且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法启动ASP.NET开发服务器,因为端口'1900'正在使用中

更新时间:2023-01-17 22:29:53

只需结束所有Webdev.WebServer.exe进程 - 为我的伎俩。
偶尔,这个无法启动,因为端口正在使用错误发生时,其中一个可视工作室进程(webdev.webserver.exe)仍在运行和锁定。 webdev.webserver进程应该在关闭浏览器或应用程序时结束,但是如果他们不(例如我的Visual Studio崩溃,但如果让Web服务器仍然运行),那么这可能锁定端口,这将阻止Visual Studio启动您的项目。当您尝试F5的应用程序(从Visual Studio启动您的应用程序),然后它与当前使用的端口冲突,并且上述',因为端口XYZ正在使用显示错误。



所以要解决它:在状态栏(在Windows时钟旁边)右键单击并停止所有ASP.net开发服务器图标。您还可以打开任务管理器并终止所有的webdev.webserver.exe进程。




Possible Duplicate:
Visual Studio Development Server using wrong port

I don't know what has got into my computer today. I was developing just fine in VS 2008 and testing my ASP.NET web site on my development server.

Then suddenly, out of the blue, I can't run my web site any more! As soon as I hit F5, the message appears: Unable to launch the ASP.NET Development server because port '1900' is in use. And it doesn't matter what port I change to, it's always in use! AAARRRGGGHH!!!

I have tried:

  • Changing the port number
  • Restarting Visual Studio
  • Rebooting my machine
  • Installing IIS

Clue: My IIS refuses to start. But I didn't have IIS installed when I was happily working earlier, so that is probably not the issue; it might just be highlighting something else...

Thanks in advance...


Update: after rebooting, IIS does start, but the problem here persists.

Simply end all Webdev.WebServer.exe processes - did the trick for me. Occasionally this 'unable to launch because port is in use' error happens when one of the visual studio processes (webdev.webserver.exe) is still running and locked. The webdev.webserver process(s) should end when you close your browser or app but if they dont (for instance my Visual Studio crashed but if left the webserver still running) then this could lock the port and this will prevent visual studio from launching your project. When you try to F5 your app (launch your application from visual studio) then it conflicts with the current port in use and the above 'because port XYZ is in use' error is displayed.

So to fix it: in the status bar (next to your windows clock) right-click and 'Stop' all the ASP.net development server icons. You can also open task manager and kill all the webdev.webserver.exe processes.