@Nicholas Piazza , Based on my research, It violates the Rule CA1416.
The article CA1416: Validate platform compatibility describes the cause as following:
Violations are reported if a platform-specific API is used in the context of a different platform or if the platform isn't verified (platform-neutral). Violations are also reported if an API that's not supported for the target platform of the project is used.
We could try the following method to Suppress violations.
Please use SupportedOSPlatformGuardAttribute or UnsupportedOSPlatformGuardAttribute in your code.
Like the following code:
[SupportedOSPlatform("linux")]
public void LinuxOnlyApi() { }
public void Caller()
{
#pragma warning disable CA1416
LinuxOnlyApi();
#pragma warning restore CA1416
}
Hope this could help you.
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.