Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception shows developer's path instead of servers

When an exception occurs with any ASP.NET project (possibly any .net app) the stack trace will show the path on the developer's machine, even when in production.

How to change it?

What's going on under the hood?

like image 869
user1231231412 Avatar asked Jan 17 '12 18:01

user1231231412


2 Answers

This information is stored inside the .PDB files that were generated during the compilation of the source code. They contain the debugging information. But normally people don't compile applications on their machines before shipping them into production. They use continuous integration and build servers that are dedicated for this purpose.

Now if you want to turn off debugging details you could configure the level of verbosity and debug info in the properties of your project.

like image 93
Darin Dimitrov Avatar answered Oct 19 '22 07:10

Darin Dimitrov


In order to remove it, go to Properties -> Package/Publish Web:

enter image description here

Make sure to click or check the "Exclude generated debug symbols".

This will Publish your site without PDB files attached on the Bin folder. Make sure you are on Release mode before publishing your site for Live environment. One of the main difference of publishing your site without PDB files is that you cannot see the line number on the StackTrace when an error happens on your site.

like image 25
Willy David Jr Avatar answered Oct 19 '22 06:10

Willy David Jr