Skip to content

Commit 8114ddd

Browse files
Support .NET 9
- Add `net9.0` TFMs. - Drop TFMs for all out-of-support versions of .NET. - Bump version to `7.0.0`. - Only audit direct NuGet dependencies. - Suppress vulnerabilities in IdentityServer4 used in sample. - Remove some now-redundant pre-processor directives.
1 parent 3173d11 commit 8114ddd

File tree

50 files changed

+330
-96
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+330
-96
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
dotnet-version: |
5454
6.0.x
55-
7.0.x
55+
8.0.x
5656
5757
- name: Setup .NET SDK
5858
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1

Directory.Build.props

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,12 @@
2020
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
2121
<NeutralLanguage>en-US</NeutralLanguage>
2222
<!--
23-
TODO Remove deprecated TFMs
24-
-->
25-
<CheckEolTargetFramework>false</CheckEolTargetFramework>
26-
<NoWarn>$(NoWarn);NETSDK1138</NoWarn>
27-
<!--
28-
TODO Update packages to resolve vulnerability warnings
29-
-->
30-
<NoWarn>$(NoWarn);NU1902;NU1903</NoWarn>
31-
<!--
3223
TODO Fix warning from Swashbuckle.AspNetCore with dotnet pack
3324
-->
3425
<NoWarn>$(NoWarn);NU5128</NoWarn>
26+
<!-- TODO Remove once .NET 9.0.0 is released -->
27+
<NoWarn>$(NoWarn);NU5104</NoWarn>
28+
<NuGetAuditMode>direct</NuGetAuditMode>
3529
<!--
3630
TODO Go through the code and add nullable annotations
3731
<Nullable>enable</Nullable>
@@ -49,7 +43,7 @@
4943
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
5044
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
5145
<UseArtifactsOutput>true</UseArtifactsOutput>
52-
<VersionPrefix>6.7.1</VersionPrefix>
46+
<VersionPrefix>7.0.0</VersionPrefix>
5347
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
5448
</PropertyGroup>
5549
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' != '' ">

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.303",
3+
"version": "9.0.100-preview.6.24328.19",
44
"allowPrerelease": false,
55
"rollForward": "latestMajor"
66
}

src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<NoWarn>$(NoWarn);1591</NoWarn>
99
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore;annotations</PackageTags>
1010
<SignAssembly>true</SignAssembly>
11-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
11+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<IsTestProject>false</IsTestProject>
88
<NoWarn>$(NoWarn);1591</NoWarn>
99
<PackageTags>swagger;openapi;test-first;spec-first;testing;aspnetcore;xunit</PackageTags>
10-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
10+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<IsPackable>true</IsPackable>
77
<NoWarn>$(NoWarn);1591</NoWarn>
88
<PackageTags>swagger;openapi;test-first;spec-first;testing;aspnetcore</PackageTags>
9-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
9+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
@@ -16,29 +16,21 @@
1616
</ItemGroup>
1717

1818
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
19-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="2.1.2" />
20-
</ItemGroup>
21-
22-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
23-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="3.0.0" />
24-
</ItemGroup>
25-
26-
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
27-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="5.0.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="2.1.3" />
2820
</ItemGroup>
2921

3022
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
3123
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="6.0.0" />
3224
</ItemGroup>
3325

34-
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
35-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="7.0.0" />
36-
</ItemGroup>
37-
3826
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
3927
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="8.0.0" />
4028
</ItemGroup>
4129

30+
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
31+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" VersionOverride="9.0.0-preview.6.24328.4" />
32+
</ItemGroup>
33+
4234
<ItemGroup>
4335
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
4436
<AdditionalFiles Include="PublicAPI\PublicAPI.Shipped.txt" />

src/Swashbuckle.AspNetCore.Cli/HostingApplication.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
using System.Threading.Tasks;
55
using Microsoft.AspNetCore.Hosting.Server;
66
using Microsoft.AspNetCore.Http.Features;
7-
#if NETCOREAPP3_0_OR_GREATER
87
using Microsoft.Extensions.DependencyInjection;
9-
#endif
108
using Microsoft.Extensions.Hosting;
119

1210
namespace Swashbuckle.AspNetCore.Cli
@@ -19,9 +17,6 @@ internal class HostingApplication
1917
{
2018
internal static IServiceProvider GetServiceProvider(Assembly assembly)
2119
{
22-
#if NETCOREAPP2_1
23-
return null;
24-
#else
2520
// We're disabling the default server and the console host lifetime. This will disable:
2621
// 1. Listening on ports
2722
// 2. Logging to the console from the default host.
@@ -102,7 +97,6 @@ void OnEntryPointExit(Exception exception)
10297
}
10398

10499
return null;
105-
#endif
106100
}
107101

108102
private class NoopHostLifetime : IHostLifetime

src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
<OutputType>Exe</OutputType>
88
<PackAsTool>true</PackAsTool>
99
<PackageId>Swashbuckle.AspNetCore.Cli</PackageId>
10-
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
10+
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
1111
<ToolCommandName>swagger</ToolCommandName>
1212
</PropertyGroup>
1313

1414
<ItemGroup>
1515
<ProjectReference Include="..\Swashbuckle.AspNetCore.Swagger\Swashbuckle.AspNetCore.Swagger.csproj" />
1616
</ItemGroup>
1717

18-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
19-
<PackageReference Include="Microsoft.AspNetCore" />
20-
</ItemGroup>
21-
2218
</Project>

src/Swashbuckle.AspNetCore.Newtonsoft/Swashbuckle.AspNetCore.Newtonsoft.csproj

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<IsPackable>true</IsPackable>
77
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore;newtonsoft</PackageTags>
88
<SignAssembly>true</SignAssembly>
9-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
9+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
@@ -17,26 +17,18 @@
1717
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" />
1818
</ItemGroup>
1919

20-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
21-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" VersionOverride="3.0.0" />
22-
</ItemGroup>
23-
24-
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
25-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" VersionOverride="5.0.0" />
26-
</ItemGroup>
27-
2820
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
2921
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" VersionOverride="6.0.0" />
3022
</ItemGroup>
3123

32-
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
33-
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" VersionOverride="7.0.0" />
34-
</ItemGroup>
35-
3624
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
3725
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" VersionOverride="8.0.0" />
3826
</ItemGroup>
3927

28+
<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
29+
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" VersionOverride="9.0.0-preview.6.24328.4" />
30+
</ItemGroup>
31+
4032
<ItemGroup>
4133
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
4234
<AdditionalFiles Include="PublicAPI\PublicAPI.Shipped.txt" />

src/Swashbuckle.AspNetCore.ReDoc/Swashbuckle.AspNetCore.ReDoc.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<NoWarn>$(NoWarn);1591</NoWarn>
99
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore;redoc</PackageTags>
1010
<SignAssembly>true</SignAssembly>
11-
<TargetFrameworks>netstandard2.0;netcoreapp3.0;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
11+
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

0 commit comments

Comments
 (0)