Daniel
Daniel

Reputation: 16216

Programmatically build a Visual Studio solution?

Is there a way to programmatically build Visual Studio solutions? E.g. if you are inside a console app, can you programmatically build an existing solution elsewhere?

Upvotes: 6

Views: 1160

Answers (3)

Dan Vanderboom
Dan Vanderboom

Reputation: 121

You should no longer use the Microsoft.Build.BuildEngine.Engine class. Per MSDN, "This class has been deprecated. Please use Microsoft.Build.Evaluation.ProjectCollection from the Microsoft.Build assembly instead."

Upvotes: 0

nitzmahone
nitzmahone

Reputation: 13940

Sure- MSBuild is included on any machine with .NET 2.0 or better installed. Just call it and pass the solution file, or drive the MSBuild classes (see Microsoft.Build.BuildEngine.Engine) from your code to do it.

Upvotes: 6

Daniel
Daniel

Reputation: 16216

devenv.exe solution.sln /build "Release"

Upvotes: 3

Related Questions