0

Under vs10 msbuild.exe how can a specific project within a solution.sln be Ignored?

I am building a large project that is moving to Visual Studio 10.0. In the IDE I can uncheck a project within the configuration manager and it will not build it. I need to mimic that behavior with a command line call to msbuild.exe.

The project I want to bypass is an *.dll plugin with a link error. I am stuck on stupid with the link error at the moment and since it stands alone, I can run the main program with out it and just live with a warning at run time that it isn't present.

I need some switch magic concerning calls to msbuild.exe.

NickyP
  • 91
  • 1
  • 7
  • possible duplicate of [Skip a project while building a solution using msbuild 3.5](http://stackoverflow.com/questions/1627483/skip-a-project-while-building-a-solution-using-msbuild-3-5) – Ruben Bartelink May 12 '11 at 10:52
  • Sorry, got wrong end of stick, would like to `Recall:` the vote-to-close.... – Ruben Bartelink May 12 '11 at 10:54

1 Answers1

2

If you have a certain configuration in the sln (configured in VS Configuration Manager) that you want to build with MSBuild, you can do so with the following command line:

msbuild /p:Configuration=MyConfiguration MySolution.sln

Aaron Marten
  • 6,548
  • 1
  • 32
  • 41
  • I want to exclude a project within MySolutions.sln. Been trying to exclude it with cmake when it contructs the Mysolution.sln but havent got there yet. – NickyP Feb 20 '11 at 20:01
  • Try diffing versions of the SLN file before and after making the changes in Visual Studio to exclude the project. Then you'll know the right things to be including/excluding in your .sln generation process. – Aaron Marten Feb 20 '11 at 20:55