VS 2008 debugger: How does it decide what Cassini port to run a web service under?

对着背影说爱祢 提交于 2019-12-02 06:20:10

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"

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.

from here

By default, Cassini assigns a random port number to each website it hosts. This port number gets assigned the first time you start the site using the Visual Studio debugger, and then gets persisted for the life of the solution.

You can disable this behavior by selecting the project node for your Web Project in Solution Explorer and choosing View->Properties Window (Ctrl-W, P). Change “Use Dynamic Ports” to False and then specify a TCP port of your liking (best to keep this between 1000–5000, but it can technically be any unused TCP port).

This will give your Cassini-hosted site a deterministic port number, and make it easier to write Indigo clients that use services hosted on that site.

In VS2008 Solution Explorer: Right click your web project, choose Properties. On the left side, click "Web" and you'll see the port options under Servers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!