Initial .NET 10 support & few improvements #1479
Open
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.
Initial support fixes for .NET 10 with TFM conditional compilation.
Will use 'latest' C# language version in the .csproj.
BouncyCastle.Cryptographypackage update. Also some TFM conditional compilation.For some reason,
Span<>.Reverse()is not a fluent pattern anymore, so I addedFluentReverse()extension.Unit & Integration Tests passed with some warnings/skips, build: .NET Framework 4.6.2 & .NET 10.
closes #1462
Copilot:
This pull request adds support for .NET 9 and .NET 10, updates dependencies, and improves cross-version compatibility throughout the codebase. It also introduces a new
FluentReverseextension method to replace usages of LINQ'sReverse().ToArray()for better performance and clarity. Additionally, several cryptography and certificate handling routines are updated to use the latest APIs where available, and test projects are updated to target the new frameworks..NET 9/10 Support and Project File Updates
net9.0andnet10.0to theTargetFrameworksinSIPSorcery.csproj,SIPSorcery.IntegrationTests.csproj, andSIPSorcery.UnitTests.csproj, and setLangVersiontolatestfor broader language feature support. [1] [2] [3]Certificate and Cryptography Improvements
BouncyCastle.CryptographyNuGet package to version 2.6.2.X509CertificateLoader.LoadPkcs12FromFileandRfc2898DeriveBytes.Pbkdf2where possible. [1] [2] [3] [4] [5] [6] [7] [8]NegotiatedCipherSuiteproperty on .NET 5+.Performance and Code Quality Enhancements
FluentReverseextension inTypeExtensions.csand replaced all usages of.Reverse().ToArray()with.FluentReverse().ToArray()for improved efficiency and readability, especially in endianness conversion and STUN/TURN attribute processing. [1] [2] [3] [4] [5] [6] [7] [8]Cross-Version I/O Improvements
ReadExactlywhere available (.NET 9+), ensuring complete reads and better error handling. [1] [2]Miscellaneous
These changes collectively modernize the codebase, enhance compatibility with future .NET versions, and improve maintainability and performance.