-
-
Notifications
You must be signed in to change notification settings - Fork 8
Upgrade Project to .NET 10 #403
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
Open
erwan-joly
wants to merge
13
commits into
master
Choose a base branch
from
claude/upgrade-dotnet-10-01ADk1Ek5XdBkZh1Ya3uvbK7
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Upgrade Project to .NET 10 #403
erwan-joly
wants to merge
13
commits into
master
from
claude/upgrade-dotnet-10-01ADk1Ek5XdBkZh1Ya3uvbK7
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updated all project files and CI/CD workflow to target .NET 10: - src/NosCore.Packets/NosCore.Packets.csproj: net8.0 → net10.0 - test/NosCore.Packets.Benchmark/NosCore.Packets.Benchmark.csproj: net8.0 → net10.0 - test/NosCore.Packets.Tests/NosCore.Packets.Tests.csproj: net8.0 → net10.0 - .github/workflows/dotnet.yml: dotnet-version 8.0.x → 10.0.x
Updated test and benchmark project packages: Benchmark project: - BenchmarkDotNet: 0.13.12 → 0.15.7 - Microsoft.CodeAnalysis.CSharp: 4.10.0 → 4.14.0 Test project: - coverlet.collector: 6.0.2 → 6.0.4 - Microsoft.NET.Test.Sdk: 17.10.0 → 18.0.1 - Moq: 4.20.70 → 4.20.72 - MSTest.TestAdapter: 3.4.3 → 4.0.2 - MSTest.TestFramework: 3.4.3 → 4.0.2 - Verify.MSTest: 25.0.3 → 30.20.1
…sions Fixes: - Updated actions/checkout from v2 to v4 - Updated actions/setup-dotnet from v3 to v4 for better .NET 10 support - Replaced deprecated 'create' event with 'push' tags filter - Fixed deprecated 'echo ::set-output' syntax with $GITHUB_OUTPUT - Fixed tag reference from github.event.ref to github.ref - Properly extract tag name using bash parameter expansion - Replaced deprecated actions/upload-release-asset@v1 with softprops/action-gh-release@v2 - Removed unnecessary jossef/action-latest-release-info step - Fixed GITHUB_TOKEN reference to use secrets.GITHUB_TOKEN
….AreEqual Replaced Assert.IsTrue(x == y) with Assert.AreEqual(expected, actual) throughout test files to comply with MSTest analyzer MSTEST0037 which requires more specific assertion methods. Changes: - DeserializerTest.cs: Updated 75 assertions to use Assert.AreEqual for equality checks - SerializerTest.cs: Updated 1 assertion to use Assert.IsNotNull for null checks This fixes compilation errors caused by TreatWarningsAsErrors being enabled with the newer MSTest 4.0.2 analyzer rules.
- Fixed typo in test project: TreatWrningsAsErrors -> TreatWarningsAsErrors - Restored CS1591 (missing XML documentation) suppression to prevent build failures The codebase has many public APIs without XML documentation. While CS1591 warnings are useful, adding documentation to all public members is beyond the scope of the .NET 10 upgrade. The suppression allows the build to succeed while maintaining other strict warning-as-error enforcement.
Changes: - Suppress AD0001 analyzer error in Benchmark project (BenchmarkDotNet incompatibility with .NET 10) - Add test parallelization configuration to fix MSTEST0001 error - Fix MSTEST0037 errors by using correct assertion methods: * Assert.IsNull instead of Assert.AreEqual for null checks * Assert.HasCount instead of Assert.AreEqual for collection counts * Assert.IsFalse instead of Assert.AreEqual for boolean checks - Fix MSTEST0017 error by correcting assertion argument order - Fix CS0411 type inference errors by adding explicit type casts Test files updated: - DeserializerTest.cs: 8 assertion method fixes - SerializerTest.cs: 1 assertion method fix - Test project: Added ParallelizeAttribute configuration - Benchmark project: Suppressed analyzer compatibility warning
The assembly-level ParallelizeAttribute configuration was causing a build error. Simplified by suppressing MSTEST0001 analyzer warning instead, which is a recommendation rather than a critical requirement.
- Corrected Assert.HasCount calls - signature is (expectedCount, collection) not (collection, count) - Fixed type cast on line 242: CreateShopPacketType to byte - Added null-forgiving operators to fix CS8604 warnings on .First() calls
Changed Assert.AreEqual((byte)0, value) to Assert.AreEqual<byte>(0, value) to help the compiler infer the correct type for the assertion on lines 242-243.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated all project files and CI/CD workflow to target .NET 10: