简体   繁体   English

Visual Studio 2013.您没有足够的权限访问计算机上的IIS网站

[英]Visual Studio 2013. You do not have sufficient privilege to access IIS web sites on your machine

I just installed VS2013 and turned on IIS 7 on my Windows 7 Ultimate x64 machine. 我刚安装了VS2013并在我的Windows 7 Ultimate x64机器上打开了IIS 7。 When trying to open a solution I get: 在尝试打开解决方案时,我得到:

Creation of the virtual directory localhost:xxxxx failed with the error: Unable to access the IIS metabase. 创建虚拟目录localhost:xxxxx失败,并显示错误:无法访问IIS元数据库。 You do not have sufficient privilege to access IIS web sites on your machine. 您没有足够的权限访问计算机上的IIS网站。

I tried running Visual Studio 2013 as Administrator (right click, run as administrator), still the same error. 我尝试以管理员身份运行Visual Studio 2013(右键单击,以管理员身份运行),仍然是同样的错误。 I also did aspnet_regiis -i and it didn't help either. 我也做了aspnet_regiis -i ,它也没有帮助。

Go to C:\\Windows\\System32\\inetsrv. 转到C:\\ Windows \\ System32 \\ inetsrv。 Click config folder. 单击配置文件夹。 You will get a popup - "You don't have access to this folder - Click continue to permanently get access to this folder". 您将获得一个弹出窗口 - “您无权访问此文件夹 - 单击”继续以永久访问此文件夹“。 Perform same for Export folder which is inside config folder. 对于配置文件夹内的导出文件夹执行相同的操作。 You should be able to open the solution and the web application project will be deployed on IIS. 您应该能够打开解决方案,并且将在IIS上部署Web应用程序项目。

在此输入图像描述

The root cause of this error for me was that IIS was installing the config folder on a network shared drive at my workplace. 这个错误的根本原因是我在我的工作场所的网络共享驱动器上安装了配置文件夹。 I had to change this to use a local drive and it fixed it. 我不得不改变它以使用本地驱动器并修复它。

IIS creates an IISExpress folder in your %USER_HOME%/Documents folder (which for me was a shared drive) IIS在%USER_HOME%/ Documents文件夹中创建一个IISExpress文件夹(对我来说这是一个共享驱动器)

For me this issue was solved by uninstalling IIS, and clearing everything IIS related in the registry. 对我来说,通过卸载IIS并清除注册表中与IIS相关的所有内容解决了这个问题。 I then had to change my Documents drive in Registry (KHCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders) from a shared drive to a local drive (C:\\Users[profile]\\Documents). 然后,我必须将注册表中的文档驱动器(KHCU \\ Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Explorer \\ Shell文件夹)从共享驱动器更改为本地驱动器(C:\\ Users [profile] \\ Documents)。

Then reinstall IIS. 然后重新安装IIS。 It should create an IISExpress in the new Documents folder. 它应该在新的Documents文件夹中创建一个IISExpress。

In Windows 8, you have to right-click devenv.exe and select "Troubleshoot compatibility". 在Windows 8中,您必须右键单击devenv.exe并选择“疑难解答兼容性”。

select "Troubleshoot Program" 选择“排除程序故障”
check "The program requires additional permissions" 检查“该程序需要其他权限”
click "Next", click "Test the program..." 单击“下一步”,单击“测试程序...”
wait for the program to launch 等待程序启动
click "Next" 点击下一步”
select "Yes, save these settings for this program" 选择“是,保存此程序的这些设置”
click "Close" 点击“关闭”

Try running VS as admin. 尝试以管理员身份运行VS. If it does not work check if you have IIS metabase folder permission. 如果它不起作用,请检查您是否具有IIS元数据库文件夹权限。 Open up windows explorer (Win + e). 打开Windows资源管理器(Win + e)。 Type the following to address bar: 键入以下地址栏:

win 7, win 8.1, win 10 %systemroot%\\System32\\inetsrv\\config 赢7,赢8.1,赢10 %systemroot%\\ System32 \\ inetsrv \\ config

win 8 professional %systemroot%\\inetsrv\\config win 8 professional %systemroot%\\ inetsrv \\ config

Allow access if needed. 如果需要,允许访问。 Go into \\Export\\ folder and allow access again. 进入\\ Export \\文件夹并再次允许访问。

Source here 来源于

I had tried each of the steps recommended and didn't work. 我曾尝试过推荐的每个步骤,但没有奏效。 So, my last resource was to review the registry to find out if my user was pointing to a temp or cache folder. 所以,我的最后一个资源是检查注册表以查明我的用户是否指向临时文件夹或缓存文件夹。 Some posts were suggesting to check on HKEY_LOCAL_MACHINE ; 有些帖子建议检查HKEY_LOCAL_MACHINE ; but those were. 但那些是。 So, I finally found it by going into the HKEY_CURRENT_USER as recommended by boilers222: 所以,我终于按照boilers222的建议进入了HKEY_CURRENT_USER
Opened registry (CTRL-R, regedit, OK) Navigated to HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\ Found the Personal key was pointing to "\\OurServer\\RedirectedFolders\\MyName\\MyDocuments" Selected the Personal key, right clicked on it, and selected Modify 打开注册表(CTRL-R,注册表,确定)导航到HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\发现个人密钥指向"\\OurServer\\RedirectedFolders\\MyName\\MyDocuments"选择个人密钥,右键单击它,然后选择修改
Entered a location pointing to my user's documents file: "%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. 输入指向我的用户文档文件的位置: "%USERPROFILE%\\Documents\\"单击确定并关闭注册表编辑器当我打开Visual Studio并打开我的解决方案时,它加载时没有“无法访问IIS元数据库”错误。

The highest voted answer here did not work for me. 这里最高的投票答案对我不起作用。 I've recently upgraded to Windows 10 (ungh) and when I went to: 我最近升级到Windows 10(ungh),当我去的时候:

C:\Windows\System32\inetsrv

...I did not get a permissions pop up. ...我没有弹出权限。 Further more when I tried to change the permissions manually, most of the options were not available or greyed out. 当我尝试手动更改权限时,大多数选项都不可用或显示为灰色。

The end fix was to click into each folder individually inside the inetsrv directory. 最终修复是单击inetsrv目录中的每个文件夹。 When I did this I received a pop up for each folder where I could gain access. 当我这样做时,我收到了每个文件夹的弹出窗口,我可以访问它。

Restarted VS and voilà! 重启VS和voilà!

There is a simple answer. 有一个简单的答案。 Make sure you start VS 20xx as an administrator. 确保以管理员身份启动VS 20xx。 This is required for Azure development as well. 这也是Azure开发所必需的。

I encountered similar problem. 我遇到过类似的问题。 I had not installed IIS yet. 我还没有安装IIS。 1. I installed IIS. 1.我安装了IIS。 2. I used aspnet_regiis tool (with -i) to enable Asp.Net on IIS. 2.我使用aspnet_regiis工具(带-i)在IIS上启用Asp.Net。 3. Tried to load existing web app project. 3.试图加载现有的Web应用程序项目。 (FAILED with same error) 4. I reset IIS service. (FAILED出现相同错误)4。我重置了IIS服务。 5. I opened VS2013 as administrator and loaded the existing web app project (Succeeded) 6. The virtual directory created on IIS successfully. 5.我以管理员身份打开VS2013并加载了现有的Web应用程序项目(成功)6。在IIS上成功创建的虚拟目录。

I think the key is the Aspnet_regiis IIS reset and IIS service reset steps. 我认为关键是Aspnet_regiis IIS重置和IIS服务重置步骤。

Tried everything suggested, finally turned out we had to install IIS 10.0 Express with Application Compatibility Database installed by default 尝试了所有建议,最后证明我们必须安装默认安装了应用程序兼容性数据库的IIS 10.0 Express

Screenshot: 截图:

Programs screenshot 程序截图

Visual Studio 2015:只需启动Visual Studio“以管理员身份”为我工作,而无需对VS或注册表进行任何更改。

只需删除Project中的.vs文件夹(可能是隐藏的)并再次在visual studio中打开项目,它就可以了。

On Windows 10 running Visual Studio 2015 Community Edition, here are the steps I followed: 在运行Visual Studio 2015 Community Edition的Windows 10上,以下是我遵循的步骤:

  1. 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 Metabse and IIS 6 configuration compatibility. 控制面板 - >程序和功能 - >打开或关闭Windows功能...在其中,我们必须选择Internet信息服务 - > Web管理工具 - > IIS 6管理兼容性 - > IIS Metabse和IIS 6配置兼容性。

  2. select "Troubleshoot Program" check "The program requires additional permissions" click "Next", click "Test the program..." wait for the program to launch click "Next" select "Yes, save these settings for this program" click "Close" 选择“排除程序故障”选中“程序需要其他权限”单击“下一步”,单击“测试程序...”等待程序启动单击“下一步”选择“是,保存此程序的设置”单击“关”

  3. Go to C:\\Windows\\System32\\inetsrv. 转到C:\\ Windows \\ System32 \\ inetsrv。 Click config folder. 单击配置文件夹。 You will get a popup - "You don't have access to this folder - Click continue to permanently get access to this folder". 您将获得一个弹出窗口 - “您无权访问此文件夹 - 单击”继续以永久访问此文件夹“。 Perform same for Export folder which is inside config folder. 对于配置文件夹内的导出文件夹执行相同的操作。

Then it finally got past the permission issue. 然后它终于通过了许可问题。

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

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