[英]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:具体来说,我在该链接问题中遇到了以下答案,这些答案在我职业生涯的不同时期都对我有用:
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 中,只有在我为两个用户的站点文件夹授予“读取和执行”、“列出文件夹内容”、“读取”权限后,它才开始工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.