From 0fc16d1578fd2a0955e7947c0ebe1145b3e4caf6 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Fri, 28 Nov 2025 16:55:50 +1000 Subject: [PATCH] Update to .NET 10 SDK and dependencies --- .github/workflows/ci.yml | 2 +- Directory.Version.props | 2 +- global.json | 2 +- samples/Sample/Sample.csproj | 2 +- .../Serilog.AspNetCore.csproj | 12 ++++++------ .../Serilog.AspNetCore.Tests.csproj | 8 ++++---- .../SerilogWebHostBuilderExtensionsTests.cs | 4 ++-- .../Support/SerilogWebApplicationFactory.cs | 19 ++++++++++++++----- 8 files changed, 30 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acd3bc6..8b34c29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Setup uses: actions/setup-dotnet@v4 with: - dotnet-version: 9.0.x + dotnet-version: 10.0.x - name: Compute build number shell: bash run: | diff --git a/Directory.Version.props b/Directory.Version.props index 1ee8cc2..24db496 100644 --- a/Directory.Version.props +++ b/Directory.Version.props @@ -1,6 +1,6 @@ - 9.0.1 + 10.0.0 diff --git a/global.json b/global.json index db8627a..7ca72cb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "10.0.100", "allowPrerelease": false, "rollForward": "latestFeature" } diff --git a/samples/Sample/Sample.csproj b/samples/Sample/Sample.csproj index 446c9b8..a3fc142 100644 --- a/samples/Sample/Sample.csproj +++ b/samples/Sample/Sample.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 false diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 56c7dd4..af850d6 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -3,7 +3,7 @@ Serilog support for ASP.NET Core logging Microsoft;Serilog Contributors - net462;netstandard2.0;netstandard2.1;net8.0;net9.0 + net462;netstandard2.0;netstandard2.1;net8.0;net9.0;net10.0 serilog;aspnet;aspnetcore icon.png https://github.com/serilog/serilog-aspnetcore @@ -20,17 +20,17 @@ - - - + + + - - + + diff --git a/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj b/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj index a0a29df..41b8b51 100644 --- a/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj +++ b/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj @@ -1,7 +1,7 @@  - net9.0 + net10.0 false @@ -10,10 +10,10 @@ - + - - + + diff --git a/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs b/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs index 61ea07a..7e1237c 100644 --- a/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs +++ b/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs @@ -134,7 +134,7 @@ public async Task RequestLoggingMiddlewareShouldEnrichWithUnhandledExceptionEven Assert.Same(unhandledException, thrownException); } - WebApplicationFactory Setup( + WebApplicationFactory Setup( ILogger logger, bool dispose, Action? configureOptions = null, @@ -177,7 +177,7 @@ public async Task RequestLoggingMiddlewareShouldAddTraceAndSpanIds() Assert.NotNull(completionEvent.SpanId); } - (SerilogSink, WebApplicationFactory) Setup( + (SerilogSink, WebApplicationFactory) Setup( Action? configureOptions = null, Action? actionCallback = null) { diff --git a/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs b/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs index f4fe961..e92936f 100644 --- a/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs +++ b/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs @@ -1,13 +1,22 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.Extensions.Hosting; namespace Serilog.AspNetCore.Tests.Support; // ReSharper disable once ClassNeverInstantiated.Global -public class SerilogWebApplicationFactory : WebApplicationFactory +public class TestEntryPoint; + +// ReSharper disable once ClassNeverInstantiated.Global +public class SerilogWebApplicationFactory : WebApplicationFactory { - protected override IWebHostBuilder CreateWebHostBuilder() => new WebHostBuilder().UseStartup(); - protected override void ConfigureWebHost(IWebHostBuilder builder) => builder.UseContentRoot("."); -} + protected override IHostBuilder CreateHostBuilder() + { + return new HostBuilder(); + } -public class TestStartup { } \ No newline at end of file + protected override void ConfigureWebHost(IWebHostBuilder builder) + { + builder.UseContentRoot("."); + } +}