Visual Studio XML IntelliSense for URL Rewrite 1.1

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:

VS IntelliSense for URL Rewrite

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:

cd \rewrite_intellisense

Replace the path if you unpacked the files into a different location

cscript UpdateSchemaCache.js

You should see the output as below:

Run the UpdateSchemaCache.js

Check that the XML IntelliSense in Visual Studio XML editor works now:

 Intellisense for URL Rewrite Configuration in Visual Studio

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

1,893 views

ruslany on August 13th 2009 in URLRewrite

PoorFairAverageGoodExcellent (3 votes, average: 5.00 out of 5)

5 Responses to “Visual Studio XML IntelliSense for URL Rewrite 1.1”

  1. Gravatar ImageDotNetShoutout responded on 18 Aug 2009 at 8:43 am #

    Visual Studio XML IntelliSense for URL Rewrite 1.1 | RuslanY Blog…

    Thank you for submitting this cool story – Trackback from DotNetShoutout…

  2. Gravatar ImageGene responded on 20 Oct 2009 at 1:54 pm #

    The same issue exists in Visual Studio 2010, but after running the script, no love. Is there an updated version for VS 2010?

  3. Gravatar Imageruslany responded on 20 Oct 2009 at 7:10 pm #

    @Gene: This is be because the XML schema cache is located in a different location in VS2010. Can you open the UpdateSchemaCache.js and replace this line:

    var vs9CommonTools = shell.ExpandEnvironmentStrings( “%VS90COMNTOOLS%” );

    with this line:

    var vs9CommonTools = shell.ExpandEnvironmentStrings( “%VS100COMNTOOLS%” );

    After that try running the script and see if that helps.

  4. Gravatar ImageDavid responded on 28 Jan 2010 at 8:02 am #

    The download link doesn’t work for the schema file. Do you have an updated schema for version 2?

  5. Gravatar Imageruslany responded on 28 Jan 2010 at 10:06 am #

    @David: The links should work now. There was some glitch in the WP download plugin.

    I do not yet have a schema for v2.0. I will try to provide it sometime soon.

Trackback URI | Comments RSS

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

XML Markup: If You want to add XML code to the comment please XML encode it first, otherwise the code will not show up.

Recently Published Articles