Skip to content

Commit 4a11709

Browse files
committed
Try pre-release versions of .NET/EF 9
1 parent acde3e8 commit 4a11709

File tree

27 files changed

+100
-32
lines changed

27 files changed

+100
-32
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2024.2.6",
6+
"version": "2024.3.0-eap04",
77
"commands": [
88
"jb"
99
],

.github/workflows/build.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ jobs:
4848
dotnet-version: |
4949
6.0.x
5050
8.0.x
51+
- name: Setup .NET 9 (unstable)
52+
uses: actions/setup-dotnet@v4
53+
with:
54+
dotnet-version: |
55+
9.0.x
56+
dotnet-quality: 'preview'
5157
- name: Show installed versions
5258
shell: pwsh
5359
run: |
@@ -105,7 +111,7 @@ jobs:
105111
Logging__LogLevel__Microsoft.EntityFrameworkCore.Database.Command: 'None'
106112
Logging__LogLevel__JsonApiDotNetCore: 'None'
107113
run: |
108-
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true"
114+
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --logger "GitHubActions;summary.includeSkippedTests=true" -- xUnit.ParallelAlgorithm=conservative
109115
- name: Upload coverage to codecov.io
110116
if: matrix.os == 'ubuntu-latest'
111117
env:
@@ -166,6 +172,12 @@ jobs:
166172
dotnet-version: |
167173
6.0.x
168174
8.0.x
175+
- name: Setup .NET 9 (unstable)
176+
uses: actions/setup-dotnet@v4
177+
with:
178+
dotnet-version: |
179+
9.0.x
180+
dotnet-quality: 'preview'
169181
- name: Git checkout
170182
uses: actions/checkout@v4
171183
- name: Restore tools
@@ -221,6 +233,12 @@ jobs:
221233
dotnet-version: |
222234
6.0.x
223235
8.0.x
236+
- name: Setup .NET 9 (unstable)
237+
uses: actions/setup-dotnet@v4
238+
with:
239+
dotnet-version: |
240+
9.0.x
241+
dotnet-quality: 'preview'
224242
- name: Git checkout
225243
uses: actions/checkout@v4
226244
with:

.github/workflows/codeql.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ jobs:
2929
dotnet-version: |
3030
6.0.x
3131
8.0.x
32+
- name: Setup .NET 9 (unstable)
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: |
36+
9.0.x
37+
dotnet-quality: 'preview'
3238
- name: Git checkout
3339
uses: actions/checkout@v4
3440
- name: Initialize CodeQL

Directory.Build.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<Nullable>enable</Nullable>
4-
<LangVersion>latest</LangVersion>
4+
<LangVersion>preview</LangVersion>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<IsPackable>false</IsPackable>
77
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
@@ -38,6 +38,12 @@
3838
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
3939
</PropertyGroup>
4040

41+
<PropertyGroup>
42+
<NoWarn>$(NoWarn);NU5104;NU1608</NoWarn>
43+
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
44+
<NuGetAuditMode>direct</NuGetAuditMode>
45+
</PropertyGroup>
46+
4147
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('Tests'))">
4248
<NoWarn>$(NoWarn);CA1707;CA1062</NoWarn>
4349
</PropertyGroup>

NuGet.config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
5+
<add key="npgsql" value="https://www.myget.org/F/npgsql/api/v3/index.json" />
6+
<add key="npgsql-next" value="https://www.myget.org/F/npgsql-vnext/api/v3/index.json" />
7+
<add key="pomelo-nightly"
8+
value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json" />
9+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
10+
</packageSources>
11+
</configuration>

benchmarks/Benchmarks.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
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<ServerGarbageCollection>true</ServerGarbageCollection>
66
</PropertyGroup>
77

package-versions.props

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,27 @@
2020
<XunitVisualStudioVersion>2.8.*</XunitVisualStudioVersion>
2121
</PropertyGroup>
2222

23+
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0'">
24+
<!-- Published dependencies (only update on major version change) -->
25+
<EntityFrameworkCoreFrozenVersion>9.0.0-rtm.24508.5</EntityFrameworkCoreFrozenVersion>
26+
27+
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
28+
<AspNetCoreVersion>9.0.*-*</AspNetCoreVersion>
29+
<EntityFrameworkCoreVersion>$(EntityFrameworkCoreFrozenVersion)</EntityFrameworkCoreVersion>
30+
<EntityFrameworkCorePostgreSQLVersion>9.0.0-rc.2-ci.20240930T080442</EntityFrameworkCorePostgreSQLVersion>
31+
<EntityFrameworkCorePomeloVersion>9.0.0-*</EntityFrameworkCorePomeloVersion>
32+
<SystemTextJsonVersion>$(AspNetCoreVersion)</SystemTextJsonVersion>
33+
</PropertyGroup>
34+
2335
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
2436
<!-- Published dependencies (only update on major version change) -->
2537
<EntityFrameworkCoreFrozenVersion>8.0.0</EntityFrameworkCoreFrozenVersion>
2638

2739
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
2840
<AspNetCoreVersion>8.0.*</AspNetCoreVersion>
2941
<EntityFrameworkCoreVersion>8.0.*</EntityFrameworkCoreVersion>
42+
<EntityFrameworkCorePostgreSQLVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePostgreSQLVersion>
43+
<EntityFrameworkCorePomeloVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePomeloVersion>
3044
<SystemTextJsonVersion>$(AspNetCoreVersion)</SystemTextJsonVersion>
3145
</PropertyGroup>
3246

@@ -38,6 +52,8 @@
3852
<AspNetCoreVersion>6.0.*</AspNetCoreVersion>
3953
<DateOnlyTimeOnlyVersion>2.1.*</DateOnlyTimeOnlyVersion>
4054
<EntityFrameworkCoreVersion>7.0.*</EntityFrameworkCoreVersion>
55+
<EntityFrameworkCorePostgreSQLVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePostgreSQLVersion>
56+
<EntityFrameworkCorePomeloVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCorePomeloVersion>
4157
<SystemTextJsonVersion>8.0.*</SystemTextJsonVersion>
4258
</PropertyGroup>
4359
</Project>

src/Examples/DapperExample/DapperExample.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
44
</PropertyGroup>
55

66
<Import Project="..\..\..\package-versions.props" />
@@ -14,8 +14,9 @@
1414
<ItemGroup>
1515
<PackageReference Include="Dapper" Version="$(DapperVersion)" />
1616
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="$(EntityFrameworkCoreVersion)" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
1718
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="$(EntityFrameworkCoreVersion)" />
18-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCoreVersion)" />
19-
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="$(EntityFrameworkCoreVersion)" />
19+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCorePostgreSQLVersion)" />
20+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="$(EntityFrameworkCorePomeloVersion)" />
2021
</ItemGroup>
2122
</Project>

src/Examples/DapperExample/Program.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@
3131
}
3232
case DatabaseProvider.MySql:
3333
{
34-
builder.Services.AddMySql<AppDbContext>(connectionString, ServerVersion.AutoDetect(connectionString),
35-
optionsAction: options => SetDbContextDebugOptions(options));
34+
#if NET9_0_OR_GREATER
35+
ServerVersion serverVersion = await ServerVersion.AutoDetectAsync(connectionString);
36+
#else
37+
ServerVersion serverVersion = ServerVersion.AutoDetect(connectionString);
38+
#endif
39+
40+
builder.Services.AddMySql<AppDbContext>(connectionString, serverVersion, optionsAction: options => SetDbContextDebugOptions(options));
3641

3742
break;
3843
}

src/Examples/DatabasePerTenantExample/DatabasePerTenantExample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net9.0;net8.0;net6.0</TargetFrameworks>
44
</PropertyGroup>
55

66
<Import Project="..\..\..\package-versions.props" />
@@ -13,6 +13,6 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="$(EntityFrameworkCoreVersion)" />
16-
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCoreVersion)" />
16+
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(EntityFrameworkCorePostgreSQLVersion)" />
1717
</ItemGroup>
1818
</Project>

0 commit comments

Comments
 (0)