Skip to content

Commit 47458cd

Browse files
WhitWaldodivzi-p
authored andcommitted
Support .NET 9 (dapr#1404)
* Updated build and integration test scripts to include .NET 9 Signed-off-by: Whit Waldo <[email protected]> * Removed unused matrix values Signed-off-by: Whit Waldo <[email protected]> * Reverted some .NET 8 requirement Signed-off-by: Whit Waldo <[email protected]> * 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 <[email protected]> * Removed unnecessary secondary build step Signed-off-by: Whit Waldo <[email protected]> * Updating TFM moniker Signed-off-by: Whit Waldo <[email protected]> * Added test to install VStest Signed-off-by: Whit Waldo <[email protected]> * Rolling back use of tool as it doesn't independently exist outside of the SDK Signed-off-by: Whit Waldo <[email protected]> * Added .NET 9 to build targets Signed-off-by: Whit Waldo <[email protected]> * Added .NET 9 to target frameworks across solution Signed-off-by: Whit Waldo <[email protected]> * I understand the reason for the required install step now - adding it back with a .NET 9 install step Signed-off-by: Whit Waldo <[email protected]> * Placing install steps before build Signed-off-by: Whit Waldo <[email protected]> * Updating global.json Signed-off-by: Whit Waldo <[email protected]> * Disabled analyzer errors in unit tests Signed-off-by: Whit Waldo <[email protected]> * Added .NET 9 to test Signed-off-by: Whit Waldo <[email protected]> * Changed from #pragma error to #pragma warning Signed-off-by: Whit Waldo <[email protected]> * Fixed unit tests to resolve analyzer warning Signed-off-by: Whit Waldo <[email protected]> * Updated integration test to always include .NET 8 and .NET 9 installs Signed-off-by: Whit Waldo <[email protected]> * Falling back to add separate .NET 9 support Signed-off-by: Whit Waldo <[email protected]> * Updated referenced projects to target appropriate frameworks Signed-off-by: Whit Waldo <[email protected]> * Added all target frameworks back to Dapr.Commono Signed-off-by: Whit Waldo <[email protected]> * Added warnings to fix nullability analyzer warnings when targeting .NET 6 Signed-off-by: Whit Waldo <[email protected]> * Updated build step to use .NET 9 instead Signed-off-by: Whit Waldo <[email protected]> * 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 <[email protected]> * Including target for .NET 6, 7, 8 and 9 Signed-off-by: Whit Waldo <[email protected]> * Trialing fix to E2E integration test - excluding use of AppWebApplicationFactory in favor of direct use of HttpClient Signed-off-by: Whit Waldo <[email protected]> * Reverting as it breaks the other .NET versions Signed-off-by: Whit Waldo <[email protected]> * Potentially fixed unit tests in .NET 9 Signed-off-by: Whit Waldo <[email protected]> * Removed extra line from build definition Signed-off-by: Whit Waldo <[email protected]> * 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 <[email protected]> * Removed unintentionally added file to commit Signed-off-by: Whit Waldo <[email protected]> * Added .NET 9 to E2E test setup Signed-off-by: Whit Waldo <[email protected]> * Fixed typo Signed-off-by: Whit Waldo <[email protected]> * Removed RC version from .NET 9 build Signed-off-by: Whit Waldo <[email protected]> * Apparently the solution file got a minor change Signed-off-by: Whit Waldo <[email protected]> * Removed unnecessary null checks Signed-off-by: Whit Waldo <[email protected]> * Whoops - didn't mean to commit that project to the solution Signed-off-by: Whit Waldo <[email protected]> --------- Signed-off-by: Whit Waldo <[email protected]> Signed-off-by: Divya Perumal <[email protected]>
1 parent 7965359 commit 47458cd

File tree

21 files changed

+255
-97
lines changed

21 files changed

+255
-97
lines changed

.github/workflows/itests.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
dotnet-version: ['6.0', '7.0', '8.0']
23+
dotnet-version: ['6.0', '7.0', '8.0', '9.0']
2424
include:
2525
- dotnet-version: '6.0'
2626
display-name: '.NET 6.0'
@@ -37,6 +37,11 @@ jobs:
3737
framework: 'net8'
3838
prefix: 'net8'
3939
install-version: '8.0.x'
40+
- dotnet-version: '9.0'
41+
display-name: '.NET 9.0'
42+
framework: 'net9'
43+
prefix: 'net9'
44+
install-version: '9.0.x'
4045
env:
4146
NUPKG_OUTDIR: bin/Release/nugets
4247
GOVER: 1.20.3
@@ -103,14 +108,22 @@ jobs:
103108
- name: Parse release version
104109
run: python ./.github/scripts/get_release_version.py
105110
- name: Setup ${{ matrix.display-name }}
106-
uses: actions/setup-dotnet@v1
111+
uses: actions/setup-dotnet@v3
107112
with:
108113
dotnet-version: ${{ matrix.install-version }}
109-
- name: Setup .NET 8.0 # net8 is always required.
110-
uses: actions/setup-dotnet@v1
114+
dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available
115+
- name: Setup .NET 8 (required)
116+
uses: actions/setup-dotnet@v3
111117
if: ${{ matrix.install-version != '8.0.x' }}
112118
with:
113-
dotnet-version: 8.0.x
119+
dotnet-version: '8.0.x'
120+
dotnet-quality: 'ga'
121+
- name: Setup .NET 9 (required)
122+
uses: actions/setup-dotnet@v3
123+
if: ${{ matrix.install-version != '9.0.x' }}
124+
with:
125+
dotnet-version: '9.0.x'
126+
dotnet-quality: 'ga'
114127
- name: Build
115128
# disable deterministic builds, just for test run. Deterministic builds break coverage for some reason
116129
run: dotnet build --configuration release /p:GITHUB_ACTIONS=false

.github/workflows/sdk_build.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ jobs:
2424
- name: Parse release version
2525
run: python ./.github/scripts/get_release_version.py
2626
- name: Setup .NET Core
27-
uses: actions/setup-dotnet@v1
27+
uses: actions/setup-dotnet@v3
2828
with:
29-
dotnet-version: 8.0.x
29+
dotnet-version: 9.0.x
30+
dotnet-quality: 'ga'
3031
- name: Build
3132
run: dotnet build --configuration release
3233
- name: Generate Packages
@@ -43,39 +44,49 @@ jobs:
4344
strategy:
4445
fail-fast: false
4546
matrix:
46-
dotnet-version: ['6.0', '7.0', '8.0']
47+
dotnet-version: ['6.0', '7.0', '8.0', '9.0']
4748
include:
4849
- dotnet-version: '6.0'
49-
install-3: false
5050
display-name: '.NET 6.0'
5151
framework: 'net6'
5252
prefix: 'net6'
5353
install-version: '6.0.x'
5454
- dotnet-version: '7.0'
55-
install-3: false
5655
display-name: '.NET 7.0'
5756
framework: 'net7'
5857
prefix: 'net7'
5958
install-version: '7.0.x'
6059
- dotnet-version: '8.0'
61-
install-3: false
6260
display-name: '.NET 8.0'
6361
framework: 'net8'
6462
prefix: 'net8'
6563
install-version: '8.0.x'
64+
- dotnet-version: '9.0'
65+
display-name: '.NET 9.0'
66+
framework: 'net9'
67+
prefix: 'net9'
68+
install-version: '9.0.x'
6669
steps:
6770
- uses: actions/checkout@v1
6871
- name: Parse release version
6972
run: python ./.github/scripts/get_release_version.py
7073
- name: Setup ${{ matrix.display-name }}
71-
uses: actions/setup-dotnet@v1
74+
uses: actions/setup-dotnet@v3
7275
with:
7376
dotnet-version: ${{ matrix.install-version }}
74-
- name: Setup .NET 8.0 # net8 is always required.
75-
uses: actions/setup-dotnet@v1
77+
dotnet-quality: 'ga' # Prefer a GA release, but use the RC if not available
78+
- name: Setup .NET 8 (required)
79+
uses: actions/setup-dotnet@v3
7680
if: ${{ matrix.install-version != '8.0.x' }}
7781
with:
78-
dotnet-version: 8.0.x
82+
dotnet-version: '8.0.x'
83+
dotnet-quality: 'ga'
84+
- name: Setup .NET 9 (required)
85+
uses: actions/setup-dotnet@v3
86+
if: ${{ matrix.install-version != '9.0.x' }}
87+
with:
88+
dotnet-version: '9.0.x'
89+
dotnet-quality: 'ga'
7990
- name: Build
8091
# disable deterministic builds, just for test run. Deterministic builds break coverage for some reason
8192
run: dotnet build --configuration release /p:GITHUB_ACTIONS=false

all.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# 17
2+
# Visual Studio Version 17
33
VisualStudioVersion = 17.3.32929.385
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapr.Actors", "src\Dapr.Actors\Dapr.Actors.csproj", "{C2DB4B64-B7C3-4FED-8753-C040F677C69A}"
@@ -366,7 +366,7 @@ Global
366366
{290D1278-F613-4DF3-9DF5-F37E38CDC363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
367367
{290D1278-F613-4DF3-9DF5-F37E38CDC363}.Debug|Any CPU.Build.0 = Debug|Any CPU
368368
{290D1278-F613-4DF3-9DF5-F37E38CDC363}.Release|Any CPU.ActiveCfg = Release|Any CPU
369-
{290D1278-F613-4DF3-9DF5-F37E38CDC363}.Release|Any CPU.Build.0 = Release|Any CP
369+
{290D1278-F613-4DF3-9DF5-F37E38CDC363}.Release|Any CPU.Build.0 = Release|Any CPU
370370
{C8BB6A85-A7EA-40C0-893D-F36F317829B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
371371
{C8BB6A85-A7EA-40C0-893D-F36F317829B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
372372
{C8BB6A85-A7EA-40C0-893D-F36F317829B3}.Release|Any CPU.ActiveCfg = Release|Any CPU

daprdocs/content/en/dotnet-sdk-docs/_index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ Dapr offers a variety of packages to help with the development of .NET applicati
1818

1919
- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed
2020
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}})
21-
- [.NET 6](https://dotnet.microsoft.com/download) or [.NET 8+](https://dotnet.microsoft.com/download) installed
21+
- [.NET 6](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed
22+
23+
{{% alert title="Note" color="primary" %}}
24+
25+
Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages
26+
and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will
27+
continue to be supported by Dapr in v1.16 and later.
28+
29+
{{% /alert %}}
2230

2331
## Installation
2432

daprdocs/content/en/dotnet-sdk-docs/dotnet-actors/dotnet-actors-howto.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ This project contains the implementation of the actor client which calls MyActor
4545

4646
- [Dapr CLI]({{< ref install-dapr-cli.md >}}) installed.
4747
- Initialized [Dapr environment]({{< ref install-dapr-selfhost.md >}}).
48-
- [.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).
48+
- [.NET 6](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed
49+
50+
{{% alert title="Note" color="primary" %}}
51+
52+
Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages
53+
and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will
54+
continue to be supported by Dapr in v1.16 and later.
55+
56+
{{% /alert %}}
4957

5058
## Step 0: Prepare
5159

daprdocs/content/en/dotnet-sdk-docs/dotnet-jobs/dotnet-jobs-howto.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@ In the .NET example project:
1616
- The main [`Program.cs`](https://github.com/dapr/dotnet-sdk/tree/master/examples/Jobs/JobsSample/Program.cs) file comprises the entirety of this demonstration.
1717

1818
## Prerequisites
19-
- [.NET 6+](https://dotnet.microsoft.com/download) installed
2019
- [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
2120
- [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost)
22-
- [Dapr Jobs .NET SDK](https://github.com/dapr/dotnet-sdk)
21+
- [.NET 6](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed
22+
23+
{{% alert title="Note" color="primary" %}}
24+
25+
Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages
26+
and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will
27+
continue to be supported by Dapr in v1.16 and later.
28+
29+
{{% /alert %}}
2330

2431
## Set up the environment
2532
Clone the [.NET SDK repo](https://github.com/dapr/dotnet-sdk).

daprdocs/content/en/dotnet-sdk-docs/dotnet-workflow/dotnet-workflow-howto.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ In the .NET example project:
1818

1919
## Prerequisites
2020

21-
- [.NET 6+](https://dotnet.microsoft.com/download) installed
2221
- [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/)
2322
- [Initialized Dapr environment](https://docs.dapr.io/getting-started/install-dapr-selfhost/)
24-
- [Dapr .NET SDK](https://github.com/dapr/dotnet-sdk/)
23+
- [.NET 7](https://dotnet.microsoft.com/download), [.NET 8](https://dotnet.microsoft.com/download) or [.NET 9](https://dotnet.microsoft.com/download) installed
2524

25+
{{% alert title="Note" color="primary" %}}
26+
27+
Note that while .NET 6 is generally supported as the minimum .NET requirement across the Dapr .NET SDK packages
28+
and .NET 7 is the minimally supported version of .NET by Dapr.Workflows in Dapr v1.15, only .NET 8 and .NET 9 will
29+
continue to be supported by Dapr in v1.16 and later.
30+
31+
{{% /alert %}}
2632

2733
## Set up the environment
2834

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"_comment": "This policy allows the 8.0.100 SDK or patches in that family.",
33
"sdk": {
4-
"version": "8.0.100",
5-
"rollForward": "minor"
4+
"version": "9.0.100",
5+
"rollForward": "latestFeature"
66
}
77
}

src/Dapr.Common/Dapr.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6;net7;net8</TargetFrameworks> <!-- Supports .NET 7 for Dapr.Workflow -->
4+
<TargetFrameworks>net6;net7;net8;net9</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

src/Dapr.Jobs/Dapr.Jobs.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6;net8</TargetFrameworks>
54
<ImplicitUsings>enable</ImplicitUsings>
65
<Nullable>enable</Nullable>
76
<PackageId>Dapr.Jobs</PackageId>

0 commit comments

Comments
 (0)