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

孤街醉人 提交于 2019-12-21 03:23:22

问题


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.


回答1:


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.




回答2:


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.

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.




回答3:


The Default value will be false.

Here is a link to MSDN about the compilation tag for web.config.




回答4:


The default is false as described by previous answers.

If debug=true is specified in Machine.config, every web app's web.config will inherit it and it will be treated as default then.



来源:https://stackoverflow.com/questions/12114734/asp-net-web-config-what-is-the-default-for-the-debug-attribute-in-system-web-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!