Hah! Victory :-D It appears that if you add logging, you find out what the problem is...
// Instantiate a new Engine object
Engine engine = new Engine();
// Instantiate a new FileLogger to generate build log
FileLogger logger = new FileLogger();
// Set the logfile parameter to indicate the log destination
logger.Parameters = @"logfile=" + strlogFile;
// Register the logger with the engine
engine.RegisterLogger(logger);
// Build a project file
bool success = engine.BuildProjectFile(strProjectFile);
//Unregister all loggers to close the log file
engine.UnregisterAllLoggers();
if (success)
MessageBox.Show("Build succeeded.");
else
MessageBox.Show(@"Build failed. View " + strLogFile + " for details");
Using the above code, I was able to view the log of the issue: C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.WinFX.targets(64,7): error MSB4127: The "GetWinFXPath" task could not be instantiated from the assembly "PresentationBuildTasks, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". This issue in turn needs the following config file settings to be added:
<configuration>
<configSections>
<section name="msbuildToolsets" type="Microsoft.Build.BuildEngine.ToolsetConfigurationSection, Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<startup>
<supportedRuntime version="v2.0.50727" safemode="true"/>
<requiredRuntime version="v2.0.50727" safemode="true"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<!-- To define one or more new toolsets, add an 'msbuildToolsets' element in this file. -->
</configuration>
My project builds! :cool: