문제

I want to put an comment in web.config file, something like this:

<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
  />

Is there any way to put comments in this way, using server-side comments like <% %> or something?

도움이 되었습니까?

해결책

The web.config file is an XML file, so your only option is to use XML comments:

<!--
   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"      
/>

다른 팁

you could comment any section of web.config to see how to do that !

anyways

<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-->
  />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top