无法访问 IIS 元数据库 ASP.Net [英] Unable to access the IIS metabase ASP.Net

查看:20
本文介绍了无法访问 IIS 元数据库 ASP.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一些关于此的主题,但似乎没有一个解决方案适合我.

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

我有一个 ASP.Net 网站项目,我正尝试在 Visual Studio 中加载和发布该项目.但是,当我加载项目时,出现错误:

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:

创建虚拟目录 http://localhost:xxxx 失败错误:无法访问 IIS 元数据库.你没有有足够的权限访问您机器上的 IIS 网站.

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.

此错误仅在我以管理员身份运行 Visual Studio 时发生.如果我不以管理员身份运行,则不会发生上述错误,但是当我尝试发布我的应用程序时,我得到:

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:

请在管理员模式下启动 Visual Studio 来执行此操作部署动作

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

看来我赢不了!

到目前为止我尝试过的:

  • 取得C:/Windows/System32/Inetsrv/Config的所有权
  • 在我的 project_name.csproj 文件中设置 false
  • 返回到旧的团队基础服务器检查在管理员模式下没有问题并使用该配置.
  • 以非管理员身份运行 Visual Studio(有效,但请注意上面的第二个错误)
  • 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.

额外信息:

操作系统:Windows 8.1(64 位)

Operating System: Windows 8.1 (64 bit)

Visual Studio:2013

Visual Studio: 2013

IIS:8.5

C:WindowsSystem32inetsrvconfig 上的权限(只读):

Permissions on C:WindowsSystem32inetsrvconfig (read only):

  1. 我:完全控制
  2. 管理员:完全控制

对 Documents/IISExpress/config 的权限(只读):

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

  1. 我:完全控制
  2. 管理员:完全控制

注意文档"在网络驱动器上

Note "Documents" is on a network drive

推荐答案

原来我的个人文件夹被设置为一个网络驱动器,该驱动器偶尔会出现故障,导致上述错误.

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:

  • 打开C://Windows/regedit.exe
  • 导航到HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders
  • 将字段 Personal 更改为 %USERPROFILE%%USERPROFILE%{a folder of your choice}
  • Open C://Windows/regedit.exe
  • Navigate to HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders
  • Change the field Personal to %USERPROFILE% or %USERPROFILE%{a folder of your choice}

这为我解决了问题.

请注意,您可能需要将旧个人文件夹中的任何文件移至新文件夹,因为它们将不再被提取

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

这篇关于无法访问 IIS 元数据库 ASP.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆