feat: upgrade to .NET 10

This commit is contained in:
Stevan Freeborn
2026-07-15 10:12:56 -05:00
parent 97fa55e60a
commit 45dc9de223
7 changed files with 34 additions and 25 deletions
@@ -2,25 +2,26 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<NoWarn>1591;</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4"> <PackageReference Include="coverlet.collector" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="coverlet.msbuild" Version="6.0.4"> <PackageReference Include="coverlet.msbuild" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Moq" Version="4.20.72" /> <PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" /> <PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="Spectre.Console.Testing" Version="0.49.1" /> <PackageReference Include="Spectre.Console.Testing" Version="0.57.2" />
<PackageReference Include="xunit" Version="2.9.3" /> <PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1"> <PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -1,5 +1,3 @@
using BGR.Console.Removal.Onnx;
using Microsoft.ML.OnnxRuntime.Tensors; using Microsoft.ML.OnnxRuntime.Tensors;
namespace BGR.Console.Tests.Unit; namespace BGR.Console.Tests.Unit;
@@ -1,6 +1,4 @@
using Microsoft.Extensions.Logging; using System.Diagnostics.CodeAnalysis;
using Spectre.Console.Cli;
namespace BGR.Console.Tests.Unit; namespace BGR.Console.Tests.Unit;
@@ -28,6 +26,7 @@ public class RemovalCommandTests : IDisposable
[Theory] [Theory]
[InlineData("output.png", false)] [InlineData("output.png", false)]
[InlineData("", true)] [InlineData("", true)]
[SuppressMessage("Reliability", "CA2025:Do not pass 'IDisposable' instances into unawaited tasks", Justification = "Matching invocations")]
public async Task ExecuteAsync_WhenCalled_ItShouldProcessImage(string outputPath, bool includeMask) public async Task ExecuteAsync_WhenCalled_ItShouldProcessImage(string outputPath, bool includeMask)
{ {
var imagePath = $"{Guid.NewGuid()}.png"; var imagePath = $"{Guid.NewGuid()}.png";
+10 -10
View File
@@ -38,17 +38,17 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.1" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" /> <PackageReference Include="Microsoft.Extensions.Options" Version="10.0.10" />
<PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.20.1" /> <PackageReference Include="Microsoft.ML.OnnxRuntime" Version="1.27.1" />
<PackageReference Include="Serilog" Version="4.2.0" /> <PackageReference Include="Serilog" Version="4.4.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="9.0.0" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="10.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" /> <PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" /> <PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="Spectre.Console" Version="0.49.1" /> <PackageReference Include="Spectre.Console" Version="0.57.2" />
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" /> <PackageReference Include="Spectre.Console.Cli" Version="0.55.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+1 -1
View File
@@ -1,6 +1,6 @@
namespace BGR.Console.Removal.Onnx; namespace BGR.Console.Removal.Onnx;
public class OnnxTensor : ITensor<float> internal class OnnxTensor : ITensor<float>
{ {
private readonly Tensor<float> _tensor; private readonly Tensor<float> _tensor;
+13 -3
View File
@@ -1,5 +1,3 @@
using System.Diagnostics;
namespace BGR.Console.Removal; namespace BGR.Console.Removal;
internal class RemovalCommand( internal class RemovalCommand(
@@ -16,7 +14,19 @@ internal class RemovalCommand(
private readonly IAnsiConsole _console = console; private readonly IAnsiConsole _console = console;
private readonly ILogger<RemovalCommand> _logger = logger; private readonly ILogger<RemovalCommand> _logger = logger;
public override async Task<int> ExecuteAsync(CommandContext context, Settings settings) public async Task<int> ExecuteAsync(
CommandContext context,
Settings settings
)
{
return await ExecuteAsync(context, settings, CancellationToken.None);
}
protected override async Task<int> ExecuteAsync(
CommandContext context,
Settings settings,
CancellationToken cancellationToken
)
{ {
await _console.Status() await _console.Status()
.Spinner(Spinner.Known.Dots) .Spinner(Spinner.Known.Dots)
+2 -1
View File
@@ -1,6 +1,6 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AnalysisLevel>latest</AnalysisLevel> <AnalysisLevel>latest</AnalysisLevel>
@@ -8,6 +8,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors> <CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
</Project> </Project>