Skip to content

Update to .NET 10 #2106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/AdventOfCode.Site/bin/Debug/net9.0/AdventOfCode.Site.dll",
"program": "${workspaceFolder}/src/AdventOfCode.Site/bin/Debug/net10.0/AdventOfCode.Site.dll",
"args": [],
"cwd": "${workspaceFolder}/src/AdventOfCode.Site",
"stopAtEntry": false,
Expand Down
2 changes: 1 addition & 1 deletion .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.NetCore.Component.Runtime.9.0",
"Microsoft.NetCore.Component.Runtime.10.0",
"Microsoft.NetCore.Component.SDK",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
Expand Down
10 changes: 5 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
<ItemGroup>
<PackageVersion Include="Amazon.Lambda.AspNetCoreServer.Hosting" Version="1.8.0" />
<PackageVersion Include="Amazon.Lambda.RuntimeSupport" Version="1.13.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.1-nightly.20250107.205" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="MartinCostello.Logging.XUnit.v3" Version="0.5.1" />
<PackageVersion Include="MartinCostello.Testing.AwsLambdaTestServer" Version="0.9.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.0-preview.3.25172.1" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0-preview.3.25172.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0-preview.3.25171.5" />
<PackageVersion Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Microsoft.OpenApi" Version="1.6.22" />
<PackageVersion Include="Microsoft.OpenApi" Version="2.0.0-preview7" />
<PackageVersion Include="Microsoft.Playwright" Version="1.52.0" />
<PackageVersion Include="Microsoft.Toolkit.HighPerformance" Version="7.1.2" />
<PackageVersion Include="Microsoft.TypeScript.MSBuild" Version="5.8.3" />
Expand Down
5 changes: 5 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
<configuration>
<packageSources>
<clear />
<add key="benchmarkdotnet" value="https://www.myget.org/F/benchmarkdotnet/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="benchmarkdotnet">
<package pattern="BenchmarkDotNet" />
<package pattern="BenchmarkDotNet.*" />
</packageSource>
<packageSource key="NuGet">
<package pattern="*" />
</packageSource>
Expand Down
6 changes: 3 additions & 3 deletions crank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
scenarios:
microbenchmarks:
application:
framework: net9.0
framework: net10.0
job: microbenchmarks
root:
application:
framework: net9.0
framework: net10.0
job: server
load:
framework: net9.0
framework: net10.0
job: bombardier
variables:
serverPort: 5000
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.203",
"version": "10.0.100-preview.3.25201.16",
"allowPrerelease": false,
"rollForward": "latestMajor",
"paths": [ ".dotnet", "$host$" ],
Expand Down
2 changes: 1 addition & 1 deletion src/AdventOfCode.Console/AdventOfCode.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OptimizationPreference>Speed</OptimizationPreference>
<OutputType>Exe</OutputType>
<RootNamespace>MartinCostello.AdventOfCode.Console</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Spectre.Console" />
Expand Down
2 changes: 1 addition & 1 deletion src/AdventOfCode.Resources/AdventOfCode.Resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsAotCompatible>true</IsAotCompatible>
<OutputType>Library</OutputType>
<RootNamespace>MartinCostello.AdventOfCode</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Input\**\input.txt" />
Expand Down
12 changes: 10 additions & 2 deletions src/AdventOfCode.Site/AdventOfCode.Site.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<OutputType>Exe</OutputType>
<PublishSelfContained>true</PublishSelfContained>
<RootNamespace>MartinCostello.AdventOfCode.Site</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>latest</TypeScriptToolsVersion>
</PropertyGroup>
Expand All @@ -25,7 +25,7 @@
<ItemGroup>
<PackageReference Include="Amazon.Lambda.AspNetCoreServer.Hosting" />
<PackageReference Include="Amazon.Lambda.RuntimeSupport" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" PrivateAssets="all" />
<PackageReference Include="RazorSlices" />
</ItemGroup>
Expand Down Expand Up @@ -60,4 +60,12 @@
<RuntimeHostConfigurationOption Condition=" '%(PackageVersion.Identity)' == 'Microsoft.ICU.ICU4C.Runtime' " Include="System.Globalization.AppLocalIcu" Value="%(PackageVersion.Version)" />
</ItemGroup>
</Target>
<!--
HACK Workaround for https://github.com/dotnet/aspnetcore/issues/61037
-->
<Target Name="DisableCompileTimeOpenApiXmlGenerator" BeforeTargets="CoreCompile">
<ItemGroup>
<Analyzer Remove="$(PkgMicrosoft_AspNetCore_OpenApi)\analyzers\dotnet\cs\Microsoft.AspNetCore.OpenApi.SourceGenerators.dll" />
</ItemGroup>
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/AdventOfCode.Site/aws-lambda-tools-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"region": "eu-west-2",
"profile": "",
"configuration": "Release",
"framework": "net9.0",
"framework": "net10.0",
"function-architecture": "arm64",
"function-description": "The Advent of Code as a Service function.",
"function-handler": "AdventOfCode.Site",
Expand Down
2 changes: 1 addition & 1 deletion src/AdventOfCode/AdventOfCode.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<NoWarn>$(NoWarn);CA1034;CA2007;CA2225;CA5351</NoWarn>
<OutputType>Library</OutputType>
<RootNamespace>MartinCostello.AdventOfCode</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.HighPerformance" />
Expand Down
3 changes: 0 additions & 3 deletions src/AdventOfCode/Puzzles/Y2020/Day22.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ public static int PlayCombat(IList<string> startingDeck, bool recursive)
.TakeWhile((p) => !string.IsNullOrEmpty(p))
.Select(Parse<int>);

#pragma warning disable IDE0306
// HACK https://github.com/dotnet/roslyn/issues/77177
return Play(new(deck1), new(deck2), recursive);
#pragma warning restore IDE0306

static int Play(Queue<int> deck1, Queue<int> deck2, bool recursive)
{
Expand Down
3 changes: 0 additions & 3 deletions src/AdventOfCode/Puzzles/Y2022/Day11.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ private sealed class Monkey(int number, IEnumerable<long> items)
{
public int Inspections { get; private set; }

#pragma warning disable IDE0306
// HACK https://github.com/dotnet/roslyn/issues/77177
public Queue<long> Items { get; } = new(items);
#pragma warning restore IDE0306

public Func<long, Monkey> Next { get; set; } = default!;

Expand Down
2 changes: 1 addition & 1 deletion startvscode.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86
SET PATH=%DOTNET_ROOT%;%PATH%

:: Sets the Target Framework for Visual Studio Code.
SET TARGET=net6.0
SET TARGET=net10.0

SET FOLDER=%~1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<NoWarn>$(NoWarn);CA1034;CA1056;CA1819;CA2007;SA1600</NoWarn>
<OutputType>Exe</OutputType>
<RootNamespace>MartinCostello.AdventOfCode.Benchmarks</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\AdventOfCode\AdventOfCode.csproj" />
Expand Down
11 changes: 10 additions & 1 deletion tests/AdventOfCode.Tests/AdventOfCode.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<NoWarn>$(NoWarn);xUnit1004</NoWarn>
<OutputType>Exe</OutputType>
<RootNamespace>MartinCostello.AdventOfCode</RootNamespace>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<UseDefaultCodeAnalysisRuleSet>true</UseDefaultCodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
Expand All @@ -20,10 +20,19 @@
<PackageReference Include="MartinCostello.Logging.XUnit.v3" />
<PackageReference Include="MartinCostello.Testing.AwsLambdaTestServer" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.Playwright" />
<PackageReference Include="Shouldly" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="xunit.v3" />
</ItemGroup>
<!--
HACK Workaround for https://github.com/dotnet/aspnetcore/issues/61037
-->
<Target Name="DisableCompileTimeOpenApiXmlGenerator" BeforeTargets="CoreCompile">
<ItemGroup>
<Analyzer Remove="$(PkgMicrosoft_AspNetCore_OpenApi)\analyzers\dotnet\cs\Microsoft.AspNetCore.OpenApi.SourceGenerators.dll" />
</ItemGroup>
</Target>
</Project>