From e7d1a7918490addd7cdcc4986c5e5b239c5ee8aa Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 17:53:43 -0500 Subject: [PATCH 01/21] Adding .NET 10 support to unit and integration tests Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 21 ++++++++++++++++----- .github/workflows/sdk_build.yml | 17 ++++++++++++++--- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index b72e90ef4..e2cb51fe0 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - dotnet-version: ['8.0', '9.0'] + dotnet-version: ['8.0', '9.0', '10.0'] include: - dotnet-version: '8.0' display-name: '.NET 8.0' @@ -22,14 +22,19 @@ jobs: framework: 'net9' prefix: 'net9' install-version: '9.0.x' + - dotnet-version: '10.0' + display-name: '.NET 10.0' + framework: 'net10' + prefix: 'net10' + install-version: '10.0.x' env: NUPKG_OUTDIR: bin/Release/nugets GOVER: 1.20.3 GOOS: linux GOARCH: amd64 GOPROXY: https://proxy.golang.org - DAPR_CLI_VER: 1.15.2 - DAPR_RUNTIME_VER: 1.16.0-rc.6 + DAPR_CLI_VER: 1.16.0 + DAPR_RUNTIME_VER: 1.16.1 DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/release-1.16/install/install.sh DAPR_CLI_REF: '' steps: @@ -94,16 +99,22 @@ jobs: dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - name: Setup .NET 8 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version != '8.0.x' }} + if: ${{ matrix.install-version == '8.0.x' }} with: dotnet-version: '8.0.x' dotnet-quality: 'ga' - name: Setup .NET 9 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version != '9.0.x' }} + if: ${{ matrix.install-version == '9.0.x' }} with: dotnet-version: '9.0.x' dotnet-quality: 'ga' + - name: Setup .NET 10 (required) + uses: actions/setup-dotnet@v3 + if: ${{ matrix.install-version == '10.0.x' }} + with: + dotnet-version: '10.0.x' + dotnet-quality: 'preview' - name: Restore dependencies run: dotnet restore - name: Build diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 113858f0d..2170589c8 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: false matrix: - dotnet-version: ['8.0', '9.0'] + dotnet-version: ['8.0', '9.0', '10.0'] include: - dotnet-version: '8.0' display-name: '.NET 8.0' @@ -62,6 +62,11 @@ jobs: framework: 'net9' prefix: 'net9' install-version: '9.0.x' + - dotnet-version: '10.0' + display-name: '.NET 10.0' + framework: 'net10' + prefix: 'net10' + install-version: '10.0.x' steps: - uses: actions/checkout@v1 - name: Parse release version @@ -73,16 +78,22 @@ jobs: dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - name: Setup .NET 8 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version != '8.0.x' }} + if: ${{ matrix.install-version == '8.0.x' }} with: dotnet-version: '8.0.x' dotnet-quality: 'ga' - name: Setup .NET 9 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version != '9.0.x' }} + if: ${{ matrix.install-version == '9.0.x' }} with: dotnet-version: '9.0.x' dotnet-quality: 'ga' + - name: Setup .NET 10 (required) + uses: actions/setup-dotnet@v3 + if: ${{ matrix.install-version == '10.0.x' }} + with: + dotnet-version: '10.0.x' + dotnet-quality: 'preview' - name: Build # disable deterministic builds, just for test run. Deterministic builds break coverage for some reason run: dotnet build --configuration release /p:GITHUB_ACTIONS=false From 710220bc42c46f2f442e9466d048b291f9d9b870 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 17:54:07 -0500 Subject: [PATCH 02/21] Adding .NET 10 to Directory.Build.props files throughout solution Signed-off-by: Whit Waldo --- examples/Directory.Build.props | 2 +- src/Directory.Build.props | 2 +- test/Directory.Build.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Directory.Build.props b/examples/Directory.Build.props index 0c8af6eaf..3c403dd64 100644 --- a/examples/Directory.Build.props +++ b/examples/Directory.Build.props @@ -2,7 +2,7 @@ - net8;net9 + net8;net9;net10 $(RepoRoot)bin\$(Configuration)\examples\$(MSBuildProjectName)\ diff --git a/src/Directory.Build.props b/src/Directory.Build.props index e7b1b91fa..3f7f7c4da 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ - net8;net9 + net8;net9;net10 $(RepoRoot)bin\$(Configuration)\prod\$(MSBuildProjectName)\ $(OutputPath)$(MSBuildProjectName).xml diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 65b969f3b..09054627f 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,7 +2,7 @@ - net8;net9 + net8;net9;net10 $(RepoRoot)bin\$(Configuration)\test\$(MSBuildProjectName)\ From 14546efd13a015dd5b5cd0230d0927abebc39ff8 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 17:54:19 -0500 Subject: [PATCH 03/21] Fixed reference version number Signed-off-by: Whit Waldo --- .../Aspire/ServiceInvocationDemo/FrontendApp/FrontendApp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Hosting/Aspire/ServiceInvocationDemo/FrontendApp/FrontendApp.csproj b/examples/Hosting/Aspire/ServiceInvocationDemo/FrontendApp/FrontendApp.csproj index f1e3f0c23..3424ff655 100644 --- a/examples/Hosting/Aspire/ServiceInvocationDemo/FrontendApp/FrontendApp.csproj +++ b/examples/Hosting/Aspire/ServiceInvocationDemo/FrontendApp/FrontendApp.csproj @@ -8,7 +8,7 @@ - + From 57505d7a8774e533a078493a1790cc80665e311a Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 17:54:35 -0500 Subject: [PATCH 04/21] Updated Aspire hosting package number to latest Signed-off-by: Whit Waldo --- .../ServiceInvocationDemo.AppHost.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Hosting/Aspire/ServiceInvocationDemo/ServiceInvocationDemo.AppHost/ServiceInvocationDemo.AppHost.csproj b/examples/Hosting/Aspire/ServiceInvocationDemo/ServiceInvocationDemo.AppHost/ServiceInvocationDemo.AppHost.csproj index 07e655631..24e56dcd3 100644 --- a/examples/Hosting/Aspire/ServiceInvocationDemo/ServiceInvocationDemo.AppHost/ServiceInvocationDemo.AppHost.csproj +++ b/examples/Hosting/Aspire/ServiceInvocationDemo/ServiceInvocationDemo.AppHost/ServiceInvocationDemo.AppHost.csproj @@ -1,6 +1,6 @@ - + Exe @@ -13,8 +13,8 @@ - - + + From b838463e133acabbbbf736ce37a24b667a968c79 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:01:18 -0500 Subject: [PATCH 05/21] Updated ASP.NET Core test packages to support .NET 10 Signed-off-by: Whit Waldo --- Directory.Packages.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Packages.props b/Directory.Packages.props index 6db58e8e9..8476a26b7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -20,8 +20,10 @@ + + From ab5f3a2bc70819fc4634b86948d5c6971ab918d9 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:55:35 -0500 Subject: [PATCH 06/21] Modified deprecated WebHostBuilder to use HostBuilder instead Signed-off-by: Whit Waldo --- .../EndpointRouteBuilderExtensionsTests.cs | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs b/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs index 77b60fe06..1aac8f0b1 100644 --- a/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs +++ b/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs @@ -24,6 +24,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; namespace Dapr.Jobs.Test.Extensions; @@ -76,40 +77,45 @@ public async Task MapDaprScheduledJobHandler_HandlesTimeoutCorrectly() // Arrange var timeout = TimeSpan.FromSeconds(5); const string testJobName = "testJob"; - var testJobPayload = Encoding.UTF8.GetBytes("testPayload"); + var testJobPayload = "testPayload"u8.ToArray(); - var builder = new WebHostBuilder() - .ConfigureServices(services => + var builder = new HostBuilder(); + builder.ConfigureServices(services => { services.AddLogging(); services.AddRouting(); }) - .Configure(app => + .ConfigureWebHost(webBuilder => { - app.UseRouting(); - app.UseEndpoints(endpoints => + webBuilder.Configure(app => { - endpoints.MapDaprScheduledJobHandler(async ( - string jobName, - ReadOnlyMemory jobPayload, - ILogger? logger, - CancellationToken cancellationToken) => + app.UseRouting(); + app.UseEndpoints(endpoints => { - logger?.LogInformation("Received trigger invocation for job '{jobName}'", jobName); - - var deserializedPayload = Encoding.UTF8.GetString(jobPayload.Span); - logger?.LogInformation( - "Received invocation for the job '{jobName}' with payload '{deserializedPayload}'", - jobName, deserializedPayload); - await Task.Delay(TimeSpan.FromSeconds(1), - cancellationToken); //Less than the timeout, so this should work without throwing - - return Task.CompletedTask; - }, timeout); + endpoints.MapDaprScheduledJobHandler(async ( + string jobName, + ReadOnlyMemory jobPayload, + ILogger? logger, + CancellationToken cancellationToken) => + { + logger?.LogInformation("Received trigger invocation for job '{jobName}'", jobName); + + var deserializedPayload = Encoding.UTF8.GetString(jobPayload.Span); + logger?.LogInformation( + "Received invocation for the job '{jobName}' with payload '{deserializedPayload}'", + jobName, deserializedPayload); + await Task.Delay(TimeSpan.FromSeconds(1), + cancellationToken); //Less than the timeout, so this should work without throwing + + return Task.CompletedTask; + }, timeout); + }); }); }); - var testServer = new TestServer(builder); + var host = await builder.StartAsync(); + var testServer = host.GetTestServer(); + var client = testServer.CreateClient(); var requestContent = new ByteArrayContent(testJobPayload); @@ -129,7 +135,7 @@ public async Task MapDaprScheduledJobHandler_AppliesTimeoutCorrectly() // Arrange var timeout = TimeSpan.FromSeconds(1); const string testJobName = "testJob"; - var testJobPayload = Encoding.UTF8.GetBytes("testPayload"); + var testJobPayload = "testPayload"u8.ToArray(); var builder = new WebHostBuilder() .ConfigureServices(services => From b025f1a5b716efc5fb95fe93114e849c022d0372 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:55:53 -0500 Subject: [PATCH 07/21] Updated package TPMs Signed-off-by: Whit Waldo --- Directory.Packages.props | 20 ++++++++++---------- examples/Directory.Build.props | 2 +- src/Directory.Build.props | 2 +- test/Directory.Build.props | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 8476a26b7..fbe4d61db 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -34,15 +34,15 @@ - - - - - - - - - + + + + + + + + + @@ -53,7 +53,7 @@ - + diff --git a/examples/Directory.Build.props b/examples/Directory.Build.props index 3c403dd64..c98f86a8b 100644 --- a/examples/Directory.Build.props +++ b/examples/Directory.Build.props @@ -2,7 +2,7 @@ - net8;net9;net10 + net8.0;net9.0;net10.0 $(RepoRoot)bin\$(Configuration)\examples\$(MSBuildProjectName)\ diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 3f7f7c4da..c0c8e2c77 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ - net8;net9;net10 + net8.0;net9.0;net10.0 $(RepoRoot)bin\$(Configuration)\prod\$(MSBuildProjectName)\ $(OutputPath)$(MSBuildProjectName).xml diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 09054627f..835f82a70 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,7 +2,7 @@ - net8;net9;net10 + net8.0;net9.0;net10.0 $(RepoRoot)bin\$(Configuration)\test\$(MSBuildProjectName)\ From 09911233281b3940b395b1fc35058734c0bf04df Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:56:11 -0500 Subject: [PATCH 08/21] Fixing flags to accommodate .NET9+ Signed-off-by: Whit Waldo --- test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index 54e099be5..37a1efa52 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -402,7 +402,7 @@ public async Task InvokeAsync_ReadsBinaryData() { httpContext.Request.ContentType.ShouldBe(dataContentType); var bytes = new byte[httpContext.Request.Body.Length]; -#if NET9_0 +#if NET9_0_OR_GREATER httpContext.Request.Body.ReadExactly(bytes, 0, bytes.Length); #else httpContext.Request.Body.Read(bytes, 0, bytes.Length); @@ -478,4 +478,4 @@ private static string ReadBody(Stream stream, Encoding encoding = null) var str = encoding.GetString(bytes); return str; } -} \ No newline at end of file +} From f638a12a6908ae671834002bf70e6781be08db52 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:56:27 -0500 Subject: [PATCH 09/21] Adding .NET 10 target in pragma statements Signed-off-by: Whit Waldo --- test/Dapr.Analyzers.Common/TestUtilities.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Dapr.Analyzers.Common/TestUtilities.cs b/test/Dapr.Analyzers.Common/TestUtilities.cs index b6db51472..936a25881 100644 --- a/test/Dapr.Analyzers.Common/TestUtilities.cs +++ b/test/Dapr.Analyzers.Common/TestUtilities.cs @@ -35,6 +35,8 @@ internal static class TestUtilities var referenceAssemblies = ReferenceAssemblies.Net.Net80; #elif NET9_0 var referenceAssemblies = ReferenceAssemblies.Net.Net90; +#elif NET10_0 + var referenceAssemblies = ReferenceAssemblies.Net.Net10; #endif // Create a new project with necessary references From 01cdb4a22f14d5ff614d25f649cd638ac51eedd7 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:56:38 -0500 Subject: [PATCH 10/21] Added support for .NET 10 in global.json Signed-off-by: Whit Waldo --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index b86bbe43e..b01d305e4 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { - "_comment": "This policy allows the 9.0.100 SDK or patches in that family.", + "_comment": "This policy allows the 10.0.0 SDK or patches in that family.", "sdk": { - "version": "9.0.100", + "version": "10.0.0", "rollForward": "latestFeature" } } \ No newline at end of file From c5b58029c6c360edf05721c70231a5442e3b89e6 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:57:15 -0500 Subject: [PATCH 11/21] Possible fix for reference assemblies mismatch for .NET 10 Signed-off-by: Whit Waldo --- test/Dapr.Analyzers.Common/TestUtilities.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Dapr.Analyzers.Common/TestUtilities.cs b/test/Dapr.Analyzers.Common/TestUtilities.cs index 936a25881..92d569974 100644 --- a/test/Dapr.Analyzers.Common/TestUtilities.cs +++ b/test/Dapr.Analyzers.Common/TestUtilities.cs @@ -36,7 +36,7 @@ internal static class TestUtilities #elif NET9_0 var referenceAssemblies = ReferenceAssemblies.Net.Net90; #elif NET10_0 - var referenceAssemblies = ReferenceAssemblies.Net.Net10; + var referenceAssemblies = ReferenceAssemblies.Net.Net100; #endif // Create a new project with necessary references From 8b8b3f470aec76314f7fe08aea02a07fd91e257f Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 18:58:38 -0500 Subject: [PATCH 12/21] Fixed another pragma statement Signed-off-by: Whit Waldo --- test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index 37a1efa52..539c97a80 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -470,7 +470,7 @@ private static string ReadBody(Stream stream, Encoding encoding = null) encoding ??= Encoding.UTF8; var bytes = new byte[stream.Length]; -#if NET9_0 +#if NET9_0_OR_GREATER stream.ReadExactly(bytes, 0, bytes.Length); #else stream.Read(bytes, 0, bytes.Length); From 32af6277d20cd9af5b3b405c35740bd3b19b96d3 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 22:51:28 -0500 Subject: [PATCH 13/21] Migrated all uses of WebHostBuilder to HostBuilder Signed-off-by: Whit Waldo --- .../EndpointRouteBuilderExtensionsTests.cs | 105 ++++++++++-------- 1 file changed, 60 insertions(+), 45 deletions(-) diff --git a/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs b/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs index 1aac8f0b1..7b2b4d62e 100644 --- a/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs +++ b/test/Dapr.Jobs.Test/Extensions/EndpointRouteBuilderExtensionsTests.cs @@ -34,7 +34,7 @@ public class EndpointRouteBuilderExtensionsTest [Fact] public async Task MapDaprScheduledJobHandler_ValidRequest_ExecutesAction() { - var server = CreateTestServer(); + var server = await CreateTestServer(); var client = server.CreateClient(); var serializedPayload = JsonSerializer.Serialize(new SamplePayload("Dapr", 789)); @@ -54,7 +54,7 @@ public async Task MapDaprScheduledJobHandler_ValidRequest_ExecutesAction() [Fact] public async Task MapDaprScheduleJobHandler_HandleMissingCancellationToken() { - var server = CreateTestServer2(); + var server = await CreateTestServer2(); var client = server.CreateClient(); var serializedPayload = JsonSerializer.Serialize(new SamplePayload("Dapr", 789)); @@ -136,39 +136,43 @@ public async Task MapDaprScheduledJobHandler_AppliesTimeoutCorrectly() var timeout = TimeSpan.FromSeconds(1); const string testJobName = "testJob"; var testJobPayload = "testPayload"u8.ToArray(); - - var builder = new WebHostBuilder() - .ConfigureServices(services => + + var builder = new HostBuilder(); + builder.ConfigureServices(services => { services.AddLogging(); services.AddRouting(); }) - .Configure(app => + .ConfigureWebHost(webBuilder => { - app.UseRouting(); - app.UseEndpoints(endpoints => + webBuilder.Configure(app => { - endpoints.MapDaprScheduledJobHandler(async ( - string jobName, - ReadOnlyMemory jobPayload, - ILogger? logger, - CancellationToken cancellationToken) => + app.UseRouting(); + app.UseEndpoints(endpoints => { - logger?.LogInformation("Received trigger invocation for job '{jobName}'", jobName); + endpoints.MapDaprScheduledJobHandler(async ( + string jobName, + ReadOnlyMemory jobPayload, + ILogger? logger, + CancellationToken cancellationToken) => + { + logger?.LogInformation("Received trigger invocation for job '{jobName}'", jobName); - var deserializedPayload = Encoding.UTF8.GetString(jobPayload.Span); - logger?.LogInformation( - "Received invocation for the job '{jobName}' with payload '{deserializedPayload}'", - jobName, deserializedPayload); - await Task.Delay(timeout.Add(TimeSpan.FromSeconds(3)), - cancellationToken); //Intentionally delay longer than the timeout allows + var deserializedPayload = Encoding.UTF8.GetString(jobPayload.Span); + logger?.LogInformation( + "Received invocation for the job '{jobName}' with payload '{deserializedPayload}'", + jobName, deserializedPayload); + await Task.Delay(timeout.Add(TimeSpan.FromSeconds(3)), + cancellationToken); //Intentionally delay longer than the timeout allows - return Task.CompletedTask; - }, timeout); + return Task.CompletedTask; + }, timeout); + }); }); }); - var testServer = new TestServer(builder); + var host = await builder.StartAsync(); + var testServer = host.GetTestServer(); var client = testServer.CreateClient(); var requestContent = new ByteArrayContent(testJobPayload); @@ -189,55 +193,66 @@ public sealed class Validator public string? SerializedPayload { get; set; } } - private static TestServer CreateTestServer() + private static async Task CreateTestServer() { - var builder = new WebHostBuilder() + var builder = new HostBuilder() .ConfigureServices(services => { services.AddSingleton(); services.AddRouting(); }) - .Configure(app => + .ConfigureWebHost(host => { - app.UseRouting(); - app.UseEndpoints(endpoints => + host.Configure(app => { - endpoints.MapDaprScheduledJobHandler(async (string jobName, ReadOnlyMemory jobPayload, Validator validator, CancellationToken cancellationToken) => + app.UseRouting(); + app.UseEndpoints(endpoints => { - validator.JobName = jobName; - validator.SerializedPayload = Encoding.UTF8.GetString(jobPayload.Span); - await Task.CompletedTask; + endpoints.MapDaprScheduledJobHandler(async (string jobName, ReadOnlyMemory jobPayload, + Validator validator, CancellationToken cancellationToken) => + { + validator.JobName = jobName; + validator.SerializedPayload = Encoding.UTF8.GetString(jobPayload.Span); + await Task.CompletedTask; + }); }); }); }); - return new TestServer(builder); + var host = await builder.StartAsync(); + var testServer = host.GetTestServer(); + return testServer; } - private static TestServer CreateTestServer2() + private static async Task CreateTestServer2() { - var builder = new WebHostBuilder() + var builder = new HostBuilder() .ConfigureServices(services => { services.AddSingleton(); services.AddRouting(); }) - .Configure(app => + .ConfigureWebHost(host => { - app.UseRouting(); - app.UseEndpoints(endpoints => + host.Configure(app => { - endpoints.MapDaprScheduledJobHandler(async (string jobName, Validator validator, ReadOnlyMemory payload) => + app.UseRouting(); + app.UseEndpoints(endpoints => { - validator.JobName = jobName; - - var payloadString = Encoding.UTF8.GetString(payload.Span); - validator.SerializedPayload = payloadString; - await Task.CompletedTask; + endpoints.MapDaprScheduledJobHandler(async (string jobName, Validator validator, + ReadOnlyMemory payload) => + { + validator.JobName = jobName; + + var payloadString = Encoding.UTF8.GetString(payload.Span); + validator.SerializedPayload = payloadString; + await Task.CompletedTask; + }); }); }); }); - return new TestServer(builder); + var host = await builder.StartAsync(); + return host.GetTestServer(); } } From 22f50033e73e293a7250d6e443ec9b312be132f8 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Mon, 27 Oct 2025 22:54:07 -0500 Subject: [PATCH 14/21] Added pragma statement for .NET 10 Signed-off-by: Whit Waldo --- .../CSharpSourceGeneratorVerifier.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs b/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs index ef1d7b9a0..e6fcc7889 100644 --- a/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs +++ b/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs @@ -36,6 +36,8 @@ public Test() 8; #elif NET9_0 9; +#elif NET10_0 + 10; #endif // @@ -48,7 +50,7 @@ public Test() this.ReferenceAssemblies = new ReferenceAssemblies( - $"net{frameworkVersion}.0", + $"net{(frameworkVersion)}.0", new PackageIdentity( "Microsoft.NETCore.App.Ref", $"{frameworkVersion}.0.0"), From f686a76fa3b0f9979e8417576a176fde2821cbd8 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 28 Oct 2025 01:25:34 -0500 Subject: [PATCH 15/21] Made all the changes I can until the new test package comes out Signed-off-by: Whit Waldo --- Directory.Packages.props | 12 ++++++------ .../TimerCallbackMethodPresentAnalyzerTests.cs | 8 ++++---- test/Dapr.Analyzers.Common/TestUtilities.cs | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index fbe4d61db..e12172bf3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -19,10 +19,10 @@ - + - + @@ -33,7 +33,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -52,10 +52,10 @@ - + - + \ No newline at end of file diff --git a/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs b/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs index e3fd47f31..2d775f627 100644 --- a/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs +++ b/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs @@ -30,7 +30,7 @@ public async Task TestActor_TimerRegistration_NotPresent() { var context = new CSharpAnalyzerTest(); context.ReferenceAssemblies = assemblies.AddPackages([ - new ("Dapr.Actors", "1.15.3") + new ("Dapr.Actors", "1.16.0") ]); context.TestCode = """ @@ -55,7 +55,7 @@ public async Task TestActor_TimerRegistration_NameOfCallbackPresent() { var context = new CSharpAnalyzerTest(); context.ReferenceAssemblies = assemblies.AddPackages([ - new ("Dapr.Actors", "1.15.3") + new ("Dapr.Actors", "1.16.0") ]); @@ -86,7 +86,7 @@ public async Task TestActor_TimerRegistration_LiteralCallbackPresent() { var context = new CSharpAnalyzerTest(); context.ReferenceAssemblies = assemblies.AddPackages([ - new ("Dapr.Actors", "1.15.3") + new ("Dapr.Actors", "1.16.0") ]); @@ -117,7 +117,7 @@ public async Task TestActor_TimerRegistration_CallbackNotPresent() { var context = new CSharpAnalyzerTest(); context.ReferenceAssemblies = assemblies.AddPackages([ - new ("Dapr.Actors", "1.15.3") + new ("Dapr.Actors", "1.16.0") ]); context.TestCode = """ diff --git a/test/Dapr.Analyzers.Common/TestUtilities.cs b/test/Dapr.Analyzers.Common/TestUtilities.cs index 92d569974..a8b01b5d0 100644 --- a/test/Dapr.Analyzers.Common/TestUtilities.cs +++ b/test/Dapr.Analyzers.Common/TestUtilities.cs @@ -33,10 +33,10 @@ internal static class TestUtilities #if NET8_0 var referenceAssemblies = ReferenceAssemblies.Net.Net80; -#elif NET9_0 +#elif NET9_0_OR_GREATER var referenceAssemblies = ReferenceAssemblies.Net.Net90; -#elif NET10_0 - var referenceAssemblies = ReferenceAssemblies.Net.Net100; +// #elif NET10_0 +// var referenceAssemblies = ReferenceAssemblies.Net.Net10_0; #endif // Create a new project with necessary references From 1dbb4061f516e3ed855e5d8bdb7bb0d37fc05dab Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Thu, 6 Nov 2025 07:45:37 -0600 Subject: [PATCH 16/21] Updated .NET 10 reference assemblies Signed-off-by: Whit Waldo --- .../TimerCallbackMethodPresentAnalyzerTests.cs | 3 +++ test/Dapr.Analyzers.Common/TestUtilities.cs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs b/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs index 2d775f627..f1621a53d 100644 --- a/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs +++ b/test/Dapr.Actors.Analyzers.Test/TimerCallbackMethodPresentAnalyzerTests.cs @@ -23,8 +23,11 @@ public class TimerCallbackMethodPresentAnalyzerTests private static readonly ReferenceAssemblies assemblies = ReferenceAssemblies.Net.Net80; #elif NET9_0 private static readonly ReferenceAssemblies assemblies = ReferenceAssemblies.Net.Net90; + #elif NET10_0 + private static readonly ReferenceAssemblies assemblies = new ReferenceAssemblies("net10.0", new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0-rc.1.25451.107"), Path.Combine("ref", "net10.0")); #endif + [Fact] public async Task TestActor_TimerRegistration_NotPresent() { diff --git a/test/Dapr.Analyzers.Common/TestUtilities.cs b/test/Dapr.Analyzers.Common/TestUtilities.cs index a8b01b5d0..a8a3cae5f 100644 --- a/test/Dapr.Analyzers.Common/TestUtilities.cs +++ b/test/Dapr.Analyzers.Common/TestUtilities.cs @@ -33,10 +33,10 @@ internal static class TestUtilities #if NET8_0 var referenceAssemblies = ReferenceAssemblies.Net.Net80; -#elif NET9_0_OR_GREATER +#elif NET9_0 var referenceAssemblies = ReferenceAssemblies.Net.Net90; -// #elif NET10_0 -// var referenceAssemblies = ReferenceAssemblies.Net.Net10_0; + #elif NET10_0 + var referenceAssemblies = new ReferenceAssemblies("net10.0", new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0-rc.1.25451.107"), Path.Combine("ref", "net10.0")); #endif // Create a new project with necessary references From a22f781f4fd6a157b3027818ed0557f5417e5a00 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Thu, 6 Nov 2025 07:51:09 -0600 Subject: [PATCH 17/21] Added .NET 10 install to build script Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 2170589c8..df55cc082 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -27,11 +27,21 @@ jobs: - uses: actions/checkout@v1 - name: Parse release version run: python ./.github/scripts/get_release_version.py - - name: Setup .NET Core + - name: Setup .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + dotnet-quality: 'ga' + - name: Setup .NET 9 uses: actions/setup-dotnet@v3 with: dotnet-version: 9.0.x dotnet-quality: 'ga' + - name: Setup .NET 10 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 10.0.x + dotnet-quality: 'preview' - name: Restore dependencies run: dotnet restore - name: Build From af8c3b9abea4fd3eb340fc3976c0b0460d5435c4 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Thu, 6 Nov 2025 07:53:18 -0600 Subject: [PATCH 18/21] Installing .NET 10 across all test workflows Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index df55cc082..6c3001b3b 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -100,7 +100,6 @@ jobs: dotnet-quality: 'ga' - name: Setup .NET 10 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version == '10.0.x' }} with: dotnet-version: '10.0.x' dotnet-quality: 'preview' From e3514eec2116a37444e0e0bc2e4eab2a43e81e27 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Thu, 6 Nov 2025 07:56:26 -0600 Subject: [PATCH 19/21] Installing .NET 8, 9 and 10 during test workflows because of the global.json Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 6c3001b3b..ad1908bc9 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -88,13 +88,11 @@ jobs: dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - name: Setup .NET 8 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version == '8.0.x' }} with: dotnet-version: '8.0.x' dotnet-quality: 'ga' - name: Setup .NET 9 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version == '9.0.x' }} with: dotnet-version: '9.0.x' dotnet-quality: 'ga' From 34695fa7c06f57f8b226db2187c1313852046507 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Thu, 6 Nov 2025 07:57:56 -0600 Subject: [PATCH 20/21] Installing .NET 8, 9 and 10 during integration test workflows due to global.json Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index e2cb51fe0..71f30dd13 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -99,19 +99,16 @@ jobs: dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - name: Setup .NET 8 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version == '8.0.x' }} with: dotnet-version: '8.0.x' dotnet-quality: 'ga' - name: Setup .NET 9 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version == '9.0.x' }} with: dotnet-version: '9.0.x' dotnet-quality: 'ga' - name: Setup .NET 10 (required) uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version == '10.0.x' }} with: dotnet-version: '10.0.x' dotnet-quality: 'preview' From b5a4ee539d15895aa7bb4780e9e099226508bb40 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 7 Nov 2025 17:19:29 -0600 Subject: [PATCH 21/21] Tentative support for NuGet OIDC auth to get away from permanent keys Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index ad1908bc9..8fdeba488 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -161,6 +161,8 @@ jobs: echo "matrix=$files" >> $GITHUB_OUTPUT publish: + permissions: + id-token: write # Enable GitHub OIDC token issuance for this job name: Publish Packages needs: ['discover'] if: | @@ -177,9 +179,15 @@ jobs: with: name: packages path: packages + - name: NuGet logic (OIDC -> temp API key) + uses: NuGet/login@v1 + id: login + with: + user: ${{ secrets.NUGETORG_DAPR_USER }} - name: Publish ${{ matrix.package }} to NuGet run: | - dotnet nuget push "${{ matrix.package }}" --skip-duplicate --api-key ${{ secrets.NUGETORG_DAPR_API_KEY }} --source https://api.nuget.org/v3/index.json + dotnet nuget push "${{ matrix.package }}" --skip-duplicate --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json +# Old: dotnet nuget push "${{ matrix.package }}" --skip-duplicate --api-key ${{ secrets.NUGETORG_DAPR_API_KEY }} --source https://api.nuget.org/v3/index.json # - name: List packages (for sanity check) # run: ls -R