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:
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
27,837 views
ruslany on August 13th 2009 in URLRewrite



(9 votes, average: 4.67 out of 5)
Visual Studio XML IntelliSense for URL Rewrite 1.1 | RuslanY Blog…
Thank you for submitting this cool story – Trackback from DotNetShoutout…
The same issue exists in Visual Studio 2010, but after running the script, no love. Is there an updated version for VS 2010?
@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.
The download link doesn’t work for the schema file. Do you have an updated schema for version 2?
@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.
Any news for v2.0 schema?
Visual Studio XML IntelliSense for URL Rewrite 2.0…
Last year I published an XML schema for URL Rewrite 1.1 that could be used to enable IntelliSense support when editing rewrite rules in Visual Studio XML editor. Now that the URL Rewrite 2.0 has been released, the old schema will not work for the the n…
@Barbaros: use the link in the trackback above to get the schema for v2.0.
[...] has released a Visual Studio schema update for URL Rewrite which is available as a free quick download. Contrary to the title of the post, the installer [...]
Thanks for posting the update js for vs 2010 install. Works great. Thanks.
I had to add the node to DotNetConfig35.xsd instead of DotNetConfig.xsd on VS 2010 and .net 4
thank you…This worked great for both VS2008 and vs2010
Great stuff!
I also added the “logRewrittenUrl” attribute to the XSD. I just copied the “appendQueryString” and changed the name.
[The xml code has been removed because it was not XML encoded]It needs to appear twice, once for globalRules and once for rules elements.
Cheers
RuslanY – Thanks for providing the solution to this, especially the comment about how to tweak the file for VS2010. You’re awesome!
-Ron
Great job, worked for 2008 and 2010, thanks
Thank goodness that 9h0s7 put down the comment that it should be added to DotNetConfig35.xsd for VS10 and .NET Framework 4. Otherwise, this solution would have been no solution at all for me.
Before you run the script, make sure that your windows environment variables has…
VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
To view your envionment variables, open a command prompt and type the command “SET”
It worked like a charm in VS2010 after updating the “90″ to “100″ in the javascript. Thanks!
The things we do to get rid of a squiggly line…
Got it working in VS2012. First change “90″ to “110″ in the javascript. Then add “1033\” to the end of the path where it is assigning the dotNetSchemaDir variable. On my computer, the file that should be affected was in the C:Program Files (x86)Microsoft Visual Studio 11.0XmlSchemas1033 folder.
worked like a charm, thanks
Successfully added 2.0 to VS2012, I can browse dotnetconfig.xsd and rewrite is there, but VS still remarks invalid child element, even after restart. Any suggestions?
TIA,
Bill
I found I needed to add it to DotNetConfig40.xsd in
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Xml\Schemas
This was using VS 2012 on a ASP.NET 4.0 site.
i encountered with the following error when trying to run the script in cmd.
“Failed to open file Xml\Schemas\DotNetConfig.xsd. Make sure that the script is run in the elevated command prompt.”
im running cmd in admin mode.
im using VS2008
@supriya salunkhe: Do the step described by the Brant Burnett (on 19 Oct 2012 at 11:40 am). After run the js command
I just updated this on VS2010 as the lack of intellisense had been p*ssing me off for ages. However the rewrite node doesn’t support xdt:transform so I’m back in the same position
Thanks for the comment Dominic Turner, I was about to give up on this solution.
Hi,
Great post, I used the 2.0 version with success on VS2012. Thanks to updated js script by Michal A. Valášek.
I put it together for the VS2012 folks: http://blog.vanmeeuwen-online.nl/2013/04/visual-studio-2012-xml-intellisense-for.html