Warning CA2015: Do not define finalizers for types derived from MemoryManager<T>
Starting in .NET 5, the .NET SDK includes .NET source code analyzers. Several of these rules are enabled, by default, including CA2015. If your project contains code that violates this rule and is configured to treat warnings as errors, this change could break your build.
Rule CA2015 flags types that derive from MemoryManager<T> that define a finalizer. Adding a finalizer to a type that derives from MemoryManager<T> is likely an indication of a bug. It suggests that a native resource that could have been obtained in a Span<T> is getting cleaned up, potentially while it's still in use by the Span<T>.
Remove the finalizer definition. For more information, see CA2015.
To disable code analysis completely, set
falsein your project file. For more information, see EnableNETAnalyzers.
Not detectable via API analysis.