From a8eaca62489763d4538007d8b249a6932aeb7a35 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Tue, 12 Nov 2024 19:36:23 +0000 Subject: [PATCH] Support .NET 9 (#3007) * 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. * Update package references Target .NET 9 versions for Microsoft.AspNetCore.OpenApi in test sites. * Bump Microsoft.OpenApi Bump Microsoft.OpenApi to the latest version. * Update .NET SDK to 9.0.100-preview.7.24407.12 (#3025) * Update .NET SDK Update .NET SDK to version 9.0.100-preview.7.24407.12. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: github-actions[bot] * Update NuGet packages Bump NuGet packages for .NET 9 preview 7. --------- Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Martin Costello * Bump Microsoft.OpenApi Bump Microsoft.OpenApi to 1.6.18. * Bump Microsoft.OpenApi Bump Microsoft.OpenApi to 1.6.20. * Bump Microsoft.OpenApi Update Microsoft.OpenApi to 1.6.21. * Update .NET SDK to 9.0.100-rc.1.24452.12 (#3066) * Update .NET SDK Update .NET SDK to version 9.0.100-rc.1.24452.12. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: github-actions[bot] * Update NuGet packages Update NuGet packages for RC1. --------- Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Martin Costello * Make middlewares internal Make all the middleware classes internal as they have no useful public-facing functionality (e.g. virtual members). Resolves #2805. * Update .NET SDK to 9.0.100-rc.2.24474.11 (#3098) * Update .NET SDK Update .NET SDK to version 9.0.100-rc.2.24474.11. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: github-actions[bot] * Update NuGet packages Update NuGet packages for .NET 9 RC2. --------- Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] Co-authored-by: Martin Costello * Bump Microsoft.OpenApi Bump Microsoft.OpenApi to 1.6.22. * Bump packages Update packages for ASP.NET Core 8.0.10. * Swap order of TFMs Put the newest first so Visual Studio loads the latest version as the selected TFM by default. * Apply suggestions from code review - Remove redundant comment. - Add link to tracking issue in comment. * Add [ActivatorUtilitiesConstructor] React to aspnet/Announcements#514 for .NET 9. * Update to .NET 9 GA Update to the stable version of .NET 9. * Bump .NET 8 packages Bump test packages for .NET 8. --------- Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- .github/workflows/build.yml | 2 +- Directory.Build.props | 12 +- Directory.Packages.props | 4 +- global.json | 2 +- .../Swashbuckle.AspNetCore.Annotations.csproj | 2 +- ...hbuckle.AspNetCore.ApiTesting.Xunit.csproj | 2 +- .../Swashbuckle.AspNetCore.ApiTesting.csproj | 20 +-- .../CommandRunner.cs | 2 +- .../HostingApplication.cs | 6 - src/Swashbuckle.AspNetCore.Cli/Program.cs | 2 +- .../Swashbuckle.AspNetCore.Cli.csproj | 6 +- .../Swashbuckle.AspNetCore.Newtonsoft.csproj | 18 +-- .../.NETCoreApp/PublicAPI.Shipped.txt | 1 - .../.NETCoreApp/PublicAPI.Unshipped.txt | 0 .../.NETStandard/PublicAPI.Shipped.txt | 1 - .../.NETStandard/PublicAPI.Unshipped.txt | 0 .../PublicAPI/PublicAPI.Shipped.txt | 2 - .../ReDocMiddleware.cs | 2 +- .../Swashbuckle.AspNetCore.ReDoc.csproj | 2 +- .../.NETCoreApp/PublicAPI.Shipped.txt | 1 - .../PublicAPI/PublicAPI.Shipped.txt | 3 - .../SwaggerMiddleware.cs | 3 +- .../Swashbuckle.AspNetCore.Swagger.csproj | 2 +- .../ConfigureSwaggerGeneratorOptions.cs | 2 +- .../SchemaGenerator/SchemaGenerator.cs | 2 +- .../ApiParameterDescriptionExtensions.cs | 4 +- .../Swashbuckle.AspNetCore.SwaggerGen.csproj | 2 +- .../.NETCoreApp/PublicAPI.Shipped.txt | 1 - .../.NETCoreApp/PublicAPI.Unshipped.txt | 0 .../.NETStandard/PublicAPI.Shipped.txt | 1 - .../.NETStandard/PublicAPI.Unshipped.txt | 0 .../PublicAPI/PublicAPI.Shipped.txt | 2 - .../SwaggerUIBuilderExtensions.cs | 2 +- .../SwaggerUIMiddleware.cs | 4 +- .../Swashbuckle.AspNetCore.SwaggerUI.csproj | 2 +- .../Swashbuckle.AspNetCore.csproj | 10 +- ...hbuckle.AspNetCore.Annotations.Test.csproj | 2 +- ...shbuckle.AspNetCore.ApiTesting.Test.csproj | 2 +- .../Swashbuckle.AspNetCore.Cli.Test.csproj | 2 +- ...hbuckle.AspNetCore.IntegrationTests.csproj | 11 +- ...shbuckle.AspNetCore.Newtonsoft.Test.csproj | 2 +- ...shbuckle.AspNetCore.SwaggerGen.Test.csproj | 2 +- .../ApiExplorer/ApiDescriptionFactory.cs | 4 - .../Swashbuckle.AspNetCore.TestSupport.csproj | 2 +- test/WebSites/Basic/Basic.csproj | 2 +- test/WebSites/CliExample/CliExample.csproj | 2 +- .../wwwroot/swagger/v1/swagger_net9.0.json | 54 +++++++ .../CliExampleWithFactory.csproj | 2 +- .../wwwroot/swagger/v1/swagger_net9.0.json | 54 +++++++ .../ConfigFromFile/ConfigFromFile.csproj | 2 +- .../CustomDocumentSerializer.csproj | 2 +- .../CustomUIConfig/CustomUIConfig.csproj | 2 +- .../CustomUIIndex/CustomUIIndex.csproj | 2 +- .../GenericControllers.csproj | 2 +- test/WebSites/MinimalApp/MinimalApp.csproj | 2 +- .../MinimalAppWithHostedServices.csproj | 2 +- .../MultipleVersions/MultipleVersions.csproj | 2 +- .../MvcWithNullable/MvcWithNullable.csproj | 6 +- .../NswagClientExample.csproj | 2 +- .../NswagClientExample/swagger_net9.0.json | 140 ++++++++++++++++++ .../OAuth2Integration.csproj | 11 +- test/WebSites/ReDoc/ReDoc.csproj | 2 +- .../TestFirst.IntegrationTests.csproj | 2 +- test/WebSites/TestFirst/TestFirst.csproj | 2 +- .../TopLevelSwaggerDoc.csproj | 2 +- test/WebSites/WebApi.Aot/WebApi.Aot.csproj | 2 +- test/WebSites/WebApi/WebApi.csproj | 6 +- 67 files changed, 346 insertions(+), 113 deletions(-) delete mode 100644 src/Swashbuckle.AspNetCore.ReDoc/PublicAPI/.NETCoreApp/PublicAPI.Shipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.ReDoc/PublicAPI/.NETCoreApp/PublicAPI.Unshipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.ReDoc/PublicAPI/.NETStandard/PublicAPI.Shipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.ReDoc/PublicAPI/.NETStandard/PublicAPI.Unshipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.SwaggerUI/PublicAPI/.NETCoreApp/PublicAPI.Shipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.SwaggerUI/PublicAPI/.NETCoreApp/PublicAPI.Unshipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.SwaggerUI/PublicAPI/.NETStandard/PublicAPI.Shipped.txt delete mode 100644 src/Swashbuckle.AspNetCore.SwaggerUI/PublicAPI/.NETStandard/PublicAPI.Unshipped.txt create mode 100644 test/WebSites/CliExample/wwwroot/swagger/v1/swagger_net9.0.json create mode 100644 test/WebSites/CliExampleWithFactory/wwwroot/swagger/v1/swagger_net9.0.json create mode 100644 test/WebSites/NswagClientExample/swagger_net9.0.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c376eca45a..022e9d3142 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: with: dotnet-version: | 6.0.x - 7.0.x + 8.0.x - name: Setup .NET SDK uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 diff --git a/Directory.Build.props b/Directory.Build.props index a815c00f0d..0d83b78f80 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -20,18 +20,10 @@ true en-US - false - $(NoWarn);NETSDK1138 - - $(NoWarn);NU1902;NU1903 - $(NoWarn);NU5128 + direct + + + + diff --git a/test/WebSites/ReDoc/ReDoc.csproj b/test/WebSites/ReDoc/ReDoc.csproj index a12405310d..3c229ad132 100644 --- a/test/WebSites/ReDoc/ReDoc.csproj +++ b/test/WebSites/ReDoc/ReDoc.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net9.0;net8.0;net6.0 diff --git a/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj b/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj index 62dfbcccd3..a17310c19b 100644 --- a/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj +++ b/test/WebSites/TestFirst.IntegrationTests/TestFirst.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net9.0;net8.0;net6.0 diff --git a/test/WebSites/TestFirst/TestFirst.csproj b/test/WebSites/TestFirst/TestFirst.csproj index ef0580e64e..599d9144ea 100644 --- a/test/WebSites/TestFirst/TestFirst.csproj +++ b/test/WebSites/TestFirst/TestFirst.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net9.0;net8.0;net6.0 diff --git a/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj b/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj index 9c90a9ad79..fd35c5d8fb 100644 --- a/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj +++ b/test/WebSites/TopLevelSwaggerDoc/TopLevelSwaggerDoc.csproj @@ -1,7 +1,7 @@ - net6.0;net8.0 + net9.0;net8.0;net6.0 enable enable diff --git a/test/WebSites/WebApi.Aot/WebApi.Aot.csproj b/test/WebSites/WebApi.Aot/WebApi.Aot.csproj index 70cb09a09d..9d7467fe77 100644 --- a/test/WebSites/WebApi.Aot/WebApi.Aot.csproj +++ b/test/WebSites/WebApi.Aot/WebApi.Aot.csproj @@ -5,7 +5,7 @@ true enable true - net8.0 + net9.0;net8.0 false diff --git a/test/WebSites/WebApi/WebApi.csproj b/test/WebSites/WebApi/WebApi.csproj index be737b6c89..7b7e13bf21 100644 --- a/test/WebSites/WebApi/WebApi.csproj +++ b/test/WebSites/WebApi/WebApi.csproj @@ -4,7 +4,7 @@ enable enable WebApi - net8.0 + net9.0;net8.0 true @@ -18,4 +18,8 @@ + + + +