Richard Collette
Richard Collette

Reputation: 5703

Visual Studio 2010: How can I build a project and not its dependencies?

I want to be able to build a web project and not its dependencies since I know that I have not modified any of the dependencies since the last build. I am looking to cut down the build time if possible. Is there a way to do this?

Upvotes: 4

Views: 1644

Answers (4)

squeegee
squeegee

Reputation: 792

To accomplish this in something I am working on, I created my own solution, added the projects I needed (including the projects I never wanted compiled), and then in the Configuration Manager turned off the check boxes for building the projects I didn't want to build, just as arora described above.

I've also made a copy of an existing solution (that had 16 components in it), saved it under new name (foo.sln -> foo.mine.sln), and then disabled the build of all the other sub-projects except the one(s) I am working on, that way I know for sure that I got the correct build settings.

It's not the simplest solution, but it works well for me, and takes less than 2 minutes to set up and is easy to understand. I normally add the new solution to the version control ignore list so that it never gets checked in.

Upvotes: 2

Anand M Arora
Anand M Arora

Reputation: 372

You could have a solution by

  • check the setting in Tools >> Options >> Projects and Solutions >>
    Build and Run setting : Only build startup projects and dependencies on Run.
  • OR If you want to go for sophistication then :
    1. build >> Configuration Manager
    2. from the "Active solution configuration:" dropdown select ""
    3. give a name to your configuration and keep checked the "Create new project configurations" checkbox.
    4. and then choose that config that you want and set the build or not check boxes.

Upvotes: 5

spinon
spinon

Reputation: 10847

Well one way would be to remove project references. Instead stick to dll references. You could use a post build script for dependent projects that copy the updated dll to the web project whenever they change.

Upvotes: 0

Ryan Christensen
Ryan Christensen

Reputation: 7933

Rather than project references you can just add the references to the dlls directly (the Add Reference dialog has tabs for these types, choose browse rather than project and remove the other projects from your solution). I typically create a full lib and web project solution for major development. Then just a solution for the website project for fixes where I don't need updated libs/dlls.

Although it is nice to have them autocompile if they have changed during heavy development. If they haven't changed it just refreshes them and recopies them to the bin folder.

Upvotes: 0

Related Questions