简体   繁体   中英

ASP.NET errors display my local develop folder?

I have a inherited asp.net project. I never had this issue in others projects,so this is completly new for me.

In my web.config, I put that the errors in customErrors mode="Off" , and any error in the app is displayed on the screen.

The problem, is that the errors, displayed my develop local directory folder, when the site is published on other server...

Exameple:

ASP.NET Error
The connection of the server it's Close.
Error in C:\Develop\myProject\file.cs\MethodName() <- ?¿

Someone know what's happening?

Thanks

The stack trace information shown when there is an error is fetched from the symbol information being produced during compilation. It is stored in the pdb-files. The symbol information refers to the location of the files during compilation. When deployed, the source .cs files are not even present on the target system, it just shows what's in the pdb.

This is completely normal behaviour and nothing to worry about.

As others have noted you should never leave customerrors off on a production server as the stack trace might reveal sensitive information.

By setting the customErrors mode="Off" will expose all exceptions thrown and exposes the errors thrown YSOD (Yellow Screen of Death)

If you want to hide these then set the option to "On" and then this will only show your custom error message/page. If you still need to see these error's then set it to RemoteOnly and this will show the YSOD on the local machine the site is deployed too but show the Custom Errors to everyone else.

As for showing your development folders this is because it is just using the information where the dll's were compiled.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM