为什么是64位的MSBuild加载32位扩展?加载、为什么是、MSBuild

2023-09-08 00:45:42 作者:抢我对象者不孕不育

我试图建立一个64位的机器上使用的MSBuild(V4.0)的项目。出于某种原因,MSBuild的尝试加载32位扩展,我想不通这是为什么。我已经为了阐明该问题降低了问题的最小集合

I'm attempting to build a project using MSBuild (v4.0) on a 64-bit machine. For some reason, MSBuild is attempting to load a 32-bit extension, and I cannot figure out why. I've reduced the problem to the smallest set in order to demonstrate the issue.

使用下面的MSBuild项目文件:

Using the following MSBuild project file:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
    <Target Name="test">
        <Message Text="bin path: $(MSBuildBinPath)" />
        <Message Text="extensions path: $(MSBuildExtensionsPath)" />
        <Message Text="extensions path (x86): $(MSBuildExtensionsPath32)" />
        <Message Text="extensions path (x64): $(MSBuildExtensionsPath64)" />
    </Target>
</Project>

我得到这样的输出:

I get this output:

Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 8/27/2010 9:56:35 AM.
Project "D:\5\test.proj" on node 1 (default targets).
test:
  bin path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  extensions path: C:\Program Files (x86)\MSBuild
  extensions path (x86): C:\Program Files (x86)\MSBuild
  extensions path (x64): C:\Program Files\MSBuild
Done Building Project "D:\5\test.proj" (default targets).


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.03

的MSBuild显然知道有关32位和64位扩展路径,从二进制路似乎很清楚,我是运行64位MSBuild.exe,但由于某些原因,它认为,扩展应从的>程序文件(x86),而不是