Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET errors display my local development folder?

Tags:

c#

asp.net

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

like image 998
amelian Avatar asked Dec 15 '22 21:12

amelian


2 Answers

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.

like image 74
Anders Abel Avatar answered Jan 09 '23 22:01

Anders Abel


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.

like image 30
David Shorthose Avatar answered Jan 09 '23 21:01

David Shorthose