Hello, I am trying to set up an Azure pipeline to build and publish my solution. All projects inside the solution are in .NET Core 3.1. The project builds and works perfectly fine in Visual studio, however when I try to run a pipeline I am getting a following error:
##[error]DbConfiguration\DbContexts\Configurations\Write\RequestConfiguration.cs(1,12): Error CS0234: The type or namespace name 'Model' does not exist in the namespace 'CCCC' (are you missing an assembly reference?)
D:\a\1\s\DbConfiguration\DbContexts\Configurations\Write\RequestConfiguration.cs(1,12): error CS0234: The type or namespace name 'Model' does not exist in the namespace 'CCCC' (are you missing an assembly reference?) [D:\a\1\s\DbConfiguration\CCCC.DbConfiguration.csproj]
##[error]DbConfiguration\DbContexts\Configurations\Write\RequestConfiguration.cs(7,66): Error CS0246: The type or namespace name 'Request' could not be found (are you missing a using directive or an assembly reference?)
D:\a\1\s\DbConfiguration\DbContexts\Configurations\Write\RequestConfiguration.cs(7,66): error CS0246: The type or namespace name 'Request' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\DbConfiguration\CCCC.DbConfiguration.csproj]
##[error]DbConfiguration\DbContexts\Configurations\Write\RequestConfiguration.cs(9,49): Error CS0246: The type or namespace name 'Request' could not be found (are you missing a using directive or an assembly reference?)
D:\a\1\s\DbConfiguration\DbContexts\Configurations\Write\RequestConfiguration.cs(9,49): error CS0246: The type or namespace name 'Request' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\DbConfiguration\CCCC.DbConfiguration.csproj]
YAML file for pipeline:
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
What I have tried:
If locally the solution works just fine and Visual Studio doesn't rise any errors (or warnings), then what could be the reason for this error?