Skip to content

Commit

Permalink
Work around CA1416 firing on a call to SetApartmentState
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmalinowski committed Oct 7, 2020
1 parent aaff726 commit 9b0c82c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Interactive/HostProcess/InteractiveHostEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ private static async Task<int> Main(string[] args)
Application.Run();
});

#pragma warning disable CA1416 // analyzer is warning this API is only available on Windows, but this project only targets windows.
uiThread.SetApartmentState(ApartmentState.STA);
#pragma warning restore CA1416
uiThread.IsBackground = true;
uiThread.Start();
resetEvent.Wait();
Expand Down

0 comments on commit 9b0c82c

Please sign in to comment.