44

When I try to change the ASP.NET version to v4 on IIS 6, I receive the following warning:

Changing the Framework version requires a restart of the W3SVC service. Alternatively, you can change the Framework version without restarting the W3SVC service by running: aspnet_regiis.exe -norestart -s IIS-Viirtual-Path

Do you want to continue (this will change the Framework version and restart the W3SVC service)?

How do I work out IIS-Virtual-Path?

I have tried the obvious paths i.e.:

aspnet_regiis.exe -norestart -s "/WebSites/Extranet/AppName"

Where WebSites is the name of the folder in IIS, Extranet the name of the root app and AppName the name of the Virtual Directory application I am trying to change.

Thanks!

Edit:

How do I work out the virtual path for the Auth virtual directory in following IIS6 setup:

alt text
(source: imgbag.com)

I have tried:

aspnet_regiis.exe -norestart -s "/Web Sites/Extranet/Auth"

aspnet_regiis.exe -norestart -s "Auth"

I get:

Installation stopped because the specified path (WhateverIPutIn) is invalid.

2
  • So "Virtual Path" is not "Virtual Directory"? Im confused and hiding behind the sofa. Nov 26, 2009 at 15:35
  • Yup - as you saw below, "Virtual Path" is an IIS special path that looks rather formalised
    – joshcomley
    Nov 26, 2009 at 16:29

6 Answers 6

71

I solved it. I had to use:

aspnet_regiis -lk to get a list of the folders in "IIS" format

Then I do something like:

aspnet_regiis.exe -norestart -s "W3SVC/1234567/root/AppName"

4
  • 2
    +1 as is often the way, you work it out youself in the end :) Nov 26, 2009 at 15:43
  • +1 Have a lot of apps on mutliple servers; this saved my butt!
    – tahdhaze09
    Jul 18, 2013 at 13:32
  • this is the best way, but I'm facing a problem because this command does not give me all the virtual paths =( Any idea?
    – Gelásio
    Aug 29, 2013 at 12:37
  • Note that the -s flag is recursive. Use -sn to only target a single site such as a virtual directory.
    – jason
    Dec 11, 2013 at 21:36
29

My problem running aspnet_regiis -lk was that I got an incomplete list of IDs and also I didn't know which ID corresponded to the Website i wanted to work on.

An easier way to find the IDs for your websites is by clicking on the "Website" node (folder) in IIS as in this picture. On the right side you should see a list of all websites with their "Identifier"s, State, IPs and ports.

Image showing IDs

1
  • That picture... was the most helpful thing ever. Thank you. Feb 14, 2012 at 21:07
13

Here's a good summary

W3SVC/ + [Site Identifier from IIS Console] + /root

for example W3SVC/1234567/root

To find the Identifier

Click on the Websites node (folder) in IIS.
On the right hand side is a list of all websites with their Identifiers, State, IPs and ports.

Now all together

aspnet_regiis.exe -norestart -s "W3SVC/1234567/root"

Finally

Add of the virtual directory to the end W3SVC/1234567/root/APPNAME if you need to

4

I think your need to use a path starting with /W3SVC. Maybe this article can help you further.

0
3

To change Framework version without restarting W3SVC: Run aspnet_regiis.exe -norestart -s IIS-Virtual-Path

aspnet_regiis.exe should be run from %SystemRoot%\Microsoft.NET\Framework(required dotnet version) eg C:\WindowsMicrosoft.NET\Framework\v4.0.30319

IIS-Virtual-Path is: W3SVC/(WebsiteID)/root[/AppName] Where (WebsiteID) is the identifier as listed in IIS (see Diego C's image above) and [/appname] is an optional virtual directory below your website. (eg W3SVC/1234567890/root/dotnetnuke)

  1. Open a command prompt
  2. Navigate (CD) to C:\WindowsMicrosoft.NET\Framework\v4.0.30319
  3. Execute aspnet_regiis.exe -norestart -s “W3SVC/1234567890/root/dotnetnuke”
1

I was able to follow the advice according to joshcomley's post here, but had to get the name of the virtual path from the generated XML file. You can use IIS's export site config to a file (xml file). Inside, there are a few tags that look like this:

 <IIsWebVirtualDir   Location ="/LM/W3SVC/2070355274/root" 

Just pick the first one that ending with "root".

that worked great.

(tried, but cant post image here)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.