Azure Build代理找不到类库引用

时间:2019-08-17 11:01:10

标签: c# azure-devops portable-class-library visual-studio-2019

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

VS 2019中文件浏览器的图像:

enter image description here

enter image description here

这是构建代理程序日志:

    [command]"C:\Program Files\dotnet\dotnet.exe" build d:\a\1\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\1\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj" because it was not found.
  Skipping project "d:\a\1\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj" because it was not found.
  Restoring packages for d:\a\1\s\OneCalendar\OneCalendar.csproj...
  Restore completed in 872.26 ms for d:\a\1\s\OneCalendar\OneCalendar.csproj.
C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(1879,5): warning : The referenced project '..\..\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj' does not exist. [d:\a\1\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\1\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\1\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\1\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\1\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\1\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\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(372,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(72,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(79,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(86,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(34,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(78,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(122,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(160,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(199,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(271,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(322,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(375,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk\2.2.105\Microsoft.Common.CurrentVersion.targets(1879,5): warning : The referenced project '..\..\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters\CaseSolutionsTokenValidationParameters.csproj' does not exist. [d:\a\1\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\1\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\1\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\1\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\1\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\1\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\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(372,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(72,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(79,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\AuthController.cs(86,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(34,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(78,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(122,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(160,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(199,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(271,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(322,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\s\OneCalendar\OneCalendar.csproj]
Controllers\CalenderController.cs(375,29): error CS0103: The name 'TokenValidationConstants' does not exist in the current context [d:\a\1\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\1\s\OneCalendar\OneCalendar.csproj
##[section]Finishing: Build

1 个答案:

答案 0 :(得分:0)

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