【发布时间】:2017-11-15 06:44:05
【问题描述】:
我正在尝试使用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 步骤,我手动选择 MSBuildTools 版本,如 SO answer 中所述:
但我没有找到“NuGet 安装程序”步骤的类似设置。我错过了什么吗?
【问题讨论】:
-
尝试从命令行步骤调用
dotnet restore
标签: msbuild nuget teamcity .net-core