开发者

Why so many instances of ASP.NET Development Server?

开发者 https://www.devze.com 2023-02-25 13:51 出处:网络
I am debugging a large web application solution, with the main web application project as a single startup project, configured to use IIS for debugging.Whenever I ru开发者_如何学JAVAn this application

I am debugging a large web application solution, with the main web application project as a single startup project, configured to use IIS for debugging. Whenever I ru开发者_如何学JAVAn this application inside Visual Studio 2010, I still get multiple instances (sometimes over 15) of the ASP.NET Development Server starting up as well. Why does this occur?


Visual Studio has a setting in every Web Project's properties by default to start the development server when you are debugging. This enables, for example, a web project which contains Web Services to be available when you've selected a client web site or application to start.

If you do not want this behaviour follow these steps:

  1. Select the web project
  2. Open the "Properties" window by pressing F4
  3. Change the Always Start When Debugging value to False
  4. Repeat steps 1-3 for any other web projects in your solution

Source: '"Always Start When Debugging" – Preventing multiple Visual Studio Development Servers from starting' by by Kevin Rintoul


A simple solution if you have many web projects in the same solution: from the Package Manager console:

get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug" } | %{ $_.Value = $False} }

This will change all web projects Always Start When Debugging setting to false with a single command.


My setup is similar to yours (except I use CassiniDev ( http://cassinidev.codeplex.com/ ))

Go to all your secondary sites project properties : click "use Custom Web Server", set something in "Server Url" (for exemple http://your-iis-server:your_port/your_project, but it may be even invalid)..

This will prevent the automatic startup of Cassini for the secondary web sites.

Leave your main site in the original configuration.

0

精彩评论

暂无评论...
验证码 换一张
取 消