当我在Jenkins构建服务器上构建.NET Standard 2.0库时
C:\Program Files\dotnet\sdk\2.1.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error : Assets file 'C:\Jenkins\workspace\<Project>\Sources\Library\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. [C:\Jenkins\workspace\<Project>\Sources\Library\Library.csproj]
在构建日志中我遇到了一个错误。
我搜索了关于这个错误的资料,找到了解决方案
然而,在运行时:
dotnet restore <Solution Name>
清理工作区后开始构建时,这个解决方案对我没有帮助。
因此,在 MSBuild 命令之前插入命令,但是失败了:
C:\Program Files\dotnet\sdk\2.1.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error : Package Microsoft.CodeAnalysis.CSharp.Workspaces, version 2.8.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions. [C:\Jenkins\workspace\<Project>\Sources\Web\Web.csproj]
根据解决方案参考,也许升级Nuget Package Installer可以帮助我解决问题。但是我不知道如何通过命令行升级Nuget Package Installer...