Reputation: 4759
I am building a web application. Here's what I do.
Set the solution Configuration Manager to Release. Thus all projects are building the Release version. Then I clean the solution and build all. Then I "Build Deployment Package".
When running the installed code from the deployment package I notice when there is a bug in the compiled source the source file appears! How is this possible, I am building the Release configuration. The source code is definitely not in the release so it must be in the dlls.
Is there a way to stop this?
Upvotes: 1
Views: 183
Reputation: 13673
In addition to Andrew's answer you should also check that your web.config has debug disabled:
<compilation debug="false"/>
That should prevent the source code from showing in the 'Yellow Screen of Death'.
Upvotes: 1
Reputation: 40150
Assuming you are talking about the 'Yellow Screen of Death' ASP.NET error pages, showing the source code locations of the exceptions; that is happening due to including the debug symbols in the build and the deployment package. That is the *.pdb
file(s) named the same as your *.dll
file(s).
This is not bad, in and of itself. However, you should not be displaying those errors to end-users regardless. Even without the debug symbols, those error messages show too much information. You should be handling errors and displaying a 'safe and friendly' error message to users.
If you want to remove the debug symbols, you can remove the PDB files. You can also change the build properties in the project, and remove the option that includes debug symbols.
Upvotes: 2