Now this is interesting!
I just noticed that exceptions in my MVC Views have line-numbers in the stack trace! Which means - my views are compiled with PDB.
I looked at the "Temporary ASP.NET Files" folder on my server - and yes, there are PDB files for every view.
I have <compilation debug="false"/>
in my web.config.
Why is this happening and how do I disable that? This is the production server, so I would like to disable the pdb-generation.
I checked my "web.config", "Views/web.config", "machine.config", default "web.config" in windir%\Microsoft.NET\Framework64\[version]\config\
- I think I haven't found any suspicious compiler options there... Where do I look?
Or am I just wasting my time and this is the default option that cannot be changed?
PS. More info, just in case: this is an MVC 4 app, the Views are written in Razor.
Found it!!
Seems like this is the default setting for Razor - it is always compiled with DEBUG option and you can't change it - but I think I found the solution.
Adding this to your machine.config seem to fix the issue:
<configuration>
<system.web>
<deployment retail="true"/>
<system.web>
</configuration>
At least I don't see any more .pdb's in my "Temp ASP.NET Files".
More info about this flag on ScottGu's blog: http://weblogs.asp.net/scottgu/Don_1920_t-run-production-ASP.NET-Applications-with-debug_3D001D20_true_1D20_-enabled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With