VS 2008调试器:如何确定在哪个Cassini端口下运行Web服务? [英] VS 2008 debugger: How does it decide what Cassini port to run a web service under?

查看:78
本文介绍了VS 2008调试器:如何确定在哪个Cassini端口下运行Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VS 2008解决方案,其中包括一个网站和一个Web服务。我同时开发了两者,因此能够从一个调试到另一个调试很有帮助。

I have a VS 2008 solution that includes a web site and a web service. I'm developing both at once, and it's helpful to be able to debug from one into the other.

它有时找不到Web服务。如果我查看web.config,则发现它正在查看的端口号不是使用调试器时自动运行该服务的端口号。例如,web.config参考中的内容类似于:

It occasionally can't find the web service. If I look in the web.config, I find the port number it's looking at is not the port number it auto-runs the service in when I use the debugger. For example, the web.config reference says something like:

添加密钥= mynamespace.mywebservice value = http:// localhost:55765 / mywebservice.asmx

add key="mynamespace.mywebservice" value="http://localhost:55765/mywebservice.asmx"

当我将鼠标悬停在Cassini端口图标上时,我发现Web服务正在端口55382(或其他一些非55765端口)中运行。难怪找不到它。

When I hover over the Cassini port icon, I find that the web service is running in port 55382 (or some other non-55765 port). No wonder it can't find it.

有没有一种方法可以强制其运行的端口号是网络配置中指定的端口号?如果它没有使用网络配置端口号来确定在哪里运行,它将在哪里决定?我知道在VS2005中,有一种方法可以指定调试时使用的端口号,但在VS 2008中的Web服务项目中找不到该端口号。

Is there a way to enforce that the port number it runs under is the one specified in the web config? And if it's not using the web config port number to figure out where to run it... where does it decide? I know in VS2005, there was a way to specify the port number to use when debugging, but I can't find that anywhere in the web service project in VS 2008.

随着越来越多的开发人员加入该项目,这确实会引起问题-我该如何解决?删除Web服务并将其重新添加到项目中即可对其进行修复,但实际上我每天必须做几次,而不是理想的解决方案。

This is really going to cause problems as more developers come on to this project - how can I fix it? Deleting and re-adding the web services to the project fixes it, but I'd literally have to do it a couple times a day, not an ideal solution.

推荐答案

今天,当我寻找解决方案时,我偶然发现了这个问题...如上所述,您可以使用记事本打开解决方案。查找行:

I stumbled across this today when I was lookign for a solution... As stated above you can open the solution with notepad. Look for the line:

VWDPort = "55071"

并将端口号更改为所需的端口号。保存文件。如果您打开了解决方案,则系统将提示您重新加载。如果不重新启动VS,您应该一切顺利。我不知道VS中是否有选项,但这对我来说是个简单的技巧。

and change the port number to what you would like. Save the file. If you have the solution open you should be prompted to reload. If not restart VS and you should be good to go. I don't know if there is an option in VS, but this was an easy hack for me.

这篇关于VS 2008调试器:如何确定在哪个Cassini端口下运行Web服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆