ChatGPT解决这个技术问题 Extra ChatGPT

Visual Studio 2013. You do not have sufficient privilege to access IIS web sites on your machine

I just installed VS2013 and turned on IIS 7 on my Windows 7 Ultimate x64 machine. When trying to open a solution I get:

Creation of the virtual directory localhost:xxxxx failed with the error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.

I tried running Visual Studio 2013 as Administrator (right click, run as administrator), still the same error. I also did aspnet_regiis -i and it didn't help either.

This fixed it for me, maybe it will help in your situation (the article is for VS2012 but my issue was with 2013): - social.msdn.microsoft.com/Forums/en-US/…
Turning on IIS Feature On and Off didnt do it. I had to first turn IIS Feature OFF. Then uninstalled VS2013, .NET Framework 4.5.1. Turn ON IIS again, then reinstall VS2013 (which include .NET Frameworks 4.x Seems to work now. My guess is the problem is caused by installing VS and .NET Framework before installing IIS on Windows 7.
Also see this question and answers: stackoverflow.com/questions/12859891/… I tried several things. One that worked was editing csproj file to use IIS . Later, did Control Panel/Turn Windows Features On and Off, and selected (checked) Internet Information Services -> Web Management Tools -> IIS 6 Management Compatibility -> IIS Metabase and IIS 6 configuration compatibility. This triggered some installs. Switched back to IIS Express and VS2013 worked next time on an ASP.NET MVC project that had been failing to load. Not 100% sure what worked.

W
Walter Stabosz

Go to C:\Windows\System32\inetsrv. Click config folder. You will get a popup - "You don't have access to this folder - Click continue to permanently get access to this folder". Perform same for Export folder which is inside config folder. You should be able to open the solution and the web application project will be deployed on IIS.

https://i.stack.imgur.com/NHTfy.gif


your solution rocks! this is only one that solved my problem, no reboot needed. thanks
Worked perfectly. Thanks.
Didn't fix it for me. I didn't get a popup - I had access to this folder already.
The solution was concise and on spot! It resolved the same error I was getting while using VS2015. Thanks!
I added a quick video of the process you described so that people can see what the prompts look like and understand that there are two folders that need to be fixed.
d
dannash918

The root cause of this error for me was that IIS was installing the config folder on a network shared drive at my workplace. I had to change this to use a local drive and it fixed it.

IIS creates an IISExpress folder in your %USER_HOME%/Documents folder (which for me was a shared drive)

For me this issue was solved by uninstalling IIS, and clearing everything IIS related in the registry. I then had to change my Documents drive in Registry (KHCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders) from a shared drive to a local drive (C:\Users[profile]\Documents).

Then reinstall IIS. It should create an IISExpress in the new Documents folder.


The shared drive on our corporate network was down and I got this error. I wasn't able to change the registry setting like you said, but once the shared drive came back online the error went away and VS.NET was working again.
If you can't change through the registry, you can always try: Open up file explorer > C:/Users/[username]/ > Right click on Documents > Select Location Tab, change the location field. (I found I did not have permissions to change this setting, however I did have to change the registry, maybe your permissions may be different)
There's got to be a better solution than moving ALL of your documents folder. That seems like a sledge hammer to an ant solution.
Did you ever find a way of taking it off your network share? I'm having this problem too, but concerned changing my registry could cause problems with other (non-IIS) applications
Unfortunately this was the only way I could manage. Tried reinstalling multiple times but that did not work. However I have not had any other issues after I changed this. You can always try changing then if it breaks something change it back?
G
Galaxydreams

In Windows 8, you have to right-click devenv.exe and select "Troubleshoot compatibility".

select "Troubleshoot Program" check "The program requires additional permissions" click "Next", click "Test the program..." wait for the program to launch click "Next" select "Yes, save these settings for this program" click "Close"


Y
Yasel

I had tried each of the steps recommended and didn't work. So, my last resource was to review the registry to find out if my user was pointing to a temp or cache folder. Some posts were suggesting to check on HKEY_LOCAL_MACHINE; but those were. So, I finally found it by going into the HKEY_CURRENT_USER as recommended by boilers222:
Opened registry (CTRL-R, regedit, OK) Navigated to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\ Found the Personal key was pointing to "\OurServer\RedirectedFolders\MyName\MyDocuments" Selected the Personal key, right clicked on it, and selected Modify
Entered a location pointing to my user's documents file: "%USERPROFILE%\Documents\" Clicked OK and closed the registry editor When I opened Visual Studio and opened my solution, it loaded without the "unable to access the IIS metabase" error.


So, in-short the issue is that your "My Documents"\"Documents" folder was on a network share. OUCH. that's a pretty crap limitation.
Similar situation - my Personal key was pointing to a drive that was no longer mapped. Amazing the grief that this has caused.
O
Orcun Berkem

Try running VS as admin. If it does not work check if you have IIS metabase folder permission. Open up windows explorer (Win + e). Type the following to address bar:

win 7, win 8.1, win 10 %systemroot%\System32\inetsrv\config

win 8 professional %systemroot%\inetsrv\config

Allow access if needed. Go into \Export\ folder and allow access again.

Source here


Isn't this answer already mentioned above in 2015? Anyway, it still doesn't work for me, in windows 10.... in my case I have enabled https and not sure that is the case
s
spryce

The highest voted answer here did not work for me. I've recently upgraded to Windows 10 (ungh) and when I went to:

C:\Windows\System32\inetsrv

...I did not get a permissions pop up. Further more when I tried to change the permissions manually, most of the options were not available or greyed out.

The end fix was to click into each folder individually inside the inetsrv directory. When I did this I received a pop up for each folder where I could gain access.

Restarted VS and voilà!


C
Curt Miller

There is a simple answer. Make sure you start VS 20xx as an administrator. This is required for Azure development as well.


P
Polymorphic

I encountered similar problem. I had not installed IIS yet. 1. I installed IIS. 2. I used aspnet_regiis tool (with -i) to enable Asp.Net on IIS. 3. Tried to load existing web app project. (FAILED with same error) 4. I reset IIS service. 5. I opened VS2013 as administrator and loaded the existing web app project (Succeeded) 6. The virtual directory created on IIS successfully.

I think the key is the Aspnet_regiis IIS reset and IIS service reset steps.


A
Andrew Gale

Tried everything suggested, finally turned out we had to install IIS 10.0 Express with Application Compatibility Database installed by default

Screenshot:

Programs screenshot


M
Miguel

Visual Studio 2015: Just start Visual Studio "as administrator" that worked for me without having to make any changes to VS or registry.


J
Jitendra Suthar

Just delete .vs folder in Project (It may be hidden) and again open project in visual studio, it will be work.


d
durron597

On Windows 10 running Visual Studio 2015 Community Edition, here are the steps I followed:

Control Panel -> Programs and Features -> Turn Windows Features on or off... inside that, we had to select Internet Information Services -> Web Management Tools -> IIS 6 Management Compatibility -> IIS Metabse and IIS 6 configuration compatibility. select "Troubleshoot Program" check "The program requires additional permissions" click "Next", click "Test the program..." wait for the program to launch click "Next" select "Yes, save these settings for this program" click "Close" Go to C:\Windows\System32\inetsrv. Click config folder. You will get a popup - "You don't have access to this folder - Click continue to permanently get access to this folder". Perform same for Export folder which is inside config folder.

Then it finally got past the permission issue.