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.
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.
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...
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.
精彩评论