customErrors mode=“Off” in web.config but still Server Error in ‘/’ Application - asp.net

I deployed an asp.net website to a shared server.....
I got the 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.
Here is my page http://static3.nextgenits.com/Forms/Homepage.aspx
What am i missing ?... Any suggestion...

Your application's web.config is not configured to show the error messages remotely. You will have to edit your web.config and un-comment the customErrors section. Also make sure you set it to RemoteOnly . Once you do this you will see the actual error on the screen and then you can correct it accordingly. Here is the web.config section to be used:
<customErrors mode="RemoteOnly"/>

Set it to debug="true" and you will see the error. Or browse it from the local machine if thats possible. I would also recommend you use something like elmah to log errors in your application. Then you will always be able to see the error when you have your custom error pages set.
The reason you get the message is because you have some other error that asp.net doesn't want to display in release mode as it might contain sensitive information that you don't want the end use to see.

Maybe a typo in your web.config preventing asp.net to eval. customErrors section.
EDIT:
Bit more clear. If there is an error in the web.config (it's an XML File) then ASP.NET isn't able to parse that file. This is an error. As asp.net can't parse the web.config it ignores any settings.

Related

Runtime Error don't know at ALL what to do i have no experience with these things

Who can help me with this?? I don't know what the hell to do at all. From begining to end I don't even know how to create a tag or nothing. help me? asap this is how it looks:
Server Error in '/HRX' 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 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".
Server Error in '/HRX' 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>
If you have remote access to the server then try to browse the page on the server locally.
Otherwise try to set customerrors mode to "Off" and deploy it.
<customErrors mode="Off"/>
If you do either way you will hopefully see a Exception StackTrace instead. That will probably give you a better clue of what that is wrong.
In addition to what others have said, it helps to install some sort of error handling capabilities. For a nearly plug and play solution, look into ELMAH (which can be installed easily with NUGET). This keeps a database of all the unhandled exceptions in your ASP.NET site and can even email you the error details when a problem is encountered.
Also, you'll want to set up a custom error page that explains to your users an unexpected error has occurred. This looks much more professional.

ASP.net Custom error page redirect fails when error occurs in webservice?

We have custom error page for a webservice. The custom error page is displayed properly in test environment. The same fails in production environment, a 'Runtime Error' page displays showing how to setup CustomErrors.
I have the following pieace of code in Web.config:
<customErrors mode="RemoteOnly" defaultRedirect="WebServiceError.aspx"/>
I have the following code in webserviceerror.aspx
Response.ContentType = "text/xml";
Response.Write("<?xml version='1.0' encoding='ISO-8859-1'?>");
Response.Write("<WebServiceError>");
Response.Write("<ErrorCode>9999</ErrorCode>");
Response.Write("<ErrorDescription>Errore Tecnico</ErrorDescription>");
Response.Write("</WebServiceError>");
1) i am able to open WebServiceError.aspx without any issues from browser.
2) i have tried with a html file WebServiceError.html , this also fails
3)i have tried mentioning absoulte and relative paths for refering webserviceerror.aspx in web.config
4) I have checked that the web.config file is proper and not having any issues.
I have been not able to find the solution for long time now, Please Help.
Thanks in advance,
Pradeep
A few points that come to mind:
You should always include the path to your error page in the <customErrors> tag.
<customErrors mode="RemoteOnly" defaultRedirect="/myErrorPageFolder/WebServiceError.aspx">
The mode="RemoteOnly" attribute tells IIS that you only want to see the custom error pages when requesting the page from a machine other than the one that is hosting the site. If you're running the browser and web server on the same box (typical when debugging using the VS web server or a local IIS instance), you won't see your custom error page.
If there are any errors in your webServiceError.aspx, it won't work correctly.
How are you calling the web service? Have you tried looking at the request and response in Fiddler?

Server Error in '/' Application. ASP.NET

Greeting,
I developed a website using ASP.Net 3.5 and C#. It is working good with Visual Stdio 2010.
I uploaded my website to my domain under the public folder.
First time I lunched my website for testing (http://wecoders.com/Habib_cuizine/Gallery.aspx)
I would revive (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
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>
To fix this error I added to the webConfig file inside tag:
> <customErrors mode="Off"/>
After that when I lunch the website I would receive a new error as listed bellow:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: 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.
Source Error:
Line 35: ASP.NET to identify an incoming user.
Line 36: -->
Line 37: <authentication mode="Windows" />
Line 38: <!--
Line 39: The section enables configuration
Source File: \10.0.40.35\wecoders.com\public\habib_cuizine\web.config Line: 37
Please advice how to fix this error and how configure my website which developed using Visual Stdio 2010 to be published in the internet.
Regards,
The key information in this error is this line:
This error can be caused by a virtual
directory not being configured as an
application in IIS.
In IIS, you can have several applications, but they must be configured as an application. Generally, when you create a web project it maps directly to an IIS application.
Check with your hosting service on how to create an IIS application for your web app.
Edit - added
If this is on your server, you can set this up yourself following the instructions in #Frazell Thomas's answer. He beat me to finding that link. To save yourself some reading, you should be able to focus in on the Creating Virtual Directories and Local Web Sites section.
right-click virtual directory (e.g. MyVirtualDirectory)
click convert to application.
Have you configured the virtual directory as an ASP.NET application for the right framework version?
See IIS Setup
Look at these two excerpts:
I uploaded my website to my domain under the public folder.
and
This error can be caused by a virtual directory not being configured as an application in IIS.
It's pretty clear to me that you did exactly what you said you did, and no more, i.e. you transfered the files to the web server, but nothing else. You need to configure that public folder as a virtual directory in IIS as the error is telling you, or it's just not going to work.
Looks like you have <authentication mode="Windows" /> in your web.config file but your hosting provider won't let you use that. Just remove that line.
I got the same problem and my solution was to remove webconfig file from the directory.. then it works..
http://www.velocityreviews.com/forums/t123353-configuration-error.html
If you want to use inetpub/wwwroot/aspnet as your application, remove this
line :
Line 26:
and any other lines which define MachineToApplication beyond application
level
If you want to use d:\inetpub\wwwroot\aspnet\begin\chapter02\ as your
application,
create an IIS Application which points to
d:\inetpub\wwwroot\aspnet\begin\chapter02\
maybe you can refer link above.
For my application, my web.config store in d:\inetpub\wwwroot\aspnet\begin\chapter02\
and when i move the web.config to d:\inetpub\wwwroot\aspnet and the problem is solve.
Please check also does your application have two web.config file.
Looks like this is a very generic message from iis.
in my case we enabled integrated security on web config but forgot to change IIS app pool identity.
Things to check -
go to event viewer on your server and check exact message.
-make sure your app pool and web config using same security(E.g Windows,integrated)
Note: this may not help every time but this might be one of the reason for above error message.
I have the same issue, my application was running on amazon vps, lately i found that bin folder had multiple copies of dll's ...
After removing those copies of dlls like entityframework(copy1).dll, errors were gone....
May be some one will get help...cheers
Removing the web.config-file from the IIS Directory Folder solves the problem.
Try removing the contents of the <compilers> tag in the web.config file. Depending on who you're hosting with, some don't allow the compiler in production.
Your application is trying to compile when it is called and their servers won't allow it.
This wont necessarily fix the problem...but it will tell you what the real problem is. Its currently trying to use a custom error page that doesn't exist.
If you add this line to Web.config (under system.web tag) it should give you the real error.
<system.web>
<!-- added line -->
<customErrors mode="Off"/>
<!-- added line -->
</system.web>
If your project is linq with Sql Database.
Then Simply Check your System Services and Start sql Server Agent Service.
Now your problem is solved.
Just check connectivity between SQL And your App (if you used SQL)

Runtime Error in asp.net?(online )

I develop a web application it is working fine in local.
When i upload the site in online through CuteFTP it is showing the error like this...
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 <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>
please help me i place the but even though it is not working it is giving same error. Thank you
Did you create a custom errors section in your web.config? See here for more details: http://msdn.microsoft.com/en-us/library/h0hfz6fc(VS.71).aspx
As the error message says you need to set this to "Off" to see errors remotely.
You could also look at the event logs on the server for clues.
If you have remote desktop access to the server you can try logging on there and connecting to localhost and see what that tells you.
"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"."
Try this and check what the error is.
If you can't, run the application from the server (using a remote desktop tool)..
If you can't, add a try catch that writes the exception to a text file.
The message says "something happened but I am not allowed to show the error. Do this to see the error". So make those changes and try again.
EDIT
Your answer to your question (by the way: it would be clearer to edit the question itself) suggests that you want to write to some directory. On your development system, that worked because then the webapp ran under your own account. On the server the webapp runs under the specified accounts.
So: find the directory where you want to write to, and give the correct account "write" rights there.

Error while deploying

I am getting the following error while deploying the web application
Server Error in '/FormRelease' 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>
Please help me !
To avoid seeing useless error messages like the one you posted, I use an errorlog database table and additional exception handlers. In general, when an exception occurs, I catch the error, write the error to the error log and then just reraise it to let the system handle it further. Then, when I receive an errorpage like this one, I can check the error log for possible exceptions.
In this case, I suspect that it's a configuration error, though. So it's likely that the system did not even manage to get inside your code or possibly the exception handling itself would fail too, simply because it can't connect to the database.
Possible causes: no access rights to the database, missing modules, invalid configuration, not enough access rights, routing errors, application not set in IIS and many, many other possibilities. To solve these errors and to prevent this happening in a production environment, always deploy to a test environment first, so you can check for any errors and other problems.
As Joel Coehoorn commented, adjust web.config first. But additionally, deploy the web application to a local, clean test environment first! Then you can more easily check any problems without disturbing the production environment. (Use a virtual machine if you can't afford a second test system.)

Resources