views:

183

answers:

2

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?

+3  A: 

devenv.exe solution.sln /build "Release"

Daniel
+3  A: 

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.

nitzmahone
or better yet, use CC.NET and have it continuously build your solution for you using msbuild.
Lucas B