Skip to content

Commit

Permalink
Temporarily disable CA1852 for top-level statements
Browse files Browse the repository at this point in the history
As mentioned in the previous commit, .NET 7 includes a new analyzer [1]
that checks for internal types that can be sealed.

Unfortunately that analyzer is currently generating false positives for
generated `Program` classes [2] and therefore has to be suppressed
manually.

A fix [3] has already been committed to the Roslyn Analyzers repo so we
should be able to remove this suppression once that fix has made its way
into an SDK update.

[1] dotnet/roslyn-analyzers#5594
[2] dotnet/roslyn-analyzers#6141
[3] dotnet/roslyn-analyzers#6278
  • Loading branch information
smfeest committed Mar 5, 2023
1 parent 4052b5f commit 5a4dc3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Buttercup.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Razor;

#pragma warning disable CA1852

var builder = WebApplication.CreateBuilder(args);

var isDevelopment = builder.Environment.IsDevelopment();
Expand Down

0 comments on commit 5a4dc3d

Please sign in to comment.