我正在尝试加载现有的 c# web 应用程序并在加载任何 web 项目时遇到以下错误:
Creation of the virtual directory http://localhost:/ failed with the error: You do not have permission to access the IIS configuration file. Opening and creating web sites on IIS requires running Visual Studio under an Administrator account.. You will need to manually create this virtual directory in IIS before you can open this project.
The following error occurred when trying to configure IIS Express for project xxx.WebApi. You do not have permission to access the IIS configuration file. Opening and creating web sites on IIS requires running Visual Studio under an Administrator account.
我尝试了以下操作,但徒劳无功:
stackoverflow 上提到了所有尝试过的解决方案,但对我不起作用。我错过了一些微不足道的东西吗?请指导我破解这些IIS错误。
最佳答案
我能够通过执行以下操作来解决此问题:
1- 转至 C:\Windows\System32\inetsrv
并双击目录 config
并接受警告消息。
2- 转至 C:\Windows\System32\inetsrv\config
目录并双击目录 Export
并接受警告消息。
然后您就可以在本地 IIS 中运行该应用程序,而无需成为管理员。 您可以按照给定图像中的路径进行操作。
关于asp.net - 您无权访问 IIS 配置文件 - Web 应用程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56233319/