httpRuntime targetFramework="4.5" causes 500 - Internal server error - asp.net

I am converting mvc4 project, 4.0 to 4.5
I need to add the folowing line to system.web in web config, but when I do, I get 500 - Internal server error
<httpRuntime targetFramework="4.5" />

Turns out that I was trying to add the httpRuntime, when it already existed at the end of the system.web.
To resolve the issue I did a merge:
<httpRuntime maxRequestLength="102400" executionTimeout="1200" targetFramework="4.5"/>

Related

Why would adding targetFramework="4.5" to httpRuntime in web.config make my decryption key invalid?

I've added IIS Web Sockets into my site recently. To do this I had to add the targetFramework="4.5" into the httpRuntime tag of the web.config.
Unfortunately, now when I try and log in to my site I get the following error:
Decryption key specified has invalid hex characters.
The machineKey in my web.config file is as follows:
<system.web>
<machineKey decryptionKey="513A71A2266CD92E99AA2970F18AE3F8A14DE3625BDD5792FB4AC15F9004693D,IsolateApps" validationKey="FBC9407A7ECE1C60741B44303670247CBE2E08B0658ED1031CF4A2582BDDFA4CD2E27201B083A5DF39C56C2D5B91674BD4FAB2EE644FB067D2C43633D3E6A724,IsolateApps" />
</system.web>
Does anyone know why adding targetFramework would cause this issue, and what I can do to fix it?
After looking further it appears it is the ,IsolateApps that is the issue. Before targetFramework was added, IsolateApps was fine in the machineKey, but with 4.5 added it is seen as no longer valid.
<system.web>
<machineKey decryptionKey="513A71A2266CD92E99AA2970F18AE3F8A14DE3625BDD5792FB4AC15F9004693D" validationKey="FBC9407A7ECE1C60741B44303670247CBE2E08B0658ED1031CF4A2582BDDFA4CD2E27201B083A5DF39C56C2D5B91674BD4FAB2EE644FB067D2C43633D3E6A724" />
</system.web>

ASP.NET : Error 500 instead of Detailed Error

All of a sudden i am getting a error 500 on my Asp.Net web application hosted on smarterasp.
I can access the pages but cant access any of the resources (CSS,JS,Images etc)
Here is a CSS File.
The Error : The page cannot be displayed because an internal server
error has occurred.
Even if you try accessing a resource that does not exist, it should through a 404 but instead, you will get a 500. I tried contacting the support and they said everything is fine on their end.
I already have set customErrors=off.
<system.web>
<trace enabled="false" />
<customErrors mode="Off">
</customErrors>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime requestValidationMode="2.0" />
<pages controlRenderingCompatibilityVersion="4.0" />
</system.web>
I had defined mimeMap for static contents which was working fine before in web.config but then found out StaticFileModule was already installed on the web server which was causing the problem.
(Probably they recently installed it)

increase the timeout of asp.net webservice in the apache and mono context

I want increase the timeout of asp.net webservice in the apache and mono context
but this code is not working:
<sessionState timeout="120"></sessionState>
<compilation debug="false" targetFramework="4.0" />
<httpRuntime executionTimeout="85000" />
<customErrors mode="Off"/>
Try the steps which are there in the below link:
http://www.nullskull.com/q/10111748/how-can-we-increase-the-timeout-of-a-thread-from-webconfig.aspx

Web.config page - ASP.NET 3.5 error

I have the following web.config page (My site is in ASP.NET 3.5):
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="3.0"/>
<pages validateRequest="false"/>
<httpRuntime requestValidationMode="2.0" />
</system.web>
</configuratiotn>
The problem is that there is an error under the targetFramework and the requestValidationMode.
But I get thie errors:
Unrecognized attribute 'requestValidationMode. Note that names are case-sensitive features.
Unrecognized attribute 'targetFramework. Note that names are case-sensitive features.
My question is how can I fix this error?
requestValidationMode and targetFramework are .NET 4.0+ specific, so you can't use those in an ASP.NET 3.5 project.

Runtime Error in ASP.Net Application

I am modifying a website using asp.net pages which was created using asp. In the web.config file I am using
<system.web>
<compilation debug="true" strict="false" explicit="true" tarrgetFramework="4.0"/>
<httpRuntime requestValidationMode="2.0" maxRequestLength="1048576" executionTimeout="3600" />
<customErrors mode="Off"/>
</system.web>
and also tried
<customErrors mode="RemoteOnly" defaultRedirect="error.htm"/>
But still an error occuring as
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
What is its solution??

Resources