Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to access the IIS metabase ASP.Net

Hi I know there are a few threads on this but none of the solutions seem to work for me.

I have an ASP.Net website project which I am trying to load and publish in Visual Studio. However when I load the project I get the error:

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

This error only occurs when I run Visual Studio as Administrator. If I don't run as admin then the above error does not occur but when I try to publish my app I get:

Please launch Visual Studio under administrator mode to perform this deployment action

It seems I can't win!


What I've tried so far:

  • Taking ownership of C:/Windows/System32/Inetsrv/Config
  • Setting <UseIISExpress>false</UseIISExpress> in my project_name.csproj file
  • Go back to and old team foundation server check in that didn't have the problem in admin mode and use that configuration.
  • Running Visual Studio as non-admin (works but note second error above)

None had any luck so far.


Extra Info:

Operating System: Windows 8.1 (64 bit)

Visual Studio: 2013

IIS: 8.5

Permissions on C:\Windows\System32\inetsrv\config (read only):

  1. Me: Full control
  2. Administrators: Full control

Permissions on Documents/IISExpress/config (read only):

  1. Me: Full control
  2. Administrators: Full control

Note "Documents" is on a network drive

like image 589
Eduardo Avatar asked Feb 11 '15 16:02

Eduardo


2 Answers

It turns out my Personal Folder was set to a network drive which occasionally went down causing the error described.

To change your Personal folder:

  • Open C://Windows/regedit.exe
  • Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
  • Change the field Personal to %USERPROFILE% or %USERPROFILE%\{a folder of your choice}

This fixed the problem for me.

Note you may need to move over any files from your old Personal folder to your new one as they wont be picked up any more

like image 67
Eduardo Avatar answered Sep 30 '22 18:09

Eduardo


I had the same problem after I mistakenly Cut and Pasted my Documents, Downloads and Desktop folders to my external hard drive, it changed the path of the folders to the F: drive (the external hard drive), I copied the folders back and set the path back to local.

  • Copy the items back to C:\Local Disk\Users\your_name
  • Right click on the folder (that isn't working) and click Properties e.g Documents
  • Click on the Location Tab
  • Change the location to normal e.g C:\Local Disk\Users\your_name\Documents

This is what worked for me :D

like image 27
stackman Avatar answered Sep 30 '22 18:09

stackman