23 instantiations of ThreadStateException
PresentationCore (5)
System\Windows\OleServicesContext.cs (5)
91throw new ThreadStateException(SR.OleServicesContext_ThreadMustBeSTA); 114throw new ThreadStateException(SR.OleServicesContext_ThreadMustBeSTA); 127throw new ThreadStateException(SR.OleServicesContext_ThreadMustBeSTA); 143throw new ThreadStateException(SR.OleServicesContext_ThreadMustBeSTA); 174throw new ThreadStateException(SR.OleServicesContext_ThreadMustBeSTA);
PresentationFramework (1)
System\Windows\Interop\ActiveXHost.cs (1)
85throw new ThreadStateException(SR.Format(SR.AxRequiresApartmentThread, clsid.ToString()));
System.Private.CoreLib (5)
src\System\Threading\Thread.CoreCLR.cs (5)
81throw new ThreadStateException(SR.Argument_InvalidHandle); 202throw new ThreadStateException(SR.ThreadState_Dead_State); 213throw new ThreadStateException(SR.ThreadState_Dead_State); 239throw new ThreadStateException(SR.ThreadState_Dead_State); 268throw new ThreadStateException(SR.ThreadState_Dead_Priority);
System.Private.Windows.Core.Tests (1)
System\Private\Windows\Ole\ClipboardCoreTests.cs (1)
40static void IOleServices.EnsureThreadState() => throw new ThreadStateException();
System.Windows.Forms (11)
System\Windows\Forms\ActiveX\AxHost.cs (2)
184throw new ThreadStateException(string.Format(SR.AXMTAThread, clsid)); 3288throw new ThreadStateException(SR.ThreadMustBeSTA);
System\Windows\Forms\Control.cs (1)
9462throw new ThreadStateException(SR.ThreadMustBeSTA);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
156throw new ThreadStateException(SR.ThreadMustBeSTA); 198throw new ThreadStateException(SR.ThreadMustBeSTA);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
172throw new ThreadStateException(SR.ThreadMustBeSTA);
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
74throw new ThreadStateException(string.Format(SR.AXMTAThread, clsidString)); 1217throw new ThreadStateException(SR.ThreadMustBeSTA);
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (1)
730throw new ThreadStateException(string.Format(SR.DebuggingExceptionOnly, SR.ThreadMustBeSTA));
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (1)
450throw new ThreadStateException(string.Format(SR.DebuggingExceptionOnly, SR.ThreadMustBeSTA));
System\Windows\Forms\OLE\WinFormsOleServices.cs (1)
32throw new ThreadStateException(SR.ThreadMustBeSTA);
21 references to ThreadStateException
Microsoft.CodeAnalysis.InteractiveHost (2)
Interactive\Core\InteractiveHost.RemoteService.cs (2)
258catch (ThreadStateException) 267catch (ThreadStateException)
Microsoft.Extensions.Logging.Console (1)
ConsoleLoggerProcessor.cs (1)
193catch (ThreadStateException) { }
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1182[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadStateException))]
netstandard (1)
netstandard.cs (1)
2145[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadStateException))]
System.Private.CoreLib (5)
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (4)
190/// <exception cref="ThreadStateException">The thread has already been started.</exception> 200/// <exception cref="ThreadStateException">The thread has already been started.</exception> 239/// <exception cref="ThreadStateException">The thread has already been started.</exception> 247/// <exception cref="ThreadStateException">The thread has already been started.</exception>
src\System\Threading\Thread.CoreCLR.cs (1)
410/// <exception cref="ThreadStateException">if the thread has not been started yet</exception>
System.Private.Windows.Core (1)
System\Private\Windows\Ole\IOleServices.cs (1)
17/// <exception cref="ThreadStateException">Current thread is not in the right state for OLE.</exception>
System.Private.Windows.Core.Tests (3)
System\Private\Windows\Ole\ClipboardCoreTests.cs (3)
21Assert.Throws<ThreadStateException>(() => ClipboardCore<InvalidThreadOleServices>.Clear()); 27Assert.Throws<ThreadStateException>(() => ClipboardCore<InvalidThreadOleServices>.SetData(null!, false)); 33Assert.Throws<ThreadStateException>(() => ClipboardCore<InvalidThreadOleServices>.TryGetData(out _, out _));
System.Threading.Thread (1)
artifacts\obj\System.Threading.Thread\Debug\net10.0\System.Threading.Thread.Forwards.cs (1)
16[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Threading.ThreadStateException))]
System.Windows.Forms (2)
System\Windows\Forms\OLE\Clipboard.cs (2)
138/// <exception cref="ThreadStateException"> 253/// <exception cref="ThreadStateException">
System.Windows.Forms.Tests (4)
System\Windows\Forms\ClipboardTests.cs (4)
288action.Should().Throw<ThreadStateException>(); 298action.Should().Throw<ThreadStateException>(); 300action.Should().Throw<ThreadStateException>(); 302action.Should().Throw<ThreadStateException>();