How Can I Tell NuGet What MSBuild Executable to Us

2019-08-02 06:25发布

问题:

NuGet apparently has some logic to determine what MSBuild Executable to use. Is there a way to override this behavior? Or at least a way to tell it to use the x86 MSBuild instead of x64?

MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin\amd64'.

回答1:

From the command-line documentation, you can specify -MSBuildPath or -MSBuildVersion on the command line.

MSBuildPath (4.0+) Specifies the path of MSBuild to use with the command, taking precedence over -MSBuildVersion.

MSBuildVersion (3.2+) Specifies the version of MSBuild to be used with this command. Supported values are 4, 12, 14, 15. By default the MSBuild in your path is picked, otherwise it defaults to the highest installed version of MSBuild.



标签: msbuild nuget