以编程方式运行X86版本的MSBuild

以编程方式运行X86版本的MSBuild,msbuild,msbuild-4.0,Msbuild,Msbuild 4.0,我当前正在使用以下程序以编程方式运行MSBuild: var pc = new ProjectCollection(); var buildProperties = new Dictionary<string, string> { {"Configuration", "Release"}, {"Platform", "Any CPU"}, {"OutputPath", _outputPath},

我当前正在使用以下程序以编程方式运行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);
var pc=newprojectcollection();
var buildProperties=新字典
{
{“配置”、“发布”},
{“平台”,“任何CPU”},
{“OutputPath”,_OutputPath},
{“enablenUgetPackageStore”,“true”}
};
var buildParameters=新的buildParameters(pc);
var buildRequest=新的BuildRequestData(_solutionFilePath,
建筑属性,
"4.0", 
新建[]{“重建”},
无效);

如何强制使用X86版本的MSBuild运行库而不是X64版本来运行上述操作。它内部运行的应用程序是64位应用程序。

如果我可以问一下,为什么?目标平台不够?某些生成工具无法在X64版本的MSBuild中成功运行。