Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi Friends,

I am trying to MSBuild a Web application programitically.I am able execute it from command line successfully and get the build.

Please help me in getting the same done programitically.

Thanks,
Vishant
Posted
Comments
Sergey Alexandrovich Kryukov 25-May-12 12:06pm    
Useful question, my 5.
--SA

1 solution

I would recommend stronlgy to go the official route via classes/interfaces in Microsoft.Build namespace.

Esp. the class Microsoft.Build.Execution.BuildManager and the Singleton Microsoft.Build.Execution.BuildManager.DefaultBuildManager is what you are after to run a build task... source code examples:

http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/ec95c513-f972-45ad-b108-5fcfd27f39bc/
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-12 12:05pm    
Good idea, a 5.
But one could also just run MSBuild.exe with parameters. The only problem is finding the correct location of this executable for appropriate version of the .NET, so it's rather good for an ad-hoc batch file, not for a robust and universal/flexible solution.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900