我目前正在使用以下代码以编程方式运行MSBuild:
var pc = new ProjectCollection();
var buildProperties = new Dictionary<string, string>
{
{"Configuration", "Release"},
{"Platform", "Any CPU"},
{"OutputPath", _outputPath},
{"EnableNuGetPackageRestore", "true"}
};
var buildParameters = new BuildParameters(pc);
var buildRequest = new BuildRequestData(_solutionFilePath,
buildProperties,
"4.0",
new[] { "Rebuild" },
null);
如何强制使用X86版本的MSBuild运行时而不是X64版本运行上述内容。内部运行的应用程序是64位应用程序。