简体   繁体   English

Visual Studio 2013:无法访问IIS元数据库

[英]Visual Studio 2013: Unable to access IIS metabase

I'm trying to open an asp.net MVC project in Visual Studio 2013 on a Windows 7 machine. 我正试图在Windows 7机器上的Visual Studio 2013中打开一个asp.net MVC项目。 I'm getting an error about being unable to access the IIS metabase. 我收到有关无法访问IIS元数据库的错误。 I've tried every suggestion I could find on the web, but am unable to get this to work. 我已经尝试过我可以在网上找到的所有建议,但我无法让它发挥作用。 The major change at our company is that our local file server went down. 我们公司的主要变化是我们的本地文件服务器出现故障。 This held all of My Documents. 这包含了我的所有文件。 I'm guessing that there was something in there that I need, but I don't know what that file is or how to restore it. 我猜我有需要的东西,但我不知道该文件是什么或如何恢复它。 I'm unable to make any changes to sites and my bosses are hounding me to get changes done, so I'm pretty desperate. 我无法对网站进行任何更改,而且我的老板正在追捕我以完成更改,所以我非常绝望。 Can someone give me a solution? 有人可以给我一个解决方案吗?

If I open the site using the Visual Studio solution file, I get a message saying that the project failed to load. 如果我使用Visual Studio解决方案文件打开该站点,我会收到一条消息,指出项目无法加载。 If I right click on it and choose reload, I get a message saying, "Creation of the virtual directory http://localhost:1436/ failed with the error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine." 如果我右键单击它并选择重新加载,我会收到一条消息,“创建虚拟目录http:// localhost:1436 /失败并显示错误:无法访问IIS元数据库。您没有足够的权限访问您计算机上的IIS网站。“

If I open the site as a web site (not using the solution or project files), I get the error "Configuring IIS Express failed with the following error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine." 如果我打开网站作为一个网站(不使用解决方案或项目文件),我收到错误“配置IIS Express失败,出现以下错误:无法访问IIS元数据库。您没有足够的权限访问IIS Web你机器上的网站。“

Here's a list of everything I tried. 这是我尝试过的所有内容的列表。 This seems to be most of the ideas people have had, but I'm hoping there's another solution out there you can come up with. 这似乎是人们所拥有的大多数想法,但我希望你能找到另一种解决方案。

Went to %systemroot%\\System32\\inetsrv\\config 去了%systemroot%\\ System32 \\ inetsrv \\ config

Uninstall/Reinstall IIS 卸载/重新安装IIS

  • Control Panel, Programs and Features, Turn Windows features on or off 控制面板,程序和功能,打开或关闭Windows功能
  • Unchecked Internet Information Services 未经检查的Internet信息服务
  • Clicked apply 点击申请
  • Restarted 重新启动
  • Control Panel, Programs and Features, Turn Windows features on or off 控制面板,程序和功能,打开或关闭Windows功能
  • Checked Internet Information Services 检查了Internet信息服务
  • Clicked apply 点击申请
  • Restarted 重新启动
  • Error - Unable to access the IIS metabase 错误 - 无法访问IIS元数据库

Repaired Visual Studio 13 修复了Visual Studio 13

  • Control Panel, Programs and Features, Microsoft Visual Studio Professional 2023 控制面板,程序和功能,Microsoft Visual Studio Professional 2023
  • Clicked Repair 点击修复
  • Suggested by a co-worker 由同事建议

Change .csproj file 更改.csproj文件

Ran Visual Studio as administrator 以管理员身份运行Visual Studio

Deleted the default web site and recreated it 删除默认网站并重新创建

Repaired IIS 修复了IIS

Tried giving Default App Pool access to inetsrv folder 尝试向inetsrv文件夹提供默认应用程序池访问权限

  • icacls "C:\\Windows\\System32\\inetsrv\\config" /t /grant "IIS AppPool\\DefaultAppPool":(R) icacls“C:\\ Windows \\ System32 \\ inetsrv \\ config”/ t / grant“IIS AppPool \\ DefaultAppPool”:( R)
  • Received error saying "Access is denied". 收到错误消息“访问被拒绝”。 According to http://forums.iis.net/t/1189996.aspx , that's not uncommon. 根据http://forums.iis.net/t/1189996.aspx ,这并不罕见。
  • Checked that I have admin access (I do) and took ownership of the folder, but kept getting that error. 检查我有管理员权限(我这样做)并获得该文件夹的所有权,但一直收到该错误。

Checked the registry key in HKEY_LOCAL_MACHINE 检查HKEY_LOCAL_MACHINE中的注册表项

Found a solution to my problem. 找到了我的问题的解决方案。

I had found a suggestion to check the registry in HKEY_LOCAL_MACHINE to make sure the values were not pointing to a server or other location that did not exist. 我发现了一个检查HKEY_LOCAL_MACHINE中的注册表的建议,以确保这些值没有指向服务器或其他不存在的位置。 I thought this made since because I know I'd lost connection to a server. 我认为这是因为我知道我失去了与服务器的连接。 But when I checked the values there, they were already pointing to my C drive. 但是当我检查那里的值时,他们已经指向我的C盘了。 Here's the link where I found this suggestion: Visual Studio 2013. You do not have sufficient privilege to access IIS web sites on your machine . 以下是我发现此建议的链接: Visual Studio 2013.您没有足够的权限访问计算机上的IIS网站

Did some more digging and finally found a value in HKEY_CURRENT_USER that was pointing to our crashed server. 做了一些挖掘,最后在HKEY_CURRENT_USER中发现了一个指向我们崩溃的服务器的值。 I changed the value to point to the C drive and Visual Studio opened without any problems! 我将值更改为指向C驱动器并且Visual Studio打开没有任何问题!

Here's the steps I took: 这是我采取的步骤:

  • Opened registry (CTRL-R, regedit, OK) 打开注册表(CTRL-R,regedit,OK)
  • Navigated to HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\ 导航到HKEY_CURRENT_USER \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Explorer \\ User Shell Folders \\
  • Found the Personal key was pointing to "\\OurServer\\RedirectedFolders\\MyName\\MyDocuments" 发现Personal键指向“\\ 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\\" 输入指向我的用户文档文件的位置:“%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. 当我打开Visual Studio并打开我的解决方案时,它加载时没有“无法访问IIS元数据库”错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM