简体   繁体   English

Visual Studio 无法启动程序访问被拒绝

[英]visual studio unable to start program access is denied

I'm getting "Unable to start program http://localhost:[port] Access is denied."我收到“无法启动程序http://localhost:[port]访问被拒绝。” when I try to debug an ASP.NET MVC app.当我尝试调试 ASP.NET MVC 应用程序时。 Here are some more details, some of which may not be relevant.这里有一些更多的细节,其中一些可能不相关。

This is happening under a somewhat different context for this project.对于这个项目,这是在稍微不同的背景下发生的。 I recently obtained an elevated account on the network, so now I'm running VS 2017 (15.5.4) as Admin every time I start it so that I can access the TFS server.我最近在网络上获得了一个提升的帐户,所以现在我每次启动它时都以管理员身份运行 VS 2017 (15.5.4),以便我可以访问 TFS 服务器。 Previous to this, I had been working offline with my non-elevated account and passing code changes to another developer for him to check in to TFS.在此之前,我一直在使用我的非提升帐户离线工作,并将代码更改传递给另一个开发人员,让他签入 TFS。 I am still logged on to the local PC (Windows 10) with my non-elevated account.我仍然使用我的非提升帐户登录到本地 PC(Windows 10)。 I just start VS as an admin and when prompted enter the credentials for the elevated account.我只是以管理员身份启动 VS,并在提示时输入提升帐户的凭据。

This morning was the first time I ran VS under this new context, got the latest code, and tried to do some work.今天早上是我第一次在这个新环境下运行 VS,拿到最新的代码,并尝试做一些工作。 I had to delete an existing TFS workspace, but I did get a complete refresh of the code from TFS.我不得不删除现有的 TFS 工作区,但我确实从 TFS 中完全刷新了代码。

The first time I went to F5 the code in this new context I get a warning about the app using SSL and VS wanting to self-sign a certificate.我第一次在这个新上下文中使用 F5 代码时,我收到一条关于使用 SSL 和 VS 的应用程序想要自签名证书的警告。 I said yes.我说是。 I forget exactly what happened at that point, I think the browser (Firefox) timed out trying to connect.我忘记了当时到底发生了什么,我认为浏览器 (Firefox) 在尝试连接时超时。 Anyway, I tried a different browser (Chrome) and still no luck.无论如何,我尝试了不同的浏览器(Chrome),但仍然没有运气。

Yet now, whether I , +, , or , I very quickly get the message from above "Unable to start program..." I've done a lot of searching on this problem, but have had no success in getting close to a solution.然而现在,无论是 I 、 +、 、 还是 ,我都很快从上面得到消息“无法启动程序......”我已经对这个问题进行了大量搜索,但没有成功接近解决方案。 Here's what I've tried:这是我尝试过的:

Cleaned the build and done a fresh rebuild.清理了构建并进行了全新的重建。 Building works, no issues.建筑工程,没有问题。

Use netsh to look for (and delete) URL reservation.使用 netsh 查找(并删除)URL 保留。 There wasn't one.没有一个。

Tried using a different port.尝试使用不同的端口。

Deleted temporary asp.net files.删除了临时的 asp.net 文件。

Turn JavaScript debugging option off in VS.在 VS 中关闭 JavaScript 调试选项。

Crtl+F5, w/o debugger. Crtl+F5,无调试器。

Turn SSL off for the project.为项目关闭 SSL。

Checked, Windows Authentication is on in web.config.检查,Windows 身份验证在 web.config 中。

Used Process Monitor to look for any "access denied" for either devenv.exe or iisexpress.exe使用进程监视器查找 devenv.exe 或 iisexpress.exe 的任何“访问被拒绝”

So what I'm hoping for here is not so much a silver bullet (though that would be great), but more some help in troubleshooting.所以我在这里希望的不是灵丹妙药(尽管那会很棒),而是更多的故障排除帮助。 Access denied means some resource--a file, a registry setting, a network share, something--is inaccessible in the context in which I'm running.访问被拒绝意味着某些资源(文件、注册表设置、网络共享等)在我运行的上下文中无法访问。 Exactly what that is has got to be recorded somewhere, I hope.我希望,这到底是什么,必须在某处记录下来。 What log files does VS write to when you hit ?当您点击 VS 时,VS 会写入哪些日志文件? I've looked at the output during build and there's nothing there.我在构建期间查看了输出,但没有任何内容。

I'm sure I haven't exhausted all resources in troubleshooting this, I just need some help on where to look.我确定我没有用尽所有资源来解决这个问题,我只是需要一些关于在哪里查找的帮助。 Also, I had to leave that project/site and head to another, so I won't be able to try any ideas you all throw at me until tomorrow, at the earliest.此外,我不得不离开那个项目/站点并前往另一个项目/站点,所以我最早要到明天才能尝试你们向我提出的任何想法。

Please take a look at these answers in a similar question .在类似问题中查看这些答案。 From the list you provided it appears some of these may be new things to try for your case.从您提供的列表中可以看出,其中一些可能是为您的案例尝试的新事物。

Specifically, I have run across the following answers in that linked question that have worked for me at various times in my career:具体来说,我在该链接问题中遇到了以下答案,这些答案在我职业生涯的不同时期都对我有用:

  • If you're using Anonymous Authentication, IIS 7 will use the "IUSR" account for directory access (unless you've set it to use the app pool identity. If you haven't granted IUSR sufficient permissions on your site's folders and files, you'll get this error如果您使用匿名身份验证,IIS 7 将使用“IUSR”帐户进行目录访问(除非您已将其设置为使用应用程序池标识。如果您尚未授予 IUSR 对站点文件夹和文件的足够权限,你会得到这个错误
  • For me in windows 7 it started to work only after I gave 'Read & execute', 'List folder contents', 'Read' permissions to site folder for both users对我来说,在 Windows 7 中,只有在我为两个用户的站点文件夹授予“读取和执行”、“列出文件夹内容”、“读取”权限后,它才开始工作

    • IUSR IUSR
    • NETWORK SERVICE网络服务
  • I had the same problem, I enabled "Anonymous Authentication" but it still did not work.我遇到了同样的问题,我启用了“匿名身份验证”但它仍然不起作用。 So I also ENABLED "Forms Authentication" Then it worked without any problems.所以我也启用了“表单身份验证”然后它就可以正常工作了。 (also try windows auth) (也尝试 Windows 身份验证)
  • For me, nothing worked except the following, which solved the problem: open IIS, select the site, open Authentication (in the IIS section), right click Anonymous Authentication and select Edit, select Application Pool Identity.对我来说,除了以下解决问题的方法外没有任何效果:打开 IIS,选择站点,打开身份验证(在 IIS 部分),右键单击匿名身份验证并选择编辑,选择应用程序池标识。
  • I gave access to "IIS_IUser" but instead it should be "IUSR".我允许访问“IIS_IUser”,但它应该是“IUSR”。 That solved the problem.那解决了问题。

I have a very similar problem with yours and my architecture uses windows authentication and what works for me is selecting my project and going to properties.我和你有一个非常相似的问题,我的架构使用 Windows 身份验证,对我有用的是选择我的项目并转到属性。 Then select "Enabled" on Windows Authentication.然后在 Windows 身份验证上选择“启用”。

在此处输入图片说明

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

相关问题 无法启动程序,访问被拒绝 C# net6.0 - Unable to start program, Access is denied C# net6.0 从Visual Studio调试Process.Start时拒绝访问 - Access is denied when debugging Process.Start from Visual Studio Visual Studio 无法复制文件...访问路径被拒绝 - Visual Studio Unable to Copy File ...Access to the Path is Denied 无法启动Visual Studio 2013/2012中的程序进行调试 - Unable to start program in Visual Studio 2013/2012 for debugging Visual Studio 2012随机调试器启动失败:无法启动程序 - Visual Studio 2012 random debugger startup failure: Unable to start program Visual Studio:无法添加到网站...无法添加文件...访问被拒绝错误 550 - Visual Studio: Unable to add to the Web site… Unable to add file… Access is denied Error 550 Visual Studio,直接编译成程序文件的最佳方法(访问被拒绝的问题)? - Visual Studio, best way to compile directly to Program Files (access denied issues)? Visual Studio 2012调试MVC 4访问被拒绝 - Visual Studio 2012 Debugging MVC 4 Access Denied 无法启动程序。 [VALUE].dll 不是 Visual Studio 2017 中有效的 Win32 应用程序错误 - Unable to start program. [VALUE].dll is not a valid Win32 application error in Visual Studio 2017 Visual Studio 2012“无法启动调试” - Visual Studio 2012 “Unable to start debugging”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM