Morcatko.AspNetCore.JsonMergePatch
Morcatko.AspNetCore.JsonMergePatch copied to clipboard
Referencing this package in .NET 6 produces a warning
Problem: Referencing this package in .NET 6 causes a warning when compiling. When projects are configured to treat warnings as errors, such a project is unable to compile.
AD0001 Analyzer 'Microsoft.AspNetCore.Mvc.Analyzers.TopLevelParameterNameAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'
To Reproduce:
- Create an ASP.NET project with the following configuration:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Morcatko.AspNetCore.JsonMergePatch.SystemText" Version="3.0.7" />
</ItemGroup>
</Project>
Known workarounds:
- Add the following snippet to the .csproj file to ignore the warning:
<PropertyGroup>
<NoWarn>AD0001</NoWarn>
<WarningsNotAsErrors>$(NoWarn);</WarningsNotAsErrors>
</PropertyGroup>