Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
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. |
| CA1420: Property, type, or attribute requires runtime marshalling | Using features that require runtime marshalling when runtime marshalling is disabled will result in runtime exceptions. |
| CA1421: Method uses runtime marshalling when DisableRuntimeMarshallingAttribute is applied | A method uses runtime marshalling, and runtime marshalling is explicitly disabled. |
| CA1422: Validate platform compatibility | Calling an API that's obsolete in a given OS (version) from a call site that's reachable from that OS (version) is not recommended. |
Samarbejd med os på GitHub
Kilden til dette indhold kan findes på GitHub, hvor du også kan oprette og gennemse problemer og pullanmodninger. Du kan få flere oplysninger i vores vejledning til bidragydere.