我正在使用批处理文件来调用构建解决方案文件的MSBuild。我的问题是,在为AnyCPU平台构建时,我应该使用哪个MSBuild? 32位还是64位?
set sln=MySolution.sln
set src=%CD%\..\
set msbuildx86=%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
set msbuildx64=%windir%\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe
set verbosity=/v:normal
%msbuildx86% "%src%%sln%" %verbosity% /t:Clean;Build /p:NoWarn=1591 /p:Configuration=Debug /p:Platform="Any CPU" <-- x86 or x64?
%msbuildx86% "%src%%sln%" %verbosity% /t:Clean;Build /p:NoWarn=1591 /p:Configuration=Debug /p:Platform="x86"
%msbuildx64% "%src%%sln%" %verbosity% /t:Clean;Build /p:NoWarn=1591 /p:Configuration=Debug /p:Platform="x64"
%msbuildx86% "%src%%sln%" %verbosity% /t:Clean;Build /p:NoWarn=1591 /p:Configuration=Release /p:Platform="Any CPU" <-- x86 or x64?
%msbuildx86% "%src%%sln%" %verbosity% /t:Clean;Build /p:NoWarn=1591 /p:Configuration=Release /p:Platform="x86"
%msbuildx64% "%src%%sln%" %verbosity% /t:Clean;Build /p:NoWarn=1591 /p:Configuration=Release /p:Platform="x64"
答案 0 :(得分:0)
为x86进行构建时,使用x86编译器更快,更稳定。大多数需要64位工具的用户通常都希望大型应用程序具有更大的工作内存。您可以将PreferredToolArchitecture = x64设置为环境变量,MSBuild会选择它们。