Configure IIS 7 to work with Visual Studio 2008 in Windows 7

You should install IIS 7 prior to the installation of Visual Studio 2008, otherwise, you will need to run command aspnet_regiis –i with administrator permission. If you install IIS 7 with the default settings, you will get this error when you try to use local IIS instead of the built-in web server in VS 2008, or when you try to create a new web site project on local IIS instead of using the file system.

  To access local IIS Web sites, you must install the following IIS components:

    IIS Metabase and IIS 6 Configuration Compatibility
    Windows Authentication

  In addition, you must run Visual Studio in the context of an administrator account.

IISComponentsNeeded

To install the above two IIS components:

1. Start => Control Panel => Programs

2. Click Turn Windows features on or off under Programs and Features section

3. Expand Internet Information Services, then check IIS Metabase and IIS 6 configuration compatibility and Windows Authentication as shown in the screen shot below:

IIS7Settings

4. Click OK to exit out.

You will notice you still cannot access local IIS Web sites through Visual Studio 2008 even after installing the missing IIS components, the reason is given in the above error message: you must run Visual Studio 2008 in the context of an administrator account. Since Windows Vista, by default, Windows runs applications in a limited-rights user account even when you are logged on to the computer as an administrator.

To run Visual Studio with administrative permissions in Windows Vista and 7:

  1. In Windows Vista, click Start, click All Programs, and then locate Visual Studio.
  2. Right-click Microsoft Visual Studio, and then click Run as administrator.

Now you should be able to access local IIS via Visual Studio 2008.

11
Leave a Reply

avatar
10 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
9 Comment authors
jorgeJamie FStephHermes NetoR.L. Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jon
Guest
Jon

Still not working on my Vista machine. Any other ideas?

EP
Guest
EP

I am struggling to get a new Vista Business machine configured for ASP.Net development. I did install Visual Studio before I turned on the IIS 6 components. I did then run aspnetregiis. I think my trouble now is I have no clue how to configure my VisualStudio project to run in IIS. When I try to run my code I get error 404 can you help me?

Emon
Guest
Emon

can i have a detailed solution how to configure a web-application(asp.net) for IIS-7 ?I cannot run Visual studio 2008 project in IIS-7

R.L.
Guest
R.L.

Thanks–you saved me some time and stress with this tip.

Hermes Neto
Guest
Hermes Neto

This worked until I install VS2010 in the same machine.  After that I lost the ‘Windows Authentication’ component on IIS.   VS2010 f**ked my development environment.

Steph
Guest
Steph

thank you!

Jamie F
Guest
Jamie F

After 20 minutes of googling other sites, this one actually fixed my problem, just follow every step.
 
Good post, I salute you.

jorge
Guest
jorge

Gracias muy buen aporte, solucionado