platform-compat
platform-compat copied to clipboard
PC001: Thread.SetApartmentState(ApartmentState) isn't supported on Linux and macOS
I want my application to be supported in Linux and macOS any suggestions would be appreciated
Why do you call SetApartmentState? If you need to call it on Windows only, you could achieve that by changing your code to something like:
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
Thread.SetApartmentState(…);