From 1c2648e9869021e4f9e51d34ff3a5bd5ba6fd03b Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 18:59:36 -0600 Subject: [PATCH 01/37] Updated build and integration test scripts to include .NET 9 Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 11 +++++++++-- .github/workflows/sdk_build.yml | 12 ++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index 36741ce7c..a96c69941 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['6.0', '7.0', '8.0'] + dotnet-version: ['6.0', '7.0', '8.0', '9.0'] include: - dotnet-version: '6.0' display-name: '.NET 6.0' @@ -36,6 +36,11 @@ jobs: framework: 'net8' prefix: 'net8' install-version: '8.0.x' + - dotnet-version: '9.0' + display-name: '.NET 9.0' + framework: 'net9' + prefix: 'net9' + install-version: '9.0.x' env: NUPKG_OUTDIR: bin/Release/nugets GOVER: 1.20.3 @@ -109,7 +114,9 @@ jobs: uses: actions/setup-dotnet@v1 if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 9.0.x - 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 diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index fe935bfb8..a05b79466 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet-version: ['6.0', '7.0', '8.0'] + dotnet-version: ['6.0', '7.0', '8.0', '9.0'] include: - dotnet-version: '6.0' install-3: false @@ -62,6 +62,12 @@ jobs: framework: 'net8' prefix: 'net8' install-version: '8.0.x' + - dotnet-version: '9.0' + install-3: false + display-name: '.NET 9.0' + framework: 'net9' + prefix: 'net9' + install-version: '9.0.x' steps: - uses: actions/checkout@v1 - name: Parse release version @@ -74,7 +80,9 @@ jobs: uses: actions/setup-dotnet@v1 if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 9.0.x - 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 58b12e36d6e2e7827376585bcf4f04d1802f5fb6 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:06:37 -0600 Subject: [PATCH 02/37] Removed unused matrix values Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index a05b79466..de5b4edd7 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -45,25 +45,21 @@ jobs: dotnet-version: ['6.0', '7.0', '8.0', '9.0'] include: - dotnet-version: '6.0' - install-3: false display-name: '.NET 6.0' framework: 'net6' prefix: 'net6' install-version: '6.0.x' - dotnet-version: '7.0' - install-3: false display-name: '.NET 7.0' framework: 'net7' prefix: 'net7' install-version: '7.0.x' - dotnet-version: '8.0' - install-3: false display-name: '.NET 8.0' framework: 'net8' prefix: 'net8' install-version: '8.0.x' - dotnet-version: '9.0' - install-3: false display-name: '.NET 9.0' framework: 'net9' prefix: 'net9' From 804a9d66e03c6f5ad33cf6be94b98e3f75905335 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:07:14 -0600 Subject: [PATCH 03/37] Reverted some .NET 8 requirement Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index a96c69941..60eee23af 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -114,9 +114,7 @@ jobs: uses: actions/setup-dotnet@v1 if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: | - 8.0.x - 9.0.x + dotnet-version: 8.0.x - 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 9a1b3a3ba6e5da1294498af8d63cacc8a8428e9c Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:11:34 -0600 Subject: [PATCH 04/37] Updated setup-dotnet to use latest action version + updated script to prefer a GA release, but use RC if available. Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 3 ++- .github/workflows/sdk_build.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index 60eee23af..1aaf4c9ba 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -107,9 +107,10 @@ jobs: - name: Parse release version run: python ./.github/scripts/get_release_version.py - name: Setup ${{ matrix.display-name }} - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: dotnet-version: ${{ matrix.install-version }} + dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - name: Setup .NET 8.0 # net8 is always required. uses: actions/setup-dotnet@v1 if: ${{ matrix.install-version != '8.0.x' }} diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index de5b4edd7..cf7ba67bd 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -73,12 +73,13 @@ jobs: with: dotnet-version: ${{ matrix.install-version }} - name: Setup .NET 8.0 # net8 is always required. - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 if: ${{ matrix.install-version != '8.0.x' }} with: dotnet-version: | 8.0.x 9.0.x + dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - 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 1b77c0a15a8a4e0f313fbbd9f64a0b15e2b46b06 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:14:29 -0600 Subject: [PATCH 05/37] Removed unnecessary secondary build step Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index cf7ba67bd..039314cd4 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -69,16 +69,9 @@ jobs: - name: Parse release version run: python ./.github/scripts/get_release_version.py - name: Setup ${{ matrix.display-name }} - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ matrix.install-version }} - - name: Setup .NET 8.0 # net8 is always required. uses: actions/setup-dotnet@v3 - if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: | - 8.0.x - 9.0.x + dotnet-version: ${{ matrix.install-version }} dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - name: Build # disable deterministic builds, just for test run. Deterministic builds break coverage for some reason From dc8d0919eae04002b63156509f017f49d2f86f80 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:36:35 -0600 Subject: [PATCH 06/37] Updating TFM moniker Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 039314cd4..d17d6373f 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -61,7 +61,7 @@ jobs: install-version: '8.0.x' - dotnet-version: '9.0' display-name: '.NET 9.0' - framework: 'net9' + framework: 'net9.0' prefix: 'net9' install-version: '9.0.x' steps: From 0bc6170faabd3677f2a339dc6741532f83b159e1 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:42:20 -0600 Subject: [PATCH 07/37] Added test to install VStest Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index d17d6373f..80bf0fd49 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -73,6 +73,8 @@ jobs: with: dotnet-version: ${{ matrix.install-version }} dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available + - name: Install VSTest (compatible with .NET 9 and older) + run: dotnet tool install --global dotnet-vstest --version 17.12.0 - 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 a725d8c768233cd86fefd98d03ee6a8e49845f89 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sat, 9 Nov 2024 19:49:48 -0600 Subject: [PATCH 08/37] Rolling back use of tool as it doesn't independently exist outside of the SDK 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 80bf0fd49..d17d6373f 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -73,8 +73,6 @@ jobs: with: dotnet-version: ${{ matrix.install-version }} dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - - name: Install VSTest (compatible with .NET 9 and older) - run: dotnet tool install --global dotnet-vstest --version 17.12.0 - 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 df627f9a24ef4292792b867ab034c47874b88db9 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 10:00:36 -0600 Subject: [PATCH 09/37] Added .NET 9 to build targets Signed-off-by: Whit Waldo --- src/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 35f0fbf7c..a74833a37 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ - net6;net8 + net6;net8;net9 $(RepoRoot)bin\$(Configuration)\prod\$(MSBuildProjectName)\ $(OutputPath)$(MSBuildProjectName).xml From 70916bce6cbcfc337391f02886bb60640ec45677 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 10:02:47 -0600 Subject: [PATCH 10/37] Added .NET 9 to target frameworks across solution Signed-off-by: Whit Waldo --- src/Dapr.Common/Dapr.Common.csproj | 2 +- src/Dapr.Workflow/Dapr.Workflow.csproj | 2 +- test/Directory.Build.props | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Dapr.Common/Dapr.Common.csproj b/src/Dapr.Common/Dapr.Common.csproj index 31af3952c..77709c144 100644 --- a/src/Dapr.Common/Dapr.Common.csproj +++ b/src/Dapr.Common/Dapr.Common.csproj @@ -1,7 +1,7 @@  - net6;net7;net8 + net6;net7;net8;net9 enable enable diff --git a/src/Dapr.Workflow/Dapr.Workflow.csproj b/src/Dapr.Workflow/Dapr.Workflow.csproj index 992baee73..f24d41e40 100644 --- a/src/Dapr.Workflow/Dapr.Workflow.csproj +++ b/src/Dapr.Workflow/Dapr.Workflow.csproj @@ -3,7 +3,7 @@ - net6;net7;net8 + net6;net7;net8;net9 enable Dapr.Workflow Dapr Workflow Authoring SDK diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 50b029a12..e3a49b72f 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,7 +2,7 @@ - net6;net7;net8 + net6;net7;net8;net9 $(RepoRoot)bin\$(Configuration)\test\$(MSBuildProjectName)\ From 378ac9f63ed259d19a9dc965717d5a48ed91eea9 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 10:19:58 -0600 Subject: [PATCH 11/37] I understand the reason for the required install step now - adding it back with a .NET 9 install step Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index d17d6373f..2e58880dc 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -61,7 +61,7 @@ jobs: install-version: '8.0.x' - dotnet-version: '9.0' display-name: '.NET 9.0' - framework: 'net9.0' + framework: 'net9' prefix: 'net9' install-version: '9.0.x' steps: @@ -76,6 +76,18 @@ jobs: - 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 + - 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: Test id: tests continue-on-error: true # proceed if tests fail to allow for the report generation in master or next step failure in PR From 10296198fac7ed806adc5659dec7880e8e48ef16 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 10:20:40 -0600 Subject: [PATCH 12/37] Placing install steps before build Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index 2e58880dc..18ebd9740 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -73,9 +73,6 @@ jobs: with: dotnet-version: ${{ matrix.install-version }} dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - - 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 - name: Setup .NET 8 (required) uses: actions/setup-dotnet@v3 if: ${{ matrix.install-version != '8.0.x' }} @@ -88,6 +85,9 @@ jobs: with: dotnet-version: '9.0.x' dotnet-quality: 'ga' + - 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 - name: Test id: tests continue-on-error: true # proceed if tests fail to allow for the report generation in master or next step failure in PR From ec3e95382093e3504f86a5c6218f28bbb819c7b1 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 10:42:47 -0600 Subject: [PATCH 13/37] Updating 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 fe53f92ae..3e41d7e1b 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "_comment": "This policy allows the 8.0.100 SDK or patches in that family.", "sdk": { - "version": "8.0.100", - "rollForward": "minor" + "version": "9.0.100-rc.2", + "rollForward": "latestFeature" } } \ No newline at end of file From 763dc7527c62c2bbc670c45e978f323f6090c6b9 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 11:24:29 -0600 Subject: [PATCH 14/37] Disabled analyzer errors in unit tests Signed-off-by: Whit Waldo --- test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index 9c1f1e005..a08b88057 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -328,7 +328,9 @@ public async Task InvokeAsync_ReadsBinaryData() { httpContext.Request.ContentType.Should().Be(dataContentType); var bytes = new byte[httpContext.Request.Body.Length]; +#pragma error disable CA2022 httpContext.Request.Body.Read(bytes, 0, bytes.Length); +#pragma error restore CA2022 bytes.Should().Equal(data); return Task.CompletedTask; }); @@ -391,7 +393,9 @@ private static string ReadBody(Stream stream, Encoding encoding = null) encoding ??= Encoding.UTF8; var bytes = new byte[stream.Length]; +#pragma error disable CA2022 stream.Read(bytes, 0, bytes.Length); +#pragma error resume CA2022 var str = encoding.GetString(bytes); return str; } From 37219db744b140e62446d49b1266a099b08e6247 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 11:25:19 -0600 Subject: [PATCH 15/37] Added .NET 9 to test Signed-off-by: Whit Waldo --- .../CSharpSourceGeneratorVerifier.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs b/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs index c64fd3427..ef1d7b9a0 100644 --- a/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs +++ b/test/Dapr.Actors.Generators.Test/CSharpSourceGeneratorVerifier.cs @@ -34,6 +34,8 @@ public Test() 7; #elif NET8_0 8; +#elif NET9_0 + 9; #endif // From 9b7f68cff639956b0b969c393918cece3c34fe8e Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 11:29:29 -0600 Subject: [PATCH 16/37] Changed from #pragma error to #pragma warning Signed-off-by: Whit Waldo --- test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index a08b88057..d492f2d14 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -328,9 +328,9 @@ public async Task InvokeAsync_ReadsBinaryData() { httpContext.Request.ContentType.Should().Be(dataContentType); var bytes = new byte[httpContext.Request.Body.Length]; -#pragma error disable CA2022 +#pragma warning disable CA2022 httpContext.Request.Body.Read(bytes, 0, bytes.Length); -#pragma error restore CA2022 +#pragma warning restore CA2022 bytes.Should().Equal(data); return Task.CompletedTask; }); @@ -393,9 +393,9 @@ private static string ReadBody(Stream stream, Encoding encoding = null) encoding ??= Encoding.UTF8; var bytes = new byte[stream.Length]; -#pragma error disable CA2022 +#pragma warning disable CA2022 stream.Read(bytes, 0, bytes.Length); -#pragma error resume CA2022 +#pragma warning resume CA2022 var str = encoding.GetString(bytes); return str; } From ed01370772dc226021ee50c8495488ed2626c370 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 11:31:17 -0600 Subject: [PATCH 17/37] Fixed unit tests to resolve analyzer warning Signed-off-by: Whit Waldo --- test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index d492f2d14..6dcb22144 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -328,9 +328,7 @@ public async Task InvokeAsync_ReadsBinaryData() { httpContext.Request.ContentType.Should().Be(dataContentType); var bytes = new byte[httpContext.Request.Body.Length]; -#pragma warning disable CA2022 - httpContext.Request.Body.Read(bytes, 0, bytes.Length); -#pragma warning restore CA2022 + httpContext.Request.Body.ReadExactly(bytes, 0, bytes.Length); bytes.Should().Equal(data); return Task.CompletedTask; }); @@ -393,9 +391,7 @@ private static string ReadBody(Stream stream, Encoding encoding = null) encoding ??= Encoding.UTF8; var bytes = new byte[stream.Length]; -#pragma warning disable CA2022 - stream.Read(bytes, 0, bytes.Length); -#pragma warning resume CA2022 + stream.ReadExactly(bytes, 0, bytes.Length); var str = encoding.GetString(bytes); return str; } From b293f3112eb3593488a1e82d4164f671d0f91c90 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 11:35:18 -0600 Subject: [PATCH 18/37] Updated integration test to always include .NET 8 and .NET 9 installs Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index 1aaf4c9ba..c9592cf45 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -111,11 +111,19 @@ jobs: with: dotnet-version: ${{ matrix.install-version }} dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available - - name: Setup .NET 8.0 # net8 is always required. - uses: actions/setup-dotnet@v1 + - name: Setup .NET 8 (required) + uses: actions/setup-dotnet@v3 if: ${{ matrix.install-version != '8.0.x' }} with: - dotnet-version: 8.0.x + 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: Build - 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 2ac52076f82e11a54e938aa3ec7cf3690f511b84 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 11:56:13 -0600 Subject: [PATCH 19/37] Falling back to add separate .NET 9 support Signed-off-by: Whit Waldo --- test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index 6dcb22144..069b1a755 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -328,7 +328,11 @@ public async Task InvokeAsync_ReadsBinaryData() { httpContext.Request.ContentType.Should().Be(dataContentType); var bytes = new byte[httpContext.Request.Body.Length]; +#if NET9_0 httpContext.Request.Body.ReadExactly(bytes, 0, bytes.Length); +#else + httpContext.Request.Body.Read(bytes, 0, bytes.Length); +#endif bytes.Should().Equal(data); return Task.CompletedTask; }); @@ -391,7 +395,11 @@ private static string ReadBody(Stream stream, Encoding encoding = null) encoding ??= Encoding.UTF8; var bytes = new byte[stream.Length]; +#if NET9_0 stream.ReadExactly(bytes, 0, bytes.Length); +#else + stream.Read(bytes, 0, bytes.Length); +#endif var str = encoding.GetString(bytes); return str; } From 056c7d477d5021a3ac48ee5a2f3a7b0b7690467b Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 12:18:55 -0600 Subject: [PATCH 20/37] Updated referenced projects to target appropriate frameworks Signed-off-by: Whit Waldo --- src/Dapr.Common/Dapr.Common.csproj | 1 - src/Dapr.Jobs/Dapr.Jobs.csproj | 1 - src/Dapr.Protos/Dapr.Protos.csproj | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Dapr.Common/Dapr.Common.csproj b/src/Dapr.Common/Dapr.Common.csproj index 77709c144..2516e7f6e 100644 --- a/src/Dapr.Common/Dapr.Common.csproj +++ b/src/Dapr.Common/Dapr.Common.csproj @@ -1,7 +1,6 @@  - net6;net7;net8;net9 enable enable diff --git a/src/Dapr.Jobs/Dapr.Jobs.csproj b/src/Dapr.Jobs/Dapr.Jobs.csproj index 74c9bec23..9f209b0bd 100644 --- a/src/Dapr.Jobs/Dapr.Jobs.csproj +++ b/src/Dapr.Jobs/Dapr.Jobs.csproj @@ -1,7 +1,6 @@  - net6;net8 enable enable Dapr.Jobs diff --git a/src/Dapr.Protos/Dapr.Protos.csproj b/src/Dapr.Protos/Dapr.Protos.csproj index 8a8804b22..5331f229c 100644 --- a/src/Dapr.Protos/Dapr.Protos.csproj +++ b/src/Dapr.Protos/Dapr.Protos.csproj @@ -1,6 +1,7 @@  + net6;net7;net8;net9 enable enable This package contains the reference protos used by develop services using Dapr. From 9a21e82f54ff06effde850127860acf9b4b89d9b Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 12:59:11 -0600 Subject: [PATCH 21/37] Added all target frameworks back to Dapr.Commono Signed-off-by: Whit Waldo --- src/Dapr.Common/Dapr.Common.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Dapr.Common/Dapr.Common.csproj b/src/Dapr.Common/Dapr.Common.csproj index 2516e7f6e..d1e106b6d 100644 --- a/src/Dapr.Common/Dapr.Common.csproj +++ b/src/Dapr.Common/Dapr.Common.csproj @@ -1,6 +1,7 @@  + net6;net7;net8;net9 enable enable From 677b982149672070a3eee89518df51cb8018c3e7 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Sun, 10 Nov 2024 13:25:34 -0600 Subject: [PATCH 22/37] Added warnings to fix nullability analyzer warnings when targeting .NET 6 Signed-off-by: Whit Waldo --- src/Dapr.Jobs/Models/DaprJobSchedule.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Dapr.Jobs/Models/DaprJobSchedule.cs b/src/Dapr.Jobs/Models/DaprJobSchedule.cs index c1b592e12..8b1666727 100644 --- a/src/Dapr.Jobs/Models/DaprJobSchedule.cs +++ b/src/Dapr.Jobs/Models/DaprJobSchedule.cs @@ -67,7 +67,9 @@ public static DaprJobSchedule FromCronExpression(CronExpressionBuilder builder) /// public static DaprJobSchedule FromDateTime(DateTimeOffset scheduledTime) { +#if NET6_0 ArgumentNullException.ThrowIfNull(scheduledTime, nameof(scheduledTime)); +#endif return new DaprJobSchedule(scheduledTime.ToString("O")); } @@ -77,7 +79,9 @@ public static DaprJobSchedule FromDateTime(DateTimeOffset scheduledTime) /// The systemd Cron-like expression indicating when the job should be triggered. public static DaprJobSchedule FromExpression(string expression) { +#if NET6_0 ArgumentNullException.ThrowIfNull(expression, nameof(expression)); +#endif return new DaprJobSchedule(expression); } @@ -87,7 +91,9 @@ public static DaprJobSchedule FromExpression(string expression) /// The duration interval. public static DaprJobSchedule FromDuration(TimeSpan duration) { +#if NET6_0 ArgumentNullException.ThrowIfNull(duration, nameof(duration)); +#endif return new DaprJobSchedule(duration.ToDurationString()); } From 1be87d6ac74d0cbf42ea3958a8896cee6dbc1c68 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 26 Nov 2024 10:00:02 -0600 Subject: [PATCH 23/37] Updated build step to use .NET 9 instead Signed-off-by: Whit Waldo --- .github/workflows/sdk_build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk_build.yml b/.github/workflows/sdk_build.yml index c30bec56d..b6e263530 100644 --- a/.github/workflows/sdk_build.yml +++ b/.github/workflows/sdk_build.yml @@ -24,9 +24,10 @@ jobs: - name: Parse release version run: python ./.github/scripts/get_release_version.py - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v3 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x + dotnet-quality: 'ga' - name: Build run: dotnet build --configuration release - name: Generate Packages From a7e15da9d8d40cca027bff18c3c2c9ef7722d6be Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 26 Nov 2024 10:20:59 -0600 Subject: [PATCH 24/37] Fixed cloud event middleware tests - the ApplicationBuilder requires a non-null ServiceProvider per https://learn.microsoft.com/en-us/dotnet/core/compatibility/extensions/8.0/activatorutilities-createinstance-null-provider Signed-off-by: Whit Waldo --- src/Dapr.Common/Dapr.Common.csproj | 1 - .../CloudEventsMiddlewareTest.cs | 191 ++++++++++++------ test/Dapr.Client.Test/DaprClientTest.cs | 2 +- 3 files changed, 132 insertions(+), 62 deletions(-) diff --git a/src/Dapr.Common/Dapr.Common.csproj b/src/Dapr.Common/Dapr.Common.csproj index d1e106b6d..2516e7f6e 100644 --- a/src/Dapr.Common/Dapr.Common.csproj +++ b/src/Dapr.Common/Dapr.Common.csproj @@ -1,7 +1,6 @@  - net6;net7;net8;net9 enable enable diff --git a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs index 069b1a755..2f9fab936 100644 --- a/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs +++ b/test/Dapr.AspNetCore.Test/CloudEventsMiddlewareTest.cs @@ -11,6 +11,8 @@ // limitations under the License. // ------------------------------------------------------------------------ +using Microsoft.Extensions.DependencyInjection; + namespace Dapr.AspNetCore.Test { using System.IO; @@ -33,7 +35,10 @@ public class CloudEventsMiddlewareTest [InlineData("application/cloudevents-batch+json")] // we don't support batch public async Task InvokeAsync_IgnoresOtherContentTypes(string contentType) { - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); // Do verification in the scope of the middleware @@ -46,9 +51,10 @@ public async Task InvokeAsync_IgnoresOtherContentTypes(string contentType) var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = contentType; - context.Request.Body = MakeBody("Hello, world!"); + var context = new DefaultHttpContext + { + Request = { ContentType = contentType, Body = MakeBody("Hello, world!") } + }; await pipeline.Invoke(context); } @@ -62,7 +68,10 @@ public async Task InvokeAsync_IgnoresOtherContentTypes(string contentType) public async Task InvokeAsync_ReplacesBodyJson(string dataContentType, string charSet) { var encoding = charSet == null ? null : Encoding.GetEncoding(charSet); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); // Do verification in the scope of the middleware @@ -75,11 +84,17 @@ public async Task InvokeAsync_ReplacesBodyJson(string dataContentType, string ch var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = charSet == null ? "application/cloudevents+json" : $"application/cloudevents+json;charset={charSet}"; - context.Request.Body = dataContentType == null ? - MakeBody("{ \"data\": { \"name\":\"jimmy\" } }", encoding) : - MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding); + var context = new DefaultHttpContext { Request = + { + ContentType = + charSet == null + ? "application/cloudevents+json" + : $"application/cloudevents+json;charset={charSet}", + Body = dataContentType == null ? + MakeBody("{ \"data\": { \"name\":\"jimmy\" } }", encoding) : + MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding) + } + }; await pipeline.Invoke(context); } @@ -93,7 +108,10 @@ public async Task InvokeAsync_ReplacesBodyJson(string dataContentType, string ch public async Task InvokeAsync_ReplacesPascalCasedBodyJson(string dataContentType, string charSet) { var encoding = charSet == null ? null : Encoding.GetEncoding(charSet); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); // Do verification in the scope of the middleware @@ -106,11 +124,17 @@ public async Task InvokeAsync_ReplacesPascalCasedBodyJson(string dataContentType var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = charSet == null ? "application/cloudevents+json" : $"application/cloudevents+json;charset={charSet}"; - context.Request.Body = dataContentType == null ? - MakeBody("{ \"Data\": { \"name\":\"jimmy\" } }", encoding) : - MakeBody($"{{ \"DataContentType\": \"{dataContentType}\", \"Data\": {{ \"name\":\"jimmy\" }} }}", encoding); + var context = new DefaultHttpContext { Request = + { + ContentType = + charSet == null + ? "application/cloudevents+json" + : $"application/cloudevents+json;charset={charSet}", + Body = dataContentType == null ? + MakeBody("{ \"Data\": { \"name\":\"jimmy\" } }", encoding) : + MakeBody($"{{ \"DataContentType\": \"{dataContentType}\", \"Data\": {{ \"name\":\"jimmy\" }} }}", encoding) + } + }; await pipeline.Invoke(context); } @@ -124,7 +148,10 @@ public async Task InvokeAsync_ReplacesPascalCasedBodyJson(string dataContentType public async Task InvokeAsync_ForwardsJsonPropertiesAsHeaders(string dataContentType, string charSet) { var encoding = charSet == null ? null : Encoding.GetEncoding(charSet); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(new CloudEventsMiddlewareOptions { ForwardCloudEventPropertiesAsHeaders = true @@ -143,11 +170,17 @@ public async Task InvokeAsync_ForwardsJsonPropertiesAsHeaders(string dataContent var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = charSet == null ? "application/cloudevents+json" : $"application/cloudevents+json;charset={charSet}"; - context.Request.Body = dataContentType == null ? - MakeBody("{ \"type\": \"Test.Type\", \"subject\": \"Test.Subject\", \"data\": { \"name\":\"jimmy\" } }", encoding) : - MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"type\":\"Test.Type\", \"subject\": \"Test.Subject\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding); + var context = new DefaultHttpContext { Request = + { + ContentType = + charSet == null + ? "application/cloudevents+json" + : $"application/cloudevents+json;charset={charSet}", + Body = dataContentType == null ? + MakeBody("{ \"type\": \"Test.Type\", \"subject\": \"Test.Subject\", \"data\": { \"name\":\"jimmy\" } }", encoding) : + MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"type\":\"Test.Type\", \"subject\": \"Test.Subject\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding) + } + }; await pipeline.Invoke(context); } @@ -161,7 +194,10 @@ public async Task InvokeAsync_ForwardsJsonPropertiesAsHeaders(string dataContent public async Task InvokeAsync_ForwardsIncludedJsonPropertiesAsHeaders(string dataContentType, string charSet) { var encoding = charSet == null ? null : Encoding.GetEncoding(charSet); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(new CloudEventsMiddlewareOptions { ForwardCloudEventPropertiesAsHeaders = true, @@ -181,11 +217,17 @@ public async Task InvokeAsync_ForwardsIncludedJsonPropertiesAsHeaders(string dat var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = charSet == null ? "application/cloudevents+json" : $"application/cloudevents+json;charset={charSet}"; - context.Request.Body = dataContentType == null ? - MakeBody("{ \"type\": \"Test.Type\", \"subject\": \"Test.Subject\", \"data\": { \"name\":\"jimmy\" } }", encoding) : - MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"type\":\"Test.Type\", \"subject\": \"Test.Subject\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding); + var context = new DefaultHttpContext { Request = + { + ContentType = + charSet == null + ? "application/cloudevents+json" + : $"application/cloudevents+json;charset={charSet}", + Body = dataContentType == null ? + MakeBody("{ \"type\": \"Test.Type\", \"subject\": \"Test.Subject\", \"data\": { \"name\":\"jimmy\" } }", encoding) : + MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"type\":\"Test.Type\", \"subject\": \"Test.Subject\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding) + } + }; await pipeline.Invoke(context); } @@ -199,7 +241,10 @@ public async Task InvokeAsync_ForwardsIncludedJsonPropertiesAsHeaders(string dat public async Task InvokeAsync_DoesNotForwardExcludedJsonPropertiesAsHeaders(string dataContentType, string charSet) { var encoding = charSet == null ? null : Encoding.GetEncoding(charSet); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(new CloudEventsMiddlewareOptions { ForwardCloudEventPropertiesAsHeaders = true, @@ -219,11 +264,17 @@ public async Task InvokeAsync_DoesNotForwardExcludedJsonPropertiesAsHeaders(stri var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = charSet == null ? "application/cloudevents+json" : $"application/cloudevents+json;charset={charSet}"; - context.Request.Body = dataContentType == null ? - MakeBody("{ \"type\": \"Test.Type\", \"subject\": \"Test.Subject\", \"data\": { \"name\":\"jimmy\" } }", encoding) : - MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"type\":\"Test.Type\", \"subject\": \"Test.Subject\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding); + var context = new DefaultHttpContext { Request = + { + ContentType = + charSet == null + ? "application/cloudevents+json" + : $"application/cloudevents+json;charset={charSet}", + Body = dataContentType == null ? + MakeBody("{ \"type\": \"Test.Type\", \"subject\": \"Test.Subject\", \"data\": { \"name\":\"jimmy\" } }", encoding) : + MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"type\":\"Test.Type\", \"subject\": \"Test.Subject\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding) + } + }; await pipeline.Invoke(context); } @@ -234,10 +285,13 @@ public async Task InvokeAsync_ReplacesBodyNonJsonData() // Our logic is based on the content-type, not the content. // Since this is for text-plain content, we're going to encode it as a JSON string // and store it in the data attribute - the middleware should JSON-decode it. - var input = "{ \"message\": \"hello, world\"}"; + const string input = "{ \"message\": \"hello, world\"}"; var expected = input; - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); // Do verification in the scope of the middleware @@ -251,9 +305,12 @@ public async Task InvokeAsync_ReplacesBodyNonJsonData() var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = "application/cloudevents+json"; - context.Request.Body = MakeBody($"{{ \"datacontenttype\": \"text/plain\", \"data\": {JsonSerializer.Serialize(input)} }}"); + var context = new DefaultHttpContext { Request = + { + ContentType = "application/cloudevents+json", + Body = MakeBody($"{{ \"datacontenttype\": \"text/plain\", \"data\": {JsonSerializer.Serialize(input)} }}") + } + }; await pipeline.Invoke(context); } @@ -262,10 +319,13 @@ public async Task InvokeAsync_ReplacesBodyNonJsonData() public async Task InvokeAsync_ReplacesBodyNonJsonData_ExceptWhenSuppressed() { // Our logic is based on the content-type, not the content. This test tests the old bad behavior. - var input = "{ \"message\": \"hello, world\"}"; + const string input = "{ \"message\": \"hello, world\"}"; var expected = JsonSerializer.Serialize(input); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(new CloudEventsMiddlewareOptions() { SuppressJsonDecodingOfTextPayloads = true, }); // Do verification in the scope of the middleware @@ -279,9 +339,12 @@ public async Task InvokeAsync_ReplacesBodyNonJsonData_ExceptWhenSuppressed() var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = "application/cloudevents+json"; - context.Request.Body = MakeBody($"{{ \"datacontenttype\": \"text/plain\", \"data\": {JsonSerializer.Serialize(input)} }}"); + var context = new DefaultHttpContext { Request = + { + ContentType = "application/cloudevents+json", + Body = MakeBody($"{{ \"datacontenttype\": \"text/plain\", \"data\": {JsonSerializer.Serialize(input)} }}") + } + }; await pipeline.Invoke(context); } @@ -291,10 +354,13 @@ public async Task InvokeAsync_ReplacesBodyNonJsonData_ExceptWhenSuppressed() [Fact] public async Task InvokeAsync_ReplacesBodyJson_NormalizesPayloadCharset() { - var dataContentType = "application/person+json;charset=UTF-16"; - var charSet = "UTF-16"; + const string dataContentType = "application/person+json;charset=UTF-16"; + const string charSet = "UTF-16"; var encoding = Encoding.GetEncoding(charSet); - var app = new ApplicationBuilder(null); + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); // Do verification in the scope of the middleware @@ -307,10 +373,11 @@ public async Task InvokeAsync_ReplacesBodyJson_NormalizesPayloadCharset() var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = $"application/cloudevents+json;charset={charSet}"; - context.Request.Body = - MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding); + var context = new DefaultHttpContext { Request = + { + ContentType = $"application/cloudevents+json;charset={charSet}", Body = MakeBody($"{{ \"datacontenttype\": \"{dataContentType}\", \"data\": {{ \"name\":\"jimmy\" }} }}", encoding) + } + }; await pipeline.Invoke(context); } @@ -318,8 +385,11 @@ public async Task InvokeAsync_ReplacesBodyJson_NormalizesPayloadCharset() [Fact] public async Task InvokeAsync_ReadsBinaryData() { - var dataContentType = "application/octet-stream"; - var app = new ApplicationBuilder(null); + const string dataContentType = "application/octet-stream"; + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); var data = new byte[] { 1, 2, 3 }; @@ -339,8 +409,7 @@ public async Task InvokeAsync_ReadsBinaryData() var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = "application/cloudevents+json"; + var context = new DefaultHttpContext { Request = { ContentType = "application/cloudevents+json" } }; var base64Str = System.Convert.ToBase64String(data); context.Request.Body = @@ -352,10 +421,13 @@ public async Task InvokeAsync_ReadsBinaryData() [Fact] public async Task InvokeAsync_DataAndData64Set_ReturnsBadRequest() { - var dataContentType = "application/octet-stream"; - var app = new ApplicationBuilder(null); + const string dataContentType = "application/octet-stream"; + var serviceCollection = new ServiceCollection(); + var provider = serviceCollection.BuildServiceProvider(); + + var app = new ApplicationBuilder(provider); app.UseCloudEvents(); - var data = "{\"id\": \"1\"}"; + const string data = "{\"id\": \"1\"}"; // Do verification in the scope of the middleware app.Run(httpContext => @@ -368,8 +440,7 @@ public async Task InvokeAsync_DataAndData64Set_ReturnsBadRequest() var pipeline = app.Build(); - var context = new DefaultHttpContext(); - context.Request.ContentType = "application/cloudevents+json"; + var context = new DefaultHttpContext { Request = { ContentType = "application/cloudevents+json" } }; var bytes = Encoding.UTF8.GetBytes(data); var base64Str = System.Convert.ToBase64String(bytes); context.Request.Body = diff --git a/test/Dapr.Client.Test/DaprClientTest.cs b/test/Dapr.Client.Test/DaprClientTest.cs index 01d22edcf..e280728c2 100644 --- a/test/Dapr.Client.Test/DaprClientTest.cs +++ b/test/Dapr.Client.Test/DaprClientTest.cs @@ -45,7 +45,7 @@ public void CreateInvokeHttpClient_WithoutAppId() var client = DaprClient.CreateInvokeHttpClient(daprEndpoint: "http://localhost:3500"); Assert.Null(client.BaseAddress); } - + [Fact] public void CreateInvokeHttpClient_InvalidDaprEndpoint_InvalidFormat() { From e32c9a68fe00ea87bdf1c32a8e51fbbe6f86f7a1 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 26 Nov 2024 10:40:16 -0600 Subject: [PATCH 25/37] Including target for .NET 6, 7, 8 and 9 Signed-off-by: Whit Waldo --- src/Dapr.Common/Dapr.Common.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Dapr.Common/Dapr.Common.csproj b/src/Dapr.Common/Dapr.Common.csproj index 2516e7f6e..d1e106b6d 100644 --- a/src/Dapr.Common/Dapr.Common.csproj +++ b/src/Dapr.Common/Dapr.Common.csproj @@ -1,6 +1,7 @@  + net6;net7;net8;net9 enable enable From 0189ffcf007e982290f093e9962e3c7f3cc07b8b Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 26 Nov 2024 10:48:08 -0600 Subject: [PATCH 26/37] Trialing fix to E2E integration test - excluding use of AppWebApplicationFactory in favor of direct use of HttpClient Signed-off-by: Whit Waldo --- .../CloudEventsIntegrationTest.cs | 61 ++++++++++++------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs b/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs index dd940a75d..58de49b0b 100644 --- a/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs +++ b/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs @@ -143,28 +143,47 @@ public async Task CanSendStructuredCloudEvent_WithNonJsonContentType() [Fact] public async Task CanSendBinaryCloudEvent_WithContentType() { - using (var factory = new AppWebApplicationFactory()) + var httpClient = new HttpClient(); + var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user") { - var httpClient = factory.CreateClient(new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions { HandleCookies = false }); - - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user") - { - Content = new StringContent( - JsonSerializer.Serialize( - new - { - name = "jimmy", - }), - Encoding.UTF8) - }; - request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - - var response = await httpClient.SendAsync(request); - response.EnsureSuccessStatusCode(); - - var userInfo = await JsonSerializer.DeserializeAsync(await response.Content.ReadAsStreamAsync(), this.options); - userInfo.Name.Should().Be("jimmy"); - } + Content = new StringContent( + JsonSerializer.Serialize( + new + { + name = "jimmy", + }), + Encoding.UTF8) + }; + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + + var response = await httpClient.SendAsync(request); + response.EnsureSuccessStatusCode(); + var userInfo = await JsonSerializer.DeserializeAsync(await response.Content.ReadAsStreamAsync(), this.options); + userInfo.Name.Should().Be("jimmy"); + + + // using (var factory = new AppWebApplicationFactory()) + // { + // var httpClient = factory.CreateClient(new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions { HandleCookies = false }); + // + // var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user") + // { + // Content = new StringContent( + // JsonSerializer.Serialize( + // new + // { + // name = "jimmy", + // }), + // Encoding.UTF8) + // }; + // request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + // + // var response = await httpClient.SendAsync(request); + // response.EnsureSuccessStatusCode(); + // + // var userInfo = await JsonSerializer.DeserializeAsync(await response.Content.ReadAsStreamAsync(), this.options); + // userInfo.Name.Should().Be("jimmy"); + // } } } } From 3635f5e25701f13f9dc5b8bf9fa127e90030832e Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 26 Nov 2024 11:13:36 -0600 Subject: [PATCH 27/37] Reverting as it breaks the other .NET versions Signed-off-by: Whit Waldo --- .../CloudEventsIntegrationTest.cs | 55 ++++++------------- 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs b/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs index 58de49b0b..9b0b5d3a3 100644 --- a/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs +++ b/test/Dapr.AspNetCore.IntegrationTest/CloudEventsIntegrationTest.cs @@ -143,47 +143,28 @@ public async Task CanSendStructuredCloudEvent_WithNonJsonContentType() [Fact] public async Task CanSendBinaryCloudEvent_WithContentType() { - var httpClient = new HttpClient(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user") + using (var factory = new AppWebApplicationFactory()) { - Content = new StringContent( - JsonSerializer.Serialize( - new - { - name = "jimmy", - }), - Encoding.UTF8) - }; - request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + var httpClient = factory.CreateClient(new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions { HandleCookies = false }); - var response = await httpClient.SendAsync(request); - response.EnsureSuccessStatusCode(); - var userInfo = await JsonSerializer.DeserializeAsync(await response.Content.ReadAsStreamAsync(), this.options); - userInfo.Name.Should().Be("jimmy"); + var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user") + { + Content = new StringContent( + JsonSerializer.Serialize( + new + { + name = "jimmy", + }), + Encoding.UTF8) + }; + request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); + var response = await httpClient.SendAsync(request); + response.EnsureSuccessStatusCode(); - // using (var factory = new AppWebApplicationFactory()) - // { - // var httpClient = factory.CreateClient(new Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactoryClientOptions { HandleCookies = false }); - // - // var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/register-user") - // { - // Content = new StringContent( - // JsonSerializer.Serialize( - // new - // { - // name = "jimmy", - // }), - // Encoding.UTF8) - // }; - // request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - // - // var response = await httpClient.SendAsync(request); - // response.EnsureSuccessStatusCode(); - // - // var userInfo = await JsonSerializer.DeserializeAsync(await response.Content.ReadAsStreamAsync(), this.options); - // userInfo.Name.Should().Be("jimmy"); - // } + var userInfo = await JsonSerializer.DeserializeAsync(await response.Content.ReadAsStreamAsync(), this.options); + userInfo.Name.Should().Be("jimmy"); + } } } } From 9506c0d1616cad81cc86193909f27119938cf9b6 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 29 Nov 2024 18:51:06 -0600 Subject: [PATCH 28/37] Potentially fixed unit tests in .NET 9 Signed-off-by: Whit Waldo --- .../Dapr.AspNetCore.IntegrationTest.csproj | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj b/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj index d51dc70e8..d7dd6d52a 100644 --- a/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj +++ b/test/Dapr.AspNetCore.IntegrationTest/Dapr.AspNetCore.IntegrationTest.csproj @@ -7,14 +7,36 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + - + + + + + + + + + + + + From 9b33d36a7db0881dc5e3afa7d0538ef3f2127e36 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 29 Nov 2024 19:09:20 -0600 Subject: [PATCH 29/37] Removed extra line from build definition Signed-off-by: Whit Waldo --- .github/workflows/itests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/itests.yml b/.github/workflows/itests.yml index e99bcc60c..4dcdfb951 100644 --- a/.github/workflows/itests.yml +++ b/.github/workflows/itests.yml @@ -124,7 +124,6 @@ jobs: with: dotnet-version: '9.0.x' dotnet-quality: 'ga' - - name: Build - 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 aecf3d4759b85fe8c2366b0dc8d07fc7e264a6e9 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 29 Nov 2024 19:31:00 -0600 Subject: [PATCH 30/37] Updated documentation to reflect .NET 9 and a note highlighting that .NET 6 and .NET 7 will be deprecated in v1.16 Signed-off-by: Whit Waldo --- daprdocs/content/en/dotnet-sdk-docs/_index.md | 10 ++++- .../dotnet-actors/dotnet-actors-howto.md | 10 ++++- .../dotnet-jobs/dotnet-jobs-howto.md | 11 +++++- .../dotnet-workflow/dotnet-workflow-howto.md | 10 ++++- src/Dapr.Common/DaprConnectionOptions.cs | 39 +++++++++++++++++++ 5 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 src/Dapr.Common/DaprConnectionOptions.cs diff --git a/daprdocs/content/en/dotnet-sdk-docs/_index.md b/daprdocs/content/en/dotnet-sdk-docs/_index.md index 60a4a1a61..75b16e40e 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/_index.md +++ b/daprdocs/content/en/dotnet-sdk-docs/_index.md @@ -18,7 +18,15 @@ Dapr offers a variety of packages to help with the development of .NET applicati - [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed - Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}) -- [.NET 6](https://dotnet.microsoft.com/download) or [.NET 8+](https://dotnet.microsoft.com/download) installed +- [.NET 6](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed + +{{% alert title="Note" color="primary" %}} + +Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +continue to be supported by Dapr in v1.16 and later. + +{{% /alert %}} ## Installation diff --git a/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md b/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md index eaa13625d..62e166da6 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md +++ b/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md @@ -45,7 +45,15 @@ This project contains the implementation of the actor client which calls MyActor - [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed. - Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}). -- [.NET 6+](https://dotnet.microsoft.com/download) installed. Dapr .NET SDK uses [ASP.NET Core](https://docs.microsoft.com/aspnet/core/introduction-to-aspnet-core?view=aspnetcore-6.0). +- [.NET 6](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed + +{{% alert title="Note" color="primary" %}} + +Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +continue to be supported by Dapr in v1.16 and later. + +{{% /alert %}} ## Step 0: Prepare diff --git a/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md b/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md index c8bc66175..5125b2cd7 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md +++ b/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md @@ -16,10 +16,17 @@ In the .NET example project: - The main [`Program.cs`](https://github.com/dapr/dotnet-sdk/tree/master/examples/Jobs/JobsSample/Program.cs) file comprises the entirety of this demonstration. ## Prerequisites -- [.NET 6+](https://dotnet.microsoft.com/download) installed - [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) - [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost) -- [Dapr Jobs .NET SDK](https://github.com/dapr/dotnet-sdk) +- [.NET 6](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed + +{{% alert title="Note" color="primary" %}} + +Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +continue to be supported by Dapr in v1.16 and later. + +{{% /alert %}} ## Set up the environment Clone the [.NET SDK repo](https://github.com/dapr/dotnet-sdk). diff --git a/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md b/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md index f6d18bc58..9aa0c9f7a 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md +++ b/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md @@ -18,11 +18,17 @@ In the .NET example project: ## Prerequisites -- [.NET 6+](https://dotnet.microsoft.com/download) installed - [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) - [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/) -- [Dapr .NET SDK](https://github.com/dapr/dotnet-sdk/) +- [.NET 7](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed +{{% alert title="Note" color="primary" %}} + +Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +continue to be supported by Dapr in v1.16 and later. + +{{% /alert %}} ## Set up the environment diff --git a/src/Dapr.Common/DaprConnectionOptions.cs b/src/Dapr.Common/DaprConnectionOptions.cs new file mode 100644 index 000000000..effe85a05 --- /dev/null +++ b/src/Dapr.Common/DaprConnectionOptions.cs @@ -0,0 +1,39 @@ +namespace Dapr.Common; + +/// +/// Provides the options used to configure a Dapr client. +/// +public class DaprClientOptions +{ + /// + /// Provides the endpoint and port to use as the gRPC endpoint. + /// + public string? GrpcEndpoint { get; init; } + + /// + /// Only used fi the isn't specified, this provides the port to use + /// with a localhost gRPC endpoint address. + /// + public int? GrpcPort { get; init; } + + /// + /// Provides the endpoint and port to use as the HTTP endpoint. + /// + public string? HttpEndpoint { get; init; } + + /// + /// Only used if the isn't specified, this provides the port to use with a + /// localhost HTTP endpoint address. + /// + public int? HttpPort { get; init; } + + /// + /// The timeout used for all requests to the Dapr runtime. + /// + public TimeSpan? Timeout { get; init; } + + /// + /// The Dapr API token to include on every request to the Dapr runtime. + /// + public string? DaprApiToken { get; init; } +} From 25a22e75efab37b23f809f3c82292ee6314d5211 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 29 Nov 2024 19:32:58 -0600 Subject: [PATCH 31/37] Removed unintentionally added file to commit Signed-off-by: Whit Waldo --- src/Dapr.Common/DaprConnectionOptions.cs | 39 ------------------------ 1 file changed, 39 deletions(-) delete mode 100644 src/Dapr.Common/DaprConnectionOptions.cs diff --git a/src/Dapr.Common/DaprConnectionOptions.cs b/src/Dapr.Common/DaprConnectionOptions.cs deleted file mode 100644 index effe85a05..000000000 --- a/src/Dapr.Common/DaprConnectionOptions.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace Dapr.Common; - -/// -/// Provides the options used to configure a Dapr client. -/// -public class DaprClientOptions -{ - /// - /// Provides the endpoint and port to use as the gRPC endpoint. - /// - public string? GrpcEndpoint { get; init; } - - /// - /// Only used fi the isn't specified, this provides the port to use - /// with a localhost gRPC endpoint address. - /// - public int? GrpcPort { get; init; } - - /// - /// Provides the endpoint and port to use as the HTTP endpoint. - /// - public string? HttpEndpoint { get; init; } - - /// - /// Only used if the isn't specified, this provides the port to use with a - /// localhost HTTP endpoint address. - /// - public int? HttpPort { get; init; } - - /// - /// The timeout used for all requests to the Dapr runtime. - /// - public TimeSpan? Timeout { get; init; } - - /// - /// The Dapr API token to include on every request to the Dapr runtime. - /// - public string? DaprApiToken { get; init; } -} From 38820c4df2200e13f622f6cabf0f89a007f31e40 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Fri, 29 Nov 2024 19:46:08 -0600 Subject: [PATCH 32/37] Added .NET 9 to E2E test setup Signed-off-by: Whit Waldo --- test/Dapr.E2E.Test/DaprTestApp.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Dapr.E2E.Test/DaprTestApp.cs b/test/Dapr.E2E.Test/DaprTestApp.cs index 152aeee98..2330785d8 100644 --- a/test/Dapr.E2E.Test/DaprTestApp.cs +++ b/test/Dapr.E2E.Test/DaprTestApp.cs @@ -139,6 +139,7 @@ private static string GetTargetFrameworkName() ".NETCoreApp,Version=v6.0" => "net6", ".NETCoreApp,Version=v7.0" => "net7", ".NETCoreApp,Version=v8.0" => "net8", + ".NETCoreApp,Version=v9.0" => "net9", _ => throw new InvalidOperationException($"Unsupported target framework: {targetFrameworkName}") }; } From 31bdbef83216f54b0c217c14b252978cce6429e1 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 3 Dec 2024 03:49:29 -0600 Subject: [PATCH 33/37] Fixed typo Signed-off-by: Whit Waldo --- daprdocs/content/en/dotnet-sdk-docs/_index.md | 2 +- .../en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md | 2 +- .../content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md | 2 +- .../en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/dotnet-sdk-docs/_index.md b/daprdocs/content/en/dotnet-sdk-docs/_index.md index 75b16e40e..82d16016d 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/_index.md +++ b/daprdocs/content/en/dotnet-sdk-docs/_index.md @@ -23,7 +23,7 @@ Dapr offers a variety of packages to help with the development of .NET applicati {{% alert title="Note" color="primary" %}} Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages -and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will continue to be supported by Dapr in v1.16 and later. {{% /alert %}} diff --git a/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md b/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md index 62e166da6..aba62bf07 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md +++ b/daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md @@ -50,7 +50,7 @@ This project contains the implementation of the actor client which calls MyActor {{% alert title="Note" color="primary" %}} Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages -and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will continue to be supported by Dapr in v1.16 and later. {{% /alert %}} diff --git a/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md b/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md index 5125b2cd7..8d98d1ca5 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md +++ b/daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md @@ -23,7 +23,7 @@ In the .NET example project: {{% alert title="Note" color="primary" %}} Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages -and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will continue to be supported by Dapr in v1.16 and later. {{% /alert %}} diff --git a/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md b/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md index 9aa0c9f7a..8a6e6665e 100644 --- a/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md +++ b/daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md @@ -25,7 +25,7 @@ In the .NET example project: {{% alert title="Note" color="primary" %}} Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages -and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 wil +and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will continue to be supported by Dapr in v1.16 and later. {{% /alert %}} From 8860de67e33957e86ebdfc26369ea90726ebea06 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 3 Dec 2024 03:49:55 -0600 Subject: [PATCH 34/37] Removed RC version from .NET 9 build Signed-off-by: Whit Waldo --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 3e41d7e1b..139cca3e3 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "_comment": "This policy allows the 8.0.100 SDK or patches in that family.", "sdk": { - "version": "9.0.100-rc.2", + "version": "9.0.100", "rollForward": "latestFeature" } } \ No newline at end of file From cba669e9aa08d22d8d4591ee085767ac67bd2eb9 Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 3 Dec 2024 03:50:23 -0600 Subject: [PATCH 35/37] Apparently the solution file got a minor change Signed-off-by: Whit Waldo --- all.sln | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/all.sln b/all.sln index bb44a3bdc..523adbd74 100644 --- a/all.sln +++ b/all.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# 17 +# Visual Studio Version 17 VisualStudioVersion = 17.3.32929.385 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapr.Actors", "src\Dapr.Actors\Dapr.Actors.csproj", "{C2DB4B64-B7C3-4FED-8753-C040F677C69A}" @@ -147,6 +147,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JobsSample", "examples\Jobs EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapr.Workflow.Test", "test\Dapr.Workflow.Test\Dapr.Workflow.Test.csproj", "{E90114C6-86FC-43B8-AE5C-D9273CF21FE4}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneratedActorClient", "examples\Actor\GeneratedActorClient\GeneratedActorClient.csproj", "{E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -366,7 +368,7 @@ Global {290D1278-F613-4DF3-9DF5-F37E38CDC363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {290D1278-F613-4DF3-9DF5-F37E38CDC363}.Debug|Any CPU.Build.0 = Debug|Any CPU {290D1278-F613-4DF3-9DF5-F37E38CDC363}.Release|Any CPU.ActiveCfg = Release|Any CPU - {290D1278-F613-4DF3-9DF5-F37E38CDC363}.Release|Any CPU.Build.0 = Release|Any CP + {290D1278-F613-4DF3-9DF5-F37E38CDC363}.Release|Any CPU.Build.0 = Release|Any CPU {C8BB6A85-A7EA-40C0-893D-F36F317829B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C8BB6A85-A7EA-40C0-893D-F36F317829B3}.Debug|Any CPU.Build.0 = Debug|Any CPU {C8BB6A85-A7EA-40C0-893D-F36F317829B3}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -383,6 +385,10 @@ Global {E90114C6-86FC-43B8-AE5C-D9273CF21FE4}.Debug|Any CPU.Build.0 = Debug|Any CPU {E90114C6-86FC-43B8-AE5C-D9273CF21FE4}.Release|Any CPU.ActiveCfg = Release|Any CPU {E90114C6-86FC-43B8-AE5C-D9273CF21FE4}.Release|Any CPU.Build.0 = Release|Any CPU + {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -453,6 +459,7 @@ Global {D9697361-232F-465D-A136-4561E0E88488} = {D687DDC4-66C5-4667-9E3A-FD8B78ECAA78} {9CAF360E-5AD3-4C4F-89A0-327EEB70D673} = {D9697361-232F-465D-A136-4561E0E88488} {E90114C6-86FC-43B8-AE5C-D9273CF21FE4} = {DD020B34-460F-455F-8D17-CF4A949F100B} + {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8} = {02374BD0-BF0B-40F8-A04A-C4C4D61D4992} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {65220BF2-EAE1-4CB2-AA58-EBE80768CB40} From fe7daf8e34b3c7479c7f0d614609791402a8294b Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 3 Dec 2024 03:55:58 -0600 Subject: [PATCH 36/37] Removed unnecessary null checks Signed-off-by: Whit Waldo --- src/Dapr.Jobs/Models/DaprJobSchedule.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Dapr.Jobs/Models/DaprJobSchedule.cs b/src/Dapr.Jobs/Models/DaprJobSchedule.cs index 8b1666727..e00c77f49 100644 --- a/src/Dapr.Jobs/Models/DaprJobSchedule.cs +++ b/src/Dapr.Jobs/Models/DaprJobSchedule.cs @@ -67,9 +67,6 @@ public static DaprJobSchedule FromCronExpression(CronExpressionBuilder builder) /// public static DaprJobSchedule FromDateTime(DateTimeOffset scheduledTime) { -#if NET6_0 - ArgumentNullException.ThrowIfNull(scheduledTime, nameof(scheduledTime)); -#endif return new DaprJobSchedule(scheduledTime.ToString("O")); } @@ -91,9 +88,6 @@ public static DaprJobSchedule FromExpression(string expression) /// The duration interval. public static DaprJobSchedule FromDuration(TimeSpan duration) { -#if NET6_0 - ArgumentNullException.ThrowIfNull(duration, nameof(duration)); -#endif return new DaprJobSchedule(duration.ToDurationString()); } From 33f972a21d8945317b91b03b48616a098ab73f5d Mon Sep 17 00:00:00 2001 From: Whit Waldo Date: Tue, 3 Dec 2024 04:07:11 -0600 Subject: [PATCH 37/37] Whoops - didn't mean to commit that project to the solution Signed-off-by: Whit Waldo --- all.sln | 7 ------- 1 file changed, 7 deletions(-) diff --git a/all.sln b/all.sln index 523adbd74..1dab60475 100644 --- a/all.sln +++ b/all.sln @@ -147,8 +147,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JobsSample", "examples\Jobs EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapr.Workflow.Test", "test\Dapr.Workflow.Test\Dapr.Workflow.Test.csproj", "{E90114C6-86FC-43B8-AE5C-D9273CF21FE4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GeneratedActorClient", "examples\Actor\GeneratedActorClient\GeneratedActorClient.csproj", "{E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -385,10 +383,6 @@ Global {E90114C6-86FC-43B8-AE5C-D9273CF21FE4}.Debug|Any CPU.Build.0 = Debug|Any CPU {E90114C6-86FC-43B8-AE5C-D9273CF21FE4}.Release|Any CPU.ActiveCfg = Release|Any CPU {E90114C6-86FC-43B8-AE5C-D9273CF21FE4}.Release|Any CPU.Build.0 = Release|Any CPU - {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -459,7 +453,6 @@ Global {D9697361-232F-465D-A136-4561E0E88488} = {D687DDC4-66C5-4667-9E3A-FD8B78ECAA78} {9CAF360E-5AD3-4C4F-89A0-327EEB70D673} = {D9697361-232F-465D-A136-4561E0E88488} {E90114C6-86FC-43B8-AE5C-D9273CF21FE4} = {DD020B34-460F-455F-8D17-CF4A949F100B} - {E0B3D569-4DBC-4682-8C24-E3BC9AA9B4B8} = {02374BD0-BF0B-40F8-A04A-C4C4D61D4992} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {65220BF2-EAE1-4CB2-AA58-EBE80768CB40}