platform-compat icon indicating copy to clipboard operation
platform-compat copied to clipboard

PC001: Thread.SetApartmentState(ApartmentState) isn't supported on Linux and macOS

Open Basanagoudaglb opened this issue 6 years ago • 1 comments

I want my application to be supported in Linux and macOS any suggestions would be appreciated

Basanagoudaglb avatar Nov 14 '19 07:11 Basanagoudaglb

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(…);

svick avatar Nov 18 '19 12:11 svick