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?
If you are working on a project which does not require the use of IIS, then a workaround to open the project with this error is to simply right click on the unloaded project and click edit, search for:
and set USEIIS to false
reload the project by right clicking on it after saving changes.
I tried everything above. The credit goes to all of the responses above. Having tried all of the suggestions on their own, I just assembled this combination of suggestions in an order that made sense to me. Note my Documents folder is on a shared drive. The subst/IISExpress stuff is not applicable unless you're in the same boat.
C:\windows\system32\inetsrv\
rmdir /s c:\windows\system32\inetsrv\
to completely remove all traces of the last install. Leave elevated cmd prompt open for later.C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ga MYDOMAIN\scottt732
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
Also, because my Documents folder is on a share drive, I was having IIS Express issues. I don't use/like IIS Express, but Visual Studio complained about it.
subst U: c:\Temp
. CreatedC:\Temp\Documents\
and copied the IISExpress folder from my U drive.CustomUserHome
key inHKCU\Software\Microsoft\IISExpress
withC:\Temp\Documents\IISExpress
subst
command each time I restart. Don't care.And after throwing in the towel 3 times and spending roughly ~6 hours I can open web projects in Visual Studio (2015 Update 2).
I did a repair of Visual Studio 2015 to solve this. The repair took a long time, but it solved the issue while doing much of the above did not. I am running Win 7 enterprise.
If you have administrator permissions, Right Click to Visual Studio icon > properties and then advanced, "Run as administrator" check. You can run visaul studio as administrator directly anymore. This way, formal and so basic.
I have had two seperate types of problem lead to this error, and thought I'd share...
Both of these stem from an unfortunate (imo) choice by MS to put things in the Documents or My Document directory, combinee with really lousy error messages. In both of the above cases the fundamental problem was that the IISExpress Config file goes in My Documents, and it either didn't exist or couldn't be accessed.
Navigating to folder:
%systemroot%\System32\inetsrv\config
presents a security dialog. Click continue and this may resolve the issue. This has worked on two separate Win 10/VS 2017/IIS machines.