From 954216aa8087ac54f75a2a2dd37c18cf31e69a7a Mon Sep 17 00:00:00 2001 From: martincostello Date: Thu, 4 Sep 2025 19:34:28 +0100 Subject: [PATCH 1/2] Update to ASP.NET Core 10 RC1 Update to release candidate 1 of ASP.NET Core 10. --- Directory.Packages.props | 6 +++--- eng/Versions.props | 6 +++--- global.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c013b1852..d06ba1ccb 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,9 +4,9 @@ - - - + + + diff --git a/eng/Versions.props b/eng/Versions.props index 551b99fb6..9efa09cd0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -6,9 +6,9 @@ 0 $(MajorVersion).$(MinorVersion).$(PatchVersion) 10.0.0 - preview - 7 - Preview $(PreReleaseVersionIteration) + rc + 1 + Release Candidate $(PreReleaseVersionIteration) false release true diff --git a/global.json b/global.json index 5ada88321..5eeb905df 100644 --- a/global.json +++ b/global.json @@ -1,12 +1,12 @@ { "sdk": { - "version": "10.0.100-preview.7.25380.108", + "version": "10.0.100-rc.1.25451.107", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "10.0.100-preview.7.25380.108" + "dotnet": "10.0.100-rc.1.25451.107" }, "msbuild-sdks": { From b93dc86a2e04eeeb5fd75b30c3e2344cd590bfa8 Mon Sep 17 00:00:00 2001 From: martincostello Date: Tue, 9 Sep 2025 14:31:57 +0100 Subject: [PATCH 2/2] Fix tests - Fix obsolete usage of `WebHostBuilder`. - Update `JetBrains.Annotations` and `Microsoft.IdentityModel.Protocols.OpenIdConnect` to their latest versions. - Disable `IDE0058`. --- .editorconfig | 2 ++ Directory.Packages.props | 4 +-- .../Apple/AppleClientSecretGeneratorTests.cs | 25 ++++++++----------- .../Infrastructure/ApplicationFactory.cs | 12 ++++++--- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.editorconfig b/.editorconfig index 582a12360..61b517326 100644 --- a/.editorconfig +++ b/.editorconfig @@ -152,3 +152,5 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false # Wrapping preferences csharp_preserve_single_line_statements = true csharp_preserve_single_line_blocks = true + +dotnet_diagnostic.IDE0058.severity = none diff --git a/Directory.Packages.props b/Directory.Packages.props index d06ba1ccb..2a157c0af 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,13 +1,13 @@ - + - + diff --git a/test/AspNet.Security.OAuth.Providers.Tests/Apple/AppleClientSecretGeneratorTests.cs b/test/AspNet.Security.OAuth.Providers.Tests/Apple/AppleClientSecretGeneratorTests.cs index 9e4905ee3..ced6354b7 100644 --- a/test/AspNet.Security.OAuth.Providers.Tests/Apple/AppleClientSecretGeneratorTests.cs +++ b/test/AspNet.Security.OAuth.Providers.Tests/Apple/AppleClientSecretGeneratorTests.cs @@ -8,21 +8,15 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.IdentityModel.JsonWebTokens; namespace AspNet.Security.OAuth.Apple; -public class AppleClientSecretGeneratorTests +public class AppleClientSecretGeneratorTests(ITestOutputHelper outputHelper) { - private readonly ITestOutputHelper _outputHelper; - - public AppleClientSecretGeneratorTests(ITestOutputHelper outputHelper) - { - _outputHelper = outputHelper; - } - [Fact] public async Task GenerateAsync_Generates_Valid_Signed_Jwt() { @@ -186,13 +180,16 @@ private async Task GenerateTokenAsync( Func actAndAssert) { // Arrange - var builder = new WebHostBuilder() - .ConfigureLogging((p) => p.AddXUnit(_outputHelper).SetMinimumLevel(LogLevel.Debug)) - .Configure((app) => app.UseAuthentication()) - .ConfigureServices((services) => + var builder = new HostBuilder() + .ConfigureWebHost((builder) => { - services.AddAuthentication() - .AddApple(); + builder.ConfigureLogging((p) => p.AddXUnit(outputHelper).SetMinimumLevel(LogLevel.Debug)) + .Configure((app) => app.UseAuthentication()) + .ConfigureServices((services) => + { + services.AddAuthentication() + .AddApple(); + }); }); using var host = builder.Build(); diff --git a/test/AspNet.Security.OAuth.Providers.Tests/Infrastructure/ApplicationFactory.cs b/test/AspNet.Security.OAuth.Providers.Tests/Infrastructure/ApplicationFactory.cs index 9e7dd0424..6b49444a1 100644 --- a/test/AspNet.Security.OAuth.Providers.Tests/Infrastructure/ApplicationFactory.cs +++ b/test/AspNet.Security.OAuth.Providers.Tests/Infrastructure/ApplicationFactory.cs @@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Http; using Microsoft.Extensions.Logging; @@ -137,10 +138,15 @@ private static string IdentityToXmlString(ClaimsPrincipal user) private sealed class TestApplicationFactory : WebApplicationFactory { - protected override IWebHostBuilder CreateWebHostBuilder() + protected override void ConfigureWebHost(IWebHostBuilder builder) { - return new WebHostBuilder() - .UseSetting("TEST_CONTENTROOT_ASPNET_SECURITY_OAUTH_PROVIDERS_TESTS", "."); // Use a dummy content root + base.ConfigureWebHost(builder); + builder.UseContentRoot("."); // Use a dummy content root + } + + protected override IHostBuilder? CreateHostBuilder() + { + return new HostBuilder(); } } }