138 instantiations of FileNotFoundException
Aspire.Dashboard.Tests (1)
tests\Shared\Playwright\PlaywrightProvider.cs (1)
22throw new FileNotFoundException($"Browser path {BrowserPathEnvironmentVariableName}='{browserPath}' does not exist");
Aspire.EndToEnd.Tests (1)
tests\Shared\Playwright\PlaywrightProvider.cs (1)
22throw new FileNotFoundException($"Browser path {BrowserPathEnvironmentVariableName}='{browserPath}' does not exist");
Aspire.Hosting (4)
ContainerResourceBuilderExtensions.cs (1)
311throw new FileNotFoundException($"Dockerfile not found at '{fullyQualifiedDockerfilePath}'.");
Dcp\DcpDependencyCheck.cs (1)
50throw new FileNotFoundException($"The Aspire orchestration component is not installed at \"{dcpPath}\". The application cannot be run without it.", dcpPath);
Dcp\DcpHostService.cs (1)
156throw new FileNotFoundException($"The Aspire application host is not installed at \"{dcpExePath}\". The application cannot be run without it.", dcpExePath);
DistributedApplicationOptions.cs (1)
100throw new FileNotFoundException($"No assembly with name '{AssemblyName}' exists in the current AppDomain.");
Aspire.RuntimeIdentifier.Tool (1)
Program.cs (1)
51throw new FileNotFoundException("File {0} does not exist. Please ensure the runtime graph path exists.", rgp);
Aspire.Workload.Tests (1)
tests\Shared\Playwright\PlaywrightProvider.cs (1)
22throw new FileNotFoundException($"Browser path {BrowserPathEnvironmentVariableName}='{browserPath}' does not exist");
dotnet-svcutil-lib (1)
Metadata\MetadataFileNameManager.cs (1)
261throw new FileNotFoundException(string.Format(CultureInfo.CurrentCulture, MetadataResources.ErrNoFilesFoundFormat, path));
dotnet-user-jwts (3)
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
36throw new FileNotFoundException(SecretsHelpersResources.FormatError_MultipleProjectsFound(projectPath)); 41throw new FileNotFoundException(SecretsHelpersResources.FormatError_NoProjectsFound(projectPath)); 49throw new FileNotFoundException(SecretsHelpersResources.FormatError_ProjectPath_NotFound(projectPath));
dotnet-user-secrets (3)
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
36throw new FileNotFoundException(SecretsHelpersResources.FormatError_MultipleProjectsFound(projectPath)); 41throw new FileNotFoundException(SecretsHelpersResources.FormatError_NoProjectsFound(projectPath)); 49throw new FileNotFoundException(SecretsHelpersResources.FormatError_ProjectPath_NotFound(projectPath));
IdeCoreBenchmarks (1)
SyntacticChangeRangeBenchmark.cs (1)
36throw new FileNotFoundException(csFilePath);
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
84throw new FileNotFoundException(name);
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
84throw new FileNotFoundException(name);
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
AnalyzerTestBase.cs (1)
24throw new FileNotFoundException($"TestFile {source} could not be found at {filePath}.", filePath);
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
AnalyzerTestBase.cs (1)
24throw new FileNotFoundException($"TestFile {source} could not be found at {filePath}.", filePath);
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
DebugProxyLauncher.cs (1)
132throw new FileNotFoundException(
Microsoft.AspNetCore.Hosting.Tests (1)
Fakes\StartupThrowTypeLoadException.cs (1)
15exceptions: new Exception[] { new FileNotFoundException("Message from the LoaderException") },
Microsoft.AspNetCore.Http.Results (2)
PhysicalFileHttpResult.cs (1)
115throw new FileNotFoundException($"Could not find file: {FileName}", FileName);
VirtualFileHttpResult.cs (1)
111throw new FileNotFoundException($"Could not find file: {FileName}.", FileName);
Microsoft.AspNetCore.Mvc.Core (2)
Infrastructure\PhysicalFileResultExecutor.cs (1)
34throw new FileNotFoundException(
Infrastructure\VirtualFileResultExecutor.cs (1)
42throw new FileNotFoundException(
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISDeployerBase.cs (1)
102throw new FileNotFoundException("AspNetCoreModuleV2 could not be found.", ancmFile);
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
87throw new FileNotFoundException($"The file '{_resource.AssetPath}' could not be found.");
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileMiddlewareTests.cs (1)
88.ThrowsAsync(new FileNotFoundException());
Microsoft.Build (1)
TypeLoader.cs (1)
185throw new FileNotFoundException(null, assemblyLoadInfo.AssemblyLocation, e);
Microsoft.Build.Engine (1)
Shared\TypeLoader.cs (1)
111throw new FileNotFoundException(null, assembly.ToString(), e);
Microsoft.Build.Tasks.Core (2)
ManifestUtil\Manifest.cs (1)
492throw new FileNotFoundException(null, f.SourcePath);
ManifestUtil\SecurityUtil.cs (1)
663throw new FileNotFoundException(String.Format(CultureInfo.InvariantCulture, resources.GetString("SecurityUtil.SignTargetNotFound"), path), path);
Microsoft.Build.Tasks.UnitTests (4)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (4)
1050throw new FileNotFoundException(path); 1103throw new FileNotFoundException(path); 1284throw new FileNotFoundException(); 2263throw new FileNotFoundException(path);
Microsoft.CodeAnalysis (1)
FileSystem\ICommonCompilerFileSystem.cs (1)
40throw new FileNotFoundException(e.Message, filePath, e);
Microsoft.CodeAnalysis.Features (2)
EditAndContinue\DebuggingSession.cs (2)
390throw new FileNotFoundException(); 400throw new FileNotFoundException();
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
3170AssertEx.Equal([$"proj.csproj: (0,0)-(0,0): Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, "test-pdb", new FileNotFoundException().Message)}"], InspectDiagnostics(emitDiagnostics));
Microsoft.CodeAnalysis.LanguageServer (1)
CustomExportAssemblyLoader.cs (1)
95throw new FileNotFoundException($"Could not find assembly {assemblyName} with code base {codeBasePath} in any extension context.");
Microsoft.CodeAnalysis.Test.Utilities (2)
Mocks\TestMetadataReference.cs (1)
43throw new FileNotFoundException();
Platform\Custom\SigningTestHelpers.cs (1)
121throw new FileNotFoundException("File not found", fullPath);
Microsoft.CodeAnalysis.Workspaces (1)
Serialization\SerializerService_Reference.cs (1)
535throw new FileNotFoundException(FilePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\PathResolver.cs (2)
39msg => new FileNotFoundException(msg)); 64msg => new FileNotFoundException(msg));
Microsoft.Data.Analysis (1)
TextFieldParser.cs (1)
587throw new FileNotFoundException(Strings.FileNotFound);
Microsoft.Data.Analysis.Tests (1)
src\Microsoft.Data.Analysis\TextFieldParser.cs (1)
587throw new FileNotFoundException(Strings.FileNotFound);
Microsoft.DotNet.Build.Tasks.Installers (3)
src\BuildFPMToolPreReqs.cs (3)
39throw new FileNotFoundException($"Expected file {ConfigJsonFile} was not found."); 70throw new FileNotFoundException($"Expected file {changelogFile} was not found."); 98throw new FileNotFoundException($"Expected file {copyrightFile} was not found.");
Microsoft.DotNet.Build.Tasks.Workloads (2)
CreateVisualStudioWorkload.wix.cs (1)
243throw new FileNotFoundException(message: "NuGet package not found", fileName: sourcePackage);
WorkloadManifestPackage.wix.cs (1)
117throw new FileNotFoundException(string.Format(Strings.WorkloadManifestNotFound, primaryManifest, secondaryManifest));
Microsoft.DotNet.GenFacades (1)
TypeParser.cs (1)
145throw new FileNotFoundException($"File {sourceFile} was not found.");
Microsoft.DotNet.Helix.JobSender (1)
Payloads\ArchivePayload.cs (1)
24throw new FileNotFoundException($"The file '{pathToArchive}' was not found.");
Microsoft.DotNet.Internal.SymbolHelper (1)
SymbolUploadHelperFactory.cs (1)
80throw new FileNotFoundException("Symbol tool not found", expectedSymbolPath);
Microsoft.DotNet.XliffTasks (1)
Tasks\XlfTask.cs (1)
84throw new FileNotFoundException($"File not found: {path}", path);
Microsoft.Extensions.Configuration.FileExtensions (1)
FileConfigurationProvider.cs (1)
72HandleException(ExceptionDispatchInfo.Capture(new FileNotFoundException(error.ToString())));
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Linux\OSFileSystem.cs (1)
56throw new FileNotFoundException();
Microsoft.Extensions.FileProviders.Abstractions (1)
NotFoundFileInfo.cs (1)
60throw new FileNotFoundException(SR.Format(SR.FileNotExists, Name));
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
108throw new FileNotFoundException(name);
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
108throw new FileNotFoundException(name);
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
108throw new FileNotFoundException(name);
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
108throw new FileNotFoundException(name);
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
108throw new FileNotFoundException(name);
Microsoft.ML.PerformanceTests (8)
Numeric\Ranking.cs (5)
29throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _mslrWeb10kValidate)); 32throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _mslrWeb10kTrain)); 80throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _mslrWeb10kTest)); 83throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _mslrWeb10kValidate)); 86throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _mslrWeb10kTrain));
RffTransform.cs (1)
25throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _dataPathDigits));
Text\MultiClassClassification.cs (2)
26throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _dataPathWiki)); 103throw new FileNotFoundException(string.Format(Errors.DatasetNotFound, _dataPathWiki));
Microsoft.ML.TestFrameworkCommon (2)
Utility\LibraryLoader.cs (2)
51throw new FileNotFoundException("Could not find or load the native library: " + name); 83throw new FileNotFoundException($"Could not find or load the native library from any name: [ {string.Join(", ", names)} ]");
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (2)
254Return New IO.FileNotFoundException(Description) 277Return New IO.FileNotFoundException(Description)
MSBuild (1)
TypeLoader.cs (1)
185throw new FileNotFoundException(null, assemblyLoadInfo.AssemblyLocation, e);
MSBuildTaskHost (1)
TypeLoader.cs (1)
312throw new FileNotFoundException(null, _assemblyLoadInfo.AssemblyLocation, e);
Mvc.Api.Analyzers.Test (1)
Infrastructure\MvcTestSource.cs (1)
18throw new FileNotFoundException($"TestFile {testMethod} could not be found at {filePath}.", filePath);
PresentationCore (5)
MS\Internal\FontCache\FontCacheUtil.cs (1)
771throw new FileNotFoundException(SR.Format(SR.FileNotFoundExceptionWithFileName, fileName), fileName);
MS\Internal\Text\TextInterface\DWriteUtil.cs (1)
20throw new System.IO.FileNotFoundException();
src\Microsoft.DotNet.Wpf\src\Common\Graphics\wgx_render.cs (2)
935return new System.IO.FileNotFoundException(SR.Format(SR.Media_DownloadFailed, null), exceptionForHR); 941return new System.IO.FileNotFoundException(SR.Media_FileNotFound, exceptionForHR);
System\Windows\Media\ColorContext.cs (1)
552throw new FileNotFoundException(SR.Format(SR.FileNotFoundExceptionWithFileName, profileUri.AbsolutePath), profileUri.AbsolutePath);
ResultsOfTGenerator (2)
Program.cs (2)
210throw new FileNotFoundException(classFilePath); 296throw new FileNotFoundException(testFilePath);
Roslyn.VisualStudio.Next.UnitTests (3)
Remote\SnapshotSerializationTests.cs (3)
713=> throw new FileNotFoundException(fullPath); 716=> throw new FileNotFoundException(fullPath); 730=> throw new FileNotFoundException("can't find");
System.Console (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.Diagnostics.FileVersionInfo (2)
System\Diagnostics\FileVersionInfo.cs (1)
276throw new FileNotFoundException(fileName);
System\Diagnostics\FileVersionInfo.Unix.cs (1)
22throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, _fileName), _fileName);
System.Drawing.Common (3)
System\Drawing\Icon.cs (1)
162throw new FileNotFoundException(message: null, fileName: filePath);
System\Drawing\Image.cs (1)
95throw new FileNotFoundException(filename);
System\Drawing\Text\PrivateFontCollection.cs (1)
55throw new FileNotFoundException();
System.Formats.Tar (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System\Formats\Tar\TarFile.cs (2)
266throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, sourceFileName)); 313return Task.FromException(new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, sourceFileName)));
System.IO.Compression.ZipFile (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.IO.FileSystem.DriveInfo (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.IO.FileSystem.Watcher (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (2)
307throw new FileNotFoundException(SR.Format(SR.PathNotFound_Path, sourceFileName)); 335throw new FileNotFoundException(SR.Format(SR.PathNotFound_Path, sourceFileName));
System.IO.MemoryMappedFiles (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.IO.Pipes (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.IO.Ports (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
System.Private.CoreLib (11)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
126new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : 127new FileNotFoundException(SR.IO_FileNotFound);
src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
34return new FileNotFoundException(
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
1054throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, fullSourceFileName), fullSourceFileName);
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (2)
40throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, FullPath), FullPath); 167throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, FullName), FullName);
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
292throw new FileNotFoundException(SR.Format(SR.FileNotFound_LoadFile, normalizedPath), normalizedPath);
src\System\Reflection\RuntimeAssembly.cs (3)
439throw new FileNotFoundException(SR.IO_NoFileTableInInMemoryAssemblies); 457throw new FileNotFoundException(SR.IO_NoFileTableInInMemoryAssemblies); 678throw new FileNotFoundException(SR.Format(culture, SR.IO_FileNotFound_FileName, an.Name));
src\System\Reflection\TypeNameResolver.CoreCLR.cs (1)
172throw new FileNotFoundException(SR.Format(SR.FileNotFound_ResolveAssembly, assemblyName));
System.Private.Windows.Core (1)
Windows\Win32\Graphics\GdiPlus\StatusExtensions.cs (1)
45return new FileNotFoundException(SR.GdiplusFileNotFound);
System.Private.Xml (1)
System\Xml\Serialization\Compilation.cs (1)
210throw new FileNotFoundException(null, serializerName);
System.Reflection.MetadataLoadContext (3)
System\Reflection\MetadataLoadContext.CoreAssembly.cs (1)
46e = new FileNotFoundException(SR.UnableToDetermineCoreAssembly);
System\Reflection\MetadataLoadContext.Resolving.cs (1)
64return new RoExceptionAssembly(new FileNotFoundException(SR.Format(SR.FileNotFoundAssembly, refName.FullName)));
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.Modules.cs (1)
33throw new FileNotFoundException(SR.Format(SR.FileNotFoundModule, moduleName));
System.Windows.Forms.IntegrationTests.Common (3)
TestHelpers.cs (3)
63throw new FileNotFoundException("File does not exist", exePath); 83throw new FileNotFoundException("File does not exist", path); 187throw new FileNotFoundException("global.json does not exist");
System.Windows.Forms.Tests (1)
System\Windows\Forms\ClipboardTests.cs (1)
501Clipboard.SetData(format, new FileNotFoundException());
VBCSCompiler.UnitTests (1)
CompilerServerTests.cs (1)
1481throw new FileNotFoundException();
WinShimmer (1)
Program.cs (1)
33throw new FileNotFoundException($"The executable {exePath} was not found.");
176 references to FileNotFoundException
Aspire.Dashboard.Tests (1)
Integration\StartupTests.cs (1)
73var ex = await Assert.ThrowsAsync<FileNotFoundException>(async () =>
Aspire.Hosting.Containers.Tests (8)
WithDockerfileTests.cs (8)
540var ex = Assert.Throws<FileNotFoundException>(() => 555var ex = Assert.Throws<FileNotFoundException>(() => 569var ex = Assert.Throws<FileNotFoundException>(() => 584var ex = Assert.Throws<FileNotFoundException>(() =>
csc (1)
src\Compilers\CSharp\csc\Program.cs (1)
20catch (FileNotFoundException e)
dotnet-svcutil-lib (1)
TypeLoader.cs (1)
104catch (FileNotFoundException)
Microsoft.Analyzers.Local (1)
ApiLifecycle\ModelLoader.cs (1)
51catch (FileNotFoundException)
Microsoft.AspNetCore (1)
WebApplicationBuilder.cs (1)
283catch (FileNotFoundException)
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\LazyAssemblyLoader.cs (1)
59catch (FileNotFoundException ex)
Microsoft.AspNetCore.Http.Extensions.Tests (1)
SendFileResponseExtensionsTests.cs (1)
15return Assert.ThrowsAsync<FileNotFoundException>(() => response.SendFileAsync("foo"));
Microsoft.AspNetCore.Http.Results.Tests (3)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
418await Assert.ThrowsAsync<FileNotFoundException>(
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (2)
478var ex = await Assert.ThrowsAsync<FileNotFoundException>(() => ExecuteAsync(httpContext, path, "text/plain"));
Microsoft.AspNetCore.Mvc.Core.Test (4)
ApplicationParts\RelatedAssemblyPartTest.cs (1)
51Assert.Throws<FileNotFoundException>(() => RelatedAssemblyAttribute.GetRelatedAssemblies(assembly, throwOnError: true));
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
418await Assert.ThrowsAsync<FileNotFoundException>(
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (2)
478var ex = await Assert.ThrowsAsync<FileNotFoundException>(() => ExecuteAsync(httpContext, path, "text/plain"));
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
161catch (FileNotFoundException)
Microsoft.AspNetCore.StaticFiles (3)
HtmlDirectoryFormatter.cs (2)
155catch (FileNotFoundException) 191catch (FileNotFoundException)
StaticFileContext.cs (1)
329catch (FileNotFoundException)
Microsoft.Build (4)
AssemblyNameExtension.cs (1)
198catch (FileNotFoundException)
BackEnd\Components\SdkResolution\SdkResolverService.cs (1)
331catch (Exception e) when ((e is FileNotFoundException || e is FileLoadException) && sdkResolver.GetType().GetTypeInfo().Name.Equals("NuGetSdkResolver", StringComparison.Ordinal))
ManagedFileSystem.cs (1)
76catch (FileNotFoundException ex) when (ex.FusionLog != null)
TaskEngineAssemblyResolver.cs (1)
133catch (FileNotFoundException)
Microsoft.Build.Engine (1)
Engine\TaskEngineAssemblyResolver.cs (1)
102catch (FileNotFoundException)
Microsoft.Build.Engine.UnitTests (1)
BackEnd\CustomTaskHelper.cs (1)
66catch (FileNotFoundException)
Microsoft.Build.Tasks.Core (7)
AssemblyDependency\ReferenceTable.cs (2)
663catch (FileNotFoundException e) // Why isn't this covered in NotExpectedException? 1182catch (FileNotFoundException e) // Why isn't this covered in NotExpectedException?
AssemblyDependency\ResolveAssemblyReference.cs (1)
2612catch (System.IO.FileNotFoundException)
AssemblyNameExtension.cs (1)
198catch (FileNotFoundException)
ManifestUtil\XmlUtil.cs (2)
168catch (FileNotFoundException) 185catch (FileNotFoundException)
SignFile.cs (1)
67catch (FileNotFoundException ex)
Microsoft.Build.Tasks.UnitTests (1)
FileStateTests.cs (1)
393Assert.Throws<FileNotFoundException>(() =>
Microsoft.CodeAnalysis (11)
CommandLine\CommonCompiler.cs (1)
508if (e is FileNotFoundException || e is DirectoryNotFoundException)
MetadataReference\ModuleMetadata.cs (1)
265/// <exception cref="FileNotFoundException">File <paramref name="path"/> not found.</exception>
MetadataReference\PortableExecutableReference.cs (5)
137/// <exception cref="FileNotFoundException">The metadata image is stored in a file that can't be found.</exception> 167/// <exception cref="FileNotFoundException">The metadata image is stored in a file that can't be found.</exception> 180/// <exception cref="FileNotFoundException">The metadata image is stored in a file that can't be found.</exception> 194var fileNotFound = e as FileNotFoundException;
ReferenceManager\CommonReferenceManager.Resolution.cs (1)
472/// If any of the following exceptions: <see cref="BadImageFormatException"/>, <see cref="FileNotFoundException"/>, <see cref="IOException"/>,
RuleSet\RuleSet.cs (1)
322if (e is FileNotFoundException || e.GetType().Name == "DirectoryNotFoundException")
RuleSet\RuleSetInclude.cs (1)
63catch (FileNotFoundException)
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (1)
36var fusionLog = (exception as FileNotFoundException)?.FusionLog;
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
ExpressionCompiler.cs (1)
338catch (FileNotFoundException)
Microsoft.CodeAnalysis.Features (3)
EditAndContinue\DebuggingSession.cs (1)
272catch (Exception e) when (e is FileNotFoundException or DirectoryNotFoundException)
Emit\CompilationOutputFilesWithImplicitPdbPath.cs (1)
91catch (Exception e) when (e is FileNotFoundException or DirectoryNotFoundException)
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (1)
36var fusionLog = (exception as FileNotFoundException)?.FusionLog;
Microsoft.CodeAnalysis.LanguageServer (2)
CustomExportAssemblyLoader.cs (1)
51catch (FileNotFoundException ex)
Testing\RunTestsHandler.cs (1)
183catch (FileNotFoundException)
Microsoft.CodeAnalysis.Scripting (3)
Hosting\AssemblyLoader\InteractiveAssemblyLoader.cs (1)
132catch (FileNotFoundException)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (1)
620catch (Exception e) when (fileMayNotExist && (e is FileNotFoundException || e is DirectoryNotFoundException))
src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs (1)
152if (e is FileNotFoundException || e is DirectoryNotFoundException)
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (1)
MetadataShadowCopyProviderTests.cs (1)
190Assert.Throws<FileNotFoundException>(() => _provider.GetMetadata(f1, MetadataImageKind.Assembly));
Microsoft.CodeAnalysis.UnitTests (3)
AnalyzerAssemblyLoaderTests.cs (1)
325Assert.IsAssignableFrom<FileNotFoundException>(exception.InnerException);
MetadataReferences\ModuleMetadataTests.cs (2)
123Assert.Throws<FileNotFoundException>(() => ModuleMetadata.CreateFromFile(systemDrive + @":\file_that_does_not_exists.dll")); 124Assert.Throws<FileNotFoundException>(() => ModuleMetadata.CreateFromFile(systemDrive + @":\directory_that_does_not_exists\file_that_does_not_exists.dll"));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
VisualStudioMSBuildWorkspaceTests.cs (6)
927await Assert.ThrowsAsync<FileNotFoundException>(() => workspace.OpenSolutionAsync(solutionFilePath)); 1065await Assert.ThrowsAsync<FileNotFoundException>(() => workspace.OpenSolutionAsync(solutionFilePath)); 1207await Assert.ThrowsAsync<FileNotFoundException>(async () => 1267await Assert.ThrowsAsync<FileNotFoundException>(async () => 2629await Assert.ThrowsAsync<FileNotFoundException>(async () => 2643await Assert.ThrowsAsync<FileNotFoundException>(async () =>
Microsoft.DotNet.Build.Tasks.Workloads (1)
WorkloadManifestPackage.wix.cs (1)
102/// <exception cref="FileNotFoundException" />
Microsoft.DotNet.Internal.SymbolHelper (3)
SymbolUploadHelperFactory.cs (3)
39/// <exception cref="FileNotFoundException">If the symbol tool is not found after download.</exception> 68/// <exception cref="FileNotFoundException">If the symbol tool is not found after download.</exception> 90/// <exception cref="FileNotFoundException">If the symbol tool is not found after download.</exception>
Microsoft.DotNet.XliffTasks (3)
Tasks\EnsureAllResourcesTranslated.cs (1)
37catch (FileNotFoundException)
Tasks\SortXlf.cs (1)
33catch (FileNotFoundException)
Tasks\UpdateXlf.cs (1)
46catch (FileNotFoundException fileNotFoundEx) when (fileNotFoundEx.FileName == xlfPath)
Microsoft.Extensions.Configuration.FileExtensions (1)
FileConfigurationProvider.cs (1)
120/// <exception cref="FileNotFoundException">Optional is <c>false</c> on the source and a
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Linux\OSFileSystemTests.cs (1)
175Assert.Throws<FileNotFoundException>(() => osFileSystem.ReadAllByLines(fileInfo, new BufferWriter<char>()).ToList());
Microsoft.Extensions.FileProviders.Abstractions (1)
NotFoundFileInfo.cs (1)
55/// <exception cref="FileNotFoundException">In all cases.</exception>
Microsoft.Extensions.Hosting (1)
HostingHostBuilderExtensions.cs (1)
251catch (FileNotFoundException)
Microsoft.Extensions.SecretManager.Tools.Tests (5)
MsBuildProjectFinderTest.cs (5)
36Assert.Throws<FileNotFoundException>(() => finder.FindMsBuildProject(null)); 48Assert.Throws<FileNotFoundException>(() => finder.FindMsBuildProject(null)); 61Assert.Throws<FileNotFoundException>(() => finder.FindMsBuildProject(null)); 72Assert.Throws<FileNotFoundException>(() => finder.FindMsBuildProject("test.csproj")); 82Assert.Throws<FileNotFoundException>(() => finder.FindMsBuildProject(null));
Microsoft.VisualBasic.Core (9)
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (1)
360ByVal ResourceID As String, ByVal ParamArray PlaceHolders() As String) As IO.FileNotFoundException
Microsoft\VisualBasic\CompilerServices\VB6InputFile.vb (1)
36Catch ex As FileNotFoundException
Microsoft\VisualBasic\CompilerServices\VB6OutputFile.vb (1)
50Catch ex As FileNotFoundException
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (1)
36Catch ex As FileNotFoundException
Microsoft\VisualBasic\FileIO\FileSystem.vb (4)
546''' <exception cref="IO.FileNotFoundException">if a file does not exist at FilePath</exception> 658''' <exception cref="IO.FileNotFoundException">If directory does not point to an existing directory.</exception> 701''' <exception cref="IO.FileNotFoundException">If file does not point to an existing file.</exception> 1332TypeOf ex Is IO.FileNotFoundException Or TypeOf ex Is ObjectDisposedException Or
Microsoft\VisualBasic\FileSystem.vb (1)
290Catch ex As FileNotFoundException
Microsoft.VisualBasic.IntegrationTests (1)
InteractionTests.cs (1)
109_ = Assert.Throws<FileNotFoundException>(() => Interaction.Shell(path)).ToString();
Microsoft.VisualBasic.Tests (3)
Microsoft\VisualBasic\Devices\AudioTests.cs (2)
18testCode.Should().Throw<FileNotFoundException>(); 39testCode.Should().Throw<FileNotFoundException>();
Microsoft\VisualBasic\MyServices\FileSystemProxyTests.cs (1)
665Assert.Throws<FileNotFoundException>(() => _fileSystem.RenameFile(Path.Combine(TestDirectory, "DoesNotExistFile"), "NewFile"));
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\MetadataReferences\VisualStudioFrameworkAssemblyPathResolverFactory.cs (1)
93catch (FileNotFoundException)
MSBuild (3)
AssemblyNameExtension.cs (1)
198catch (FileNotFoundException)
ManagedFileSystem.cs (1)
76catch (FileNotFoundException ex) when (ex.FusionLog != null)
TaskEngineAssemblyResolver.cs (1)
133catch (FileNotFoundException)
MSBuildTaskHost (2)
AssemblyNameExtension.cs (1)
198catch (FileNotFoundException)
TaskEngineAssemblyResolver.cs (1)
133catch (FileNotFoundException)
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
325[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileNotFoundException))]
netstandard (1)
netstandard.cs (1)
920[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileNotFoundException))]
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
2630catch (FileNotFoundException)
PresentationCore (2)
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\InputPane.cs (1)
202|| e is FileNotFoundException
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\UISettings.cs (1)
126catch (Exception e) when (e is TypeLoadException || e is FileNotFoundException)
PresentationFramework (2)
System\Windows\Documents\Serialization\SerializerProvider.cs (1)
171catch (FileNotFoundException)
System\Windows\SystemResources.cs (1)
809catch (FileNotFoundException)
PresentationUI (1)
MS\Internal\Documents\Application\RightsManagementErrorHandler.cs (1)
272(exception is System.IO.FileNotFoundException) ||
RemoteExecutorConsoleApp (1)
RemoteExecutorConsoleApp.cs (1)
50catch (FileNotFoundException)
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
209catch (FileNotFoundException)
System.ComponentModel.Composition (6)
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (5)
54/// <exception cref="FileNotFoundException"> 110/// <exception cref="FileNotFoundException"> 167/// <exception cref="FileNotFoundException"> 231/// <exception cref="FileNotFoundException"> 568catch (FileNotFoundException)
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (1)
671catch (FileNotFoundException ex)
System.Drawing.Common (2)
System\Drawing\Image.cs (1)
71or FileNotFoundException)
System\Drawing\SystemFonts.cs (1)
145or FileNotFoundException);
System.Drawing.Common.Tests (10)
System\Drawing\IconTests.cs (2)
394Assert.Throws<FileNotFoundException>(() => Icon.ExtractAssociatedIcon("http://microsoft.com")); 413Assert.Throws<FileNotFoundException>(() => Icon.ExtractAssociatedIcon("no-such-file.png"));
System\Drawing\ImageTests.cs (4)
530Assert.Throws<FileNotFoundException>(() => Image.FromFile(fileName)); 531Assert.Throws<FileNotFoundException>(() => Image.FromFile(fileName, 539Assert.Throws<FileNotFoundException>(() => Image.FromFile("NoSuchFile")); 540Assert.Throws<FileNotFoundException>(() => Image.FromFile("NoSuchFile", useEmbeddedColorManagement: true));
System\Drawing\Text\PrivateFontCollectionTests.cs (4)
100AssertExtensions.Throws<FileNotFoundException>(() => fontCollection.AddFontFile(string.Empty)); 107Assert.Throws<FileNotFoundException>(() => fontCollection.AddFontFile("fileName")); 114Assert.Throws<FileNotFoundException>( 122AssertExtensions.Throws<FileNotFoundException, ExternalException>(() => fontCollection.AddFontFile(AppContext.BaseDirectory));
System.Formats.Tar (2)
System\Formats\Tar\TarFile.cs (2)
248/// <exception cref="FileNotFoundException"> The <paramref name="sourceFileName"/> file path was not found.</exception> 291/// <exception cref="FileNotFoundException"> The <paramref name="sourceFileName"/> file path was not found.</exception>
System.IO (1)
System.IO.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileNotFoundException))]
System.IO.Compression.ZipFile (9)
System\IO\Compression\ZipFile.Create.cs (3)
25/// <exception cref="FileNotFoundException">The file specified in archiveFileName was not found.</exception> 48/// <exception cref="FileNotFoundException">The file specified in <code>archiveFileName</code> was not found. </exception> 85/// <exception cref="FileNotFoundException">The file specified in <code>archiveFileName</code> was not found. </exception>
System\IO\Compression\ZipFile.Extract.cs (4)
32/// <exception cref="FileNotFoundException">sourceArchive was not found.</exception> 64/// <exception cref="FileNotFoundException">sourceArchive was not found.</exception> 97/// <exception cref="FileNotFoundException">sourceArchive was not found.</exception> 151/// <exception cref="FileNotFoundException">sourceArchive was not found.</exception>
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.cs (2)
35/// <exception cref="FileNotFoundException">The file specified in sourceFileName was not found. </exception> 66/// <exception cref="FileNotFoundException">The file specified in sourceFileName was not found. </exception>
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (2)
305catch (FileNotFoundException) 333catch (FileNotFoundException)
System.Net.NetworkInformation (3)
System\Net\NetworkInformation\LinuxNetworkInterface.cs (1)
60catch (Exception e) when (e is FileNotFoundException || e is UnauthorizedAccessException)
System\Net\NetworkInformation\UnixIPInterfaceProperties.cs (2)
105catch (FileNotFoundException) 118catch (FileNotFoundException)
System.Net.Sockets (5)
System\Net\Sockets\Socket.cs (2)
1229/// <exception cref="FileNotFoundException">The file <paramref name="fileName"/> was not found.</exception> 1255/// <exception cref="FileNotFoundException">The file <paramref name="fileName"/> was not found.</exception>
System\Net\Sockets\Socket.Tasks.cs (2)
731/// <exception cref="FileNotFoundException">The file <paramref name="fileName"/> was not found.</exception> 749/// <exception cref="FileNotFoundException">The file <paramref name="fileName"/> was not found.</exception>
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (1)
276if (exc is FileNotFoundException fnfe)
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
139/// If the path doesn't exist as of the last cached state, the return value is `(UnixFileMode)(-1)`. <see cref="FileNotFoundException"/> or <see cref="DirectoryNotFoundException"/> can only be thrown when setting the value.
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (1)
366catch (FileNotFoundException)
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (1)
1019catch (FileNotFoundException fileNotFoundException) when (!_permitDeserialization)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
115catch (FileNotFoundException ex)
src\System\Reflection\Assembly.CoreCLR.cs (1)
39catch (FileNotFoundException)
src\System\Reflection\RuntimeAssembly.cs (1)
227catch (FileNotFoundException) when (!throwOnError)
System.Reflection.Metadata (2)
System\Reflection\Metadata\MetadataReader.netstandard.cs (1)
55/// <exception cref="FileNotFoundException">If <paramref name="assemblyFile"/> is not found.</exception>
System\Reflection\PortableExecutable\PEReader.cs (1)
818catch (FileNotFoundException)
System.Resources.Extensions (1)
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.TypeResolver.cs (1)
99catch (FileNotFoundException) { }
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
304[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.FileNotFoundException))]
System.ServiceModel.NetNamedPipe (2)
System\ServiceModel\Channels\PipeConnectionInitiator.cs (2)
273catch (FileNotFoundException) 280catch(FileNotFoundException)
System.Windows.Forms.Design (4)
System\Drawing\BitmapSelector.cs (1)
61catch (FileNotFoundException)
System\Drawing\Design\ToolboxItem.cs (2)
497catch (FileNotFoundException) 514catch (FileNotFoundException)
System\Windows\Forms\Design\ComponentTray.cs (1)
2373catch (FileNotFoundException e)
System.Windows.Forms.Tests (1)
System\Windows\Forms\CursorTests.cs (1)
142Assert.Throws<FileNotFoundException>(() => new Cursor("NoSuchFile"));
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
464catch (System.IO.FileNotFoundException)
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
62catch(System.IO.FileNotFoundException)
UIAutomationClientSideProviders (1)
MS\Internal\AutomationProxies\WindowsRichEdit.cs (1)
127catch (System.IO.FileNotFoundException)
vbc (1)
src\Compilers\VisualBasic\vbc\Program.cs (1)
22catch (FileNotFoundException e)