Visual Studio 2013:无法访问IIS元数据库 [英] Visual Studio 2013: Unable to access IIS metabase
问题描述
我正在尝试在Windows 7计算机上的Visual Studio 2013中打开一个asp.net MVC项目.我收到有关无法访问IIS元数据库的错误.我尝试了所有可以在网上找到的建议,但无法使其正常工作.我们公司的主要变化是本地文件服务器出现故障.这保存了所有我的文档".我猜那里需要一些东西,但是我不知道该文件是什么或如何还原它.我无法对网站进行任何更改,而我的老板们却在追捕我以完成更改,所以我非常绝望.有人可以给我解决方案吗?
I'm trying to open an asp.net MVC project in Visual Studio 2013 on a Windows 7 machine. I'm getting an error about being unable to access the IIS metabase. 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?
如果我使用Visual Studio解决方案文件打开该站点,则会收到一条消息,指出该项目无法加载.如果我右键单击它并选择重新加载,则会收到一条消息,内容为:创建虚拟目录 http://localhost:1436/失败,并显示以下错误:无法访问IIS元数据库.您没有足够的权限访问计算机上的IIS网站."
If I open the site using the Visual Studio solution file, I get a message saying that the project failed to load. 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."
如果我将网站作为网站打开(不使用解决方案或项目文件),则会收到错误消息配置IIS Express失败,并出现以下错误:无法访问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."
这是我尝试过的所有内容的列表.这似乎是人们所拥有的大多数想法,但是我希望可以找到另外一种解决方案.
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.
转到%systemroot%\ System32 \ inetsrv \ config
Went to %systemroot%\System32\inetsrv\config
- 在线信息说,系统将提示我我没有访问权限,可以更改访问权限
- 没有提示我没有访问权限;我可以打开所有文件夹
- 卸载/重新安装IIS
Uninstall/Reinstall IIS
- 控制面板,程序和功能,打开或关闭Windows功能
- 未经检查的Internet信息服务
- 点击了应用
- 重新启动
- 控制面板,程序和功能,打开或关闭Windows功能
- 已检查的Internet信息服务
- 点击了应用
- 重新启动
- 错误-无法访问IIS元数据库
修复后的Visual Studio 13
Repaired Visual Studio 13
- 控制面板,程序和功能,Microsoft Visual Studio Professional 2023
- 点击修复
- 由同事建议
更改.csproj文件
Change .csproj file
- 使用已设置为true的IIS标记
-
< UseIISExpress> false</UseIISExpress>
-
< UseIIS> False</UseIIS>
-
< IISUrl></IISUrl>
以管理员身份运行Visual Studio
Ran Visual Studio as administrator
- 右键单击C:\ Program Files \ Microsoft Visual Studio 12.0 \ Common7 \ IDE \ devenv.exe
- 点击以管理员身份运行
- 错误-无法访问IIS元数据库
删除默认网站并重新创建
Deleted the default web site and recreated it
- 打开IIS
- 右键单击默认网站",然后单击远程"
- 添加了一个名为默认网站"的新网站
- 在IIS中重新创建默认网站
修复后的IIS
- 控制面板,程序和功能,IIS 10.0 Express
- 点击修复
- 错误-无法访问IIS元数据库
试图赋予默认应用程序池访问inetsrv文件夹的权限
Tried giving Default App Pool access to inetsrv folder
- icacls"C:\ Windows \ System32 \ inetsrv \ config"/t/grant"IIS AppPool \ DefaultAppPool" :( R)
- 收到错误消息,提示访问被拒绝".根据 http://forums.iis.net/t/1189996.aspx ,并不少见.
- 检查(我有)是否具有管理员访问权限,并取得了该文件夹的所有权,但始终收到该错误.
检查了HKEY_LOCAL_MACHINE中的注册表项
Checked the registry key in HKEY_LOCAL_MACHINE
- 在注册表中转到HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Shell Folders \ Common Documents
- 值已设置为C:\ Users \ Public \ Documents
- 视觉Studio2013.您没有足够的权限访问计算机上的IIS网站
推荐答案
找到了解决我问题的方法.
Found a solution to my problem.
我发现建议检查HKEY_LOCAL_MACHINE中的注册表,以确保这些值未指向服务器或其他不存在的位置.我以为是因为我知道我已经失去了与服务器的连接.但是,当我检查那里的值时,它们已经指向我的C驱动器.这是我发现此建议的链接:
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. 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. 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.
进行了一些进一步的挖掘,终于在HKEY_CURRENT_USER中找到一个指向崩溃的服务器的值.我将值更改为指向C驱动器,并且Visual Studio打开没有任何问题!
Did some more digging and finally found a value in HKEY_CURRENT_USER that was pointing to our crashed server. I changed the value to point to the C drive and Visual Studio opened without any problems!
这是我采取的步骤:
- 已打开的注册表(CTRL-R,regedit,确定)
- 已导航到HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders \
- 发现个人密钥指向"\ OurServer \ RedirectedFolders \ MyName \ MyDocuments"
- 选择个人"密钥,右键单击它,然后选择修改"
- 输入了指向我的用户文档文件的位置:%USERPROFILE%\ Documents \"
- 单击确定"并关闭注册表编辑器
- 当我打开Visual Studio并打开解决方案时,它加载时没有出现无法访问IIS元数据库"错误.
这篇关于Visual Studio 2013:无法访问IIS元数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-