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.
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:
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:
- In Windows Vista, click Start, click All Programs, and then locate Visual Studio.
- Right-click Microsoft Visual Studio, and then click Run as administrator.
Now you should be able to access local IIS via Visual Studio 2008.