Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web.config: put an comment inside xml attributes

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?

like image 685
stacker Avatar asked May 16 '10 07:05

stacker


People also ask

How do I configure comments in XML?

Right click and select "Block Comment".

How do you comment in web config?

On some Button click,after it modified like :or any where in the web. config file commnets should be added or in any commented part text should be added.

How do I write comments in config file?

To enter comments in a configuration file, use a comment character and enter the comment text anywhere to the right of the comment character on the same line. Valid comment characters are a semicolon (;), a pound sign (#), or two hyphens (--). You can start comments in any column of a separate line.

How do I comment multiple lines in web config?

ctl K + C combination to comment that line... to uncomment ctl K + U combination is used.


1 Answers

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"      
/>
like image 182
Oded Avatar answered Sep 21 '22 02:09

Oded