Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET web.config: What is the default for the debug attribute in system.web.compilation?

If I don't include the debug attribute in the compilation element like this:

<system.web>     <compilation /> </system.web> 

Does it default to true or false? Links to sources would be appreciated.

like image 950
oscilatingcretin Avatar asked Aug 24 '12 18:08

oscilatingcretin


People also ask

What is the default value for compilation debug?

The default value is false, but beware of ASP.NET Configuration File Hierarchy and Inheritance. If you use the the IIS configuration editor, you can see the actual values. A drop down list allows you to inspect the values set at a higher level. You can see that the value of debug=true.

What is compilation debug true in Web config file?

In the Web. config file, locate the compilation element. Debugging is enabled when the debug attribute in the compilation element is set to true. Change the debug attribute to false to disable debugging for that application.


2 Answers

The default for debug attribute in the compilation is false

MSDN - compilation Element (ASP.NET Settings Schema)

debug

Optional Boolean attribute. Specifies whether to compile debug binaries rather than retail binaries. The default is False.

like image 64
Mark Avatar answered Sep 21 '22 23:09

Mark


The default value is false, but beware of ASP.NET Configuration File Hierarchy and Inheritance.

So, if in a specific web.config file you find:

<system.web>     <compilation /> </system.web> 

It may very well be that the actual value it true, if there is a web.config file at a higher level with:

<system.web>     <compilation debug="true" /> </system.web> 

If you use the the IIS configuration editor, you can see the actual values. A drop down list allows you to inspect the values set at a higher level. Configuration inheritance at work

You can see that the value of debug=true. Not because it is set in the web.config file at the application level, but at the root site level.

like image 41
R. Schreurs Avatar answered Sep 20 '22 23:09

R. Schreurs