المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : MSBuild / Microsoft.Build... nyaaargh!



C# Programming
04-28-2009, 04:00 PM
Someone out there must be able to help me...
I'm trying to find/design a way of automating my project's builds, publishing, versioning in VSS etc and I'd like to create an app/script that will obey my command and do in one easy button click, what would otherwise take copious amounts of time & attention.
The general idea is: Build a project/solution based on the .*proj files, publish the project with different config settings & install ******** depending on whether the app is going to QA, Pre-Prod or Production. I would also like to be able to have Source Safe's labelling done automatically.

So far, I have found that Microsoft's MSBuild Reference on MSDN is virtually useless ( http://www.barakasoft.com/script/Forums/Images/smiley_WTF.gif ???), but I have been able to compile a project via the command line using it.

I found that Microsoft.Build.BuildEngine looked perfect for what I'm trying to acheive, however, using the following code, I can't get it to build the project:

Engine engine = new Engine();
Project project = new Project(engine);
project.Load(strProjFile);
project.Build();

The Build method on the Project keeps returning False - no error, nothing. (Before you ask, yes, the path to the project file is correct - the same file builds fine through VS2008 as well as MSBuild)
(Oh, and again, Great Job Microsoft on the crummy documentation)

If anyone has an idea of where I am going wrong, please, please, please! Let me know http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif