Skip to content

Update target frameworks and package references for improved compatibility#44

Merged
gehongyan merged 4 commits into
masterfrom
targeting
Feb 14, 2026
Merged

Update target frameworks and package references for improved compatibility#44
gehongyan merged 4 commits into
masterfrom
targeting

Conversation

@gehongyan

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 14, 2026 07:46
@github-actions

github-actions Bot commented Feb 14, 2026

Copy link
Copy Markdown

Test Results (All Platforms)

    9 files  ±0      9 suites  ±0   8s ⏱️ -1s
  379 tests ±0    379 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 140 runs  ±0  1 140 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ccc0194. ± Comparison against base commit 9ffa52b.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request aims to update target frameworks and package references to improve compatibility across different .NET versions. The changes consolidate conditional compilation directives, migrate from PolySharp to Meziantou.Polyfill for polyfills, update package versions, and reorganize package references across projects.

Changes:

  • Migrated from PolySharp to Meziantou.Polyfill package and introduced SUPPORTS_ASYNC_DISPOSABLE conditional compilation symbol
  • Updated multiple package versions (MassTransit, Microsoft.Extensions.*, Serilog, System.Linq.Async, etc.) to latest versions
  • Consolidated conditional compilation directives replacing framework-specific checks with more consistent patterns (SUPPORTS_ASYNC_DISPOSABLE, NETFRAMEWORK)
  • Reorganized project dependencies by moving System.Linq.Async and other package references to framework-specific ItemGroups in Kook.Net.Core.csproj
  • Replaced Microsoft.AspNetCore.App FrameworkReference with specific PackageReferences in hosting projects
  • Reordered target frameworks in common.props
  • Added global using directives for System.Net.Http on NETFRAMEWORK targets
  • CRITICAL: Introduced C# 13 extension syntax that will prevent compilation

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
props/common.props Reordered target frameworks, added SUPPORTS_ASYNC_DISPOSABLE symbol, migrated to Meziantou.Polyfill, added System.Net.Http reference for .NET Framework
Directory.Packages.props Updated package versions for MassTransit (with version range), Microsoft.Extensions.*, Serilog, System packages
THIRD-PARTY-NOTICES.md Replaced PolySharp license with Meziantou.Polyfill license
src/Kook.Net.Core/Kook.Net.Core.csproj Reorganized package references into framework-specific ItemGroups
src/Kook.Net.Core/Utils/PolyfillUtils.cs CRITICAL: Attempted to add polyfill using experimental C# 13 extension syntax that won't compile
src/Kook.Net.Core/Extensions/CollectionExtensions.cs CRITICAL: Refactored to use experimental C# 13 extension syntax that won't compile
src/Kook.Net.Core/GlobalUsings.cs Added global using for System.Net.Http on NETFRAMEWORK
src/Kook.Net.Rest/Kook.Net.Rest.csproj Removed duplicate package references (now inherited from Core)
src/Kook.Net.Rest/GlobalUsings.cs Added global using for System.Net.Http on NETFRAMEWORK
src/Kook.Net.Rest/BaseKookClient.cs Minor typo in comment ("any ways" should be "anyway")
src/Kook.Net.Rest/KookRestClient.cs Updated async disposable pattern to use SUPPORTS_ASYNC_DISPOSABLE
src/Kook.Net.Rest/KookRestApiClient.cs Changed conditional from NET462 to NETFRAMEWORK for URL encoding
src/Kook.Net.Rest/Net/*.cs Removed explicit NET462 using directives (now global), updated conditional compilation
src/Kook.Net.Rest/Net/Converters/*.cs Removed conditional compilation for DateTimeOffset.UnixEpoch (now uses polyfill)
src/Kook.Net.WebSocket/*.cs Updated async disposable patterns, removed System.Linq.Async package reference, changed Lock usage
src/Kook.Net.Webhook/*.cs Updated async disposable patterns to use SUPPORTS_ASYNC_DISPOSABLE
src/Kook.Net.Hosting/Kook.Net.Hosting.csproj Replaced FrameworkReference with PackageReference for Microsoft.Extensions.Hosting.Abstractions
src/Kook.Net.DependencyInjection.Microsoft/Kook.Net.DependencyInjection.Microsoft.csproj Commented out FrameworkReference, added PackageReference for Microsoft.Extensions.Options.ConfigurationExtensions
src/Kook.Net.Pipe/GlobalUsings.cs, KookPipeClient.cs Added global using, changed NET462 to NETFRAMEWORK
src/Kook.Net.Experimental/GlobalUsings.cs Added global using for System.Net.Http on NETFRAMEWORK
src/Kook.Net.Commands/PrimitiveParsers.cs Changed NET6_0_OR_GREATER to NET for DateOnly/TimeOnly
src/Kook.Net.CardMarkup/CardMarkupSerializer.cs Updated async disposable pattern
test/Kook.Net.Tests.Unit/ModuleBuilderTests.cs Removed conditional compilation for DateTimeOffset.UnixEpoch test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread props/common.props
Comment thread src/Kook.Net.Core/Extensions/CollectionExtensions.cs
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="System.Linq.Async" />
</ItemGroup>

Copilot AI Feb 14, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package references have been reorganized to be framework-specific, but there's no ItemGroup for net10.0. Given that net10.0 is in the target frameworks list (line 25 in common.props), net10.0 builds will not get any of these package references. If net10.0 has System.Linq.Async built-in or doesn't need it, this is fine. Otherwise, add an ItemGroup condition for net10.0 or verify that the packages are not needed for this target framework.

Suggested change
</ItemGroup>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="System.Linq.Async" />
</ItemGroup>

Copilot uses AI. Check for mistakes.
Comment thread src/Kook.Net.Rest/BaseKookClient.cs
Comment thread src/Kook.Net.Core/Extensions/CollectionExtensions.cs Outdated
Comment thread src/Kook.Net.Core/Utils/PolyfillUtils.cs
Comment thread src/Kook.Net.Commands/PrimitiveParsers.cs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 43 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Directory.Packages.props
Comment thread src/Kook.Net.Rest/BaseKookClient.cs
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@gehongyan gehongyan merged commit ea9de54 into master Feb 14, 2026
7 of 9 checks passed
@gehongyan gehongyan deleted the targeting branch February 14, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants