C# Jenkins/.net core 2.0/ubuntu缺少程序集

C# Jenkins/.net core 2.0/ubuntu缺少程序集,c#,jenkins,asp.net-core,continuous-integration,C#,Jenkins,Asp.net Core,Continuous Integration,我用Jenkins、nodejs和.NETCore2.0安装了一台Ubuntu16.04计算机,然后试图让它构建我的.NETCore2.0Web应用程序。失败,出现以下消息: 16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): 警告MSB3245:未能解析此引用。找不到 程序集“Microsoft.AspNetCore.Authorization”。检查确认 该程序集存在于磁盘

我用Jenkins、nodejs和.NETCore2.0安装了一台Ubuntu16.04计算机,然后试图让它构建我的.NETCore2.0Web应用程序。失败,出现以下消息:

16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): 警告MSB3245:未能解析此引用。找不到 程序集“Microsoft.AspNetCore.Authorization”。检查确认 该程序集存在于磁盘上。如果您的客户需要此参考 代码时,可能会出现编译错误。 [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): 警告MSB3245:未能解析此引用。找不到 程序集“Microsoft.AspNetCore.Mvc.Abstractions”。支票 确保磁盘上存在该程序集。如果要求提供此参考 您的代码可能会出现编译错误。 [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): 警告MSB3245:未能解析此引用。找不到 程序集“Microsoft.IdentityModel.Tokens”。检查以确保 磁盘上存在程序集。如果您的代码需要此引用, 您可能会遇到编译错误。[/var/lib/jenkins/workspace/MySolution 主应用程序/MySolution.Common/MySolution.Common.csproj]16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): 警告MSB3245:未能解析此引用。找不到 程序集“System.IdentityModel.Tokens.Jwt”。检查以确保 磁盘上存在程序集。如果您的代码需要此引用, 您可能会遇到编译错误。[/var/lib/jenkins/workspace/MySolution 主应用程序/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/bankedenresult.cs(5,28):错误CS0234:类型 或命名空间名称“Mvc”在命名空间中不存在 “Microsoft.AspNetCore”(是否缺少程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/GroupMemberAttribute.cs(3,28):错误CS0234: 命名空间中不存在类型或命名空间名称“Mvc” “Microsoft.AspNetCore”(是否缺少程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Services/Impl/TokenManagementService.cs(10,14):错误CS0234:类型 或命名空间名称“IdentityModel”在命名空间中不存在 “系统”(是否缺少程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Services/Impl/TokenManagementService.cs(12,17):错误CS0234:类型 或命名空间名称“IdentityModel”在命名空间中不存在 “Microsoft”(是否缺少程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/bankedenresult.cs(9,33):错误CS0246:类型 或命名空间名称“IActionResult”找不到(是否缺少 使用指令或组件引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/bankedenresult.cs(18,40):错误CS0246:类型 或命名空间名称“ActionContext”找不到(是否缺少 使用指令或组件引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/GroupMemberAttribute.cs(8,51):错误CS0246: 找不到类型或命名空间名称“IActionFilter”(是否为空) 缺少使用指令或程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/GroupMemberAttribute.cs(33,33):错误CS0246: 找不到类型或命名空间名称“ActionExecutingContext” (是否缺少using指令或程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/GroupMemberAttribute.cs(53,32):错误CS0246: 找不到类型或命名空间名称“ActionExecutedContext”(是 是否缺少using指令或程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]16:32:27 Security/Decorators/GroupMemberAttribute.cs(58,24):错误CS0246: 找不到类型或命名空间名称“ActionExecutingContext” (是否缺少using指令或程序集引用?) [/var/lib/jenkins/workspace/mysolutionmain App/MySolution.Common/MySolution.Common.csproj]

在我的开发机器上,我环顾四周,找不到那些程序集,但我肯定在引用它们,所以我猜它们藏在某个公共位置

我需要做什么才能让Jenkins找到所有引用的程序集并成功构建我的项目?我在网上看到的所有文档似乎都参考了.NETCore1.0或1.1,现在这些东西似乎都不同了

我的构建步骤非常简单(有一个)。要执行的脚本:

dotnet clean
dotnet restore
dotnet build

因此,这是一个bug(可能是ReSharper的bug),如果您第一次在项目中引用解决方案中的库,并自动更新引用,那么该引用并没有完全正确地添加;当然,MySolution.Common项目没有显式地将依赖程序集添加到项目文件中,即使它们是解决方案的一部分并且可用

在我的开发机器上,这并不重要;VisualStudio能够找到de
16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNetCore.Authorization". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/var/lib/jenkins/workspace/MySolution Main App/MySolution.Common/MySolution.Common.csproj]
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.0.1" />
cd MySolution.Common
dotnet add reference Microsoft.AspNetCore.Authorization