diff --git a/dotnet-projects/StyleCop/.editorconfig b/dotnet-projects/StyleCop/.editorconfig new file mode 100644 index 0000000000..790edd72d1 --- /dev/null +++ b/dotnet-projects/StyleCop/.editorconfig @@ -0,0 +1,3 @@ +[*.cs] +# SA1101: Prefix local calls with this (demoted to a suggestion, see the article) +dotnet_diagnostic.SA1101.severity = suggestion diff --git a/dotnet-projects/StyleCop/StyleCop/Program.cs b/dotnet-projects/StyleCop/StyleCop/Program.cs index e8f3c37699..8f1154f630 100644 --- a/dotnet-projects/StyleCop/StyleCop/Program.cs +++ b/dotnet-projects/StyleCop/StyleCop/Program.cs @@ -13,17 +13,15 @@ public static void Main(string[] args) // Add services to the container. builder.Services.AddControllers(); - // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle - builder.Services.AddEndpointsApiExplorer(); - builder.Services.AddSwaggerGen(); + // Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi + builder.Services.AddOpenApi(); var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(); + app.MapOpenApi(); } app.UseHttpsRedirection(); diff --git a/dotnet-projects/StyleCop/StyleCop/StyleCop.csproj b/dotnet-projects/StyleCop/StyleCop/StyleCop.csproj index 2cb22fb4b9..814f2dc863 100644 --- a/dotnet-projects/StyleCop/StyleCop/StyleCop.csproj +++ b/dotnet-projects/StyleCop/StyleCop/StyleCop.csproj @@ -1,7 +1,7 @@ - net7.0 + net10.0 enable enable @@ -11,18 +11,15 @@ - - Always - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/dotnet-projects/StyleCop/Tests/Tests.csproj b/dotnet-projects/StyleCop/Tests/Tests.csproj index 20281cab39..4a83736808 100644 --- a/dotnet-projects/StyleCop/Tests/Tests.csproj +++ b/dotnet-projects/StyleCop/Tests/Tests.csproj @@ -1,7 +1,7 @@  - net7.0 + net10.0 enable enable @@ -9,13 +9,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all