我was looking for MSBuild.exe ,我在两个稍微不同的地方找到了它:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe
它们之间有什么区别,我应该使用哪个?
最佳答案
What's the difference between them?
MSBuild.exe 有两个版本,32 位和 64 位。
在 32 位机器上 , MSBuild.exe 存在于路径:
C:\Program Files\..\..\Bin\MSBuild.exe
在 64 位机器上 ,有两个版本的 MSBuild.exe 工具。 32 位工具将位于:
Bin\MSBuild.exe
以及以下 64 位工具:Bin\amd64\MSBuild.exe
如果想了解这两个版本的一些区别,可以引用博客:Building on Cross targeting scenarios and 64-bit MSBuild .
which should I use?
要回答这个问题,您应该了解 32 位程序和 64 位程序之间的区别。您可以引用this document详情。
If the assembly is configured for Any CPU then it will run as x64 on a 64-bit machine and as x86 on a 32-bit machine.
If the assembly is configured for x86 then it will run as WOW64 on a 64-bit machine (i.e. a 32-bit process) and as x86 on a 32-bit machine.
If the assembly is configured for x64 then it will run as x64 on a 64-bit machine and will fail to run on a 32-bit machine
所以你应该使用 Bin/MSBuild.exe ,它可以在 64 位机器上运行,也可以在 32 位机器上作为 x86 运行。
此外,Visual Studio 构建相当于运行 32 位 MSBuild。
关于msbuild - Bin/MSBuild.exe 和 Bin/amd64/MSBuild.exe 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46232442/