Conversation
Review Summary by QodoUpgrade to .NET 11 and complete Cuemon.Kernel assembly split
WalkthroughsDescription• Upgrade target frameworks to .NET 11 and remove .NET 9 support • Remove TypeForwardedTo compatibility bridge from Cuemon.Core • Move date and range primitives to Cuemon.Kernel assembly • Update preprocessor directives from NET9_0_OR_GREATER to NET10_0_OR_GREATER • Reorganize solution structure with dedicated corelibs folder • Enable .NET preview SDK in CI pipeline and update package versions Diagramflowchart LR
A["Target Frameworks<br/>net9.0 → net11.0"] --> B["Remove TypeForwardedTo<br/>from Cuemon.Core"]
B --> C["Move Primitives<br/>to Cuemon.Kernel"]
C --> D["Update Preprocessor<br/>Directives"]
D --> E["Reorganize Solution<br/>Structure"]
E --> F["Enable Preview SDK<br/>in CI"]
File Changes1. src/Cuemon.Core/Properties/AssemblyInfo.cs
|
Code Review by Qodo
1. New RangeTest uses block namespace
|
| namespace Cuemon | ||
| { | ||
| public class RangeTest : Test | ||
| { | ||
| public RangeTest(ITestOutputHelper output) : base(output) | ||
| { | ||
| } |
There was a problem hiding this comment.
1. New rangetest uses block namespace 📘 Rule violation ✓ Correctness
The new C# test file RangeTest.cs declares a block-scoped namespace (namespace Cuemon { ... })
instead of a file-scoped namespace. This violates the requirement that new C# files must use
file-scoped namespaces.
Agent Prompt
## Issue description
The new C# file `test/Cuemon.Kernel.Tests/RangeTest.cs` uses a block-scoped namespace (`namespace Cuemon { ... }`) but new C# files must use file-scoped namespaces.
## Issue Context
This repository targets modern C# and the compliance checklist requires file-scoped namespaces for new/fully rewritten C# files.
## Fix Focus Areas
- test/Cuemon.Kernel.Tests/RangeTest.cs[6-104]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| /// <param name="duration">A function delegate that returns the duration of the time range. If not provided, the duration is calculated as the difference between <paramref name="end"/> and <paramref name="start"/>.</param> | ||
| public TimeRange(TimeSpan start, TimeSpan end, Func<TimeSpan> duration = null) : base(start, end, duration ?? (() => end.Subtract(start))) | ||
| { |
There was a problem hiding this comment.
2. Timerange ctor binary break 🐞 Bug ⛯ Reliability
TimeRange no longer provides a public .ctor(TimeSpan, TimeSpan); it was replaced with .ctor(TimeSpan, TimeSpan, Func<TimeSpan>) using an optional parameter. Any existing compiled consumer binaries calling the old 2-argument constructor will throw MissingMethodException at runtime after upgrading.
Agent Prompt
### Issue description
`TimeRange` removed the public 2-parameter constructor and replaced it with a 3-parameter constructor that uses an optional parameter. Optional parameters do **not** preserve the old constructor signature, so previously compiled consumers will fail at runtime.
### Issue Context
This is a public API in a library; even in a major release, this kind of break is easy to avoid while keeping the new functionality.
### Fix Focus Areas
- src/Cuemon.Kernel/TimeRange.cs[11-19]
### Suggested change
- Add back:
- `public TimeRange(TimeSpan start, TimeSpan end) : this(start, end, null) { }`
- Keep the new capability via:
- `public TimeRange(TimeSpan start, TimeSpan end, Func<TimeSpan> duration) : base(start, end, duration ?? (() => end.Subtract(start))) { }`
- Avoid an optional parameter on the public constructor to reduce future API traps (optional params are baked into call sites).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Pull request overview
Migrates the solution forward to .NET 11 (adds net11.0, removes net9.0) while continuing the kernel split work by updating conditional compilation and dependencies, and adjusting CI/test environments accordingly.
Changes:
- Updated build/test/benchmark TFMs across projects to include
net11.0and dropnet9.0. - Updated conditional compilation guards from
NET9_0_OR_GREATERtoNET10_0_OR_GREATERand refreshed CI/test environment configurations for preview tooling. - Updated central package versions (including preview packages) and expanded/added test coverage for range/date primitives.
Reviewed changes
Copilot reviewed 75 out of 77 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| testenvironments.json | Drops net9 Docker runner; adds net11 runner and re-formats JSON. |
| test/Cuemon.Security.Cryptography.Tests/UnkeyedHashFactoryTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Runtime.Caching.Tests/Cuemon.Runtime.Caching.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Kernel.Tests/RangeTest.cs | Adds new tests for Range<>, DateTimeRange, and TimeRange. |
| test/Cuemon.IO.Tests/StreamDecoratorExtensionsTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.Threading.Tests/Tasks/TaskExtensionsTest.cs | Updates TFM guards to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.Text.Json.Tests/Cuemon.Extensions.Text.Json.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Extensions.Reflection.Tests/TypeExtensionsTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.IO.Tests/TextReaderExtensionsTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.IO.Tests/StreamExtensionsTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.Hosting.Tests/HostEnvironmentExtensionsTest.cs | Updates TFM guards to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.DependencyInjection.Tests/ServiceCollectionExtensionsTest.cs | Updates TFM guards to NET10_0_OR_GREATER. |
| test/Cuemon.Extensions.DependencyInjection.Tests/Cuemon.Extensions.DependencyInjection.Tests.csproj | Updates conditional ItemGroup to include net10/net11 instead of net9/net10. |
| test/Cuemon.Extensions.AspNetCore.Tests/Cuemon.Extensions.AspNetCore.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Extensions.AspNetCore.Mvc.Tests/Cuemon.Extensions.AspNetCore.Mvc.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Extensions.AspNetCore.Mvc.RazorPages.Tests/Cuemon.Extensions.AspNetCore.Mvc.RazorPages.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Extensions.AspNetCore.Authentication.Tests/Cuemon.Extensions.AspNetCore.Authentication.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.Core.Tests/Text/ParserFactoryTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Core.Tests/Reflection/AssemblyContextOptionsTest.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.Core.Tests/DateSpanTest.cs | Adds extensive new DateSpan tests and alters existing test data setup. |
| test/Cuemon.Core.Tests/Assets/UnmanagedDisposable.cs | Updates TFM guards to NET10_0_OR_GREATER. |
| test/Cuemon.Core.Tests/Assets/ClampOptions.cs | Updates TFM guard to NET10_0_OR_GREATER. |
| test/Cuemon.AspNetCore.Tests/Cuemon.AspNetCore.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.AspNetCore.Razor.TagHelpers.Tests/Cuemon.AspNetCore.Razor.TagHelpers.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.AspNetCore.Mvc.Tests/Cuemon.AspNetCore.Mvc.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.AspNetCore.Mvc.FunctionalTests/Cuemon.AspNetCore.Mvc.FunctionalTests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.AspNetCore.FunctionalTests/Cuemon.AspNetCore.FunctionalTests.csproj | Updates test TFMs to net11.0;net10.0. |
| test/Cuemon.AspNetCore.Authentication.Tests/Cuemon.AspNetCore.Authentication.Tests.csproj | Updates test TFMs to net11.0;net10.0. |
| src/Cuemon.Xml/Serialization/Formatters/XmlFormatterOptions.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Resilience/Transient.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Kernel/Disposable.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Kernel/Convertible.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.IO/StreamFactory.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.IO/Extensions/StreamDecoratorExtensions.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.IO/Cuemon.IO.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.IO/BufferWriterOptions.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.Text.Json/Formatters/JsonFormatterOptions.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.Text.Json/Formatters/JsonFormatter.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.Text.Json/Converters/StringFlagsEnumConverter.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.Text.Json/Converters/StringEnumConverter.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.Runtime.Caching/CacheEnumerableExtensions.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.Net/Http/SlimHttpClientFactory.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.IO/StreamExtensions.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Extensions.IO/Cuemon.Extensions.IO.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore/Cuemon.Extensions.AspNetCore.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Xml/Cuemon.Extensions.AspNetCore.Xml.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Text.Json/Cuemon.Extensions.AspNetCore.Text.Json.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Mvc/Cuemon.Extensions.AspNetCore.Mvc.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Mvc.RazorPages/Cuemon.Extensions.AspNetCore.Mvc.RazorPages.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Xml.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json/Cuemon.Extensions.AspNetCore.Mvc.Formatters.Text.Json.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Extensions.AspNetCore.Authentication/Cuemon.Extensions.AspNetCore.Authentication.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.Data/DatabaseWatcher.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Core/TimeRange.cs | Changes TimeRange constructor signature to allow optional duration resolver. |
| src/Cuemon.Core/StringFactory.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Core/Runtime/Watcher.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Core/Runtime/FileWatcher.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Core/Runtime/Dependency.cs | Updates lock implementation guard to NET10_0_OR_GREATER. |
| src/Cuemon.Core/Reflection/AssemblyContext.cs | Updates conditional compilation to NET10_0_OR_GREATER. |
| src/Cuemon.Core/Properties/AssemblyInfo.cs | Removes [TypeForwardedTo] compatibility bridge and related imports. |
| src/Cuemon.Core/DateTimeRange.cs | Formatting/BOM update while keeping type in Cuemon.Core. |
| src/Cuemon.Core/DateSpan.cs | Replaces FNV constants with literals and removes a dependency import. |
| src/Cuemon.AspNetCore/Cuemon.AspNetCore.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.AspNetCore.Razor.TagHelpers/Cuemon.AspNetCore.Razor.TagHelpers.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.AspNetCore.Mvc/Cuemon.AspNetCore.Mvc.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.AspNetCore.Authentication/Cuemon.AspNetCore.Authentication.csproj | Adds net11.0 to TFMs and removes net9.0. |
| src/Cuemon.AspNetCore.App/Cuemon.AspNetCore.App.csproj | Adds net11.0 to TFMs and removes net9.0. |
| Directory.Packages.props | Updates central package versions (including preview lines) and conditions. |
| Directory.Build.props | Updates default TFMs to include net11.0 and remove net9.0. |
| Cuemon.slnx | Re-organizes solution structure under /src/corelibs/. |
| CHANGELOG.md | Adds 11.0.0 release notes describing .NET 11 and kernel split changes. |
| AGENTS.md | Updates documented TFMs and conditional compilation guidance. |
| .github/workflows/ci-pipeline.yml | Enables preview .NET usage across CI jobs/steps. |
| <ItemGroup Condition="$(TargetFramework.StartsWith('net11')) OR $(TargetFramework.StartsWith('netstandard2'))"> | ||
| <PackageVersion Include="Microsoft.Data.Sqlite" Version="11.0.0-preview.2.26159.112" /> | ||
| <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="11.0.0-preview.2.26159.112" /> | ||
| <PackageVersion Include="Microsoft.Extensions.Hosting" Version="11.0.0-preview.2.26159.112" /> | ||
| <PackageVersion Include="Microsoft.Extensions.Http" Version="11.0.0-preview.2.26159.112" /> | ||
| <PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="11.0.0-preview.2.26159.112" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="$(TargetFramework.StartsWith('net10')) OR $(TargetFramework.StartsWith('net11'))"> | ||
| <PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.0-preview4.26064.3" /> | ||
| </ItemGroup> |
| - Solution, source, test, and benchmark target frameworks now include `net11.0`; `net9.0` has been removed from the supported matrix. | ||
| - Central package management was updated to align `net11.0` and `netstandard2.0` builds with .NET 11 preview package versions, while `net10.0` remains on the .NET 10 package line where applicable. | ||
| - `DateSpan`, `DateTimeRange`, `Range`, `TimeRange`, and `TimeUnit` source files now live in `Cuemon.Kernel` as part of the completed kernel split. | ||
| - `BufferWriterOptions` was updated to follow the new `NET10_0_OR_GREATER` conditional path. |
| Validator.ThrowIfNull(value); | ||
| #if NET9_0_OR_GREATER | ||
| #if NET10_0_OR_GREATER | ||
| return Convert.ToHexString(value).Replace("-", "").ToLowerInvariant(); |
This pull request is a major update that moves the build, test, and benchmark matrix forward to .NET 11, removes .NET 9 support, and completes the split of foundational APIs into the
Cuemon.Kernelassembly. It also updates central package management to use .NET 11 preview packages where applicable, and removes the compatibility bridge that previously forwarded kernel types fromCuemon.Core. The solution structure has been reorganized to group core libraries under a dedicated folder..NET 11 migration and build matrix update:
net11.0in addition tonet10.0, withnet9.0removed from all target framework lists (Directory.Build.props,AGENTS.md,src/*.csproj,CHANGELOG.md). (Ffe7db85L1R1, [1] [2] [3] [4] [5] [6] [7] [8] [9].github/workflows/ci-pipeline.yml). [1] [2] [3] [4] [5] [6]Central package management and dependency updates:
Directory.Packages.propsupdated to use .NET 11 preview package versions fornet11.0andnetstandard2.0, and to remove .NET 9-specific package groups.Assembly boundary and solution structure changes:
Cuemon.CoreandCuemon.Kernelunder/src/corelibs/, reflecting the completed kernel split (Cuemon.slnx). [1] [2][TypeForwardedTo]attributes removed fromCuemon.Core, eliminating the compatibility bridge and requiring direct references toCuemon.Kernelfor foundational APIs (src/Cuemon.Core/Properties/AssemblyInfo.cs).Codebase compatibility and conditional compilation updates:
NET9_0_OR_GREATERtoNET10_0_OR_GREATERwhere appropriate, aligning with the new minimum supported .NET version (src/Cuemon.Core/Reflection/AssemblyContext.cs,AGENTS.md). [1] [2]These changes collectively mark the transition to .NET 11, finalize the kernel split, and remove legacy compatibility shims.