Thursday, May 01, 2008

Problem loading IIS7 hosted WAP projects in VS 2005 after installing Vista SP1

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.

  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>True</UseIIS> ---> Changed to False
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>60528</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost/Cronus</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions

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:

Error Message 1

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:

iis_4

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:

iis_2

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:

  1. 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.
  2. Open Explorer and make sure that hidden files/directories are visible.
  3. Navigate to C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys.
  4. 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).
  5. From the Start menu run cmd as administrator and type the following at the prompt:
    • start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService
  6. Now open Control Panel and select Programs, Programs and Features, Turn Windows features on or off.
  7. Select Windows Process Activation Service (at the bottom of the tree) and select all components.  Hit OK.
  8. 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.

iis7_3

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.

Technorati Tags: ,,,

2 comments:

  1. Sorry, for posting a comment on this post, but I could not see any other way to give you feedback on your main page.

    It may just be me, but clicking on Subscribe at your blog(http://developershelf.blogspot.com/), lead me to http://feeds.webintellix.com, rather than http://feeds.webintellix.com/developersshelf

    And your LinkedIn link fails with: Page Not Found

    ReplyDelete
  2. erich, Thank you so much for taking the time to visit my blog, and point out the critical errors. Thanks a lot and I really appreciate it. I have since fixed the issues. Thanks again.

    ReplyDelete

Google