0

What's the difference between:

  • <compilation debug="true" /> (the default VS 2013 web.config in debug mode)
  • <compilation debug="false" />
  • <compilation /> (the default VS 2013 web.config in release mode)

The bundling and minification now is always turned on by BundleTable.EnableOptimizations = true; so I'm wondering why the usage of this element and why the false value is not the default in release mode.

Max Bündchen
  • 1,283
  • 17
  • 38

1 Answers1

1

Without listing all the things it does, lets just say it does a lot. Of significance, disabling debug turns on browser caching of generated script resources and some other things you may not want cached. Also, if an exception occurs it won't display the file name, function name and line number of the file in your source. Debug=false SHOULD be set once you deploy your project to a staging server or QA server but it should be debug=true on your own machine for development lest you run into confusing problems about why changes that you make don't see to be reflected in the running web site etc (caching) or where exactly an error/exception happened in your code. Here is a link that goes into deeper details on what debug=true does: debug=true in web.config = BAD thing?

Community
  • 1
  • 1
Michael Urvan
  • 492
  • 3
  • 8
  • Is it save to leave the VS 2013 default (no debug value) and assume it's equal to debug="false"? – Max Bündchen Jul 16 '14 at 20:17
  • Yes its default is false, but each page can still enable debug individually. Here are the "compilation" section defaults: [compilation element (ASP.NET settings schema)](http://msdn.microsoft.com/en-us/library/s10awwz0%28v=vs.100%29.aspx) – Michael Urvan Jan 02 '15 at 15:53