Azure Build 代理找不到 class 库引用

Azure Build agent cant´t find class library referance

我创建了一个 C# class 库,我想将其添加到 Web 应用程序中。当我在 AzureDevOps 上的构建代理上构建 webapp 时发生错误。构建代理找不到 class 库。我尝试将 class 库项目添加到解决方案中,但源代码管理选项从未出现。我也试过只添加 class 库的 .dll。但是运气不好。

VS 2019 中文件资源管理器的图像:

这是构建代理日志:

    [command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\s\OneCalendar\OneCalendar.csproj --configuration release
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Skipping project "d:\a\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj" because it was not found.
  Skipping project "d:\a\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj" because it was not found.
  Restoring packages for d:\a\s\OneCalendar\OneCalendar.csproj...
  Restore completed in 872.26 ms for d:\a\s\OneCalendar\OneCalendar.csproj.
C:\Program Files\dotnet\sdk.2.105\Microsoft.Common.CurrentVersion.targets(1879,5): warning : The referenced project '..\..\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj' does not exist. [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(11,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(1,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Services\AccountService.cs(1,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Services\JwtService.cs(1,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Startup.cs(3,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Context\UserContext.cs(15,28): warning CS0108: 'UserContext.Users' hides inherited member 'IdentityUserContext<User, string, IdentityUserClaim<string>, IdentityUserLogin<string>, IdentityUserToken<string>>.Users'. Use the new keyword if hiding was intended. [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(372,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(72,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(79,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(86,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(34,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(78,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(122,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(160,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(199,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(271,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(322,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(375,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk.2.105\Microsoft.Common.CurrentVersion.targets(1879,5): warning : The referenced project '..\..\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj' does not exist. [d:\a\s\OneCalendar\OneCalendar.csproj]
Context\UserContext.cs(15,28): warning CS0108: 'UserContext.Users' hides inherited member 'IdentityUserContext<User, string, IdentityUserClaim<string>, IdentityUserLogin<string>, IdentityUserToken<string>>.Users'. Use the new keyword if hiding was intended. [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(11,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(1,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Services\AccountService.cs(1,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Services\JwtService.cs(1,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Startup.cs(3,7): error CS0246: The type or namespace name 'CaseSolutionsTokenValidationParameters' could not be found (are you missing a using directive or an assembly reference?) [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(372,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(72,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(79,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(86,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(34,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(78,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(122,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(160,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(199,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(271,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(322,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(375,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\s\OneCalendar\OneCalendar.csproj]
    2 Warning(s)
    17 Error(s)

Time Elapsed 00:00:03.18
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
##[error]Dotnet command failed with non-zero exit code on the following projects : d:\a\s\OneCalendar\OneCalendar.csproj
##[section]Finishing: Build

我通过在解决方案文件夹中创建一个新的 Class 库并复制并粘贴我已经为第一个 class 库创建的代码来解决它。