Error - Unable to access the IIS metabase

2019-01-03 07:29发布

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:

  1. Running Visual Studio as Administrator
  2. Running aspnet_regiis.exe -ga MyUserName
  3. 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?

标签: c# .net iis
30条回答
三岁会撩人
2楼-- · 2019-01-03 07:43

Open visual studio command prompt and type below command and run

aspnet_regiis -ga machinename\ASPNET

After running the above command Reset the IIS and test the application that resolve your issue.

If above command doesn’t resolve your problem then try to run below command in visual studio command prompt:-

aspnet_regiis -i

Alternatively we can run above command from our windows command prompt also

Go to the Start menu and open Run and enter and click OK

%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –I

After that Reset the IIS and test the application that resolves your issue

查看更多
相关推荐>>
3楼-- · 2019-01-03 07:46

I just had the same issue with me today. And I found it annoying. Though I have other two websites already under development from the same IIS but still was not able to create new site. Strange, but I did this.

  • Delete the site from IIS
  • Create new site, give it a name "new_site"
  • Select Application Pool other than the site name itself. So it wont be messing up with default settings.
  • Keep IP "unassigned" if you are running it from same machine
  • give it some unused port
  • Run Visual Studio as "Run as Administrator" by right-clicking on VS executable shortcut.
  • You are done!

You do not need to turn off/re-install anything other than what I have stated since it works.

Let me know if anybody had the same issue just like me and solved the same way. I think it was not the issue but a wrong way of creating website on localhost which Visual Studio rejects to open.

I hope this will help newbies.

查看更多
迷人小祖宗
4楼-- · 2019-01-03 07:48

One more thing you could try:

  • Check if you have pending Windows updates.
  • If you do, please reboot before trying anything else.

I tend to never shut down my machine, so I had plenty of them waiting for a reboot. And that fixed it.

查看更多
看我几分像从前
5楼-- · 2019-01-03 07:49

I think we encountered a similar problem at work. For us, the solution was to go into 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 Metabase and IIS 6 configuration compatibility. Windows Features dialog showing IIS Metabase option

Give that a try and let me know if it helps!

Note: We're running IIS 7.5 on Windows 7 using both Visual Studio 2005 and 2010 and doing stuff with super-old-school WebServices (.asmx)...

查看更多
我只想做你的唯一
6楼-- · 2019-01-03 07:49

I just had this issue today and I found that I didn't open VS as 'Run as Administrator'. After doing this, I was able to publish the Service.

查看更多
Explosion°爆炸
7楼-- · 2019-01-03 07:50

On Windows 8 Pro:

%systemroot%\inetsrv\config

On Windows 7 and 8.1 and 10

%systemroot%\System32\inetsrv\config 

(Where %systemroot% is usually C:\Windows)

Navigate to the appropriate location above in Windows Explorer. You will be blocked access with a popup which says:

"You don't have access to this folder - Click continue to permanently get access to this folder"

Click 'continue' for this folder, and with the Export folder underneath. I changed the shortcut back to "Run as me" (a member of the domain and local administrators ) and was able to open and deploy the solution.

查看更多
登录 后发表回答