错误 - 无法访问IIS元数据库

本文翻译自:Error - Unable to access the IIS metabase

After installing Visual Studio 2012 and opening my solution I get a series of errors in this form: 安装Visual Studio 2012并打开我的解决方案后,我收到以下形式的一系列错误:

The Web Application Project Foo is configured to use IIS. Web应用程序项目Foo配置为使用IIS。
Unable to access the IIS metabase. 无法访问IIS元数据库。 You do not have sufficient privilege to access IIS web sites on your machine. 您没有足够的权限访问计算机上的IIS网站。

I get this for each of our web applications. 我为每个Web应用程序都得到了这个。 Things I have tried: 我尝试过的事情:

  1. Running Visual Studio as Administrator 以管理员身份运行Visual Studio
  2. Running aspnet_regiis.exe -ga MyUserName 运行aspnet_regiis.exe -ga MyUserName
  3. Running aspnet_regiis.exe -i 运行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? 还有什么我可以尝试做的吗?


#1楼

参考:https://stackoom.com/question/rxRb/错误-无法访问IIS元数据库


#2楼

I think you are not running visual studio with administrator permissions. 我认为你没有运行具有管理员权限的visual studio。 Look that: 看那个:

http://bloggingabout.net/blogs/rick/archive/2012/10/04/unable-to-access-the-iis-metabase.aspx http://bloggingabout.net/blogs/rick/archive/2012/10/04/unable-to-access-the-iis-metabase.aspx

To quote 报价

The solution to this is simple: start your Visual Studio with "Run as Administrator". 解决方案很简单:使用“以管理员身份运行”启动Visual Studio。 You can do this by right clicking the shortcut and selecting "Run as Administrator". 您可以通过右键单击快捷方式并选择“以管理员身份运行”来执行此操作。


#3楼

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功能......在其中,我们必须选择Internet信息服务 - > Web管理工具 - > IIS 6管理兼容性 - > IIS Metabase和IIS 6配置兼容性。 Windows功能对话框显示IIS Metabase选项

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)... 注意:我们使用Visual Studio 2005和2010在Windows 7上运行IIS 7.5并使用超老派WebServices(.asmx)进行操作...


#4楼

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. 我通过关闭Windows 7中的IIS和.Net Framework功能然后重新打开它来解决了这个问题。 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. 我仍然不知道导致问题的原因,但我团队中至少有一位其他开发人员遇到了同样的问题。


#5楼

I also had a similar problem. 我也有类似的问题。 My solution is an extension to the answer "Run as admin" which I hope someone might find useful. 我的解决方案是对“以管理员身份运行”的答案的扩展,我希望有人可能会觉得有用。

I was running VS2012 and almost every time I had to do the Right Click, Run As Administrator. 我正在运行VS2012,几乎每次我都必须执行右键单击,以管理员身份运行。 I got tired of this so instead I went into its properties on the shortcut, clicked advanced, and then clicked the "Run as Administrator" option. 我厌倦了这一点,所以我进入了快捷方式的属性,单击高级,然后单击“以管理员身份运行”选项。 Now VS2012 always runs as administrator whenever I open it from that shortcut . 现在,当我从该快捷方式打开它时, VS2012始终以管理员身份运行。

The from that shortcut bit is important. 来自该快捷方式位非常重要。 I proceeded to branch my project, and download the branch to a new local folder. 我继续分支我的项目,并将分支下载到新的本地文件夹。 Then, when I opened it from the shortcut I had no problem. 然后,当我从快捷方式打开它时我没有问题。 But if I went directly into the folder, and ran the project locally without the shortcut, it did not run as administrator and I got this error. 但是,如果我直接进入该文件夹,并在没有快捷方式的情况下在本地运行项目,它没有以管理员身份运行,我收到此错误。

Once I opened VS2012 as usual first, then using File/Open/Project It worked again no problem. 一旦我像往常一样打开VS2012,然后使用文件/打开/项目它再次工作没有问题。 (because I was running as admin). (因为我是以管理员身份运行的)。 But I wasn't running as admin when I opened the solution using windows file manager. 但是当我使用Windows文件管理器打开解决方案时,我没有以管理员身份运行。

The other suggestions seem somewhat extreme, but this is pretty simple so I would tend to give this a try first. 其他建议似乎有些极端,但这很简单,所以我倾向于首先尝试一下。

Hope this was helpful. 希望这有用。


#6楼

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. 虽然我已经从同一个IIS开发了其他两个网站,但仍然无法创建新网站。 Strange, but I did this. 很奇怪,但我这样做了。

  • Delete the site from IIS 从IIS中删除该站点
  • Create new site, give it a name "new_site" 创建新网站,为其命名为“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 如果从同一台计算机上运行,​​请保持IP“未分配”
  • give it some unused port 给它一些未使用的端口
  • Run Visual Studio as "Run as Administrator" by right-clicking on VS executable shortcut. 右键单击VS可执行快捷方式,将Visual Studio作为“以管理员身份运行”运行。
  • 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. 我认为这不是问题,而是在Visual Studio拒绝打开的localhost上创建网站的错误方法。

I hope this will help newbies. 我希望这会对新手有所帮助。

发布了0 篇原创文章 · 获赞 7 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/asdfgh0077/article/details/105384945
今日推荐