Reputation: 9870
In Pro ASP.NET MVC5 it says you need to set <compilation debug="false"/>
in the <system.web>
section of Web.config
if you are deploying to production.
Why is this?
What would happen if you left debug="true"
in production?
Upvotes: 1
Views: 1386
Reputation: 458
Debug mode causes ASP.NET to compile applications with extra information that enables a debugger to closely monitor and control the execution of an application. Applications that are compiled in debug mode execute as expected. However, the performance of the application is affected. To avoid the effect on performance, it is a good idea to enable debugging only when a developer is doing interactive troubleshooting. By default, debugging is disabled, and although debugging is frequently enabled to troubleshoot a problem, it is also frequently not disabled again after the problem is resolved.
1) The compilation of ASP.NET pages takes longer (since some batch optimizations are disabled)
2) The code can execute more slowly (since some additional debug paths are enabled)
3) Much more memory is used within the application at runtime
4) Scripts and images downloaded from the WebResources.axd handler are not cached
Upvotes: 2