Answer 4
Thanks again, that did the trick. I did try that but it didn't work bc I didn't know what the property was called. I tried:
GlobalProperty.Add("BinariesSubdirectory", "Binaries")
"BinariesSubdirectory" was the name of the property in the MSBuild of VS 2008. Where can I get a list of the names of the properties so that I may assign values to them? (I.e., where did you get the names "Configuration", "Platform" and "OutputPath"?)
Also, how do I incorporate logging into the VS2010 build? For the VS 2008 solution, I am able to pass a logger to the Build() method as follows:
Microsoft.Build.Evaluation.Project p = new Microsoft.Build.Evaluation.Project(myProject);
ILogger logger = new MyLogger();
logger.Verbosity = LoggerVerbosity.Detailed;
p.Build(logger);
I tried the following for the VS 2010 solution, but it didn't work. Do I need to change the logger to work with VS2010? Or, is this not the correct way to add logging?
string projectFileName = @"C:\Solutions\MySolution.sln";
ILogger logger = new MyLogger();
logger.Verbosity = LoggerVerbosity.Detailed;
Microsoft.Build.Evaluation.ProjectCollection pc = new ProjectCollection();
pc.RegisterLogger(logger);
GlobalProperty.Add("Configuration", "Debug");
GlobalProperty.Add("Platform", "x86");
BuildRequestData buildRequest = new BuildRequestData(projectFileName, GlobalProperty, null, new string[] {" Build"}, null);
BuildResult result = BuildManager.DefaultBuildManager.Build(new BuildParameters(pc), buildRequest);