893 references to InnerException
aspire (1)
Commands\RunCommand.cs (1)
229catch (ConnectionLostException ex) when (ex.InnerException is OperationCanceledException)
Aspire.Dashboard.Tests (1)
Model\ResourceViewModelTests.cs (1)
106Assert.NotNull(ex.InnerException);
Aspire.Hosting.Nats.Tests (1)
NatsFunctionalTests.cs (1)
147Assert.IsType<NatsServerException>(exception.InnerException);
Aspire.Hosting.Testing (1)
DistributedApplicationEntryPointInvoker.cs (1)
105exception = tie.InnerException ?? tie;
Client.ExpectedExceptions.IntegrationTests (1)
ExpectedExceptionTests.4.1.0.cs (1)
115string innerExceptionMessage = ex.InnerException?.Message;
Crossgen2Tasks (2)
CommonFilePulledFromSdkRepo\TaskBase.cs (2)
92if (e.InnerException != null) 94s = s + " ---> " + ExceptionToStringWithoutMessage(e.InnerException) + Environment.NewLine +
csc (2)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (2)
69Exception? e = exception.InnerException; 74e = e.InnerException;
CSharpSyntaxGenerator (2)
SourceGenerator.cs (2)
79catch (InvalidOperationException ex) when (ex.InnerException is XmlException) 81var xmlException = (XmlException)ex.InnerException;
Diagnostics.EFCore.FunctionalTests (4)
DatabaseErrorPageMiddlewareTest.cs (3)
109Assert.Equal("SQLite Error 1: 'no such table: Blogs'.", ex.InnerException.Message); 406|| exception.InnerException?.GetType().Name == "SqliteException"); 454|| exception.InnerException?.GetType().Name == "SqliteException");
MigrationsEndPointMiddlewareTest.cs (1)
265Assert.Equal("Welcome to the invalid snapshot!", ex.InnerException.Message);
dotnet-openapi (2)
Application.cs (2)
61catch (AggregateException ex) when (ex.InnerException != null) 65Error.WriteLine(ex.InnerException.Message);
dotnet-svcutil.xmlserializer (5)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
140Exception ie = tie.InnerException;
Microsoft\Tools\ServiceModel\SvcUtil\ToolConsole.cs (4)
108while (e.InnerException != null) 110if (e.Message != e.InnerException.Message) 112WriteError(e.InnerException.Message, " "); 114e = e.InnerException;
dotnet-svcutil-lib (44)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializer.cs (2)
397e = e.InnerException; 489e = e.InnerException;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DiagnosticUtility.cs (1)
33exception = exception.InnerException;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
492fieldToValueDictionary.Add("_innerException", value.InnerException);
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (1)
474throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(exception.Message, exception.InnerException));
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (1)
1469throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(exception.Message, exception.InnerException));
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Diagnostics\DiagnosticTraceBase.cs (2)
183if (exception.InnerException != null) 186AddExceptionToTraceString(xml, exception.InnerException);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Diagnostics\EtwDiagnosticTrace.cs (2)
305if (exception.InnerException != null) 339WriteExceptionToTraceString(xml, exception.InnerException, remainingLength, remainingAllowedRecursionDepth);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\ExceptionTrace.cs (7)
52if (targetInvocationException != null && targetInvocationException.InnerException != null) 54return AsError(targetInvocationException.InnerException); 71if (targetInvocationException != null && targetInvocationException.InnerException != null) 73return AsError(targetInvocationException.InnerException, eventSource); 91Exception innerException = targetInvocationException.InnerException; 149Exception innerException = (targetInvocationException != null && targetInvocationException.InnerException != null) 150? targetInvocationException.InnerException
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (1)
198exception = exception.InnerException;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TaskHelpers.cs (2)
60if (antecedent.IsFaulted) tcsObj.TrySetException(antecedent.Exception.InnerException); 109tcsObj.TrySetException(antecedent.Exception.InnerException);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Connection.cs (6)
518if (ioException.InnerException is TimeoutException) 520return new TimeoutException(ioException.InnerException.Message, ioException); 522else if (ioException.InnerException is CommunicationObjectAbortedException) 524return new CommunicationObjectAbortedException(ioException.InnerException.Message, ioException); 526else if (ioException.InnerException is CommunicationException) 528return new CommunicationException(ioException.InnerException.Message, ioException);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelHelpers.cs (3)
114var inner = requestException.InnerException; 128Contract.Assert(exception.InnerException != null, "InnerException must be set to be able to convert"); 130uint hresult = (uint)exception.InnerException.HResult;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ServiceChannelProxy.cs (1)
389throw e.InnerException;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\WsdlImporter.cs (6)
1879if (wie.InnerException != null && (wie.InnerException is WsdlImportException)) 1881WsdlImportException wieInner = wie.InnerException as WsdlImportException; 1945return new WsdlImportException(item, afe.InnerException); 1964Exception messageException = this.InnerException; 1967messageException = messageException.InnerException;
FrameworkFork\System.ServiceModel\System\ServiceModel\ExceptionDetail.cs (2)
32if (exception.InnerException != null) 34_innerException = new ExceptionDetail(exception.InnerException);
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (1)
3193throw new ArgumentException(GetDuplicateMessage(value.GetType(), key), e.InnerException);
Metadata\HttpAuthenticationHelper.cs (3)
25exception = exception.InnerException; 42webException = GetException<WebException>(webException.InnerException); 60webException = GetException<WebException>(webException.InnerException);
Shared\Utilities\Utilities.cs (1)
45e = e.InnerException;
Tool.cs (1)
324var ex = new AggregateException(options.Errors.Select(e => e as ToolArgumentException ?? new ToolArgumentException(e.Message, e.InnerException)));
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") 255exception = tie.InnerException ?? tie;
HttpStress (6)
Program.cs (6)
130if (e is HttpRequestException hre && hre.InnerException is IOException) 132e = hre.InnerException; 142var name = e.InnerException?.GetType().Name; 149if (e.InnerException.Message.Contains("INTERNAL_ERROR") || e.InnerException.Message.Contains("CANCEL")) 597if (e is HttpRequestException hre && hre.InnerException is SocketException se && se.SocketErrorCode == SocketError.AddressAlreadyInUse)
IIS.FunctionalTests (8)
Http3Tests.cs (8)
124var qex = Assert.IsType<QuicException>(ex.InnerException); 140var qex = Assert.IsType<QuicException>(ex.InnerException?.InnerException?.InnerException); 157var qex = Assert.IsType<QuicException>(ex.InnerException?.InnerException?.InnerException); 171var qex = Assert.IsType<QuicException>(ex.InnerException);
IIS.LongTests (5)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (5)
70catch (HttpRequestException ex) when (ex.InnerException is IOException) 438catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException) 594catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException)
IIS.NewHandler.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (5)
70catch (HttpRequestException ex) when (ex.InnerException is IOException) 438catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException) 594catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException)
IIS.NewShim.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (5)
70catch (HttpRequestException ex) when (ex.InnerException is IOException) 438catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException) 594catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException)
IISExpress.FunctionalTests (8)
InProcess\IISExpressShutdownTests.cs (3)
35catch (HttpRequestException ex) when (ex.InnerException is IOException) 65catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (5)
70catch (HttpRequestException ex) when (ex.InnerException is IOException) 438catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException) 594catch (HttpRequestException ex) when (ex.InnerException is IOException | ex.InnerException is SocketException)
InMemory.FunctionalTests (11)
Http2\Http2StreamTests.cs (7)
1166Assert.IsType<Http2StreamErrorException>(thrownEx.InnerException); 1201Assert.IsType<Http2StreamErrorException>(thrownEx.InnerException); 1237Assert.IsType<Http2StreamErrorException>(thrownEx.InnerException); 1273Assert.IsType<Http2StreamErrorException>(thrownEx.InnerException); 3471Assert.IsType<ConnectionAbortedException>(thrownEx.InnerException); 3472Assert.Equal(CoreStrings.ConnectionAbortedByApplication, thrownEx.InnerException.Message); 4724&& w.Exception is ConnectionAbortedException && w.Exception.InnerException == expectedException);
HttpsTests.cs (2)
578Assert.Equal("HTTP/3 requires HTTPS.", ex.InnerException.InnerException.Message);
ResponseTests.cs (2)
2682Assert.Same(onStartingException, writeException.InnerException); 4322&& w.Exception is ConnectionAbortedException && w.Exception.InnerException == expectedException);
Interop.FunctionalTests (9)
Http3\Http3RequestTests.cs (4)
576var innerEx = Assert.IsType<HttpProtocolException>(ex.InnerException); 685var innerEx = Assert.IsType<HttpProtocolException>(ex.InnerException); 2077while (rootException.InnerException != null) 2079rootException = rootException.InnerException;
HttpClientHttp2InteropTests.cs (4)
600Assert.Equal("The HTTP/2 server reset the stream. HTTP/2 error code 'CANCEL' (0x8). (HttpProtocolError)", exception?.InnerException?.Message); 629Assert.Equal("The HTTP/2 server reset the stream. HTTP/2 error code 'CANCEL' (0x8). (HttpProtocolError)", exception?.InnerException?.Message); 1402Assert.Equal("The HTTP response headers length exceeded the set limit of 65536 bytes.", ex.InnerException?.InnerException?.Message);
HttpHelpers.cs (1)
32current = current.InnerException;
Microsoft.AspNetCore.Authentication.Test (22)
JwtBearerTests.cs (3)
619Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 691Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 763Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message);
JwtBearerTests_Handler.cs (3)
580Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 646Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 712Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message);
OpenIdConnect\OpenIdConnectEventTests.cs (7)
72Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 141Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 250Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 356Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 464Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 574Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 698Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message);
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (7)
72Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 141Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 250Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 356Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 464Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 574Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message); 698Assert.Equal("Authentication was aborted from user code.", exception.InnerException.Message);
WsFederation\WsFederationTest.cs (1)
147Assert.Contains("Unsolicited logins are not allowed.", exception.InnerException.Message);
WsFederation\WsFederationTest_Handler.cs (1)
145Assert.Contains("Unsolicited logins are not allowed.", exception.InnerException.Message);
Microsoft.AspNetCore.Components (1)
EventCallbackWorkItem.cs (1)
71return Task.FromException(e.InnerException!);
Microsoft.AspNetCore.Components.Authorization.Tests (4)
src\Components\Shared\test\AutoRenderComponent.cs (2)
33var exception = t.Exception.Flatten().InnerException; 36exception = e.InnerException;
src\Components\Shared\test\TestRenderer.cs (2)
85var exception = task.Exception.Flatten().InnerException; 88exception = e.InnerException;
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
ImportMapTest.cs (2)
318var exception = task.Exception.Flatten().InnerException; 321exception = e.InnerException;
src\Components\Shared\test\AutoRenderComponent.cs (2)
33var exception = t.Exception.Flatten().InnerException; 36exception = e.InnerException;
Microsoft.AspNetCore.Components.Forms.Tests (4)
src\Components\Shared\test\AutoRenderComponent.cs (2)
33var exception = t.Exception.Flatten().InnerException; 36exception = e.InnerException;
src\Components\Shared\test\TestRenderer.cs (2)
85var exception = task.Exception.Flatten().InnerException; 88exception = e.InnerException;
Microsoft.AspNetCore.Components.Server.Tests (1)
ProtectedBrowserStorageTest.cs (1)
232var innerException = ex.InnerException;
Microsoft.AspNetCore.Components.Tests (10)
ParameterViewTest.Assignment.cs (2)
518$"type '{typeof(HasInstanceProperties).FullName}'. The error was: {ex.InnerException.Message}", 539$"type '{typeof(HasPropertyWhoseSetterThrows).FullName}'. The error was: {ex.InnerException.Message}",
RendererTest.cs (2)
5211var exception = t.Exception.Flatten().InnerException; 5214exception = e.InnerException;
Routing\RouteTableFactoryTests.cs (2)
1146catch (InvalidOperationException ex) when (ex.InnerException is InvalidOperationException) 1149throw ex.InnerException;
src\Components\Shared\test\AutoRenderComponent.cs (2)
33var exception = t.Exception.Flatten().InnerException; 36exception = e.InnerException;
src\Components\Shared\test\TestRenderer.cs (2)
85var exception = task.Exception.Flatten().InnerException; 88exception = e.InnerException;
Microsoft.AspNetCore.Components.Web (1)
HtmlRendering\StaticHtmlRenderer.cs (1)
75ExceptionDispatchInfo.Capture(quiescenceTask.Exception.InnerException ?? quiescenceTask.Exception).Throw();
Microsoft.AspNetCore.Components.Web.Tests (4)
src\Components\Shared\test\AutoRenderComponent.cs (2)
33var exception = t.Exception.Flatten().InnerException; 36exception = e.InnerException;
src\Components\Shared\test\TestRenderer.cs (2)
85var exception = task.Exception.Flatten().InnerException; 88exception = e.InnerException;
Microsoft.AspNetCore.DataProtection.Abstractions.Tests (2)
DataProtectionCommonExtensionsTests.cs (2)
254Assert.IsAssignableFrom<EncoderFallbackException>(ex.InnerException); 296Assert.IsAssignableFrom<DecoderFallbackException>(ex.InnerException);
Microsoft.AspNetCore.DataProtection.Extensions.Tests (1)
TimeLimitedDataProtectorTests.cs (1)
148Assert.Equal("How exceptional!", ex.InnerException.Message);
Microsoft.AspNetCore.DataProtection.Tests (1)
KeyManagement\KeyRingBasedDataProtectorTests.cs (1)
123Assert.IsAssignableFrom<MockException>(ex.InnerException);
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (1)
86ex = ex.InnerException;
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (3)
DatabaseDeveloperPageExceptionFilter.cs (1)
48?? errorContext.Exception?.InnerException as DbException;
DatabaseErrorPageMiddleware.cs (1)
137for (var e = exception; e != null && !match; e = e.InnerException)
Views\DatabaseErrorPage.Designer.cs (1)
151for (Exception? ex = Model.Exception; ex != null; ex = ex.InnerException)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Logging\AcceptanceTests.cs (4)
695var originalException = ex.InnerException?.InnerException; 729var originalException = ex.InnerException?.InnerException;
Microsoft.AspNetCore.Diagnostics.Tests (3)
ExceptionHandlerTest.cs (3)
568Assert.NotNull(exception.InnerException); 569Assert.IsType<ApplicationException>(exception.InnerException); 570Assert.Equal("Something bad happened.", exception.InnerException.Message);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\CommonGrpcProtocolHelpers.cs (2)
14return ex.InnerException == null ? $"{ex.GetType().Name}: {ex.Message}" : BuildErrorMessage(ex); 37while ((current = current.InnerException) != null);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (30)
HttpRoutePatternParserTests.cs (1)
323Assert.Equal(errorMessage, ex.InnerException!.Message);
JsonTranscodingServiceMethodProviderTests.cs (29)
170Assert.Equal("Error binding BadResponseBody on JsonTranscodingInvalidResponseBodyGreeterService to HTTP API.", ex.InnerException!.InnerException!.Message); 171Assert.Equal("Couldn't find matching field for response body 'NoMatch' on HelloReply.", ex.InnerException!.InnerException!.InnerException!.Message); 182Assert.Equal("Error binding BadResponseBody on JsonTranscodingInvalidNestedResponseBodyGreeterService to HTTP API.", ex.InnerException!.InnerException!.Message); 183Assert.Equal("The response body field 'sub.subfield' references a nested field. The response body field name must be on the top-level response message.", ex.InnerException!.InnerException!.InnerException!.Message); 194Assert.Equal("Error binding BadBody on JsonTranscodingInvalidBodyGreeterService to HTTP API.", ex.InnerException!.InnerException!.Message); 195Assert.Equal("Couldn't find matching field for body 'NoMatch' on HelloRequest.", ex.InnerException!.InnerException!.InnerException!.Message); 206Assert.Equal("Error binding BadBody on JsonTranscodingInvalidNestedBodyGreeterService to HTTP API.", ex.InnerException!.InnerException!.Message); 207Assert.Equal("The body field 'sub.subfield' references a nested field. The body field name must be on the top-level request message.", ex.InnerException!.InnerException!.InnerException!.Message); 218Assert.Equal("Error binding BadPattern on JsonTranscodingInvalidPatternGreeterService to HTTP API.", ex.InnerException!.InnerException!.Message); 219Assert.Equal("Error parsing path template 'v1/greeter/{name}'.", ex.InnerException!.InnerException!.InnerException!.Message); 220Assert.Equal("Path template must start with a '/'.", ex.InnerException!.InnerException!.InnerException!.InnerException!.Message);
Microsoft.AspNetCore.Hosting (4)
Internal\ErrorPageBuilder.cs (1)
22exception = tae.InnerException!;
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (1)
86ex = ex.InnerException;
Startup\ConventionBasedStartup.cs (2)
28ExceptionDispatchInfo.Capture(ex.InnerException!).Throw(); 41ExceptionDispatchInfo.Capture(ex.InnerException!).Throw();
Microsoft.AspNetCore.Hosting.Tests (3)
ConfigureBuilderTests.cs (3)
33Assert.NotNull(ex.InnerException); 34Assert.Equal("Service instantiation failed", ex.InnerException.Message); 35Assert.Contains(nameof(CrasherService), ex.InnerException.StackTrace);
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionContext.cs (2)
341Transport?.Output.Complete(applicationTask.Exception?.InnerException); 366Application?.Output.Complete(transportTask.Exception?.InnerException);
Internal\HttpConnectionManager.cs (1)
213catch (WebSocketException ex) when (ex.InnerException is IOException)
Microsoft.AspNetCore.Http.Connections.Client (2)
Internal\LongPollingTransport.cs (1)
98_error = sending.IsFaulted ? sending.Exception!.InnerException : null;
Internal\ServerSentEventsTransport.cs (1)
115_error = sending.IsFaulted ? sending.Exception!.InnerException : null;
Microsoft.AspNetCore.Http.Connections.Tests (2)
NegotiateProtocolTests.cs (2)
64Assert.Equal(expectedMessage, exception.InnerException.Message); 84Assert.Equal("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.", exception.InnerException.Message);
Microsoft.AspNetCore.Http.Extensions.Tests (5)
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (1)
1018Assert.IsType<InvalidDataException>(badHttpRequestException.InnerException);
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (2)
576Assert.Same(jsonException, badHttpRequestException.InnerException); 655Assert.IsType<JsonException>(badHttpRequestException.InnerException);
ValidationsGenerator\ValidationsGeneratorTestBase.cs (2)
432catch (TargetInvocationException tie) when (tie.InnerException.GetType().Name == "HostAbortedException") 438exception = tie.InnerException ?? tie;
Microsoft.AspNetCore.InternalTesting (1)
ExceptionAssertions.cs (1)
248exception = tie.InnerException;
Microsoft.AspNetCore.Mvc.Core (14)
ModelBinding\Binders\ComplexObjectModelBinder.cs (2)
720if (targetInvocationException?.InnerException != null) 722exception = targetInvocationException.InnerException;
ModelBinding\Binders\ComplexTypeModelBinder.cs (2)
558if (targetInvocationException?.InnerException != null) 560exception = targetInvocationException.InnerException;
ModelBinding\Binders\DecimalModelBinder.cs (2)
95if (!isFormatException && exception.InnerException != null) 99exception = ExceptionDispatchInfo.Capture(exception.InnerException).SourceException;
ModelBinding\Binders\DoubleModelBinder.cs (2)
95if (!isFormatException && exception.InnerException != null) 99exception = ExceptionDispatchInfo.Capture(exception.InnerException).SourceException;
ModelBinding\Binders\FloatModelBinder.cs (2)
95if (!isFormatException && exception.InnerException != null) 99exception = ExceptionDispatchInfo.Capture(exception.InnerException).SourceException;
ModelBinding\Binders\SimpleTypeModelBinder.cs (2)
90if (!isFormatException && exception.InnerException != null) 94exception = ExceptionDispatchInfo.Capture(exception.InnerException).SourceException;
ModelBinding\ModelBindingHelper.cs (2)
730if (ex.InnerException == null) 738ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
Microsoft.AspNetCore.Mvc.Core.Test (10)
Filters\MiddlewareFilterBuilderTest.cs (2)
215Assert.Null(exception.InnerException); 283Assert.Null(exception.InnerException);
Infrastructure\JsonResultExecutorTestBase.cs (1)
223var expectedException = Assert.IsType<NotImplementedException>(serializerException.InnerException);
ModelBinding\FormFileValueProviderFactoryTest.cs (2)
71Assert.Same(exception, ex.InnerException); 85Assert.Same(exception, ex.InnerException);
ModelBinding\FormValueProviderFactoryTest.cs (2)
59Assert.Same(exception, ex.InnerException); 73Assert.Same(exception, ex.InnerException);
ModelBinding\JQueryFormValueProviderFactoryTest.cs (2)
144Assert.Same(exception, ex.InnerException); 158Assert.Same(exception, ex.InnerException);
Routing\AttributeRouteTest.cs (1)
537Assert.IsType<RouteCreationException>(exception.InnerException);
Microsoft.AspNetCore.Mvc.Formatters.Xml (8)
XmlSerializerInputFormatter.cs (8)
145catch (InvalidOperationException exception) when (exception.InnerException != null && 146exception.InnerException.InnerException == null && 147string.Equals("Microsoft.GeneratedCode", exception.InnerException.Source, StringComparison.InvariantCulture)) 152throw new InputFormatterException(Resources.ErrorDeserializingInputData, exception.InnerException); 154catch (InvalidOperationException exception) when (exception.InnerException is FormatException || 155exception.InnerException is XmlException) 157throw new InputFormatterException(Resources.ErrorDeserializingInputData, exception.InnerException);
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
TagHelpersTest.cs (2)
81Assert.Equal("Should be visible", exception.InnerException.InnerException.Message);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
src\Mvc\Mvc.Core\test\Infrastructure\JsonResultExecutorTestBase.cs (1)
223var expectedException = Assert.IsType<NotImplementedException>(serializerException.InnerException);
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") 255exception = tie.InnerException ?? tie;
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
DefaultHtmlGenerator.cs (1)
1390when (exception is FormatException || exception.InnerException is FormatException)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (2)
SnapshotTestHelper.cs (2)
440catch (TargetInvocationException tie) when (tie.InnerException.GetType().Name == "HostAbortedException") 446exception = tie.InnerException ?? tie;
Microsoft.AspNetCore.Routing.Tests (12)
DefaultParameterPolicyFactoryTest.cs (1)
376var inner = Assert.IsType<InvalidOperationException>(exception.InnerException);
Matching\DataSourceDependentMatcherTest.cs (1)
233Assert.Equal(expectedError, exception.InnerException.Message);
RouteTest.cs (4)
44Assert.NotNull(exception.InnerException); 48Assert.Equal(expected, exception.InnerException.Message); 1622Assert.NotNull(exception.InnerException); 1623Assert.Equal(expectedMessage, exception.InnerException.Message);
TemplateParserDefaultValuesTests.cs (6)
70Assert.NotNull(ex.InnerException); 74Assert.Equal(message, ex.InnerException.Message); 95Assert.NotNull(ex.InnerException); 97Assert.Equal(message, ex.InnerException.Message); 121Assert.NotNull(ex.InnerException); 123Assert.Equal(message, ex.InnerException.Message);
Microsoft.AspNetCore.Server.HttpSys (2)
ValidationHelper.cs (2)
16if (exception.InnerException == null) 20return exception.Message + " (" + ExceptionMessage(exception.InnerException) + ")";
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (8)
Http3Tests.cs (8)
177var qex = Assert.IsType<QuicException>(ex.InnerException); 210var qex = Assert.IsType<QuicException>(ex.InnerException?.InnerException?.InnerException); 236var qex = Assert.IsType<QuicException>(ex.InnerException?.InnerException?.InnerException); 257var qex = Assert.IsType<QuicException>(ex.InnerException);
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\StackTrace\ExceptionDetails\ExceptionDetailsProvider.cs (1)
86ex = ex.InnerException;
Microsoft.AspNetCore.Server.Kestrel.Core (4)
Internal\Http3\Http3Connection.cs (2)
176if (ex.InnerException is not null) 178session.Value.Abort(new ConnectionAbortedException(ex.Message, ex.InnerException), errorCode);
Internal\WebTransport\WebTransportSession.cs (2)
107if (exception.InnerException is not null) 109stream.Value.Abort(new ConnectionAbortedException(exception.Message, exception.InnerException));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
MessageBodyTests.cs (1)
380Assert.IsType<OverflowException>(ex.InnerException);
src\Shared\test\Shared.Tests\runtime\Http2\HPackDecoderTest.cs (1)
903Assert.IsType<HuffmanDecodingException>(exception.InnerException);
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
683Assert.IsAssignableFrom<CryptographicException>(ex.InnerException);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
QuicConnectionContextTests.cs (1)
139var innerEx = Assert.IsType<QuicException>(ex.InnerException);
Microsoft.AspNetCore.Shared.Tests (5)
ObjectMethodExecutorTest.cs (4)
373Assert.IsType<InvalidOperationException>(exception.InnerException); 374Assert.Equal("Test exception", exception.InnerException.Message); 406Assert.IsType<InvalidOperationException>(exception.InnerException); 407Assert.Equal("Test exception", exception.InnerException.Message);
runtime\Http2\HPackDecoderTest.cs (1)
903Assert.IsType<HuffmanDecodingException>(exception.InnerException);
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HttpConnectionTests.ConnectionLifecycle.cs (1)
450var innerInnerEx = innerEx.InnerException;
Microsoft.AspNetCore.SignalR.Core (2)
Internal\DefaultHubDispatcher.cs (2)
468ErrorMessageHelper.BuildErrorMessage($"An unexpected error occurred invoking '{hubMethodInvocationMessage.Target}' on the server.", ex.InnerException ?? ex, _enableDetailedErrors)); 571var exception = ex.InnerException ?? ex;
Microsoft.AspNetCore.SignalR.Tests (1)
HubConnectionHandlerTestUtils\Hubs.cs (1)
934catch (ChannelClosedException ex) when (ex.InnerException == null)
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") 255exception = tie.InnerException ?? tie;
Microsoft.AspNetCore.TestHost.Tests (4)
HttpContextBuilderTests.cs (1)
301Assert.IsAssignableFrom<InvalidOperationException>(ex.InnerException);
ResponseBodyTests.cs (2)
98var ex = (InvalidOperationException)requestException?.InnerException?.InnerException;
TestClientTests.cs (1)
446Assert.Equal("An error occurred when completing the request. Request delegate may have finished while there is a pending read of the request body.", ex.InnerException.Message);
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (4)
2607Assert.IsType<InvalidOperationException>(ex.InnerException.InnerException); 2610ex.InnerException.InnerException.Message);
Microsoft.AspNetCore.WebUtilities.Tests (1)
FormPipeReaderTests.cs (1)
86Assert.IsType<InvalidOperationException>(exception.InnerException);
Microsoft.Build (25)
BackEnd\Components\ProjectCache\ProjectCacheService.cs (2)
345catch (TargetInvocationException e) when (e.InnerException != null) 347HandlePluginException(e.InnerException, "Constructor");
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
922exceptionToLog = exceptionToLog.InnerException;
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (2)
293string message = e.InnerException?.Message ?? e.Message; 295ProjectFileErrorUtilities.ThrowInvalidProjectFile(new BuildEventFileInfo(location), e.InnerException ?? e, "CouldNotLoadSdkResolver", type.Name, message);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (4)
504e.InnerException, 515e.InnerException?.Message); 988Environment.NewLine + e.InnerException); 1356e.InnerException,
BuildEnvironmentHelper.cs (2)
54if (e.InnerException != null) 58throw e.InnerException;
Evaluation\Evaluator.cs (2)
2313if (ex.InnerException != null) 2317importFileUnescaped, ex.InnerException.Message);
Evaluation\Expander.cs (1)
3679ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "InvalidFunctionPropertyExpression", partiallyEvaluated, ex.InnerException.Message.Replace("\r\n", " "));
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
285ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskLoadFailure", taskName, loadInfo.AssemblyLocation, Environment.NewLine + e.InnerException.ToString()); 436ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskLoadFailure", taskName, _loadedType.Assembly.AssemblyLocation, Environment.NewLine + e.InnerException.ToString());
Instance\TaskRegistry.cs (1)
1527ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskFactoryLoadFailure", TaskFactoryAttributeName, taskFactoryLoadInfo.AssemblyLocation, Environment.NewLine + e.InnerException.ToString());
Logging\FileLogger.cs (3)
129throw new LoggerException(message, e.InnerException, errorCode, helpKeyword); 158throw new LoggerException(message, ex.InnerException, errorCode, helpKeyword); 225throw new LoggerException(ex.Message, ex.InnerException, "MSB4128", null);
Logging\LoggerDescription.cs (2)
226throw new LoggerException(message, e.InnerException); 228catch (TargetInvocationException e) when (e.InnerException is LoggerException le)
TaskLoggingHelper.cs (3)
533while (excep.InnerException != null) 535excep = excep.InnerException; 969exception = exception.InnerException;
Microsoft.Build.Engine.OM.UnitTests (2)
BuildEnvironmentHelper.cs (2)
54if (e.InnerException != null) 58throw e.InnerException;
Microsoft.Build.Engine.UnitTests (15)
BackEnd\BinaryTranslator_Tests.cs (1)
202value = value.InnerException;
BackEnd\SdkResolverLoader_Tests.cs (3)
144Exception innerException = exception.InnerException.ShouldBeOfType<Exception>(); 176exception.InnerException.ShouldBeOfType<MissingMethodException>(); 207Exception innerException = exception.InnerException.ShouldBeOfType<Exception>();
BackEnd\TranslationHelpers.cs (2)
114if (!CompareExceptions(left.InnerException, right.InnerException, out diffReason, detailed))
ProjectCache\ProjectCacheTests.cs (9)
1146buildResult.Exception.InnerException!.ShouldNotBeNull(); 1147buildResult.Exception.InnerException!.Message.ShouldContain("Cache plugin exception from"); 1151buildResult.Exception.InnerException.ShouldBeNull(); 1183e.InnerException!.ShouldNotBeNull(); 1184e.InnerException!.Message.ShouldContain("Cache plugin exception from EndBuildAsync"); 1188e.InnerException.ShouldBeNull(); 1280buildResult.Exception.InnerException!.ShouldNotBeNull(); 1281buildResult.Exception.InnerException!.Message.ShouldContain("Cache plugin exception from"); 1350Should.Throw<ProjectCacheException>(() => buildSession.Dispose()).InnerException!.Message.ShouldContain("Cache plugin exception from EndBuildAsync");
Microsoft.Build.Framework (3)
BuildException\BuildExceptionBase.cs (3)
76writer.Write(exception.InnerException != null); 77if (exception.InnerException != null) 79WriteExceptionToTranslator(translator, exception.InnerException);
Microsoft.Build.Tasks.CodeAnalysis (4)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (2)
69Exception? e = exception.InnerException; 74e = e.InnerException;
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Microsoft.Build.Tasks.Core (10)
AssemblyDependency\BadImageReferenceException.cs (2)
39public override string Message => (InnerException == null) ? base.Message : $"{base.Message} {InnerException.Message}";
BuildEnvironmentHelper.cs (2)
54if (e.InnerException != null) 58throw e.InnerException;
DownloadFile.cs (4)
244if (actualException is AggregateException aggregateException && aggregateException.InnerException != null) 246actualException = aggregateException.InnerException; 252if (httpRequestException.InnerException != null) 254actualException = httpRequestException.InnerException;
GenerateResource.cs (2)
2599"General.InvalidResxFile", msbuildResXException.InnerException.ToString()); 2604if (ae.InnerException is XmlException xe)
Microsoft.Build.Utilities.Core (5)
BuildEnvironmentHelper.cs (2)
54if (e.InnerException != null) 58throw e.InnerException;
TaskLoggingHelper.cs (3)
533while (excep.InnerException != null) 535excep = excep.InnerException; 969exception = exception.InnerException;
Microsoft.CodeAnalysis (19)
Compilation\Compilation.cs (3)
3313diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PeWritingFailure, Location.None, e.InnerException?.ToString() ?? "")); 3318diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_CantReadResource, Location.None, e.Message, e.InnerException?.Message ?? "")); 3490diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PeWritingFailure, Location.None, e.InnerException?.ToString() ?? ""));
Compilation\SourceReferenceResolver.cs (1)
46/// <exception cref="IOException">Error reading file <paramref name="resolvedPath"/>. See <see cref="Exception.InnerException"/> for details.</exception>
Compilation\XmlReferenceResolver.cs (1)
36/// <exception cref="IOException">Error reading file <paramref name="resolvedPath"/>. See <see cref="Exception.InnerException"/> for details.</exception>
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
719var innerException = faultedTask.Exception?.InnerException;
InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
MetadataReference\AssemblyMetadata.cs (5)
160/// <exception cref="IOException">Error reading file <paramref name="path"/>. See <see cref="Exception.InnerException"/> for details.</exception> 277/// <exception cref="IOException">IO error reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception> 303/// <exception cref="IOException">IO error while reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception> 311/// <exception cref="IOException">IO error while reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception> 406/// <exception cref="IOException">IO error reading the metadata. See <see cref="Exception.InnerException"/> for details.</exception>
MetadataReference\ModuleMetadata.cs (1)
257/// <exception cref="IOException">Error opening file <paramref name="path"/>. See <see cref="Exception.InnerException"/> for details.</exception>
NativePdbWriter\PdbWriter.cs (2)
548catch (SymUnmanagedWriterException e) when (e.InnerException is NotSupportedException) 765catch (SymUnmanagedWriterException e) when (e.InnerException is NotSupportedException)
SourceGeneration\UserFunction.cs (1)
16public new Exception InnerException => base.InnerException!;
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (1)
28return string.Join(s_separator, GetExceptionMessage(exception), CreateDiagnosticDescription(exception.InnerException));
Microsoft.CodeAnalysis.CodeStyle (6)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
71catch (AggregateException ex) when (ex.InnerException is not null) 79ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
56ExceptionDispatchInfo.Capture(ex.InnerException ?? ex).Throw();
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (5)
InteractiveSessionReferencesTests.cs (5)
765catch (FileLoadException fileLoadEx) when (fileLoadEx.InnerException is InteractiveAssemblyLoaderException) 833catch (FileLoadException fileLoadEx) when (fileLoadEx.InnerException is InteractiveAssemblyLoaderException) 901catch (FileLoadException fileLoadEx) when (fileLoadEx.InnerException is InteractiveAssemblyLoaderException) 969catch (FileLoadException fileLoadEx) when (fileLoadEx.InnerException is InteractiveAssemblyLoaderException) 1037catch (FileLoadException fileLoadEx) when (fileLoadEx.InnerException is InteractiveAssemblyLoaderException)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\GeneratorDriverTests.cs (1)
1709Assert.IsType<InvalidOperationException>(e.InnerException);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1663var e = x.InnerException;
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (3)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (5)
Debugger\Engine\DkmClrValue.cs (2)
479var exception = e.InnerException; 506var exception = e.InnerException;
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Microsoft.CodeAnalysis.Features (2)
SemanticSearch\QueryExecutionContext.cs (1)
180if (e is TargetInvocationException { InnerException: { } innerException })
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (1)
28return string.Join(s_separator, GetExceptionMessage(exception), CreateDiagnosticDescription(exception.InnerException));
Microsoft.CodeAnalysis.InteractiveHost (4)
Interactive\Core\InteractiveHost.Service.cs (2)
393if (e is FileLoadException && e.InnerException is InteractiveAssemblyLoaderException) 395Console.Error.WriteLine(e.InnerException.Message);
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
56ExceptionDispatchInfo.Capture(ex.InnerException ?? ex).Throw();
Microsoft.CodeAnalysis.LanguageServer (1)
Logging\RoslynLogger.cs (1)
61if (exception is OperationCanceledException { InnerException: { } oceInnerException })
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (1)
113if (exception is OperationCanceledException { InnerException: { } oceInnerException })
Microsoft.CodeAnalysis.Scripting (5)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (2)
229/// <exception cref="IOException">Error reading file <paramref name="fullPath"/>. See <see cref="Exception.InnerException"/> for details.</exception> 287/// <exception cref="IOException">Error reading file <paramref name="fullPath"/>. See <see cref="Exception.InnerException"/> for details.</exception>
Hosting\CommandLine\CommandLineRunner.cs (2)
350if (e is FileLoadException && e.InnerException is InteractiveAssemblyLoaderException) 352Console.Error.WriteLine(e.InnerException.Message);
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (1)
270exception = e.InnerException;
Microsoft.CodeAnalysis.UnitTests (6)
AnalyzerAssemblyLoaderTests.cs (1)
382Assert.IsAssignableFrom<FileNotFoundException>(exception.InnerException);
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (1)
263Assert.IsType<ArgumentNullException>(tie.InnerException);
Collections\ImmutableSegmentedDictionaryTest.cs (1)
263Assert.IsType<ArgumentNullException>(tie.InnerException);
Collections\ImmutableSegmentedHashSetTest.cs (1)
199Assert.IsType<ArgumentNullException>(tie.InnerException);
Collections\ImmutableSegmentedListBuilderTest.cs (1)
373Assert.IsType<ArgumentNullException>(tie.InnerException);
Collections\ImmutableSegmentedListTest.cs (1)
788Assert.IsType<ArgumentNullException>(tie.InnerException);
Microsoft.CodeAnalysis.Workspaces (6)
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
71catch (AggregateException ex) when (ex.InnerException is not null) 77ExceptionDispatchInfo.Throw(ex.InnerException);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs (1)
56ExceptionDispatchInfo.Capture(ex.InnerException ?? ex).Throw();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (4)
Rpc\RpcServer.cs (1)
164e = e.InnerException ?? e;
src\Compilers\Core\Portable\InternalUtilities\FailFast.cs (1)
72for (Exception? current = exception; current is object; current = current.InnerException)
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
131Debug.Assert(e.InnerException is object); 132ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
src\Workspaces\MSBuild\BuildHost\Rpc\RpcServer.cs (1)
164e = e.InnerException ?? e;
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\AsyncLazyTests.cs (1)
218var operationCancelledException = (OperationCanceledException)ex.Flatten().InnerException!;
Microsoft.DotNet.Arcade.Sdk (2)
src\DownloadFile.cs (2)
165if (e.InnerException is OperationCanceledException) 171throw e.InnerException;
Microsoft.DotNet.Build.Tasks.Installers (1)
src\ExecWithRetries.cs (1)
107catch (AggregateException e) when (e.InnerException is TaskCanceledException)
Microsoft.DotNet.RemoteExecutor (3)
Program.cs (3)
75catch (Exception exc) when (exc is not (TargetInvocationException { InnerException: AccessViolationException } or AccessViolationException)) 77if (exc is TargetInvocationException && exc.InnerException != null) 78exc = exc.InnerException;
Microsoft.DotNet.XUnitAssert.Tests (53)
AsyncCollectionAssertsTests.cs (6)
151 Assert.Null(collEx.InnerException); 222 Assert.Null(collEx.InnerException); 884 Assert.IsType<DivideByZeroException>(ex.InnerException); 1037 Assert.IsType<DivideByZeroException>(ex.InnerException); 1243 Assert.IsType<DivideByZeroException>(ex.InnerException); 1370 Assert.IsType<DivideByZeroException>(ex.InnerException);
CollectionAssertsTests.cs (6)
149 Assert.Null(collEx.InnerException); 222 Assert.Null(collEx.InnerException); 1118 Assert.IsType<DivideByZeroException>(ex.InnerException); 1245 Assert.IsType<DivideByZeroException>(ex.InnerException); 1818 Assert.IsType<DivideByZeroException>(ex.InnerException); 1920 Assert.IsType<DivideByZeroException>(ex.InnerException);
EqualityAssertsTests.cs (10)
115 Assert.IsType<DivideByZeroException>(ex.InnerException); 138 Assert.IsType<DivideByZeroException>(ex.InnerException); 190 Assert.IsType<DivideByZeroException>(ex.InnerException); 211 Assert.IsType<DivideByZeroException>(ex.InnerException); 2399 Assert.IsType<DivideByZeroException>(ex.InnerException); 2422 Assert.IsType<DivideByZeroException>(ex.InnerException); 2445 Assert.IsType<DivideByZeroException>(ex.InnerException); 2497 Assert.IsType<DivideByZeroException>(ex.InnerException); 2518 Assert.IsType<DivideByZeroException>(ex.InnerException); 2533 Assert.IsType<DivideByZeroException>(ex.InnerException);
EquivalenceAssertsTests.cs (1)
1486 Assert.IsType<ArgumentException>(ex.InnerException); // Thrown by DateTime.CompareTo
ExceptionAssertsTests.cs (30)
35 Assert.Null(ex.InnerException); 61 Assert.Same(thrown, ex.InnerException); 79 Assert.Same(thrown, ex.InnerException); 118 Assert.Null(ex.InnerException); 144 Assert.Same(thrown, ex.InnerException); 162 Assert.Same(thrown, ex.InnerException); 191 Assert.Null(ex.InnerException); 217 Assert.Same(thrown, ex.InnerException); 235 Assert.Same(thrown, ex.InnerException); 271 Assert.Null(ex.InnerException); 297 Assert.Same(thrown, ex.InnerException); 315 Assert.Same(thrown, ex.InnerException); 343 Assert.Null(ex.InnerException); 386 Assert.Same(thrown, ex.InnerException); 404 Assert.Same(thrown, ex.InnerException); 429 Assert.Null(ex.InnerException); 472 Assert.Same(thrown, ex.InnerException); 490 Assert.Same(thrown, ex.InnerException); 518 Assert.Null(ex.InnerException); 544 Assert.Same(thrown, ex.InnerException); 588 Assert.Null(ex.InnerException); 614 Assert.Same(thrown, ex.InnerException); 648 Assert.Null(ex.InnerException); 674 Assert.Same(thrown, ex.InnerException); 707 Assert.Null(ex.InnerException); 733 Assert.Same(thrown, ex.InnerException); 751 Assert.Same(thrown, ex.InnerException); 776 Assert.Null(ex.InnerException); 819 Assert.Same(thrown, ex.InnerException); 837 Assert.Same(thrown, ex.InnerException);
Microsoft.DotNet.XUnitExtensions (1)
src\Microsoft.DotNet.XUnitExtensions.Shared\XunitParallelTheoryTestCaseRunner.cs (1)
178ex = tiex.InnerException;
Microsoft.Extensions.AI (2)
Functions\AIFunctionFactory.Utilities.cs (2)
48catch (TargetInvocationException e) when (e.InnerException is not null) 53System.Runtime.ExceptionServices.ExceptionDispatchInfo.Capture(e.InnerException).Throw();
Microsoft.Extensions.AI.Abstractions.Tests (1)
Contents\FunctionCallContentTests..cs (1)
312Assert.Same(exc, content.Exception.InnerException);
Microsoft.Extensions.Diagnostics.ExceptionSummarization (5)
ExceptionSummarizer.cs (5)
51if (exception.InnerException != null) 53var innerExceptionType = exception.InnerException.GetType(); 57exception.InnerException, 65var exceptionDescription = exception.InnerException != null 66? exception.InnerException.GetType().Name
Microsoft.Extensions.Http.Resilience (1)
Polly\HttpClientResiliencePredicates.cs (1)
55&& outcome.Exception is OperationCanceledException { Source: "System.Private.CoreLib", InnerException: TimeoutException };
Microsoft.Extensions.Telemetry (2)
Logging\ExtendedLogger.cs (2)
215else if (exception.InnerException != null) 217HandleException(exception.InnerException, indent + IndentAmount);
Microsoft.JSInterop (3)
Infrastructure\DotNetDispatcher.cs (3)
195if (tie.InnerException != null) 197ExceptionDispatchInfo.Capture(tie.InnerException).Throw(); 198throw tie.InnerException; // Unreachable
Microsoft.JSInterop.Tests (2)
JSRuntimeTest.cs (2)
202var jsException = Assert.IsType<JSException>(exception.InnerException); 232Assert.IsAssignableFrom<JsonException>(jsException.InnerException);
Microsoft.Maui.Controls (4)
BindingExpression.cs (4)
731 if (ex.InnerException is KeyNotFoundException || ex.InnerException is IndexOutOfRangeException || ex.InnerException is ArgumentOutOfRangeException) 737 throw ex.InnerException;
Microsoft.Maui.Controls.Build.Tasks (4)
NodeILExtensions.cs (4)
170 catch (System.Reflection.TargetInvocationException tie) when (tie.InnerException is XamlParseException) 172 throw tie.InnerException; 174 catch (System.Reflection.TargetInvocationException tie) when (tie.InnerException is BuildException) 176 throw tie.InnerException;
Microsoft.Maui.Controls.Xaml (3)
CreateValuesVisitor.cs (3)
115 catch (TargetInvocationException e) when (e.InnerException is XamlParseException || e.InnerException is XmlException) 117 throw e.InnerException;
Microsoft.ML.AutoML (4)
API\BinaryClassificationExperiment.cs (1)
462throw new OperationCanceledException(ex.Message, ex.InnerException);
API\MulticlassClassificationExperiment.cs (1)
440throw new OperationCanceledException(ex.Message, ex.InnerException);
API\RegressionExperiment.cs (1)
455throw new OperationCanceledException(ex.Message, ex.InnerException);
AutoMLExperiment\Runner\SweepablePipelineRunner.cs (1)
108throw new OperationCanceledException(ex.Message, ex.InnerException);
Microsoft.ML.Core (2)
ComponentModel\ComponentCatalog.cs (2)
251if (ex.InnerException != null && ex.InnerException.IsMarked())
Microsoft.ML.Maml (5)
MAML.cs (5)
163for (var e = ex; e != null; e = e.InnerException) 235/// <see cref="Exception.InnerException"/> chain. 245for (var e = ex; e != null; e = e.InnerException) 256/// <see cref="Exception.InnerException"/> chain. 263for (var e = ex; e != null; e = e.InnerException)
Microsoft.ML.TestFramework (2)
DataPipe\TestDataPipeBase.cs (2)
52for (e = ex; e.InnerException != null; e = e.InnerException)
Microsoft.ML.Tests (7)
DatabaseLoaderTests.cs (1)
47Assert.Contains("Timeout", ex.InnerException.Message);
Scenarios\GetColumnTests.cs (2)
107for (e = ex; e.InnerException != null; e = e.InnerException)
SvmLightTests.cs (4)
247Assert.Contains("Duplicate keys found in dataset", ex.InnerException.Message); 362Assert.Contains("Encountered 0 index while parsing a 1-based dataset", ex.InnerException.Message); 381Assert.Contains("Encountered non-parsable index '-1' while parsing dataset", ex.InnerException.Message); 400Assert.Contains("Encountered non-parsable index 'a' while parsing dataset", ex.InnerException.Message);
Microsoft.VisualBasic.Core (13)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (2)
1465Throw ie.InnerException 1492Throw ie.InnerException
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (9)
176Throw ex.InnerException 202(TypeOf ex.InnerException Is COMException AndAlso 203CType(ex.InnerException, COMException).ErrorCode = DISP_E_NOTACOLLECTION) Then 463If ex.InnerException Is Nothing Then 465ElseIf TypeOf ex.InnerException Is TargetParameterCountException Then 474Throw ex.InnerException 651Throw ex.InnerException 898Throw ex.InnerException 1047Throw ex.InnerException
Microsoft\VisualBasic\CompilerServices\Symbols.vb (2)
1287Catch ex As TargetInvocationException When ex.InnerException IsNot Nothing 1289Throw ex.InnerException
Microsoft.VisualBasic.Forms.Tests (6)
System\Windows\Forms\ApplicationServicesExceptionsTests.vb (6)
25ex.InnerException.Should.Be(Nothing) 29ex.InnerException.Should.Be(Nothing) 33ex.InnerException.Should.BeOfType(Of DirectoryNotFoundException)() 42ex.InnerException.Should.Be(Nothing) 46ex.InnerException.Should.Be(Nothing) 50ex.InnerException.Should.BeOfType(Of DirectoryNotFoundException)()
Microsoft.VisualStudio.LanguageServices (4)
Diagnostics\VisualStudioDiagnosticAnalyzerProvider.cs (1)
106catch (TargetInvocationException ex) when (ex.InnerException is InvalidOperationException)
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (2)
53var innerException = exception.InnerException; 61innerException = innerException.InnerException;
Watson\FaultReporter.cs (1)
113if (exception is OperationCanceledException { InnerException: { } oceInnerException })
MSBuild (20)
BuildEnvironmentHelper.cs (2)
54if (e.InnerException != null) 58throw e.InnerException;
OutOfProcTaskAppDomainWrapperBase.cs (3)
122Exception exceptionToReturn = e is TargetInvocationException ? e.InnerException : e; 314exceptionToReturn = e.InnerException; 336e is TargetInvocationException ? e.InnerException : e,
XMake.cs (15)
163catch (TypeInitializationException ex) when (ex.InnerException is not null 210exception = exception.InnerException; 991if (e.InnerException != null) 995Console.WriteLine(e.InnerException.ToString()); 1012Console.WriteLine(e.InnerException.ToString()); 1019$"MSBUILD : error {e.ErrorCode}: {e.Message}{(e.InnerException != null ? $" {e.InnerException.Message}" : "")}"); 1028if (!e.HasBeenLoggedByProjectCache && e.InnerException != null) 1034if (e.InnerException is not null) 1036Console.WriteLine(e.InnerException.ToString()); 1044$"MSBUILD : error {e.ErrorCode}: {e.Message}{(e.InnerException != null ? $" {e.InnerException.Message}" : string.Empty)}"); 1051$"{e.Message}{(e.InnerException != null ? $" {e.InnerException.Message}" : string.Empty)}"); 4443InitializationException.Throw("LoggerFatalError", unquotedParameter, e.InnerException, true);
MSBuildTaskHost (8)
BuildEnvironmentHelper.cs (2)
54if (e.InnerException != null) 58throw e.InnerException;
BuildExceptionBase.cs (3)
76writer.Write(exception.InnerException != null); 77if (exception.InnerException != null) 79WriteExceptionToTranslator(translator, exception.InnerException);
OutOfProcTaskAppDomainWrapperBase.cs (3)
122Exception exceptionToReturn = e is TargetInvocationException ? e.InnerException : e; 314exceptionToReturn = e.InnerException; 336e is TargetInvocationException ? e.InnerException : e,
PresentationBuildTasks (12)
MS\Internal\Tasks\CompilerWrapper.cs (1)
335e = e.InnerException;
MS\Internal\Tasks\TaskHelper.cs (2)
195while (e.InnerException != null) 197Exception eInner = e.InnerException;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (1)
90_xamlTypeMapper.ThrowExceptionWithLine(e.Message, e.InnerException);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParseException.cs (2)
454if (innerException is TargetInvocationException && innerException.InnerException is XamlParseException) 456xamlParseException = (XamlParseException)innerException.InnerException;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (2)
208if (e is TargetInvocationException && e.InnerException is XamlParseException) 210throw e.InnerException;
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (2)
1394if (innerException is TargetInvocationException && innerException.InnerException is XamlParseException) 1396parseException = innerException.InnerException as XamlParseException;
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CriticalExceptions.cs (2)
49while (ex.InnerException is not null && 53ex = ex.InnerException;
PresentationFramework (17)
MS\Internal\PtsHost\Pts.cs (7)
136innerException = exception.InnerException; 275get { return InnerException.HelpLink; } 276set { InnerException.HelpLink = value; } 281get { return InnerException.Message; } 286get { return InnerException.Source; } 287set { InnerException.Source = value; } 292get { return InnerException.StackTrace; }
System\Windows\Markup\BamlRecordReader.cs (6)
1543e = tie.InnerException; 2488e = tie.InnerException; 2661e = tie.InnerException; 2903e = tie.InnerException; 3718e = tie.InnerException; 3856e = tie.InnerException;
System\Windows\Markup\BamlRecordWriter.cs (1)
90_xamlTypeMapper.ThrowExceptionWithLine(e.Message, e.InnerException);
System\Windows\Markup\XamlParseException.cs (2)
454if (innerException is TargetInvocationException && innerException.InnerException is XamlParseException) 456xamlParseException = (XamlParseException)innerException.InnerException;
System\Windows\Markup\XamlReader.cs (1)
498Exception baseException = e.InnerException ?? e;
ReachFramework (4)
PrintConfig\PrtCap_Public.cs (1)
40/// null, the exception object's <see cref="Exception.InnerException"/> property provides more details.
PrintConfig\PrtCap_Public_Simple.cs (1)
195/// <see cref="Exception.InnerException"/> property provides more details.
PrintConfig\PrtTicket_Public.cs (1)
59/// And if not null, the exception object's <see cref="Exception.InnerException"/> property provides more details.
PrintConfig\PrtTicket_Public_Simple.cs (1)
264/// <see cref="Exception.InnerException"/> property provides more details.
Replay (2)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (2)
69Exception? e = exception.InnerException; 74e = e.InnerException;
Security.TransportSecurity.IntegrationTests (10)
Https\HttpsTests.4.1.0.cs (8)
97for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException) 136for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException) 175for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException) 214for (Exception innerException = ex.InnerException; innerException != null; innerException = innerException.InnerException)
Tcp\ClientCredentialTypeCertificateCanonicalNameTests.4.1.0.cs (2)
71if ((exception is MessageSecurityException) || (exception is CommunicationException) && !string.Equals(exception.InnerException.GetType().ToString(), "System.ServiceModel.Security.MessageSecurityException")) 147if ((exception is MessageSecurityException) || (exception is CommunicationException) && !string.Equals(exception.InnerException.GetType().ToString(), "System.ServiceModel.Security.MessageSecurityException"))
Shared.Tests (2)
Throw\ThrowTest.cs (2)
33Assert.Equal(innerException, exception.InnerException); 57Assert.Equal(innerException, exception.InnerException);
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
183throw tie.InnerException!;
System.ComponentModel.Composition (27)
System\ComponentModel\Composition\CompositionContractMismatchException.cs (1)
52/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>.
System\ComponentModel\Composition\CompositionException.cs (4)
61/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 286if (exception.InnerException != null) 288VisitException(exception.InnerException, context); 318VisitError(new CompositionError(exception.Message, exception.InnerException), context);
System\ComponentModel\Composition\ImportCardinalityMismatchException.cs (1)
55/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>.
System\ComponentModel\Composition\ImportCardinalityMismatchExceptionDebuggerProxy.cs (1)
21get { return _exception.InnerException; }
System\ComponentModel\Composition\MetadataViewProvider.cs (10)
100if (ex.InnerException!.GetType() == typeof(InvalidCastException)) 105ex.InnerException.Data[MetadataViewGenerator.MetadataViewType], 106ex.InnerException.Data[MetadataViewGenerator.MetadataItemKey], 107ex.InnerException.Data[MetadataViewGenerator.MetadataItemValue], 108ex.InnerException.Data[MetadataViewGenerator.MetadataItemSourceType], 109ex.InnerException.Data[MetadataViewGenerator.MetadataItemTargetType]), ex); 111else if (ex.InnerException.GetType() == typeof(NullReferenceException)) 116ex.InnerException.Data[MetadataViewGenerator.MetadataViewType], 117ex.InnerException.Data[MetadataViewGenerator.MetadataItemKey], 118ex.InnerException.Data[MetadataViewGenerator.MetadataItemTargetType]), ex);
System\ComponentModel\Composition\Primitives\ComposablePartException.cs (2)
107/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>. 133/// the <see cref="Exception.InnerException"/> property to <see langword="null"/>.
System\ComponentModel\Composition\Primitives\ComposablePartExceptionDebuggerProxy.cs (1)
26get { return _exception.InnerException; }
System\ComponentModel\Composition\ReflectionModel\ExportingMember.cs (2)
58exception.InnerException); 70exception.InnerException);
System\ComponentModel\Composition\ReflectionModel\ImportingMember.cs (4)
75exception.InnerException); 87exception.InnerException); 139exception.InnerException); 162exception.InnerException);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (1)
430exception = ex.InnerException;
System.ComponentModel.TypeConverter (4)
System\ComponentModel\LicenseManager.cs (1)
152throw e.InnerException!;
System\ComponentModel\ReflectPropertyDescriptor.cs (3)
935t = t.InnerException!; 1135if (t is TargetInvocationException && t.InnerException != null) 1138throw t.InnerException;
System.Configuration.ConfigurationManager (7)
System\Configuration\ConfigurationErrorsException.cs (2)
83this(e?.BareMessage, e?.InnerException, e?.Filename, e?.Line ?? 0) 171ConfigurationErrorsException e = new ConfigurationErrorsException(BareMessage, InnerException,
System\Configuration\ExceptionUtil.cs (1)
58deprecatedException.InnerException,
System\Diagnostics\TraceUtils.cs (4)
112Debug.Assert(tiexc.InnerException != null, "ill-formed TargetInvocationException!"); 113innerException = tiexc.InnerException; 127Debug.Assert(tiexc.InnerException != null, "ill-formed TargetInvocationException!"); 128innerException = tiexc.InnerException;
System.Data.Odbc (1)
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
112retry.TrySetException(task.Exception!.InnerException!);
System.Diagnostics.Process (1)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
170catch (Exception ex) when (ex is IOException || ex.InnerException is IOException)
System.Linq.Expressions (2)
System\Linq\Expressions\Interpreter\CallInstruction.cs (1)
97if (!(tie.InnerException is NotSupportedException))
System\Linq\Expressions\Interpreter\Utilities.cs (1)
163ExceptionDispatchInfo.Throw(exception.InnerException!);
System.Net.Http (5)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
845TimeoutException te = new TimeoutException(SR.net_http_connect_timedout, oce.InnerException);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (2)
155Trace($"{nameof(QuicConnection)} failed to close: {closeTask.Exception!.InnerException}"); 493if (t.Exception?.InnerException is QuicException ex && ex.QuicError == QuicError.StreamAborted)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
482catch (HttpRequestException hex) when (hex.InnerException is QuicException qex && qex.QuicError == QuicError.StreamAborted && qex.ApplicationErrorCode == (long)Http3ErrorCode.NoError)
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (1)
213Exception? e = task.Exception!.InnerException; // Access Exception even if not tracing, to avoid TaskScheduler.UnobservedTaskException firing
System.Net.HttpListener (6)
System\Net\Managed\HttpRequestStream.Managed.cs (3)
196catch (IOException e) when (e.InnerException is ArgumentException || e.InnerException is InvalidOperationException) 198ExceptionDispatchInfo.Throw(e.InnerException);
System\Net\Managed\HttpResponseStream.Managed.cs (3)
287if (ex.InnerException is ArgumentException || ex.InnerException is InvalidOperationException) 289ExceptionDispatchInfo.Throw(ex.InnerException);
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
133Exception? ex = t.Exception?.InnerException;
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
55catch (NetworkInformationException ex) when (ex.InnerException is IOException or UnauthorizedAccessException) { }
System.Net.Quic (5)
System\Net\Quic\QuicConnection.cs (2)
579catch (ChannelClosedException ex) when (ex.InnerException is not null) 581ExceptionDispatchInfo.Throw(ex.InnerException);
System\Net\Quic\QuicListener.cs (3)
193catch (ChannelClosedException ex) when (ex.InnerException is not null) 195ExceptionDispatchInfo.Throw(ex.InnerException); 300if (task.AsTask().Exception?.InnerException is Exception handshakeException)
System.Net.Requests (3)
System\Net\FtpWebRequest.cs (2)
918if (webException.InnerException is IOException ioEx && 919ioEx.InnerException is SocketException sEx &&
System\Net\WebException.cs (1)
105SocketException? socketException = ex.InnerException as SocketException;
System.Net.Sockets (2)
System\Net\Sockets\Socket.cs (1)
4063return t.Exception.InnerException switch
System\Net\Sockets\Socket.Unix.cs (1)
284catch (TargetInvocationException ex) when (ex.InnerException is SocketException se && se.SocketErrorCode == SocketError.OperationNotSupported)
System.Net.WebSockets (1)
System\Net\WebSockets\ManagedWebSocket.cs (1)
1898Exception e = task.Exception!.InnerException!;
System.Private.CoreLib (17)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
170catch (Exception ex) when (ex is IOException || ex.InnerException is IOException)
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (2)
230back = back!.InnerException; 373if (_innerExceptions[i] == InnerException)
src\libraries\System.Private.CoreLib\src\System\BadImageFormatException.cs (2)
100if (InnerException != null) 101s += InnerExceptionPrefix + InnerException.ToString();
src\libraries\System.Private.CoreLib\src\System\ComponentModel\Win32Exception.cs (1)
113Exception? innerException = InnerException;
src\libraries\System.Private.CoreLib\src\System\Exception.cs (2)
71Exception? inner = InnerException; 77inner = inner.InnerException;
src\libraries\System.Private.CoreLib\src\System\IO\FileLoadException.cs (2)
57if (InnerException != null) 58s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString();
src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (2)
80if (InnerException != null) 81s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString();
src\libraries\System.Private.CoreLib\src\System\IO\InvalidDataException.cs (3)
34/// An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the <see cref="Exception.InnerException" /> property. The <see cref="Exception.InnerException" /> property returns the same value that is passed into the constructor, or <see langword="null" /> if the <see cref="Exception.InnerException" /> property does not supply the inner exception value to the constructor.</remarks>
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\COMException.cs (1)
62Exception? innerException = InnerException;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ExternalException.cs (1)
61Exception? innerException = InnerException;
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\ExceptionUtility.cs (1)
28exception = exception.InnerException!;
System\Xml\ValueHandle.cs (1)
463throw new XmlException(exception.Message, exception.InnerException);
System\Xml\XmlBaseReader.cs (1)
1512throw new XmlException(exception.Message, exception.InnerException);
System.Private.Windows.Core (2)
System\ExceptionExtensions.cs (1)
32ex = targetException.InnerException ?? ex;
System\Private\Windows\Ole\BinaryFormatUtilities.cs (1)
208catch (SerializationException e) when (e.InnerException is NotSupportedException nse)
System.Private.Xml (5)
System\Xml\Serialization\XmlSerializer.cs (2)
415e = e.InnerException; 515e = e.InnerException;
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (1)
290throw new XslTransformException(e.InnerException, SR.XmlIl_ExtensionError, _name);
System\Xml\Xsl\XslException.cs (2)
89if (InnerException != null) 91result += $" ---> {InnerException}{Environment.NewLine} {CreateMessage(SR.Xml_EndOfInnerExceptionStack)}";
System.Resources.Extensions (2)
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.cs (2)
58throw ExceptionDispatchInfo.Capture(ex.InnerException!).SourceException.ConvertToSerializationException(); 79throw ExceptionDispatchInfo.Capture(ex.InnerException!).SourceException.ConvertToSerializationException();
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (1)
30exception = exception.InnerException!;
System.ServiceModel.Federation (3)
System\Runtime\Fx.cs (1)
26exception = exception.InnerException;
System\Runtime\TaskHelpers.cs (2)
48tcsObj.TrySetException(antecedent.Exception.InnerException); 104tcsObj.TrySetException(antecedent.Exception.InnerException);
System.ServiceModel.NetFramingBase (6)
System\ServiceModel\Channels\Connection.cs (6)
346if (ioException.InnerException is TimeoutException) 348return new TimeoutException(ioException.InnerException.Message, ioException); 350else if (ioException.InnerException is CommunicationObjectAbortedException) 352return new CommunicationObjectAbortedException(ioException.InnerException.Message, ioException); 354else if (ioException.InnerException is CommunicationException) 356return new CommunicationException(ioException.InnerException.Message, ioException);
System.ServiceModel.Primitives.Tests (1)
Security\SecurityNegotiationExceptionTest.cs (1)
27Assert.Equal(exceptionMessage, exception3.InnerException.Message);
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
68throw e.InnerException ?? e;
System.Threading.Tasks.Dataflow (4)
Internal\Common.cs (4)
260else if (exc.InnerException != null) 262StoreStringIntoExceptionData(exc.InnerException, Common.EXCEPTIONDATAKEY_DATAFLOWMESSAGEVALUE, strValue); 314Debug.Assert(!unwrapInnerExceptions || exception.InnerException != null, 329list.Add(exception.InnerException!);
System.Web.Services.Description (1)
System\Web\Services\Description\ServiceDescription.cs (1)
2085throw new ArgumentException(GetDuplicateMessage(value.GetType(), key), e.InnerException);
System.Windows.Forms (13)
System\Resources\ResXResourceReader.cs (2)
386string newMessage = string.Format(SR.InvocationException, reader[ResXResourceWriter.TypeStr], pt.Y, pt.X, tie.InnerException?.Message); 387XmlException xml = new(newMessage, tie.InnerException, pt.Y, pt.X);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.ExceptionConverter.cs (2)
22if (ex.InnerException is not null) 24ex = ex.InnerException;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (4)
4925ex = ex.InnerException; 4935ex = ex?.InnerException; 4998ex = ex.InnerException; 5008ex = ex?.InnerException;
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (2)
2339if (exception.InnerException is not null) 2342exception = exception.InnerException;
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (1)
43throw new TargetInvocationException(string.Format(SR.ExceptionCreatingCompEditorControl, e), e.InnerException);
System\Windows\Forms\Internal\Formatter.cs (2)
485throw new FormatException(ex.InnerException?.Message, ex.InnerException);
System.Windows.Forms.Design (10)
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
68ex = ex.InnerException!;
System\ComponentModel\Design\DesignerActionPanel.PropertyLine.cs (1)
82e = e.InnerException!;
System\ComponentModel\Design\DesignerHost.cs (1)
342if (e is TargetInvocationException && e.InnerException is { } inner)
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (1)
216e = e.InnerException!;
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
453e = e.InnerException!;
System\ComponentModel\Design\Serialization\EventMemberCodeDomSerializer.cs (1)
66e = e.InnerException!;
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (1)
120e = e.InnerException!;
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (1)
104throw tie.InnerException!;
System\Windows\Forms\Design\OleDragDropHandler.cs (2)
212if (ex.InnerException is not null) 214exceptionMessage = ex.InnerException.ToString();
System.Windows.Forms.Design.Tests (7)
System\ComponentModel\Design\ArrayEditorTests.cs (1)
125Assert.IsType<TargetException>(ex.InnerException);
System\ComponentModel\Design\CollectionEditorTests.cs (1)
757Assert.IsType<TargetException>(ex.InnerException);
System\ComponentModel\Design\DesignSurfaceTests.cs (1)
361Assert.Same(exception, Assert.Throws<InvalidOperationException>(() => surface.View).InnerException);
System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs (4)
28Assert.Null(exception.InnerException); 44Assert.Same(innerException, exception.InnerException); 61Assert.Null(exception.InnerException); 78Assert.Same(innerException, exception.InnerException);
System.Windows.Forms.Tests (4)
System\Windows\Forms\MessageBoxTests.cs (1)
154throw ex.InnerException;
System\Windows\Forms\ToolStripControlHostTests.cs (3)
357Assert.IsType<ObjectDisposedException>(ex.InnerException); 1033Assert.IsType<ObjectDisposedException>(ex.InnerException); 1176Assert.IsType<ObjectDisposedException>(ex.InnerException);
System.Xaml (17)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CriticalExceptions.cs (2)
49while (ex.InnerException is not null && 53ex = ex.InnerException;
System\Xaml\InfosetObjects\XamlObjectWriter.cs (2)
1892if (!(ex.InnerException is ArgumentException) && 1893!(ex.InnerException is InvalidCastException))
System\Xaml\Runtime\ClrObjectRuntime.cs (2)
36if (e is TargetInvocationException && e.InnerException is not null) 38return e.InnerException;
System\Xaml\Runtime\PartialTrustTolerantRuntime.cs (11)
143if (ex.InnerException is MethodAccessException) 150else if (ex.InnerException is MissingMethodException) 174if (ex.InnerException is MethodAccessException) 181else if (ex.InnerException is MissingMethodException) 207if (e.InnerException is MissingMethodException) 211else if (e.InnerException is MethodAccessException) 239if (e.InnerException is MissingMethodException) 243else if (e.InnerException is MethodAccessException) 299if (e.InnerException is MethodAccessException) 346if (e.InnerException is MethodAccessException) 375if (e.InnerException is MethodAccessException)
System.Xaml.Tests (34)
System\Xaml\XamlBackgroundReaderTests.cs (1)
254catch (TargetInvocationException ex) when (ex.InnerException is ObjectDisposedException)
System\Xaml\XamlDuplicateMemberExceptionTests.cs (4)
18Assert.Null(exception.InnerException); 30Assert.Null(exception.InnerException); 54Assert.Null(exception.InnerException); 74Assert.Equal(innerException, exception.InnerException);
System\Xaml\XamlExceptionTests.cs (4)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 48Assert.Equal(innerException, exception.InnerException); 66Assert.Equal(innerException, exception.InnerException);
System\Xaml\XamlInternalExceptionTests.cs (3)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 46Assert.Equal(innerException, exception.InnerException);
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)
System\Xaml\XamlObjectReaderExceptionTests.cs (3)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 46Assert.Equal(innerException, exception.InnerException);
System\Xaml\XamlObjectWriterExceptionTests.cs (3)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 46Assert.Equal(innerException, exception.InnerException);
System\Xaml\XamlParseExceptionTests.cs (3)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 46Assert.Equal(innerException, exception.InnerException);
System\Xaml\XamlSchemaExceptionTests.cs (3)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 46Assert.Equal(innerException, exception.InnerException);
System\Xaml\XamlXmlWriterExceptionTests.cs (3)
18Assert.Null(exception.InnerException); 28Assert.Null(exception.InnerException); 46Assert.Equal(innerException, exception.InnerException);
vbc (2)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (2)
69Exception? e = exception.InnerException; 74e = e.InnerException;
VBCSCompiler (2)
src\Compilers\Core\CommandLine\CompilerServerLogger.cs (2)
69Exception? e = exception.InnerException; 74e = e.InnerException;
WindowsBase.Tests (14)
System\Security\RightsManagement\RightsManagementExceptionTests.cs (14)
16Assert.Null(exception.InnerException); 31Assert.Null(exception.InnerException); 45Assert.Null(exception.InnerException); 57Assert.Null(exception.InnerException); 81Assert.Same(innerException, exception.InnerException); 96Assert.Null(exception.InnerException); 111Assert.Null(exception.InnerException); 132Assert.Same(innerException, exception.InnerException); 153Assert.Same(innerException, exception.InnerException); 177Assert.Same(innerException, exception.InnerException); 201Assert.Same(innerException, exception.InnerException); 224Assert.NotNull(exception.InnerException); 246Assert.Null(exception.InnerException); 262Assert.Null(exception.InnerException);
xunit.assert (2)
Sdk\ArgumentFormatter.cs (2)
694 if (tiex == null || tiex.InnerException == null) 697 ex = tiex.InnerException;
xunit.console (1)
ConsoleRunner.cs (1)
426e = e.InnerException;