how do I know what version of IIS7 URL Rewrite module is installed

blkbam picture blkbam · Aug 5, 2012 · Viewed 20.5k times · Source

I created a rewrite rule in IIS7 that uses the trackAllCaptures="false" attribute in the conditions element and uses outboundRules. All works fine on my test system however when I deploy these rules to GoDaddy I get the error:

Unrecognized attribute 'trackAllCaptures' 

And if I include the outboundRules node I get a 500 error from the server. I spoke with their support and they insist that they have support for the 2.0 version of the URL Rewrite module. My question is how do I verify or communicate to them how to check the version of this module? I can't find a way anywhere short of attempting to install it on how to check the version.

I'm attempting to rewrite URL's for an ASP.Net application not WordPress in order to remove the sub-folder from the URL this is a very prevalent issue in their multi-domain hosting. The sample I am using is located here: http://weblogs.asp.net/owscott/archive/2010/05/26/url-rewrite-multiple-domains-under-one-site-part-ii.aspx

Answer

Kev picture Kev · Aug 5, 2012

The binary for Url Rewrite is located at:

%SystemRoot%\system32\inetsrv\rewrite.dll

Url Rewrite 1.1 has a File Version of 7.1.490.43.
Url Rewrite 2.0 has a File Version of 7.1.761.0 or 7.1.871.0 (there may be others but these are the two different versions I know of).

If you don't have console access to verify the version number try running the following code in a simple web page:

Assembly a = Assembly.Load("Microsoft.Web.Iis.Rewrite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
Response.Write(a.FullName);

If UrlRewrite 2.0 is installed then you'll see something like:

Microsoft.Web.Iis.Rewrite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

If it isn't then you'll get an exception thrown:

Could not load file or assembly 'Microsoft.Web.Iis.Rewrite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

You could also point them at this documentation page:

Tracking Capture Groups Across Conditions

This paragraph makes it pretty clear that trackAllCaptures is a 2.0 specific setting and if it isn't working then 2.0 is definitely not installed:

In URL Rewrite Module 2.0, it is possible to change how capture groups are indexed. Enabling trackAllCaptures setting to on the <conditions> collection makes the capture groups form all matched conditions to be available through the back-references.