27 instantiations of TargetInvocationException
Microsoft.Build (2)
Evaluation\Expander.cs (1)
4333throw new TargetInvocationException(new MissingMethodException());
Instance\TaskFactories\TaskHostTask.cs (1)
474throw new TargetInvocationException(taskHostTaskComplete.TaskException);
PresentationFramework (1)
System\Windows\Interop\ActiveXHost.cs (1)
662throw new TargetInvocationException(SR.Format(SR.AXNohWnd, GetType().Name), e);
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\MetadataViewGenerator.cs (1)
148throw new TargetInvocationException(e);
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\AsyncCompletedEvent.cs (1)
23throw new TargetInvocationException(SR.Async_ExceptionOccurred, Error);
System.ComponentModel.TypeConverter (1)
System\ComponentModel\ReflectPropertyDescriptor.cs (1)
940throw new TargetInvocationException(SR.Format(SR.ErrorPropertyAccessorException, Name, name, message), t);
System.Data.Common (1)
System\Data\SQLTypes\SqlXml.cs (1)
113throw new TargetInvocationException(ex);
System.Private.CoreLib (12)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Constructor.cs (2)
55throw new TargetInvocationException(e); 77throw new TargetInvocationException(e);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (7)
61throw new TargetInvocationException(e); 99throw new TargetInvocationException(e); 140throw new TargetInvocationException(e); 178throw new TargetInvocationException(e); 221throw new TargetInvocationException(e); 266throw new TargetInvocationException(e); 307throw new TargetInvocationException(e);
src\System\RuntimeType.CoreCLR.cs (3)
3988throw new TargetInvocationException(e); 4014throw new TargetInvocationException(e); 4040throw new TargetInvocationException(e);
System.Windows.Forms (7)
System\Resources\ResXResourceReader.cs (1)
388throw new TargetInvocationException(newMessage, xml);
System\Windows\Forms\ActiveX\AxHost.cs (2)
1461throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t); 1608throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\ImmutablePropertyDescriptorGridEntry.cs (1)
78throw new TargetInvocationException(
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
946throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t); 989throw new TargetInvocationException(string.Format(SR.AXNohWnd, GetType().Name), t);
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (1)
43throw new TargetInvocationException(string.Format(SR.ExceptionCreatingCompEditorControl, e), e.InnerException);
System.Windows.Forms.Design.Tests (1)
System\ComponentModel\Design\DesignSurfaceTests.cs (1)
486.Throws(new TargetInvocationException(exception));
219 references to TargetInvocationException
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
103catch (TargetInvocationException tie)
dotnet-svcutil-lib (12)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializer.cs (2)
396if (e is TargetInvocationException) 488if (e is TargetInvocationException)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ExceptionTrace.cs (7)
51TargetInvocationException targetInvocationException = exception as TargetInvocationException; 70TargetInvocationException targetInvocationException = exception as TargetInvocationException; 79public Exception AsError(TargetInvocationException targetInvocationException, string eventSource) 147TargetInvocationException targetInvocationException = nextInnerException as TargetInvocationException;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (1)
196exception is TargetInvocationException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpMessageHandlerFactory.cs (1)
170catch (TargetInvocationException targetInvocationException)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (1)
387catch (TargetInvocationException e)
GetDocument.Insider (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25256.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
249catch (TargetInvocationException tie) when (tie.InnerException?.GetType().Name == "HostAbortedException") 253catch (TargetInvocationException tie)
Microsoft.AspNetCore.Components (1)
EventCallbackWorkItem.cs (1)
66catch (TargetInvocationException e)
Microsoft.AspNetCore.Hosting (3)
Internal\ErrorPageBuilder.cs (1)
20if (exception is TargetInvocationException tae)
Startup\ConventionBasedStartup.cs (2)
26catch (TargetInvocationException ex) 39catch (TargetInvocationException ex)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
ValidationsGenerator\ValidationsGeneratorTestBase.cs (2)
432catch (TargetInvocationException tie) when (tie.InnerException.GetType().Name == "HostAbortedException") 436catch (TargetInvocationException tie)
Microsoft.AspNetCore.InternalTesting (1)
ExceptionAssertions.cs (1)
246if (exception is TargetInvocationException tie)
Microsoft.AspNetCore.Mvc.Core (4)
ModelBinding\Binders\ComplexObjectModelBinder.cs (2)
719var targetInvocationException = exception as TargetInvocationException;
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
557var targetInvocationException = exception as TargetInvocationException;
Microsoft.AspNetCore.Mvc.Testing (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25256.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
249catch (TargetInvocationException tie) when (tie.InnerException?.GetType().Name == "HostAbortedException") 253catch (TargetInvocationException tie)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (2)
SnapshotTestHelper.cs (2)
440catch (TargetInvocationException tie) when (tie.InnerException.GetType().Name == "HostAbortedException") 444catch (TargetInvocationException tie)
Microsoft.AspNetCore.SignalR.Core (1)
Internal\DefaultHubDispatcher.cs (1)
464catch (TargetInvocationException ex)
Microsoft.AspNetCore.TestHost (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.5.25256.101\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (2)
249catch (TargetInvocationException tie) when (tie.InnerException?.GetType().Name == "HostAbortedException") 253catch (TargetInvocationException tie)
Microsoft.Build (11)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
345catch (TargetInvocationException e) when (e.InnerException != null)
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
920if (exceptionToLog is TargetInvocationException)
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (1)
289catch (TargetInvocationException e)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (3)
496catch (TargetInvocationException e) 979catch (TargetInvocationException e) 1346catch (TargetInvocationException e)
Evaluation\Expander.cs (1)
3670catch (TargetInvocationException ex)
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
281catch (TargetInvocationException e) 432catch (TargetInvocationException e)
Instance\TaskRegistry.cs (1)
1523catch (TargetInvocationException e)
Logging\LoggerDescription.cs (1)
228catch (TargetInvocationException e) when (e.InnerException is LoggerException le)
Microsoft.Build.Tasks.CodeAnalysis (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.Build.Tasks.Core (2)
GenerateResource.cs (2)
2631e is TargetInvocationException) 2788e is TargetInvocationException)
Microsoft.CodeAnalysis (1)
InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.CodeAnalysis.CodeStyle (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1661catch (TargetInvocationException x)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (3)
Debugger\Engine\DkmClrValue.cs (2)
477catch (System.Reflection.TargetInvocationException e) 504catch (System.Reflection.TargetInvocationException e)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.CodeAnalysis.Features (1)
SemanticSearch\QueryExecutionContext.cs (1)
180if (e is TargetInvocationException { InnerException: { } innerException })
Microsoft.CodeAnalysis.Scripting (1)
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (1)
268catch (TargetInvocationException e)
Microsoft.CodeAnalysis.UnitTests (13)
AnalyzerAssemblyLoaderTests.cs (3)
380var exception = Assert.Throws<TargetInvocationException>( 1386Assert.True(ex is MissingMethodException or TargetInvocationException, $@"Unexpected exception type: ""{ex.GetType()}""");
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (2)
262TargetInvocationException tie = Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(proxyType, (object?)null));
Collections\ImmutableSegmentedDictionaryTest.cs (2)
262TargetInvocationException tie = Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(proxyType, (object?)null));
Collections\ImmutableSegmentedHashSetTest.cs (2)
198TargetInvocationException tie = Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(proxyType, (object?)null));
Collections\ImmutableSegmentedListBuilderTest.cs (2)
372TargetInvocationException tie = Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(proxyType, (object)null!));
Collections\ImmutableSegmentedListTest.cs (2)
787TargetInvocationException tie = Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(proxyType, (object?)null));
Microsoft.CodeAnalysis.Workspaces (1)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Rpc\RpcServer.cs (1)
163if (e is TargetInvocationException)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
129catch (TargetInvocationException e)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (1)
163if (e is TargetInvocationException)
Microsoft.DotNet.RemoteExecutor (2)
Program.cs (2)
75catch (Exception exc) when (exc is not (TargetInvocationException { InnerException: AccessViolationException } or AccessViolationException)) 77if (exc is TargetInvocationException && exc.InnerException != null)
Microsoft.DotNet.XUnitExtensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\XunitParallelTheoryTestCaseRunner.cs (1)
175if (ex is not TargetInvocationException tiex)
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.Utilities.cs (1)
48catch (TargetInvocationException e) when (e.InnerException is not null)
Microsoft.JSInterop (1)
Infrastructure\DotNetDispatcher.cs (1)
193catch (TargetInvocationException tie) // Avoid using exception filters for AOT runtime support
Microsoft.Maui.Controls (1)
BindingExpression.cs (1)
729 catch (TargetInvocationException ex)
Microsoft.Maui.Controls.Build.Tasks (2)
NodeILExtensions.cs (2)
170 catch (System.Reflection.TargetInvocationException tie) when (tie.InnerException is XamlParseException) 174 catch (System.Reflection.TargetInvocationException tie) when (tie.InnerException is BuildException)
Microsoft.Maui.Controls.Xaml (1)
CreateValuesVisitor.cs (1)
115 catch (TargetInvocationException e) when (e.InnerException is XamlParseException || e.InnerException is XmlException)
Microsoft.ML.Core (1)
ComponentModel\ComponentCatalog.cs (1)
249catch (TargetInvocationException ex)
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipeBase.cs (1)
49catch (TargetInvocationException ex)
Microsoft.ML.Tests (3)
DatabaseLoaderTests.cs (2)
46var ex = Assert.Throws<System.Reflection.TargetInvocationException>(() => IrisLightGbmImpl(dbs));
Scenarios\GetColumnTests.cs (1)
104catch (TargetInvocationException ex)
Microsoft.VisualBasic.Core (9)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (2)
1464Catch ie As TargetInvocationException 1491Catch ie As TargetInvocationException
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (6)
175Catch ex As TargetInvocationException 201ElseIf TypeOf ex Is TargetInvocationException AndAlso 462Catch ex As TargetInvocationException 650Catch ex As TargetInvocationException 897Catch ex As TargetInvocationException 1046Catch ex As TargetInvocationException
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
1287Catch ex As TargetInvocationException When ex.InnerException IsNot Nothing
Microsoft.VisualStudio.LanguageServices (1)
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.cs (1)
106catch (TargetInvocationException ex) when (ex.InnerException is InvalidOperationException)
MSBuild (4)
OutOfProcTaskAppDomainWrapperBase.cs (3)
122Exception exceptionToReturn = e is TargetInvocationException ? e.InnerException : e; 312if (e is TargetInvocationException) 336e is TargetInvocationException ? e.InnerException : e,
XMake.cs (1)
4441catch (TargetInvocationException e) when (!loggerDescription.IsOptional)
MSBuildTaskHost (3)
OutOfProcTaskAppDomainWrapperBase.cs (3)
122Exception exceptionToReturn = e is TargetInvocationException ? e.InnerException : e; 312if (e is TargetInvocationException) 336e is TargetInvocationException ? e.InnerException : e,
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
497[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.TargetInvocationException))]
netstandard (1)
netstandard.cs (1)
1465[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.TargetInvocationException))]
PresentationBuildTasks (4)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParseException.cs (1)
454if (innerException is TargetInvocationException && innerException.InnerException is XamlParseException)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (1)
208if (e is TargetInvocationException && e.InnerException is XamlParseException)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (1)
1394if (innerException is TargetInvocationException && innerException.InnerException is XamlParseException)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CriticalExceptions.cs (1)
50( ex is System.Reflection.TargetInvocationException
PresentationFramework (15)
MS\Internal\Data\DefaultValueConverter.cs (1)
233catch (TargetInvocationException)
MS\Internal\WindowsRuntime\Windows\Data\Text\WordsSegmenter.cs (1)
71(e is TargetInvocationException) ||
System\Windows\Markup\BamlRecordReader.cs (12)
1540TargetInvocationException tie = e as TargetInvocationException; 2485TargetInvocationException tie = e as TargetInvocationException; 2658TargetInvocationException tie = e as TargetInvocationException; 2900TargetInvocationException tie = e as TargetInvocationException; 3715TargetInvocationException tie = e as TargetInvocationException; 3853TargetInvocationException tie = e as TargetInvocationException;
System\Windows\Markup\XamlParseException.cs (1)
454if (innerException is TargetInvocationException && innerException.InnerException is XamlParseException)
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
181catch (TargetInvocationException tie)
System.ComponentModel.Composition (6)
System\ComponentModel\Composition\MetadataViewProvider.cs (1)
95catch (TargetInvocationException ex)
System\ComponentModel\Composition\ReflectionModel\ExportingMember.cs (1)
48catch (TargetInvocationException exception)
System\ComponentModel\Composition\ReflectionModel\ImportingMember.cs (3)
66catch (TargetInvocationException exception) 132catch (TargetInvocationException exception) 154catch (TargetInvocationException exception)
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
428catch (TargetInvocationException ex)
System.ComponentModel.TypeConverter (3)
System\ComponentModel\LicenseManager.cs (1)
150catch (TargetInvocationException e)
System\ComponentModel\ReflectPropertyDescriptor.cs (2)
933if (t is TargetInvocationException) 1135if (t is TargetInvocationException && t.InnerException != null)
System.Configuration.ConfigurationManager (2)
System\Diagnostics\TraceUtils.cs (2)
110catch (TargetInvocationException tiexc) 125catch (TargetInvocationException tiexc)
System.Linq.Expressions (13)
System\Linq\Expressions\Interpreter\CallInstruction.cs (6)
95catch (TargetInvocationException tie) 228catch (TargetInvocationException e) 308catch (TargetInvocationException e) 332catch (TargetInvocationException e) 405catch (TargetInvocationException e) 429catch (TargetInvocationException e)
System\Linq\Expressions\Interpreter\LightCompiler.cs (2)
3230catch (TargetInvocationException e) 3275catch (TargetInvocationException e)
System\Linq\Expressions\Interpreter\LocalAccess.cs (2)
392catch (TargetInvocationException e) 433catch (TargetInvocationException e)
System\Linq\Expressions\Interpreter\NewInstruction.cs (2)
36catch (TargetInvocationException e) 95catch (TargetInvocationException e)
System\Linq\Expressions\Interpreter\Utilities.cs (1)
161public static void UnwrapAndRethrow(TargetInvocationException exception)
System.Net.Sockets (1)
System\Net\Sockets\Socket.Unix.cs (1)
284catch (TargetInvocationException ex) when (ex.InnerException is SocketException se && se.SocketErrorCode == SocketError.OperationNotSupported)
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\ExceptionUtility.cs (1)
26exception is TargetInvocationException)
System.Private.Windows.Core (2)
System\ExceptionExtensions.cs (1)
30if (ex is TargetInvocationException targetException)
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
31catch (Exception ex) when (ex is ArgumentException or InvalidCastException or ArithmeticException or IOException or TargetInvocationException)
System.Private.Xml (3)
System\Xml\Serialization\XmlSerializer.cs (2)
414if (e is TargetInvocationException) 514if (e is TargetInvocationException)
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (1)
288catch (TargetInvocationException e)
System.Reflection (1)
System.Reflection.cs (1)
34[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.TargetInvocationException))]
System.Resources.Extensions (2)
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.cs (2)
56catch (TargetInvocationException ex) 77catch (TargetInvocationException ex)
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
505[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.TargetInvocationException))]
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (1)
28exception is TargetInvocationException)
System.ServiceModel.Federation (1)
System\Runtime\Fx.cs (1)
24exception is TargetInvocationException)
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
63catch (TargetInvocationException e)
System.Windows.Forms (7)
System\Resources\ResXResourceReader.cs (1)
383catch (TargetInvocationException tie)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
4923if (ex is Reflection.TargetInvocationException) 4996if (ex is Reflection.TargetInvocationException)
System\Windows\Forms\DataBinding\BindingSource.cs (1)
537catch (TargetInvocationException ex)
System\Windows\Forms\DataBinding\ListBindingHelper.cs (1)
252catch (TargetInvocationException ex)
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (1)
40catch (TargetInvocationException e)
System\Windows\Forms\Internal\Formatter.cs (1)
483catch (TargetInvocationException ex)
System.Windows.Forms.Design (10)
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
66if (ex is TargetInvocationException)
System\ComponentModel\Design\DesignerActionPanel.PropertyLine.cs (1)
80if (e is TargetInvocationException)
System\ComponentModel\Design\DesignerHost.cs (1)
342if (e is TargetInvocationException && e.InnerException is { } inner)
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (1)
214while (e is TargetInvocationException)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
451if (e is TargetInvocationException)
System\ComponentModel\Design\Serialization\EventMemberCodeDomSerializer.cs (1)
64if (e is TargetInvocationException)
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (1)
118if (e is TargetInvocationException)
System\ComponentModel\Design\UndoEngine.cs (1)
464catch (TargetInvocationException)
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (1)
348catch (TargetInvocationException) { }
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (1)
102catch (TargetInvocationException tie)
System.Windows.Forms.Design.Tests (7)
System\ComponentModel\Design\ArrayEditorTests.cs (2)
124TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => editor.GetDisplayText(new ClassWithNonStringDefaultProperty()));
System\ComponentModel\Design\CollectionEditorTests.cs (2)
756TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => editor.GetDisplayText(new ClassWithNonStringDefaultProperty()));
System\Windows\Forms\Design\ListViewGroupCollectionEditorTests.cs (1)
67action.Should().Throw<TargetInvocationException>();
System\Windows\Forms\Design\ParentControlDesignerTests.cs (2)
201action.Should().Throw<TargetInvocationException>() 206action.Should().Throw<TargetInvocationException>()
System.Windows.Forms.Tests (19)
System\Windows\Forms\AccessibleObjects\DataGridViewAccessibleObjectTests.cs (1)
270Assert.Throws<TargetInvocationException>(() => ctor.Invoke([null]));
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (2)
26Assert.Throws<TargetInvocationException>(() => ctor.Invoke([null])); 31Assert.Throws<TargetInvocationException>(() => ctor.Invoke([itemWithoutList]));
System\Windows\Forms\AccessibleObjects\PropertyGridView.GridViewListBoxItemAccessibleObjectTests.cs (2)
20Assert.Throws<TargetInvocationException>(() => (AccessibleObject)Activator.CreateInstance(type, [null, new ItemArray.Entry("A")])); 29Assert.Throws<TargetInvocationException>(() => (AccessibleObject)Activator.CreateInstance(type, [control, null]));
System\Windows\Forms\AccessibleObjects\PropertyGridView.PropertyGridViewAccessibleObjectTests.cs (1)
210Assert.Throws<TargetInvocationException>(() => ctor.Invoke([null, null]));
System\Windows\Forms\AccessibleObjects\ToolStripTextBox.ToolStripTextBoxControlAccessibleObjectTests.cs (1)
32Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(type, (Control)null));
System\Windows\Forms\AxHost.AxPropertyDescriptorTests.cs (1)
734Assert.Throws<TargetInvocationException>(() => property.GetValue(new object()));
System\Windows\Forms\ListBindingHelperTests.cs (3)
458Assert.Throws<TargetInvocationException>(() => ListBindingHelper.GetListItemProperties(new DataClass(), TypeDescriptor.GetProperties(typeof(ListDataClass)).Cast<PropertyDescriptor>().ToArray())); 459Assert.Throws<TargetInvocationException>(() => ListBindingHelper.GetListItemProperties(new DataClass(), null, TypeDescriptor.GetProperties(typeof(ListDataClass)).Cast<PropertyDescriptor>().ToArray())); 460Assert.Throws<TargetInvocationException>(() => ListBindingHelper.GetListItemProperties(new DataClass(), string.Empty, TypeDescriptor.GetProperties(typeof(ListDataClass)).Cast<PropertyDescriptor>().ToArray()));
System\Windows\Forms\MessageBoxTests.cs (1)
152catch (TargetInvocationException ex)
System\Windows\Forms\PropertyGridInternal\AccessibleObjects\PropertyGridView.GridViewTextBox.GridViewTextBoxAccessibleObjectTests.cs (1)
116Assert.Throws<TargetInvocationException>(() => Activator.CreateInstance(accessibleObjectType, (TextBox)null));
System\Windows\Forms\ToolStripControlHostTests.cs (6)
356TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => property.ResetValue(item)); 1032TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => property.ResetValue(item)); 1175TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => property.ResetValue(item));
System.Xaml (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CriticalExceptions.cs (1)
50( ex is System.Reflection.TargetInvocationException
System\Xaml\Runtime\ClrObjectRuntime.cs (1)
36if (e is TargetInvocationException && e.InnerException is not null)
System.Xaml.Tests (8)
System\Xaml\XamlBackgroundReaderTests.cs (1)
254catch (TargetInvocationException ex) when (ex.InnerException is ObjectDisposedException)
System\Xaml\XamlNodeListTests.cs (5)
601catch (TargetInvocationException ex) when (ex.InnerException is XamlException) 624catch (TargetInvocationException ex) when (ex.InnerException is XamlException) 644catch (TargetInvocationException ex) when (ex.InnerException is XamlException) 664catch (TargetInvocationException ex) when (ex.InnerException is XamlException) 683catch (TargetInvocationException ex) when (ex.InnerException is XamlException)
System\Xaml\XamlNodeQueueTests.cs (2)
513catch (TargetInvocationException ex) when (ex.InnerException is XamlException) 536catch (TargetInvocationException ex) when (ex.InnerException is XamlException)
xunit.assert (2)
Sdk\ArgumentFormatter.cs (2)
693 var tiex = ex as TargetInvocationException;