Skip to content

Commit 8a4f6bf

Browse files
Copilotadamhathcock
andcommitted
Upgrade to .NET 10 - Update configuration and fix code issues
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
1 parent 86f7692 commit 8a4f6bf

File tree

20 files changed

+394
-714
lines changed

20 files changed

+394
-714
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
- uses: actions/checkout@v5
1212
- uses: actions/setup-dotnet@v5
1313
with:
14-
dotnet-version: 8.0.204
14+
dotnet-version: 10.0.100-rc.2.25502.107
1515
- run: dotnet run --project build/build.csproj

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<Nullable>enable</Nullable>
55
<AnalysisMode>Recommended</AnalysisMode>
66
<WarningsAsErrors>true</WarningsAsErrors>

Directory.Packages.props

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,30 @@
44
<PackageVersion Include="Bullseye" Version="6.0.0" />
55
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
66
<PackageVersion Include="Glob" Version="1.1.9" />
7-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.13" />
8-
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.13" />
9-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.13" />
10-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.13" />
7+
<PackageVersion
8+
Include="Microsoft.AspNetCore.Authentication.JwtBearer"
9+
Version="10.0.0-rc.2.25502.107"
10+
/>
11+
<PackageVersion
12+
Include="Microsoft.EntityFrameworkCore.InMemory"
13+
Version="10.0.0-rc.2.25502.107"
14+
/>
15+
<PackageVersion
16+
Include="Microsoft.EntityFrameworkCore.Sqlite"
17+
Version="10.0.0-rc.2.25502.107"
18+
/>
19+
<PackageVersion
20+
Include="Microsoft.EntityFrameworkCore.SqlServer"
21+
Version="10.0.0-rc.2.25502.107"
22+
/>
1123
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
1224
<PackageVersion Include="Serilog" Version="4.3.0" />
1325
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
1426
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
1527
<PackageVersion Include="FluentValidation" Version="12.0.0" />
1628
<PackageVersion Include="MediatR" Version="12.5.0" />
1729
<PackageVersion Include="SimpleExec" Version="12.0.0" />
18-
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.4" />
30+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="9.0.6" />
1931
<PackageVersion Include="xunit" Version="2.9.3" />
2032
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.1" />
2133
</ItemGroup>

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
22

33

4-
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
4+
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
55
WORKDIR /src
66
COPY . .
77
RUN dotnet run --project build/build.csproj -- publish
88

9-
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
9+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
1010

1111
WORKDIR /app
1212
COPY --from=build /src/publish .

build/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void RemoveDirectory(string d)
4343
}
4444
);
4545

46-
Target(Build, [Format], () => Run("dotnet", "build . -c Release"));
46+
Target(Build, [Format], () => Run("dotnet", "build Conduit.sln -c Release"));
4747

4848
Target(
4949
Test,
@@ -67,7 +67,7 @@ void RemoveDirectory(string d)
6767
{
6868
Run(
6969
"dotnet",
70-
$"publish {project} -c Release -f net8.0 -o ./publish --no-restore --no-build --verbosity=normal"
70+
$"publish {project} -c Release -f net10.0 -o ./publish --no-restore --no-build --verbosity=normal"
7171
);
7272
}
7373
);

build/packages.lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": 2,
33
"dependencies": {
4-
"net8.0": {
4+
"net10.0": {
55
"Bullseye": {
66
"type": "Direct",
77
"requested": "[6.0.0, )",

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.201",
3+
"version": "10.0.100-rc.2.25502.107",
44
"rollForward": "latestFeature"
55
}
66
}

src/Conduit/Domain/Article.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Article
3131

3232
[NotMapped]
3333
public List<string> TagList =>
34-
ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!).ToList();
34+
[.. ArticleTags.Where(x => x.TagId is not null).Select(x => x.TagId!)];
3535

3636
[JsonIgnore]
3737
public List<ArticleTag> ArticleTags { get; init; } = new();

src/Conduit/Features/Articles/Edit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ CancellationToken cancellationToken
6969

7070
// ensure context is tracking any tags that are about to be created so that it won't attempt to insert a duplicate
7171
context.Tags.AttachRange(
72-
articleTagsToCreate.Where(x => x.Tag is not null).Select(a => a.Tag!).ToArray()
72+
[.. articleTagsToCreate.Where(x => x.Tag is not null).Select(a => a.Tag!)]
7373
);
7474

7575
// add the new article tags

src/Conduit/Features/Profiles/IProfileReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ namespace Conduit.Features.Profiles;
55

66
public interface IProfileReader
77
{
8-
Task<ProfileEnvelope> ReadProfile(string username, CancellationToken cancellationToken);
8+
public Task<ProfileEnvelope> ReadProfile(string username, CancellationToken cancellationToken);
99
}

0 commit comments

Comments
 (0)