SpokaneDude
SpokaneDude

Reputation: 4974

How to prevent one of the projects in a solution from being built?

I have a VS solution with two projects: one is the actual code (which builds into a dll), the other is sample code that exercises the dll code. Without deleting the sample code, is there a way I can prevent the build from outputting the sample code?

Upvotes: 0

Views: 102

Answers (2)

Roman Ryltsov
Roman Ryltsov

Reputation: 69632

Open solution properties in Solution Explorer, right click, Properties, then Configuration Properties, then uncheck the projects you don't want to build in this configuration.

Check Solution Configuration on MSDN for details.

enter image description here

Upvotes: 1

ChrisF
ChrisF

Reputation: 137108

Create a new configuration that just includes the "real" code and build that.

Go to Build > Configuration Manager... then select <New> from the "Active solution configuration:" combo box.

You can copy a configuration from one of the existing ones and then just deselect your sample code project.

Upvotes: 1

Related Questions