Unable to install WBI because Default Web Site is no longer in IIS

Ran into this situation with a site installing WBI, but their Default Web Site in their IIS had been deleted a while back. For the benefit of others that may encounter this, wanted to post what happened and how it was resolved:

A. When went to install WBI, received the error:

Internal error: Expression Error 'Runtime error (at 1:661):

B. Noticed that the Default Web Site had been deleted from IIS. But WBI initially needs this there to be able to initially install itself, even if create a virtual site after.

C. Did a search online, and found this great site http://geekswithblogs.net/lorint/archive/2005/12/09/62737.aspx(want to post a link here to give all kudo’s to them) which provides two suggestions for retrieving the Default Web Site without having to reinstall IIS and potentially mess up existing web sites already installed.

**First possible solution is if you have just recently deleted, do the following: " "

  1. Right-click on the root folder in IIS where the websites exist and choose New>Website(from file…)
  2. Browse to: \WINDOWS\System32\inetsrv\History
  3. Choose the newest XML file in the list and choose “Read”
  4. If “Default Website” exists in the list, choose it and finish.

**Otherwise as outlined on that web page (see for full details)

1.First make sure that there is not a web known as W3SVC/1 as it may have just been renamed.Open a command prompt and type this: " "

cscript adsutil.vbs enum w3svc/1

If it comes up with “The path requested could not be found” thenthat meansyou don’t have a true default website anymore. If no error then check out the “ServerComment” to know which web the machine now thinks is the default as that is the default now.

2.If there is no default any longer and youwant tocontinue recreating your Default Web Site, run this to find the IDs of any other webs you do have (and you’ll need at least one): " "

cscript adsutil.vbs enum w3svc

A bunch of info will fly past. Look for the folder entries at the end, which start with square brackets. You’ll have w3svc/Info, w3svc/Filters, and hopefully at least one w3svc/### where the number is the interesting thing. If there are more than one then you can find the name of each with: " "

cscript adsutil.vbs enum w3svc/###

(Putting in the ###s that you saw in the list.) Check out the ServerComment property to know its name. Find a numbered web in the list from above that you can use as a template to copy from.

  1. Use these commands to copy this to a new web with ID 1 now that you know an ID to use as a source (i.e. to copy from): " "

cscript adsutil.vbs create_vserv W3SVC/1
cscript adsutil.vbs copy W3SVC/### W3SVC/1
cscript adsutil.vbs set w3svc/1/ServerComment “Default Web Site”

Note that with the last command there you can actually rename the new web to whatever you want to call it - but by haing it called Default Web Site than you actually know it is the actual Default Web Site. This is the name under which it will appear in the Internet Information Services MMC (aka InetMgr).

Received further solutions from another company also experiencing the error message:

Internal error: Expression error 'Runtime Error (at 1:30:1):
WBI requires Microsoft IIS
(Error ‘Invalid class string, ProgID: “IISNamespace” occured)’

Solution that resolved for them:

Found solution at http://forums.iis.net/t/1154336.aspx (all props to Leo Tang (Microsoft Online Community Support) for this)

All web sites’ information is stored under “<configuration><system.applicationHost><sites>” in the ApplicationHost.config file(%windir%\System32\InetSrv\config). Once the section of default website is corrupt, IIS manager will fail to show the default website. The ApplicationHost.config file will not be clear up/removed during IIS reinstallation. Hence, your default website seems to be missing all the time.

1.Back up both your files in the directory of “ %windir%\System32\InetSrv” and “%SYSTEMDRIVE%\inetpub”

2.Uninstall IIS

3.Uninstall Windows Process Activation Service(Server Manage->Remove features), this will remove the ApplicationHost.config file and other files in the directories mentioned in step 1.

(In my case this did not remove the config file and other files.I manually deleted the folder)

4.Reboot system, reinstall IIS

After reinstalling IIS I could see the Default Web Site created.
Core issue is that once the corruption has occurred you have to manually delete the folders

Also wanted to post details from another URL http://www.dotnetscraps.com/dotnetscraps/post/Did-you-know-How-to-recreate-e2809cDefault-Web-Sitee2809d-in-IIS-7-75.aspx - again all props to the original poster for providing:

In IIS 7 / 7.5
1.Right click on Sites folder and click Add Web Site
2.Under Site name: type ?Default Web Site
3.Under Application pool: select DefaultAppPool
4.Under Physical path: C:\Inetpub\wwwroot
5.Click OK

6.Fortunately for me, the ?Default Web Site? was created with the ID 1.
7.But just incase, if in your case the ?Default Web Site? does not show ID 1 and if ID 1 is not in use.
8.Open command prompt as an Administrator
9.Go to C:\Windows\System32\inetsrv\config and type notepad applicationHost.config
10.Find Default Web Site and change id=x to id=1
11.Save applicationHost.config
12.Now refresh IIS Manager and start the Web Site.

Confirm IIS loads and no errors on your computer
Now run the WBI setup again and confirm no errors running the WBI setup.

Wanted to post another possible resolution :

Your server may already have IIS installed
Your server may show that there is a Default Web Site
And that the Default Web Site is set as 1

BUT you receive the error when installing WBI:

“Internal error: Expression error 'Runtime Error (at 1:301):
WBI requires Microsoft IIS
(Error ‘Invalid class string, ProgID: “IISNamespace” occurred)’”

In a situation for one service company, the issue was due to not all of the required IIS components were installed.

If you encounter this error, check and MAKE SURE that the IIS 6 Management Compatibility is selected as well as ALL of the components under World Wide Wed Services