Portability and interoperability rules
Portability rules support portability across different platforms. Interoperability rules support interaction with COM clients.
In this section
| Rule | Description |
|---|---|
| CA1401: P/Invokes should not be visible | A public or protected method in a public type has the System.Runtime.InteropServices.DllImportAttribute attribute (also implemented by the Declare keyword in Visual Basic). Such methods should not be exposed. |
| CA1416: Validate platform compatibility | Using platform-dependent APIs on a component makes the code no longer work across all platforms. |
CA1417: Do not use OutAttribute on string parameters for P/Invokes |
String parameters passed by value with the OutAttribute can destabilize the runtime if the string is an interned string. |
| CA1418: Use valid platform string | Platform compatibility analyzer requires a valid platform name and version. |
| CA1419: Provide a parameterless constructor that is as visible as the containing type for concrete types derived from 'System.Runtime.InteropServices.SafeHandle' | Providing a parameterless constructor that is as visible as the containing type for a type derived from System.Runtime.InteropServices.SafeHandle enables better performance and usage with source-generated interop solutions. |
Povratne informacije
Pošalјite i prikažite povratne informacije za