我正在尝试使用NuGet Installer TeamCity构建步骤来恢复.NET Core解决方案的NuGet包。'MSBuild自动检测'选择了MSBuild v4.0,而不是.NET Core项目所需的v15.0:
[15:41:53][restore] Starting NuGet.exe 4.1.0.2450 from C:\TeamCity\buildAgent\tools\NuGet.CommandLine.4.1.0\tools\NuGet.exe
[15:41:53][restore] MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319'.
[15:41:53][restore] Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.
[15:41:53][restore] Process exited with code 0
这会导致在“MSBuild” TeamCity步骤中编译错误,在包恢复之后运行:
Assets file 'C:\TeamCity\...\MyProj\obj\project.assets.json' not found.
Run a NuGet package restore to generate this file.
在 'MSBuild' TeamCity 步骤中,我像在这个 SO 答案 中描述的那样手动选择了 MSBuildTools 版本:
但是我没有找到类似的设置适用于 'NuGet Installer' 步骤。我有什么遗漏吗?
dotnet restore
。 - hkarask