Disabling Debug Mode and Tracing in your ASP.NET applications

To improve the performance of our ASP.NET application, a recommended practice is to make sure that the application is not deployed with Debug=True attribute.

One of my clients had a production server which hosted multiple websites. Although some of the applications were deployed keeping debug=false, however the rest of the applications had the attribute set to true. They now wanted to control the setting from the machine.config file which would apply to all the applications running on that server.

Here’s a technique that most of the users to not know about. In your machine.config, locate the <system.web> section and add the following entry

<deployment retail=“true”/>

That’s it. Now this setting will automatically disable the debug mode and tracing on your applications.






About The Author

Suprotim Agarwal
Suprotim Agarwal, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

1 comment:

Anonymous said...

Do you have any knowledge if setting retail = true in machine.config will show debugging as false (regardless of compile setting in web.config)

HttpContext.Current.IsDebuggingEnabled

I have seen some posts indicating this is an issue but nothing definitive.