Share via


Error When Opening ASP.NET Site on IIS 7 Using Visual Studio 2005

Now that Windows Server 2008 is out the door, we're starting to see more customers using IIS 7. I recently worked on a case where one of our engineers was dealing with a customer using Visual Studio 2005 and IIS 7. He was encountering an error message when attempting to open his ASP.NET 2.0 application running on his local instance of IIS that displayed the following message:

The site is currently configured for use with ASP.NET 1.1 error.

When we checked the application pool in IIS, it was configured correctly for the 2.0 Framework, so what exactly is the problem here?

The problem is that Visual Studio 2005 came out prior to IIS 7. Therefore, it doesn't deal well with the way that the handler mappings work in IIS 7. As it turns out, the .aspx file extension is mapped to both the ASPNET-ISAPI-1.1-PageHandlerFactory (for 1.1) and to the PageHandlerFactory-ISAPI-2.0. When Visual Studio 2005 hits the site to check for ASP.NET, it is fooled into thinking that the site is configured for ASP.NET 1.1 by the mapping for the ASPNET-ISAPI-1.1-PageHandlerFactory.

To correct this problem, you can either click Yes to the dialog shown above (and you'll have to do that each time you open the project) or you can change the order of the handlers mapped to your application.

To change the order of the handlers, follow these steps:

  1. Select your application in the IIS Manager.
  2. Double-click on the Handler Mappings feature as shown below.

handlermappings

  1.   Click the View Ordered List link on the right side of the IIS Manager as shown below.

ordered

  1. Select the PageHandlerFactory-ISAPI-2.0 (or PageHandlerFactory-ISAPI-2.0-64 on 64-bit Windows).
  2. Click the Move Up link as shown below until the handler appears above the ASPNET-ISAPI-1.1-PageHandlerFactory handler.

movehandler

 

You should now be able to open the project without any issues.

By the way, this issue does not occur in Visual Studio 2008.

Jim

Comments

  • Anonymous
    February 25, 2008
    PingBack from http://msdnrss.thecoderblogs.com/2008/02/25/error-when-opening-aspnet-site-on-iis-7-using-visual-studio-2005/

  • Anonymous
    February 19, 2009
    Thanks, I have been putting up with that error for months.  The last time I searched for a solution I found nothing that solved it.

  • Anonymous
    April 10, 2009
    many thanks, solved my problem.

  • Anonymous
    January 22, 2010
    the same problem  but the solution doesn't work ... i will keep on clicking "Yes" :(

  • Anonymous
    March 15, 2010
    Thanks a million. Uninstalling 1.1 solved the problem for me  before but I had still needed it for other dev sites so I would have to reinstall 1.1 when i needed it. I did have to make this change to the Parent Handler Mappings to get this to work though.