Visual Studio 开发服务器使用错误的端口

发布于 2024-07-14 07:02:13 字数 695 浏览 10 评论 0原文

上一篇相关我认为问题已解决,但实际上并未解决...

我认为我的 Visual Studio 2008 安装可能有点混乱。

  1. 当我的 ASP.NET 项目设置为使用具有固定端口的 VS Dev Server 时,我收到 链接问题
  2. 当我的项目设置为使用随机(自动分配)端口号时,它可以工作,但它使用比实际开发服务器端口号小 3 的端口号启动浏览器(例如,如果端口号为 1903,则浏览器启动到 http://localhost:1900/
  3. 如果我对项目设置进行更改,它们不会“采取”直到我保存并重新启动 Visual Studio。

有什么想法如何追踪这个吗?

谢谢!

Related to a previous issue that I thought was resolved and actually isn't...

My Visual Studio 2008 installation may be a bit messed up, I think.

  1. When my ASP.NET project is set up to use VS Dev Server with a fixed port, I get the "Port in use" error described in the linked question.
  2. When my project is set up to use a random (auto-assigned) port number, it works, but it launches the browser using a port number 3 less than the actual Dev Server port number (e.g. if the port number is 1903, the browser launches to http://localhost:1900/)
  3. If I make changes to the project settings, they do not "take" until I save and restart Visual Studio.

Any ideas how to track this one down?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

硪扪都還晓 2024-07-21 07:02:13

我遇到了类似的问题,同时影响了我的两台主机。 经过调查,我发现它与 Eset 个人安全有关(猜测最近的更新搞砸了一些事情)。 为了解决这个问题,我从活动浏览器过滤中排除了 VS2008 - 这是在:
设置-> 高级防火墙设置-> 防病毒软件 反间谍软件 -> 网络访问保护-> HTTP-> webbrowsers

在这里取消选择 vsdev 解决了问题 - 有趣的是,禁用防火墙和防病毒/反间谍软件并没有解决问题,因此如果您正在运行不同的安全软件,则值得寻找类似的设置

I had a similar problem which hit my 2 main machines at the same time. On investigating I found it to be related to the Eset personal security (guessing a recent update messed something up). To solve it I excluded VS2008 from the active browser filtering - this is in:
setup -> advanced firewall setup -> antivirus & anti spyware -> web access protection -> HTTP -> webbrowsers

Deselecting vsdev in here fixed the problem - interestingly enough disabling the firewall and antivirus / antispyware did not solve the issue, so it is worth looking for a similar setting if you are running different security software

浪荡不羁 2024-07-21 07:02:13

首先尝试终止所有“WebDev.WebServer.exe”进程。

  • 在解决方案资源管理器中,单击应用程序的名称。
  • 在“属性”窗格中,单击“使用动态端口”旁边的向下箭头,然后从下拉列表中选择“False”。这将启用端口号属性的编辑。
  • 在“属性”窗格中,单击“端口号”旁边的文本框并输入端口号。
  • 单击“属性”窗格外部。 这将保存属性设置。

希望这可以帮助

First try to kill all "WebDev.WebServer.exe" processes.

  • In Solution Explorer, click the name of the application.
  • In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list.This will enable editing of the Port number property.
  • In the Properties pane, click the text box beside Port number and type in a port number.
  • Click outside of the Properties pane. This saves the property settings.

Hope this helps

豆芽 2024-07-21 07:02:13

我非常同意Macros的回答。 只是想分享 Eset Nod32 v5 的解决方案

ESET NOD32 v5 中,要允许 Visual Studio 运行开发或 IIS Express 服务器,您必须在 Nod32 中取消选中 Visual Studio 高级设置 => 网络和电子邮件 => 协议过滤=> 网络和电子邮件客户端

I do absolutely agree with Macros' answer. Just want to share solution for Eset Nod32 v5

In ESET NOD32 v5 to allow Visual Studio to run Development or IIS Express server you must uncheck Visual Studio in Nod32 Advanced Setup => Web and Email => Protocol filtering => Web and email clients

冷血 2024-07-21 07:02:13

诡异的!

端口号存储在 .sln 文件中。 因此,我会先将解决方案文件删除,然后重新创建它,看看会发生什么。 如果这没有帮助,我会转到 web.config 文件并将其删除并重新开始。

Weird!

The port number is stored in the .sln file. So, I'd blow that away the solution file first, re-create it and see what happens. If that doesn't help, I'd then move onto the web.config file and blow that away and start again too.

超可爱的懒熊 2024-07-21 07:02:13

我也遇到了同样的错误信息:

<块引用>

无法启动 Visual Studio 开发服务器,因为端口 [xxxx] 正在使用中。

但是,我没有安装 ESET。 相反,我最近在我的计算机上安装了 GlassFish 服务器,这导致了问题。 因此,在 Windows 任务管理器中,我杀死了它运行的进程 java.exe 并解决了问题。

I also encountered the same error message:

Unable to launch Visual Studio development server because port [xxxx] is in use.

However, I do not have ESET installed. Instead, I had recently installed GlassFish server on my machine and that was causing the problem. Therefore, in Windows Task Manager, I killed the process it runs under which is java.exe and it fixed the problem.

稚然 2024-07-21 07:02:13

这也适用于 Visual Studio 2010。

而且还有更多内容。

症状:

  • Web(服务)项目配置为在特定端口(例如 10080)运行。
  • 一段时间后,Visual Studio 抱怨“无法启动 Visual Studio 开发服务器,因为端口“10080”正在使用中
  • 原因尚不清楚。 这可能与 webdev 服务器崩溃有关。
  • 重新启动电脑并不能解决问题。
  • Netstat 不显示端口 10080 的条目
  • 在端口 10080 处手动启动 WebDev.WebServer40.exe 工作正常。

由于我想从 Visual Studio 中开始,因此我移至端口 10081,然后移至 10082,今天移至 10083。我的端口已用完。

不起作用的解决方案

  • 重新启动 Visual Studio
  • 调整 Trendmicro 安全设置(无法访问它们)
  • 禁用 Forticlient 防病毒/防火墙

有效的解决方法


  • 将我的项目配置为手动启动服务器
  • 右键单击​​项目,选择属性
  • 单击选项卡“Web”
  • 选择启动操作“启动外部程序”并将其指向 Webdev.Webserver40.EXE
    (对我来说:C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.EXE)
  • 命令行参数:/port:10080 /path:C:\Solution\Project< /strong>
  • 工作目录:C:\Solution\Project
  • 在服务器下选中“使用自定义 Web 服务器
  • 不要选中任何调试器复选框

副作用:我的项目认为 断点没有被击中。 (“未加载符号”)。 事实证明它们按照应有的方式工作。

我希望任何人都能找到一个明确的解决方案,但在此之前这个解决方法对我来说已经成功了。

This also applies to Visual Studio 2010.

And there is more to it.

Symptoms:

  • A Web (Services) project is configured to run at a specific port, e.g. 10080.
  • After a while Visual Studio compains “Unable to launch the Visual Studio Development Server because port ’10080′ is in use
  • The reason is still unclear. It might have something to do with the webdev server crashing.
  • Restarting the pc doesn't solve the problem.
  • Netstat doen’t show an entry for the port 10080
  • Manually startin WebDev.WebServer40.exe at port 10080 works fine.

Since I'd like to start from within Visual Studio, I moved to port 10081, then to 10082, and today to 10083. I’m running out of ports.

Solutions that did not work:

  • Restart Visual Studio
  • Tweaking Trendmicro security settings (couldn't access them)
  • Disabling Forticlient antivirus/firewall

Workaround that DOES work:


  • Configuring my project to manually start the server
  • Right click the project, choose properties
  • Click the tab "Web"
  • Pick for start action "Start external program" and point it to Webdev.Webserver40.EXE
    (for me: C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.EXE)
  • Command line arguments: /port:10080 /path:C:\Solution\Project
  • Working directory: C:\Solution\Project
  • Under servers check "Use Custom Web Server"
  • Do not check any debugger checkbox

Side effect: my project thinks break points are not getting hit. ("no symbols loaded"). Turns out they work like they should.

I hope anybody ever finds a definitive solution, but up until then this workaround does the trick for me.

朦胧时间 2024-07-21 07:02:13

要解决您的问题,只需重新启动您的电脑即可。 我也遇到过同样的问题,我做了同样的事情。

To solve your problem, just restart your PC. I've had the same problem, I did the same thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文