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 new configuration elements introduced in the v2.0. Use the link below to download the schema for URL Rewrite 2.0:
VS IntelliSense for URL Rewrite 2.0
Disclaimer: The schema file and the helper script file contained in this package are provided by me and not by Microsoft. They are not officially supported by Microsoft. Use them at your own risk.
Follow the same instructions as in Visual Studio XML IntelliSense for URL Rewrite 1.1 to add the schema to the Visual Studio schema cache. If after following the instructions the IntelliSense does not work then follow the instructions at Not getting IntelliSense in your web.config for system.webServer sections in Visual Studio 2008?.
17,801 views
ruslany on April 23rd 2010 in URLRewrite

(9 votes, average: 4.89 out of 5)
[...] has released a Visual Studio schema update for URL Rewrite 2.0 which is available as a free quick download. The installation instructions (they are quick [...]
Hi Ruslan: I tried running the intellisense script, after changing the path from “90″ to “100″ in the js:
var vs9CommonTools = shell.ExpandEnvironmentStrings( “%VS100COMNTOOLS%” );
but when I run the cscript command I see:
Input Error: There is no script engine for file extension “.js”
?
Its not working for me in VS2010
@Abdul: Try the workaround described here
Hi Ruslan: Just coming back to this after awhile…I downloaded the v2 script, updated the “vs9″ var to point to “%VS100COMNTOOLS%” and I’m still getting the error:
C:\Users\joe\Downloads\rewrite2_vsintellisense>cscript UpdateSchemaCache.js
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Input Error: There is no script engine for file extension “.js”.
This is on Windows 7 Pro with VS2010 and .NET 4 installed
Hi John,
I remember that I had run into the same error some time ago while working on a completely different project. I think I tried the workaround described here and it helped.
Thank you, Ruslan, worked like a charm (after switching the VS version).
Only thing I’m wondering about is why my DotNetConfig.xsd after rewrite is so much smaller than the one before?! Everything seems to be working fine, I was just curious
Hi ruslany,
I am trying to rewrite the URL, I installed URL Rewrite 2.0 and VS IntelliSense for URL Rewrite 2.0. Now rewrite tag is coming in web.config. but i am uable to add rule for URL rewrite.Can you give me live exampr how to add rewrite rule in web.config.
I installed these URL Rewrite 2.0 and VS IntelliSense for URL Rewrite 2.0, if anything esle nedd to be install than let me know.
Hi Tylor,
Here are the examples of some of the most used rewrite rules.
Thank you, Ruslan but i am getting an error when running csscript UpdateSchemaCache.js it says : “Failed to open the file Xml\Schemas\DotNetConfig.xsd”
wow so ms really hasnt addressed this? I don’t know if anyone is trying to compile and publish their web apps, but mine fails compile due to this. so it’s not just an annoyance, i actually have to remove (comment out) the rewrite rules when I compile. this is an argh.
Hi Setiri, is this on VS 2010? I have not heard that the rewrite rules would cause the problems with compilation. Will try it out to check what’s going on.
This schema doesn’t include configSource for rules. I’m trying to follow http://stackoverflow.com/questions/4922690/visual-studio-2008-problem-on-web-config-synthax-highlighter to fix the schema. Can you provide direction on the right place to add the attribute?
Thanks
Visual Studio XML IntelliSense for URL Rewrite 2.0 through command prompte
but it not working …its shows Failed to open file XML\Schema\DotNetConfig.xsd Make sure that the script run in elevated command prompte.
i m using Windows 7 Ultimate edition
Visual Studio XML IntelliSense for URL Rewrite 2.0 through command prompte
but it not working …its shows Failed to open file XML\Schema\DotNetConfig.xsd Make sure that the script run in elevated command prompte.
i m using Windows 7 Ultimate edition
and visual studio 2010 Ultimate edition
Did you run the cmd with elevatd priviledges?
Click start button, then type cmd in the search box. Under the Programs section of the list, right click on cmd.exe and click ‘Run as Administrator’
Thumbs up!
Can’t get it to work!
1. Changed “%VS90COMNTOOLS%” to “%VS100COMNTOOLS%”
2. Ran cscript UpdateSchemaCache.js as Administrator
3. Everything seemed to work ok, but I can’t get it to work.
Visual Studio 2010 complains about in my web.config file.
Any ideas?
I got it working! Apparently my first cmd-window was not running as Administrator. When it did, it worked.
Thanks ruslany!
Hi,
Should i change:
var vs9CommonTools = shell.ExpandEnvironmentStrings( “%VS90COMNTOOLS%” );
to:
var vs9CommonTools = shell.ExpandEnvironmentStrings( “%VS110COMNTOOLS%” ); for VS2012
Got it to work fine for VS2010 by making the “90″ to “100″ change in the .js file. But it’s not working in VS2012. Please help..Thanks
Can you make it work on VS2012 RTM ?
Thanks
I am writing a script that allows me to “generate” the rules section for web.config. I am familiar with mod_rewrite by the way.
The problem I am having is that I do not know the default values for optional parameters. E.g. in mod_rewrite the default matching behavior is case-sensitive and it took me a while to figure out that I have to explicitly specify ignoreCase=”false” to achieve equivalent result.
My question is where do I find a documentation for URL rewrite which specified the default value/behavior for attributes.
I updated RuslanY’s setup script to work with Visual Studio 2012 RTM and .NET versions 3.5, 4.0 and 4.5.
Its source code can be found at http://pastebin.com/8GGGHTBL
I really wish you would post a webconfig example that shows where in the config this belongs. I’ve googled 10 different ways and don’t understand under what elements this belongs. You can’t simply just throw it anywhere of course.
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
Used Michal A. Valášek updated version of UpdateSchemaCache.js and it worked for Visual Studio 2012 Ultimate. Now I have Intellisense for the Rewrite module. Thank you!