[英]IIS Express 'The specified port is in use' Visual Studio 2015
Apologies about the long message, but I thought I should let you know what I have already tried.对长消息深表歉意,但我想我应该让你知道我已经尝试过什么。
I've very recently started learning C# through Visual Studio and all was going OK until about three weeks ago.我最近开始通过 Visual Studio 学习 C#,直到大约三周前,一切都很顺利。 I clicked on the button with a green triangle which did the usual thing of launching the internet page, but the site never loads.
我点击了带有绿色三角形的按钮,它执行了启动 Internet 页面的常规操作,但该站点从未加载过。 I then noticed there was an ISS Express notification which brings up the following (can't figure out how to get my cropped screen shot on here):
然后我注意到有一个 ISS Express 通知,它显示了以下内容(无法弄清楚如何在此处获取我的裁剪屏幕截图):
'The Specified port is in use Port 49665 is already being used by process "svchost.exe" (process ID "2112") Recommendations '指定的端口正在使用端口 49665 已被进程“svchost.exe”(进程 ID“2112”)使用建议
I have managed to locate the svchost.exe on my computer and it is in the system 32 folder.我已设法在我的计算机上找到 svchost.exe,它位于系统 32 文件夹中。 There doesn't appear to be an option to stop it, and I am worried deleting it will break my operating system (I did click delete to see what happens and got an error saying I need permission from trusted installer to do this, but didn't go any further).
似乎没有一个选项可以阻止它,我担心删除它会破坏我的操作系统(我确实点击了删除以查看会发生什么并收到错误消息,说我需要受信任的安装程序的许可才能执行此操作,但没有不再继续)。 When I open task manager and look through all tasks, including 'background tasks' and 'windows processes' and can't see it anywhere
当我打开任务管理器并查看所有任务时,包括“后台任务”和“Windows 进程”并且在任何地方都看不到
I have tried to follow the advice in this discussion: IIS Express Web Server Port Is In Use我已尝试遵循此讨论中的建议: 正在使用 IIS Express Web 服务器端口
But I cannot fully understand where the solution was- I don't think I have anything called ISS installed, however there is a Local ISS when I go to 'file', 'open website', which I found through the following: Why and how to fix?但是我无法完全理解解决方案在哪里 - 我认为我没有安装任何名为 ISS 的东西,但是当我转到“文件”、“打开网站”时有一个本地 ISS,我通过以下方式找到了: 为什么和怎么修? IIS Express "The specified port is in use"
IIS Express“指定的端口正在使用中”
I did as the answer marked 21 (with the green tick) suggested and restarted my computer (as one of the comments suggested) however my problem persists.我按照标记为 21(带有绿色勾号)的答案建议并重新启动了我的计算机(如建议的评论之一),但是我的问题仍然存在。 There is no longer anything under 'IIS Express Sites'
“IIS Express 站点”下不再有任何内容
I have closed all browsers then tried, restarted and then tried, still no luck The third answer (7) I really don't know how to do this (I don't know what solution they are referring to), so if this is a potential solution I'd be happy for further instructions我已经关闭了所有浏览器,然后尝试,重新启动,然后尝试,仍然没有运气第三个答案(7)我真的不知道该怎么做(我不知道他们指的是什么解决方案),所以如果这是一个潜在的解决方案我很乐意得到进一步的说明
The answer marked with a 5 about netstat -aob helped me locate a task called 'service host: local service (network restricted) (6)'.标有 5 的关于 netstat -aob 的答案帮助我找到了一个名为“服务主机:本地服务(网络受限)(6)”的任务。 Trying to terminate this task brings up an error saying that by terminating this task Windows will become unusable- so I assume this is why I couldn't delete the above.
尝试终止此任务会出现一个错误,指出终止此任务 Windows 将无法使用 - 所以我认为这就是我无法删除上述内容的原因。 The final part of this answer about elevated access I don't know what this means or how I would do this.
这个关于提升访问权限的答案的最后一部分我不知道这意味着什么或我将如何做到这一点。
Closing visual studio and restarting as an administrator doesn't fix the problem.关闭 Visual Studio 并以管理员身份重新启动并不能解决问题。
I only have Edge and Internet Explorer and I have ended these via task manager whenever I have tried to resolve this problem, but it persists I tried the answer at the bottom, but was not able to locate the folder IISExpress, maybe this is part of the problem?我只有 Edge 和 Internet Explorer,每当我试图解决这个问题时,我都通过任务管理器结束了这些,但它仍然存在我尝试了底部的答案,但无法找到文件夹 IISExpress,也许这是的一部分问题?
Any suggestions where I might be going wrong with the above, or any further advice on how to progress some of the things above, or any new ideas will be welcome.任何我可能在上述方面出错的建议,或关于如何推进上述某些事情的任何进一步建议,或任何新想法都将受到欢迎。
Thanks for the suggestion Methodman.感谢 Methodman 的建议。 After much digging I found the solution you suggested here (change the port): How can i change IIS Express port for a site
经过大量挖掘,我找到了您在此处建议的解决方案(更改端口): 如何更改站点的 IIS Express 端口
The answer provided provides excellent instructions with a step by step guide on how to change the port所提供的答案提供了极好的说明以及有关如何更改端口的分步指南
Just changed the port number until I got one that worked :)只是改变了端口号,直到我得到一个可以工作的:)
Ed埃德
It is an old post but just in case someone having the same issue recently;这是一个旧帖子,但以防万一最近有人遇到同样的问题; I tried many things including removing websites, running VS in administration mode.
我尝试了很多事情,包括删除网站、在管理模式下运行 VS。 Nothing worked.
没有任何效果。 Then I finally changed the port which finally worked.
然后我终于改变了最终工作的端口。 Right Click on project.
右键单击项目。 Go to Web on the left menu.
转到左侧菜单中的 Web。 And change the port number at the end of the project url to whatever you want.
并将项目 url 末尾的端口号更改为您想要的任何内容。 I changed it to 50645.
我将其更改为 50645。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.