After installing Visual Studio 2012 and opening my solution I get a series of errors in this form:
The Web Application Project Foo is configured to use IIS.
Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
I get this for each of our web applications. Things I have tried:
- Running Visual Studio as Administrator
- Running aspnet_regiis.exe -ga MyUserName
- Running aspnet_regiis.exe -i
These seem to be common solutions for this problem but I have not had any success with them. Is there anything else I can try to do?
I resolved this issue by granting IIS AppPool identity permissions to the
%systemroot%\inetsrv\config
On a windows 81, from an admin command prompt, use:
Then go back in VS, right click on the failed project, choose Reload.
Credit to: IIS7 Permissions Overview - ApplicationPoolIdentity
I had a similar problem. Visual Studio would not load any web projects and showed the error: creation of virtual directory <myproj:myport> failed. Unable to access the IIS metabase.
In my case it was actually IISExpress that was at the root of the problem. Right clicking on IIS Express in Programs and Features in the control panel and choosing repair fixed the issue in less than two minutes.
I came across this today and fixed the problem by removing the IISUrl from the Project file:
Delete the following line:
Reload project
Thank you to everyone that answered. Since this was closed for a long time I couldn't provide much feedback, but I did eventually fix my problem. I tried many of these other solutions and they didn't fix my issue, but I'm sure they help when the root cause is different.
My Solution
I solved this problem by turning off the IIS and .Net Framework features within Windows 7 and then turning them back on. It seems like this re-installation is what fixed my issue. I still don't know what caused the problem, but at least one other developer on my team had the same issue.
Go to the root directory of your project and find the following file:
YourProjectName.csproj.user - inside it, make sure UseIISExpress is set to false:
If that alone doesn't work try the following as well and try again:
YourProjectName.csproj - inside the main project file, make sure both UseIIS and UseIISExpress are set to false:
After changing these I was able to load the project again.
Note: Make sure you run your VS as an Administrator, as mentioned in the other answers.