我正在尝试使用以下命令恢复 .NET Core 解决方案的 NuGet 包NuGet 安装程序 https://confluence.jetbrains.com/display/TCD10/NuGet+InstallerTeamCity 构建步骤。 “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.
For the 'MSBuild' TeamCity step I choose the MSBuildTools version manually as described in this SO answer https://stackoverflow.com/a/26731398/4207332:
但我没有找到“NuGet Installer”步骤的类似设置。我错过了什么吗?
我设法克服了这个问题,指定了-MSBuildPath
命令行参数 https://learn.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference#options-11:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)