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.

Will you give this article a +1 ? Thanks in advance

About The Author

Suprotim Agarwal
Suprotim Agarwal, ASP.NET Architecture MVP (Microsoft Most Valuable Professional) works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He is the Editor of a Developer Magazine called DNC Magazine. He has also written two EBooks 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)


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