我想在web.config
文件中添加评论,如下所示:
<httpRuntime
requestValidationMode="2.0" // require for [ValidateInput(false)] in .net-4.0
requestPathInvalidCharacters="" // include & character in the url
enableVersionHeader="false" // disable X-AspNet-Version header
/>
是否可以使用
<% %>
之类的服务器端注释以这种方式添加注释?
最佳答案
web.config
文件是XML文件,因此您唯一的选择是使用XML注释:
<!--
requestValidationMode="2.0" - require for [ValidateInput(false)] in .net-4.0
requestPathInvalidCharacters="" - include & character in the url
enableVersionHeader="false" - disable X-AspNet-Version header
-->
<httpRuntime
requestValidationMode="2.0"
requestPathInvalidCharacters=""
enableVersionHeader="false"
/>
关于asp.net - Web.config:在xml属性中添加注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2842850/