1 type derived from COMException
System.DirectoryServices (1)
artifacts\obj\System.DirectoryServices\Debug\net10.0\System.DirectoryServices.notsupported.cs (1)
255public partial class DirectoryServicesCOMException : System.Runtime.InteropServices.COMException, System.Runtime.Serialization.ISerializable
56 instantiations of COMException
Microsoft.Build.Framework (1)
VisualStudioLocationHelper.cs (1)
102throw new COMException("Failed to get query", result);
PresentationFramework (53)
MS\Internal\IO\Packaging\CorePropertiesFilter.cs (2)
129throw new COMException(SR.FilterGetTextNotSupported, 143throw new COMException(SR.FilterGetValueAlreadyCalledOnCurrentChunk,
MS\Internal\IO\Packaging\EncryptedPackageFilter.cs (1)
82throw new COMException(SR.FilterGetTextNotSupported,
MS\Internal\IO\Packaging\indexingfiltermarshaler.cs (1)
273throw new COMException(SR.FilterEndOfChunks,
MS\Internal\IO\Packaging\PackageFilter.cs (4)
120throw new COMException(SR.FilterEndOfChunks, 213throw new COMException(SR.FilterEndOfChunks, 226throw new COMException(SR.FilterGetTextNotSupported, 241throw new COMException(SR.FilterGetValueNotSupported,
MS\Internal\IO\Packaging\XamlFilter.cs (2)
219throw new COMException(SR.FilterGetChunkNoStream, (int)FilterErrorCode.FILTER_E_ACCESS); 242throw new COMException(xmlException.Message, (int)FilterErrorCode.FILTER_E_UNKNOWNFORMAT);
MS\Internal\IO\Packaging\XpsFilter.cs (13)
54throw new COMException(SR.FileToFilterNotLoaded, 61throw new COMException(SR.FilterInitInvalidAttributes, 76throw new COMException(SR.FileToFilterNotLoaded, 104throw new COMException(SR.FileToFilterNotLoaded, 151throw new COMException(SR.AuxiliaryFilterReturnedAnomalousCountOfCharacters, 190throw new COMException(SR.AuxiliaryFilterReturnedAnomalousCountOfCharacters, 275throw new COMException(SR.FileToFilterNotLoaded, 423throw new COMException(ex.Message, (int)FilterErrorCode.FILTER_E_ACCESS); 427throw new COMException(ex.Message, (int)FilterErrorCode.FILTER_E_UNKNOWNFORMAT); 459throw new COMException(SR.FilterIPersistFileIsReadOnly, NativeMethods.STG_E_CANTSAVE); 552throw new COMException(ex.Message, (int)FilterErrorCode.FILTER_E_ACCESS); 556throw new COMException(ex.Message, (int)FilterErrorCode.FILTER_E_UNKNOWNFORMAT); 579throw new COMException(SR.FilterIPersistStreamIsReadOnly, NativeMethods.STG_E_CANTSAVE);
System\Windows\Documents\InputScopeAttribute.cs (3)
60throw new COMException(SR.InputScopeAttribute_E_OUTOFMEMORY, NativeMethods.E_OUTOFMEMORY); 88throw new COMException(SR.InputScopeAttribute_E_OUTOFMEMORY, NativeMethods.E_OUTOFMEMORY); 107throw new COMException(SR.InputScopeAttribute_E_OUTOFMEMORY, NativeMethods.E_OUTOFMEMORY);
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerFactory.cs (2)
149throw new COMException(string.Empty, uae); 158throw new COMException(string.Empty, icex);
System\Windows\Documents\TextStore.cs (24)
78throw new COMException(SR.TextStore_CONNECT_E_CANNOTCONNECT, unchecked((int)0x80040202)); 84throw new COMException(SR.TextStore_E_NOINTERFACE, unchecked((int)0x80004002)); 106throw new COMException(SR.TextStore_CONNECT_E_NOCONNECTION, unchecked((int)0x80040200)); 121throw new COMException(SR.TextStore_NoSink); 124throw new COMException(SR.TextStore_BadLockFlags); 154throw new COMException(SR.TextStore_ReentrantRequestLock); 474throw new COMException(SR.TextStore_TS_E_READONLY, UnsafeNativeMethods.TS_E_READONLY); 495throw new COMException(SR.TextStore_CompositionRejected, NativeMethods.E_FAIL); 506throw new COMException(SR.TextStore_CompositionRejected, NativeMethods.E_FAIL); 545throw new COMException(SR.TextStore_E_NOTIMPL, unchecked((int)0x80004001)); 606throw new COMException(SR.TextStore_TS_E_READONLY, UnsafeNativeMethods.TS_E_READONLY); 636throw new COMException(SR.TextStore_TS_E_FORMAT, UnsafeNativeMethods.TS_E_FORMAT); 657throw new COMException(SR.TextStore_TS_E_READONLY, UnsafeNativeMethods.TS_E_READONLY); 707throw new COMException(SR.TextStore_CompositionRejected, NativeMethods.E_FAIL); 802throw new COMException(SR.TextStore_TS_E_READONLY, UnsafeNativeMethods.TS_E_READONLY); 838throw new COMException(SR.TextStore_TS_E_FORMAT, UnsafeNativeMethods.TS_E_FORMAT); 883throw new COMException(SR.TextStore_E_NOTIMPL, unchecked((int)0x80004001)); 957throw new COMException(SR.TextStore_TS_E_NOLAYOUT, UnsafeNativeMethods.TS_E_NOLAYOUT); 965throw new COMException(SR.TextStore_TS_E_INVALIDPOINT, UnsafeNativeMethods.TS_E_INVALIDPOINT); 1037throw new COMException(SR.TextStore_TS_E_NOLAYOUT, UnsafeNativeMethods.TS_E_NOLAYOUT); 1052throw new COMException(SR.TextStore_TS_E_NOLAYOUT, UnsafeNativeMethods.TS_E_NOLAYOUT); 1505throw new COMException(SR.TextStore_CompositionRejected, NativeMethods.E_FAIL); 2597throw new COMException(SR.TextStore_TS_E_NOLAYOUT, UnsafeNativeMethods.TS_E_NOLAYOUT); 3423throw new COMException(SR.TextStore_CompositionRejected, NativeMethods.E_FAIL);
System\Windows\Standard\ErrorCodes.cs (1)
433e = new COMException(message, (int)_value);
System.Windows.Forms (2)
System\Windows\Forms\ActiveX\AxHost.cs (1)
36private static readonly COMException s_invalidArgumentException = new(SR.AXInvalidArgument, unchecked((int)0x80070057));
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (1)
495throw new COMException(string.Format(SR.TYPEINFOPROCESSORGetDocumentationFailed, dispid, hr, "ITypeInfo", (int)hr));
121 references to COMException
Microsoft.Build.Framework (2)
VisualStudioLocationHelper.cs (2)
76catch (COMException) 94catch (COMException ex) when (ex.ErrorCode == REGDB_E_CLASSNOTREG)
Microsoft.CodeAnalysis.Features (1)
EditAndContinue\EditAndContinueMethodDebugInfoReader.cs (1)
182/// <exception cref="COMException">Error reading debug information.</exception>
Microsoft.CodeAnalysis.Test.Utilities (1)
Platform\Custom\SigningTestHelpers.cs (1)
72catch (COMException ex)
Microsoft.CodeAnalysis.UnitTests (3)
MetadataReferences\AssemblyPortabilityPolicyTests.cs (3)
80Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 89Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 105Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path));
Microsoft.VisualBasic.Core (5)
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (4)
191Dim cex As COMException = TryCast(ex, COMException) 202(TypeOf ex.InnerException Is COMException AndAlso 203CType(ex.InnerException, COMException).ErrorCode = DISP_E_NOTACOLLECTION) Then
Microsoft\VisualBasic\Interaction.vb (1)
529Catch e As COMException
Microsoft.VisualStudio.LanguageServices (3)
InlineRename\InlineRenameUndoManager.cs (2)
110catch (COMException ex) when (ex.ErrorCode == VSConstants.E_UNEXPECTED && FatalError.ReportAndCatch(ex)) 211catch (COMException)
Snippets\SnippetExpansionClient.cs (1)
1028catch (COMException ex)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (13)
CodeModel\FileCodeFunctionTests.cs (3)
272Assert.Throws<COMException>(() => testObject.GetStartPoint(vsCMPart.vsCMPartAttributesWithDelimiter)); 369Assert.Throws<COMException>(() => testObject.GetEndPoint(vsCMPart.vsCMPartAttributesWithDelimiter)); 508Assert.Throws<COMException>(() =>
CodeModel\FileCodeImportTests.cs (6)
37Assert.Throws<COMException>(() => { var value = import.Name; }); 44Assert.Throws<COMException>(() => { var value = import.FullName; }); 82Assert.Throws<COMException>(() => import.GetStartPoint(vsCMPart.vsCMPartAttributesWithDelimiter)); 89Assert.Throws<COMException>(() => import.GetStartPoint(vsCMPart.vsCMPartBody)); 158Assert.Throws<COMException>(() => import.GetEndPoint(vsCMPart.vsCMPartAttributesWithDelimiter)); 165Assert.Throws<COMException>(() => import.GetEndPoint(vsCMPart.vsCMPartBody));
CodeModel\FileCodeNamespaceTests.cs (2)
117Assert.Throws<COMException>(() => testObject.GetStartPoint(vsCMPart.vsCMPartAttributesWithDelimiter)); 198Assert.Throws<COMException>(() => testObject.GetEndPoint(vsCMPart.vsCMPartAttributesWithDelimiter));
CodeModel\FileCodeVariableTests.cs (2)
212Assert.Throws<COMException>(() => testObject.GetStartPoint(vsCMPart.vsCMPartBody)); 294Assert.Throws<COMException>(() => testObject.GetEndPoint(vsCMPart.vsCMPartBody));
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
CodeModel\CodeModelTestHelpers.vb (1)
157Catch ex As COMException
Microsoft.VisualStudio.LanguageServices.UnitTests (13)
CodeModel\AbstractCodeElementTests`1.vb (2)
106Dim exception = Assert.Throws(Of COMException)( 187Dim exception = Assert.Throws(Of COMException)(
CodeModel\AbstractFileCodeModelTests.vb (2)
109Assert.Throws(Of System.Runtime.InteropServices.COMException)( 159Assert.Throws(Of System.Runtime.InteropServices.COMException)(
CodeModel\CSharp\CodeImportTests.vb (2)
23Dim ex = Assert.Throws(Of COMException)( 42Dim ex = Assert.Throws(Of COMException)(
CodeModel\CSharp\FileCodeModelTests.vb (2)
980Assert.Throws(Of System.Runtime.InteropServices.COMException)( 1283Assert.Throws(Of COMException)(Sub() member.AddParameter("Test", "System.Object"))
CodeModel\VisualBasic\CodeClassTests.vb (3)
158TestAddBaseThrows(Of COMException)(code, "A", Nothing) 1709TestRemoveBaseThrows(Of COMException)(code, "B") 1795TestRemoveImplementedInterfaceThrows(Of COMException)(code, "I")
CodeModel\VisualBasic\CodeInterfaceTests.vb (1)
239TestRemoveBaseThrows(Of COMException)(code, "J")
CodeModel\VisualBasic\CodeStructTests.vb (1)
226TestRemoveImplementedInterfaceThrows(Of COMException)(code, "I")
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
624[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.COMException))]
netstandard (1)
netstandard.cs (1)
1617[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.COMException))]
PresentationCore (10)
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
74catch (Exception e) when (e is ArgumentException || e is UnauthorizedAccessException || e is COMException)
MS\Internal\DpiUtil\DpiUtil+WindowDpiScaleHelper.cs (2)
54catch (Exception e) when (e is COMException) 65catch (Exception e) when (e is COMException)
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\InputPane.cs (4)
97catch (COMException) 108catch (COMException) 148catch (COMException) 170catch (COMException)
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\UISettings.cs (2)
33catch (COMException) 63catch (COMException)
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (1)
1133return (e is COMException
PresentationFramework (24)
MS\Internal\IO\Packaging\PackageFilter.cs (3)
178catch (COMException) 290catch(COMException) 390catch (COMException)
MS\Internal\IO\Packaging\UnsafeIndexingFilterStream.cs (1)
107catch (COMException comException)
MS\Internal\IO\Packaging\XpsFilter.cs (1)
84catch (COMException ex)
System\Windows\Controls\InkCanvas.cs (2)
2748catch ( System.Runtime.InteropServices.COMException ) 2800catch ( System.Runtime.InteropServices.COMException )
System\Windows\Controls\WebBrowser.cs (1)
898catch (COMException ce)
System\Windows\Data\ObjectDataProvider.cs (1)
454catch (System.Runtime.InteropServices.COMException ce)
System\Windows\Documents\MsSpellCheckLib\SpellChecker\OptionDescription.cs (1)
68catch (COMException) when (shouldSuppressCOMExceptions)
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (1)
643{true, new List<Type> { typeof(COMException), typeof(UnauthorizedAccessException)}}
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerFactory.cs (3)
55{true, new List<Type> { typeof(COMException), typeof(UnauthorizedAccessException)} } 139catch (COMException) when (suppressCOMExceptions) 161catch (Exception e) when (suppressOtherExceptions && !(e is COMException) && !(e is UnauthorizedAccessException))
System\Windows\Documents\MsSpellCheckLib\Utils\Extensions.cs (3)
50catch (COMException) when (shouldSuppressCOMExceptions) 97catch (COMException) when (shouldSuppressCOMExceptions) 167catch (COMException) when (shouldSuppressCOMExceptions)
System\windows\Documents\TextEditorContextMenu.cs (1)
705catch (COMException)
System\windows\Documents\TextEditorDragDrop.cs (1)
230catch (COMException ex) when(ex.HResult == NativeMethods.E_UNEXPECTED)
System\Windows\Documents\WinRTSpellerInterop.cs (1)
45when (ex is InvalidCastException || ex is COMException )
System\Windows\FrameworkCompatibilityPreferences.cs (1)
346/// a corresponding <see cref="System.Runtime.InteropServices.COMException"/> (which is a type of
System\Windows\Interop\ActiveXHost.cs (2)
972catch (COMException) 983catch (COMException e)
System\Windows\Standard\ErrorCodes.cs (1)
425if (e.GetType() == typeof(COMException))
ReachFramework (10)
Serialization\Manager\XpsOMPackagingPolicy.cs (10)
42catch (COMException) 74catch(COMException) 123catch (COMException) 474catch (COMException) 590catch (COMException) 642catch (COMException) 786catch (COMException) 820catch (COMException) 888catch (COMException) 914catch (COMException)
System.Runtime.InteropServices (1)
artifacts\obj\System.Runtime.InteropServices\Debug\net10.0\System.Runtime.InteropServices.Forwards.cs (1)
21[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.COMException))]
System.Windows.Forms (14)
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (1)
146catch (COMException)
System\Windows\Forms\ActiveX\AxHost.cs (2)
36private static readonly COMException s_invalidArgumentException = new(SR.AXInvalidArgument, unchecked((int)0x80070057)); 1975catch (COMException)
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
1001catch (COMException)
System\Windows\Forms\Controls\WebBrowser\HtmlElement.cs (6)
220catch (COMException ex) 249catch (COMException ex) 349catch (COMException ex) 378catch (COMException ex) 526catch (COMException ex) 667catch (COMException comException)
System\Windows\Forms\Controls\WebBrowser\HtmlWindowCollection.cs (1)
68catch (COMException)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
1320catch (COMException ce)
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (1)
296catch (COMException)
System\Windows\Forms\Input\Cursor.cs (1)
438catch (COMException e)
System.Windows.Forms.Tests (16)
System\Windows\Forms\AccessibleObjects\TrackBar.TrackBarAccessibleObjectTests.cs (1)
118Assert.Throws<COMException>(() => accessibilityObject.Value = value);
System\Windows\Forms\AxHostTests.cs (3)
1385Assert.Throws<COMException>(control.CreateControl); 1657Assert.Throws<COMException>(() => SubAxHost.GetIPictureDispFromPicture(original)); 1725Assert.Throws<COMException>(() => SubAxHost.GetIPictureFromPicture(original));
System\Windows\Forms\DataObjectTests.cs (2)
2717((Action)(() => iComDataObject.GetDataHere(ref formatetc, ref stgMedium))).Should().Throw<COMException>() 2743((Action)(() => iComDataObject.GetDataHere(ref formatetc, ref stgMedium))).Should().Throw<COMException>()
System\Windows\Forms\HtmlDocumentTests.cs (4)
548Assert.Throws<COMException>(() => document.Domain = value); 1514COMException ex = Assert.Throws<COMException>(() => document.AttachEventHandler(string.Empty, handler)); 1686Assert.Throws<COMException>(() => document.ExecCommand(command, showUI, value));
System\Windows\Forms\HtmlElementTests.cs (4)
1709COMException ex = Assert.Throws<COMException>(() => element.AttachEventHandler(string.Empty, handler)); 2489COMException ex = Assert.Throws<COMException>(() => element.SetAttribute(string.Empty, "value"));
System\Windows\Forms\WebBrowserTests.cs (2)
2312catch (COMException) 2346catch (COMException)
UIAutomationClientSideProviders (2)
MS\Internal\AutomationProxies\Accessible.cs (2)
1309COMException comException = e as COMException;