229 references to Exception
ClassLibraryWithPortablePdbs (2)
ExceptionType.cs (2)
10throw new Exception(); 15throw new Exception();
dotnet-svcutil-lib (6)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (1)
2897: base()
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\InvalidDataContractException.cs (1)
12public InvalidDataContractException() : base()
FrameworkFork\System.ServiceModel\System\IdentityModel\SecurityMessageSerializationException.cs (1)
10: base()
FrameworkFork\System.ServiceModel\System\IdentityModel\Tokens\SecurityTokenException.cs (1)
10: base()
FrameworkFork\System.ServiceModel\System\ServiceModel\InvalidMessageContractException.cs (1)
13: base()
FrameworkFork\System.ServiceModel\System\ServiceModel\QuotaExceededException.cs (1)
13: base()
IdeBenchmarks (2)
Lsp\LspCompletionSerializationBenchmarks.cs (2)
121throw new System.Exception(); 164throw new System.Exception();
InMemory.FunctionalTests (21)
ChunkedRequestTests.cs (1)
1093httpContext.Request.BodyReader.Complete(new Exception());
ChunkedResponseTests.cs (2)
428throw new Exception(); 461throw new Exception();
Http2\Http2ConnectionTests.cs (1)
5338var exception = new Exception();
Http2\Http2StreamTests.cs (3)
1760throw new Exception(); 1794throw new Exception(); 4695var expectedException = new Exception();
RequestTests.cs (1)
2048httpContext.Request.BodyReader.Complete(new Exception());
ResponseTests.cs (13)
50throw new Exception(); 285throw new Exception(); 315throw new Exception(); 377context.Response.OnCompleted(_ => throw new Exception(), null); 2623throw new Exception(); 2667var onStartingException = new Exception(); 2822throw new Exception(); 2827throw new Exception(); 2879throw new Exception(); 2924throw new Exception(); 3268var expectedException = new Exception(); 3296var expectedException = new Exception(); 4301var expectedException = new Exception();
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
387throw new Exception();
InteractiveHost.UnitTests (2)
InteractiveHostDesktopTests.cs (2)
979Assert.True(error.StartsWith($"{new Exception().GetType()}: {new Exception().Message}"));
Microsoft.AspNetCore.Authentication.Test (2)
JwtBearerTests.cs (1)
184throw new Exception();
JwtBearerTests_Handler.cs (1)
175throw new Exception();
Microsoft.AspNetCore.Components.Tests (6)
RendererTest.cs (6)
2270var exception1 = new Exception(); 2271var exception2 = new Exception(); 2547var exception1 = new Exception(); 2548var exception2 = new Exception(); 4236var exception1 = new Exception(); 4237var exception2 = new Exception();
Microsoft.AspNetCore.Hosting.Tests (2)
HostingApplicationDiagnosticsTests.cs (2)
675hostingApplication.DisposeContext(context, new Exception()); 697hostingApplication.DisposeContext(context, new Exception());
Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks (4)
GetHeaderSplitBenchmark.cs (4)
32throw new Exception(); 42throw new Exception(); 52throw new Exception(); 62throw new Exception();
Microsoft.AspNetCore.Http.Connections.Tests (1)
WebSocketsTests.cs (1)
259connection.Transport.Output.Complete(new Exception());
Microsoft.AspNetCore.Identity (1)
SignInManager.cs (1)
1544internal IdentityResultException(IdentityResult result) : base()
Microsoft.AspNetCore.Identity.Test (1)
UserManagerTest.cs (1)
1339throw new Exception();
Microsoft.AspNetCore.Mvc.Abstractions.Test (12)
ModelBinding\ModelStateDictionaryTest.cs (12)
325var exception = new Exception(); 649var ex = new Exception(); 761dictionary.AddModelError("key2", new Exception(), metadata); 762dictionary.AddModelError("key3", new Exception(), metadata); 791result = dictionary.TryAddModelException("key2", new Exception()); 794result = dictionary.TryAddModelException("key3", new Exception()); 824result = dictionary.TryAddModelError("key2", new Exception(), metadata); 861dictionary.AddModelError("key1", new Exception(), metadata); 864dictionary.AddModelError("key3", new Exception(), metadata); 896result = dictionary.TryAddModelError("key2", new Exception(), metadata); 899result = dictionary.TryAddModelError("key3", new Exception(), metadata); 922dictionary.TryAddModelError("key3", new Exception(), metadata);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
RuntimeViewCompilerTest.cs (1)
625throw new Exception();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (4)
CacheTagHelperTest.cs (3)
645throw new Exception(); 721throw new Exception(); 1050throw new Exception();
DistributedCacheTagHelperTest.cs (1)
653throw new Exception();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (10)
CookieTempDataProviderTest.cs (1)
74.Throws(new Exception());
ModelStateDictionaryExtensionsTest.cs (8)
82var exception = new Exception(); 100var exception = new Exception(); 120var exception = new Exception(); 138var exception = new Exception(); 158var exception = new Exception(); 176var exception = new Exception(); 197var exception = new Exception(); 216var exception = new Exception();
ViewExecutorTest.cs (1)
304throw new Exception();
Microsoft.AspNetCore.Razor.Runtime.Test (2)
Runtime\TagHelpers\TagHelperExecutionContextTest.cs (2)
23executeChildContentAsync: () => throw new Exception(), 46executeChildContentAsync: () => throw new Exception(),
Microsoft.AspNetCore.Routing.Tests (5)
CompositeEndpointDataSourceTest.cs (1)
64var ex = new Exception();
EndpointRoutingMiddlewareTest.cs (3)
171throw new Exception(); 193throw new Exception(); 221throw new Exception();
Tree\TreeRouterTest.cs (1)
1830throw new Exception();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (9)
ConcurrentPipeWriterTests.cs (5)
66var completeEx = new Exception(); 158var completeEx = new Exception(); 249var completeEx = new Exception(); 306var completeEx = new Exception(); 400var completeEx = new Exception();
HeartbeatTests.cs (1)
189var ex = new Exception();
HttpRequestPipeReaderTests.cs (1)
39var error = new Exception();
HttpRequestStreamTests.cs (2)
148var error = new Exception(); 182var error = new Exception();
Microsoft.AspNetCore.Shared.Tests (9)
StackTraceHelperTest.cs (9)
273throw new Exception(); 277void MethodWithOutParameter(out int value) => throw new Exception(); 280void MethodWithGenericOutParameter<TVal>(string a, out TVal value) => throw new Exception(); 283void MethodWithRefParameter(ref int value) => throw new Exception(); 286void MethodWithGenericRefParameter<TVal>(ref TVal value) => throw new Exception(); 289void MethodWithNullableParameter(int? value) => throw new Exception(); 311public void Throw(T parameter) => throw new Exception(); 315private void GenericMethod<T>(T val) where T : class => throw new Exception(); 345private static void ThrowCore() => throw new Exception();
Microsoft.AspNetCore.SignalR.Client.Tests (17)
HubConnectionTests.Reconnect.cs (17)
40var exception = new Exception(); 155var firstException = new Exception(); 164var reconnectException = new Exception(); 252var firstException = new Exception(); 261var reconnectException = new Exception(); 347var firstException = new Exception(); 352var reconnectException = new Exception(); 429var firstException = new Exception(); 447var secondException = new Exception(); 661var firstException = new Exception(); 716var firstException = new Exception(); 796var firstException = new Exception(); 805var secondException = new Exception(); 903var firstException = new Exception(); 1023var firstException = new Exception(); 1032var secondException = new Exception(); 1100var firstException = new Exception();
Microsoft.AspNetCore.SignalR.Microbenchmarks (11)
HandshakeProtocolBenchmark.cs (11)
94throw new Exception(); 104throw new Exception(); 114throw new Exception(); 124throw new Exception(); 134throw new Exception(); 144throw new Exception(); 154throw new Exception(); 164throw new Exception(); 174throw new Exception(); 184throw new Exception(); 194throw new Exception();
Microsoft.AspNetCore.SignalR.Specification.Tests (1)
src\SignalR\common\testassets\Tests.Utils\HubConnectionContextUtils.cs (1)
51throw new Exception();
Microsoft.AspNetCore.SignalR.Tests (1)
EndToEndTests.cs (1)
740return Task.FromException(new Exception());
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
HubConnectionContextUtils.cs (1)
51throw new Exception();
Microsoft.Build.Framework (1)
BuildException\BuildExceptionBase.cs (1)
20: base()
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (12)
ObjectFormatterTests.cs (12)
903throw new Exception(); 909throw new Exception(); 918throw new Exception(); 924throw new Exception(); 942$@"{new Exception().Message} 966$@"{new Exception().Message} 990$@"{new Exception().Message} 1014$@"{new Exception().Message} 1061throw new Exception(); 1067throw new Exception(); 1087$@"{new Exception().Message} 1112$@"{new Exception().Message}
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
CodeFixes\CodeFixServiceTests.cs (1)
328() => throwExceptionInFixerCreation ? throw new Exception() : codefix,
Diagnostics\SuppressMessageAttributeWorkspaceTests.cs (2)
116[new ThrowExceptionForEachNamedTypeAnalyzer(ExceptionDispatchInfo.Capture(new Exception()))], 126[new ThrowExceptionFromSupportedDiagnostics(new Exception())],
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
TelemetryReporterTests.cs (1)
50service.ReportFault(GetEventName(nameof(TestFault)), "test description", logLevel: 2, forceDump: false, processId: 0, new Exception());
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
ObjectFormatterFixtures\Custom.cs (1)
464throw new Exception();
Microsoft.CodeAnalysis.UnitTests (4)
Analyzers\AnalyzerFileReferenceTests.cs (2)
751public Assembly LoadFromPath(string fullPath) => throw new Exception(); 752public string? GetOriginalDependencyLocation(AssemblyName assembly) => throw new Exception();
Diagnostics\SuppressMessageAttributeCompilerTests.cs (2)
99var exception = new Exception(); 158var exception = new Exception();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\CancellationSeriesTests.cs (1)
122var exception = new Exception();
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
22: base()
Microsoft.Extensions.AI.Abstractions.Tests (2)
Contents\FunctionCallContentTests..cs (1)
71Exception e = new();
Contents\FunctionResultContentTests.cs (1)
56Exception e = new();
Microsoft.Maui (2)
Handlers\HybridWebView\HybridWebViewInvokeJavaScriptException.cs (1)
10 : base()
Layouts\Flex.cs (1)
830 throw new Exception();
Microsoft.Maui.Controls (3)
StyleSheets\Style.cs (1)
53 throw new Exception();
StyleSheets\StyleSheet.cs (1)
82 throw new Exception();
StyleSheets\TextReaderExtensions.cs (1)
33 throw new Exception();
Microsoft.Maui.Controls.Build.Tasks (1)
CompiledConverters\ICompiledTypeConverter.cs (1)
24 throw new Exception();
Microsoft.Maui.Controls.SourceGen (1)
CodeBehindGenerator.cs (1)
476 var name = GetAttributeValue(node, "Name", XamlParser.X2006Uri, XamlParser.X2009Uri) ?? throw new Exception();
Microsoft.Maui.Controls.Xaml (1)
ExpandMarkupsVisitor.cs (1)
95 throw new Exception();
Microsoft.ML.AutoML (2)
Tuner\AutoZeroTuner.cs (2)
45_ => throw new Exception(), 52_ => throw new Exception(),
Microsoft.ML.PerformanceTests (4)
HashBench.cs (4)
36throw new Exception(); 50throw new Exception(); 53throw new Exception(); 59throw new Exception();
Microsoft.VisualBasic.Core (3)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (1)
2483Throw New Exception 'would be nice to have an internal runtime exception or something like that
Microsoft\VisualBasic\CompilerServices\IncompleteInitialization.vb (1)
10MyBase.New()
Microsoft\VisualBasic\FileIO\MalformedLineException.vb (1)
25MyBase.New()
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
PersistentStorage\SQLiteV2PersistentStorageTests.cs (1)
30throw new Exception();
PresentationCore (1)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (1)
154Marshal.GetHRForException(new Exception());
PresentationFramework (2)
System\Windows\Controls\PrintDialogException.cs (1)
23: base()
System\Windows\Documents\MsSpellCheckLib\Utils\RetryHelper.cs (1)
311internal RetriesExhaustedException() : base() { }
ReachFramework (1)
Exceptions\XpsException.cs (1)
23: base()
Shared.Tests (2)
Throw\ThrowTest.cs (2)
29var innerException = new Exception(); 52var innerException = new Exception();
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\ConnectionMiddlewareTests.cs (1)
22listenOptions.Use(next => context => throw new Exception());
System.Formats.Cbor (6)
System\Formats\Cbor\CborConformanceLevel.cs (1)
270throw new Exception();
System\Formats\Cbor\Reader\CborReader.PeekState.cs (3)
39throw new Exception(); 85throw new Exception(); 130throw new Exception();
System\Formats\Cbor\Writer\CborWriter.cs (1)
410throw new Exception();
System\Formats\Cbor\Writer\CborWriter.Tag.cs (1)
198throw new Exception();
System.IO.Ports (1)
System\IO\Ports\SerialStream.Unix.cs (1)
534throw new Exception();
System.Linq.Expressions (1)
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
202public RethrowException() : base() { }
System.Linq.Queryable (1)
System\Linq\EnumerableRewriter.cs (1)
274throw new Exception();
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Exception.cs (2)
26: this() 37: this()
System.Reflection.Metadata (1)
System\Reflection\Metadata\ImageFormatLimitationException.cs (1)
11: base()
System.Reflection.MetadataLoadContext (1)
System\CoreRtBridge.cs (1)
34internal static Exception CreateMissingMetadataException() => new Exception();
System.Runtime.Serialization.Primitives (1)
System\Runtime\Serialization\InvalidDataContractException.cs (1)
15: base()
System.Text.Json (3)
System\ReflectionExtensions.cs (1)
157throw new Exception();
System\Text\Json\JsonException.cs (1)
78public JsonException() : base() { }
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (1)
72throw new Exception();
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Emitter.cs (1)
1512_ => throw new Exception(),
VBCSCompiler.UnitTests (12)
AnalyzerConsistencyCheckerTests.cs (2)
252public Assembly LoadFromPath(string fullPath) => throw new Exception(); 253public string? GetOriginalDependencyLocation(AssemblyName assembly) => throw new Exception();
ClientConnectionHandlerTests.cs (2)
27var compilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 48ReadBuildRequestFunc = _ => throw new Exception(),
CompilerServerTests.cs (6)
313var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 326var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 343var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 365var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 389var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); }); 411var testableCompilerServerHost = new TestableCompilerServerHost(delegate { throw new Exception(); });
TestableClientConnection.cs (2)
22public Func<CancellationToken, Task<BuildRequest>> ReadBuildRequestFunc = delegate { throw new Exception(); }; 23public Func<BuildResponse, CancellationToken, Task> WriteBuildResponseFunc = delegate { throw new Exception(); };
WindowsBase.Tests (14)
System\Security\RightsManagement\RightsManagementExceptionTests.cs (8)
67yield return new object?[] { RightsManagementFailureCode.ServerError, new Exception() }; 70yield return new object?[] { RightsManagementFailureCode.Success - 1, new Exception() }; 121yield return new object?[] { "message", new Exception() }; 142yield return new object?[] { new Exception() }; 163yield return new object?[] { RightsManagementFailureCode.ServerError, "message", new Exception() }; 166yield return new object?[] { RightsManagementFailureCode.Success - 1, "message", new Exception() }; 187yield return new object?[] { RightsManagementFailureCode.ServerError, new Exception() }; 190yield return new object?[] { RightsManagementFailureCode.Success - 1, new Exception() };
System\Windows\Data\DataSourceProviderTests.cs (6)
1239provider.OnQueryFinished(new object(), new Exception(), e => e, new object()); 1456var error = new Exception(); 1534var error = new Exception(); 1664var error1 = new Exception(); 1667var error2 = new Exception(); 1833provider.OnQueryFinished(new object(), new Exception(), e => e, new object());