views:

348

answers:

3

I am re-hashing this question because I have looked at over 50 threads in different forums and have not been able to get a resolution to my problem. Here are the specs:

Windows XP SP3, Visual Studio 2008 SP1, .NET 3.5, ASP. NET MVC 2 project, IE 7 (was IE 8)

Up until a few days ago I was not having any issues. It is now happening on any solution that I try to debug. I start a debug session (F5), the solution rebuilds, a VS development web server starts and then I get this error:

Unable to start program http://localhost:2012/

If I open a web browser and enter the URL the application loads up. I had upgraded to IE 8 a few weeks ago and read there may be some issues so it has been uninstalled and I am currently on IE 7. Also, while IE 8 was installed I had switched my default browser to Firefox but my current default broweser is now IE7.

I have reveiewed the threads on this site and others and have not been able to fix the issue. Any help would be appreciated.

+1  A: 

I can't help you directly, but I will give you an alternate suggestion. When I debug, I launch the site in a browser, and then use Debug -> Attach To Process to start the debugging session. This works much faster for me than starting the app from VS.

I am using IIS on XP, not the VS dev server, so I attach to the aspnet_wp.exe process. The dev server process name may be different.

Ray
Actually I do the same, and I use also a blank page with the Debug.Assert(false) to attach the visual studio even faster :). When I won to debug, I just run this page. (+1 from me)
Aristos
@Aristos: cool idea - I'll have to try it
Ray
Thanks for the answer. I agree that this is a viable wrokaround but it doesn't really solve the underlying problem.
JookyDFW
@JookyDFW: I started using this solution because I was so tired of fighting the underlying problem :) - good luck
Ray
I never figured out what was going on but the problem resolved itself when my HD crashed and I got a new Windows 7 system.
JookyDFW
A: 

I have not seen this type of issue, but my first thought is that it sounds like a windows configuration issue; After starting the web server, VS is going to try opening the web browser through the operating system. Just as an experiment, can you open a command prompt and try running "start http://www.google.com/". This should open a browser window, but I am thinking that it will fail.

Unfortunately, I don't know how to fix it, just hopefully if you can narrow it down and recreate it outside of Visual Studio, maybe it will help you track it down and fix it...

Chris Shaffer
Chris, tried your suggestion and the browser opened up with google. I think this is some kind of security issue (see comments under original question). Thanks.
JookyDFW
A: 

I do exactly the same with Rays answer, is very faster for develop.

How ever, on small test projects I have the same issue, on two computers - both of them using firewalls, the one xp, the other vista.

The problem if you check it is on Port. After you press the F5, the port that send by visual studio is for example :2000 but the port that localserver start the port on +2 or +3 ( eg starts on :2002)

I have read that the firewall makes that, when the localserver go to run, is not get permission for some reason to starts on port 2000, and start try to 2001, then to 2002 etc and stop after 2-3 numbers and run.

Probably have something to do with the ports and the firewall permissions...

I did not have found the actual reason and I am just go for the moment and correct the port.

Aristos
Thanks for the reply but this is not my problem. I can launch IE after the error message and enter the same url and the app starts
JookyDFW
Yes you enter the same url - what about the port ? is the same ?
Aristos
@Aristos: Yes the port is the same.
JookyDFW
@JokkyDFW, can you please check from ie menu, Tools|Internet Options|Connections|LAN Settings -> if you have set any proxy, and not bypass local adresses, and if you have or not the Automatically detect settings - try to change it for test. Do you have firewall ?
Aristos