I have a build pipeline in AzureDevOps that builds a .NET Core 5 solution using the AzureDevOps Task '.NET Core' -> Build
The solution has a Directory.Build.props file that has the setting:
<PropertyGroup>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
That means that any warning will be propagated as error.
After some time a collegae encountered a local build fail (it is a warning CS8603: Possible null reference return -> which become an error due to our setting) but the build pipeline succeeds with the same code base (commit).
The build agent has the following .NET Core SDK versions: 5.0.402, 5.0.408.
The local dev machine uses VS2022 with .NET Core SDK versions: 2.1.300, 2.1.402, 2.1.526, 2.1.700, 3.1.420, 5.0.401, 5.0.408 and 6.0.301
Outside VS2022, a local dotnet build has the same error.
What could be the issue here ?