Hi @bording, sure thing.
Hopefully the below has enough detail 
So below is the pipeline step that we are running, a pretty straight forward dotnet build. We have the same step running on some of our other apps (where all projects in this app are .net 6) and they build with the same Messaging packages without any issues. Also the projects build fine locally, both in visual studio in Debug/Release as well as using dotnet build. The only place we see this issue is in the pipeline.
- task: DotNetCoreCLI@2
displayName: 'Build ${{ variables.projectDir }} Projects'
inputs:
command: 'build'
projects: '${{ variables.projectDir }}/App.Host.csproj'
arguments: '--configuration Release'
App.Host
Our .net 6 web app host.
<PackageReference Include="Messaging.Contract" Version="1.4.0" />
<PackageReference Include="Messaging.Core" Version="1.13.2" />
<PackageReference Include="Messaging.Extensions" Version="1.4.2" />
<PackageReference Include="NServiceBus" Version="7.8.2" />
<ProjectReference Include="..\App.Core\App.Core.csproj" />
<ProjectReference Include="..\App.Contract\App.Contract.csproj" />
App.Core
App Core project, containing business logic, including message handlers. netstandard2.0
<PackageReference Include="Messaging.Contract" Version="1.4.0" />
<PackageReference Include="Messaging.Core" Version="1.13.2" />
<PackageReference Include="NServiceBus" Version="7.8.2" />
<ProjectReference Include="..\App.Contract\App.Contract.csproj" />
App.Contract
App Contract containing POCO for Commands, Events, Queries etc. netstandard2.0
<PackageReference Include="Messaging.Contract" Version="0.4.1" />
Messaging.Core - Nuget Package
Project published to package feed that holds recurring functionality used in our system when configuring and starting endpoints. netstandard2.0
<PackageReference Include="NServiceBus" Version="7.8.2" />
<PackageReference Include="NServiceBus.Extensions.DependencyInjection" Version="1.0.1" />
<PackageReference Include="NServiceBus.Metrics.ServiceControl" Version="3.0.6" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="2.3.0" />
<PackageReference Include="NServiceBus.Persistence.Sql" Version="6.5.1" />
<PackageReference Include="NServiceBus.SagaAudit" Version="3.0.1" />
<PackageReference Include="NServiceBus.RabbitMQ" Version="6.1.1" />
<PackageReference Include="NServiceBus.Transport.AzureServiceBus" Version="2.0.2" />
<ProjectReference Include="..\Messaging.Contract\Messaging.Contract.csproj" />
<ProjectReference Include="..\Messaging.Extensions\Messaging.Extensions.csproj" />
Messaging.Extensions - Nuget Package
Project published to package feed and contains custom behaviours that we may/may not include in our apps. netstandard2.0
<PackageReference Include="NServiceBus" Version="7.8.2" />
<PackageReference Include="NServiceBus.Extensions.DependencyInjection" Version="1.0.1" />
<PackageReference Include="NServiceBus.Metrics.ServiceControl" Version="3.0.6" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="2.3.0" />
<PackageReference Include="NServiceBus.Persistence.Sql" Version="6.5.1" />
<PackageReference Include="NServiceBus.SagaAudit" Version="3.0.1" />
<PackageReference Include="NServiceBus.RabbitMQ" Version="6.1.1" />
<PackageReference Include="NServiceBus.Transport.AzureServiceBus" Version="2.0.2" />
<ProjectReference Include="..\Messaging.Contract\Messaging.Contract.csproj" />
Messaging.Contract - Nuget Package
Project published to package feed, contains some attributes/interfaces that we use in conventions. netstandard2.0
<PackageReference Include="NServiceBus" Version="7.8.2" />