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?.

32,989 views

ruslany on April 23rd 2010 in URLRewrite

PoorFairAverageGoodExcellent (9 votes, average: 4.89 out of 5)

28 Responses to “Visual Studio XML IntelliSense for URL Rewrite 2.0”

  1. Gravatar ImageVisual Studio IntelliSense for URL Rewrite - Scott Forsyth's Blog responded on 04 Jun 2010 at 2:54 pm #

    [...] 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 [...]

  2. Gravatar Imagejohn responded on 13 Jun 2010 at 10:20 am #

    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”

    ?

  3. Gravatar ImageAbdul Rauf responded on 21 Jun 2010 at 3:56 am #

    Its not working for me in VS2010

  4. Gravatar Imageruslany responded on 24 Jun 2010 at 5:20 pm #

    @Abdul: Try the workaround described here

  5. Gravatar Imagejohn responded on 21 Sep 2010 at 9:43 am #

    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

  6. Gravatar Imageruslany responded on 21 Sep 2010 at 11:19 am #

    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.

  7. Gravatar ImageRuben responded on 30 Jan 2011 at 3:21 am #

    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 :)

  8. Gravatar ImageTylor responded on 09 Feb 2011 at 4:31 am #

    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.

  9. Gravatar Imageruslany responded on 09 Feb 2011 at 11:11 pm #

    Hi Tylor,

    Here are the examples of some of the most used rewrite rules.

  10. Gravatar ImageAhmed responded on 07 Apr 2011 at 10:21 am #

    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”

  11. Gravatar Imagesetiri responded on 18 Apr 2011 at 7:39 am #

    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.

  12. Gravatar Imageruslany responded on 18 Apr 2011 at 11:28 pm #

    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.

  13. Gravatar ImageURL-Rewrite-User responded on 11 Aug 2011 at 9:17 am #

    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

  14. Gravatar ImagePrathamesh responded on 05 Nov 2011 at 9:14 pm #

    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

  15. Gravatar ImagePrathamesh responded on 05 Nov 2011 at 9:15 pm #

    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

  16. Gravatar ImageLanceR responded on 30 Nov 2011 at 3:26 pm #

    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’

  17. Gravatar ImageRichard Bos responded on 23 Feb 2012 at 1:13 am #

    Thumbs up!

  18. Gravatar ImageJohan Persson responded on 26 Apr 2012 at 7:17 am #

    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?

  19. Gravatar ImageJohan Persson responded on 26 Apr 2012 at 7:30 am #

    I got it working! Apparently my first cmd-window was not running as Administrator. When it did, it worked.

    Thanks ruslany!

  20. Gravatar ImageRicardo responded on 25 Aug 2012 at 5:18 am #

    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

  21. Gravatar Imageglat responded on 29 Aug 2012 at 11:59 pm #

    Can you make it work on VS2012 RTM ?

    Thanks

  22. Gravatar ImageSalman responded on 12 Nov 2012 at 11:03 pm #

    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.

  23. Gravatar ImageMichal A. Valášek responded on 17 Jan 2013 at 12:43 pm #

    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

  24. Gravatar ImageNick responded on 08 Mar 2013 at 11:55 pm #

    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.

  25. Gravatar ImageRob van Meeuwen responded on 11 Apr 2013 at 3:02 am #

    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

  26. Gravatar ImageKdefduf responded on 18 Apr 2013 at 12:02 pm #

    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!

  27. Gravatar ImageLeandro responded on 02 Oct 2013 at 10:31 am #

    Wonderfull. Works perfectly. Thanks.

  28. Gravatar ImageAlexander responded on 24 May 2014 at 4:54 pm #

    Как бороться с этим гавном:

    make sure that the script is run in the elevated command prompt
    ?

    Я администратор на Windows 7, а ваш скрипт не запускается. Что делать ?

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