7 instantiations of TargetException
System.Private.CoreLib (5)
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (1)
483
private static void ThrowHelperTargetException() => throw new
TargetException
(SR.RFLCT_Targ_StatFldReqTarg);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (2)
94
throw new
TargetException
(SR.RFLCT_Targ_StatMethReqTarg);
99
throw new
TargetException
(SR.Format(SR.RFLCT_Targ_ITargMismatch_WithType, method.DeclaringType, target.GetType()));
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeConstructorInfo.cs (1)
93
throw new
TargetException
();
src\libraries\System.Private.CoreLib\src\System\Reflection\RuntimeMethodInfo.cs (1)
92
throw new
TargetException
();
System.Reflection.Context (2)
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (2)
44
throw new
TargetException
(SR.Target_InstanceMethodRequiresTarget);
47
throw new
TargetException
(SR.Target_ObjectTargetMismatch);
19 references to TargetException
Microsoft.Build (1)
ExceptionHandling.cs (1)
259
|| e is
TargetException
// thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not
Microsoft.Build.Engine.OM.UnitTests (1)
ExceptionHandling.cs (1)
259
|| e is
TargetException
// thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not
Microsoft.Build.Tasks.Core (1)
ExceptionHandling.cs (1)
259
|| e is
TargetException
// thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not
Microsoft.Build.Utilities.Core (1)
ExceptionHandling.cs (1)
259
|| e is
TargetException
// thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not
MSBuild (1)
ExceptionHandling.cs (1)
259
|| e is
TargetException
// thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not
MSBuildTaskHost (1)
ExceptionHandling.cs (1)
259
|| e is
TargetException
// thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
496
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
TargetException
))]
netstandard (1)
netstandard.cs (1)
1464
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
TargetException
))]
PresentationFramework (1)
System\Windows\Data\ObjectDataProvider.cs (1)
534
catch (
TargetException
te)
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (1)
100
/// <exception cref="
TargetException
">
System.Reflection (1)
System.Reflection.cs (1)
33
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
TargetException
))]
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
504
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.
TargetException
))]
System.Windows.Forms.Design.Tests (2)
System\ComponentModel\Design\ArrayEditorTests.cs (1)
125
Assert.IsType<
TargetException
>(ex.InnerException);
System\ComponentModel\Design\CollectionEditorTests.cs (1)
757
Assert.IsType<
TargetException
>(ex.InnerException);
System.Windows.Forms.Tests (5)
System\Windows\Forms\AxHost.AxPropertyDescriptorTests.cs (2)
1060
Assert.Throws<
TargetException
>(() => property.SetValue(new object(), "Value"));
1069
Assert.Throws<
TargetException
>(() => property.SetValue(new object(), "Value"));
System\Windows\Forms\FeatureSupportTests.cs (3)
95
Assert.Throws<
TargetException
>(() => FeatureSupport.GetVersionPresent(featureClassType.AssemblyQualifiedName, featureConstName));
158
Assert.Throws<
TargetException
>(() => FeatureSupport.IsPresent(featureClassType.AssemblyQualifiedName, featureConstName));
159
Assert.Throws<
TargetException
>(() => FeatureSupport.IsPresent(featureClassType.AssemblyQualifiedName, featureConstName, new Version(1, 2, 3, 4)));