Answered by:
Control project build list based on 'startup project'

Question
-
Say you have 3 projects in Visual Studio: Test.WinformApp, Test.WebApp and Test.API where Winform App and the Web App both reference the API project and Test.WinformApp is the startup project.
When I hit F5 Visual Studio builds Test.WebApp and launches the 'ASP.NET Development Server' eventhough that application is not needed (Test.WinformApp is startup).How do I configure Visual Studio to only build projects in the dependency list of the startup project?
In addition, how do I prevent 'ASP.NET Development Server' from loading for every webservice/webapp in my solution eventhough I have no intention to use them at that moment?
We have a team working on a large solution with several projects (Winform UI, Web UI, Webservices, BLL, DAL...) and as a result of this issue, starting up debugging is very slow.
Thanks
Monday, January 26, 2009 4:54 PM
Answers
-
Hi jvonbart,
I can see 2 issues here:
1. If you don't want to build some of the projects in solution, you can open Build -> Configuration Manager (or right-click on solution and select Configuration Manager), then uncheck checkbox in Build column for those project. They will be excluded from the build process.
2. There is a special setting which Hongye mentioned to prevent ASP.NET Development from starting when you launch other project. You need to open Properties window (not project properties document, but property grid-like window) by selecting from menu View -> Other Windows -> Properties window or press Alt + Enter. Then select you web project in Solution Explorer. You will see the following option in properties window: "Always Start When Debugging". Select False and development server will not be launched when you debug other projects.
I think these 2 steps should resolve your issues.
Andrew Pechersky, VS Diagnostics Team. The posting is provided "AS IS".- Marked as answer by Andrew Pechersky - MSFT Thursday, February 5, 2009 9:50 PM
Thursday, February 5, 2009 9:49 PM
All replies
-
To prevent website from building, you can do:
In Visual Studio -> Builds -> Configuration Manager -> uncheck in build column of the web site project -> close
To prevent web server from starting, it seems no good way to prevent it. A workaround is in project properties -> Web -> Use Custom Web Server and type a dummy URL. Or you can just start website from IIS.
Hope it helps.
Hongye Sun [MSFT]
Thursday, January 29, 2009 9:22 AM -
Sorry, jvonbart.
Correct one statement in my previous reply.
It is possible to let web server stop running when deubugging. Here is the steps:
1. Select webapp/webservice project.
2. Open properties window (View -> Properties Window)
3. Development Server -> Always Start When Debugging -> Change True to False
Hongye Sun [MSFT]- Proposed as answer by Andrew Pechersky - MSFT Monday, February 2, 2009 11:09 PM
- Marked as answer by liurong luo Tuesday, February 3, 2009 1:50 AM
- Unmarked as answer by jvonbart Wednesday, February 4, 2009 2:40 PM
Monday, February 2, 2009 3:41 AM -
Thanks for your responses.
I am using VS2008 SP1 and I don't see that setting in my webservice/WebApp project properties. The core of my question is a little more advanced though...
I have a team of developers all working on on the same solution that includes a webapp, winform app, common API, WCF service...
I want to configure my solution so that when the winforms developer sets his project to be the startup project, unecessary projects do not build (webapp, webservice...) and in addition the development server for the webApp and web service do not load.
We have a very large solution and developers are waiting around waiting for the debugger to startup because these uneeded projects are compiling and starting.
Regards,
-JasonWednesday, February 4, 2009 2:52 PM -
A question in the case would be: why are you using the same solution for all these different types of projects instead of creating a separate solution for each group of developers, so that I don't have to open or build project that I have no business with?
Alex Bulankou, Microsoft Corporation. This posting is provided "AS IS".Wednesday, February 4, 2009 10:08 PM -
Sure,
We have a common Business Layer and Data Layer that all UI developers leverage/enhance in their workflow and all of this is managed with a source control system. Using a single solution is the cleanest approach to this that we know of because the developers need to be able to step into/enhance the layers at anytime.
For example
XYZApp (Solution)
(Solution Folder - Config files, 3rd Party DLLs, Images...)
>XYZAPP.BusinessLayer
>XYZAPP.DataAccessLayer
>XYZAPP.Utility
>XYZAPP.WinformsApp
>XYZAPP.WebApp1 (Research Reports)
>XYZAPP.WebApp2 (Report Builder)
>XYZAPP.Webservice
>XYZAPP.UnitTests
>XYZAPP.BuildEvents
etc...
When the Winforms developer tries to debug (hits F5) all projects build and 3 seperate Development Servers start up even though the Winforms application has no dependencies on these projects. Ideally, only the projects that the Winforms application needs (BusinessLayer, DataAccessLayer, Utility) should build and startup.Thursday, February 5, 2009 1:07 AM -
Hi jvonbart,
I can see 2 issues here:
1. If you don't want to build some of the projects in solution, you can open Build -> Configuration Manager (or right-click on solution and select Configuration Manager), then uncheck checkbox in Build column for those project. They will be excluded from the build process.
2. There is a special setting which Hongye mentioned to prevent ASP.NET Development from starting when you launch other project. You need to open Properties window (not project properties document, but property grid-like window) by selecting from menu View -> Other Windows -> Properties window or press Alt + Enter. Then select you web project in Solution Explorer. You will see the following option in properties window: "Always Start When Debugging". Select False and development server will not be launched when you debug other projects.
I think these 2 steps should resolve your issues.
Andrew Pechersky, VS Diagnostics Team. The posting is provided "AS IS".- Marked as answer by Andrew Pechersky - MSFT Thursday, February 5, 2009 9:50 PM
Thursday, February 5, 2009 9:49 PM