Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse } # obj, bin 폴더 삭제
dotnet nuget locals --clear all # nuget의 캐시 삭제
You can mark each windows-specific method with System.Runtime.Versioning.SupportedOSPlatformAttribute e.g.
[SupportedOSPlatform("windows")]
public static void Foo()
=> Thread.CurrentThread.SetApartmentState(ApartmentState.STA);
Mark entire assembly with in AssemblyInfo (if you have one)
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
Or edit .csproj file to target windows-specific version of dotnet to make these changes automatic
<TargetFramework>net5.0-windows</TargetFramework>
https://docs.microsoft.com/ko-kr/dotnet/fundamentals/code-analysis/quality-rules/ca1060