Visual Studio 2008 开发 Web 服务器问题

发布于 2024-07-19 03:29:49 字数 285 浏览 1 评论 0原文

我有一个带有 asp.net 2.0/C# 网站的 Visual Studio 2008 解决方案。 当我按 F5 进行调试时,cassini - 开发网络服务器正确启动并将其自身挂接到系统托盘中。 但这之后就有问题了。 如果 cassini 从端口 4004 启动,浏览器会查找端口 4002。然后我必须手动将浏览器地址栏中的端口更改为 4004 才能启动网站。

我在VS2005 SP1中也遇到过这个问题。 这真的让我很痛苦,因为我花费了大量时间手动更改浏览器地址栏中的端口。 MSDN 上没有关于此问题的帮助。

I'm having a visual studio 2008 solution with asp.net 2.0/C# website. When I press F5 to debug, cassini - the development webserver starts properly and hooks it self in the system tray. But there's a problem after this. If cassini starts at say port 4004, the browser looks for port 4002. I will then have to manually change the port in my browser address bar to 4004 to start the website.

I've encountered this problem in VS2005 SP1 as well. This is really killing me by eating lot of my time incurred in manually chaning the port in browser address bar. No help available on this issue on MSDN.

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

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

发布评论

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

评论(4

拒绝两难 2024-07-26 03:29:49

您是否正在运行 ESET NOD32 防病毒软件? 其防火墙可能导致该问题:

ESET NOD32 和 Visual Studio 端口号

Are you running ESET NOD32 Antivirus? Its firewall is likely causing the issue:

ESET NOD32 and Visual Studio Port Numbers

野生奥特曼 2024-07-26 03:29:49

您是否尝试过通过 Web 应用程序设置来设置特定端口? 使用固定端口而不是自动分配应该可以解决这个问题。

如果没有,您可以尝试以下解决方法:

右键单击您的入口页面并选择“在浏览器中查看”以在 Cassini/Web 开发服务器中启动您的 Web 应用程序。

转到“工具”->“附加到进程”并找到“WebDev.WebServer.EXE”文件或类似的文件。 标题应为“ASP.NET 开发服务器”。

这应该将调试器连接到本地开发服务器,并允许您根据需要进行调试。

Have you tried setting a specific port through the web application settings? Using a fixed port, as opposed to the auto-assign should clean that up.

If not, you can try this as a workaround:

Right click your entry page and select "View in Browser" to start up your web application in Cassini/Web Development Server.

Go to Tools->Attach to Process and find the "WebDev.WebServer.EXE" file or something similar to this. The title should read "ASP.NET Development Server".

This should hook up the debugger to your local development server and allow you do debug as needed.

維他命╮ 2024-07-26 03:29:49

我建议查看 Web 应用程序的 Web 调试属性。

  • 在 Visual Studio 中打开项目后,
  • 选择 Web 应用程序的根目录(.csproj 文件),
  • 右键单击并从上下文菜单中选择“属性”。
  • 选择属性页集的“Web”选项卡。

在“服务器”下,有 3 个选项:

  1. 使用 Visual Studio 开发
  2. 服务器、使用本地 IIS Web 服务器
  3. 使用自定义 Web 服务器

检查是否选中了“自动分配端口” “使用 Virtual Studio Development Server”,并且虚拟路径为“/”。

更改设置、保存、构建、运行,然后将它们更改回我上次遇到它时修复的“合理”值。

或者,如果您愿意,可以手动修改 .csproj 文件的 XML 以达到相同的效果。

希望这能解决它。

乔尔

I'd suggest looking at the Web debug properties for your web application.

  • With the project open in Visual Studio,
  • Select the root of the web application (the .csproj file),
  • right click and select "Properties" from the context menu.
  • Select the "Web" tab of the properties page set.

Under "Servers", there are 3 options:

  1. Use Visual Studio Development
  2. Server, Use Local IIS Web Server
  3. Use Custom Web Server

Check that "Auto-Assign Port" is selected under "Use Virtual Studio Development Server", and that the Virtual Path is "/".

Changing the settings, saving, building, running, then changing them back to "sensible" values fixed this last time I encountered it.

Alternatively, if you're up for it, you can modify the XML of the .csproj file by hand to the same effect.

Hope this fixes it.

Joel

幸福不弃 2024-07-26 03:29:49

URL 上的端口始终为 4002 还是也是随机的? 您可以在 Visual Studio 中为项目指定特定端口,但这始终使用与服务器启动相同的端口启动我的浏览器。

Is the port on the URL always 4002 or is it random also? You can specify a specific port in Visual Studio for a project, but that has always started my browser with the same port that the server started on.

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