Search code examples
c#azure-devopsportable-class-libraryvisual-studio-2019

Azure Build agent cant´t find class library referance


I have created a C# class library that I want to add to a webapp. The error occurs when I a build the webapp on a build agent on AzureDevOps. The build agent can´t find the class library. I have tried adding the class library project to the solution but the source control choice never turns up. I have also tried adding just the .dll of class library. But to no luck.

Images of the file explorer in VS 2019:

enter image description here

enter image description here

Here is the build agent log:

    [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

Solution

  • I solved it by creating a new Class library inside the solution folder and copy and pasted the code I already created for the first class library.