191 instantiations of DirectoryPath
dotnet (45)
BuildServer\BuildServerProvider.cs (2)
73return new DirectoryPath(directory); 76return new DirectoryPath(
CommandFactory\CommandResolution\LocalToolsCommandResolver.cs (1)
22private readonly ToolManifestFinder _toolManifest = toolManifest ?? new ToolManifestFinder(new DirectoryPath(currentWorkingDirectory ?? Directory.GetCurrentDirectory()));
Commands\Package\Add\PackageAddCommandParser.cs (2)
117var downloader = new NuGetPackageDownloader.NuGetPackageDownloader(packageInstallDir: new DirectoryPath()); 131var downloader = new NuGetPackageDownloader.NuGetPackageDownloader(packageInstallDir: new DirectoryPath());
Commands\Tool\Execute\ToolExecuteCommand.cs (1)
40private readonly ToolManifestFinder _toolManifestFinder = toolManifestFinder ?? new ToolManifestFinder(new DirectoryPath(currentWorkingDirectory ?? Directory.GetCurrentDirectory()));
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (2)
87var tempDir = new DirectoryPath(PathUtilities.CreateTempSubdirectory()); 155toolPath = new DirectoryPath(_toolPath);
Commands\Tool\Install\ToolInstallLocalCommand.cs (1)
58new ToolManifestFinder(new DirectoryPath(Directory.GetCurrentDirectory()));
Commands\Tool\List\ToolListGlobalOrToolPathCommand.cs (1)
48toolPath = new DirectoryPath(toolPathOption);
Commands\Tool\List\ToolListLocalCommand.cs (1)
29new ToolManifestFinder(new DirectoryPath(Directory.GetCurrentDirectory()));
Commands\Tool\Restore\ToolRestoreCommand.cs (1)
56?? new ToolManifestFinder(new DirectoryPath(Directory.GetCurrentDirectory()));
Commands\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommand.cs (1)
48toolDirectoryPath = new DirectoryPath(toolPath);
Commands\Tool\Uninstall\ToolUninstallLocalCommand.cs (1)
38new ToolManifestFinder(new DirectoryPath(Directory.GetCurrentDirectory()));
Commands\Tool\Update\ToolUpdateCommand.cs (1)
51DirectoryPath? location = string.IsNullOrWhiteSpace(_toolPath) ? null : new DirectoryPath(_toolPath);
Commands\Tool\Update\ToolUpdateLocalCommand.cs (1)
50new ToolManifestFinder(new DirectoryPath(Directory.GetCurrentDirectory()));
Commands\Workload\Install\FileBasedInstaller.cs (3)
59_tempPackagesDir = new DirectoryPath(tempDirPath ?? PathUtilities.CreateTempSubdirectory()); 213var packFiles = _nugetPackageDownloader.ExtractPackageAsync(packagePath, new DirectoryPath(tempExtractionDir)).GetAwaiter().GetResult(); 672await _nugetPackageDownloader.ExtractPackageAsync(nupkgPath, new DirectoryPath(extractionPath));
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (3)
755await _nugetPackageDownloader.ExtractPackageAsync(nupkgPath, new DirectoryPath(extractionPath)); 958_ = _nugetPackageDownloader.ExtractPackageAsync(packagePath, new DirectoryPath(extractionDirectory)).Result; 1128DirectoryPath tempPackagesDir = new(string.IsNullOrWhiteSpace(tempDirPath) ? PathUtilities.CreateTempSubdirectory() : tempDirPath);
Commands\Workload\Install\WorkloadInstallCommand.cs (2)
146DownloadToOfflineCacheAsync(workloadsToDownload, new DirectoryPath(_downloadToCacheOption), _skipManifestUpdate, _includePreviews).Wait(); 221DirectoryPath? offlineCache = string.IsNullOrWhiteSpace(_fromCacheOption) ? null : new DirectoryPath(_fromCacheOption);
Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
67var tempPackagesDir = new DirectoryPath(PathUtilities.CreateTempSubdirectory());
Commands\Workload\InstallingWorkloadCommand.cs (3)
372tempPath = new DirectoryPath(Path.Combine(TempDirectoryPath, "dotnet-manifest-extraction")); 377folderForManifestDownloads = new DirectoryPath(downloadFolder); 416DirectoryPath downloadFolderDirectoryPath = new(downloadFolder);
Commands\Workload\Update\WorkloadUpdateCommand.cs (3)
77DownloadToOfflineCacheAsync(new DirectoryPath(_downloadToCacheOption), _includePreviews).Wait(); 106new DirectoryPath(_fromCacheOption)) 149DirectoryPath? offlineCache = string.IsNullOrWhiteSpace(_fromCacheOption) ? null : new DirectoryPath(_fromCacheOption);
Commands\Workload\WorkloadCommandBase.cs (1)
111TempPackagesDirectory = new DirectoryPath(Path.Combine(TempDirectoryPath, "dotnet-sdk-advertising-temp"));
Commands\Workload\WorkloadIntegrityChecker.cs (1)
21var tempPackagesDirectory = new DirectoryPath(PathUtilities.CreateTempSubdirectory());
ShellShim\ShellShimRepositoryFactory.cs (1)
20return new DirectoryPath(CliFolderPathCalculator.ToolsShimPath);
ToolPackage\LocalToolsResolverCache.cs (1)
27cacheDirectory ?? new DirectoryPath(Path.Combine(CliFolderPathCalculator.ToolsResolverCachePath));
ToolPackage\ToolPackageDownloader.cs (3)
45new DirectoryPath(), 72includeUnlisted: includeUnlisted, downloadFolder: new DirectoryPath(packagesRootPath)).ConfigureAwait(false).GetAwaiter().GetResult(); 98nugetPackageDownloader.ExtractPackageAsync(packagePath, new DirectoryPath(nupkgDir)).ConfigureAwait(false).GetAwaiter().GetResult();
ToolPackage\ToolPackageDownloaderBase.cs (2)
53_localToolDownloadDir = new DirectoryPath(SettingsUtility.GetGlobalPackagesFolder(settings)); 56_localToolAssetDir = new DirectoryPath(_fileSystem.Directory.CreateTemporarySubdirectory());
ToolPackage\ToolPackageFactory.cs (2)
56return new DirectoryPath(CliFolderPathCalculator.ToolsPackagePath); 64? new DirectoryPath(
ToolPackage\ToolPackageStoreAndQuery.cs (3)
15public DirectoryPath Root { get; private set; } = new DirectoryPath(Path.GetFullPath(root.Value)); 94packageDirectory: new DirectoryPath(subdirectory), 95assetsJsonParentDirectory: new DirectoryPath(subdirectory), _fileSystem);
dotnet.Tests (121)
CommandFactoryTests\GivenALocalToolsCommandResolver.cs (6)
27_nugetGlobalPackagesFolder = new DirectoryPath(NuGetGlobalPackagesFolder.GetLocation()); 32new DirectoryPath(Path.Combine(temporaryDirectory, "cache"))); 90new(new DirectoryPath(_testDirectoryRoot), _fileSystem, new FakeDangerousFileDetector()); 123new(new DirectoryPath(_testDirectoryRoot), _fileSystem, new FakeDangerousFileDetector()); 164new(new DirectoryPath(_testDirectoryRoot), _fileSystem); 186new(new DirectoryPath(_testDirectoryRoot), _fileSystem);
CommandTests\Tool\Install\ToolInstallGlobalOrToolPathCommandTests.cs (7)
60var toolPackageStoreMock = new ToolPackageStoreAndQuery(new DirectoryPath(_pathToPlacePackages), _fileSystem); 65new DirectoryPath(_pathToPlaceShim), 73new DirectoryPath(_toolsDirectory), 122rootConfigDirectory: new DirectoryPath(testAsset.Path), 124var nuGetPackageDownloader = new NuGetPackageDownloader(new DirectoryPath(testAsset.Path)); 643nugetPackageDownloader: new NuGetPackageDownloader(new DirectoryPath(PathUtilities.CreateTempSubdirectory()), verifySignatures: false, currentWorkingDirectory: testDir), 654new DirectoryPath(_pathToPlaceShim),
CommandTests\Tool\Install\ToolInstallLocalCommandTests.cs (4)
51new(new DirectoryPath(_pathToPlacePackages), _fileSystem); 78new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 83_toolManifestFinder = new ToolManifestFinder(new DirectoryPath(_temporaryDirectory), _fileSystem, new FakeDangerousFileDetector()); 91new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")),
CommandTests\Tool\List\ToolListLocalCommandTests.cs (2)
40new DirectoryPath(_temporaryDirectory), 46new DirectoryPath(_temporaryDirectory),
CommandTests\Tool\Restore\ToolRestoreCommandTests.cs (15)
59_nugetGlobalPackagesFolder = new DirectoryPath(NuGetGlobalPackagesFolder.GetLocation()); 63new(new DirectoryPath(_pathToPlacePackages), _fileSystem); 107new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 119new DirectoryPath(_temporaryDirectory), 123new DirectoryPath(_temporaryDirectory), 158new DirectoryPath(_temporaryDirectory), 162new DirectoryPath(_temporaryDirectory), 195new DirectoryPath(_temporaryDirectory), 199new DirectoryPath(_temporaryDirectory), 252new DirectoryPath(_temporaryDirectory), 256new DirectoryPath(_temporaryDirectory), 297new DirectoryPath(_temporaryDirectory), 441new ToolManifestFinder(new DirectoryPath(Path.GetTempPath()), _fileSystem, new FakeDangerousFileDetector()); 466new DirectoryPath(_temporaryDirectory), 494new DirectoryPath(_temporaryDirectory),
CommandTests\Tool\Restore\ToolRestoreCommandWithMultipleNugetConfigTests.cs (4)
50new(new DirectoryPath(pathToPlacePackages), _fileSystem); 59new DirectoryPath(Path.Combine(temporaryDirectory, "cache")), 120new DirectoryPath(Path.GetDirectoryName(_nugetConfigUnderTestRoot)), 124new DirectoryPath(Path.GetDirectoryName(_nugetConfigUnderSubDir)),
CommandTests\Tool\Run\ToolRunCommandTests.cs (3)
23_nugetGlobalPackagesFolder = new DirectoryPath(NuGetGlobalPackagesFolder.GetLocation()); 76new ToolManifestFinder(new DirectoryPath(testDirectoryRoot.Path), fileSystem, new FakeDangerousFileDetector()); 86new DirectoryPath(Path.Combine(temporaryDirectory, "cache")));
CommandTests\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommandTests.cs (9)
72var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 114var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 133new DirectoryPath(_toolsDirectory), 143new DirectoryPath(_shimsDirectory), 184var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 232var store = new ToolPackageStoreMock(new DirectoryPath(_toolsDirectory), _fileSystem); 248new DirectoryPath(_shimsDirectory), 264new DirectoryPath(_toolsDirectory), 274new DirectoryPath(_shimsDirectory),
CommandTests\Tool\Uninstall\ToolUninstallLocalCommandTests.cs (1)
41_toolManifestFinder = new ToolManifestFinder(new DirectoryPath(_temporaryDirectory), _fileSystem, new FakeDangerousFileDetector());
CommandTests\Tool\Update\ToolUpdateGlobalOrToolPathCommandTests.cs (2)
47_store = new ToolPackageStoreMock(new DirectoryPath(_toolsDirectory), _fileSystem); 477new DirectoryPath(_shimsDirectory),
CommandTests\Tool\Update\ToolUpdateLocalCommandTests.cs (3)
64new(new DirectoryPath(_pathToPlacePackages), _fileSystem); 98new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 103_toolManifestFinder = new ToolManifestFinder(new DirectoryPath(_temporaryDirectory), _fileSystem,
CommandTests\Workload\Install\GivenDotnetWorkloadInstall.cs (1)
261installer.InstalledManifests[0].offlineCache.Should().Be(new DirectoryPath(cachePath));
CommandTests\Workload\Install\GivenFileBasedWorkloadInstall.cs (2)
390CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context, new DirectoryPath(cachePath))); 415CliTransaction.RunNew(context => installer.InstallWorkloads(new[] { new WorkloadId("android-sdk-workload") }, new SdkFeatureBand(version), context, new DirectoryPath(cachePath))));
CommandTests\Workload\Install\GivenWorkloadManifestUpdater.cs (4)
253await manifestUpdater.UpdateAdvertisingManifestsAsync(includePreviews: true, offlineCache: new DirectoryPath(offlineCacheDir)); 329await manifestUpdater.UpdateAdvertisingManifestsAsync(includePreviews: true, offlineCache: new DirectoryPath(offlineCacheDir)); 395await manifestUpdater.UpdateAdvertisingManifestsAsync(includePreviews: true, offlineCache: new DirectoryPath(offlineCacheDir)); 568await manifestUpdater.UpdateAdvertisingManifestsAsync(false, false, new DirectoryPath(offlineCache));
ShellShimTests\ShellShimRepositoryTests.cs (4)
70return new ShellShimRepository(new DirectoryPath(pathToShim), stage2AppHostTemplateDirectory); 102var shellShimRepository = new ShellShimRepository(new DirectoryPath(Path.Combine(testFolder, extraNonExistDirectory)), GetAppHostTemplateFromStage2()); 426var templateFinder = new ShellShimTemplateFinder(new MockNuGetPackageDownloader(), new DirectoryPath(tempDir), null); 523new DirectoryPath(pathToShim),
ToolManifestTests\ToolManifestEditorTests.cs (1)
178toolManifestFileEditor.Read(new FilePath(manifestFile), new DirectoryPath(_testDirectoryRoot));
ToolManifestTests\ToolManifestFinderTests.cs (53)
34new DirectoryPath(_testDirectoryRoot), 40new DirectoryPath(_testDirectoryRoot), 51new DirectoryPath(_testDirectoryRoot), 67new DirectoryPath(subdirectoryOfTestRoot), 84new DirectoryPath(_testDirectoryRoot), 96var rootDirectory = new DirectoryPath(_testDirectoryRoot); 106new DirectoryPath(_testDirectoryRoot), 118new DirectoryPath(rootDirectory.Value), 124new DirectoryPath(rootDirectory.Value), 134var rootDirectory = new DirectoryPath(_testDirectoryRoot); 144new DirectoryPath(_testDirectoryRoot), 157var rootDirectory = new DirectoryPath(_testDirectoryRoot); 167new DirectoryPath(_testDirectoryRoot), 187new DirectoryPath(rootDirectory.Value), 193new DirectoryPath(rootDirectory.Value), 207new DirectoryPath(_testDirectoryRoot), 225new DirectoryPath(_testDirectoryRoot), 251new DirectoryPath(_testDirectoryRoot), 267new DirectoryPath(_testDirectoryRoot), 282new DirectoryPath(_testDirectoryRoot), 302new DirectoryPath(_testDirectoryRoot), 319new DirectoryPath(_testDirectoryRoot), 336new DirectoryPath(_testDirectoryRoot), 356new DirectoryPath(subdirectoryOfTestRoot), 367new DirectoryPath(subdirectoryOfTestRoot), 376new DirectoryPath(_testDirectoryRoot), 384new DirectoryPath(subdirectoryOfTestRoot), 402new DirectoryPath(subdirectoryOfTestRoot), 433new DirectoryPath(subdirectoryOfTestRoot), 454new DirectoryPath(subdirectoryOfTestRoot), 469new DirectoryPath(_testDirectoryRoot), 486new DirectoryPath(_testDirectoryRoot), 501new DirectoryPath(_testDirectoryRoot), 511new DirectoryPath(_testDirectoryRoot), 521new DirectoryPath(_testDirectoryRoot), 531new DirectoryPath(_testDirectoryRoot), 542new DirectoryPath(subdirectoryOfTestRoot), 552new DirectoryPath(_testDirectoryRoot), 561new DirectoryPath(_testDirectoryRoot), 574new DirectoryPath(_testDirectoryRoot), 588new DirectoryPath(_testDirectoryRoot), 602new DirectoryPath(_testDirectoryRoot), 621new DirectoryPath(subdirectoryOfTestRoot), 631new DirectoryPath(subdirectoryOfTestRoot), 646new DirectoryPath(subdirectoryOfTestRoot), 663= new ToolManifestFinder(new DirectoryPath(_testDirectoryRoot), _fileSystem, fakeMarkOfTheWebDetector); 680new DirectoryPath(_testDirectoryRoot), 696new DirectoryPath(_testDirectoryRoot), 712new DirectoryPath(_testDirectoryRoot), 726new DirectoryPath(_testDirectoryRoot), 745var toolManifest = new ToolManifestFinder(new DirectoryPath(subdirectoryOfTestRoot), _fileSystem); 762var toolManifest = new ToolManifestFinder(new DirectoryPath(testRoot), _fileSystem); 772new DirectoryPath(_testDirectoryRoot),
Microsoft.DotNet.InternalAbstractions (4)
DirectoryPath.cs (3)
30return new DirectoryPath(Path.Combine(insertValueInFront)); 55return new DirectoryPath(parentDirectory.FullName); 68return new DirectoryPath(parentDirectory.FullName);
FilePath.cs (1)
31return new DirectoryPath(Path.GetDirectoryName(Value)!);
Microsoft.DotNet.PackageInstall.Tests (16)
LocalToolsResolverCacheTests.cs (3)
25new(fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath); 228new(fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath); 285new(fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath);
NuGetPackageInstallerExtractTests.cs (4)
26new(new DirectoryPath(Directory.GetCurrentDirectory()), null, 32IEnumerable<string> result = await installer.ExtractPackageAsync(packagePath, new DirectoryPath(targetPath)); 46new DirectoryPath(Directory.GetCurrentDirectory()), 69new(new DirectoryPath(Directory.GetCurrentDirectory()), null,
NuGetPackageInstallerTests.cs (3)
66new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName()); 113new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName()); 350new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName());
ToolPackageDownloaderTests.cs (3)
454var localToolDownloadDir = Path.Combine(new DirectoryPath(SettingsUtility.GetGlobalPackagesFolder(settings)).ToString().Trim('"'), TestPackageId.ToString()); 727var store = new ToolPackageStoreAndQuery(new DirectoryPath(root.Path)); 877var root = new DirectoryPath(_testAssetsManager.CreateTestDirectory(callingMethod, identifier: useMock.ToString() + identiifer).Path);
ToolPackageInstallerNugetCacheTests.cs (2)
40new DirectoryPath(testDirectory).WithSubDirectories(Path.GetRandomFileName()); 122var root = new DirectoryPath(Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()));
ToolPackageUninstallerTests.cs (1)
75var root = new DirectoryPath(_testAssetsManager.CreateTestDirectory(testName, identifier).Path);
Microsoft.DotNet.Tools.Tests.ComponentMocks (5)
ToolPackageDownloaderMock.cs (3)
63_localToolDownloadDir = new DirectoryPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "nuget", "package")); 64_localToolAssetDir = new DirectoryPath(PathUtilities.CreateTempSubdirectory()); 171packageDirectory = new DirectoryPath(NuGetGlobalPackagesFolder.GetLocation()).WithSubDirectories(packageId.ToString());
ToolPackageStoreMock.cs (2)
24Root = new DirectoryPath(Path.GetFullPath(root.Value)); 105new DirectoryPath(subdirectory),
246 references to DirectoryPath
dotnet (151)
BuildServer\BuildServerProvider.cs (2)
47var directory = GetPidFileDirectory(); 68public DirectoryPath GetPidFileDirectory()
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (4)
21internal delegate IShellShimRepository CreateShellShimRepository(string appHostSourceDirectory, DirectoryPath? nonGlobalLocation = null); 24DirectoryPath? nonGlobalLocation = null, 87var tempDir = new DirectoryPath(PathUtilities.CreateTempSubdirectory()); 152DirectoryPath? toolPath = null;
Commands\Tool\Install\ToolInstallLocalInstaller.cs (1)
73var rootConfigDirectory = manifestFile.GetDirectoryPath();
Commands\Tool\List\ToolListGlobalOrToolPathCommand.cs (3)
14internal delegate IToolPackageStoreQuery CreateToolPackageStore(DirectoryPath? nonGlobalLocation = null); 37DirectoryPath? toolPath = null; 71public IEnumerable<IToolPackage> GetPackages(DirectoryPath? toolPath, PackageId? packageId)
Commands\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommand.cs (3)
18internal delegate IShellShimRepository CreateShellShimRepository(string appHostSourceDirectory, DirectoryPath? nonGlobalLocation = null); 19internal delegate (IToolPackageStore, IToolPackageStoreQuery, IToolPackageUninstaller) CreateToolPackageStoresAndUninstaller(DirectoryPath? nonGlobalLocation = null); 37DirectoryPath? toolDirectoryPath = null;
Commands\Tool\Update\ToolUpdateCommand.cs (1)
51DirectoryPath? location = string.IsNullOrWhiteSpace(_toolPath) ? null : new DirectoryPath(_toolPath);
Commands\Tool\Update\ToolUpdateGlobalOrToolPathCommand.cs (1)
17DirectoryPath? nonGlobalLocation = null,
Commands\Workload\Install\FileBasedInstaller.cs (12)
35protected readonly DirectoryPath _tempPackagesDir; 98public WorkloadSet InstallWorkloadSet(ITransactionContext context, string workloadSetVersion, DirectoryPath? offlineCache = null) 138public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 143public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, bool overwriteExistingPacks, DirectoryPath? offlineCache = null) 220FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(tempExtractionDir, packInfo.Path)); 263public void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null) 273public void InstallWorkloadManifest(ManifestVersionUpdate manifestUpdate, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 301void InstallPackage(PackageId packageId, string packageVersion, string targetFolder, ITransactionContext transactionContext, DirectoryPath? offlineCache) 332FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(targetFolder, tempBackupDir)); 344FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(tempBackupDir, targetFolder)); 392public void GarbageCollect(Func<string, IWorkloadResolver> getResolverForWorkloadSet, DirectoryPath? offlineCache = null, bool cleanAllPacks = false) 678FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(Path.Combine(extractionPath, "data"), targetPath));
Commands\Workload\Install\IInstaller.cs (5)
19void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null); 21void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null); 23void GarbageCollect(Func<string, IWorkloadResolver> getResolverForWorkloadSet, DirectoryPath? offlineCache = null, bool cleanAllPacks = false); 25WorkloadSet InstallWorkloadSet(ITransactionContext context, string workloadSetVersion, DirectoryPath? offlineCache = null); 27void InstallWorkloadManifest(ManifestVersionUpdate manifestUpdate, ITransactionContext transactionContext, DirectoryPath? offlineCache = null);
Commands\Workload\Install\IWorkloadManifestUpdater.cs (1)
13Task UpdateAdvertisingManifestsAsync(bool includePreviews, bool useWorkloadSets = false, DirectoryPath? offlineCache = null);
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (16)
120public void GarbageCollect(Func<string, IWorkloadResolver> getResolverForWorkloadSet, DirectoryPath? offlineCache = null, bool cleanAllPacks = false) 307public WorkloadSet InstallWorkloadSet(ITransactionContext context, string workloadSetVersion, DirectoryPath? offlineCache) 348(MsiPayload msi, string msiPackageId, string installationFolder) GetWorkloadSetPayload(string workloadSetVersion, DirectoryPath? offlineCache) 425private void RemoveWorkloadSets(List<WorkloadSetRecord> workloadSetsToRemove, DirectoryPath? offlineCache) 451private void RemoveWorkloadManifests(List<WorkloadManifestRecord> manifestToRemove, DirectoryPath? offlineCache) 477private void RemoveWorkloadPacks(List<WorkloadPackRecord> packsToRemove, DirectoryPath? offlineCache) 539public void InstallWorkloadManifest(ManifestVersionUpdate manifestUpdate, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 560void InstallWorkloadManifestImplementation(ManifestVersionUpdate manifestUpdate, DirectoryPath? offlineCache = null, InstallAction action = InstallAction.Install) 587public void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null) 613public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 666void RollBackMsiInstall(WorkloadDownload msiToRollback, DirectoryPath? offlineCache = null) 766FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(extractedManifestPath, targetPath)); 809FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(manifestFolder, targetPath)); 931private string ExtractPackage(string packageId, string packageVersion, DirectoryPath? offlineCache) 994private MsiPayload GetCachedMsiPayload(string packageId, string packageVersion, DirectoryPath? offlineCache) 1128DirectoryPath tempPackagesDir = new(string.IsNullOrWhiteSpace(tempDirPath) ? PathUtilities.CreateTempSubdirectory() : tempDirPath);
Commands\Workload\Install\WorkloadInstallCommand.cs (3)
221DirectoryPath? offlineCache = string.IsNullOrWhiteSpace(_fromCacheOption) ? null : new DirectoryPath(_fromCacheOption); 295internal static void TryRunGarbageCollection(IInstaller workloadInstaller, IReporter reporter, VerbosityOptions verbosity, Func<string, IWorkloadResolver> getResolverForWorkloadSet, DirectoryPath? offlineCache = null) 325private Task DownloadToOfflineCacheAsync(IEnumerable<WorkloadId> workloadIds, DirectoryPath offlineCache, bool skipManifestUpdate, bool includePreviews)
Commands\Workload\Install\WorkloadManifestUpdater.cs (4)
67var tempPackagesDir = new DirectoryPath(PathUtilities.CreateTempSubdirectory()); 81public async Task UpdateAdvertisingManifestsAsync(bool includePreviews, bool useWorkloadSets = false, DirectoryPath? offlineCache = null) 312private async Task<bool> UpdateManifestWithVersionAsync(string id, bool includePreviews, SdkFeatureBand band, NuGetVersion packageVersion = null, DirectoryPath? offlineCache = null) 395private async Task UpdateAdvertisingManifestAsync(WorkloadManifestInfo manifest, bool includePreviews, DirectoryPath? offlineCache = null)
Commands\Workload\InstallingWorkloadCommand.cs (4)
185protected void UpdateWorkloadManifests(WorkloadHistoryRecorder recorder, ITransactionContext context, DirectoryPath? offlineCache) 366DirectoryPath? tempPath = null; 371DirectoryPath folderForManifestDownloads; 416DirectoryPath downloadFolderDirectoryPath = new(downloadFolder);
Commands\Workload\Update\WorkloadUpdateCommand.cs (3)
149DirectoryPath? offlineCache = string.IsNullOrWhiteSpace(_fromCacheOption) ? null : new DirectoryPath(_fromCacheOption); 181private void UpdateInstalledWorkloadsFromHistory(ITransactionContext context, DirectoryPath? offlineCache) 202private async Task DownloadToOfflineCacheAsync(DirectoryPath offlineCache, bool includePreviews)
Commands\Workload\WorkloadCommandBase.cs (1)
46protected DirectoryPath TempPackagesDirectory
Commands\Workload\WorkloadIntegrityChecker.cs (1)
21var tempPackagesDirectory = new DirectoryPath(PathUtilities.CreateTempSubdirectory());
NugetPackageDownloader\INuGetPackageDownloader.cs (2)
20DirectoryPath? downloadFolder = null, 28Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder);
NugetPackageDownloader\NuGetPackageDownloader.cs (4)
31private readonly DirectoryPath _packageInstallDir; 53DirectoryPath packageInstallDir, 97DirectoryPath? downloadFolder = null, 228public async Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder)
NugetPackageDownloader\PackageSourceLocation.cs (2)
14DirectoryPath? rootConfigDirectory = null, 30public DirectoryPath? RootConfigDirectory { get; }
ShellShim\ShellShimRepository.cs (2)
13DirectoryPath shimsDirectory, 19private readonly DirectoryPath _shimsDirectory = shimsDirectory;
ShellShim\ShellShimRepositoryFactory.cs (2)
13public static IShellShimRepository CreateShellShimRepository(string appHostSourceDirectory, DirectoryPath? nonGlobalLocation = null) 18private static DirectoryPath GetShimLocation()
ShellShim\ShellShimTemplateFinder.cs (2)
17DirectoryPath tempDir, 20private readonly DirectoryPath _tempDir = tempDir;
ToolManifest\ToolManifestEditor.cs (2)
113Read(FilePath manifest, DirectoryPath correspondingDirectory) 226DirectoryPath correspondingDirectory)
ToolManifest\ToolManifestFinder.cs (19)
14private readonly DirectoryPath _probeStart; 22DirectoryPath probeStart, 36IEnumerable<(FilePath manifestfile, DirectoryPath _)> allPossibleManifests = 53IEnumerable<(FilePath manifestfile, DirectoryPath _)> allPossibleManifests = 65IEnumerable<(FilePath manifestfile, DirectoryPath _)> allPossibleManifests, 70foreach ((FilePath possibleManifest, DirectoryPath correspondingDirectory) in allPossibleManifests) 103foreach ((FilePath possibleManifest, DirectoryPath correspondingDirectory) in 135foreach ((FilePath possibleManifest, DirectoryPath correspondingDirectory) in 160private IEnumerable<(FilePath manifestfile, DirectoryPath manifestFileFirstEffectDirectory)> 163DirectoryPath? currentSearchDirectory = _probeStart; 166var currentSearchDotConfigDirectory = 195foreach ((FilePath possibleManifest, DirectoryPath _) in EnumerateDefaultAllPossibleManifests()) 204DirectoryPath manifestInsertFolder = GetDirectoryToCreateToolManifest(); 219private DirectoryPath GetDirectoryToCreateToolManifest() 221DirectoryPath? currentSearchDirectory = _probeStart; 224var currentSearchGitDirectory = currentSearchDirectory.Value.WithSubDirectories(Constants.GitDirectoryName); 244private string WriteManifestFile(DirectoryPath folderPath) 266DirectoryPath? rootPath = null; 268DirectoryPath correspondingDirectory)
ToolManifest\ToolManifestPackage.cs (2)
16DirectoryPath firstEffectDirectory, 28public DirectoryPath FirstEffectDirectory { get; } = firstEffectDirectory;
ToolPackage\IToolPackage.cs (1)
22DirectoryPath PackageDirectory { get; }
ToolPackage\IToolPackageStore.cs (5)
13DirectoryPath Root { get; } 15DirectoryPath GetRandomStagingDirectory(); 17NuGetVersion GetStagedPackageVersion(DirectoryPath stagingDirectory, PackageId packageId); 19DirectoryPath GetRootPackageDirectory(PackageId packageId); 21DirectoryPath GetPackageDirectory(PackageId packageId, NuGetVersion version);
ToolPackage\IToolPackageUninstaller.cs (1)
12void Uninstall(DirectoryPath packageDirectory);
ToolPackage\LocalToolsResolverCache.cs (3)
17private readonly DirectoryPath _cacheVersionedDirectory; 22DirectoryPath? cacheDirectory = null, 26DirectoryPath appliedCacheDirectory =
ToolPackage\PackageLocation.cs (2)
12DirectoryPath? rootConfigDirectory = null, 17public DirectoryPath? RootConfigDirectory { get; } = rootConfigDirectory;
ToolPackage\ToolPackageDownloader.cs (3)
120protected override ToolConfiguration GetToolConfiguration(PackageId id, DirectoryPath packageDirectory, DirectoryPath assetsJsonParentDirectory) 128DirectoryPath packagesRootPath,
ToolPackage\ToolPackageDownloaderBase.cs (12)
27protected readonly DirectoryPath _globalToolStageDir; 31protected readonly DirectoryPath _localToolDownloadDir; 35protected readonly DirectoryPath _localToolAssetDir; 83DirectoryPath packagesRootPath, 90DirectoryPath packageDirectory, 91DirectoryPath assetsJsonParentDirectory); 185var toolStoreTargetDirectory = _toolPackageStore.GetPackageDirectory(packageId, packageVersion); 222DirectoryPath packageRootDirectory = _toolPackageStore.GetRootPackageDirectory(packageId); 265DirectoryPath packageDownloadDir, 271DirectoryPath assetFileDirectory, 332DirectoryPath packageDownloadDir, 333DirectoryPath assetFileDirectory,
ToolPackage\ToolPackageFactory.cs (6)
14DirectoryPath? nonGlobalLocation = null, string runtimeJsonPathForTests = null) 23DirectoryPath? nonGlobalLocation = null) 37DirectoryPath? nonGlobalLocation = null, IEnumerable<string> additionalRestoreArguments = null, string currentWorkingDirectory = null) 49DirectoryPath? nonGlobalLocation = null) 54private static DirectoryPath GetPackageLocation() 60DirectoryPath? nonGlobalLocation = null)
ToolPackage\ToolPackageInstance.cs (6)
30public DirectoryPath PackageDirectory { get; private set; } 46DirectoryPath packageDirectory, 47DirectoryPath assetsJsonParentDirectory, 163DirectoryPath packageDirectory, 164DirectoryPath assetsJsonParentDirectory, IFileSystem fileSystem) 172private static ToolConfiguration DeserializeToolConfiguration(LockFileTargetLibrary library, DirectoryPath packageDirectory, IFileSystem fileSystem)
ToolPackage\ToolPackageStoreAndQuery.cs (8)
11internal class ToolPackageStoreAndQuery(DirectoryPath root, IFileSystem fileSystem = null) : IToolPackageStoreQuery, IToolPackageStore 15public DirectoryPath Root { get; private set; } = new DirectoryPath(Path.GetFullPath(root.Value)); 19public DirectoryPath GetRandomStagingDirectory() 24public NuGetVersion GetStagedPackageVersion(DirectoryPath stagingDirectory, PackageId packageId) 41public DirectoryPath GetRootPackageDirectory(PackageId packageId) 46public DirectoryPath GetPackageDirectory(PackageId packageId, NuGetVersion version) 84var packageRootDirectory = Root.WithSubDirectories(packageId.ToString()); 106var directory = GetPackageDirectory(packageId, version);
ToolPackage\ToolPackageUninstaller.cs (2)
15public void Uninstall(DirectoryPath packageDirectory) 17var rootDirectory = packageDirectory.GetParentPath();
dotnet.Tests (32)
CommandFactoryTests\GivenALocalToolsCommandResolver.cs (1)
20private DirectoryPath _nugetGlobalPackagesFolder;
CommandTests\Tool\List\ToolListGlobalOrToolPathCommandTests.cs (1)
333private void AssertExpectedToolPath(DirectoryPath? toolPath, string expectedToolPath)
CommandTests\Tool\Restore\ToolRestoreCommandTests.cs (1)
47private readonly DirectoryPath _nugetGlobalPackagesFolder;
CommandTests\Tool\Run\ToolRunCommandTests.cs (1)
19private DirectoryPath _nugetGlobalPackagesFolder;
CommandTests\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommandTests.cs (5)
72var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 114var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 130DirectoryPath? directoryPath) 184var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 261DirectoryPath? directoryPath)
CommandTests\Workload\Install\FailingNuGetPackageInstaller.cs (2)
27DirectoryPath? downloadFolder = null, 35public Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder)
CommandTests\Workload\Install\GivenFileBasedWorkloadInstall.cs (5)
154mockNugetInstaller.DownloadCallParams[0].Should().BeEquivalentTo((new PackageId(packId), new NuGetVersion(packVersion), null as DirectoryPath?, null as PackageSourceLocation)); 176(nugetInstaller as MockNuGetPackageDownloader).DownloadCallParams[0].Should().BeEquivalentTo((new PackageId(packId), new NuGetVersion(packVersion), null as DirectoryPath?, null as PackageSourceLocation)); 201mockNugetInstaller.DownloadCallParams[0].Should().BeEquivalentTo((new PackageId(packId), new NuGetVersion(packVersion), null as DirectoryPath?, null as PackageSourceLocation)); 222mockNugetInstaller.DownloadCallParams[0].Should().BeEquivalentTo((new PackageId(packId), new NuGetVersion(packVersion), null as DirectoryPath?, packageSource)); 335new NuGetVersion(manifestVersion.ToString()), null as DirectoryPath?, null as PackageSourceLocation));
CommandTests\Workload\Install\GivenWorkloadManifestUpdater.cs (2)
681private List<(PackageId, NuGetVersion, DirectoryPath?, PackageSourceLocation)> GetExpectedDownloadedPackages(string sdkFeatureBand = "6.0.100") 684.Select(id => ((PackageId, NuGetVersion, DirectoryPath?, PackageSourceLocation))(new PackageId($"{id}.manifest-{sdkFeatureBand}"), null, null, null)).ToList();
CommandTests\Workload\Install\MockPackWorkloadInstaller.cs (7)
22public IList<(ManifestVersionUpdate manifestUpdate, DirectoryPath? offlineCache)> InstalledManifests = 23new List<(ManifestVersionUpdate manifestUpdate, DirectoryPath?)>(); 83public void InstallWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, ITransactionContext transactionContext, DirectoryPath? offlineCache = null) 124public WorkloadSet InstallWorkloadSet(ITransactionContext context, string workloadSetVersion, DirectoryPath? offlineCache = null) 142public void RepairWorkloads(IEnumerable<WorkloadId> workloadIds, SdkFeatureBand sdkFeatureBand, DirectoryPath? offlineCache = null) => throw new NotImplementedException(); 144public void GarbageCollect(Func<string, IWorkloadResolver> getResolverForWorkloadSet, DirectoryPath? offlineCache = null, bool cleanAllPacks = false) 160public void InstallWorkloadManifest(ManifestVersionUpdate manifestUpdate, ITransactionContext transactionContext, DirectoryPath? offlineCache = null)
CommandTests\Workload\Install\MockWorkloadManifestUpdater.cs (1)
31public Task UpdateAdvertisingManifestsAsync(bool includePreview, bool useWorkloadSets = false, DirectoryPath? cachePath = null)
ToolManifestTests\ToolManifestFinderTests.cs (6)
96var rootDirectory = new DirectoryPath(_testDirectoryRoot); 99rootDirectory = (DirectoryPath)rootDirectory.GetParentPathNullable(); 134var rootDirectory = new DirectoryPath(_testDirectoryRoot); 137rootDirectory = (DirectoryPath)rootDirectory.GetParentPathNullable(); 157var rootDirectory = new DirectoryPath(_testDirectoryRoot); 160rootDirectory = (DirectoryPath)rootDirectory.GetParentPathNullable();
Microsoft.DotNet.InternalAbstractions (4)
DirectoryPath.cs (3)
24public DirectoryPath WithSubDirectories(params string[] paths) 43public DirectoryPath GetParentPath() 58public DirectoryPath? GetParentPathNullable()
FilePath.cs (1)
29public DirectoryPath GetDirectoryPath()
Microsoft.DotNet.PackageInstall.Tests (27)
LocalToolsResolverCacheTests.cs (14)
20(DirectoryPath nuGetGlobalPackagesFolder, 24DirectoryPath tempDirectory = 26DirectoryPath cacheDirectory = tempDirectory.WithSubDirectories("cacheDirectory"); 27DirectoryPath nuGetGlobalPackagesFolder = tempDirectory.WithSubDirectories("nugetGlobalPackageLocation"); 39(DirectoryPath nuGetGlobalPackagesFolder, LocalToolsResolverCache localToolsResolverCache) = Setup(); 79(DirectoryPath nuGetGlobalPackagesFolder, LocalToolsResolverCache localToolsResolverCache) = Setup(); 113(DirectoryPath nuGetGlobalPackagesFolder, LocalToolsResolverCache localToolsResolverCache) = Setup(); 153(DirectoryPath nuGetGlobalPackagesFolder, LocalToolsResolverCache localToolsResolverCache) = Setup(); 227DirectoryPath tempDirectory = 229DirectoryPath cacheDirectory = tempDirectory.WithSubDirectories("cacheDirectory"); 230DirectoryPath nuGetGlobalPackagesFolder = tempDirectory.WithSubDirectories("nugetGlobalPackageLocation"); 284DirectoryPath tempDirectory = 286DirectoryPath cacheDirectory = tempDirectory.WithSubDirectories("cacheDirectory"); 287DirectoryPath nuGetGlobalPackagesFolder = tempDirectory.WithSubDirectories("nugetGlobalPackageLocation");
NuGetPackageInstallerTests.cs (6)
29private readonly DirectoryPath _tempDirectory; 65DirectoryPath nonExistFeed = 112DirectoryPath nonExistFeed = 132DirectoryPath directoryBelowNugetConfig = nugetConfigPath.GetDirectoryPath().WithSubDirectories("subDir"); 347private static DirectoryPath GetUniqueTempProjectPathEachTest() 349DirectoryPath tempProjectDirectory =
ToolPackageDownloaderTests.cs (4)
141var subDirectory = testDir.WithSubDirectories("sub"); 870private (IToolPackageStore, IToolPackageStoreQuery, IToolPackageDownloader, IToolPackageUninstaller, BufferedReporter, IFileSystem, DirectoryPath testDir 877var root = new DirectoryPath(_testAssetsManager.CreateTestDirectory(callingMethod, identifier: useMock.ToString() + identiifer).Path); 888var toolsRoot = root.WithSubDirectories("tools");
ToolPackageInstallerNugetCacheTests.cs (2)
39var nugetCacheLocation = 122var root = new DirectoryPath(Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()));
ToolPackageUninstallerTests.cs (1)
75var root = new DirectoryPath(_testAssetsManager.CreateTestDirectory(testName, identifier).Path);
Microsoft.DotNet.Tools.Tests.ComponentMocks (32)
MockNuGetPackageDownloader.cs (4)
22public List<(PackageId id, NuGetVersion version, DirectoryPath? downloadFolder, PackageSourceLocation packageSourceLocation)> DownloadCallParams = new(); 26public List<(string, DirectoryPath)> ExtractCallParams = new(); 62DirectoryPath? downloadFolder = null, 89public Task<IEnumerable<string>> ExtractPackageAsync(string packagePath, DirectoryPath targetFolder)
ToolPackageDownloaderMock.cs (13)
27protected DirectoryPath _toolDownloadDir; 29protected readonly DirectoryPath _globalToolStageDir; 30protected readonly DirectoryPath _localToolDownloadDir; 31protected readonly DirectoryPath _localToolAssetDir; 108var packageRootDirectory = _toolPackageStore.GetRootPackageDirectory(packageId); 116var assetFileDirectory = isGlobalTool ? _globalToolStageDir : _localToolAssetDir; 159var packageDirectory = _toolPackageStore.GetPackageDirectory(packageId, version); 189var packageRootDirectory = _toolPackageStore.GetRootPackageDirectory(packageId); 229DirectoryPath? rootConfigDirectory = null, 273DirectoryPath? rootConfigDirectory, 295private static IEnumerable<FilePath> EnumerateDefaultAllPossibleNuGetConfig(DirectoryPath probStart) 297DirectoryPath? currentSearchDirectory = probStart; 343public DirectoryPath PackageDirectory { get; set; }
ToolPackageDownloaderMock2.cs (3)
59protected override void CreateAssetFile(PackageId packageId, NuGetVersion version, DirectoryPath packagesRootPath, string assetFilePath, string runtimeJsonGraph, Cli.Utils.VerbosityOptions verbosity, string? targetFramework = null) 175protected override ToolConfiguration GetToolConfiguration(PackageId id, DirectoryPath packageDirectory, DirectoryPath assetsJsonParentDirectory)
ToolPackageMock.cs (2)
27DirectoryPath packageDirectory, 45public DirectoryPath PackageDirectory { get; private set; }
ToolPackageStoreMock.cs (8)
20DirectoryPath root, 29public DirectoryPath Root { get; private set; } 31public DirectoryPath GetRandomStagingDirectory() 36public NuGetVersion GetStagedPackageVersion(DirectoryPath stagingDirectory, PackageId packageId) 53public DirectoryPath GetRootPackageDirectory(PackageId packageId) 58public DirectoryPath GetPackageDirectory(PackageId packageId, NuGetVersion version) 90var packageRootDirectory = Root.WithSubDirectories(packageId.ToString()); 112var directory = GetPackageDirectory(packageId, version);
ToolPackageUninstallerMock.cs (2)
27public void Uninstall(DirectoryPath packageDirectory) 29var rootDirectory = packageDirectory.GetParentPath();