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

Posted by BDW on Stack Overflow See other posts from Stack Overflow or by BDW
Published on 2009-08-24T13:22:43Z Indexed on 2010/03/12 9:07 UTC
Read the original article Hit count: 255

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.

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:

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

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.

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.

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.

© Stack Overflow or respective owner

Related posts about cassini

Related posts about web-services