After Vista SP1 got released, I was excited as it was very promising and wrote about it that every Vista user should get it. Now before I start with the problem it is important to understand my environment prior to installing Vista SP1:
- Vista Enterprise RTM
- IIS 7
- Visual Studio 2005
- Visual Studio 2008
It is also important to note that I work with WAP projects which are configured to be hosted on IIS7 and NOT the ASP.NET Development server.
Now, I installed Vista SP1 and it went without any hitch despite a lot of pain that people have expressed on the forums.
Next, I opened my WAP project in VS 2005 and the project would not load. It showed the dreadful 'Unavailable' status. I right-clicked on the project file and chose to edit the project file. I went down the file and changed the highlighted property to False.
<UseIIS>True</UseIIS> ---> Changed to False
Well that made me load my project in VS, but now it was not hosted in IIS 7. That is where the whole problem started.
If I tried to change the project to be hosted on IIS 7 via the project properties in VS, I would get the following error:
I tried a lot of stuff and googled a lot but could not find anything relevant. So, I shamelessly emailed Scott Guthrie, who has helped me in the past. He sent me a reply the next day (that is pretty quick for a guy so high in ranks in Microsoft):
Can you check out the steps in this article to see if they help: http://learn.iis.net/page.aspx/431/using-visual-studio-2005-with-iis-70/
Well, I read the article and in gist the article suggested to install the “IIS Metabase and IIS 6 configuration compatibility” component. The following screenshot from the above article describes what should be in place:
Now, I had a lead to follow. I checked on the “IIS Metabase and IIS 6 configuration compatibility” checkbox and Windows installed stuff or atleast it seemed so... But. alas, after a minute or two it errored out with the following message:
After I clicked OK, Windows still wanted me to Restart and I did. It showed messages that it was configuring updates and the machine came back. I went back to the Windows features window, and the “IIS Metabase and IIS 6 configuration compatibility” checkbox was now "unchecked". I thought I will try again but I got the same result. Now, I was stuck again. I replied to Scott's email with the above explanations. He forwarded the message to some of his colleagues at MS looking for a resolution. Greatly appreciate the effort, Scott.
While I waited, I searched again, and now for the failed “IIS Metabase and IIS 6 configuration compatibility” component. As luck would have it, I found an article by "bluemanifold" at http://forums.iis.net/p/1148581/1866381.aspx#1866381 (see the last post) that solved my problem. Here is the clear instructions from the article:
Hurrah! After goodness know how many fruitless hours, I have managed to enable IIS6 compatibility. For anyone else who happens to become trapped in this mess, here is the solution:
- Enable the built-in Administrator account:
- From Start menu, run cmd as administrator.
- At prompt, type net user administrator /active:yes
- Exit, log off and log in using the now-visible Administrator account.
- Open Explorer and make sure that hidden files/directories are visible.
- Navigate to C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys.
- Set the permissions on the directory as follows:
- Right-click on MachineKeys directory, select Properties and then select the Security tab.
- Click Advanced, select the Permissions tab and click Edit.
- Click Add and add the following object names: Administrators and SYSTEM. Give then full permission and make sure the 'Include inheritable permissions' is not selected.
- I also did the same for the files in the directory (just in case).
- From the Start menu run cmd as administrator and type the following at the prompt:
- start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService
- Now open Control Panel and select Programs, Programs and Features, Turn Windows features on or off.
- Select Windows Process Activation Service (at the bottom of the tree) and select all components. Hit OK.
- Repeat step 6 and select Internet Information Services. Now select the appropriate options, click OK and it should just work!!
I performed the last steps in stages so that I could be sure that everything worked. This whole process sucks - I cannot believe that something as simple as setting up compatibility should require such contortions.
I thing to note is that after I did the above steps, all the components in Windows Features under IIS->Web Management Tools and World Wide Web Services were unchecked. So, I check the relevant ones as shown below.
All is well now. I can open my WAP projects in VS 2005 and host them on IIS 7. Thanks to Scott Guthrie for all the help and "bluemanifold" for the article. Hope this helps someone else.