1 write to Value
Microsoft.DotNet.InternalAbstractions (1)
DirectoryPath.cs (1)
21
Value
= value;
170 references to Value
dotnet (75)
BuildServer\BuildServerProvider.cs (2)
49
if (!_fileSystem.Directory.Exists(directory.
Value
))
54
foreach (var path in _fileSystem.Directory.EnumerateFiles(directory.
Value
))
Commands\Workload\Install\FileBasedInstaller.cs (6)
133
var tempExtractionDir = Path.Combine(_tempPackagesDir.
Value
, $"{WorkloadManifestUpdater.WorkloadSetManifestId}-{workloadSetPackageVersion}-extracted");
175
var packagePath = Path.Combine(offlineCache.Value.
Value
, $"{packInfo.ResolvedPackageId}.{packInfo.Version}.nupkg");
203
var tempExtractionDir = Path.Combine(_tempPackagesDir.
Value
, $"{packInfo.ResolvedPackageId}-{packInfo.Version}-extracted");
317
packagePath = Path.Combine(offlineCache.Value.
Value
, $"{packageId}.{packageVersion}.nupkg");
327
tempBackupDir = Path.Combine(_tempPackagesDir.
Value
, $"{packageId} - {packageVersion}-backup");
663
var extractionPath = Path.Combine(_tempPackagesDir.
Value
, "dotnet-sdk-advertising-temp", $"{Path.GetFileName(nupkgPath)}-extracted");
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (1)
944
packagePath = Path.Combine(offlineCache.Value.
Value
, $"{packageId}.{packageVersion}.nupkg");
Commands\Workload\Install\WorkloadInstallCommand.cs (1)
327
return GetDownloads(workloadIds, skipManifestUpdate, includePreviews, offlineCache.
Value
);
Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
323
Directory.GetFiles(offlineCache.Value.
Value
)
Commands\Workload\InstallingWorkloadCommand.cs (3)
373
string extractedManifestsPath = Path.Combine(tempPath.Value.
Value
, "manifests");
428
if (tempPath != null && Directory.Exists(tempPath.Value.
Value
))
430
Directory.Delete(tempPath.Value.
Value
, true);
Commands\Workload\Update\WorkloadUpdateCommand.cs (1)
204
await GetDownloads(GetUpdatableWorkloads(), skipManifestUpdate: false, includePreviews, offlineCache.
Value
);
NugetPackageDownloader\NuGetPackageDownloader.cs (9)
117
var resolvedDownloadFolder = downloadFolder == null || !downloadFolder.HasValue ? _packageInstallDir.
Value
: downloadFolder.Value.
Value
;
231
PackageFolderReader packageReader = new(targetFolder.
Value
);
237
NuGetPackagePathResolver packagePathResolver = new(targetFolder.
Value
);
241
targetFolder.
Value
,
250
Path.GetRelativePath(targetFolder.
Value
, p).Equals("data/UnixFilePermissions.xml",
260
Path.Combine(targetFolder.
Value
, fileAndPermission.Path),
380
packageSourceLocation.NugetConfig.Value.GetDirectoryPath().
Value
;
388
packageSourceLocation?.RootConfigDirectory?.
Value
?? currentDirectory);
ShellShim\ShellShimRepository.cs (3)
44
if (!_fileSystem.Directory.Exists(_shimsDirectory.
Value
))
46
_fileSystem.Directory.CreateDirectory(_shimsDirectory.
Value
);
66
string relativePathToExe = Path.GetRelativePath(_shimsDirectory.
Value
, toolCommand.Executable.Value);
ShellShim\ShellShimTemplateFinder.cs (1)
58
return Path.Combine(_tempDir.
Value
, "runtimes", rid, "native");
ToolManifest\ToolManifestFinder.cs (6)
205
if (manifestInsertFolder.
Value
!= null)
225
if (_fileSystem.Directory.Exists(currentSearchGitDirectory.
Value
))
229
if (currentSearchDirectory.Value.
Value
!= null)
231
if (_fileSystem.Directory.EnumerateFiles(currentSearchDirectory.Value.
Value
)
253
string manifestFileLocation = Path.Combine(folderPath.
Value
, Constants.ToolManifestFileName);
273
if (!correspondingDirectory.
Value
.Equals(rootPath.Value))
ToolManifest\ToolManifestPackage.cs (2)
41
FirstEffectDirectory.
Value
.TrimEnd('/', '\\')
42
.Equals(other.FirstEffectDirectory.
Value
.TrimEnd('/', '\\'), StringComparison.Ordinal) &&
ToolPackage\LocalToolsResolverCache.cs (1)
114
_fileSystem.Directory.CreateDirectory(_cacheVersionedDirectory.
Value
);
ToolPackage\ToolPackageDownloader.cs (2)
142
NuGetv3LocalRepository localRepository = new(packagesRootPath.
Value
);
147
Reporter.Output.WriteLine($"Locating package {packageId}@{version} in package store {packagesRootPath.
Value
}");
ToolPackage\ToolPackageDownloaderBase.cs (19)
159
var nugetPackageRootDirectory = new VersionFolderPathResolver(_toolPackageStore.Root.
Value
).GetInstallPath(packageId.ToString(), packageVersion);
169
string rollbackDirectory = _globalToolStageDir.
Value
;
188
_fileSystem.Directory.CreateDirectory(toolStoreTargetDirectory.GetParentPath().
Value
);
192
FileAccessRetrier.RetryOnMoveAccessFailure(() => _fileSystem.Directory.Move(_globalToolStageDir.
Value
, toolStoreTargetDirectory.
Value
));
195
rollbackDirectory = toolStoreTargetDirectory.
Value
;
223
if (_fileSystem.Directory.Exists(packageRootDirectory.
Value
) &&
224
!_fileSystem.Directory.EnumerateFileSystemEntries(packageRootDirectory.
Value
).Any())
226
_fileSystem.Directory.Delete(packageRootDirectory.
Value
, false);
276
if (!IsPackageInstalled(packageId, packageVersion, packageDownloadDir.
Value
))
278
DownloadAndExtractPackage(packageId, nugetPackageDownloader, packageDownloadDir.
Value
, packageVersion, packageSourceLocation, includeUnlisted: givenSpecificVersion, verbosity: verbosity);
281
CreateAssetFile(packageId, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.
Value
, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, verbosity, targetFramework);
286
if (!IsPackageInstalled(ridSpecificPackage, packageVersion, packageDownloadDir.
Value
))
288
DownloadAndExtractPackage(ridSpecificPackage, nugetPackageDownloader, packageDownloadDir.
Value
, packageVersion, packageSourceLocation, includeUnlisted: true, verbosity: verbosity);
291
CreateAssetFile(ridSpecificPackage, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.
Value
, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, verbosity, targetFramework);
303
if (!IsPackageInstalled(packageId, packageVersion, _localToolDownloadDir.
Value
))
308
CreateAssetFile(packageId, packageVersion, _localToolDownloadDir, Path.Combine(_localToolAssetDir.
Value
, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, verbosity, targetFramework);
312
if (!IsPackageInstalled(ridSpecificPackage, packageVersion, _localToolDownloadDir.
Value
))
318
Path.Combine(_localToolAssetDir.
Value
, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, verbosity, targetFramework);
ToolPackage\ToolPackageFactory.cs (1)
65
ToolPackageFolderPathCalculator.GetToolPackageFolderPath(nonGlobalLocation.Value.
Value
))
ToolPackage\ToolPackageInstance.cs (1)
103
var installPath = new VersionFolderPathResolver(PackageDirectory.
Value
).GetInstallPath(ResolvedPackageId.ToString(), ResolvedPackageVersion);
ToolPackage\ToolPackageStoreAndQuery.cs (7)
15
public DirectoryPath Root { get; private set; } = new DirectoryPath(Path.GetFullPath(root.
Value
));
29
stagingDirectory.WithSubDirectories(packageId.ToString()).
Value
).FirstOrDefault()),
59
if (!_fileSystem.Directory.Exists(Root.
Value
))
64
foreach (var subdirectory in _fileSystem.Directory.EnumerateDirectories(Root.
Value
))
85
if (!_fileSystem.Directory.Exists(packageRootDirectory.
Value
))
90
foreach (var subdirectory in _fileSystem.Directory.EnumerateDirectories(packageRootDirectory.
Value
))
107
if (!_fileSystem.Directory.Exists(directory.
Value
))
ToolPackage\ToolPackageUninstaller.cs (8)
25
if (Directory.Exists(packageDirectory.
Value
))
29
var tempPath = _toolPackageStoreQuery.GetRandomStagingDirectory().
Value
;
31
Directory.Move(packageDirectory.
Value
, tempPath));
35
if (Directory.Exists(rootDirectory.
Value
) &&
36
!Directory.EnumerateFileSystemEntries(rootDirectory.
Value
).Any())
38
Directory.Delete(rootDirectory.
Value
, false);
57
Directory.CreateDirectory(rootDirectory.
Value
);
59
Directory.Move(tempPackageDirectory, packageDirectory.
Value
));
dotnet.Tests (27)
BuildServerTests\BuildServerProviderTests.cs (2)
74
.
Value
93
.
Value
CommandFactoryTests\GivenALocalToolsCommandResolver.cs (3)
93
_fileSystem.Directory.CreateDirectory(_nugetGlobalPackagesFolder.
Value
);
126
_fileSystem.Directory.CreateDirectory(_nugetGlobalPackagesFolder.
Value
);
190
_fileSystem.Directory.CreateDirectory(_nugetGlobalPackagesFolder.
Value
);
CommandTests\Tool\List\ToolListGlobalOrToolPathCommandTests.cs (1)
338
toolPath.Value.
Value
.Should().Be(expectedToolPath);
CommandTests\Tool\Restore\ToolRestoreCommandTests.cs (1)
507
_fileSystem.Directory.Delete(_nugetGlobalPackagesFolder.
Value
, true);
CommandTests\Tool\Run\ToolRunCommandTests.cs (1)
80
fileSystem.Directory.CreateDirectory(_nugetGlobalPackagesFolder.
Value
);
CommandTests\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommandTests.cs (6)
79
_fileSystem.Directory.Exists(packageDirectory.
Value
).Should().BeTrue();
95
_fileSystem.Directory.Exists(packageDirectory.
Value
).Should().BeFalse();
121
_fileSystem.Directory.Exists(packageDirectory.
Value
).Should().BeTrue();
165
_fileSystem.Directory.Exists(packageDirectory.
Value
).Should().BeFalse();
191
_fileSystem.Directory.Exists(packageDirectory.
Value
).Should().BeTrue();
208
_fileSystem.Directory.Exists(packageDirectory.
Value
).Should().BeTrue();
CommandTests\Workload\Install\FailingNuGetPackageInstaller.cs (2)
37
Directory.CreateDirectory(targetFolder.
Value
);
38
File.WriteAllText(Path.Combine(targetFolder.
Value
, "testfile.txt"), string.Empty);
CommandTests\Workload\Install\GivenDotnetWorkloadInstall.cs (1)
283
downloadParams.downloadFolder.Value.
Value
.Should().Be(cachePath);
CommandTests\Workload\Install\MockPackWorkloadInstaller.cs (1)
89
CachePath = offlineCache?.
Value
;
CommandTests\Workload\Update\GivenDotnetWorkloadUpdate.cs (1)
433
downloadParams.downloadFolder.Value.
Value
.Should().Be(cachePath);
ShellShimTests\ShellShimRepositoryTests.cs (1)
50
var parentPathAsShimPath = outputDll.GetDirectoryPath().GetParentPath().GetParentPath().
Value
;
ToolManifestTests\ToolManifestFinderTests.cs (7)
101
var dotnetconfigDirectory = Path.Combine(rootDirectory.
Value
, ".config");
118
new DirectoryPath(rootDirectory.
Value
),
124
new DirectoryPath(rootDirectory.
Value
),
139
var dotnetconfigDirectory = Path.Combine(rootDirectory.
Value
, ".config");
162
var dotnetconfigDirectory = Path.Combine(rootDirectory.
Value
, ".config");
187
new DirectoryPath(rootDirectory.
Value
),
193
new DirectoryPath(rootDirectory.
Value
),
Microsoft.DotNet.InternalAbstractions (6)
DirectoryPath.cs (6)
27
insertValueInFront[0] =
Value
;
35
return new FilePath(Path.Combine(
Value
, fileName));
40
return $"\"{
Value
}\"";
47
var directoryInfo = new DirectoryInfo(
Value
);
52
throw new InvalidOperationException(
Value
+ " does not have parent directory.");
60
var directoryInfo = new DirectoryInfo(
Value
);
Microsoft.DotNet.PackageInstall.Tests (30)
LocalToolsResolverCacheTests.cs (5)
28
fileSystem.Directory.CreateDirectory(cacheDirectory.
Value
);
231
fileSystem.Directory.CreateDirectory(cacheDirectory.
Value
);
253
.WithSubDirectories(packageId.ToString()).
Value
;
288
fileSystem.Directory.CreateDirectory(cacheDirectory.
Value
);
310
.WithSubDirectories(packageId.ToString()).
Value
;
NuGetPackageInstallerTests.cs (6)
59
packagePath.Should().Contain(_tempDirectory.
Value
, "Package should be downloaded to the input folder");
72
new PackageSourceLocation(sourceFeedOverrides: new[] { nonExistFeed.
Value
})));
125
sourceFeedOverrides: new[] { nonExistFeed.
Value
})));
133
Directory.CreateDirectory(directoryBelowNugetConfig.
Value
);
171
packagePath.Should().Contain(_tempDirectory.
Value
, "Package should be downloaded to the input folder");
359
fileSystem.Directory.CreateDirectory(filePath.Value.GetDirectoryPath().
Value
);
ToolPackageDownloaderTests.cs (17)
142
fileSystem.Directory.CreateDirectory(subDirectory.
Value
);
282
var relativePath = Path.GetRelativePath(testDir.
Value
, source);
284
Log.WriteLine("Root path: " + testDir.
Value
);
588
.Exists(store.Root.WithSubDirectories(TestPackageId.ToString()).
Value
)
596
.EnumerateFileSystemEntries(store.Root.WithSubDirectories(ToolPackageStoreAndQuery.StagingDirectory).
Value
)
836
package.PackageDirectory.
Value
.Should().Contain(store.Root.
Value
);
847
package.Command.Executable.Value.Should().Contain(store.Root.
Value
);
852
if (!fileSystem.Directory.Exists(store.Root.
Value
))
859
.EnumerateFileSystemEntries(store.Root.
Value
)
865
.EnumerateFileSystemEntries(store.Root.WithSubDirectories(ToolPackageStoreAndQuery.StagingDirectory).
Value
)
886
var nugetConfigPath = new FilePath(Path.Combine(root.
Value
, "NuGet.config"));
903
currentWorkingDirectory: root.
Value
,
916
downloader = new ToolPackageDownloader(store, testRuntimeJsonPath, root.
Value
);
920
store.Root.
Value
.Should().Be(Path.GetFullPath(toolsRoot.
Value
));
929
fileSystem.Directory.CreateDirectory(filePath.Value.GetDirectoryPath().
Value
);
ToolPackageUninstallerTests.cs (2)
114
store.Root.
Value
.Should().Be(Path.GetFullPath(root.
Value
));
Microsoft.DotNet.Tools.Tests.ComponentMocks (32)
MockNuGetPackageDownloader.cs (1)
94
var dataFolder = Path.Combine(targetFolder.
Value
, "data");
ToolPackageDownloaderMock.cs (15)
117
rollbackDirectory = _toolDownloadDir.
Value
;
134
rollbackDirectory = isGlobalTool ? _toolDownloadDir.
Value
: Path.Combine(_toolDownloadDir.
Value
, packageId.ToString(), packageVersion.ToString());
144
_fileSystem.Directory.CreateDirectory(Path.Combine(_toolDownloadDir.
Value
, fakeExecutableSubDirectory));
145
_fileSystem.File.CreateEmptyFile(Path.Combine(_toolDownloadDir.
Value
, fakeExecutablePath));
160
if (_fileSystem.Directory.Exists(packageDirectory.
Value
))
172
_fileSystem.Directory.CreateDirectory(packageDirectory.
Value
);
175
rollbackDirectory = Path.Combine(packageDirectory.
Value
, packageVersion);
191
_fileSystem.Directory.CreateDirectory(packageRootDirectory.
Value
);
192
_fileSystem.Directory.Move(_toolDownloadDir.
Value
, packageDirectory.
Value
);
193
rollbackDirectory = packageDirectory.
Value
;
216
if (_fileSystem.Directory.Exists(packageRootDirectory.
Value
) &&
217
!_fileSystem.Directory.EnumerateFileSystemEntries(packageRootDirectory.
Value
).Any())
219
_fileSystem.Directory.Delete(packageRootDirectory.
Value
, false);
ToolPackageMock.cs (2)
77
var executablePath = _fileSystem.File.ReadAllText(Path.Combine(PackageDirectory.
Value
, "project.assets.json"));
79
var settingsFilePath = Path.Combine(PackageDirectory.
Value
, @$"{Id}\{Version}\tools\net6.0\any", "DotnetToolSettings.xml");
ToolPackageStoreMock.cs (7)
24
Root = new DirectoryPath(Path.GetFullPath(root.
Value
));
41
stagingDirectory.WithSubDirectories(packageId.ToString()).
Value
).FirstOrDefault()),
66
if (!_fileSystem.Directory.Exists(Root.
Value
))
71
foreach (var subdirectory in _fileSystem.Directory.EnumerateFileSystemEntries(Root.
Value
))
91
if (!_fileSystem.Directory.Exists(packageRootDirectory.
Value
))
96
foreach (var subdirectory in _fileSystem.Directory.EnumerateFileSystemEntries(packageRootDirectory.
Value
))
113
if (!_fileSystem.Directory.Exists(directory.
Value
))
ToolPackageUninstallerMock.cs (7)
37
if (_fileSystem.Directory.Exists(packageDirectory.
Value
))
42
_fileSystem.Directory.Move(packageDirectory.
Value
, tempPath);
46
if (_fileSystem.Directory.Exists(rootDirectory.
Value
) &&
47
!_fileSystem.Directory.EnumerateFileSystemEntries(rootDirectory.
Value
).Any())
49
_fileSystem.Directory.Delete(rootDirectory.
Value
, false);
73
_fileSystem.Directory.CreateDirectory(rootDirectory.
Value
);
74
_fileSystem.Directory.Move(tempPackageDirectory, packageDirectory.
Value
);