We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c80941d commit 7981e6bCopy full SHA for 7981e6b
src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/ActiveXHost.cs
@@ -79,14 +79,11 @@ static ActiveXHost()
79
/// constructor for ActiveXHost
80
internal ActiveXHost(Guid clsid, bool fTrusted ) : base( fTrusted )
81
{
82
- // Thread.ApartmentState is [Obsolete]
83
- #pragma warning disable 0618
84
// What if the control is marked as free-threaded?
85
- if (Thread.CurrentThread.ApartmentState != ApartmentState.STA)
+ if (Thread.CurrentThread.GetApartmentState() is not ApartmentState.STA)
86
87
throw new ThreadStateException(SR.Format(SR.AxRequiresApartmentThread, clsid.ToString()));
88
}
89
- #pragma warning restore 0618
90
91
_clsid = clsid;
92
0 commit comments