Skip to content

Commit 9338b8d

Browse files
committed
Upgrade to .NET 10, C# 14 and ASP.NET Core 10
1 parent 381a3f3 commit 9338b8d

File tree

50 files changed

+4616
-4900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4616
-4900
lines changed

.github/workflows/package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
package:
1111
name: Build & package
12-
runs-on: ubuntu-22.04 # Important - later versions of ubuntu have a different .NET SDK which breaks trscli. Review on .NET 9 upgrade
12+
runs-on: ubuntu-22.04 # Important - later versions of ubuntu have a different .NET SDK which breaks trscli. Review on .NET 9 upgrade
1313
env:
1414
CONTAINER_REGISTRY: ghcr.io
1515

@@ -25,7 +25,7 @@ jobs:
2525

2626
- uses: actions/setup-dotnet@v5
2727
with:
28-
dotnet-version: 9.0.x
28+
global-json-file: TeachingRecordSystem/global.json
2929

3030
- name: Get Docker image tag
3131
id: image_tags

.github/workflows/pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929

3030
- uses: actions/setup-dotnet@v5
3131
with:
32-
dotnet-version: 9.0.x
32+
global-json-file: TeachingRecordSystem/global.json
3333

3434
- name: Install tools
3535
run: just install-tools
3636

3737
- name: Lint
38-
run: cd TeachingRecordSystem && dotnet dotnet-format --verify-no-changes
38+
run: cd TeachingRecordSystem && dotnet format --verify-no-changes
3939

4040
validate_terraform:
4141
name: Validate Terraform
@@ -85,7 +85,7 @@ jobs:
8585

8686
- uses: actions/setup-dotnet@v5
8787
with:
88-
dotnet-version: 9.0.x
88+
global-json-file: TeachingRecordSystem/global.json
8989

9090
- name: Install tools
9191
run: just install-tools
@@ -162,7 +162,7 @@ jobs:
162162

163163
- uses: actions/setup-dotnet@v5
164164
with:
165-
dotnet-version: 9.0.x
165+
global-json-file: TeachingRecordSystem/global.json
166166

167167
- name: Install tools
168168
run: just install-tools
@@ -196,7 +196,7 @@ jobs:
196196
- name: Install Playwright if required
197197
run: |
198198
if [[ "$PROJECT_NAME" =~ .*EndToEndTests ]]; then
199-
pwsh ./bin/Release/net9.0/playwright.ps1 install chromium
199+
pwsh ./bin/Release/net10.0/playwright.ps1 install chromium
200200
fi
201201
working-directory: TeachingRecordSystem/tests/TeachingRecordSystem.${{ matrix.project_short_name }}
202202
env:

TeachingRecordSystem/.config/dotnet-tools.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
"version": 1,
33
"isRoot": true,
44
"tools": {
5-
"dotnet-format": {
6-
"version": "9.0.520307",
7-
"commands": [
8-
"dotnet-format"
9-
],
10-
"rollForward": false
11-
},
125
"dotnet-ef": {
136
"version": "9.0.10",
147
"commands": [
@@ -31,4 +24,4 @@
3124
"rollForward": false
3225
}
3326
}
34-
}
27+
}

TeachingRecordSystem/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
4-
<LangVersion>13.0</LangVersion>
3+
<TargetFramework>net10.0</TargetFramework>
4+
<LangVersion>14.0</LangVersion>
55
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
66
<AnalysisMode>Recommended</AnalysisMode>
77
<Nullable>enable</Nullable>

TeachingRecordSystem/Directory.Packages.props

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@
3939
<PackageVersion Include="JustEat.HttpClientInterception" Version="5.1.2" />
4040
<PackageVersion Include="LinqKit" Version="1.2.5" />
4141
<PackageVersion Include="MediatR" Version="12.2.0" />
42-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.10" />
43-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.10" />
44-
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.10" />
45-
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.10" />
42+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
43+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0" />
44+
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.11" />
45+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.11" />
4646
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.2" />
47-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10" />
48-
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.10" />
49-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.10" />
47+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.11" />
48+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.11" />
49+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.11" />
5050
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.13.0" />
51-
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.10" />
52-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.10" />
53-
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.10" />
54-
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.10" />
55-
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.10" />
56-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
57-
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.10" />
58-
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.10" />
59-
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="9.0.10" />
51+
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="10.0.0" />
52+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.0" />
53+
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.0" />
54+
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
55+
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="10.0.0" />
56+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
57+
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.0" />
58+
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="10.0.0" />
59+
<PackageVersion Include="Microsoft.Extensions.Options.DataAnnotations" Version="10.0.0" />
6060
<PackageVersion Include="Microsoft.Identity.Web" Version="4.0.1" />
6161
<PackageVersion Include="Microsoft.Identity.Web.GraphServiceClientBeta" Version="4.0.1" />
6262
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.14.0" />
@@ -100,10 +100,8 @@
100100
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="6.6.2" />
101101
<PackageVersion Include="System.CommandLine" Version="2.0.0-rc.2.25502.107" />
102102
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
103-
<PackageVersion Include="System.Linq.Async" Version="6.0.3" />
104-
<PackageVersion Include="System.Net.Http.Json" Version="9.0.10" />
105103
<PackageVersion Include="System.Reactive" Version="6.1.0" />
106-
<PackageVersion Include="System.Text.Json" Version="9.0.10" />
104+
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
107105
<PackageVersion Include="xunit.analyzers" Version="1.23.0" />
108106
<PackageVersion Include="xunit.core" Version="2.9.3" />
109107
<PackageVersion Include="Xunit.DependencyInjection" Version="8.9.1" />
@@ -112,4 +110,4 @@
112110
<PackageVersion Include="xunit.v3.assert" Version="3.2.0" />
113111
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.0" />
114112
</ItemGroup>
115-
</Project>
113+
</Project>

TeachingRecordSystem/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# syntax=docker/dockerfile:1
2-
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine3.21
2+
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine3.22
33
ARG GIT_SHA
44
ENV SENTRY_RELEASE=${GIT_SHA}
55
ENV GIT_SHA=${GIT_SHA}
66
ENV ASPNETCORE_HTTP_PORTS=3000
7-
COPY src/TeachingRecordSystem.Api/bin/Release/net9.0/publish/ Apps/Api/
8-
COPY src/TeachingRecordSystem.Cli/bin/Release/net9.0/publish/ Apps/TrsCli/
9-
COPY src/TeachingRecordSystem.SupportUi/bin/Release/net9.0/publish/ Apps/SupportUi/
10-
COPY src/TeachingRecordSystem.Worker/bin/Release/net9.0/publish/ Apps/Worker/
11-
COPY src/TeachingRecordSystem.AuthorizeAccess/bin/Release/net9.0/publish/ Apps/AuthorizeAccess/
7+
COPY src/TeachingRecordSystem.Api/bin/Release/net10.0/publish/ Apps/Api/
8+
COPY src/TeachingRecordSystem.Cli/bin/Release/net10.0/publish/ Apps/TrsCli/
9+
COPY src/TeachingRecordSystem.SupportUi/bin/Release/net10.0/publish/ Apps/SupportUi/
10+
COPY src/TeachingRecordSystem.Worker/bin/Release/net10.0/publish/ Apps/Worker/
11+
COPY src/TeachingRecordSystem.AuthorizeAccess/bin/Release/net10.0/publish/ Apps/AuthorizeAccess/
1212
COPY db.sh Apps/db.sh
1313
WORKDIR /Apps
1414

TeachingRecordSystem/TeachingRecordSystem.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2222
..\Makefile = ..\Makefile
2323
nuget.config = nuget.config
2424
..\README.md = ..\README.md
25+
global.json = global.json
2526
EndProjectSection
2627
EndProject
2728
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeachingRecordSystem.TestCommon", "tests\TeachingRecordSystem.TestCommon\TeachingRecordSystem.TestCommon.csproj", "{DFE6654C-3222-4B20-A871-79581928D3B2}"

TeachingRecordSystem/global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100",
4+
"rollForward": "latestFeature"
5+
}
6+
}

TeachingRecordSystem/nuget.config

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
54
<add key="lib" value="lib" />
65
</packageSources>
76
<packageSourceMapping>
87
<packageSource key="nuget.org">
98
<package pattern="*" />
109
</packageSource>
11-
<packageSource key="dotnet9">
12-
<package pattern="dotnet-format" />
13-
</packageSource>
1410
<packageSource key="lib">
1511
<package pattern="Dfe.Analytics" />
1612
</packageSource>

TeachingRecordSystem/src/TeachingRecordSystem.Api/Infrastructure/ModelBinding/FlagsEnumStringListModelBinder.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public Task BindModelAsync(ModelBindingContext bindingContext)
2929
{
3030
if (!Enum.TryParse(modelType, v, ignoreCase: true, out var parsed))
3131
{
32-
logger.LogDebug("Failed to parse '{Value}' as {ModelType}.", v, modelType);
32+
#pragma warning disable CA1873
33+
logger.LogDebug("Failed to parse '{Value}' as {ModelType}.", v, modelType.Name);
34+
#pragma warning restore CA1873
3335

3436
bindingContext.Result = ModelBindingResult.Failed();
3537
return Task.CompletedTask;
@@ -44,7 +46,9 @@ public Task BindModelAsync(ModelBindingContext bindingContext)
4446
}
4547
else
4648
{
47-
logger.LogDebug("Value '{Result}' is not a single flag of {ModelType}.", parsed, modelType);
49+
#pragma warning disable CA1873
50+
logger.LogDebug("Value '{Result}' is not a single flag of {ModelType}.", parsed, modelType.Name);
51+
#pragma warning restore CA1873
4852

4953
bindingContext.Result = ModelBindingResult.Failed();
5054
return Task.CompletedTask;

0 commit comments

Comments
 (0)