If you ever tried to write or modify rewrite rules in web.config file by using Visual Studio 2008 XML Editor, you may have noticed that the Visual Studio XML IntelliSense does not work for all URL Rewrite Module configuration elements. This is because the XML schema for <rewrite> element is not registered in Visual Studio Schema Cache. This post provides the instructions on how to register URL Rewrite schema with Visual Studio to enable IntelliSense support.
To enable IntelliSense support for URL Rewrite 1.1 follow these steps:
Step 1: Download the URL Rewrite schema from the location below:
Disclaimer: The schema file and the helper script file contained in this package are provided by me and not by Microsoft. The are not officially supported by Microsoft. Use them at your own risk.
Step 2: Extract the content of the file to a directory of your choice, for example C:\rewrite_vsintellisense\
Step 3: Start the elevated privilege command line window by typing “cmd” in the search bar of the Windows Start Menu and then right clicking the “cmd” item in the search result and selecting “Run As Administrator”.
Step 4: In the command line window type the following:
Replace the path if you unpacked the files into a different location
You should see the output as below:
Check that the XML IntelliSense in Visual Studio XML editor works now:
In case you want to restore back the original XML schema used by Visual Studio, here is how you can do it:
cd “%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas" move DotNetConfig_beforeRewrite.xsd DotNetConfig.xsd
ruslany on August 13th 2009 in URLRewrite