This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Property | Value |
---|---|
Rule ID | CA1419 |
Title | Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle' |
Category | Interoperability |
Fix is breaking or non-breaking | Non-breaking |
Enabled by default in .NET 9 | As suggestion |
A concreteSafeHandle type requires a parameterless constructor that is at least as visible as the containing type.
Providing a public parameterless constructor for a type derived fromSafeHandle enables better performance and usage with source-generated interop solutions.
Add a parameterless constructor to your type.
Do not suppress a warning from this rule.
Was this page helpful?
Was this page helpful?