How do I debug MVC 3 web application?
I have an MVC 3 web application. I need to step through the controller code. I set break point in the controller and hit F5. I get this error: Unable to launch the ASP.NET development server because port '开发者_运维技巧xxxx' is in use.
Any one has the simple steps to help me step through the code?
Visual Studio: 2010 IIS: 7.5 OS: Win 7
I find this can happen if you had been working on an ASP.NET Website (MVC or Forms), and it has been starting the web development server. Then VS crashes and leaves it running. So as @ChrisF recommends, just make sure all the web dev servers are gone, then try again.
Specifically, the process name is either
WebDev.WebServer40.exe
or
WebDev.WebServer20.exe
This error is highly unlikely in an IIS hosted scenario.
It sounds like the port is still in use from a previous execution of the application. Make sure that there are no instances of the Visual Studio web server running before you debug.
If you're using IIS to run the web site then you'll need to switch to using the Visual Studio web server or attach the debugger to the running process rather than hitting F5
.
精彩评论