Runtime Error in ASP.Net Application - asp.net

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??

Related

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)

How to modify original .net framework error page?

I want to change error page for all my websites on IIS.
How can I modify original .net framework error page for all of them at once?
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

error: the details of the application error from being viewed remotely

I have 2 login pages: Login.aspx-for customer login and xlogin.aspx for admin login
i just uploaded my project to the server and all application pages works great
but when i log in the admin xlogin.aspx i'm being forwarded to the admin.aspx page - but i get this error:
Server Error in '/' Application.
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 <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> 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 <customErrors> 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>
This is my web.config
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<clear/>
<add name="PROJEntities" connectionString="metadata=res://*/PROJModel.csdl|res://*/PROJModel.ssdl|res://*/PROJModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=000.000.0.00;Initial Catalog=DBNAME;User ID=MYUSERNAME;Password=MYPASS;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="720" slidingExpiration="true" defaultUrl="~/Gateway.ashx"/>
</authentication>
<customErrors mode="Off"/>
<pages enableEventValidation="false" viewStateEncryptionMode="Never"></pages>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization>
<converters>
<add type="PROJ.Presentation.Common.DateTimeConverter" name="DateTimeJavaScriptConverter"/>
</converters>
</jsonSerialization>
</webServices>
</scripting>
</system.web.extensions>
</configuration>
Dear olga is clear what the message says. Turn off the custom errors to see the details about this error for fix it, and then you close them back. So add mode="off" as:
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Relative answer:
Deploying website: 500 - Internal server error
By the way: The error message declare that the web.config is not the one you type it here. Maybe you have forget to upload your web.config ? And remember to close the debug flag on the web.config that you use for online pages.
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".
This can be the message you receive even when custom errors is turned off in web.config file. It can mean you have run out of free space on the drive that hosts the application. Clean your log files if you have no other space to gain on the drive.
In my case I got this message because there's a special char (&) in my connectionstring, remove it then everything's good.
Cheers

ASP.net Server Error in '/' Application

I've had users consistently getting this error on our homepage:
Server Error in '/' Application.
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 <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> 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 <customErrors> 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>
I can't reproduce this error at all live or on my dev server. However, in my web.config file I beleive I do have the error code setup correctly:
<customErrors mode="On" defaultRedirect="~/error.aspx" redirectMode="ResponseRewrite">
<error statusCode="500" redirect="~/error.aspx" />
</customErrors>
All other errors on the site seem to direct to error.aspx just fine, does anyone have any idea why this error would be occurring and how I can catch it?
You should look in your Application Log in the Event Viewer to see what the actual error message is. Once you find the error message - you can determine why it is not redirecting.
Another option (albeit dangerous for public sites) is to change the error handler to display the actual error message with stack trace so you can troubleshoot the problem (customErrors mode='Off'). The users could then deliver the actual error to you instead of the generic error page above.
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>

error when configured application in IIS

This is my web.config file...
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
</authentication>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
When i trying to host my application getting error..
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Thanks
check that app pool is set up with asp.net 4.0
make sure the website (or virtual directory) in IIS is an application, and not just a folder; right-click will give you related options

Resources