bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

[WARNING] Compiler Warnings When Targetting .Net 8+ (Please Merge #611)

Open uniblab opened this issue 7 months ago • 0 comments

** Issue ** New compiler warnings are generated when compiling under .Net 8+. This is because the many Exception-derived classes in the BouncyCastle.Cryptography library implement or override code which has been marked Obsolete in the .Net 8+ runtimes. As a best practice, compiler warnings should be resolved instead of ignored.

** Solution ** Mark each such method with the Obsolete attribute and then Molly-guard the attribute inside NET8_0_OR_GREATER. This way it does not alter current code but ensures proper .Net 8+ compilation. This solution has already been implemented and made available as Pull Request #611 .

** Requested Action ** Please review and merge PR #611 . This PR has passed all tests on all configurations.

** Impact ** There is no impact to current compilation settings. It resolves numerous compiler warnings when compiling under .Net 8+, which is expected to happen in the near future.

uniblab avatar May 05 '25 18:05 uniblab