19569 references to Path
aspire (1008)
Agents\AspireSkills\AspireSkillsBundleProvider.cs (23)
116var manifestPath = Path.Combine(bundleDirectory.FullName, AspireSkillsBundleLayout.ManifestFileName);
276var fullPath = Path.Combine(bundleDirectory.FullName, AspireSkillsBundleLayout.SkillsDirectoryName, skillName, relativePath);
406.Replace('/', Path.DirectorySeparatorChar)
407.Replace('\\', Path.DirectorySeparatorChar);
409if (Path.IsPathRooted(normalizedPath))
414var segments = normalizedPath.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries);
420return Path.Combine(segments);
478var destinationRoot = Path.GetFullPath(destinationDirectory);
502var destinationFileDirectory = Path.GetDirectoryName(destinationPath);
523var destinationRoot = Path.GetFullPath(destinationDirectory);
541var destinationFileDirectory = Path.GetDirectoryName(destinationPath);
555if (Path.IsPathRooted(normalizedEntryName) ||
562var destinationPath = Path.GetFullPath(Path.Combine(destinationRoot, normalizedEntryName.Replace('/', Path.DirectorySeparatorChar)));
563if (!destinationPath.StartsWith(destinationRoot + Path.DirectorySeparatorChar, StringComparison.Ordinal) &&
574var rootManifestPath = Path.Combine(extractionDirectory, AspireSkillsBundleLayout.ManifestFileName);
580var packageDirectory = Path.Combine(extractionDirectory, "package");
581var packageManifestPath = Path.Combine(packageDirectory, AspireSkillsBundleLayout.ManifestFileName);
589.Where(directory => File.Exists(Path.Combine(directory, AspireSkillsBundleLayout.ManifestFileName)))
611var relativePath = Path.GetRelativePath(sourceDirectory, sourceFile);
612var targetFile = Path.Combine(targetDirectory, relativePath);
613var targetFileDirectory = Path.GetDirectoryName(targetFile);
Agents\AspireSkills\AspireSkillsInstaller.cs (34)
209var archivePath = Path.Combine(tempDirectory.FullName, GetSafeFileName(asset.Name));
621var archiveSha512 = TryNormalizeArchiveSha512(Path.GetFileName(directory));
670!File.Exists(Path.Combine(cacheDirectory, GitHubAttestationVerifiedFileName)))
680var cachedArchiveSha512Path = Path.Combine(cacheDirectory, ArchiveSha512FileName);
693var cachedGitHubArchiveSha256Path = Path.Combine(cacheDirectory, GitHubArchiveSha256FileName);
766Path.Combine(stageDirectory.FullName, ArchiveSha512FileName),
775Path.Combine(stageDirectory.FullName, GitHubArchiveSha256FileName),
783Path.Combine(stageDirectory.FullName, GitHubAttestationVerifiedFileName),
827File.Delete(Path.Combine(bundleDirectory, ArchiveSha512FileName));
828File.Delete(Path.Combine(bundleDirectory, GitHubArchiveSha256FileName));
829File.Delete(Path.Combine(bundleDirectory, GitHubAttestationVerifiedFileName));
830File.Delete(Path.Combine(bundleDirectory, LastUsedFileName));
858var lockPath = Path.Combine(cacheRoot, $".{GetSafeFileName(version)}.lock");
946return Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
951return Path.Combine(cacheRoot, version);
956return Path.Combine(
986var version = Path.GetFileName(directory);
1031var directoryName = Path.GetFileName(bundleDirectory);
1067return Directory.Exists(Path.Combine(versionCacheDirectory, AspireSkillsBundleLayout.SkillsDirectoryName)) ||
1068File.Exists(Path.Combine(versionCacheDirectory, AspireSkillsBundleLayout.ManifestFileName)) ||
1069File.Exists(Path.Combine(versionCacheDirectory, ArchiveSha512FileName)) ||
1070File.Exists(Path.Combine(versionCacheDirectory, GitHubArchiveSha256FileName)) ||
1071File.Exists(Path.Combine(versionCacheDirectory, GitHubAttestationVerifiedFileName)) ||
1072File.Exists(Path.Combine(versionCacheDirectory, LastUsedFileName));
1079TryDeleteDirectory(Path.Combine(versionCacheDirectory, AspireSkillsBundleLayout.SkillsDirectoryName));
1080TryDeleteFile(Path.Combine(versionCacheDirectory, AspireSkillsBundleLayout.ManifestFileName));
1081TryDeleteFile(Path.Combine(versionCacheDirectory, ArchiveSha512FileName));
1082TryDeleteFile(Path.Combine(versionCacheDirectory, GitHubArchiveSha256FileName));
1083TryDeleteFile(Path.Combine(versionCacheDirectory, GitHubAttestationVerifiedFileName));
1084TryDeleteFile(Path.Combine(versionCacheDirectory, LastUsedFileName));
1109File.WriteAllText(Path.Combine(directory, LastUsedFileName), DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture));
1119var markerPath = Path.Combine(directory, LastUsedFileName);
1133var safeName = Path.GetFileName(fileName);
1134foreach (var invalidCharacter in Path.GetInvalidFileNameChars())
Agents\Copilot\CopilotAppInstallationDetector.cs (14)
54Path.Combine(executionContext.HomeDirectory.FullName, "AppData", "Local"),
68Path.Combine(executionContext.HomeDirectory.FullName, "Applications", MacOSAppBundleName),
69Path.Combine(Path.DirectorySeparatorChar.ToString(), "Applications", MacOSAppBundleName),
98var dataHome = !string.IsNullOrEmpty(configuredDataHome) && Path.IsPathFullyQualified(configuredDataHome)
100: Path.Combine(executionContext.HomeDirectory.FullName, ".local", "share");
101applicationsDirectories.Add(Path.Combine(dataHome, LinuxApplicationsDirectoryName));
106var rootDirectory = Path.DirectorySeparatorChar.ToString();
107applicationsDirectories.Add(Path.Combine(rootDirectory, "usr", "local", "share", LinuxApplicationsDirectoryName));
108applicationsDirectories.Add(Path.Combine(rootDirectory, "usr", "share", LinuxApplicationsDirectoryName));
112foreach (var dataDirectory in configuredDataDirectories.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries))
114if (Path.IsPathFullyQualified(dataDirectory))
116applicationsDirectories.Add(Path.Combine(dataDirectory, LinuxApplicationsDirectoryName));
182candidatePaths.Add(Path.Combine(
Agents\Playwright\PlaywrightCliInstaller.cs (14)
88internal static readonly string s_primarySkillBaseDirectory = Path.Combine(".claude", "skills");
312var dir = Path.Combine(repoRoot, location.RelativeSkillDirectory, PlaywrightCliSkillName);
328var primarySkillDir = Path.Combine(repoRoot, s_primarySkillBaseDirectory, PlaywrightCliSkillName);
344var targetSkillDir = Path.Combine(repoRoot, skillBaseDir, PlaywrightCliSkillName);
372var skillDir = Path.Combine(repoRoot, location.RelativeSkillDirectory, PlaywrightCliSkillName);
400var maxDepth = relativeSkillDirectory.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Length + 1;
402var parent = Path.GetDirectoryName(startDir);
411parent = Path.GetDirectoryName(parent);
426var relativePath = Path.GetRelativePath(sourceDir, sourceFile);
427var targetFile = Path.Combine(targetDir, relativePath);
429var targetFileDir = Path.GetDirectoryName(targetFile);
443var relativePath = Path.GetRelativePath(targetDir, targetFile);
444var sourceFile = Path.Combine(sourceDir, relativePath);
Bundles\BundleService.cs (41)
112var lockPath = Path.Combine(extractDir, ".aspire-bundle-lock");
157var lockPath = Path.Combine(destinationPath, ".aspire-bundle-lock");
214var binaryDir = Path.GetDirectoryName(realBinaryPath);
236var versionsRoot = Path.Combine(destinationPath, VersionsDirectoryName);
241var activeVersionDir = Path.Combine(versionsRoot, versionId);
320var tempDir = Path.Combine(versionsRoot, $"{versionId}{TempSuffixPrefix}{Guid.NewGuid():N}");
462var binaryDir = Path.GetDirectoryName(realBinaryPath);
472var sidecarPath = Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName);
482or InstallSourceExtensions.LocalHiveWire => Path.GetDirectoryName(binaryDir) ?? binaryDir,
501var linkPath = Path.Combine(layoutPath, dir);
516var linkPath = Path.Combine(layoutPath, dir);
567var linkPath = Path.Combine(layoutPath, dir);
599var managedDir = Path.Combine(versionDir, BundleDiscovery.ManagedDirectoryName);
600var managedExe = Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName));
607var dashboardDir = Path.Combine(versionDir, BundleDiscovery.DashboardDirectoryName);
608var dashboardExe = Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
609var blazorScript = Path.Combine(dashboardDir, "wwwroot", "_framework", "blazor.web.js");
611var sqliteLibrary = Path.Combine(dashboardDir, sqliteLibraryName);
617var dcpDir = Path.Combine(versionDir, BundleDiscovery.DcpDirectoryName);
653var name = Path.GetFileName(entry);
680var bundlePath = Path.Combine(extractDir, BundleDiscovery.BundleDirectoryName);
691var markerVersionDir = Path.Combine(extractDir, VersionsDirectoryName, versionId);
714return Path.GetFullPath(Path.IsPathRooted(target)
716: Path.Combine(layoutPath, target));
721return Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
751var legacyPath = Path.Combine(layoutPath, dir);
848var markerPath = Path.Combine(extractDir, VersionMarkerFileName);
858var markerPath = Path.Combine(extractDir, VersionMarkerFileName);
903var fullPath = Path.GetFullPath(Path.Combine(destinationPath, relativePath));
904var normalizedDestination = Path.GetFullPath(destinationPath);
907if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) &&
920var dir = Path.GetDirectoryName(fullPath);
940var linkTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, entry.LinkName));
941if (!linkTarget.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) &&
946var linkDir = Path.GetDirectoryName(fullPath);
Caching\AppHostInfoDiskCache.cs (9)
116_cacheDirectory = new DirectoryInfo(Path.Combine(executionContext.CacheDirectory.FullName, SubDirectoryName));
139var path = Path.Combine(_cacheDirectory.FullName, $"{key}.json");
212var path = Path.Combine(_cacheDirectory.FullName, $"{key}.json");
218tempPath = Path.Combine(_cacheDirectory.FullName, $"{Path.GetRandomFileName()}.tmp");
318AppendMtime(sb, Path.Combine(projectDir, "obj", "project.assets.json"), "assets");
359AppendMtime(sb, Path.Combine(dir.FullName, siblingName), siblingName);
361AppendMtime(sb, Path.Combine(dir.FullName, "global.json"), "globaljson");
366AppendMtime(sb, Path.Combine(dir.FullName, customName), customName);
Certificates\CertificateGeneration\MacOSCertificateManager.cs (9)
36private static readonly string s_macOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
106var tmpFile = Path.GetTempFileName();
170var tmpFile = Path.GetTempFileName();
221var certificatePath = Path.GetTempFileName();
337ExportCertificate(certificate, Path.Combine(s_aspireDevCertsCacheDirectory, $"{aspireLookup}.pfx"), includePrivateKey: true, null, CertificateKeyExportFormat.Pfx);
356var certificatePath = Path.GetTempFileName();
385Path.Combine(s_macOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
413ExportCertificate(diskCert, Path.Combine(s_aspireDevCertsCacheDirectory, $"{aspireLookup}.pfx"), includePrivateKey: true, null, CertificateKeyExportFormat.Pfx);
423var keyPath = Path.Combine(s_aspireDevCertsCacheDirectory, $"{aspireLookup}.key");
Certificates\CertificateGeneration\UnixCertificateManager.cs (26)
130var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
133var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
270var certPath = Path.Combine(certDir, nickname) + ".pem";
384var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
386: homeDirectory + Path.DirectorySeparatorChar;
389? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
398var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
399var certDirFullPath = Path.GetFullPath(certDir);
409return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
433Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
499var certPath = Path.Combine(certDir, nickname) + ".pem";
787return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
954var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
1086var paths = nssDbOverride.Split(System.IO.Path.PathSeparator);
1126var nssDbPath = System.IO.Path.GetFullPath(path);
1154var chromiumNssDb = System.IO.Path.Combine(homeDirectory, ".pki", "nssdb");
1161var chromiumSnapNssDb = System.IO.Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
1210var separator = System.IO.Path.DirectorySeparatorChar;
1216=> System.IO.Path.Combine(homeDirectory, ".mozilla", "firefox");
1220var configDirectory = !string.IsNullOrEmpty(xdgConfigHome) && System.IO.Path.IsPathFullyQualified(xdgConfigHome)
1222: System.IO.Path.Combine(homeDirectory, ".config");
1224return System.IO.Path.Combine(configDirectory, "mozilla", "firefox");
1228=> System.IO.Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
1268var directoryPrefix = System.IO.Path.TrimEndingDirectorySeparator(System.IO.Path.GetFullPath(directory)) + System.IO.Path.DirectorySeparatorChar;
Commands\TrayLifecycleService.cs (13)
45!Path.IsPathFullyQualified(processPath) || !File.Exists(processPath))
51cliPath = Path.GetFullPath(CliPathHelper.ResolveSymlinkOrOriginalPath(processPath, logger));
65!Path.IsPathFullyQualified(bundleRoot))
71if (trayPath is null || !Path.IsPathFullyQualified(trayPath) || !File.Exists(trayPath))
78if (!string.Equals(trayPath, Path.Combine(bundleRoot, WindowsTrayPayload.ExecutablePath), StringComparison.OrdinalIgnoreCase))
82WindowsTrayPayload.Validate(Path.GetDirectoryName(trayPath)!,
134var directory = Path.GetDirectoryName(resolvedPath)!;
135var source = InstallSidecarReader.ReadSourceField(Path.Combine(directory, InstallSidecarReader.SidecarFileName));
143|| !string.Equals(Path.GetFileName(directory), "bin", StringComparison.OrdinalIgnoreCase)
150return Path.GetFullPath(invokingPath);
154=> Path.GetFullPath(path).Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
DotNet\DotNetCliRunner.cs (23)
213: Path.GetFileNameWithoutExtension(CommandPathResolver.NormalizeRunCommand(commandOverride));
320=> string.Equals(Path.GetFileNameWithoutExtension(CommandPathResolver.NormalizeRunCommand(command)), "dotnet", StringComparison.OrdinalIgnoreCase);
342var fullBinlogDirectory = Path.IsPathFullyQualified(binlogDirectory)
344: Path.GetFullPath(Path.Combine(workingDirectory.FullName, binlogDirectory));
348var binlogPath = Path.Combine(fullBinlogDirectory, CreateBinlogFileName(dotnetCommand, projectFile, workingDirectory));
363var scope = projectFile is not null ? Path.GetFileNameWithoutExtension(projectFile.Name) : workingDirectory.Name;
478var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", sdkVersion);
479var dotnetExecutablePath = Path.Combine(
493env["PATH"] = $"{sdkInstallPath}{Path.PathSeparator}{currentPath}";
627var cliDirectory = Path.GetDirectoryName(processPath);
645var resolvedCliDirectory = Path.GetDirectoryName(resolvedProcessPath);
657return string.Equals(Path.GetFileNameWithoutExtension(processPath), "dotnet", StringComparison.OrdinalIgnoreCase);
662var cliAssemblyPath = Path.Combine(cliDirectory, "aspire.dll");
677return File.Exists(Path.Combine(cliDirectory, ".aspire-install.json"));
682return HasBundleRoot(cliDirectory) || HasBundleRoot(Path.Combine(cliDirectory, "bundle"));
1192sourcePath = Path.GetFullPath(nugetSource, workingDirectory.FullName);
1195if (File.Exists(sourcePath) && string.Equals(Path.GetExtension(sourcePath), ".nupkg", StringComparison.OrdinalIgnoreCase))
1207.FirstOrDefault(path => string.Equals(Path.GetFileName(path), expectedFileName, StringComparison.OrdinalIgnoreCase));
1433var filePath = Path.IsPathRooted(configPath)
1435: Path.Combine(workingDirectory.FullName, configPath);
1742var projectPath = Path.IsPathRooted(line)
1744: Path.Combine(solutionFile.Directory!.FullName, line);
Git\GitWorktree.cs (18)
61var gitPath = Path.Combine(current, GitDirectoryName);
146var gitPath = Path.Combine(current, GitDirectoryName);
193var fullPath = Path.GetFullPath(startPath);
199var directory = Path.GetDirectoryName(fullPath);
212var adminParent = Directory.GetParent(Path.TrimEndingDirectorySeparator(canonicalAdminDirectory));
221Path.Combine(canonicalAdminDirectory, GitDirFileName),
238Path.Combine(current.FullName, GitDirFileName),
244return Path.GetDirectoryName(CanonicalizePath(checkoutGitFile));
267var metadataDirectory = Path.GetDirectoryName(canonicalGitFilePath);
329resolvedPath = Path.IsPathRooted(value)
330? Path.GetFullPath(value)
331: Path.GetFullPath(Path.Combine(relativeTo, value));
360var root = Path.GetPathRoot(resolvedPath);
367[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
373var candidate = Path.Combine(current, segment);
385var entryName = Path.GetFileName(entry);
Layout\LayoutDiscovery.cs (21)
173var entries = Directory.GetFileSystemEntries(layoutPath).Select(Path.GetFileName).ToArray();
213var cliDir = Path.GetDirectoryName(cliPath);
233var parentDir = Path.GetDirectoryName(cliDir);
250var bundlePath = Path.Combine(layoutPath, BundleDiscovery.BundleDirectoryName);
251var bundleManagedPath = Path.Combine(bundlePath, BundleDiscovery.ManagedDirectoryName);
252var bundleDashboardPath = Path.Combine(bundlePath, BundleDiscovery.DashboardDirectoryName);
253var bundleDcpPath = Path.Combine(bundlePath, BundleDiscovery.DcpDirectoryName);
265var bundleManagedExe = Path.Combine(bundleManagedPath, managedExeName);
266var bundleDashboardExe = Path.Combine(bundleDashboardPath, dashboardExeName);
269_logger.LogDebug(" {Dir}/{Dcp}/{Exe}: {Exists}", BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName, Path.GetFileName(bundleDcpExe), File.Exists(bundleDcpExe) ? "exists" : "MISSING");
279Dcp = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName),
280Dashboard = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DashboardDirectoryName),
281Managed = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.ManagedDirectoryName),
289var managedPath = Path.Combine(layoutPath, BundleDiscovery.ManagedDirectoryName);
290var dashboardPath = Path.Combine(layoutPath, BundleDiscovery.DashboardDirectoryName);
291var dcpPath = Path.Combine(layoutPath, BundleDiscovery.DcpDirectoryName);
305var managedExePath = Path.Combine(managedPath, managedExeName);
306var dashboardExePath = Path.Combine(dashboardPath, dashboardExeName);
309_logger.LogDebug(" dcp/{DcpExe}: {Exists}", Path.GetFileName(dcpExePath), File.Exists(dcpExePath) ? "exists" : "MISSING");
335var relativePath = Path.Combine(bundleDirectory, OperatingSystem.IsWindows()
337return File.Exists(Path.Combine(layoutPath, relativePath)) ? relativePath : null;
NuGet\NuGetPackageAssetResolver.cs (23)
125return Path.Combine(
146var packagePath = Path.Combine(packagesPath, libraryName.ToLowerInvariant(), libraryVersion);
200var sourcePath = Path.Combine(packagePath, relativePath.Replace('/', Path.DirectorySeparatorChar));
206var fileName = Path.GetFileName(sourcePath);
214var xmlSourcePath = Path.ChangeExtension(sourcePath, ".xml");
217AddAsset(assets, packageId, packageVersion, xmlSourcePath, Path.ChangeExtension(fileName, ".xml"), isManagedAssembly: false, isNativeLibrary: false);
299return Path.IsPathRooted(runtimeIdentifierGraphPath)
301: Path.GetFullPath(runtimeIdentifierGraphPath, Path.GetDirectoryName(Path.GetFullPath(assetsPath))!);
332var sourcePath = Path.Combine(packagePath, runtimeTarget.Path.Replace('/', Path.DirectorySeparatorChar));
363var sourcePath = Path.Combine(packagePath, resourceAssembly.Path.Replace('/', Path.DirectorySeparatorChar));
371: Path.GetFileName(Path.GetDirectoryName(resourceAssembly.Path));
383Path.Combine(locale, Path.GetFileName(sourcePath)),
404var sourcePath = Path.Combine(packagePath, nativeLib.Path.Replace('/', Path.DirectorySeparatorChar));
410AddAsset(assets, packageId, packageVersion, sourcePath, Path.GetFileName(sourcePath), isManagedAssembly: false, isNativeLibrary: true);
449return string.Equals(Path.GetFileName(path), "_._", StringComparison.OrdinalIgnoreCase);
Projects\AppHostCandidateFinder.cs (29)
76".agents", ".claude", Path.Combine(".github", "skills"), Path.Combine(".opencode", "skill"),
96name.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries)
226var relativeNative = Path.GetRelativePath(rootFullName, absolutePath);
235var relativeForwardSlash = Path.DirectorySeparatorChar == '/'
237: relativeNative.Replace(Path.DirectorySeparatorChar, '/');
263var candidate = Path.GetFullPath(candidatePath);
264var ancestor = Path.GetFullPath(ancestorPath);
266|| candidate.StartsWith(ancestor + Path.DirectorySeparatorChar, pathComparison);
274if (Path.GetDirectoryName(includedPath) is { } directory)
276directories.Add(Path.GetFullPath(directory));
285if (Path.GetDirectoryName(absolutePath) is not { Length: > 0 } absoluteDirectory)
294var relative = Path.GetRelativePath(rootFullName, absoluteDirectory);
303var segments = relative.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
413.Select(path => new FileInfo(Path.Combine(searchDirectory.FullName, path.Replace('/', Path.DirectorySeparatorChar))))
442var normalizedPattern = pattern.Replace(Path.DirectorySeparatorChar, '/');
443if (Path.AltDirectorySeparatorChar != Path.DirectorySeparatorChar)
445normalizedPattern = normalizedPattern.Replace(Path.AltDirectorySeparatorChar, '/');
464var relativeDirectory = Path.GetDirectoryName(relativePath);
470var depth = relativeDirectory.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries).Length;
569return new MatcherDirectoryInfo(new DirectoryInfo(Path.Combine(_directory.FullName, path)), _options, _excludePath, _applyDirectoryExclusions, _pathComparison, _counters, _onDirectoryEnumerated, _depth + 1, _maxDepth, _cancellationToken);
574return new MatcherFileInfo(new FileInfo(Path.Combine(_directory.FullName, path)), _options, _excludePath, _applyDirectoryExclusions, _pathComparison, _counters, _onDirectoryEnumerated, _depth, _maxDepth, _cancellationToken);
590var directoryPath = Path.GetFullPath(directory.FullName);
592|| directoryPath.StartsWith(_excludePath + Path.DirectorySeparatorChar, _pathComparison);
Projects\AppHostServerClosureSnapshots.cs (21)
20public string IntegrationLibsPath => Path.Combine(LayoutPath, "libs");
116var normalizedSourcePath = Path.GetFullPath(sourceFile.SourcePath);
159FileName = Path.GetFileName(entry.RelativePath),
172Name = Path.GetFileNameWithoutExtension(entry.RelativePath),
292var directoryName = Path.GetDirectoryName(entry.RelativePath.Replace('/', Path.DirectorySeparatorChar));
336var layoutsDirectory = Path.Combine(Path.GetFullPath(rootPath), LayoutRootFolderName);
337_itemsDirectory = Path.Combine(layoutsDirectory, LayoutItemsFolderName);
338_stagingDirectory = Path.Combine(layoutsDirectory, LayoutStagingFolderName);
379var libsPath = Path.Combine(layoutPath, "libs");
380var manifestPath = Path.Combine(layoutPath, LayoutManifestFileName);
420var stagingPath = Path.Combine(_stagingDirectory, Guid.NewGuid().ToString("n"));
421var libsPath = Path.Combine(stagingPath, "libs");
431var destinationPath = Path.Combine(libsPath, entry.RelativePath.Replace('/', Path.DirectorySeparatorChar));
432var destinationDirectory = Path.GetDirectoryName(destinationPath);
441await WriteManifestFileAsync(Path.Combine(stagingPath, LayoutManifestFileName), manifest, cancellationToken).ConfigureAwait(false);
477return Path.Combine(_itemsDirectory, fingerprint);
495var copiedPath = Path.Combine(libsPath, entry.RelativePath.Replace('/', Path.DirectorySeparatorChar));
Projects\DotNetAppHostProject.cs (18)
305var filePath = Path.Combine(current.FullName, fileName);
515if (Path.IsPathRooted(relativePath))
733var filePath = Path.Combine(current.FullName, fileName);
911var normalized = importPath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
912fullPath = Path.GetFullPath(Path.Combine(containingDirectory, normalized));
1322if (Path.GetFileNameWithoutExtension(projectFile.Name).EndsWith("AppHost", StringComparison.OrdinalIgnoreCase))
1958var runtimeConfigPath = Path.ChangeExtension(resolvedTargetPath, ".runtimeconfig.json");
1997=> Path.IsPathFullyQualified(path) ? path : Path.GetFullPath(Path.Combine(baseDirectory.FullName, path));
2000=> string.Equals(Path.GetFileNameWithoutExtension(CommandPathResolver.NormalizeRunCommand(command)), "dotnet", StringComparison.OrdinalIgnoreCase);
2117var propertiesLaunchSettingsPath = Path.Combine(directory, propertiesDirectoryName, "launchSettings.json");
2124var runJsonPath = Path.Combine(directory, $"{Path.GetFileNameWithoutExtension(projectFile.Name)}.run.json");
2336Path.GetFullPath(Path.Combine(directoryName, config.AppHost.Path)));
Projects\DotNetBasedAppHostServerProject.cs (27)
67_appPath = Path.GetFullPath(appPath);
71_repoRoot = Path.GetFullPath(repoRoot) + Path.DirectorySeparatorChar;
78_restoreRootConfigDirectory = restoreRootConfigDirectory is not null ? Path.GetFullPath(restoreRootConfigDirectory) : null;
89_projectModelPath = Path.Combine(CliPathHelper.GetAspireHomeDirectory(), AppsFolder, pathDir);
103public string BuildPath => Path.Combine(_projectModelPath, BuildFolder);
110public string GetProjectFilePath() => Path.Combine(_projectModelPath, ProjectFileName);
114var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName);
126var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName);
185var appHostInTargets = Path.Combine(_repoRoot, "src", "Aspire.Hosting.AppHost", "build", "Aspire.Hosting.AppHost.in.targets");
186var sdkInTargets = Path.Combine(_repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets");
223File.WriteAllText(Path.Combine(_projectModelPath, "Program.cs"), programCs);
329var repoDirectoryPackagesProps = Path.Combine(_repoRoot, "Directory.Packages.props");
341var projectFileName = Path.Combine(_projectModelPath, ProjectFileName);
409if (!File.Exists(Path.Combine(_projectModelPath, fileName)))
418if (!File.Exists(Path.Combine(_projectModelPath, "obj", "project.assets.json")))
429var objPath = Path.Combine(_projectModelPath, "obj");
451File.WriteAllText(Path.Combine(_projectModelPath, fileName), content);
454projectDocument.Save(Path.Combine(_projectModelPath, ProjectFileName));
460var staleNugetConfig = Path.Combine(_projectModelPath, "nuget.config");
491var projectFile = new FileInfo(Path.Combine(_projectModelPath, ProjectFileName));
542var assemblyPath = Path.Combine(BuildPath, ProjectDllName);
680var workingDirFullPath = Path.GetFullPath(workingDirectory);
682var globalNuGetPath = Path.Combine(userProfile, ".nuget");
688var configFullPath = Path.GetFullPath(configPath);
689var configDir = Path.GetDirectoryName(configFullPath);
732var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props");
Projects\GuestAppHostProject.cs (15)
948var apphostRunPath = Path.Combine(directory.FullName, "apphost.run.json");
949var launchSettingsPath = Path.Combine(directory.FullName, "Properties", "launchSettings.json");
1692var outputPath = Path.Combine(appPath, LanguageInfo.GeneratedFolderName);
1700outputPath = Path.Combine(appPath, LanguageInfo.LegacyGeneratedFolderName);
1716var filePath = Path.Combine(outputPath, fileName);
1717var directory = Path.GetDirectoryName(filePath);
1958var manifestPath = Path.Combine(outputPath, GeneratedManifestFileName);
2006var fullPath = Path.GetFullPath(Path.Combine(outputPath, recordedRelativePath));
2010var root = Path.GetFullPath(outputPath);
2011if (!fullPath.StartsWith(root + Path.DirectorySeparatorChar, PathComparison))
2031var hashPath = Path.Combine(generatedPath, ".codegen-hash");
2281var existingBundlePath = Path.GetFullPath(existingCertificateBundle, workingDirectory.FullName);
2296var bundleDirectory = Path.Combine(
2300var bundlePath = Path.Combine(bundleDirectory, $"{cacheFilePrefix}-{bundleHash}.pem");
Projects\IntegrationClosureBuilder.cs (11)
57projectFile.AddProperty("AspireClosureMetadataFile", Path.Combine(restoreDir, ClosureMetadataFileName));
58projectFile.AddProperty("AspireClosureSourcesFile", Path.Combine(restoreDir, ClosureSourcesFileName));
59projectFile.AddProperty("AspireClosureTargetsFile", Path.Combine(restoreDir, ClosureTargetsFileName));
60projectFile.AddProperty("AspireProjectRefAssemblyNamesFile", Path.Combine(restoreDir, ProjectRefAssemblyNamesFileName));
124new XElement("BaseOutputPath", CliPathHelper.EnsureTrailingSlash(Path.Combine(restoreDir, "bin"))),
125new XElement("BaseIntermediateOutputPath", CliPathHelper.EnsureTrailingSlash(Path.Combine(restoreDir, "obj"))),
145var path = Path.Combine(integrationCacheFullPath, "apphosts", hashFragment);
174var sourcesPath = Path.Combine(restoreDir, ClosureSourcesFileName);
175var metadataPath = Path.Combine(restoreDir, ClosureMetadataFileName);
176var targetsPath = Path.Combine(restoreDir, ClosureTargetsFileName);
237var path = Path.Combine(restoreDir, ProjectRefAssemblyNamesFileName);
Projects\JavaAppHostToolchainResolver.cs (38)
98private static string GradleInitScriptPath => GradleInitScriptRelativePath.Replace('/', Path.DirectorySeparatorChar);
133if (File.Exists(Path.Combine(candidate.FullName, MavenPomFileName)))
140if (File.Exists(Path.Combine(candidate.FullName, gradleBuildFileName)))
191var candidate = Path.Combine(directory.FullName, wrapperName);
206var gitPath = Path.Combine(directory.FullName, ".git");
223JavaAppHostToolchain.Gradle => File.Exists(Path.Combine(directory, GradleSettingsFileName))
224|| File.Exists(Path.Combine(directory, GradleKotlinSettingsFileName)),
227JavaAppHostToolchain.Maven => File.Exists(Path.Combine(directory, MavenPomFileName)),
318var wrapperDirectory = new DirectoryInfo(Path.GetDirectoryName(wrapperPath)!);
345var relativeWrapperPath = Path.GetRelativePath(appHostDirectory.FullName, wrapperPath);
436var scriptPath = Path.Combine(resolution.ProjectDirectory.FullName, GradleInitScriptPath);
438Directory.CreateDirectory(Path.GetDirectoryName(scriptPath)!);
495var dependencyDirectory = Path.Combine(
527var relativePath = Path.GetRelativePath(appHostDirectory.FullName, projectDirectory.FullName);
534return projectPath is null ? path : Path.Combine(projectPath, path);
551JavaAppHostToolchain.Maven => ["-f", Path.Combine(projectPath, MavenPomFileName)],
571var reactorPath = Path.GetRelativePath(appHostDirectory.FullName, invocation.WrapperDirectory.FullName);
572var modulePath = Path.GetRelativePath(invocation.WrapperDirectory.FullName, projectDirectory.FullName);
576"-f", Path.Combine(reactorPath, MavenPomFileName),
602var document = XDocument.Load(Path.Combine(aggregatorDirectory.FullName, MavenPomFileName));
618var moduleDirectory = new DirectoryInfo(Path.GetFullPath(Path.Combine(aggregatorDirectory.FullName, modulePath)));
620|| (File.Exists(Path.Combine(moduleDirectory.FullName, MavenPomFileName))
642JavaAppHostToolchain.Maven => Path.Combine("target", "classes"),
643JavaAppHostToolchain.Gradle => Path.Combine("build", "classes", "java", "main"),
652JavaAppHostToolchain.Maven => Path.Combine("target", DependencyDirectoryName),
653JavaAppHostToolchain.Gradle => Path.Combine("build", DependencyDirectoryName),
784Path.Combine("gradle", "libs.versions.toml")
808"-classpath", Path.Combine(dependencyDirectory, "*"),
820"-sourcepath", string.Join(Path.PathSeparator, ".", Path.Combine("src", "main", "java")),
852$"{CombineProjectPath(projectPath, Path.Combine("src", "main", "java"))}/**",
856.Select(output => Path.Combine(classesDirectory, Path.GetFileName(output)))
859StampFile = Path.Combine(classesDirectory, Path.GetFileName(baseCompile.UpToDateCheck.StampFile))
869var classPath = string.Join(Path.PathSeparator, [classesDirectory, Path.Combine(dependencyDirectory, "*")]);
Projects\PrebuiltAppHostServer.cs (24)
97_appDirectoryPath = Path.GetFullPath(appPath);
112_projectReferencePrepareLockPath = Path.Combine(_workingDirectory, "project-layouts", "prepare.lock");
150var assemblyPath = hostingAssembly?.Path ?? (_integrationLibsPath is not null ? Path.Combine(_integrationLibsPath, "Aspire.Hosting.dll") : null);
227_integrationProbeManifestPath = Path.Combine(_workingDirectory, IntegrationPackageProbeManifest.FileName);
484return Path.GetFullPath(projectPath);
526var projectDirectory = Path.GetDirectoryName(projectPath);
547references.Add(Path.Combine(projectDirectory, include.Replace('\\', Path.DirectorySeparatorChar)));
573var directory = Path.GetDirectoryName(projectPath);
579var candidate = Path.Combine(directory, fileName);
586directory = Path.GetDirectoryName(directory);
655var assetsPath = Path.Combine(restoreDir, "obj", ProjectAssetsFileName);
656var stampPath = Path.Combine(restoreDir, "obj", RestoreStampFileName);
680var objDir = Path.Combine(restoreDir, "obj");
682await File.WriteAllTextAsync(Path.Combine(objDir, RestoreStampFileName), fingerprint, cancellationToken).ConfigureAwait(false);
773var restoreDir = Path.Combine(_workingDirectory, "integration-restore");
795var projectFilePath = Path.Combine(restoreDir, IntegrationProjectFileName);
807Path.Combine(restoreDir, "Directory.Packages.props"), directoryPackagesProps, cancellationToken);
812Path.Combine(restoreDir, "Directory.Build.props"),
818Path.Combine(restoreDir, "Directory.Build.targets"), "<Project />", cancellationToken);
864Path.Combine(restoreDir, "obj", IntegrationClosureBuilder.ProjectAssetsFileName),
875Path.Combine(restoreDir, ClosureManifestFileName),
1195return Path.Combine(
1550Path.Combine(contentRootPath, "appsettings.json"),
Projects\ProjectLocator.cs (32)
391var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
411var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
424var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
506var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsAppHost.FullName);
518var settingsAppHostRelativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsAppHost.FullName);
631var prefix = directoryPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar;
701var configFilePath = Path.Combine(searchDirectory.FullName, AspireConfigFile.FileName);
713var qualifiedPath = Path.IsPathRooted(configAppHostPath)
715: Path.Combine(searchDirectory.FullName, configAppHostPath);
770var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath);
860if (path.Length == 0 || path.Contains('\0') || path.IndexOfAny(Path.GetInvalidPathChars()) >= 0)
970file => $"{file.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName).EscapeMarkup()})",
1160MultipleAppHostProjectsFoundBehavior.Prompt => await interactionService.PromptForSelectionAsync(InteractionServiceStrings.SelectAppHostToUse, results.BuildableAppHost.Select(c => c.AppHostFile).ToList(), projectFile => $"{projectFile.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName).EscapeMarkup()})", cancellationToken: cancellationToken),
1258Path.IsPathRooted(existingPath) ? existingPath : Path.Combine(settingsFile.Directory!.FullName, existingPath));
1284var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
1309var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
1321var configDirectoryPath = Path.GetDirectoryName(configPath)!;
1325var trimmedConfigDirectoryPath = configDirectoryPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
1326if (string.Equals(Path.GetFileName(trimmedConfigDirectoryPath), ".aspire", StringComparison.OrdinalIgnoreCase) &&
1329targetSettingsFilePath = Path.Combine(parentDirectory.FullName, AspireConfigFile.FileName);
1345var newConfigPath = Path.Combine(configRoot.FullName, AspireConfigFile.FileName);
1396return Path.Combine(executionContext.CacheDirectory.FullName, "workspace-config-locks", $"{lockFileName}.lock");
1404return Path.GetFullPath(envPath);
1410return Path.GetFullPath(Path.Combine(userProfile, ".nuget", "packages"));
Projects\TypeScriptAppHostToolchainResolver.cs (14)
63if (File.Exists(Path.Combine(candidateDirectory.FullName, BunLockFileName)))
68if (File.Exists(Path.Combine(candidateDirectory.FullName, BunBinaryLockFileName)))
73if (File.Exists(Path.Combine(candidateDirectory.FullName, PnpmLockFileName)))
78var yarnLockFilePath = Path.Combine(candidateDirectory.FullName, YarnLockFileName);
89if (File.Exists(Path.Combine(candidateDirectory.FullName, YarnConfigFileName)))
94if (File.Exists(Path.Combine(candidateDirectory.FullName, DenoLockFileName)))
99if (File.Exists(Path.Combine(candidateDirectory.FullName, DenoJsonFileName)))
104if (File.Exists(Path.Combine(candidateDirectory.FullName, DenoJsoncFileName)))
109if (File.Exists(Path.Combine(candidateDirectory.FullName, PackageLockFileName)))
355var packageJsonPath = Path.Combine(appHostDirectory.FullName, PackageJsonFileName);
503var parentPath = Path.TrimEndingDirectorySeparator(parentDirectory.FullName);
504if (string.Equals(parentPath, Path.TrimEndingDirectorySeparator(parentDirectory.Root.FullName), pathComparison))
511!string.Equals(parentPath, Path.TrimEndingDirectorySeparator(Path.GetFullPath(homeDirectory)), pathComparison);
Scaffolding\ScaffoldingService.cs (22)
184var filePath = Path.Combine(scaffoldDirectory.FullName, fileName);
185var fileDirectory = Path.GetDirectoryName(filePath);
242var appHostRunPath = Path.Combine(scaffoldDirectory.FullName, "apphost.run.json");
268if (IsTypeScriptLanguage(language) && File.Exists(Path.Combine(directory.FullName, PackageJsonFileName)))
272return new DirectoryInfo(Path.Combine(directory.FullName, BrownfieldTypeScriptAppHostDirectoryName));
282return Path.Combine(scaffoldDirectory.FullName, appHostFileName);
288rootDirectory.FullName.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar),
289scaffoldDirectory.FullName.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar),
294var packageJsonPath = Path.Combine(rootDirectory.FullName, PackageJsonFileName);
311var relativeAppHostDirectory = PathNormalizer.NormalizePathForStorage(Path.GetRelativePath(rootDirectory.FullName, appHostDirectory.FullName));
364language.MatchesFile(Path.GetFileName(fileName)));
369Path.GetRelativePath(rootDirectory.FullName, Path.Combine(scaffoldDirectory.FullName, appHostFileName)));
491var outputPath = Path.Combine(directoryPath, LanguageInfo.GeneratedFolderName);
496var filePath = Path.Combine(outputPath, fileName);
497var fileDirectory = Path.GetDirectoryName(filePath);
515!File.Exists(Path.Combine(directory.FullName, PackageJsonFileName)) ||
555var filePath = Path.Combine(rootDirectory, fileName);
601=> Path.GetFileName(fileName).Equals(".gitignore", StringComparison.Ordinal);
604=> Path.GetFileName(fileName).Equals(PackageJsonFileName, StringComparison.OrdinalIgnoreCase);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Telemetry\InternalMicrosoftDetector.cs (10)
70Path.Combine(executionContext.CacheDirectory.FullName, CacheSubdirectoryName, CacheFileName),
549var directory = Path.GetDirectoryName(_cacheFilePath);
555var tempPath = Path.Combine(directory, $"{Path.GetRandomFileName()}.tmp");
628var accountStore = Path.Combine(localAppData, ".IdentityService", "V3AccountStore.json");
894var copilotHome = Path.Combine(_executionContext.HomeDirectory.FullName, ".copilot");
1564var path = Path.Combine(directory, fileName);
1613var extensions = _environment.IsWindows() && string.IsNullOrEmpty(Path.GetExtension(command))
1617foreach (var directory in path.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries))
1621var candidate = Path.Combine(directory, command + extension);
aspire-managed (25)
aspire-tray (108)
Aspire.Acquisition.Tests (477)
Scripts\Common\FakeArchiveHelper.cs (11)
22var archivePath = Path.Combine(outputDir, $"aspire-cli-{platform}.{extension}");
25var contentDir = Path.Combine(outputDir, $"archive-content-{Guid.NewGuid():N}");
31var binaryPath = Path.Combine(contentDir, binaryName);
66var path = Path.Combine(outputDir, filename);
101var archivePath = Path.Combine(outputDir, $"aspire-cli-{platform}.{extension}");
104var contentDir = Path.Combine(outputDir, $"verify-content-{Guid.NewGuid():N}");
112? Path.Combine(contentDir, "payload")
116var binaryPath = Path.Combine(binaryDir, "aspire");
125var sidecarPath = Path.Combine(contentDir, ".aspire-install.json");
206var relativePath = Path.GetRelativePath(contentDir, fullPath).Replace(Path.DirectorySeparatorChar, '/');
Scripts\CompletionScriptTests.cs (115)
21var profile = Path.Combine(env.MockHome, "profile.ps1");
22var blockedDirectory = Path.GetDirectoryName(CompletionPath(env.MockHome, cli, dogfood))!;
23Directory.CreateDirectory(Path.GetDirectoryName(blockedDirectory)!);
41Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
74var target = Path.Combine(env.TempDirectory, "actual");
75var selected = Path.Combine(env.TempDirectory, "selected");
76var outside = Path.Combine(env.TempDirectory, "outside");
84$destination = '{{Quote(Path.Combine(selected, "completions", "aspire.ps1"))}}'
88New-Item -ItemType $linkType -Path '{{Quote(Path.Combine(target, "completions"))}}' -Target '{{Quote(outside)}}' -ErrorAction Stop | Out-Null
110var home = Path.Combine(env.MockHome, "it's $home ` [test]");
112var profile = Path.Combine(home, "edition profile", "profile.ps1");
113Directory.CreateDirectory(Path.GetDirectoryName(profile)!);
143Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
166var cli = CreateFakeCli(outsideHome ? Path.Combine(env.TempDirectory, "custom install") : env.MockHome);
167var profile = Path.Combine(env.MockHome, "profile.ps1");
169Directory.CreateDirectory(Path.GetDirectoryName(completion)!);
189Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
192Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
204var cli = CreateFakeCli(Path.Combine(env.TempDirectory, "custom install"));
205var profile = Path.Combine(Path.GetDirectoryName(cli)!, "outside-profile.ps1");
222Assert.False(Directory.Exists(Path.Combine(Path.GetDirectoryName(cli)!, "completions")));
233var cli = CreateFakeCli(Path.Combine(env.TempDirectory, "it's $install ` [test]"));
234var profile = Path.Combine(env.MockHome, "profile.ps1");
257Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire")));
258Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
272var installRoot = Path.Combine(env.TempDirectory, "custom install");
274var profile = Path.Combine(env.MockHome, "profile.ps1");
277var outside = Path.Combine(env.TempDirectory, "custom install-other");
279var sentinel = Path.Combine(outside, "aspire.ps1");
282var link = destination == "directory-link" ? Path.GetDirectoryName(completion)! : completion;
283Directory.CreateDirectory(Path.GetDirectoryName(link)!);
308Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
311Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
322var installRoot = Path.Combine(env.TempDirectory, "not yet installed", "bin");
323var cli = Path.Combine(installRoot, "aspire.ps1");
324var profile = Path.Combine(env.MockHome, "profile.ps1");
340Assert.False(Directory.Exists(Path.GetDirectoryName(installRoot)));
355var profile = Path.Combine(env.MockHome, "profile.ps1");
357Directory.CreateDirectory(Path.GetDirectoryName(completion)!);
376Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
377Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
390var profile = Path.Combine(env.MockHome, "profile.ps1");
417var profile = Path.Combine(env.MockHome, "profile.ps1");
445var profile = Path.Combine(env.MockHome, "profile.ps1");
447Directory.CreateDirectory(Path.GetDirectoryName(completion)!);
465Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
473var cli = Path.Combine(home, "fake aspire.ps1");
487Path.Combine(dogfood ? Path.GetDirectoryName(cli)! : Path.Combine(home, ".aspire"), "completions", "aspire.ps1");
500var bashrc = Path.Combine(env.MockHome, ".bashrc");
501var outside = Path.Combine(env.TempDirectory, "outside-profile");
504File.CreateSymbolicLink(Path.Combine(env.MockHome, ".bash_profile"), outside);
529var profiles = new[] { Path.Combine(env.MockHome, ".bashrc"), Path.Combine(env.MockHome, ".bash_profile") };
569var target = Path.Combine(env.TempDirectory, "actual");
570var selected = Path.Combine(env.TempDirectory, "selected");
571var outside = Path.Combine(env.TempDirectory, "outside");
579is_completion_path_within_root '{{Quote(Path.Combine(selected, "completions", "aspire.bash"))}}' '{{Quote(selected)}}'
580ln -s '{{Quote(outside)}}' '{{Quote(Path.Combine(target, "completions"))}}'
581if is_completion_path_within_root '{{Quote(Path.Combine(selected, "completions", "aspire.bash"))}}' '{{Quote(selected)}}'; then
629var home = Path.Combine(env.MockHome, "it's $home ` [test]");
634"zsh" => Path.Combine(home, "z dot", ".zshrc"),
635"fish" => Path.Combine(home, "xdg config", "fish", "conf.d", "aspire-completions.fish"),
636_ => Path.Combine(home, ".bashrc")
638Directory.CreateDirectory(Path.GetDirectoryName(profile)!);
640var completion = Path.Combine(dogfood ? home : Path.Combine(home, ".aspire"), "completions", $"aspire.{shell}");
666Assert.Empty(Directory.GetDirectories(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
697var cli = CreateFakeCli(outsideHome ? Path.Combine(env.TempDirectory, "custom install") : env.MockHome);
698var completion = Path.Combine(dogfood || outsideHome ? Path.GetDirectoryName(cli)! : Path.Combine(env.MockHome, ".aspire"), "completions", "aspire.bash");
699Directory.CreateDirectory(Path.GetDirectoryName(completion)!);
701var profile = Path.Combine(env.MockHome, ".bashrc");
721Assert.Empty(Directory.GetDirectories(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
724Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
734var installRoot = Path.Combine(env.TempDirectory, "custom install");
736var outside = Path.Combine(installRoot, ".zshrc");
740File.CreateSymbolicLink(Path.Combine(env.MockHome, ".zshrc"), outside);
756Assert.True(File.Exists(Path.Combine(env.MockHome, ".aspire", "completions", "aspire.zsh")));
757Assert.False(Directory.Exists(Path.Combine(installRoot, "completions")));
772var installRoot = Path.Combine(env.TempDirectory, "it's $install ` [test]");
776"zsh" => Path.Combine(env.MockHome, ".zshrc"),
777"fish" => Path.Combine(env.MockHome, ".config", "fish", "conf.d", "aspire-completions.fish"),
778_ => Path.Combine(env.MockHome, ".bashrc")
780Directory.CreateDirectory(Path.GetDirectoryName(profile)!);
782var completion = Path.Combine(installRoot, "completions", $"aspire.{shell}");
803Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire")));
804Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile")));
805Assert.Empty(Directory.GetDirectories(Path.GetDirectoryName(completion)!, ".aspire-completions-*"));
821var installRoot = Path.Combine(env.TempDirectory, "custom install");
823var profile = Path.Combine(env.MockHome, ".bashrc");
826var outside = Path.Combine(env.TempDirectory, "custom install-other");
828var sentinel = Path.Combine(outside, "aspire.bash");
830var completionDirectory = Path.Combine(installRoot, "completions");
831var completion = Path.Combine(completionDirectory, "aspire.bash");
845File.CreateSymbolicLink(completion, destination == "file-link" ? sentinel : Path.Combine(outside, "missing"));
866Assert.False(File.Exists(Path.Combine(env.MockHome, "called")));
876var installRoot = Path.Combine(env.TempDirectory, "not yet installed", "bin");
877var cli = Path.Combine(installRoot, "aspire");
878var profile = Path.Combine(env.MockHome, ".bashrc");
895Assert.False(Directory.Exists(Path.GetDirectoryName(installRoot)));
907var profile = Path.Combine(env.MockHome, loginProfile);
927Assert.True(File.Exists(Path.Combine(env.MockHome, ".bashrc")));
935File.WriteAllText(Path.Combine(env.MockHome, ".bashrc"), "export ASPIRE_TEST_BASHRC_LOADED=true\n");
960var profile = Path.Combine(env.MockHome, ".bashrc");
976Assert.True(File.Exists(Path.Combine(env.MockHome, "completions", "aspire.bash")));
977Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile")));
986var profile = Path.Combine(env.MockHome, ".bashrc");
1003Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile")));
1004Assert.True(File.Exists(Path.Combine(env.MockHome, ".aspire", "completions", "aspire.bash")));
1011var cli = Path.Combine(home, "fake aspire");
Scripts\PRScriptFunctionTests.cs (15)
89var pkgDir = Path.Combine(env.TempDirectory, "packages");
112var emptyDir = Path.Combine(env.TempDirectory, "empty-packages");
131var pkgDir = Path.Combine(env.TempDirectory, "packages");
153var pkgDir = Path.Combine(env.TempDirectory, "packages");
229var tempDir = Path.Combine(env.TempDirectory, "download-temp");
231File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake");
249var tempDir = Path.Combine(env.TempDirectory, "download-temp");
251File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake");
269var tempDir = Path.Combine(env.TempDirectory, "download-temp");
271File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake");
294var tempDir = Path.Combine(env.TempDirectory, "work");
318var tempDir = Path.Combine(env.TempDirectory, "work");
341var tempDir = Path.Combine(env.TempDirectory, "work");
372var configFile = Path.Combine(env.MockHome, ".zshrc");
375var newPath = Path.Combine(env.MockHome, ".aspire", "bin");
Scripts\PRScriptInstallerModeTests.cs (94)
22cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
30cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
37await File.WriteAllTextAsync(Path.Combine(root, "aspire.rb"), "cask \"aspire\" do\n version \"13.3.0\"\nend\n");
38await File.WriteAllTextAsync(Path.Combine(root, "dogfood.sh"), "#!/usr/bin/env bash\nexit 0\n");
47await File.WriteAllTextAsync(Path.Combine(root, "Microsoft.Aspire.installer.yaml"), "PackageIdentifier: Microsoft.Aspire\nPackageVersion: 13.3.0\nInstallers: []\n");
48await File.WriteAllTextAsync(Path.Combine(root, "dogfood.ps1"), "exit 0\n");
66var manifestDir = Path.Combine(root, "installer-winget");
67var archiveRoot = Path.Combine(root, "installer-native-archives");
70var archiveDir = Path.Combine(archiveRoot, "Debug", "Shipping");
94await File.WriteAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.installer.yaml"), installerYaml);
95await File.WriteAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.yaml"), $"PackageIdentifier: Microsoft.Aspire\nPackageVersion: {version}\nManifestType: version\nManifestVersion: 1.10.0\n");
96await File.WriteAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.locale.en-US.yaml"), $"PackageIdentifier: Microsoft.Aspire\nPackageVersion: {version}\nPackageLocale: en-US\nManifestType: defaultLocale\nManifestVersion: 1.10.0\n");
97await File.WriteAllTextAsync(Path.Combine(manifestDir, "dogfood.ps1"), "exit 0\n");
103await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, $"aspire-cli-win-x64-{version}.zip"), $"stub-x64-{version}");
104await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, $"aspire-cli-win-arm64-{version}.zip"), $"stub-arm64-{version}");
111var mockBinDir = Path.Combine(env.TempDirectory, "mock-homebrew-bin");
112var brewRepository = Path.Combine(env.TempDirectory, "brew-repository");
113var brewPrefix = Path.Combine(env.TempDirectory, "brew-prefix");
114var brewLog = Path.Combine(env.TempDirectory, "brew.log");
115var codesignLog = Path.Combine(env.TempDirectory, "codesign.log");
121var brewPath = Path.Combine(mockBinDir, "brew");
198var curlPath = Path.Combine(mockBinDir, "curl");
206var codesignPath = Path.Combine(mockBinDir, "codesign");
239var mockBinDir = Path.Combine(env.TempDirectory, "mock-winget-bin");
240var wingetLog = Path.Combine(env.TempDirectory, "winget.log");
246var implPath = Path.Combine(mockBinDir, "winget-impl.ps1");
381var wingetCmd = Path.Combine(mockBinDir, "winget.cmd");
387var aspireCmd = Path.Combine(mockBinDir, "aspire.cmd");
400await File.WriteAllTextAsync(Path.Combine(root, "aspire-cli-osx-arm64-13.3.0.tar.gz"), "fake arm64 archive");
401await File.WriteAllTextAsync(Path.Combine(root, "aspire-cli-osx-x64-13.3.0.tar.gz"), "fake x64 archive");
406var archiveDir = Path.Combine(root, "Debug", "Shipping");
411await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, "aspire-cli-win-x64-13.3.0.zip"), "stub-x64-13.3.0");
412await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, "aspire-cli-win-arm64-13.3.0.zip"), "stub-arm64-13.3.0");
429var parent = Path.GetDirectoryName(path);
536var localDir = await CreateHomebrewInstallerArtifactAsync(Path.Combine(env.TempDirectory, "homebrew-artifact"));
575var localDir = await CreateHomebrewInstallerArtifactAsync(Path.Combine(env.TempDirectory, "homebrew-artifact"));
578cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin");
580var result = await cmd.ExecuteAsync(Path.Combine(localDir, "aspire.rb"));
592var caskPath = Path.Combine(env.TempDirectory, "aspire.rb");
596cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin");
611var archiveRoot = Path.Combine(env.TempDirectory, "archives");
615cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin");
621"--output-dir", Path.Combine(env.TempDirectory, "homebrew-output"),
628var brewLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "brew.log"));
633var codesignLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "codesign.log"));
644var archiveRoot = Path.Combine(env.TempDirectory, "archives");
648cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin");
654"--output-dir", Path.Combine(env.TempDirectory, "homebrew-output"),
658var codesignLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "codesign.log"));
660var brewLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "brew.log"));
670var archiveRoot = Path.Combine(env.TempDirectory, "archives");
673var outputDir = Path.Combine(env.TempDirectory, "homebrew-output");
675cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin");
686var cask = await File.ReadAllTextAsync(Path.Combine(outputDir, "aspire.rb"));
692Assert.Contains((await GetSha256HexAsync(Path.Combine(archiveRoot, "aspire-cli-osx-arm64-13.3.0.tar.gz"))).ToLowerInvariant(), cask);
693Assert.Contains((await GetSha256HexAsync(Path.Combine(archiveRoot, "aspire-cli-osx-x64-13.3.0.tar.gz"))).ToLowerInvariant(), cask);
695Assert.True(File.Exists(Path.Combine(outputDir, "dogfood.sh")));
704var brewLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "brew.log"));
735Assert.DoesNotContain($"dogfood{Path.DirectorySeparatorChar}pr-12345{Path.DirectorySeparatorChar}bin", result.Output);
760Assert.DoesNotContain($"dogfood{Path.DirectorySeparatorChar}pr-12345{Path.DirectorySeparatorChar}bin", result.Output);
768var localDir = await CreateWinGetInstallerArtifactAsync(Path.Combine(env.TempDirectory, "winget-artifact"));
807var archiveRoot = Path.Combine(env.TempDirectory, "archives");
809var outputDir = Path.Combine(env.TempDirectory, "winget-output");
820var installerManifest = await File.ReadAllTextAsync(Path.Combine(outputDir, "Microsoft.Aspire.installer.yaml"));
824Assert.Contains(await GetSha256HexAsync(Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-x64-13.3.0.zip")), installerManifest);
825Assert.Contains(await GetSha256HexAsync(Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-arm64-13.3.0.zip")), installerManifest);
829var localeManifest = await File.ReadAllTextAsync(Path.Combine(outputDir, "Microsoft.Aspire.locale.en-US.yaml"));
831Assert.True(File.Exists(Path.Combine(outputDir, "Microsoft.Aspire.yaml")));
832Assert.True(File.Exists(Path.Combine(outputDir, "dogfood.ps1")));
841var localDir = await CreateWinGetInstallerArtifactAsync(Path.Combine(env.TempDirectory, "winget-artifact"));
844cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
849var wingetLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "winget.log"));
860var localDir = await CreateWinGetInstallerArtifactAsync(Path.Combine(env.TempDirectory, "winget-artifact"));
863cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
890cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
896var wingetLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "winget.log"));
901var originalInstaller = await File.ReadAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.installer.yaml"));
923var x64Archive = Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-x64-13.3.0.zip");
928cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
950var archiveRoot = Path.Combine(env.TempDirectory, "archives");
951var archiveDir = Path.Combine(archiveRoot, "Debug", "Shipping");
953var x64Zip = Path.Combine(archiveDir, "aspire-cli-win-x64-13.3.0.zip");
954var arm64Zip = Path.Combine(archiveDir, "aspire-cli-win-arm64-13.3.0.zip");
958var outputDir = Path.Combine(env.TempDirectory, "winget-output");
969var installerYaml = await File.ReadAllTextAsync(Path.Combine(outputDir, "Microsoft.Aspire.installer.yaml"));
975var extractDir = Path.Combine(env.TempDirectory, $"extract-{Path.GetFileNameWithoutExtension(archive)}");
979var expected = Path.Combine(extractDir, rel.Replace('/', Path.DirectorySeparatorChar));
981$"NestedInstallerFiles entry '{rel}' from {Path.GetFileName(archive)} not found at {expected}. Manifest disagrees with archive contents.");
1001var x64Archive = Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-x64-13.3.0.zip");
1013cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
Scripts\PRScriptPowerShellTests.cs (27)
27cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
83Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire")));
115var mockGhPath = Path.Combine(mockBinPath, OperatingSystem.IsWindows() ? "gh.cmd" : "gh");
129var mockGhPath = Path.Combine(mockBinPath, OperatingSystem.IsWindows() ? "gh.cmd" : "gh");
143var mockGhPath = Path.Combine(mockBinPath, OperatingSystem.IsWindows() ? "gh.cmd" : "gh");
156var customPath = Path.Combine(env.TempDirectory, "custom");
201var localDir = Path.Combine(env.TempDirectory, "local artifacts");
226var localDir = Path.Combine(env.TempDirectory, "raw-build");
229await File.WriteAllTextAsync(Path.Combine(localDir, "aspire"), "#!/bin/sh\necho fake\n");
309var customPath = Path.Combine(env.TempDirectory, "custom");
434var localDir = Path.Combine(env.TempDirectory, "local-artifacts");
468var expectedBinaryPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", binaryName);
488var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json");
514Assert.Contains(Path.Combine("dogfood", "pr-99999", "bin"), hintLine);
515var binDir = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin");
523Assert.Contains($"{binDir}{Path.PathSeparator}$env:PATH", hintLine);
530var customPath = Path.Combine(env.TempDirectory, "custom-prefix");
537var binDir = Path.Combine(customPath, "dogfood", "pr-99999", "bin");
539Assert.Contains($"{binDir}{Path.PathSeparator}$env:PATH", hintLine);
540Assert.DoesNotContain(Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin"), hintLine);
568var expectedHive = Path.Combine("hives", "pr-99999", "packages");
585var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json");
601var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json");
615var localDir = Path.Combine(env.TempDirectory, "local-artifacts");
634var binSidecar = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
638var aspireRoot = Path.Combine(env.MockHome, ".aspire");
716var dogfoodRoot = Path.Combine(mockHome, ".aspire", "dogfood");
Scripts\PRScriptPSFunctionTests.cs (21)
84var cliBinDir = Path.Combine(env.TempDirectory, "cli-bin");
85var existingPath = $"{cliBinDir}{Path.PathSeparator}{Path.Combine(env.TempDirectory, "other-bin")}";
86var githubPath = Path.Combine(env.TempDirectory, "github-path.txt");
116var pkgDir = Path.Combine(env.TempDirectory, "packages");
139var emptyDir = Path.Combine(env.TempDirectory, "empty-packages");
158var pkgDir = Path.Combine(env.TempDirectory, "packages");
180var pkgDir = Path.Combine(env.TempDirectory, "packages");
260var tempDir = Path.Combine(env.TempDirectory, "download-temp");
262File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake");
280var tempDir = Path.Combine(env.TempDirectory, "download-temp");
282File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake");
300var tempDir = Path.Combine(env.TempDirectory, "download-temp");
302File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake");
324var downloadDir = Path.Combine(env.TempDirectory, "cli-download");
326await File.WriteAllTextAsync(Path.Combine(downloadDir, "README.txt"), "no archive here");
328var binDir = Path.Combine(env.TempDirectory, "bin");
346var downloadDir = Path.Combine(env.TempDirectory, "cli-download");
348await File.WriteAllTextAsync(Path.Combine(downloadDir, "aspire-cli-linux-x64.tar.gz"), "fake1");
349await File.WriteAllTextAsync(Path.Combine(downloadDir, "aspire-cli-osx-arm64.tar.gz"), "fake2");
351var binDir = Path.Combine(env.TempDirectory, "bin");
Scripts\PRScriptShellTests.cs (22)
25cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
108var mockGhPath = Path.Combine(mockBinPath, "gh");
122var mockGhPath = Path.Combine(mockBinPath, "gh");
135var customPath = Path.Combine(env.TempDirectory, "custom");
161var localDir = Path.Combine(env.TempDirectory, "local artifacts");
186var localDir = Path.Combine(env.TempDirectory, "raw-build");
189await File.WriteAllTextAsync(Path.Combine(localDir, "aspire"), "#!/bin/sh\necho fake\n");
365var customPath = Path.Combine(env.TempDirectory, "custom");
512var localDir = Path.Combine(env.TempDirectory, "local-artifacts");
543var expectedBinaryPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", "aspire");
545var scriptRouteBin = Path.Combine(env.MockHome, ".aspire", "bin", "aspire");
565var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json");
588Assert.Contains(Path.Combine("dogfood", "pr-99999", "bin"), hintLine);
597var customPath = Path.Combine(env.TempDirectory, "custom-prefix");
633var expectedHive = Path.Combine("hives", "pr-99999", "packages");
650var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json");
666var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json");
680var localDir = Path.Combine(env.TempDirectory, "local-artifacts");
701var binSidecar = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
705var aspireRoot = Path.Combine(env.MockHome, ".aspire");
741var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999999999", "bin", ".aspire-install.json");
792var dogfoodRoot = Path.Combine(mockHome, ".aspire", "dogfood");
Scripts\PRScriptToolModeTests.cs (84)
35cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
43cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
49var mockBinDir = Path.Combine(env.TempDirectory, "mock-dotnet-bin");
53var dotnetScriptPath = Path.Combine(mockBinDir, isWindows ? "dotnet.cmd" : "dotnet");
170var localDir = Path.Combine(env.TempDirectory, "artifacts");
196var localDir = Path.Combine(env.TempDirectory, "artifacts");
216var localDir = Path.Combine(env.TempDirectory, "artifacts");
219var customPath = Path.Combine(env.TempDirectory, "custom");
229Assert.Contains($"Would install CLI archive to: {Path.Combine(customPath, "bin")}", result.Output);
325var localDir = Path.Combine(env.TempDirectory, "artifacts");
327var customPath = Path.Combine(env.TempDirectory, "custom");
337Assert.Contains($"dotnet tool install --tool-path {Path.Combine(customPath, "bin")} Aspire.Cli", result.Output);
346var localDir = Path.Combine(env.TempDirectory, "artifacts");
367var localDir = Path.Combine(env.TempDirectory, "artifacts");
387var localDir = Path.Combine(env.TempDirectory, "artifacts");
390var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
393cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
418var localDir = Path.Combine(env.TempDirectory, "artifacts");
421var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
424cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
442var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-5678", "packages");
446Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")),
455var localDir = Path.Combine(env.TempDirectory, "artifacts");
458var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
461cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
489var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
492cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
506var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-12345", "bin", ".aspire-install.json");
510var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-12345", "packages");
512Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")),
529cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
583var localDir = Path.Combine(env.TempDirectory, "artifacts");
585var customPath = Path.Combine(env.TempDirectory, "custom");
586var expectedToolPath = Path.Combine(customPath, "bin");
609var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
629var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
631await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.symbols.nupkg"), "fake-symbols-nupkg-content");
632await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.snupkg"), "fake-symbols-package-content");
634await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13_3_0.nupkg"), "fake-invalid-version-content");
653var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
657await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.1_0.nupkg"), "fake-invalid-version-content");
676var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
698var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
752var localDir = Path.Combine(env.TempDirectory, "artifacts");
777var localDir = Path.Combine(env.TempDirectory, "artifacts");
796var localDir = Path.Combine(env.TempDirectory, "artifacts");
799var customPath = Path.Combine(env.TempDirectory, "custom");
808Assert.Contains($"Installing Aspire CLI to {Path.Combine(customPath, "bin")}", result.Output);
874Assert.Contains(Path.Combine("hives", "pr-99999", "packages"), result.Output);
902var localDir = Path.Combine(env.TempDirectory, "artifacts");
904var customPath = Path.Combine(env.TempDirectory, "custom");
914Assert.Contains($"dotnet tool install --tool-path {Path.Combine(customPath, "bin")} Aspire.Cli", result.Output);
923var localDir = Path.Combine(env.TempDirectory, "artifacts");
944var localDir = Path.Combine(env.TempDirectory, "artifacts");
964var localDir = Path.Combine(env.TempDirectory, "artifacts");
967var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
970cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
994var localDir = Path.Combine(env.TempDirectory, "artifacts");
997var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
1000cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
1018var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-5678", "packages");
1022Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")),
1033var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt");
1036cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
1050var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-12345", "bin", ".aspire-install.json");
1054var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-12345", "packages");
1056Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")),
1073cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
1110var localDir = Path.Combine(env.TempDirectory, "artifacts");
1112var customPath = Path.Combine(env.TempDirectory, "custom");
1113var expectedToolPath = Path.Combine(customPath, "bin");
1136var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
1156var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
1158await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.symbols.nupkg"), "fake-symbols-nupkg-content");
1159await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.snupkg"), "fake-symbols-package-content");
1161await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13_3_0.nupkg"), "fake-invalid-version-content");
1180var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
1183await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.1_0.nupkg"), "fake-invalid-version-content");
1202var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
1224var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
Scripts\ReleaseScriptFunctionTests.cs (20)
305var destPath = Path.Combine(env.TempDirectory, "install-dest");
316Assert.True(File.Exists(Path.Combine(destPath, "aspire")),
326var destPath = Path.Combine(env.TempDirectory, "install-dest-zip");
337Assert.True(File.Exists(Path.Combine(destPath, "aspire.exe")),
437var cliPath = Path.Combine(env.TempDirectory, "aspire");
438var capturePath = Path.Combine(env.TempDirectory, "setup-args.txt");
510var installPath = Path.Combine(env.MockHome, ".aspire", "bin");
513File.WriteAllText(Path.Combine(env.MockHome, ".bashrc"), "# existing config\n");
525var bashrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".bashrc"));
534var installPath = Path.Combine(env.MockHome, ".aspire", "bin");
537File.WriteAllText(Path.Combine(env.MockHome, ".zshrc"), "# existing config\n");
549var zshrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".zshrc"));
558var installPath = Path.Combine(env.MockHome, ".aspire", "bin");
563Path.Combine(env.MockHome, ".bashrc"),
576var bashrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".bashrc"));
585var installPath = Path.Combine(env.MockHome, ".aspire", "bin");
609var mockBinDir = Path.Combine(env.TempDirectory, "mock-bin");
612var mockCurl = Path.Combine(mockBinDir, "curl");
646var mockBinDir = Path.Combine(env.TempDirectory, "mock-bin");
649var mockCurl = Path.Combine(mockBinDir, "curl");
Scripts\ReleaseScriptPowerShellTests.cs (13)
46Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire")));
80var customPath = Path.Combine(env.TempDirectory, "custom");
127var customPath = Path.Combine(env.TempDirectory, "custom");
201var installPath = Path.Combine(env.TempDirectory, "install");
212await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json")));
230var installPath = Path.Combine(env.TempDirectory, "install");
232var sidecarPath = Path.Combine(installPath, ".aspire-install.json");
261var installPath = Path.Combine(env.TempDirectory, "install");
290await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json")));
377var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json");
399var configPath = Path.Combine(env.MockHome, ".aspire", "aspire.config.json");
421var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
439var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
Scripts\ReleaseScriptShellTests.cs (11)
92var customPath = Path.Combine(env.TempDirectory, "custom-bin");
156var installPath = Path.Combine(env.TempDirectory, "install");
167await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json")));
183var installPath = Path.Combine(env.TempDirectory, "install");
196Assert.True(File.Exists(Path.Combine(installPath, ".aspire-install.json")));
203var installPath = Path.Combine(env.TempDirectory, "install");
226await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json")));
311var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json");
333var configPath = Path.Combine(env.MockHome, ".aspire", "aspire.config.json");
355var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
375var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
Aspire.Cli.EndToEnd.Tests (472)
AgentCommandTests.cs (12)
91var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json");
146var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json");
182var vscodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode");
221var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", "aspire", "SKILL.md");
224var deploymentSkillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", "aspire-deployment", "SKILL.md");
229var vscodeMcpConfigPath = Path.Combine(vscodePath, "mcp.json");
272var skillsRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills");
275var skillFile = Path.Combine(skillsRoot, skillName, "SKILL.md");
309var vscodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode");
348var mcpConfigPath = Path.Combine(vscodePath, "mcp.json");
383var vscodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode");
415var mcpConfigPath = Path.Combine(vscodePath, "mcp.json");
BundleSmokeTests.cs (15)
64var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
65var appHostDirectory = Path.Combine(projectRoot, $"{projectName}.AppHost");
66var appHostProjectPath = Path.Combine(appHostDirectory, $"{projectName}.AppHost.csproj");
67var appHostSourcePath = Path.Combine(appHostDirectory, "AppHost.cs");
68var argsOutputPath = Path.Combine(projectRoot, "apphost-args.txt");
88var appHostProjectRelativePath = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, appHostProjectPath);
129var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName);
130var appHostDirectory = Path.Combine(projectRoot, $"{ProjectName}.AppHost");
131var appHostProjectPath = Path.Combine(appHostDirectory, $"{ProjectName}.AppHost.csproj");
132var appHostSourcePath = Path.Combine(appHostDirectory, "AppHost.cs");
133var argsOutputPath = Path.Combine(projectRoot, "apphost-dnx-args.txt");
184var appHostProjectRelativePath = Path.GetRelativePath(projectRoot, appHostProjectPath);
222var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
223var appHostSourcePath = Path.Combine(projectRoot, "apphost.cs");
224var argsOutputPath = Path.Combine(projectRoot, "apphost-file-args.txt");
CentralPackageManagementTests.cs (15)
44var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest");
45var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost");
46var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj");
47var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props");
66File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """
156var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest");
157var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost");
158var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj");
159var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props");
177File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """
279var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest");
280var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost");
281var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj");
282var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props");
297File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """
ChannelUpdateWorkflowTests.cs (10)
83var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
84var aspireConfigPath = Path.Combine(projectPath, "aspire.config.json");
113var appHostPath = Path.GetFullPath(Path.Combine(projectPath, appHostRelativePath));
256var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
267await RunStableChannelUpdateAndAssertChannelPreservedAsync(auto, counter, Path.Combine(projectPath, "aspire.config.json"));
297var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
307await RunStableChannelUpdateAndAssertChannelPreservedAsync(auto, counter, Path.Combine(projectPath, "aspire.config.json"));
339var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
353await RunStableChannelUpdateAndAssertChannelPreservedAsync(auto, counter, Path.Combine(projectPath, "aspire.config.json"));
CompletionTests.cs (12)
34await File.WriteAllTextAsync(Path.Combine(home.FullName, "globalsettings.json"), legacyConfig);
42var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
60Assert.Equal(string.Empty, await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "completion.stderr")));
61Assert.Equal(string.Empty, await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "suggestions.stderr")));
62Assert.Equal("completions\n", await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "suggestions.txt")));
63Assert.Equal("complete -o default -F _aspire_complete aspire\n", await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "registration.txt")));
64Assert.Equal(["globalsettings.json"], Directory.GetFiles(home.FullName, "*", SearchOption.AllDirectories).Select(Path.GetFileName));
66Assert.Equal(legacyConfig, await File.ReadAllTextAsync(Path.Combine(home.FullName, "globalsettings.json")));
89await File.WriteAllTextAsync(Path.Combine(fakeBin.FullName, "aspire"), ("""
110await File.ReadAllBytesAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-arguments.bin")));
111Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-executed")));
126await File.ReadAllBytesAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-arguments.bin")));
ConfigMigrationTests.cs (14)
45var aspireHomeDir = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home");
125var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
126var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
188var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
189var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
232var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
235Path.Combine(aspireHomeDir, "globalsettings.json"),
288var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
289var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
358var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
359var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
438var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
439var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
561var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
CSharpInitTests.cs (14)
28[Path.Combine(appDirectory.FullName, "package.json")] = """{"name":"existing-web","private":true}""",
29[Path.Combine(appDirectory.FullName, "Incidental.slnx")] = "<Solution />"
33existingFiles[Path.Combine(appDirectory.FullName, "aspire.config.json")] = """{"appHost":{"language":"typescript/nodejs"}}""";
66var errorOutput = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "init-error.txt"));
82var toolsDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "tools"));
83var projectPath = Path.Combine(toolsDirectory.FullName, "Incidental.csproj");
86[Path.Combine(workspace.WorkspaceRoot.FullName, "Incidental.sln")] = """
91[Path.Combine(toolsDirectory.FullName, "Incidental.slnx")] = """
124Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
125Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")));
126var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")));
141var description = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "resources.json")));
188var appHostCs = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
189var aspireConfigJson = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
EntityFrameworkCoreDeploymentTests.cs (8)
133var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName);
134var targetRuntimePath = Path.Combine(projectDirectory, ".aspire-e2e-rid");
153var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName);
154var appHostDirectory = Path.Combine(projectDirectory, $"{ProjectName}.AppHost");
155var apiDirectory = Path.Combine(projectDirectory, $"{ProjectName}.ApiService");
158Path.Combine(appHostDirectory, "AppHost.cs"),
209Path.Combine(apiDirectory, "Program.cs"),
247var apiProjectPath = Path.Combine(apiDirectory, $"{ProjectName}.ApiService.csproj");
Helpers\CliE2ETestHelpers.cs (28)
336return Path.Combine(repoRoot, "tests", "Shared", "Docker", dockerfileName);
435var dockerfilePath = Path.Combine(repoRoot, "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base");
487var dockerfilePath = Path.Combine(repoRoot, "tests", "Shared", "Docker", "Dockerfile.e2e-podman");
608if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
917var relativePath = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, hostPath);
928var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props");
955var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props");
975TestContext.Current.KeyValueStorage[$"CaptureFile:{Path.GetFileName(fileName)}"] = path;
1009Path.Combine(repoRoot, "artifacts", "packages", "Debug", "Shipping"),
1010Path.Combine(repoRoot, "artifacts", "packages", "Release", "Shipping")
1025.Select(Path.GetFileName)
1040if (!packageFiles.Any(file => Path.GetFileName(file).StartsWith("Aspire.Hosting.", StringComparison.OrdinalIgnoreCase)))
1049if (!packageFiles.Any(file => Path.GetFileName(file).StartsWith(prefix, StringComparison.OrdinalIgnoreCase)))
1077Path.Combine(repoRoot, "artifacts", "packages", "Debug", "Shipping"),
1078Path.Combine(repoRoot, "artifacts", "packages", "Release", "Shipping")
1092var fileName = Path.GetFileName(file);
1114var configPath = Path.Combine(projectRoot, "aspire.config.json");
1144destDir = Path.Combine(destDir, label);
1147using var logWriter = new StreamWriter(Path.Combine(
1162var captureFileName = Path.GetFileName(fileName);
1169var destFile = Path.Combine(destDir, captureFileName);
1181? Path.Combine(githubWorkspace, "testresults")
1182: Path.Combine(AppContext.BaseDirectory, "TestResults");
1184return Path.Combine(baseDir, "workspaces", testName);
1195var destFile = Path.Combine(destDir, Path.GetFileName(file));
1201var dirName = Path.GetFileName(dir);
1213CopyDirectory(dir, Path.Combine(destDir, destDirName), log);
Helpers\CliInstallStrategyTests.cs (13)
277Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"), options.DockerfilePath);
355Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"), options.DockerfilePath);
370Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e"), options.DockerfilePath);
400Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e"), options.DockerfilePath);
415Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"), options.DockerfilePath);
503File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.3.0-preview.1.25175.1.nupkg"), "");
504File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.linux-x64.13.3.0-preview.1.25175.1.nupkg"), "");
800File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.3.0-preview.1.12345.1.nupkg"), "");
822File.WriteAllText(Path.Combine(tempDir.FullName, $"Aspire.Cli.{version}.nupkg"), "");
840File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.linux-x64.13.3.0.nupkg"), "");
858File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.3.0.nupkg"), "");
859File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.4.0.nupkg"), "");
878File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.linux-x64.13.3.0.nupkg"), "");
Helpers\KubernetesDeployTestHelpers.cs (8)
345var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost");
346var apiDir = Path.Combine(projectDir, $"{projectName}.ApiService");
348Assert.True(File.Exists(Path.Combine(appHostDir, "AppHost.cs")));
349Assert.True(File.Exists(Path.Combine(apiDir, $"{projectName}.ApiService.csproj")));
350Assert.True(File.Exists(Path.Combine(apiDir, "Properties", "launchSettings.json")));
351output.WriteLine($"Writing AppHost.cs to: {Path.Combine(appHostDir, "AppHost.cs")}");
352File.WriteAllText(Path.Combine(appHostDir, "AppHost.cs"), appHostCode);
353File.WriteAllText(Path.Combine(apiDir, "Program.cs"), apiProgramCode);
JavaScriptPublishTests.cs (12)
17private static readonly string s_fixturesDir = Path.Combine(
145var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
178var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
213var appDir = Path.Combine(workspace.WorkspaceRoot.FullName, appName);
220File.WriteAllText(Path.Combine(appDir, "package.json"), $$"""
235File.WriteAllText(Path.Combine(appDir, "yarn.lock"), $$"""
252File.WriteAllText(Path.Combine(appDir, "server.js"), $$"""
277File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "verify-runtime.sh"), $$"""
330File.Copy(file, Path.Combine(workspace.WorkspaceRoot.FullName, Path.GetFileName(file)));
336var targetDir = Path.Combine(workspace.WorkspaceRoot.FullName, Path.GetFileName(fixtureDir));
ProjectReferenceTests.cs (11)
48var configPath = Path.Combine(workDir, "aspire.config.json");
54var integrationDir = Path.Combine(workDir, "MyIntegration");
57File.WriteAllText(Path.Combine(integrationDir, "MyIntegration.csproj"), $$"""
72var aspireHome = Path.Combine(
74var hivesDir = Path.Combine(aspireHome, "hives");
81var packagesDir = Path.Combine(hiveDir, "packages");
84var hiveName = Path.GetFileName(hiveDir);
97File.WriteAllText(Path.Combine(workDir, "nuget.config"), nugetConfig);
100File.WriteAllText(Path.Combine(integrationDir, "MyIntegrationExtensions.cs"), """
126var modulesDir = Path.Combine(workDir, ".aspire", "modules");
133File.WriteAllText(Path.Combine(workDir, "apphost.mts"), """
RepositoryToolUpdateTests.cs (13)
42var repositoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "repository");
43var dotnetManifestPath = Path.Combine(repositoryPath, ".config", "dotnet-tools.json");
44var npmManifestPath = Path.Combine(repositoryPath, "package.json");
45var probeDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "package-manager-probes");
46var invocationLogPath = Path.Combine(workspace.WorkspaceRoot.FullName, "package-manager-invocations.log");
48Directory.CreateDirectory(Path.GetDirectoryName(dotnetManifestPath)!);
49Directory.CreateDirectory(Path.Combine(repositoryPath, ".git"));
108await File.WriteAllBytesAsync(Path.Combine(repositoryPath, name), bytes, cancellationToken);
131Path.Combine(probeDirectory, tool),
217Assert.Equal(bytes, await File.ReadAllBytesAsync(Path.Combine(repositoryPath, name), cancellationToken));
223Assert.False(File.Exists(Path.Combine(repositoryPath, "lifecycle-ran")));
224Assert.False(Directory.Exists(Path.Combine(repositoryPath, "node_modules")));
225Assert.False(File.Exists(Path.Combine(repositoryPath, "aspire.config.json")));
StartStopTests.cs (8)
90Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "Directory.Build.targets"),
129var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs");
205var bothInstancesPath = Path.Combine(workspace.WorkspaceRoot.FullName, "both-instances.json");
206var remainingInstancePath = Path.Combine(workspace.WorkspaceRoot.FullName, "remaining-instance.json");
207var stoppedInstancesPath = Path.Combine(workspace.WorkspaceRoot.FullName, "stopped-instances.json");
254string.Equals(Path.GetDirectoryName(instance.AppHostPath), primaryCheckout, StringComparison.Ordinal));
256string.Equals(Path.GetDirectoryName(instance.AppHostPath), linkedCheckout, StringComparison.Ordinal));
343var assertionScript = Path.Combine(workspace.WorkspaceRoot.FullName, "assert-detached-process-group.py");
TypeScriptCodegenValidationTests.cs (13)
79var lockFilePath = Path.Combine(
88var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
119var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules");
128var filePath = Path.Combine(modulesDir, file);
141var aspireTs = File.ReadAllText(Path.Combine(modulesDir, "aspire.mts"));
190var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules");
196var aspireModulePath = Path.Combine(modulesDir, "aspire.mts");
213var codegenHashPath = Path.Combine(modulesDir, ".codegen-hash");
232var filePath = Path.Combine(modulesDir, file);
251var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
264var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
315var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
397var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
TypeScriptEmptyAppHostTemplateTests.cs (9)
37var appDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TsEmptyApp");
40var appHostPath = Path.Combine(appDirectory, "apphost.mts");
92var appDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TsDeadlockRepro");
106var extensionDirectory = Directory.CreateDirectory(Path.Combine(appDirectory, "DeadlockExtension"));
108File.WriteAllText(Path.Combine(extensionDirectory.FullName, "DeadlockExtension.csproj"), $$"""
122File.WriteAllText(Path.Combine(extensionDirectory.FullName, "DeadlockExtensions.cs"), """
162File.WriteAllText(Path.Combine(appDirectory, "apphost.mts"), """
176var configPath = Path.Combine(appDirectory, "aspire.config.json");
188var configPath = Path.Combine(appDirectory, "aspire.config.json");
TypeScriptLegacyAppHostTests.cs (11)
108var mtsPath = Path.Combine(projectRoot, "apphost.mts");
114var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules");
123File.WriteAllText(Path.Combine(projectRoot, "apphost.ts"), """
135var configPath = Path.Combine(projectRoot, "aspire.config.json");
146File.WriteAllText(Path.Combine(projectRoot, "tsconfig.apphost.json"), """
172var legacyModulesDir = Path.Combine(projectRoot, ".modules");
181var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules");
191var filePath = Path.Combine(legacyModulesDir, expectedFile);
218var filePath = Path.Combine(legacyModulesDir, unexpectedFile);
230var aspireTs = File.ReadAllText(Path.Combine(legacyModulesDir, "aspire.ts"));
235$"File path: {Path.Combine(legacyModulesDir, "aspire.ts")}.");
TypeScriptMigrateAppHostTests.cs (13)
98var mtsPath = Path.Combine(projectRoot, "apphost.mts");
104var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules");
112File.WriteAllText(Path.Combine(projectRoot, "apphost.ts"), """
122var configPath = Path.Combine(projectRoot, "aspire.config.json");
130File.WriteAllText(Path.Combine(projectRoot, "tsconfig.apphost.json"), """
157var legacyAppHost = Path.Combine(projectRoot, "apphost.ts");
165var modernAppHost = Path.Combine(projectRoot, "apphost.mts");
181var legacyModulesDir = Path.Combine(projectRoot, ".modules");
189var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules");
198var filePath = Path.Combine(modernModulesDir, expectedFile);
206var aspireMts = File.ReadAllText(Path.Combine(modernModulesDir, "aspire.mts"));
211$"File path: {Path.Combine(modernModulesDir, "aspire.mts")}.");
215var tsconfig = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "tsconfig.apphost.json")))!.AsObject();
TypeScriptPolyglotTests.cs (26)
82var viteProjectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "viteapp");
98var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
121var appHostLockFilePath = Path.Combine(
128var viteLockFilePath = Path.Combine(
197var viteProjectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "viteapp");
208var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
227var appHostLockFilePath = Path.Combine(
234var guestLockFilePath = Path.Combine(
283var lockFilePath = Path.Combine(
352var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
360var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
361var restartCountPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".deno-watch-restart-count");
426Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"),
447var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "packages", "brownfield");
448var packageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "package.json")))!.AsObject();
454originalTsConfig = File.ReadAllText(Path.Combine(projectRoot, "tsconfig.json"));
456File.WriteAllText(Path.Combine(projectRoot, "package.json"), packageJson.ToJsonString(new JsonSerializerOptions { WriteIndented = true }));
479packageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "package.json")))!.AsObject();
496Assert.Equal(originalTsConfig, File.ReadAllText(Path.Combine(projectRoot, "tsconfig.json")));
497Assert.False(File.Exists(Path.Combine(projectRoot, "tsconfig.apphost.json")));
498Assert.False(File.Exists(Path.Combine(projectRoot, "apphost.mts")));
500var appHostDirectory = Path.Combine(projectRoot, "aspire-apphost");
501var appHostPath = Path.Combine(appHostDirectory, "apphost.mts");
504var appHostPackageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(appHostDirectory, "package.json")))!.AsObject();
516Assert.True(File.Exists(Path.Combine(appHostDirectory, "tsconfig.apphost.json")));
519var configPath = Path.Combine(projectRoot, "aspire.config.json");
TypeScriptPublishTests.cs (12)
16private static readonly string s_jsPublishFixturesDir = Path.Combine(
62var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
147var artifactsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts");
148var composeContent = await File.ReadAllTextAsync(Path.Combine(artifactsPath, "docker-compose.yaml"));
238var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
266var dockerComposePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-output", "docker-compose.yaml");
313var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
344var envFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts", ".env");
354var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
387Path.Combine(s_jsPublishFixturesDir, fixtureName),
388Path.Combine(workspace.WorkspaceRoot.FullName, fixtureName));
394var dockerfilePath = Path.Combine(artifactsPath, $"{resourceName}.Dockerfile");
TypeScriptReusablePackageTests.cs (13)
31var appDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "app"));
32var helperDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "packages", "aspire-commands"));
44var appAppHostPath = Path.Combine(appDirectory.FullName, "apphost.mts");
57var helperAppHostPath = Path.Combine(helperDirectory.FullName, "apphost.mts");
69var helperModulesDirectory = Path.Combine(helperDirectory.FullName, ".aspire", "modules");
71Assert.Contains("addRedis", File.ReadAllText(Path.Combine(helperModulesDirectory, "aspire.mts")));
93var configPath = Path.Combine(appDirectory.FullName, "aspire.config.json");
101File.WriteAllText(Path.Combine(appDirectory.FullName, "apphost.mts"), """
113File.WriteAllText(Path.Combine(appDirectory.FullName, "tsconfig.json"), """
141File.WriteAllText(Path.Combine(helperDirectory.FullName, "aspire.config.json"), $$"""
155File.WriteAllText(Path.Combine(helperDirectory.FullName, "package.json"), """
171File.WriteAllText(Path.Combine(helperDirectory.FullName, "tsconfig.json"), """
194File.WriteAllText(Path.Combine(helperSourceDirectory.FullName, "index.ts"), """
Aspire.Cli.Tests (3994)
Acquisition\InstallationDiscoveryDiscoverAllTests.cs (54)
39var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "no-sidecar-bin");
44using var _ = new EnvVarOverride("PATH", pathDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty));
55var expectedSidecarPath = Path.Combine(pathDir, InstallSidecarReader.SidecarFileName);
69var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "unreadable-bin");
72var sidecarPath = Path.Combine(pathDir, InstallSidecarReader.SidecarFileName);
101var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "malformed-bin");
104var sidecarPath = Path.Combine(pathDir, InstallSidecarReader.SidecarFileName);
128var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin");
131File.WriteAllText(Path.Combine(binDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}");
163var firstPathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "path-first");
164var secondPathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "path-second");
165var offPathDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin");
196using var pathOverride = new EnvVarOverride("PATH", firstPathDir + Path.PathSeparator + secondPathDir);
218var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin");
249var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin");
276var prDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-9999", "bin");
279File.WriteAllText(Path.Combine(prDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"pr\"}");
300var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin");
303File.WriteAllText(Path.Combine(binDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}");
322var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, hasInstallMetadata ? "metadata-bin" : "no-metadata-bin");
328File.WriteAllText(Path.Combine(binDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}");
336using var _ = new EnvVarOverride("PATH", binDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty));
366var prDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-12345", "bin");
369File.WriteAllText(Path.Combine(prDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"pr\"}");
400var prDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-12345", "bin");
403File.WriteAllText(Path.Combine(prDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"pr\"}");
435var brewDir = Path.Combine(workspace.WorkspaceRoot.FullName, "Caskroom", "aspire", "13.4.0-pr.17115.gcd700928");
438File.WriteAllText(Path.Combine(brewDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"brew\"}");
471var brewDir = Path.Combine(workspace.WorkspaceRoot.FullName, "Caskroom", "aspire", "13.4.0");
474File.WriteAllText(Path.Combine(brewDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"brew\"}");
509var binary = Path.Combine(workspace.WorkspaceRoot.FullName, "dogfood", labelName, "bin", "aspire");
510Directory.CreateDirectory(Path.GetDirectoryName(binary)!);
523var binary = Path.Combine(workspace.WorkspaceRoot.FullName, "staging", "pr-1234", "bin", "aspire");
524Directory.CreateDirectory(Path.GetDirectoryName(binary)!);
534var binary = Path.Combine(workspace.WorkspaceRoot.FullName, "dogfood", "pr-9876", "bin", "aspire");
574var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "no-sidecar-bin");
578using var _ = new EnvVarOverride("PATH", pathDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty));
606var staleDogfoodDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-9999");
637var dogfoodRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood");
680var toolStore = Path.Combine(workspace.WorkspaceRoot.FullName, ".dotnet", "tools", ".store", "aspire.cli");
762var releaseBinDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin");
765File.WriteAllText(Path.Combine(releaseBinDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}");
792var releaseBinDir = Path.Combine(aspireHome.FullName, "bin");
795File.WriteAllText(Path.Combine(releaseBinDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"localhive\"}");
815logFilePath: Path.Combine(root.FullName, "test.log"),
847var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, "firmlink-self-bin");
856binDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty));
922var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, "hint-bin");
925var fakeCanonical = Path.Combine(workspace.WorkspaceRoot.FullName, "deliberately-different-canonical-path", "aspire");
958return resolved?.FullName ?? Path.GetFullPath(path);
962return Path.GetFullPath(path);
996logFilePath: Path.Combine(root.FullName, "test.log"),
1009var path = Path.Combine(dir, name);
1027File.WriteAllText(Path.Combine(dir, InstallSidecarReader.SidecarFileName), $"{{\"source\":\"{source}\"}}");
Acquisition\InstallSourceDetectorTests.cs (29)
25var binaryDirectory = workspace.CreateDirectory(Path.Combine("mise", "installs", "aspire", "13.5.0"));
26File.WriteAllText(Path.Combine(binaryDirectory.FullName, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"}""");
31var detector = CreateDetector(Path.Combine(binaryDirectory.FullName, "aspire.exe"), environment, new TestWindowsRegistryReader(true));
47File.WriteAllText(Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName), sidecar);
49var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), TestEnvironment.CreateLinux());
74var detector = CreateDetector(Path.Combine(workspace.Path, "dotnet"), environment);
91var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), environment);
102var processPath = Path.Combine(workspace.Path, "aspire.exe");
125var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), TestEnvironment.CreateLinux(), registry);
138var detector = CreateDetector(Path.Combine(workspace.Path, "aspire.exe"), TestEnvironment.CreateWindows(), registry);
161var processPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar));
181[variable] = Path.Combine(workspace.Path, root) + Path.DirectorySeparatorChar
183var processPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar));
200var root = Path.Combine("/tmp", workspace.WorkspaceRoot.Name, "custom");
203var installsRoot = variable == "MISE_DATA_DIR" ? Path.Combine(processRoot, "installs") : processRoot;
206[variable] = configuredRoot + Path.DirectorySeparatorChar
208var detector = CreateDetector(Path.Combine(installsRoot, "aspire", "13.5.0", "aspire"), environment);
220var processPath = Path.Combine(workspace.Path, "MISE", "INSTALLS", "ASPIRE", "13.5.0", windows ? "ASPIRE.EXE" : "aspire");
233var directory = workspace.CreateDirectory(Path.Combine("mise", "installs", "aspire", "13.5.0"));
236File.WriteAllText(Path.Combine(directory.FullName, InstallSidecarReader.SidecarFileName), sidecar);
242var detector = CreateDetector(Path.Combine(directory.FullName, "aspire"), environment);
253var processPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar));
265var processPath = Path.Combine(installDirectory.FullName, "aspire");
267File.WriteAllText(Path.Combine(installDirectory.FullName, InstallSidecarReader.SidecarFileName), """{"source":"brew"}""");
268var linkPath = Path.Combine(workspace.Path, "aspire");
Agents\AspireSkillsBundleTests.cs (27)
47Assert.Contains(files, file => file.RelativePath == Path.Combine("references", "app-commands.md"));
48Assert.DoesNotContain(files, file => file.RelativePath == Path.Combine("evals", "evals.json"));
143var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName);
145var skillPath = Path.Combine(skillDirectory, "SKILL.md");
187var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName);
189await File.WriteAllTextAsync(Path.Combine(skillDirectory, "SKILL.md"), CreateSkillFileContent());
232await File.WriteAllTextAsync(Path.Combine(bundleDirectory, "skill-manifest.json"), "{");
509Directory.CreateDirectory(Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName));
510await File.WriteAllTextAsync(Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md"), CreateSkillFileContent());
555var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName);
557var skillPath = Path.Combine(skillDirectory, "SKILL.md");
609var archivePath = Path.Combine(rootDirectory, "bundle.zip");
620new DirectoryInfo(Path.Combine(rootDirectory, "staged")),
636var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireifySkillName);
638var skillPath = Path.Combine(skillDirectory, "SKILL.md");
663await File.WriteAllTextAsync(Path.Combine(bundleDirectory, "skill-manifest.json"), manifestJson);
682var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName);
684var skillPath = Path.Combine(skillDirectory, "SKILL.md");
804var skillPath = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md");
837var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName);
842var fullPath = Path.Combine(skillDirectory, AspireSkillsBundleProvider.NormalizeRelativePath(relativePath));
843Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
862Sha512 = hashOverride ?? ComputeSha512(Path.Combine(skillDirectory, AspireSkillsBundleProvider.NormalizeRelativePath(file.Key)))
883var skillDirectory = Path.Combine(bundleDirectory, "skills", skillName);
885await File.WriteAllTextAsync(Path.Combine(skillDirectory, "SKILL.md"), content);
899Sha512 = ComputeSha512(Path.Combine(bundleDirectory, "skills", skillName, "SKILL.md"))
908return File.WriteAllTextAsync(Path.Combine(bundleDirectory, "skill-manifest.json"), manifestJson);
Agents\AspireSkillsInstallerTests.cs (61)
88var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
110var cacheLockPath = Path.Combine(cacheRoot, $".{AspireSkillsInstaller.Version}.lock");
232Assert.True(File.Exists(Path.Combine(
285Assert.False(File.Exists(Path.Combine(
348await File.ReadAllTextAsync(Path.Combine(
353await File.ReadAllTextAsync(Path.Combine(
410await File.ReadAllTextAsync(Path.Combine(
446var cachedBundleDirectory = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills", AspireSkillsInstaller.Version);
460Assert.False(File.Exists(Path.Combine(cachedBundleDirectory, "skill-manifest.json")));
461Assert.False(Directory.Exists(Path.Combine(cachedBundleDirectory, "skills")));
467await File.ReadAllTextAsync(Path.Combine(
490await File.WriteAllTextAsync(Path.Combine(cachedBundleDirectory, "skill-manifest.json"), "{");
523Directory.CreateDirectory(Path.Combine(cachedBundleDirectory, ".lastused"));
557var staleCacheDirectory = Path.Combine(
564Path.Combine(staleCacheDirectory, ".lastused"),
595var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
596var staleVersionDirectory = Path.Combine(cacheRoot, "9.9.9");
640var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
641var staleVersionDirectory = Path.Combine(cacheRoot, "9.9.9");
643var staleCacheDirectory = Path.Combine(staleVersionDirectory, staleArchiveSha512);
687var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
691var staleCacheDirectory = Path.Combine(cacheRoot, staleVersion, staleArchiveSha512);
720var staleVersionLockPath = Path.Combine(cacheRoot, $".{staleVersion}.lock");
756var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
760var staleCacheDirectory = Path.Combine(cacheRoot, staleVersion, staleArchiveSha512);
764var staleVersionLockPath = Path.Combine(cacheRoot, $".{staleVersion}.lock");
881Assert.True(File.Exists(Path.Combine(
900var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
903Path.Combine(cacheRoot, $".{AspireSkillsInstaller.Version}.lock"),
947var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
954var staleDirectory = Directory.CreateDirectory(Path.Combine(cacheRoot, $"{prefix}stale")).FullName;
957recentDirectories.Add(Directory.CreateDirectory(Path.Combine(cacheRoot, $"{prefix}recent")).FullName);
1019var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "aspire-skills");
1426Assert.Equal(Path.Combine("references", "compatibility-and-validation.md"), compatibilityReference.RelativePath);
1431Assert.Equal(Path.Combine("references", "migration-patterns.md"), migrationPatternsReference.RelativePath);
1448var bundleDirectory = new DirectoryInfo(Path.Combine(rootDirectory, "bundle"));
1481var stageDirectory = new DirectoryInfo(Path.Combine(rootDirectory, ".stage-test"));
1482var targetDirectory = Path.Combine(rootDirectory, "cached");
1493Assert.True(File.Exists(Path.Combine(targetDirectory, "skill-manifest.json")));
1509var archivePath = Path.Combine(rootDirectory, "bundle.tgz");
1514var bundleDirectory = new DirectoryInfo(Path.Combine(rootDirectory, "bundle"));
1539var archivePath = Path.Combine(rootDirectory, "bundle.tgz");
1543var bundleDirectory = Path.Combine(rootDirectory, "bundle");
1568var bundleDirectory = new DirectoryInfo(Path.Combine(rootDirectory, "bundle"));
1642await File.ReadAllTextAsync(Path.Combine(
1647await File.ReadAllTextAsync(Path.Combine(
1809Assert.False(File.Exists(Path.Combine(
2044var skillDirectory = Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName);
2047var skillPath = Path.Combine(skillDirectory, "SKILL.md");
2081await File.WriteAllTextAsync(Path.Combine(bundleDirectory, "skill-manifest.json"), manifestJson);
2085await File.WriteAllTextAsync(Path.Combine(bundleDirectory, AspireSkillsInstaller.ArchiveSha512FileName), archiveSha512);
2091Path.Combine(bundleDirectory, AspireSkillsInstaller.GitHubArchiveSha256FileName),
2098Path.Combine(bundleDirectory, AspireSkillsInstaller.GitHubAttestationVerifiedFileName),
2106Path.Combine(cacheDirectory, ".lastused"),
2130var bundleDirectory = Path.Combine(rootDirectory, $"aspire-skills-v{AspireSkillsInstaller.Version}");
2135Path.Combine(bundleDirectory, AspireSkillsInstaller.GitHubAttestationVerifiedFileName),
2140await File.WriteAllTextAsync(Path.Combine(bundleDirectory, "skill-manifest.json"), "{");
2144File.Delete(Path.Combine(bundleDirectory, "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md"));
2179return Path.Combine(
2187return Path.Combine(
2316var archivePath = Path.Combine(bundleDirectory.FullName, $".test-embedded-{Guid.NewGuid():N}.tgz");
Agents\CopilotAppInstallationDetectorTests.cs (15)
17Path.Combine(localAppData.FullName, "Programs", "GitHub Copilot"));
19Path.Combine(appDirectory.FullName, "github.exe"),
26var executablePath = Path.Combine(appDirectory.FullName, "github.exe");
35var appBundlePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Applications", "GitHub Copilot.app");
61Path.Combine(".local", "share", "applications"));
63Path.Combine(applicationsDirectory.FullName, "github-copilot.desktop"),
70var desktopEntryPath = Path.Combine(applicationsDirectory.FullName, "github-copilot.desktop");
82var rootDirectory = Path.DirectorySeparatorChar.ToString();
86Path.Combine(workspace.WorkspaceRoot.FullName, ".local", "share", "applications"),
87Path.Combine(rootDirectory, "usr", "local", "share", "applications"),
88Path.Combine(rootDirectory, "usr", "share", "applications"),
104Path.PathSeparator,
113Path.Combine(dataHome.FullName, "applications"),
114Path.Combine(firstDataDirectory.FullName, "applications"),
115Path.Combine(secondDataDirectory.FullName, "applications"),
Agents\PlaywrightCliInstallerTests.cs (89)
20var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}");
91var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}");
192var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
194var tarballPath = Path.Combine(tempDir, "package.tgz");
240var tarballPath = Path.Combine(tempDir, "package.tgz");
283var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
285var tarballPath = Path.Combine(tempDir, "package.tgz");
327var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
329var tarballPath = Path.Combine(tempDir, "package.tgz");
376var tempPath = Path.Combine(tempDir, "package.tgz");
468var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
470var tarballPath = Path.Combine(tempDir, "package.tgz");
622var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-mirror-test-{Guid.NewGuid():N}");
635var skillDir = Path.Combine(repoRoot, ".claude", "skills", "playwright-cli");
637File.WriteAllText(Path.Combine(skillDir, "SKILL.md"), "# Playwright CLI Skill");
638Directory.CreateDirectory(Path.Combine(skillDir, "subdir"));
639File.WriteAllText(Path.Combine(skillDir, "subdir", "extra.md"), "Extra content");
654Path.Combine(".claude", "skills"),
655Path.Combine(".agents", "skills"),
656Path.Combine(".github", "skills")
661Assert.True(File.Exists(Path.Combine(tempDir, ".agents", "skills", "playwright-cli", "SKILL.md")));
662Assert.True(File.Exists(Path.Combine(tempDir, ".agents", "skills", "playwright-cli", "subdir", "extra.md")));
663Assert.Equal("# Playwright CLI Skill", await File.ReadAllTextAsync(Path.Combine(tempDir, ".agents", "skills", "playwright-cli", "SKILL.md")));
666Assert.True(File.Exists(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "SKILL.md")));
667Assert.True(File.Exists(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "subdir", "extra.md")));
681var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-sync-test-{Guid.NewGuid():N}");
682var sourceDir = Path.Combine(tempDir, "source");
683var targetDir = Path.Combine(tempDir, "target");
689File.WriteAllText(Path.Combine(sourceDir, "keep.md"), "keep");
693File.WriteAllText(Path.Combine(targetDir, "keep.md"), "old content");
694File.WriteAllText(Path.Combine(targetDir, "stale.md"), "should be removed");
695Directory.CreateDirectory(Path.Combine(targetDir, "stale-dir"));
696File.WriteAllText(Path.Combine(targetDir, "stale-dir", "old.md"), "should be removed");
701Assert.Equal("keep", File.ReadAllText(Path.Combine(targetDir, "keep.md")));
704Assert.False(File.Exists(Path.Combine(targetDir, "stale.md")));
705Assert.False(Directory.Exists(Path.Combine(targetDir, "stale-dir")));
719var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-cleanup-test-{Guid.NewGuid():N}");
732var skillDir = Path.Combine(repoRoot, ".claude", "skills", "playwright-cli");
734File.WriteAllText(Path.Combine(skillDir, "SKILL.md"), "# Playwright CLI Skill");
750Path.Combine(".agents", "skills")
755Assert.True(File.Exists(Path.Combine(tempDir, ".agents", "skills", "playwright-cli", "SKILL.md")));
758Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude", "skills", "playwright-cli")));
772var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-preexist-test-{Guid.NewGuid():N}");
778var preExistingDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli");
780await File.WriteAllTextAsync(Path.Combine(preExistingDir, "SKILL.md"), "# User's existing skill");
801Path.Combine(".agents", "skills")
820var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-emptydir-test-{Guid.NewGuid():N}");
833var skillDir = Path.Combine(repoRoot, ".claude", "skills", "playwright-cli");
835File.WriteAllText(Path.Combine(skillDir, "SKILL.md"), "# Playwright CLI Skill");
850Path.Combine(".agents", "skills")
855Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude", "skills")));
857Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude")));
871var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}");
877var skillDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli");
885Path.Combine(".claude", "skills"));
887Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude", "skills")));
888Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude")));
903var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}");
909var skillDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli");
911Directory.CreateDirectory(Path.Combine(tempDir, ".claude", "skills", "other-skill"));
917Path.Combine(".claude", "skills"));
920Assert.True(Directory.Exists(Path.Combine(tempDir, ".claude", "skills")));
921Assert.True(Directory.Exists(Path.Combine(tempDir, ".claude", "skills", "other-skill")));
935var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}");
941var skillDir = Path.Combine(tempDir, ".agents", "playwright-cli");
951Assert.False(Directory.Exists(Path.Combine(tempDir, ".agents")));
967var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}");
973var deepDir = Path.Combine(tempDir, "a", "b", "c", "d", "e");
983Path.Combine("a", "b"));
986Assert.False(Directory.Exists(Path.Combine(tempDir, "a", "b", "c", "d")));
987Assert.False(Directory.Exists(Path.Combine(tempDir, "a", "b", "c")));
988Assert.False(Directory.Exists(Path.Combine(tempDir, "a", "b")));
990Assert.True(Directory.Exists(Path.Combine(tempDir, "a")));
1024PackResult = Path.Combine(outputDirectory, "package.tgz");
Agents\TelemetryHookConfiguratorTests.cs (23)
27var hookFile = Path.Combine(home.FullName, ".copilot", "hooks", "aspire-telemetry.json");
57Assert.True(File.Exists(Path.Combine(home.FullName, ".copilot", "hooks", "aspire-telemetry.json")));
73Assert.True(File.Exists(Path.Combine(copilotHome.FullName, "hooks", "aspire-telemetry.json")));
74Assert.False(Directory.Exists(Path.Combine(home.FullName, ".copilot")));
122var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude"));
123var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json");
161var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude"));
162await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"),
182var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude"));
183var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json");
204var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude"));
207var host = string.Equals(Path.GetFileNameWithoutExtension(Environment.ProcessPath), "dotnet", StringComparison.OrdinalIgnoreCase)
209: Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
214["args"] = new JsonArray(Path.Combine(workspace.Path, assemblyName), "agent", "telemetry", "--hook")
227await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"), settings.ToJsonString());
247var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude"));
248var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json");
264var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude"));
265var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json");
293Assert.False(Directory.Exists(Path.Combine(home.FullName, ".aspire", "hooks")));
294Assert.False(Directory.Exists(Path.Combine(home.FullName, ".copilot")));
295Assert.False(Directory.Exists(Path.Combine(home.FullName, ".claude")));
300var settingsPath = Path.Combine(home.FullName, ".claude", "settings.json");
Agents\TelemetryHookInstallerTests.cs (7)
26var expectedDirectory = Path.Combine(home.FullName, ".aspire", "hooks");
27Assert.Equal(Path.Combine(expectedDirectory, "track-telemetry.sh"), scripts.ShellScriptPath);
28Assert.Equal(Path.Combine(expectedDirectory, "track-telemetry.ps1"), scripts.PowerShellScriptPath);
52await using var manifestStream = File.OpenRead(Path.Combine(bundleDirectory.FullName, "skill-manifest.json"));
70var bundledPath = Path.Combine(bundleDirectory.FullName, "hooks", "scripts", file.Name);
123var hooksDirectory = Path.Combine(home.FullName, ".aspire", "hooks");
125var shellPath = Path.Combine(hooksDirectory, "track-telemetry.sh");
Backchannel\AppHostConnectionResolverTests.cs (18)
56string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("TestAppHost", "TestAppHost.csproj")),
87string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("TestAppHost", "TestAppHost.csproj")),
288var realProjectFile = new FileInfo(Path.Combine(realDirectory.FullName, "TestAppHost.csproj"));
292var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
294var projectFileViaSymlink = new FileInfo(Path.Combine(symlinkDirectory, "TestAppHost.csproj"));
331var projectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "TestAppHost.csproj"));
334var differentlyCasedProjectPath = Path.Combine(
377Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
383var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj");
488Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
494var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj");
547var commonGitDirectory = Path.Combine(primaryCheckout.FullName, ".git");
549var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryCheckout.FullName, ".worktrees", "feature")).FullName;
551return Path.Combine(worktreeRoot, "AppHost", "AppHost.csproj");
557var projectFile = new FileInfo(Path.Combine(directory.FullName, fileName));
572var backchannelsDir = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch");
576var appHostId = Path.GetFileName(prefix);
577var socketPath = Path.Combine(
Backchannel\AuxiliaryBackchannelMonitorTests.cs (31)
41var appHostPath = Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj");
143var compactPath = Path.Combine(compactDirectory, $"{BackchannelConstants.ComputeAppHostId("AppHost.cs")}a1b2C3d4.{int.MaxValue}");
144var legacyPath = Path.Combine(legacyDirectory, $"auxi.sock.abc123def4567890.{int.MaxValue}");
183Directory.CreateDirectory(Path.GetDirectoryName(legacyDirectory)!);
211var socketPath = Path.Combine(homeDirectory.FullName, "stale-socket");
249var realDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "real"));
250var symlinkDirectory = Path.Combine(tempRoot.FullName, "link");
254var appHostPathViaReal = Path.Combine(realDirectory.FullName, "apphost.cs");
258var appHostPathViaSymlink = Path.Combine(symlinkDirectory, "apphost.cs");
273var workingDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "wd")).FullName;
274var outsideAppHost = Path.Combine(tempRoot.FullName, "other", "apphost.cs");
287Assert.False(AuxiliaryBackchannelMonitor.IsAppHostInScopeOfDirectory(null, Path.GetTempPath()));
288Assert.False(AuxiliaryBackchannelMonitor.IsAppHostInScopeOfDirectory(string.Empty, Path.GetTempPath()));
298Directory.CreateDirectory(Path.Combine(primaryRoot, ".git"));
299var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName;
300TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git"));
302var primaryAppHost = Path.Combine(primaryRoot, "AppHost.csproj");
303var nestedAppHost = Path.Combine(worktreeRoot, "AppHost.csproj");
323Directory.CreateDirectory(Path.Combine(primaryRoot, ".git"));
324var submoduleRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, "extern", "dep")).FullName;
327Path.Combine(primaryRoot, ".git", "modules", "dep"));
329var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj");
345Directory.CreateDirectory(Path.Combine(primaryRoot, ".git"));
346var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName;
347var adminDirectory = TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git"));
348var submoduleRoot = Directory.CreateDirectory(Path.Combine(worktreeRoot, "extern", "dep")).FullName;
349TestGitWorktree.WriteGitDirFile(submoduleRoot, Path.Combine(adminDirectory, "modules", "dep"));
350var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj");
508var appHostId = BackchannelConstants.ComputeAppHostId(Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj"));
509var socketPath = Path.Combine(backchannelsDirectory, $"{appHostId}a1b2C3d4.{Environment.ProcessId}");
541logFilePath: Path.Combine(homeDirectory.FullName, "test.log"),
Backchannel\BackchannelConstantsTests.cs (43)
15var appHostPath = Path.Combine("path", "to", "MyApp.AppHost.csproj");
16var homeDirectory = Path.Combine(Path.GetTempPath(), "testuser");
20var fileName = Path.GetFileName(socketPrefix);
23var dir = Path.GetDirectoryName(socketPrefix);
25Assert.Equal(Path.Combine(homeDirectory, ".aspire", "cli", "bch"), dir);
67var fileName = Path.GetFileName(socketPrefix);
81var fileName = Path.GetFileName(socketPrefix);
92var oldSocketPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels", "auxi.sock.3a579b6853b74a71.fee67dd76369.26688");
244var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
250var appHostId = Path.GetFileName(prefix);
252var socket1 = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.12345");
253var socket2 = Path.Combine(backchannelsDir, $"{appHostId}Z9y8X7w6.67890");
257var otherSocket = Path.Combine(backchannelsDir, "differentId1a1b2C3d4.99999");
272var legacyBackchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
279var oldFormatSocket = Path.Combine(legacyBackchannelsDir, $"auxi.sock.{hash}");
282var legacyPidSocket = Path.Combine(legacyBackchannelsDir, $"auxi.sock.{hash}.12345");
297var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
303var appHostId = Path.GetFileName(prefix);
306var badSeparator = Path.Combine(backchannelsDir, $"{appHostId}AbCdEfGhX12345");
310var badPid = Path.Combine(backchannelsDir, $"{appHostId}AbCdEfGh.notapid");
323var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
329var otherSocket = Path.Combine(backchannelsDir, "differentId1a1b2C3d4.99999");
341var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
351var appHostId = Path.GetFileName(prefix);
355var orphanedSocket = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.{deadPid}");
356var liveSocket = Path.Combine(backchannelsDir, $"{appHostId}Z9y8X7w6.{currentPid}");
357var pidlessSocket = Path.Combine(backchannelsDir, appHostId);
386var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
389var projectFileViaSymlink = Path.Combine(symlinkDirectory, "TestAppHost.csproj");
403var backchannelsDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
407var appHostId = Path.GetFileName(
409var socketPath = Path.Combine(backchannelsDirectory, $"{appHostId}A{index:D7}.{currentPid}");
438var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
441var realProjectPath = Path.Combine(realDirectory.FullName, "TestAppHost.csproj");
443var projectFileViaSymlink = Path.Combine(symlinkDirectory, "TestAppHost.csproj");
517var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
524var socket = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.12345");
539var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
553var appHostId = Path.GetFileName(upperPrefix);
555var socket = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.12345");
575var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
585var legacySocket = Path.Combine(backchannelsDir, $"auxi.sock.{legacyHash}.a1b2c3d4e5f6.99999");
BundleServiceComputeDefaultExtractDirTests.cs (23)
32var prefixDir = Path.Combine(workspace.Path, "aspire");
33var binDir = Path.Combine(prefixDir, "bin");
36var binaryPath = Path.Combine(binDir, ExeName("aspire"));
38File.WriteAllText(Path.Combine(binDir, SidecarFileName), $"{{\"source\":\"{source}\"}}");
55var prDir = Path.Combine(workspace.Path, "dogfood", "pr-12345");
56var binDir = Path.Combine(prDir, "bin");
59var binaryPath = Path.Combine(binDir, ExeName("aspire"));
61File.WriteAllText(Path.Combine(binDir, SidecarFileName), "{\"source\":\"pr\"}");
76var installDir = Path.Combine(workspace.Path, "WindowsApps", "Microsoft.Aspire_8wekyb3d8bbwe");
79var binaryPath = Path.Combine(installDir, "aspire.exe");
81File.WriteAllText(Path.Combine(installDir, SidecarFileName), "{\"source\":\"winget\"}");
103var cellarDir = Path.Combine(workspace.Path, "Caskroom", "aspire", "13.2.0");
105var cellarBinary = Path.Combine(cellarDir, "aspire");
107File.WriteAllText(Path.Combine(cellarDir, SidecarFileName), "{\"source\":\"brew\"}");
109var brewBinDir = Path.Combine(workspace.Path, "bin");
111var symlinkPath = Path.Combine(brewBinDir, "aspire");
118Assert.NotEqual(Path.GetDirectoryName(brewBinDir), result);
130var ridDir = Path.Combine(
144var binaryPath = Path.Combine(ridDir, ExeName("aspire"));
146File.WriteAllText(Path.Combine(ridDir, SidecarFileName), "{\"source\":\"dotnet-tool\"}");
160var prefixDir = Path.Combine(workspace.Path, "nix", "store", "aspire");
161var binDir = Path.Combine(prefixDir, "bin");
164var binaryPath = Path.Combine(binDir, ExeName("aspire"));
BundleServiceIntegrationTests.cs (68)
49var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName);
55var bundleLink = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
62var managedExe = Path.Combine(bundleLink,
67var dashboardExe = Path.Combine(bundleLink,
71Assert.True(File.Exists(Path.Combine(bundleLink, BundleDiscovery.DashboardDirectoryName, "wwwroot", "index.html")));
123var dashboardExe = Path.Combine(
161var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
165"blazor" => Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName, "wwwroot", "_framework", "blazor.web.js"),
166"sqlite" => Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName, sqliteLibraryName),
209var v1BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v1", "cli-v1");
210var v2BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v2", "cli-v2-longer");
223var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName);
244var managedExe = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName,
264var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName);
268Directory.CreateDirectory(Path.Combine(versionsDir, "stale-aaaaaaaaaaaaaaaa"));
269Directory.CreateDirectory(Path.Combine(versionsDir, $"stale{BundleService.TempSuffixPrefix}deadbeef"));
270Directory.CreateDirectory(Path.Combine(versionsDir, $"stale{BundleService.BadSuffixPrefix}99999"));
305Assert.False(Directory.Exists(Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName)));
314var destinationPath = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
315var lockedFilePath = Path.Combine(sourcePath, "locked.dll");
346var binDir = Path.Combine(layoutRoot, ".fake-bins");
354File.WriteAllText(Path.Combine(binDir, ".aspire-install.json"), "{\"source\":\"script\"}");
360var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName);
374Path.GetFullPath(v1VersionDir),
375Path.GetFullPath(managedPath!),
377var expectedTrayPath = includeTray ? Path.Combine(v1VersionDir, TrayExecutablePath) : null;
401var versionsDir = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName);
402var staleVersionDir = Path.Combine(versionsDir, "stale-version");
416var versionsDir = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName);
417var staleVersionDir = Path.Combine(versionsDir, "stale-version");
418var leasesDir = Path.Combine(staleVersionDir, BundleVersionLease.LeasesDirectoryName);
420File.WriteAllText(Path.Combine(leasesDir, "orphan.lease"), "{}");
437var versionsDir = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName);
438var staleVersionDir = Path.Combine(versionsDir, "stale-version");
439var leasesDir = Path.Combine(staleVersionDir, BundleVersionLease.LeasesDirectoryName);
441File.WriteAllText(Path.Combine(leasesDir, "unknown.lease"), "{}");
481var ridDir = Path.Combine(
497File.WriteAllText(Path.Combine(ridDir, ".aspire-install.json"), "{\"source\":\"dotnet-tool\"}");
505var bundleLink = Path.Combine(ridDir, BundleDiscovery.BundleDirectoryName);
510var managedExe = Path.Combine(bundleLink,
538var binaryDir = Path.Combine(workspace.WorkspaceRoot.FullName, "opt", "aspire-readonly", "bin");
544var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "home", ".aspire");
571var bundleLink = Path.Combine(aspireHome, BundleDiscovery.BundleDirectoryName);
575var managedExe = Path.Combine(bundleLink,
582Directory.Exists(Path.Combine(binaryDir, BundleDiscovery.BundleDirectoryName)),
585Directory.Exists(Path.Combine(Path.GetDirectoryName(binaryDir)!, BundleDiscovery.BundleDirectoryName)),
591var versionsDir = Path.Combine(aspireHome, BundleService.VersionsDirectoryName);
599Path.GetFullPath(activeVersionDir),
600Path.GetFullPath(managedPath!),
625var managedExe = Path.Combine(dest, BundleDiscovery.ManagedDirectoryName,
632Assert.True(Directory.Exists(Path.Combine(dest, BundleDiscovery.DcpDirectoryName)));
647var v1BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v1", "cli-v1");
648var v2BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v2", "cli-v2-longer");
656var bundleLink = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
776var linkPath = Path.Combine(layoutRoot, dir);
796var path = Path.Combine(directory, name);
809var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
810var managedDir = Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName);
811var dcpDir = Path.Combine(bundleDir, BundleDiscovery.DcpDirectoryName);
813var managedExe = Path.Combine(managedDir, managedExeName);
826Managed = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.ManagedDirectoryName),
827Dashboard = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DashboardDirectoryName),
828Dcp = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName),
835var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
838LayoutComponent.Managed => Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName,
840LayoutComponent.Dashboard => Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName),
841LayoutComponent.Dcp => Path.Combine(bundleDir, BundleDiscovery.DcpDirectoryName),
BundleServiceTests.cs (29)
77var processPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
131var managedExe = Path.Combine(dir, BundleDiscovery.ManagedDirectoryName,
147var dashboardDir = Path.Combine(dir, BundleDiscovery.DashboardDirectoryName);
148var dashboardExe = Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
160var frameworkDir = Path.Combine(dashboardDir, "wwwroot", "_framework");
162File.WriteAllText(Path.Combine(frameworkDir, "blazor.web.js"), "blazor");
164File.WriteAllText(Path.Combine(dashboardDir, sqliteLibraryName), "sqlite");
179var sqliteLibrary = Path.Combine(dir, BundleDiscovery.DashboardDirectoryName, sqliteLibraryName);
204var wwwrootDir = Path.Combine(dir, BundleDiscovery.DashboardDirectoryName, "wwwroot");
205var frameworkDir = Path.Combine(wwwrootDir, "_framework");
206var blazorScript = Path.Combine(frameworkDir, "blazor.web.js");
235Directory.Delete(Path.Combine(dir, BundleDiscovery.DcpDirectoryName), recursive: true);
246File.Delete(BundleDiscovery.GetDcpExecutablePath(Path.Combine(dir, BundleDiscovery.DcpDirectoryName)));
283var versionsRoot = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName);
287Directory.CreateDirectory(Path.Combine(versionsRoot, active));
288Directory.CreateDirectory(Path.Combine(versionsRoot, "stale-bbbbbbbbbbbbbbbb"));
289Directory.CreateDirectory(Path.Combine(versionsRoot, $"active{BundleService.TempSuffixPrefix}deadbeef"));
290Directory.CreateDirectory(Path.Combine(versionsRoot, $"active{BundleService.BadSuffixPrefix}99999"));
294Assert.True(Directory.Exists(Path.Combine(versionsRoot, active)));
295var remaining = Directory.EnumerateDirectories(versionsRoot).Select(Path.GetFileName).ToArray();
311Directory.CreateDirectory(Path.Combine(dir, BundleDiscovery.BundleDirectoryName));
318var managedDir = Path.Combine(root, BundleDiscovery.ManagedDirectoryName);
321Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
324var dashboardDir = Path.Combine(root, BundleDiscovery.DashboardDirectoryName);
327Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
329var frameworkDir = Path.Combine(dashboardDir, "wwwroot", "_framework");
331File.WriteAllText(Path.Combine(frameworkDir, "blazor.web.js"), "blazor");
334File.WriteAllText(Path.Combine(dashboardDir, sqliteLibraryName), "sqlite");
336var dcpDir = Path.Combine(root, BundleDiscovery.DcpDirectoryName);
Caching\AppHostInfoDiskCacheTests.cs (49)
29var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"));
36var path = Path.Combine(workspace.WorkspaceRoot.FullName, name);
58var cacheDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info");
170var objDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "obj"));
171var assetsPath = Path.Combine(objDir.FullName, "project.assets.json");
189File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"), "<Project />");
199File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """
212var cacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info");
249var cacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info");
288var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyHost"));
289var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
296var commonProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Common.props");
352var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj"));
353var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
358File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """
364var sharedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "shared"));
365var sharedProps = Path.Combine(sharedDirectory.FullName, "Directory.Build.props");
389var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj"));
390var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
392File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """
398var sharedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "shared"));
399var sharedProps = Path.Combine(sharedDirectory.FullName, "Directory.Build.props");
422var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj"));
423var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
425File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """
447var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj"));
448var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
453File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """
476var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyHost"));
477var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
484File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Common"), "");
485var commonProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Common.props");
556var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj"));
557var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
562File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"), """
567File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """
592var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyHost"));
593var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj"));
600File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Repo.marker"), "");
601var customProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Custom.props");
725projectDir = Directory.CreateDirectory(Path.Combine(projectDir, $"level-{i}")).FullName;
728var projectFile = new FileInfo(Path.Combine(projectDir, "Deep.AppHost.csproj"));
732File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"), "<Project />");
743var parentImport = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props");
746var repoRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "worktree-root"));
748Path.Combine(repoRoot.FullName, ".git"),
749$"gitdir: {Path.Combine(workspace.WorkspaceRoot.FullName, ".git", "worktrees", "worktree-root")}");
751var projectDir = Directory.CreateDirectory(Path.Combine(repoRoot.FullName, "src", "AppHost"));
752var projectFile = new FileInfo(Path.Combine(projectDir.FullName, "AppHost.csproj"));
Certificates\UnixCertificateManagerTests.cs (24)
212var missingProfileDirectory = Path.Combine(homeDirectory.FullName, "missing-profile");
247var missingProfileDirectory = Path.Combine(homeDirectory.FullName, "missing-profile");
322["DOTNET_DEV_CERTS_NSSDB_PATHS"] = $"firefox={Path.PathSeparator}chromium="
360var certificatePath = Path.Combine(homeDirectory.FullName, "certificate with spaces.pem");
386var certificatePath = Path.Combine(homeDirectory.FullName, "certificate with spaces.pem");
407var nssDbDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "nssdb"));
408var parentPidFile = Path.Combine(tempDirectory.FullName, "certutil-parent.pid");
409var childPidFile = Path.Combine(tempDirectory.FullName, "certutil-child.pid");
458var nssDbDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "nssdb"));
499["PATH"] = Path.Combine(openSslDirectory.FullName, "missing-tools"),
501["DOTNET_DEV_CERTS_NSSDB_PATHS"] = Path.Combine(openSslDirectory.FullName, "missing-nss-db")
507var certificatePath = Path.Combine(openSslDirectory.FullName, $"aspnetcore-localhost-{certificate.Thumbprint}.pem");
534["PATH"] = Path.Combine(corruptOpenSslDirectory.FullName, "missing-tools"),
535["SSL_CERT_DIR"] = string.Join(Path.PathSeparator, corruptOpenSslDirectory.FullName, validOpenSslDirectory.FullName),
536["DOTNET_DEV_CERTS_NSSDB_PATHS"] = Path.Combine(corruptOpenSslDirectory.FullName, "missing-nss-db")
543File.WriteAllText(Path.Combine(corruptOpenSslDirectory.FullName, certificateFileName), "not a certificate");
544File.WriteAllText(Path.Combine(validOpenSslDirectory.FullName, certificateFileName), certificate.ExportCertificatePem());
569["PATH"] = Path.Combine(openSslDirectory.FullName, "missing-tools"),
570["DOTNET_DEV_CERTS_NSSDB_PATHS"] = Path.Combine(openSslDirectory.FullName, "missing-nss-db"),
578var certificatePath = Path.Combine(openSslDirectory.FullName, $"aspnetcore-localhost-{savedCertificate.Thumbprint}.pem");
604["PATH"] = Path.Combine(nssDbDirectory.FullName, "missing-certutil"),
631var certUtilFile = new FileInfo(Path.Combine(directory.FullName, "certutil"));
655var certUtilFile = new FileInfo(Path.Combine(directory.FullName, "certutil"));
688var path = Path.Combine([homeDirectory.FullName, .. pathSegments]);
CliBootstrapTests.cs (19)
140File.WriteAllText(Path.Combine(aspireHome.FullName, AspireConfigFile.FileName), globalConfig);
175var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-pr-test");
176var binaryPath = WriteBinaryWithSidecar(Path.Combine(installPrefix, "dogfood", "pr-17159", "bin"), InstallSourceExtensions.PrWire);
180Assert.Equal(Path.Combine(installPrefix, "logs"), loggingOptions.LogsDirectory);
181Assert.Equal(loggingOptions.LogsDirectory, Path.GetDirectoryName(loggingOptions.LogFilePath));
188var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-pr-test");
189var binaryDir = Path.Combine(installPrefix, "dogfood", "pr-17159", "bin");
191var logsDirectory = Path.Combine(installPrefix, "logs");
192var logFilePath = Path.Combine(logsDirectory, "aspire.log");
209Assert.Equal(Path.Combine(installPrefix, "hives"), context.HivesDirectory.FullName);
210Assert.Equal(Path.Combine(installPrefix, "cache"), context.CacheDirectory.FullName);
211Assert.Equal(Path.Combine(installPrefix, "sdks"), context.SdksDirectory.FullName);
212Assert.Equal(Path.Combine(installPrefix, "packages"), context.PackagesDirectory?.FullName);
238logsDirectory: Path.Combine(workspace.WorkspaceRoot.FullName, "logs"),
239logFilePath: Path.Combine(workspace.WorkspaceRoot.FullName, "logs", "aspire.log"),
260logsDirectory: Path.Combine(workspace.WorkspaceRoot.FullName, "logs"),
261logFilePath: Path.Combine(workspace.WorkspaceRoot.FullName, "logs", "aspire.log"),
317var binaryPath = Path.Combine(binaryDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
320File.WriteAllText(Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"{{channelField}}}""");
CliExecutionContextTests.cs (10)
13var hivesDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "hives"));
14var cacheDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "cache"));
15var sdksDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "sdks"));
16var logsDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "logs"));
23var cacheDir = new DirectoryInfo(Path.Combine(workingDir.FullName, "cache"));
24var sdksDir = new DirectoryInfo(Path.Combine(workingDir.FullName, "sdks"));
25var logsDir = new DirectoryInfo(Path.Combine(workingDir.FullName, "logs"));
66var nonexistentHives = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "no-hives-here"));
109File.WriteAllText(Path.Combine(hivesDir.FullName, "README.md"), "stray");
110File.WriteAllText(Path.Combine(hivesDir.FullName, ".DS_Store"), string.Empty);
Commands\AddCommandTests.cs (49)
388var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
390File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """
461var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
463File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """
542var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
544File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """
641var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
645File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), $$"""
724var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere"));
725var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.ts"));
727File.WriteAllText(Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), """
769var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
842var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
844File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """
912Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives", "test-hive"));
2490var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, isTypeScript ? "apphost.ts" : "AppHost.csproj"));
2495File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), $$"""
2504var hivesDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
2599var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
2601File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """
2714var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
2786var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
2811var localPackagesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives", PackageChannelNames.Local, "packages"));
2814File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty);
2815File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty);
2846var hivesRoot = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
2847var localPackagesDir = new DirectoryInfo(Path.Combine(hivesRoot.FullName, PackageChannelNames.Local, "packages"));
2848var prPackagesDir = new DirectoryInfo(Path.Combine(hivesRoot.FullName, "pr-12345", "packages"));
2852File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty);
2853File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty);
2855File.WriteAllText(Path.Combine(prPackagesDir.FullName, $"Aspire.Hosting.{staleVersion}.nupkg"), string.Empty);
2856File.WriteAllText(Path.Combine(prPackagesDir.FullName, $"Aspire.Hosting.Redis.{staleVersion}.nupkg"), string.Empty);
2882File.WriteAllText(Path.Combine(identityPackagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty);
2883File.WriteAllText(Path.Combine(identityPackagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty);
3010var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3060var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3110var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3164var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3212var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3260var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3308var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3360var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3411var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3469var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
3541var hivesDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "hives"));
3542var cacheDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "cache"));
3543var sdksDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "sdks"));
3544var logsDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "logs"));
3552Path.Combine(logsDirectory.FullName, "test.log"),
Commands\AgentInitCommandTests.cs (46)
102var blockedSkillParentPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents");
129var expectedSkillDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName);
163Path.Combine(".agents", "skills"),
164Path.Combine(".claude", "skills"),
165Path.Combine(".github", "skills"),
166Path.Combine(".opencode", "skill")
386AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireMonitoringSkillName);
387AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".claude", "skills"), FakeAspireSkillsInstaller.AspireMonitoringSkillName);
388AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".github", "skills"), FakeAspireSkillsInstaller.AspireMonitoringSkillName);
389AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".opencode", "skill"), FakeAspireSkillsInstaller.AspireMonitoringSkillName);
417Path.Combine("references", "compatibility-and-validation.md"),
418Path.Combine("references", "migration-patterns.md")
430.Select(location => Path.Combine(workspace.WorkspaceRoot.FullName, location.RelativeSkillDirectory, skill.Name))
431.Append(Path.Combine(homeDirectory.FullName, SkillLocation.Standard.RelativeSkillDirectory, skill.Name));
437.Select(path => Path.GetRelativePath(skillDirectory, path))
443await File.ReadAllTextAsync(Path.Combine(skillDirectory, file.RelativePath), TestContext.Current.CancellationToken).DefaultTimeout());
533var agentsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents");
570AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireSkillName);
571AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireDeploymentSkillName);
572AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireInitSkillName);
573AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireMonitoringSkillName);
574AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireOrchestrationSkillName);
575AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireProjectV2MigrationSkillName);
576AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireifySkillName);
615AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), skillName);
637AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireOrchestrationSkillName);
638var aspireSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName);
673AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireSkillName);
674AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireDeploymentSkillName);
675AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireInitSkillName);
676AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireMonitoringSkillName);
677AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireOrchestrationSkillName);
678AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireProjectV2MigrationSkillName);
679AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireifySkillName);
774AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireifySkillName);
775AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), FakeAspireSkillsInstaller.AspireProjectV2MigrationSkillName);
794var aspireSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName);
898var agentsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills");
917AssertSkillFileExists(workspace.WorkspaceRoot, Path.Combine(".agents", "skills"), CommonAgentApplicators.AspireSkillName);
920var aspireifySkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireifySkillName);
926var skillPath = Path.Combine(workspaceRoot.FullName, relativeSkillDirectory, skillName, "SKILL.md");
932var bundleDirectory = new DirectoryInfo(Path.Combine(workspaceRoot.FullName, $".test-aspire-skills-bundle-{Guid.NewGuid():N}"));
938var skillDirectory = Path.Combine(bundleDirectory.FullName, "skills", name);
940var skillPath = Path.Combine(skillDirectory, "SKILL.md");
977var manifestPath = Path.Combine(bundleDirectory.FullName, "skill-manifest.json");
1013var hookFile = Path.Combine(homeDirectory.FullName, ".copilot", "hooks", "aspire-telemetry.json");
Commands\AgentMcpCommandTests.cs (5)
140AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
207AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
281AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
395AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
476AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\AppHostLauncherTests.cs (15)
60var logsDirectory = Path.Combine(Path.GetTempPath(), "aspire-cli-tests");
65var fileName = Path.GetFileName(path);
1061var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log");
1089var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log");
1112var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log");
1174var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log");
1324var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1330var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
1332locatedAppHostFile = new FileInfo(Path.Combine(linkPath, "AppHost.csproj"));
1341Path.Combine(logsDirectory.FullName, "parent.log"),
1409Path.Combine(_workspace.WorkspaceRoot.FullName, "common", ".git"));
1414var backchannelsDir = Path.Combine(_homeDirectory.FullName, ".aspire", "cli", "bch");
1419var appHostId = Path.GetFileName(prefix);
1420var socketPath = Path.Combine(
Commands\CacheCommandTests.cs (20)
47var packagesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "packages"));
49File.WriteAllText(Path.Combine(restoreDir.FullName, "test.dll"), "fake");
63Assert.False(File.Exists(Path.Combine(restoreDir.FullName, "test.dll")));
70var appHostInfoCacheDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info"));
72var cacheEntry = Path.Combine(appHostInfoCacheDir.FullName, "entry.json");
105await File.WriteAllTextAsync(Path.Combine(firstBuildCache.FullName, "Aspire.Hosting.dll"), "fake").DefaultTimeout();
106await File.WriteAllTextAsync(Path.Combine(secondBuildCache.FullName, "Aspire.Hosting.dll"), "fake").DefaultTimeout();
116Assert.False(Directory.Exists(Path.Combine(stagingCacheRoot.FullName, "deadbeef")));
117Assert.False(Directory.Exists(Path.Combine(stagingCacheRoot.FullName, "cafef00d")));
147var packagesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "packages-nonexistent"));
166var tempDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}"));
171File.WriteAllText(Path.Combine(tempDir.FullName, "root.txt"), "root");
172File.WriteAllText(Path.Combine(subDir.FullName, "nested.txt"), "nested");
192var tempDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}"));
196var keepFile = Path.Combine(tempDir.FullName, "keep.txt");
197var deleteFile = Path.Combine(tempDir.FullName, "delete.txt");
221var nonExistent = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"aspire-test-nonexistent-{Guid.NewGuid():N}"));
Commands\CompletionScriptTests.cs (23)
24var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.ps1");
66var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.ps1");
68await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.ps1"), """
84["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
98var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.bash");
100var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
124["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
151var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.bash");
152var capturedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "arguments.bin");
153var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
172["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
178Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-executed")));
187var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.bash");
188var capturedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "arguments.bin");
189var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
208["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
221var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.fish");
245var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.zsh");
269var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "_aspire");
270var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
271var capturedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "arguments.bin");
298["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
311WorkingDirectory = Path.GetDirectoryName(environment["COMPLETION_SCRIPT"]),
Commands\ConfigCommandTests.cs (19)
123var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
214var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
262var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
287var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
321var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
441var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
770var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
790var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
851var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
882var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
913var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
927var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
929var settingsPath = Path.Combine(settingsDir, "settings.json");
960var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
962var settingsPath = Path.Combine(settingsDir, "settings.json");
1002var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1019var legacySettingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
1032var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1129var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
Commands\DashboardRunCommandTests.cs (11)
192Directory.Delete(Path.GetDirectoryName(dashboardPath)!);
197var managedDir = Path.Combine(workspace.WorkspaceRoot.FullName, "layout", BundleDiscovery.ManagedDirectoryName);
198File.WriteAllText(Path.Combine(managedDir, Path.GetFileName(dashboardPath)), "fake legacy dashboard");
656var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [dashboard].log");
675var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri;
686var layoutDir = Path.Combine(workspace.WorkspaceRoot.FullName, "layout");
687var managedDir = Path.Combine(layoutDir, "managed");
689var managedPath = Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName("aspire-managed"));
691var dashboardDir = Path.Combine(layoutDir, BundleDiscovery.DashboardDirectoryName);
692var dashboardPath = Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
Commands\DoctorCommandTests.cs (19)
166var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
193var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
196Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"),
269var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Normal.csproj"));
297var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Normal.csproj"));
300var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
323await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), "<Project />");
324await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.fsproj"), "<Project />");
350var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
407Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"),
411"path": "{{Path.GetRelativePath(workspace.WorkspaceRoot.FullName, appHostFile.FullName).Replace('\\', '/')}}"
434Path.Combine("level0", "level1", "level2", "level3", "level4", "level5", "AppHost.csproj"),
495var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
498Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"),
526var appHostFile = new FileInfo(Path.Combine(nestedAppHostDir.FullName, "AppHost.csproj"));
529Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"),
553Assert.Equal(Path.Combine("src", "NestedAppHost", "AppHost.csproj"), metadata.GetProperty("appHostPath").GetString());
560var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1077return new FileInfo(Path.Combine(directory.FullName, "AppHost.csproj"));
Commands\ExportCommandTests.cs (20)
27var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
115var customDir = Path.Combine(workspace.WorkspaceRoot.FullName, "custom", "nested");
116var outputPath = Path.Combine(customDir, "my-export.zip");
149var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
152var appHostDir = Path.Combine(workspace.WorkspaceRoot.FullName, "MyAppHost");
154var appHostProjectPath = Path.Combine(appHostDir, "MyAppHost.csproj");
182var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
192AppHostPath = Path.Combine("C:", "other", "OtherAppHost", "OtherAppHost.csproj"),
215AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TargetAppHost", "TargetAppHost.csproj"),
301var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
427var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
485var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
539var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
604var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
648var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
692var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
734var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
762var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
815var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
882AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\InitCommandTests.cs (90)
67var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
70var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectFileName));
110Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")));
120var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
153Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")));
175var appHostContent = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
190var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, solutionPath));
194var projectPath = Path.Combine(solutionFile.Directory.FullName, "Test.csproj");
197var otherSolutionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Other.slnx");
223Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
224Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")));
225var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)))!.AsObject();
264Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
265Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".gitignore")));
267var config = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject();
292var runJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json");
319var aspireConfig = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject();
362File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), existingAspireConfig);
373var runJson = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")))!.AsObject();
412var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
437Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")));
461Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
478await File.WriteAllTextAsync(Path.Combine(workspace.Path, "apphost.mts"), "console.log('existing AppHost');");
563Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts")));
565var config = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject();
578var existingAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
581File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), """{ "type": "commonjs" }""");
596Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts")));
597Assert.Equal("""{ "type": "commonjs" }""", File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json")));
606File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{}");
615File.WriteAllText(Path.Combine(scaffoldDirectory.FullName, context.Language.AppHostFileName!), string.Empty);
645Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts")));
646Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-apphost", "apphost.mts")));
768Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
770var aspireSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName);
773var aspireifySkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireifySkillName);
790Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
793var agentsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills");
810Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
812var aspireSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md");
816var aspireifySkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireifySkillName);
834var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
852var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
885var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
906var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
926var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
970File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")),
979var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
983var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
984Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-12345", "packages"));
1056var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1122var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1171var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1241Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
1243var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1276Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
1278var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1313var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1337var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1386var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1430var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1545var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1652var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1731var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1735var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
1819var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1822var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1880var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1909var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1927var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1931var appHostDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost"));
1933Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")));
1954var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1972var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
1974Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")));
1991var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
2010var solutionFile = new FileInfo(Path.Combine(solutionDir.FullName, "Test.sln"));
2040Assert.True(File.Exists(Path.Combine(solutionDir.FullName, "nuget.config")),
2042Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")),
2044AssertNuGetConfigHasChannelShape(Path.Combine(solutionDir.FullName, "nuget.config"), contextChannel);
2060var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
2072var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
2121var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
2153var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
2176var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
2221File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")),
2237var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.slnx"));
2267var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
2371File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, appHostFileName), string.Empty);
2381File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, AspireConfigFile.FileName), config.ToJsonString());
Commands\LogsCommandTests.cs (5)
728AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
818AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
985AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
1548AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
1626AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\LsCommandTests.cs (18)
93var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
94var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj");
174var configuredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "ConfiguredAppHost.csproj"));
176await File.WriteAllTextAsync(Path.Combine(workingDirectory.FullName, "aspire.config.json"), JsonSerializer.Serialize(new
214var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
215var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj");
289var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
290var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj");
374var appHostPathZ = Path.Combine(workspace.WorkspaceRoot.FullName, "ZApp", "Z.AppHost.csproj");
375var appHostPathA = Path.Combine(workspace.WorkspaceRoot.FullName, "AApp", "A.AppHost.csproj");
376var appHostPathM = Path.Combine(workspace.WorkspaceRoot.FullName, "MApp", "M.AppHost.csproj");
419var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App", "App.AppHost.csproj");
520var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
521var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj");
556var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
557var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj");
609var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App", "App.AppHost.csproj");
762var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App", "App.AppHost.csproj");
Commands\NewCommandTemplateConfigPersistenceTests.cs (12)
259File.WriteAllText(Path.Combine(outputPath, $"{name}.generated"), templateName);
298var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, outputDirectoryName);
303var appHostFile = Path.Combine(outputDirectory, "apphost.cs");
312var csharpNuGetConfig = await File.ReadAllTextAsync(Path.Combine(outputDirectory, "nuget.config"));
335var dotNetNuGetConfig = await File.ReadAllTextAsync(Path.Combine(outputDirectory, "nuget.config"));
403var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, outputDirectoryName);
479hivesDirectory: new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")),
515var installPrefix = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "custom-aspire-prefix"));
516var processPath = Path.Combine(installPrefix.FullName, "dogfood", PrChannelName, "bin", "aspire");
517Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
520var packagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", PrChannelName, "packages"));
521File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{s_prVersion}.nupkg"), string.Empty);
Commands\NewCommandTests.cs (108)
147var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TemplateOut");
148var nugetConfigPath = Path.Combine(outputDirectory, "nuget.config");
553var config = AspireConfigFile.Load(Path.Combine(workspace.WorkspaceRoot.FullName, "output"));
727var doc = XDocument.Load(Path.Combine(outputPath, "nuget.config"));
916File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.mts"), "// test apphost");
933Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.mts")));
934Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "aspire.config.json")));
1082File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "AppHost.java"), "package aspire;");
1107File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), """
1145File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "AppHost.java"), "package aspire;");
1173File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.mts"), "// test apphost");
1185Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.mts")));
1250AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), expectedSource);
1260var expectedSource = Path.Combine(workspace.WorkspaceRoot.FullName, "relative-feed");
1261var nestedDirectory = Directory.CreateDirectory(Path.Combine(expectedSource, "aspire.projecttemplates", "9.2.0"));
1262File.WriteAllText(Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty);
1293AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), expectedSource);
1305var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed");
1307File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty);
1330File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, scaffoldFileName), "// test apphost");
1342AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride);
1353var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed");
1355File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty);
1366AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride);
1401Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output")));
1433var expectedSource = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.org");
1436Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output")));
1456File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.mts"), "// test apphost");
1495File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "AppHost.java"), "package aspire;");
1507Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "AppHost.java")));
1531File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.py"), "# test apphost");
1543Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.py")));
1559Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.cs")));
1589var appHostCreated = File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.cs"));
1614var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
1615var aspireConfigPath = Path.Combine(outputDir, "aspire.config.json");
1616var appHostRunJsonPath = Path.Combine(outputDir, "apphost.run.json");
1648var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
1649var aspireConfigPath = Path.Combine(outputDir, "aspire.config.json");
1650var appHostRunJsonPath = Path.Combine(outputDir, "apphost.run.json");
1723var outputRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
1725var aspireConfigPath = Path.Combine(outputRoot, "aspire.config.json");
1732var appHostRunJsonPath = Path.Combine(outputRoot, "apphost.run.json");
1857var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestApp");
1902await File.WriteAllTextAsync(Path.Combine(context.TargetDirectory.FullName, "aspire.config.json"), """
1932var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", "aspire.config.json");
1996var modulesDir = Directory.CreateDirectory(Path.Combine(directory.FullName, LanguageInfo.GeneratedFolderName));
1997File.WriteAllText(Path.Combine(modulesDir.FullName, "aspire.mts"), "// generated sdk");
2012Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", LanguageInfo.GeneratedFolderName, "aspire.mts")));
2082var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed");
2086File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty);
2120var modulesDir = Directory.CreateDirectory(Path.Combine(directory.FullName, ".aspire", "modules"));
2121File.WriteAllText(Path.Combine(modulesDir.FullName, "aspire.ts"), "// generated sdk");
2134AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride);
2182AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride);
2192var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed");
2196File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty);
2291var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
2292var agentsDir = Path.Combine(outputDir, ".agents", "skills");
2316var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
2317var aspireSkillPath = Path.Combine(outputDir, ".agents", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md");
2320var aspireifySkillPath = Path.Combine(outputDir, ".agents", "skills", CommonAgentApplicators.AspireifySkillName);
2413Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-starter"), capturedOutputPath);
2448var result = command.Parse($"new aspire-starter --name MyProject --output {Path.Combine(workspace.WorkspaceRoot.FullName, "my-project")} --use-redis-cache --test-framework None");
2458var skillPath = Path.Combine(capturedOutputPath, ".agents", "skills", "aspire", "SKILL.md");
2490var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
2498var skillPath = Path.Combine(outputDir, ".agents", "skills", "aspire", "SKILL.md");
2609Path.Combine(workspace.WorkspaceRoot.FullName, "source");
2640var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", "MyFirstApp");
2668Path.Combine(workspace.WorkspaceRoot.FullName, "source", "MyFirstApp");
2699var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", "MyFirstApp");
2725Path.Combine(workspace.WorkspaceRoot.FullName, "source");
2756var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source");
2821workspaceRoot => Path.Combine(workspaceRoot, "source") + Path.DirectorySeparatorChar,
2822workspaceRoot => Path.Combine(workspaceRoot, "source", projectName));
2826workspaceRoot => Path.Combine(workspaceRoot, projectName) + Path.DirectorySeparatorChar,
2827workspaceRoot => Path.Combine(workspaceRoot, projectName));
2853Path.Combine(workspace.WorkspaceRoot.FullName, "source");
2864File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost");
2878var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", projectName);
2880Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts")));
2890File.WriteAllText(Path.Combine(selectedParent.FullName, "existing.txt"), "existing content");
2927File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost");
2942var expectedPath = Path.Combine(selectedParent.FullName, projectName);
2944Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts")));
2954var collidingProject = Directory.CreateDirectory(Path.Combine(collidingParent.FullName, projectName));
2955File.WriteAllText(Path.Combine(collidingProject.FullName, "existing.txt"), "existing content");
3020Assert.Equal(Path.Combine(validParent.FullName, projectName), capturedOutputPath);
3080File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost");
3095var expectedPath = Path.Combine(selectedParent.FullName, projectName);
3097Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts")));
3149File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost");
3165Assert.True(File.Exists(Path.Combine(selectedOutputPath.FullName, "apphost.ts")));
3166Assert.False(File.Exists(Path.Combine(selectedOutputPath.FullName, projectName, "apphost.ts")));
3192Path.Combine(workspace.WorkspaceRoot.FullName, "source", projectName);
3203File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost");
3217var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", projectName);
3219Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts")));
3265var aspireifySkillPath = Path.Combine(
3297var skillPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", ".agents", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md");
3323var skillPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", ".agents", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md");
3325var aspireifySkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", ".agents", "skills", CommonAgentApplicators.AspireifySkillName, "SKILL.md");
3351var skillPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", ".agents", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md");
3353var aspireifySkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", ".agents", "skills", CommonAgentApplicators.AspireifySkillName, "SKILL.md");
3364File.WriteAllText(Path.Combine(existingDir.FullName, "file.txt"), "content");
3413File.WriteAllText(Path.Combine(existingDir.FullName, "file.txt"), "content");
Commands\PsCommandTests.cs (18)
131AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
146AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"),
198var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
237AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
277AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
283AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
321AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
365AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
402var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
435var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
505AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
544AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
578var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
677AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
721AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
761AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
768AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
808AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
Commands\PublishCommandPromptingIntegrationTests.cs (18)
262var selectedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "artifact.zip");
265var missingFile = Path.Combine(workspace.WorkspaceRoot.FullName, "missing.zip");
266var relativeMissingFile = Path.GetRelativePath(Directory.GetCurrentDirectory(), missingFile);
267var relativeSelectedFile = Path.GetRelativePath(Directory.GetCurrentDirectory(), selectedFile);
803var oversizedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "large.bin");
806var validFile = Path.Combine(workspace.WorkspaceRoot.FullName, "small.bin");
809var relativeOversized = Path.GetRelativePath(Directory.GetCurrentDirectory(), oversizedFile);
810var relativeValid = Path.GetRelativePath(Directory.GetCurrentDirectory(), validFile);
849var wrongExtFile = Path.Combine(workspace.WorkspaceRoot.FullName, "cert.txt");
852var correctFile = Path.Combine(workspace.WorkspaceRoot.FullName, "cert.pem");
855var relativeWrong = Path.GetRelativePath(Directory.GetCurrentDirectory(), wrongExtFile);
856var relativeCorrect = Path.GetRelativePath(Directory.GetCurrentDirectory(), correctFile);
895var validFile = Path.Combine(workspace.WorkspaceRoot.FullName, "deploy.zip");
898var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), validFile);
927Assert.Equal(Path.GetFullPath(validFile), uploadedFilePath);
941var validFile = Path.Combine(workspace.WorkspaceRoot.FullName, "archive.tar.gz");
944var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), validFile);
970Assert.Equal(Path.GetFullPath(validFile), uploadedFilePath);
Commands\RunCommandTests.cs (75)
159var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
160File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """
208var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
209File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), $$"""
315var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
356var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
403var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
448var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
532var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
628var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
733var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
835var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
923var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
1028var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
1204await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "fake");
1207await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "fake");
1308var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"));
1334var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"));
1338Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
1367var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"));
1398var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"));
1427var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"));
1504var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1577var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1578File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """
1697var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
1773var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
1837var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
1899var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
1959var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
2027var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
2110var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2216var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
2279var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
2340var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
2402var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
3079var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [run].log");
3099var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri;
3192$"{InteractionServiceStrings.BuildingAppHost} src{Path.DirectorySeparatorChar}MyApp.AppHost{Path.DirectorySeparatorChar}MyApp.AppHost.csproj",
3201var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost");
3203var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj");
3844var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
3892var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
3936var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
3984var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
4027var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
4071var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
4115var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
4257var originalSecretsDir = Path.GetDirectoryName(originalSecretsPath)!;
4409var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4471var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4513var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4571var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4615var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4676Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"),
4714Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"),
4749var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4798var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4842var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4898Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"),
4940var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
4997var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
5044Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git"));
5046var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
5048var relativeCapturePath = Path.Combine("Profile Output", "profile.zip");
5111Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git"));
5113var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
5139Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git"));
5141var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
5393var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
5434var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
5442var backchannelsDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch");
5447var appHostId = Path.GetFileName(prefix);
5448var socketPath = Path.Combine(
Commands\SetupCommandTests.cs (6)
16var processPath = Path.Combine("home", ".aspire", "bin", "aspire");
20Assert.Equal(Path.Combine("home", ".aspire"), result);
26var processPath = Path.Combine("home", ".aspire", "dogfood", "pr-12345", "bin", "aspire");
30Assert.Equal(Path.Combine("home", ".aspire", "dogfood", "pr-12345"), result);
38var processPath = Path.Combine("Program Files", "WindowsApps", "Microsoft.Aspire_xyz", "aspire.exe");
42Assert.Equal(Path.Combine("Program Files", "WindowsApps"), result);
Commands\StartCommandTests.cs (15)
217var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
218File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """
269await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "fake");
272await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "fake");
300await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "fake");
303await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "fake");
331var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
384var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
523Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git"));
619Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git"));
651Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
668var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj"));
676var backchannelsDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch");
681var appHostId = Path.GetFileName(prefix);
682var socketPath = Path.Combine(
Commands\StopCommandTests.cs (58)
68var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App Host", fileName);
120var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj");
144"path" => Path.Combine(workspace.WorkspaceRoot.FullName, "Other", "AppHost.csproj"),
145"directory" => Path.GetDirectoryName(appHostPath)!,
190var connection = CreateConnection(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs"), 1);
230var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
264var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs");
303var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs");
352var resolvedProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Resolved.AppHost", "Resolved.AppHost.csproj"));
377string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("Resolved.AppHost", "Resolved.AppHost.csproj")),
390var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "AppHost.cs");
391var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "AppHost.cs");
409var expectedPath1 = Path.Combine("App1", "AppHost.cs");
410var expectedPath2 = Path.Combine("App2", "AppHost.cs");
425var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost", "App1.AppHost.csproj");
462var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost", "App1.AppHost.csproj");
481var expectedPath = Path.Combine("App1", "App1.AppHost", "App1.AppHost.csproj");
490Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
491var worktreeRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".worktrees", "feature")).FullName;
494Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
500var primaryAppHost = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj");
501var nestedAppHost = Path.Combine(worktreeRoot, "AppHost.csproj");
533var expectedPath = Path.Combine("AppHost", "AppHost.csproj");
545var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
569string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("AppHost", "AppHost.csproj")),
577var commonGitDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".git");
579var worktreeRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".worktrees", "feature")).FullName;
589var appHostPath = Path.Combine(worktreeRoot, "App1", "App1.AppHost", "App1.AppHost.csproj");
628var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost", "App1.AppHost.csproj");
663var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
664var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj");
741var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
766Assert.Contains(interactionService.DisplayedMessages, message => message.Message == string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("AppHost", "AppHost.csproj")));
776var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
808var runningAppHostFile = new FileInfo(Path.Combine(runningAppHostDirectory.FullName, "Running.AppHost.csproj"));
811var discoveredAppHostFile = new FileInfo(Path.Combine(discoveredAppHostDirectory.FullName, "Discovered.AppHost.csproj"));
850Path.Combine("RunningAppHost", "Running.AppHost.csproj"));
860var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
892var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
927var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
933var outOfScopeAppHostFile = Path.Combine(workspace.WorkspaceRoot.FullName, "OtherWorkspace", "Other.AppHost.csproj");
967var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1007var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1048var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1088var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1127var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "apphost.ts"));
1163string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("AppHost", "apphost.ts")),
1173var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1210var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1255var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1293var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1331var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1399var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1486var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj");
1622var homeDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".home"));
1623var backchannelsDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch");
1628var appHostId = Path.GetFileName(prefix);
1630var socketPath = Path.Combine(
Commands\TerminalTapePlayCommandTests.cs (22)
54await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, path), contents);
97await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), "");
115await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), "");
185await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"),
232await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), "");
285await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"),
314await File.WriteAllTextAsync(Path.Combine(directory.FullName, "probe.tape"), "# Inspect the current screen.");
316["terminal", "tape", "play", "shell", "--tape-file", Path.Combine("tape files", "probe.tape"), "--replica", "0"]);
335await File.WriteAllTextAsync(Path.Combine(directory.FullName, "play.tape"), """
340await File.WriteAllTextAsync(Path.Combine(directory.FullName, "nested", "input.tape"), """
346["terminal", "tape", "play", "shell", "--tape-file", Path.Combine("scripts", "play.tape")]);
366await File.WriteAllTextAsync(Path.Combine(directory.FullName, "play.tape"),
368await File.WriteAllTextAsync(Path.Combine(directory.FullName, "nested", "wait.tape"),
371["terminal", "tape", "play", "shell", "--tape-file", Path.Combine("scripts", "play.tape")]);
375path => Assert.Equal(Path.Combine(directory.FullName, "screen.txt"), path));
376var capture = await File.ReadAllTextAsync(Path.Combine(directory.FullName, "screen.txt"));
391var file = Path.Combine(workspace.WorkspaceRoot.FullName, "play.tape");
415await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"),
433await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"),
452await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"),
471await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"),
490await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), "");
Commands\TrayCommandTests.cs (20)
39var sidecar = Path.Combine(Path.GetDirectoryName(cliPath)!, InstallSidecarReader.SidecarFileName);
65var packageBin = Path.Combine(workspace.WorkspaceRoot.FullName, store, "aspire", "1.0.0", "bin");
67var packagedCli = Path.Combine(packageBin, "aspire");
69File.WriteAllText(Path.Combine(packageBin, InstallSidecarReader.SidecarFileName), """{"source":"script"}""");
84File.WriteAllText(Path.Combine(Path.GetDirectoryName(cliPath)!, InstallSidecarReader.SidecarFileName), "{");
98var installed = Path.Combine(workspace.WorkspaceRoot.FullName, "stable & installed aspire");
170Assert.Equal(action == "start" ? 1 : 0, Directory.Exists(Path.Combine(root, ".leases"))
171? Directory.GetFiles(Path.Combine(root, ".leases"), "*.lease").Length : 0);
247"dotnet" => Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet"),
248"missing" => Path.Combine(workspace.WorkspaceRoot.FullName, "missing-aspire"),
536var root = Path.Combine(workspace.WorkspaceRoot.FullName, "bundle versions", "version-1");
539Directory.CreateDirectory(Path.GetDirectoryName(trayPath)!);
541var binaryDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "installed aspire", "bin");
543File.WriteAllText(Path.Combine(binaryDirectory, InstallSidecarReader.SidecarFileName), """{"source":"script"}""");
544var cliPath = Path.Combine(binaryDirectory, "aspire");
569WindowsTrayTestPayload.Create(Path.Combine(bundle.Layout.LayoutPath!, "tray"),
643WindowsTrayTestPayload.Create(Path.Combine(root, "tray"),
648File.Delete(Path.Combine(root, "tray", "Aspire.ico"));
Commands\UpdateCommandRepositoryToolsTests.cs (16)
31var appHost = new FileInfo(Path.Combine(directory.FullName, "AppHost.csproj"));
116var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
230var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
292var selectedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "selected"));
294var appHost = Path.Combine(selectedDirectory.FullName, "AppHost.csproj");
356var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
400var appHostDirectory = workspace.CreateDirectory(Path.Combine("src", "AppHost"));
401var appHost = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
409var packagesPath = Path.Combine(directory.FullName, "Directory.Packages.props");
421var configPath = Path.Combine(directory.FullName, "aspire.config.json");
429var nugetPath = Path.Combine(directory.FullName, "NuGet.config");
438var lockPath = Path.Combine(directory.FullName, "package-lock.json");
583Directory.CreateDirectory(Path.Combine(directory.FullName, ".git"));
584var config = Directory.CreateDirectory(Path.Combine(directory.FullName, ".config"));
585var dotnetManifest = Path.Combine(config.FullName, "dotnet-tools.json");
595var npmManifest = Path.Combine(directory.FullName, "package.json");
Commands\UpdateCommandTests.cs (95)
89var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
190var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
191var oldBackup1 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
192var oldBackup2 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.9876543210");
193var otherFile = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.something");
214var oldBackup = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
239FileDeleteHelper.TryCleanupOldItems(Path.Combine("C:", "NonExistent"), "aspire.exe");
311return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
380var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
443var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
498var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
568return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
631var toolPath = Path.Combine(installDir.FullName, "custom tool path");
647return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
724return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
797return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
840return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
881return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
965return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1018Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), pendingMigration.DetectedContext.AppHostFile.FullName);
1046Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), pendingMigration.DetectedContext.AppHostFile.FullName);
1048Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), pendingMigration.AppliedContext.AppHostFile.FullName);
1123return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1262var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
1305UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")))
1387var toolPath = Path.Combine(installDir.FullName, "custom tool path");
1470var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
1496var processPath = Path.Combine(installDirectory.FullName, "aspire");
1500var sidecarPath = Path.Combine(installDirectory.FullName, InstallSidecarReader.SidecarFileName);
1538var processPath = Path.Combine(installDirectory.FullName, "aspire");
1543var sidecarPath = Path.Combine(installDirectory.FullName, InstallSidecarReader.SidecarFileName);
1595var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
1636var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
1670return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1735return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1799return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1857return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1934return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
1979return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
2035var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2054var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
2056var globalSettingsPath = Path.Combine(globalDir, "settings.global.json");
2074var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2092var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
2094File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "daily" }""");
2096var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2116var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
2118File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "staging" }""");
2137var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2146return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
2199Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")))
2252var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere"));
2253var projectConfigPath = Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName);
2258updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}",
2272Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
2275var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
2277File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "staging" }""");
2279var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere"));
2283updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}",
2300Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
2303var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere"));
2305Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName),
2310updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}",
2326Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
2329var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
2331File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "staging" }""");
2333var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere"));
2335Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName),
2340updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}",
2383Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
2420return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
2506var resolved = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2591return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
2633var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere"));
2634var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "AppHost.csproj"));
2637Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName),
2781Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
2833return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(projectDirectory.FullName, "AppHost.csproj")));
2870var hivesDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
2964var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
3009var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
3054var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
3087var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
3120return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
3274var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
3296var executablePath = Path.Combine(contentDirectory.FullName, "aspire");
3314var tarPath = Path.Combine(archiveDirectory.FullName, "aspire.tar");
3317var archivePath = Path.Combine(archiveDirectory.FullName, "aspire.tar.gz");
3344var processPath = Path.Combine(toolPath, GetAspireExecutableName());
3345var storeExecutablePath = Path.Combine(
3358Directory.CreateDirectory(Path.GetDirectoryName(storeExecutablePath)!);
3367var binaryDir = Path.Combine(installPath, "nix", "store", "hash-aspire-cli", "lib", "aspire-cli");
3370var processPath = Path.Combine(binaryDir, GetAspireExecutableName());
3372File.WriteAllText(Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName), """{"source":"nix"}""");
3440var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
Commands\VsCodeExtensionCheckTests.cs (8)
63Directory.CreateDirectory(Path.Combine(extensions.FullName, "microsoft-aspire.aspire-vscode-1.2.3"));
91Directory.CreateDirectory(Path.Combine(extensions.FullName, "microsoft-aspire.aspire-vscode-1.2.3"));
116Directory.CreateDirectory(Path.Combine(home.FullName, rootFolder, "extensions", "microsoft-aspire.aspire-vscode-1.2.3"));
137Directory.CreateDirectory(Path.Combine(home.FullName, ".vscode", "extensions", "microsoft-aspire.aspire-vscode-1.2.3"));
188Directory.CreateDirectory(Path.Combine(extensions.FullName, "Microsoft-Aspire.Aspire-VSCode-9.9.9"));
207Directory.CreateDirectory(Path.Combine(extensions.FullName, "ms-dotnettools.csharp-2.0.0"));
229Directory.CreateDirectory(Path.Combine(extensions.FullName, "microsoft-aspire.aspire-vscode-extras-1.0.0"));
250var missingExtensionsDirectory = Path.Combine(home.FullName, "does-not-exist");
Configuration\AspireConfigFileTests.cs (30)
26var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
46var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
70var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
94var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
117var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
136var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
150var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
163var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
186var filePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
199var subDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "dir");
204Assert.True(File.Exists(Path.Combine(subDir, AspireConfigFile.FileName)));
220File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), "{}");
361var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
382var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
457var settingsPath = Path.Combine(root, ".aspire", "settings.json");
479var settingsPath = Path.Combine(root, ".aspire", "settings.json");
502var settingsPath = Path.Combine(root, ".aspire", "settings.json");
520var settingsPath = Path.Combine(root, ".aspire", "settings.json");
531var configPath = Path.Combine(root, AspireConfigFile.FileName);
546var absolutePath = Path.Combine(root, "src", "apphost.ts").Replace(Path.DirectorySeparatorChar, '/');
547var settingsPath = Path.Combine(root, ".aspire", "settings.json");
568var settingsPath = Path.Combine(root, ".aspire", "settings.json");
588var settingsPath = Path.Combine(root, ".aspire", "settings.json");
608var settingsPath = Path.Combine(root, ".aspire", "settings.json");
628var settingsPath = Path.Combine(root, ".aspire", "settings.json");
649var settingsPath = Path.Combine(root, ".aspire", "settings.json");
669var settingsPath = Path.Combine(root, ".aspire", "settings.json");
687var settingsPath = Path.Combine(root, ".aspire", "settings.json");
707var settingsPath = Path.Combine(root, ".aspire", "settings.json");
Configuration\ConfigurationHelperTests.cs (19)
17var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
21var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName));
121var globalSettingsFile = new FileInfo(Path.Combine(globalDirectory.FullName, AspireConfigFile.FileName));
132_ => Path.Combine(workspace.Path, AspireConfigFile.FileName)
204var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
236Directory.CreateDirectory(Path.Combine(configRoot.FullName, "nested", "apphost"));
237File.WriteAllText(Path.Combine(configRoot.FullName, AspireConfigFile.FileName), "{}");
240new DirectoryInfo(Path.Combine(configRoot.FullName, "nested", "apphost")));
250var appHostDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "apphost"));
256Path.Combine(workspace.WorkspaceRoot.FullName, AspireJsonConfiguration.SettingsFolder),
277var legacySettingsPath = Path.Combine(legacyDir.FullName, AspireJsonConfiguration.FileName);
285var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
289var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName));
315var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
325var legacySettingsPath = Path.Combine(legacyDir.FullName, AspireJsonConfiguration.FileName);
331var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName));
349var legacySettingsPath = Path.Combine(legacyDir.FullName, AspireJsonConfiguration.FileName);
353var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName));
362var migratedPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
DotNet\DotNetCliRunnerTests.cs (96)
46return Path.Combine(dotnetRoot, OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
56var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
105var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, appHostFileName));
144var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
178var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
179var appHostCommand = Path.Combine(workspace.WorkspaceRoot.FullName, "bin", "Debug", "net10.0", "AppHost");
180var runWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "run-cwd"));
220var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
221var appHostAssembly = Path.Combine(workspace.WorkspaceRoot.FullName, "bin", "Debug", "net10.0", "AppHost.dll");
222var runWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "run-cwd"));
234Assert.Equal("dotnet", Path.GetFileNameWithoutExtension(fileName));
261var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
289var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
321var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
354var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts", "bin", "Aspire.Cli", "Debug", "net10.0"));
355var cliPath = Path.Combine(cliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
357File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty);
367var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts", "bin", "Aspire.Cli", "Debug", "net10.0"));
368var cliPath = Path.Combine(cliDirectory.FullName, "aspire");
370File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty);
372var linkDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin"));
373var linkPath = Path.Combine(linkDirectory.FullName, "aspire");
383var dotnetDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet"));
384var dotnetPath = Path.Combine(dotnetDirectory.FullName, OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
394var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin"));
395var cliPath = Path.Combine(cliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
397File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty);
398File.WriteAllText(Path.Combine(cliDirectory.FullName, ".aspire-install.json"), """{"source":"script"}""");
407var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin"));
408var cliPath = Path.Combine(cliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
410File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty);
411Directory.CreateDirectory(Path.Combine(cliDirectory.FullName, "dcp"));
412Directory.CreateDirectory(Path.Combine(cliDirectory.FullName, "managed"));
413File.WriteAllText(Path.Combine(cliDirectory.FullName, "dcp", OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), string.Empty);
414File.WriteAllText(Path.Combine(cliDirectory.FullName, "managed", OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"), string.Empty);
423var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
451var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
488var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
517var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
546var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
570Assert.Equal(binlogDirectory.FullName, Path.GetDirectoryName(binlogPath));
572Assert.Contains("build", Path.GetFileName(binlogPath));
573Assert.Contains("AppHost", Path.GetFileName(binlogPath));
619var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
656var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
697var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
742var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
797var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
894var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
934var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
976var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1023var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1071[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock")
1104var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1138[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock")
1150var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1176[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock")
1192var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1218[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock")
1234var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1287var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1354var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1420var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1493var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
1498var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj"));
1502var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj"));
1522invocationOptions.StandardOutputCallback?.Invoke($"Project1{Path.DirectorySeparatorChar}Project1.csproj");
1523invocationOptions.StandardOutputCallback?.Invoke($"Project2{Path.DirectorySeparatorChar}Project2.csproj");
1540var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1543var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj"));
1573var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1620var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1666var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1703var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1740var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1780var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1825var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1877var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1926var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1974var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
2011var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2046var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2089var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2131var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2171var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2210var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "RunPropertiesApp"));
2211var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "RunPropertiesApp.csproj"));
2222await File.WriteAllTextAsync(Path.Combine(projectDirectory.FullName, "Program.cs"), "Console.WriteLine(\"Hello\");");
2248Assert.Equal(Path.Combine(projectDirectory.FullName, "relative-working-directory"), properties.GetProperty("RunWorkingDirectory").GetString());
2256var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2477var packagePath = Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{packageVersion}.nupkg");
2547var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2585var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2623var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2663var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2702var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Git\GitRepositoryTests.cs (10)
41var trackedFile = Path.Combine(appDir.FullName, "AppHost.csproj");
46var untrackedFile = Path.Combine(samplesDir.FullName, "Sample.csproj");
50var gitignorePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".gitignore");
55var ignoredFile = Path.Combine(binDir.FullName, "Stale.csproj");
69Assert.Contains(Path.GetFullPath(trackedFile), result!);
70Assert.Contains(Path.GetFullPath(untrackedFile), result);
71Assert.DoesNotContain(Path.GetFullPath(ignoredFile), result);
82var trackedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
98Assert.Contains(Path.GetFullPath(trackedFile), result!);
109var trackedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
Git\GitWorktreeTests.cs (86)
17Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
18var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj");
29var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
32Path.Combine(fixtureRoot, "primary", ".git"));
33var appHostPath = Path.Combine(worktreeRoot, "AppHost", "AppHost.csproj");
48var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
51Path.Combine(fixtureRoot, commonGitDirectoryName));
66Path.Combine(worktreeRoot, "primary", ".git"),
81Path.Combine(fixtureRoot, "physical", "checkouts", "feature")).FullName;
84Path.Combine(fixtureRoot, "physical", "primary", ".git"),
86var aliasRoot = Path.Combine(fixtureRoot, "aliases", "feature");
87Directory.CreateDirectory(Path.GetDirectoryName(aliasRoot)!);
120var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
123Path.Combine(fixtureRoot, "primary", ".git"));
124var caseVariantRoot = Path.Combine(fixtureRoot, "WORKTREE");
140var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "checkout")).FullName;
142Path.Combine(fixtureRoot, "physical", "primary", ".git", "worktrees", "feature")).FullName;
143var aliasDirectory = Path.Combine(fixtureRoot, "aliases", "admin");
144Directory.CreateDirectory(Path.GetDirectoryName(aliasDirectory)!);
163Path.Combine(adminDirectory, "gitdir"),
164Path.GetRelativePath(adminDirectory, gitFilePath) + Environment.NewLine);
184Path.Combine(worktreeRoot, "primary", ".git"));
186Path.Combine(worktreeRoot, ".git"),
187$"gitdir: {adminDirectory}{Path.DirectorySeparatorChar}{Environment.NewLine}");
200var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
201var adminDirectory = Path.Combine(fixtureRoot, "primary", ".git", "WORKTREES", "feature");
204Path.Combine(adminDirectory, "gitdir"),
222Path.Combine(worktreeRoot, "primary", ".git"));
223var caseVariantGitFile = Path.Combine(worktreeRoot, ".GIT");
225Path.Combine(adminDirectory, "gitdir"),
241var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
244Path.Combine(fixtureRoot, "primary", ".git"));
245var aliasRoot = Path.Combine(fixtureRoot, "worktree-alias");
263Path.Combine(adminDirectory, "gitdir"),
264Path.Combine(aliasRoot, ".git") + Environment.NewLine);
282var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
285Path.Combine(fixtureRoot, "primary", ".git"));
286var submoduleRoot = Directory.CreateDirectory(Path.Combine(worktreeRoot, "extern", "dep")).FullName;
289Path.Combine(adminDirectory, "modules", "dep"));
291Assert.Null(GitWorktree.TryGetLinkedWorktreeRoot(Path.Combine(submoduleRoot, "AppHost.csproj")));
299var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
300var adminDirectory = Path.Combine(fixtureRoot, "primary", ".git", "modules", "dep");
303Path.Combine(adminDirectory, "gitdir"),
314var commonGitDirectory = Path.Combine(fixtureRoot, "primary", ".git");
315var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
317var otherWorktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "other-worktree")).FullName;
320Path.Combine(commonGitDirectory, "worktrees", "other"));
322Path.Combine(adminDirectory, "gitdir"),
333var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName;
336Path.Combine(fixtureRoot, "primary", ".git", "worktrees", "stale"));
345Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git"));
346var submoduleRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "extern", "dep")).FullName;
349Path.Combine(workspace.WorkspaceRoot.FullName, ".git", "modules", "dep"));
350var appHostPath = Path.Combine(submoduleRoot, "AppHost.csproj");
370Directory.CreateDirectory(Path.Combine(primaryRoot, ".git"));
371var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName;
372TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git"));
373var nestedAppHost = Path.Combine(worktreeRoot, "AppHost.csproj");
374var primaryAppHost = Path.Combine(primaryRoot, "AppHost.csproj");
387Directory.CreateDirectory(Path.Combine(primaryRoot, ".git"));
388var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName;
389var adminDirectory = TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git"));
390var submoduleRoot = Directory.CreateDirectory(Path.Combine(worktreeRoot, "extern", "dep")).FullName;
391TestGitWorktree.WriteGitDirFile(submoduleRoot, Path.Combine(adminDirectory, "modules", "dep"));
392var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj");
404Directory.CreateDirectory(Path.Combine(primaryRoot, ".git"));
405var submoduleRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, "extern", "dep")).FullName;
408Path.Combine(primaryRoot, ".git", "modules", "dep"));
409var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj");
419var appHostPath = Path.Combine(primaryRoot, "sub", "App", "App.csproj");
430var repoBAppHost = Path.Combine(repoBRoot, "App", "App.csproj");
433Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(repoARoot, "App", "App.csproj"), repoBRoot));
442var repoBSubmoduleRoot = Directory.CreateDirectory(Path.Combine(repoBRoot, "extern", "dep")).FullName;
445Path.Combine(repoBRoot, ".git", "modules", "dep"));
446var repoBSubmoduleAppHost = Path.Combine(repoBSubmoduleRoot, "AppHost.csproj");
457var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName;
458TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git"));
460Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(worktreeRoot, "App", "App.csproj"), primaryRoot));
461Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(primaryRoot, "App", "App.csproj"), worktreeRoot));
468var workingDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "plain")).FullName;
469var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "other", "App.csproj");
479var unmanagedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "outside")).FullName;
480var unmanagedAppHost = Path.Combine(unmanagedDirectory, "App.csproj");
483Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(primaryRoot, "App", "App.csproj"), unmanagedDirectory));
493var root = Directory.CreateDirectory(Path.Combine(parent.FullName, name)).FullName;
494Directory.CreateDirectory(Path.Combine(root, ".git"));
HeldFileLeaseTests.cs (9)
44var orphanPath = Path.Combine(leaseDirectory, $"orphan{LeaseExtension}");
57var leaseDirectory = Path.Combine(workspace.Path, "missing");
67var leasePath = Path.Combine(leaseDirectory, $"orphan.unverified-lock{LeaseExtension}");
79var readyPath = Path.Combine(workspace.Path, "ready");
80var releasePath = Path.Combine(workspace.Path, "release");
119var orphanPath = Path.Combine(leaseDirectory, $"orphan{LeaseExtension}");
135var readyPath = Path.Combine(workspace.Path, "ready");
136var releasePath = Path.Combine(workspace.Path, "release");
178File.WriteAllText(Path.Combine(leaseDirectory, $"orphan{LeaseExtension}"), "{}");
Interaction\ExtensionInteractionServiceTests.cs (10)
35var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [extension].log");
68var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log");
108var cliLogFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log");
109var appHostLogFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cli.log");
158var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log");
221Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log"),
351var invalidPath = Path.Combine(workspace.WorkspaceRoot.FullName, "invalid");
352var validPath = Path.Combine(workspace.WorkspaceRoot.FullName, "valid");
393var invalidPath = Path.Combine(workspace.WorkspaceRoot.FullName, "invalid");
461var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [extension].log");
Layout\LayoutDiscoveryReparsePointTests.cs (44)
36var realLayoutRoot = Path.Combine(
43var realBinary = Path.Combine(realLayoutRoot, "aspire");
46var linksDir = Path.Combine(workspace.WorkspaceRoot.FullName, "WinGet", "Links");
48var linkPath = Path.Combine(linksDir, "aspire");
69var rawLayoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "custom-layout");
72var realBinaryDir = Path.Combine(workspace.WorkspaceRoot.FullName, "real-binary");
74var realBinary = Path.Combine(realBinaryDir, "aspire");
77var linkPath = Path.Combine(rawLayoutRoot, "aspire");
97var versionsDir = Path.Combine(layoutRoot, "versions", "v1");
98var versionedManaged = Path.Combine(versionsDir, BundleDiscovery.ManagedDirectoryName);
99var versionedDashboard = Path.Combine(versionsDir, BundleDiscovery.DashboardDirectoryName);
100var versionedDcp = Path.Combine(versionsDir, BundleDiscovery.DcpDirectoryName);
105Path.Combine(versionedManaged, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
107var dashboardPath = Path.Combine(versionedDashboard, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
112var bundleLink = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
127Path.Combine(bundleLink, BundleDiscovery.DashboardDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
146var binaryDir = Path.Combine(workspace.WorkspaceRoot.FullName, "opt", "aspire", "bin");
148var binaryPath = Path.Combine(binaryDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
151var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "home", ".aspire");
189var relativeLayoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "colocated");
190var binDir = Path.Combine(relativeLayoutRoot, "bin");
192var binaryPath = Path.Combine(binDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
197var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "home", ".aspire");
230? Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName)
232var managedDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.ManagedDirectoryName));
233Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DcpDirectoryName));
235Path.Combine(managedDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
237var dashboardDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DashboardDirectoryName));
239Path.Combine(dashboardDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
241var binaryPath = Path.Combine(layoutRoot, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
264? Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName)
266var managedDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.ManagedDirectoryName));
267var dcpDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DcpDirectoryName));
269Path.Combine(managedDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
275Path.Combine(managedDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
279var binaryPath = Path.Combine(layoutRoot, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
288var dashboardDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DashboardDirectoryName));
291var dashboardPath = Path.Combine(dashboardDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
303var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName);
304var managedDir = Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName);
305var dashboardDir = Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName);
306var dcpDir = Path.Combine(bundleDir, BundleDiscovery.DcpDirectoryName);
311Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
314Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
Layout\TrayLayoutTests.cs (17)
25var components = bundleDirectory ? Path.Combine(root, "bundle") : root;
26Directory.CreateDirectory(Path.Combine(components, "managed"));
27Directory.CreateDirectory(Path.Combine(components, "dashboard"));
28Directory.CreateDirectory(Path.Combine(components, "dcp"));
29File.WriteAllText(Path.Combine(components, "managed", BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), "");
30File.WriteAllText(Path.Combine(components, "dashboard", BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), "");
31File.WriteAllText(BundleDiscovery.GetDcpExecutablePath(Path.Combine(components, "dcp")), "");
32var trayPath = Path.Combine(components, OperatingSystem.IsWindows()
36Directory.CreateDirectory(Path.GetDirectoryName(trayPath)!);
67var source = Path.Combine(workspace.Path, "publish");
75writer.WriteEntry(Path.Combine(source, file), $"{rid}/tray/{file}");
79var extracted = Path.Combine(workspace.Path, "extracted");
83WindowsTrayPayload.Validate(Path.Combine(extracted, "tray"), rid);
85Directory.GetFiles(Path.Combine(extracted, "tray")).Select(Path.GetFileName).Order());
88Assert.Equal(File.ReadAllBytes(Path.Combine(source, file)), File.ReadAllBytes(Path.Combine(extracted, "tray", file)));
Mcp\ApiDocs\ApiDocsCacheTests.cs (8)
112new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")),
113new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache")),
114new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")),
115new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")),
120=> Directory.GetFiles(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", subdirectory))
121.Select(Path.GetFileName)
Mcp\Docs\DocsCacheTests.cs (10)
37var cacheFiles = Directory.GetFiles(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "docs"))
38.Select(Path.GetFileName)
87var cacheFiles = Directory.GetFiles(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "docs"))
88.Select(Path.GetFileName)
125new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")),
126new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache")),
127new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")),
128new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")),
Migrations\TypeScriptAppHostMigrationTests.cs (28)
54var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
71Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"),
83await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"), "// legacy");
84await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), "// modern");
95await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), "// csharp");
106var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "external-apphost"));
108var appHostPath = Path.Combine(appHostDirectory.FullName, "apphost.ts");
152await File.WriteAllTextAsync(Path.Combine(root.FullName, "apphost.ts"), LegacyAppHostContent);
154Path.Combine(root.FullName, "aspire.config.json"),
163Path.Combine(root.FullName, "tsconfig.apphost.json"),
171Path.Combine(root.FullName, "package.json"),
181await File.WriteAllTextAsync(Path.Combine(root.FullName, "eslint.config.mjs"), LegacyEslintConfigContent);
183var modulesDir = Directory.CreateDirectory(Path.Combine(root.FullName, ".modules"));
184await File.WriteAllTextAsync(Path.Combine(modulesDir.FullName, "aspire.ts"), "// generated");
189var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root.FullName, "aspire.config.json")))!;
192var tsconfig = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root.FullName, "tsconfig.apphost.json")))!;
196var packageJson = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root.FullName, "package.json")))!;
201var eslintConfig = await File.ReadAllTextAsync(Path.Combine(root.FullName, "eslint.config.mjs"));
214Assert.False(File.Exists(Path.Combine(root.FullName, "apphost.ts")));
215Assert.False(Directory.Exists(Path.Combine(root.FullName, ".modules")));
217var modernContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "apphost.mts"));
229var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "external-apphost"));
232await CreateMigration(workspace).ApplyAsync(new MigrationContext(new FileInfo(Path.Combine(appHostDirectory.FullName, "apphost.ts"))), CancellationToken.None);
234Assert.False(File.Exists(Path.Combine(appHostDirectory.FullName, "apphost.ts")));
235Assert.False(Directory.Exists(Path.Combine(appHostDirectory.FullName, ".modules")));
236Assert.Equal(ExpectedModernAppHostContent, await File.ReadAllTextAsync(Path.Combine(appHostDirectory.FullName, "apphost.mts")));
278var migratedContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "apphost.mts"));
282Assert.Equal(migratedContent, await File.ReadAllTextAsync(Path.Combine(root.FullName, "apphost.mts")));
Npm\AspireJsLauncherTests.cs (26)
66var monkeyPatchScript = Path.Combine(workspace.Path, "patch-chmod.js");
95var monkeyPatchScript = Path.Combine(workspace.Path, "patch-copy.js");
138var cachedBinaryPath = Path.Combine(layout.CacheDir, pointerVersion, rid, "bin", binaryName);
145var scriptPath = Path.Combine(GetRepoRoot(), "eng", "scripts", "pack-cli-npm-package.ps1");
147var launcherScriptPath = Path.Combine(GetRepoRoot(), "eng", "clipack", "npm", "aspire.js");
150var probeScript = Path.Combine(workspace.Path, "detect-rids.js");
168var launcherScriptPath = Path.Combine(GetRepoRoot(), "eng", "clipack", "npm", "aspire.js");
169var probeScript = Path.Combine(workspace.Path, "detect-current-rid.js");
228var pointerDir = Path.Combine(rootPath, "pointer");
229var pointerBinDir = Path.Combine(pointerDir, "bin");
230var nodeModulesDir = Path.Combine(rootPath, "node_modules");
231var ridPackageDir = Path.Combine(nodeModulesDir, ridPackageName.Replace("/", Path.DirectorySeparatorChar.ToString()));
232var ridBinDir = Path.Combine(ridPackageDir, "bin");
233var cacheDir = Path.Combine(rootPath, "cache");
246Path.Combine(pointerDir, "package.json"),
250var realLauncherPath = Path.Combine(GetRepoRoot(), "eng", "clipack", "npm", "aspire.js");
251var launcherScript = Path.Combine(pointerBinDir, "aspire.js");
257Path.Combine(pointerBinDir, "aspire-package-map.json"),
267Path.Combine(ridPackageDir, "package.json"),
271var binaryPath = Path.Combine(ridBinDir, binaryName);
274var probeScript = Path.Combine(rootPath, "probe-native.js");
285return new FakeNpmLayout(launcherScript, cacheDir, probeScript, Path.Combine(ridPackageDir, "package.json"));
322WorkingDirectory = Path.GetDirectoryName(launcherScript),
347WorkingDirectory = Path.GetDirectoryName(scriptPath),
408while (current is not null && !File.Exists(Path.Combine(current, "Aspire.slnx")))
NuGet\BundleNuGetServiceTests.cs (17)
17var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
41var restoreRoot = Path.Combine(
47Assert.Equal(Path.Combine(Path.GetDirectoryName(manifestPath)!, "obj"), capturedOutputPath);
99var toolPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.dll");
122Path.Combine(AppContext.BaseDirectory, $"{typeof(BundleNuGetService).Assembly.GetName().Name}.dll"),
176var manifestPath = Path.Combine(GetRestoreDirectory(workspace, packageList), ManifestFileName);
177Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!);
200var manifestPath = Path.Combine(GetRestoreDirectory(workspace, packageList), ManifestFileName);
201Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!);
220var firstAppHost = workspace.CreateDirectory(Path.Combine("apps", "api"));
221var secondAppHost = workspace.CreateDirectory(Path.Combine("apps", "web"));
224var restoreRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "integrations", "package-restore");
260var legacyLibsDirectory = Directory.CreateDirectory(Path.Combine(restoreDirectory, "libs"));
261var lockedFilePath = Path.Combine(legacyLibsDirectory.FullName, "Microsoft.Extensions.DependencyInjection.xml");
272Assert.Equal(Path.Combine(restoreDirectory, ManifestFileName), result);
336return Path.Combine(
NuGet\NuGetClientTests.cs (47)
114Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"),
134nugetConfigPath: Path.Combine(workspace.WorkspaceRoot.FullName, "missing", "nuget.config"),
176var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
380var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
413packageRoot = Path.GetDirectoryName(restoredPackages[0].InstallPath);
414var manifestPath = Path.Combine(restoreDirectory.FullName, IntegrationPackageProbeManifest.FileName);
416Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName),
424Assert.False(Directory.Exists(Path.Combine(restoreDirectory.FullName, "libs")));
427Path.Combine(
436Path.Combine("runtimes", "win-x64", "lib", "net10.0", "RuntimeOnly.dll"),
440Path.Combine("runtimes", "win-x64", "lib", "net10.0", "Neutral.resources.dll"),
444Path.Combine("runtimes", "win-x64", "lib", "net10.0", "fr", "RuntimeOnly.resources.dll"),
448Path.Combine("runtimes", "win-x64", "lib", "net10.0", "de", "RuntimeOnly.resources.dll"),
474var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
523var assets = new LockFileFormat().Read(Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName));
527Path.TrimEndingDirectorySeparator(folder.Path),
528Path.TrimEndingDirectorySeparator(environmentPackagesDirectory.FullName),
533Directory.Exists(Path.Combine(environmentPackagesDirectory.FullName, packageId.ToLowerInvariant(), "1.0.0")),
580var assets = new LockFileFormat().Read(Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName));
584Path.TrimEndingDirectorySeparator(folder.Path),
585Path.TrimEndingDirectorySeparator(configPackagesDirectory.FullName),
588Directory.Exists(Path.Combine(configPackagesDirectory.FullName, packageId.ToLowerInvariant(), "1.0.0")),
627var manifestPath = Path.Combine(restoreDirectory.FullName, IntegrationPackageProbeManifest.FileName);
629Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName),
637Path.Combine("runtimes", "unix-x64", "lib", "net10.0", "UnixFallback.dll"),
680var manifestPath = Path.Combine(restoreDirectory.FullName, IntegrationPackageProbeManifest.FileName);
682Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName),
754var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
802Path.Combine(restoredPackage.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll"),
818var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
865Path.Combine(restoredPackage.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll"),
879var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
994var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1009Path.GetDirectoryName(nugetConfigPath)!,
1010Path.GetFileName(nugetConfigPath));
1012var incompleteInstallPath = Path.Combine(globalPackagesFolder, packageId.ToLowerInvariant(), "1.0.0");
1014File.WriteAllText(Path.Combine(incompleteInstallPath, "partial.txt"), "incomplete");
1035Assert.True(File.Exists(Path.Combine(package.InstallPath, ".nupkg.metadata")));
1036Assert.True(File.Exists(Path.Combine(package.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll")));
1040Directory.Delete(Path.Combine(globalPackagesFolder, packageId.ToLowerInvariant()), recursive: true);
1051var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1071var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1098? Settings.LoadSpecificSettings(Path.GetDirectoryName(nugetConfigPath)!, Path.GetFileName(nugetConfigPath))
1113var lockFile = new LockFileFormat().Read(Path.Combine(restoreDirectory, LockFileFormat.AssetsFileName));
1135var packagePath = Path.Combine(feedDirectory, $"{packageId}.{version}.nupkg");
1197var packageDirectory = Path.Combine(globalPackagesFolder, packageId.ToLowerInvariant());
Packaging\NuGetConfigMergerSnapshotTests.cs (11)
34var path = Path.Combine(dir.FullName, "nuget.config");
73var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
80var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
135var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
142var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
196var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
203var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
255var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
262var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
319var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
326var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
Packaging\NuGetConfigMergerTests.cs (20)
24var path = Path.Combine(dir.FullName, "nuget.config");
46var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
70var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
114var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
153var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
197var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
237var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
347var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
397var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
466var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
530var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
586var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
668var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
718var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
759var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
789var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
839var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
861var originalContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "nuget.config")).DefaultTimeout();
882var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
904var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
Packaging\PackageChannelTests.cs (43)
141var nestedDirectory = Directory.CreateDirectory(Path.Combine(
147Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.6.0.nupkg"),
178File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty);
182File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty);
225File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty);
228File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty);
266File.WriteAllText(Path.Combine(channelPackagesDirectory.FullName, "Aspire.ProjectTemplates.13.4.0-preview.1.nupkg"), string.Empty);
269var nestedDirectory = Directory.CreateDirectory(Path.Combine(overridePackagesDirectory.FullName, "aspire.projecttemplates", "13.5.0-preview.2"));
270File.WriteAllText(Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.5.0-preview.2.nupkg"), string.Empty);
304var nestedDirectory = Directory.CreateDirectory(Path.Combine(packagesDirectory.FullName, "aspire.projecttemplates", "13.5.0-preview.2"));
305File.WriteAllText(Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.5.0-preview.2.nupkg"), string.Empty);
332File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Redis.{pinnedVersion}.nupkg"), string.Empty);
333File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.PostgreSQL.{pinnedVersion}.nupkg"), string.Empty);
334File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"CommunityToolkit.Aspire.Hosting.NodeJS.{pinnedVersion}.nupkg"), string.Empty);
337File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.SqlServer.13.3.0.nupkg"), string.Empty);
340File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty);
347File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.AppHost.{pinnedVersion}.nupkg"), string.Empty);
348File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Sdk.{pinnedVersion}.nupkg"), string.Empty);
349File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Orchestration.linux-arm64.{pinnedVersion}.nupkg"), string.Empty);
350File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Testing.{pinnedVersion}.nupkg"), string.Empty);
351File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Msi.{pinnedVersion}.nupkg"), string.Empty);
352File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Integration.Analyzers.{pinnedVersion}.nupkg"), string.Empty);
355File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Dapr.{pinnedVersion}.nupkg"), string.Empty);
356File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.GitHub.Models.{pinnedVersion}.nupkg"), string.Empty);
357File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.NodeJs.{pinnedVersion}.nupkg"), string.Empty);
640File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.4.0.nupkg"), string.Empty);
641File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.5.0-preview.1.nupkg"), string.Empty);
642File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.PostgreSQL.13.4.0-preview.1.nupkg"), string.Empty);
659File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.4.0.nupkg"), string.Empty);
660File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.5.0-preview.1.nupkg"), string.Empty);
661File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.PostgreSQL.13.4.0.nupkg"), string.Empty);
678File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.5.0.nupkg"), string.Empty);
679File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.6.0-preview.1.nupkg"), string.Empty);
680File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Azure.Kubernetes.13.6.0-pr.19404.gf51e8e1d.nupkg"), string.Empty);
709File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Dapr.13.4.0.nupkg"), string.Empty);
710File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Sql.13.4.0.nupkg"), string.Empty);
729File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Dapr.13.4.0.nupkg"), string.Empty);
730File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Sql.13.4.0.nupkg"), string.Empty);
972var missingDirectory = Path.Combine(Path.GetTempPath(), $"aspire-missing-{Guid.NewGuid():N}");
1012CreatePackageWithTags(Path.Combine(packagesDirectory.FullName, $"{packageId}.{version}.nupkg"), packageId, version, tags);
1017var packagePath = Path.Combine(packagesDirectory.FullName, packageId.ToLowerInvariant(), version, $"{packageId}.{version}.nupkg");
1018Directory.CreateDirectory(Path.GetDirectoryName(packagePath)!);
Packaging\PackagingServiceTests.cs (134)
27var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
60var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
96var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
200var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
237var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
270var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
304var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
360var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
425var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
457var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
487var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
512var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
540var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
567var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
593var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
613var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
634var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
664var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
696var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
718var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
746var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
771var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
815var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
839var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
882var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
914var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
946var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
977var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1007var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1037var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1067var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1121var nugetConfigPath = Path.Combine(tempDir.FullName, "nuget.config");
1146var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1150Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-10167"));
1151Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-11832"));
1202var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1206Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-12345"));
1242var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1277var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1312var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1376var nugetConfigPath = Path.Combine(tempDir.FullName, "nuget.config");
1393var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1425var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1455var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1486var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1488var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, "local", "packages"));
1492File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{localVersion}.nupkg"), string.Empty);
1493File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{localVersion}.nupkg"), string.Empty);
1513var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1514var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire");
1515Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1518var packagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages"));
1519File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{prVersion}.nupkg"), string.Empty);
1524var defaultHivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1556var defaultHivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1557var defaultPackagesDirectory = Directory.CreateDirectory(Path.Combine(defaultHivesDir.FullName, prChannelName, "packages"));
1558File.WriteAllText(Path.Combine(defaultPackagesDirectory.FullName, $"Aspire.ProjectTemplates.{defaultHiveVersion}.nupkg"), string.Empty);
1560var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1561var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire");
1562Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1565var dogfoodPackagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages"));
1566File.WriteAllText(Path.Combine(dogfoodPackagesDirectory.FullName, $"Aspire.ProjectTemplates.{dogfoodHiveVersion}.nupkg"), string.Empty);
1596var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1597var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire");
1598Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1601var packagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages"));
1602File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.not-a-semver.nupkg"), string.Empty);
1606hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")),
1632var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1633var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire");
1634Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1639hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")),
1662var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1663var processPath = Path.Combine(installPrefix.FullName, "dogfood", installedPrChannelName, "bin", "aspire");
1664Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1666Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", identityPrChannelName, "packages"));
1670hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")),
1694hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")),
1718var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1719var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire");
1720Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1722Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages"));
1726hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")),
1754var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix"));
1755var processPath = Path.Combine(installPrefix.FullName, "bin", "aspire");
1756Directory.CreateDirectory(Path.GetDirectoryName(processPath)!);
1758Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages"));
1774var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1776var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, "local", "packages"));
1780File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{localVersion}.nupkg"), string.Empty);
1815var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1867var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1918var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1964var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
1968var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, localHiveName, "packages"));
1972File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty);
1998var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2001var runPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, runHiveName, "packages"));
2005File.WriteAllText(Path.Combine(runPackagesDir.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty);
2032var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2035var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, "local", "packages"));
2040File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{localVersion}.nupkg"), string.Empty);
2042File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.Redis.{localVersion}.nupkg"), string.Empty);
2043File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.JavaScript.{localVersion}.nupkg"), string.Empty);
2045File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{localVersion}.nupkg"), string.Empty);
2046File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.AppHost.Sdk.{localVersion}.nupkg"), string.Empty);
2072var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2075var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, PackageChannelNames.Local, "packages"));
2077File.WriteAllText(Path.Combine(localPackagesDir.FullName, "Aspire.Hosting.13.4.0-pr.16820.g1a99aa46.nupkg"), string.Empty);
2112var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2116var localHiveDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, PackageChannelNames.Local));
2131var expectedLocalPackagesPath = Path.Combine(localHiveDir.FullName, "packages").Replace('\\', '/');
2142var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2145var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, PackageChannelNames.Local, "packages"));
2165var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2167var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping"));
2169File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, $"Aspire.ProjectTemplates.{overrideVersion}.nupkg"), string.Empty);
2170File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, $"Aspire.Hosting.{overrideVersion}.nupkg"), string.Empty);
2194var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
2196var staleHiveDir = Directory.CreateDirectory(Path.Combine(hivesDir.FullName, PackageChannelNames.Daily, "packages"));
2197File.WriteAllText(Path.Combine(staleHiveDir.FullName, "Aspire.Hosting.13.4.0.nupkg"), string.Empty);
2199var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping"));
2201File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, $"Aspire.Hosting.{overrideVersion}.nupkg"), string.Empty);
2226var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping"));
2227File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.Hosting.13.4.1.nupkg"), string.Empty);
2228File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.Hosting.13.4.2.nupkg"), string.Empty);
2230File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.ProjectTemplates.13.4.2.nupkg"), string.Empty);
2254var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping"));
2255File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.Hosting.13.4.1.nupkg"), string.Empty);
2256var nestedDir = Directory.CreateDirectory(Path.Combine(packagesOverrideDir.FullName, "nested"));
2257File.WriteAllText(Path.Combine(nestedDir.FullName, "Aspire.Hosting.13.4.2.nupkg"), string.Empty);
2259File.WriteAllText(Path.Combine(nestedDir.FullName, "Aspire.ProjectTemplates.13.4.2.nupkg"), string.Empty);
2260File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.ProjectTemplates.13.4.2.nupkg"), string.Empty);
2281var missingDir = new DirectoryInfo(Path.Combine(tempDir.FullName, "does-not-exist"));
Processes\ProcessTreeGracefulShutdownServiceTests.cs (7)
36AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"),
74AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"),
250AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"),
295AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"),
334AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"),
372AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"),
405Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"),
ProfileCaptureOptionsTests.cs (15)
39var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "profiles", "startup.zip");
66Assert.Contains("aspire-profile-", Path.GetFileName(options.OutputPath), StringComparison.Ordinal);
74var outputDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "profiles"));
83Assert.Equal(outputDirectory.FullName, Path.GetDirectoryName(options.OutputPath));
85Assert.Contains("aspire-profile-", Path.GetFileName(options.OutputPath), StringComparison.Ordinal);
92var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "profiles") + Path.DirectorySeparatorChar;
101Assert.Equal(Path.TrimEndingDirectorySeparator(Path.GetFullPath(outputDirectory)), Path.GetDirectoryName(options.OutputPath));
103Assert.Contains("aspire-profile-", Path.GetFileName(options.OutputPath), StringComparison.Ordinal);
110var dashboardBaseDirectory = Directory.CreateDirectory(Path.Combine(
117var expectedDashboardPath = Path.Combine(
131var dashboardBaseDirectory = Directory.CreateDirectory(Path.Combine(
138var expectedDashboardPath = Path.Combine(
ProfileCaptureServiceTests.cs (11)
117var managedPath = Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName));
122Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
153Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
156var dashboardPath = Path.Combine(dashboardDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
385var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "profile.zip");
402Assert.True(Directory.Exists(Path.GetDirectoryName(outputPath)));
526var dashboardPath = Path.Combine(
541var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "missing");
551var logPath = Path.Combine(workspace.WorkspaceRoot.FullName, "profile-service.log");
738var path = Path.Combine(workspace.WorkspaceRoot.FullName, fileName);
749outputPath ?? Path.Combine(workspace.WorkspaceRoot.FullName, "profile.zip"),
ProgramTests.cs (7)
42File.WriteAllText(Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"}""");
49? Path.Combine(workspace.Path, "mise", "installs", "aspire", "13.5.0", "aspire")
50: Path.Combine(workspace.Path, "aspire");
81new TestProcessPathProvider(Path.Combine(workspace.Path, "aspire.exe")),
169var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
186var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
203var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
Projects\AppHostCandidateFinderTests.cs (11)
92var missingAppHost = Path.Combine(workspace.WorkspaceRoot.FullName, "Removed", "AppHost.csproj");
168var searchRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "obj"));
205var nugetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache");
315var nugetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache");
339var differentlyCasedNuGetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "NUGET-CACHE");
383var nugetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache");
541await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, ".gitignore"), "legacy/\n");
573var searchDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src"));
607var fullPath = Path.Combine(root.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar));
608Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
Projects\AppHostServerProjectTests.cs (24)
55var parentConfigPath = Path.Combine(_workspace.Path, "NuGet.Config");
71var repoConfigPath = Path.Combine(repoRoot.FullName, "NuGet.Config");
84await File.WriteAllTextAsync(Path.Combine(repoRoot.FullName, "Directory.Packages.props"), "<Project />");
85await File.WriteAllTextAsync(Path.Combine(appPath.FullName, "NuGet.Config"), """
171var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json");
192var programCsPath = Path.Combine(project.ProjectModelPath, "Program.cs");
214var programCs = Path.Combine(project.ProjectModelPath, "Program.cs");
237var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json");
319Path.Combine("src", "Aspire.Hosting.Redis"));
320var integrationProjectPath = Path.Combine(integrationDirectory.FullName, "Aspire.Hosting.Redis.csproj");
346var firstProjectPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "Integration", "Integration.csproj");
347var secondProjectPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "integration", "Integration.csproj");
386var normalizedAppPath = Path.GetFullPath(project.AppDirectoryPath);
392var expectedRoot = Path.Combine(CliPathHelper.GetAspireHomeDirectory(), "hosts");
393var expectedPath = Path.Combine(expectedRoot, pathDir);
394var parentDirectory = Path.GetDirectoryName(project.ProjectModelPath);
453var aspireConfigPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
501var projectModelPath = Path.Combine(appPath, ".aspire_server");
532var projectFilePath = Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName);
557var aspireConfigPath = Path.Combine(appPath, AspireConfigFile.FileName);
575var projectModelPath = Path.Combine(appPath, ".aspire_server");
619var projectModelPath = Path.Combine(appPath, ".aspire_server");
647var aspireConfigPath = Path.Combine(appPath, AspireConfigFile.FileName);
665var projectModelPath = Path.Combine(appPath, ".aspire_server");
Projects\AppHostWorkloadIdTests.cs (9)
14var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
17var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.Link.csproj");
31var target = new FileInfo(Path.Combine(nestedDirectory.FullName, "AppHost.csproj"));
34var linkDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
36var pathThroughLink = Path.Combine(linkDirectoryPath, "nested", "AppHost.csproj");
49var target = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
54AppHostWorkloadId.Create(Path.Combine(nestedDirectory.FullName, "..", "AppHost.csproj")));
61var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
81var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Projects\DotNetAppHostProjectTests.cs (180)
268File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """
478Assert.Equal(Path.Combine(bundleRoot.FullName, BundleDiscovery.DcpDirectoryName), env![BundleDiscovery.DcpPathEnvVar]);
484Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
508var customDcpDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "custom-dcp"));
510var customDashboardPath = Path.Combine(
561var inheritedDcpDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "inherited-dcp")).FullName;
563var inheritedDashboardPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "inherited-dashboard");
624: Path.Combine(_workspace.WorkspaceRoot.FullName, "missing-dcp");
627: Path.Combine(_workspace.WorkspaceRoot.FullName, "missing-dashboard");
869Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
897var repoLocalManaged = Path.Combine(_workspace.WorkspaceRoot.FullName, "repo-local-aspire-managed");
926Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
955var customTerminalHost = Path.Combine(_workspace.WorkspaceRoot.FullName, "my-custom-terminal-host");
1011var runWorkingDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "run-cwd"));
1022Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1023File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1121Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1122File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1163"--log-file", Path.Combine(_workspace.WorkspaceRoot.FullName, "child.log"),
1211Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1212File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1277Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1278File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1367Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1368File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1409Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1410File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1453Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1454File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), $$"""
1500Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1501File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1545Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1546File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1653var missingTargetPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", "missing", "AppHost.dll");
1664var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", Guid.NewGuid().ToString("N")));
1665var targetPath = Path.Combine(outputDirectory.FullName, "AppHost.dll");
1677var missingRunCommand = Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", "missing", "AppHost");
1749Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1750File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
1816Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
1817File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), $$"""
1920File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "AppHost.run.json"), """
1985Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "My Project"));
1986File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "My Project", "launchSettings.json"), """
2046Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
2047File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
2111Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
2112File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
2168Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties"));
2169File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """
2271Assert.Equal(Path.Combine(bundleRoot.FullName, BundleDiscovery.DcpDirectoryName), env![BundleDiscovery.DcpPathEnvVar]);
2276Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
2434File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """
2666var appHostSymlink = Path.Combine(appHostFile.DirectoryName!, "apphost-link.cs");
2695var targetAppHostFile = new FileInfo(Path.Combine(realDirectory.FullName, "apphost.cs"));
2699var selectedAppHostPath = Path.Combine(selectedDirectory.FullName, "apphost.cs");
2729var selectedAppHostFile = new FileInfo(Path.Combine(configuredAppHostFile.DirectoryName!, "AppHost.cs"));
2792File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """
2946var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.cs");
2961var backchannelsDir = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
2966var appHostId = Path.GetFileName(prefix);
2967var socketPath = Path.Combine(
2976var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", Guid.NewGuid().ToString("N")));
2977var targetPath = Path.Combine(outputDirectory.FullName, fileName);
2979File.WriteAllText(Path.ChangeExtension(targetPath, ".runtimeconfig.json"), "{}");
2985var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", Guid.NewGuid().ToString("N")));
2986var commandPath = Path.Combine(outputDirectory.FullName, fileName);
3264var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3283var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3355var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "project", "Library.csproj"), """
3360WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3367WriteIsLikelyAppHostProject(Path.Combine("outer", "project", "Directory.Build.props"), """
3404var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3449var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
3452WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """
3457WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.targets"), """
3471var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
3529var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3553var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
3580var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3598var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3617var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """
3639var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "inner-repo", "MyAppHost", "MyAppHost.csproj"), """
3646WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3655Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "outer", "inner-repo", ".git"));
3673var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "src", "MyAppHost", "MyAppHost.csproj"), """
3681WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """
3686WriteIsLikelyAppHostProject(Path.Combine("repo", "Custom.props"), """
3709var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "src", "OrdinaryLib", "OrdinaryLib.csproj"), """
3716WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """
3723WriteIsLikelyAppHostProject(Path.Combine("repo", "src", "Directory.Build.props"), """
3744var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "OrdinaryLib.csproj"), """
3751WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3758WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
3776var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "MyAppHost.csproj"), """
3783WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3790WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
3816var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "proj", "OrdinaryLib.csproj"), """
3823WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3830WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """
3837WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "Directory.Build.props"), """
3859var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "proj", "OrdinaryLib.csproj"), """
3866WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3873WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """
3880WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "Directory.Build.props"), """
3897var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "MyAppHost.csproj"), """
3904WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
3911WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
3929var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """
3932WriteIsLikelyAppHostProject(Path.Combine("outer", "directory.build.props"), """
3939WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
3953var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """
3956WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.targets"), """
3963WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
3968WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """
3984var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """
3987WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.targets"), """
3994WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
3999WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """
4015var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """
4018WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
4023WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """
4030WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Directory.Build.targets"), """
4046var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """
4049WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
4056WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
4070var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """
4073WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
4080WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
4085WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Shared.props"), "<Project />");
4097var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "MyHost.csproj"), """
4104WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
4111WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """
4132var projectFile = WriteIsLikelyAppHostProject(Path.Combine("proj", "MyApp.csproj"), """
4139var externalAnchor = Path.Combine(_workspace.WorkspaceRoot.FullName, "external", "anchor");
4141WriteIsLikelyAppHostProject(Path.Combine("proj", "Directory.Build.props"), $"""
4146WriteIsLikelyAppHostProject(Path.Combine("external", "Directory.Build.props"), """
4183var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), "<Project Sdk=\"Microsoft.NET.Sdk\"");
4201var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), "<Project Sdk=\"Microsoft.NET.Sdk\"");
4219var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
4222WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """
4237var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
4240WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """
4255var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
4258WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """
4276var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
4279WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """
4298var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """
4301WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """
4345var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "OrdinaryLib.csproj"), """
4352WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
4359WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """
4383var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "proj", "OrdinaryLib.csproj"), """
4390WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
4397WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """
4404WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "Directory.Build.props"), """
4420var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "proj", "OrdinaryLib.csproj"), """
4423WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """
4439var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "proj", "OrdinaryLib.csproj"), """
4442WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """
4471var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "repo", "proj", "OrdinaryLib.csproj"), """
4474WriteIsLikelyAppHostProject(Path.Combine("outer", "Repo.marker"), "<Project />");
4475WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """
4482WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """
4489WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "repo", "Directory.Build.props"), """
4551var projectFile = new FileInfo(Path.Combine(repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)));
4569while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
4585Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, ".git"));
4587var path = Path.Combine(_workspace.WorkspaceRoot.FullName, fileName);
4588var directory = Path.GetDirectoryName(path);
4622var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, fileName);
4639var projectPath = Path.Combine(_workspace.WorkspaceRoot.FullName, fileName);
4653var bundleRoot = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, Guid.NewGuid().ToString()));
4654var dcpDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.DcpDirectoryName));
4655var managedDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName));
4656var dashboardDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.DashboardDirectoryName));
4659Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)),
4662Path.Combine(dashboardDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
4718=> File.WriteAllText(Path.Combine(directory, "aspire.config.json"), content);
Projects\DotNetBasedAppHostServerScaffoldCacheTests.cs (10)
64Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName));
82var programPath = Path.Combine(project.ProjectModelPath, "Program.cs");
103var objPath = Path.Combine(project.ProjectModelPath, "obj");
105var stalePath = Path.Combine(objPath, "stale.cache");
124var firstProject = Path.Combine(appPath, "v1", "Contoso.Widgets.csproj");
125var secondProject = Path.Combine(appPath, "v2", "Contoso.Widgets.csproj");
131var csprojPath = Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName);
149var objPath = Path.Combine(project.ProjectModelPath, "obj");
151var assetsPath = Path.Combine(objPath, "project.assets.json");
160var projectModelPath = Path.Combine(appPath, ".aspire_server");
Projects\ExtensionGuestLauncherTests.cs (17)
32var command = Path.Combine(Path.GetTempPath(), "npx");
57var effectivePath = Path.GetDirectoryName(effectiveJava)!;
58using var ambientPath = new EnvVarOverride("PATH", Path.GetDirectoryName(ambientJava));
64new FileInfo(Path.Combine(root.FullName, "AppHost.java")),
100await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "npx"), ["tsx"], new DirectoryInfo("/tmp"), new Dictionary<string, string>(), afterLaunchAsync: null, options: null, CancellationToken.None);
115await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "npx"), [], new DirectoryInfo("/tmp"), new Dictionary<string, string>(), afterLaunchAsync: null, options: null, CancellationToken.None);
136await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "npx"), ["tsx"], new DirectoryInfo("/tmp"), envVars, afterLaunchAsync: null, options: null, CancellationToken.None);
150var (exitCode, output) = await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "cmd"), [], new DirectoryInfo("/tmp"), new Dictionary<string, string>(), afterLaunchAsync: null, options: null, CancellationToken.None);
166var command = Path.Combine(Path.GetTempPath(), "python");
179var binDirectory = Directory.CreateDirectory(Path.Combine(root.FullName, runtimeDirectory, "bin"));
180var executable = Path.Combine(binDirectory.FullName, OperatingSystem.IsWindows() ? $"{command}.exe" : command);
Projects\FallbackProjectParserTests.cs (15)
24var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
46var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
71var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
96var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
121var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
147var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
167var tempPath = Path.GetTempPath().Replace("\\", "/");
186var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
208var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
232var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
262var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
285var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
309var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
332var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
354var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.txt");
Projects\GuestAppHostProjectTests.cs (75)
56var outputPath = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "modules");
57Directory.CreateDirectory(Path.Combine(outputPath, "aspire"));
58var kept = Path.Combine(outputPath, "aspire", "Kept.java");
59var obsolete = Path.Combine(outputPath, "aspire", "RemovedResource.java");
66[Path.Combine("aspire", "Kept.java"), Path.Combine("aspire", "RemovedResource.java")],
74[Path.Combine("aspire", "Kept.java")],
84var outputPath = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "modules");
86var handWritten = Path.Combine(outputPath, "HandWritten.java");
100var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "Generated.java");
116var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "Generated.java");
130var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "New.java");
141var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire_app.py");
183var settingsPath = Path.Combine(settingsDir.FullName, "settings.json");
203var settingsPath = Path.Combine(settingsDir.FullName, "settings.json");
389var settingsPath = Path.Combine(settingsDir.FullName, "settings.json");
449var launchSettingsPath = Path.Combine(propertiesDir.FullName, "launchSettings.json");
538var aspireConfigPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
730var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
738var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
793var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
801var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
803var installScriptPath = Path.Combine(_workspace.WorkspaceRoot.FullName, OperatingSystem.IsWindows() ? "install.cmd" : "install.sh");
807var installMarkerPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "install.marker");
817Command = OperatingSystem.IsWindows() ? Path.Combine(Environment.SystemDirectory, "cmd.exe") : "/bin/sh",
832var manifestPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "package.json");
836await File.WriteAllTextAsync(Path.Combine(_workspace.WorkspaceRoot.FullName, "package.after-install.json"), installedManifest);
906var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
914var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
952var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
960var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
997var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1005var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1048var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1056var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1089var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1113var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1122var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1169var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1177var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1224var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1233var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1294var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1311var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1410var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1459var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1527var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1560Path.Combine(AppContext.BaseDirectory, ".home", ".aspire"),
1576var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1591new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "package.json")));
1628var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1636var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1717var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1725var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts");
1806var backchannelsDir = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch");
1811var appHostId = Path.GetFileName(prefix);
1812var socketPath = Path.Combine(
1842var logFilePath = Path.Combine(_workspace.WorkspaceRoot.FullName, $"test-guest-{Guid.NewGuid()}.log");
1914var devCertificatePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire-dev-cert.pem");
1918["NODE_EXTRA_CA_CERTS"] = Path.GetFileName(devCertificatePath)
1930Assert.False(Directory.Exists(Path.Combine(_workspace.WorkspaceRoot.FullName, "bundles")));
1936var devCertificatePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire-dev-cert.pem");
1957var lowerCaseDirectory = Path.Combine(_workspace.WorkspaceRoot.FullName, "certificates");
1958var upperCaseDirectory = Path.Combine(_workspace.WorkspaceRoot.FullName, "CERTIFICATES");
1961var devCertificatePath = Path.Combine(lowerCaseDirectory, "aspire.pem");
1962var existingBundlePath = Path.Combine(upperCaseDirectory, "ASPIRE.PEM");
2011var existingBundlePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "existing-ca-certs.pem");
2012var inheritedBundlePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "inherited-ca-certs.pem");
2013var devCertificateDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "dev-certs");
2014var devCertificatePath = Path.Combine(devCertificateDirectory, "aspire-dev-cert.pem");
2031[configuredNodeExtraCaCertsKey] = Path.GetFileName(existingBundlePath)
2035var expectedBundlePath = Path.Combine(
2058envVars[configuredNodeExtraCaCertsKey] = Path.GetFileName(existingBundlePath);
2074File.GetUnixFileMode(Path.GetDirectoryName(expectedBundlePath)!));
2086var devCertificatePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire-dev-cert.pem");
Projects\GuestRuntimeTests.cs (59)
283var appHostFile = new FileInfo(Path.Combine(directory.FullName, "apphost.ts"));
578var effectivePath = Path.GetDirectoryName(effectiveJava)!;
603var appHostFile = new FileInfo(Path.Combine(root.FullName, "AppHost.java"));
608new Dictionary<string, string> { ["PATH"] = Path.GetDirectoryName(ambientJava)! },
757new DirectoryInfo(Path.GetTempPath()),
775var scriptPath = Path.Combine(
859new DirectoryInfo(Path.GetTempPath()),
891var appHostFile = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.ts"));
914var logFilePath = Path.Combine(Path.GetTempPath(), $"guest-output-test-{Guid.NewGuid()}.log");
925new DirectoryInfo(Path.GetTempPath()),
998Assert.Equal($"process {Path.GetFileName(resolvedDotNet)}", activity.DisplayName);
1102new DirectoryInfo(Path.GetTempPath()),
1161var appHostFile = new FileInfo(Path.Combine(tempDir, "apphost.ts"));
1165var migrationFilePath = Path.Combine(tempDir, migrationFileName);
1187var migrationFilePath = Path.Combine(tempDir, migrationFileName);
1209var appHostFile = new FileInfo(Path.Combine(tempDir, "apphost.ts"));
1249Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "classes", ".aspire-compile-stamp")));
1275var runtime = CreateRuntime(CreateUpToDateSpec(requiredOutputs: [Path.Combine("classes", "AppHost.class")]));
1294var input = Path.Combine(workspace.WorkspaceRoot.FullName, relativeInput.Replace('/', Path.DirectorySeparatorChar));
1315var classFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.class");
1343File.Delete(Path.Combine(workspace.WorkspaceRoot.FullName, relativeInput.Replace('/', Path.DirectorySeparatorChar)));
1358var pom = Path.Combine(workspace.WorkspaceRoot.FullName, "pom.xml");
1380var dependencies = Path.Combine(workspace.WorkspaceRoot.FullName, "target", "dependency");
1382File.WriteAllText(Path.Combine(dependencies, "guava-32.0.0.jar"), "");
1393File.Delete(Path.Combine(dependencies, "guava-32.0.0.jar"));
1394File.WriteAllText(Path.Combine(dependencies, "guava-33.0.0.jar"), "");
1396var runtime = CreateRuntime(CreateUpToDateSpec(extraInputs: [Path.Combine("target", "dependency")]));
1409var dependencies = Path.Combine(workspace.WorkspaceRoot.FullName, "target", "dependency");
1411var jar = Path.Combine(dependencies, "guava-32.0.0.jar");
1420var runtime = CreateRuntime(CreateUpToDateSpec(extraInputs: [Path.Combine("target", "dependency")]));
1438var unrelated = Path.Combine(workspace.WorkspaceRoot.FullName, "vendor", "nested", "Vendored.java");
1439Directory.CreateDirectory(Path.GetDirectoryName(unrelated)!);
1456StampFile = Path.Combine("classes", ".aspire-compile-stamp")
1480var nested = Path.Combine(workspace.WorkspaceRoot.FullName, "config", "Resources.java");
1481Directory.CreateDirectory(Path.GetDirectoryName(nested)!);
1504Path.Combine(workspace.WorkspaceRoot.FullName, "classes", "config", "Resources.class"),
1505Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "vendor", "Vendored.java"),
1506Path.Combine(workspace.WorkspaceRoot.FullName, ".gradle", "caches", "Cached.java")
1511Directory.CreateDirectory(Path.GetDirectoryName(path)!);
1527Directory.SetLastWriteTimeUtc(Path.GetDirectoryName(path)!, DateTime.UtcNow.AddMinutes(1));
1551var unreadable = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "main", "java", "locked");
1553File.WriteAllText(Path.Combine(unreadable, "Hidden.java"), "class Hidden { }");
1594Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "classes", ".aspire-compile-stamp")));
1612StampFile = Path.Combine("classes", ".aspire-compile-stamp")
1620var appHostFile = new FileInfo(Path.Combine(root.FullName, "AppHost.java"));
1622File.WriteAllText(Path.Combine(root.FullName, "Helper.java"), "class Helper { }");
1624var generated = Path.Combine(root.FullName, ".aspire", "modules", "com", "example");
1626File.WriteAllText(Path.Combine(generated, "Generated.java"), "class Generated { }");
1628var sources = Path.Combine(root.FullName, "src", "main", "java", "com", "example");
1630File.WriteAllText(Path.Combine(sources, "Service.java"), "class Service { }");
1632Directory.CreateDirectory(Path.Combine(root.FullName, "classes"));
1659var stamp = Path.Combine(root.FullName, "classes", ".aspire-compile-stamp");
1660Directory.CreateDirectory(Path.GetDirectoryName(stamp)!);
1667var binDirectory = Directory.CreateDirectory(Path.Combine(root.FullName, runtimeDirectory, "bin"));
1668var executable = Path.Combine(binDirectory.FullName, OperatingSystem.IsWindows() ? $"{command}.exe" : command);
Projects\JavaAppHostToolchainResolverTests.cs (121)
16var path = Path.Combine(directory, wrapperName);
34["/c", "call", Path.GetRelativePath(appHostDirectory, wrapperPath), .. toolArgs],
84File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
95File.WriteAllText(Path.Combine(workspace.Path, buildFileName), "");
104File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
105File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), "");
114File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
138File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
148["-B", "-q", "dependency:copy-dependencies", $"-DoutputDirectory={Path.Combine("target", "aspire-deps")}", "-DincludeScope=runtime"],
159"-classpath", Path.Combine("target", "aspire-deps", "*"),
160"-sourcepath", $".{Path.PathSeparator}{Path.Combine("src", "main", "java")}",
161"-d", Path.Combine("target", "classes"),
171["-cp", $"{Path.Combine("target", "classes")}{Path.PathSeparator}{Path.Combine("target", "aspire-deps", "*")}", "AppHost"],
186File.WriteAllText(Path.Combine(workspace.Path, buildFileName), "");
210Outputs = [Path.Combine(".java-build", "AppHost.class")],
212StampFile = Path.Combine(".java-build", ".aspire-compile-stamp")
228Assert.Contains(descriptor.Replace('/', Path.DirectorySeparatorChar), inputs);
231Assert.Contains(Path.Combine(outputDirectoryName, "aspire-deps"), inputs);
233? Path.Combine("target", "classes")
234: Path.Combine("build", "classes", "java", "main");
235Assert.Equal([Path.Combine(expectedClassesDirectory, "AppHost.class")], check.Outputs!);
243File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), "");
254["-q", "--init-script", JavaAppHostToolchainResolver.GradleInitScriptRelativePath.Replace('/', Path.DirectorySeparatorChar), "aspireCopyDependencies"],
262"-classpath", Path.Combine("build", "aspire-deps", "*"),
263"-sourcepath", $".{Path.PathSeparator}{Path.Combine("src", "main", "java")}",
264"-d", Path.Combine("build", "classes", "java", "main"),
272["-cp", $"{Path.Combine("build", "classes", "java", "main")}{Path.PathSeparator}{Path.Combine("build", "aspire-deps", "*")}", "AppHost"],
281File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
315var wrapperPath = Path.Combine(workspace.Path, expectedWrapper);
352var rootWrapperPath = Path.Combine(workspace.Path, expectedWrapper);
355var moduleDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "apphost"));
356File.WriteAllText(Path.Combine(moduleDirectory.FullName, useMaven ? "pom.xml" : "build.gradle"), "");
362Assert.Equal(["/c", "call", Path.Combine("..", expectedWrapper)], invocation.PrefixArgs);
376var localRepository = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-maven-repository"));
386Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"),
390"-f", Path.Combine("..", "..", "..", "..", "pom.xml"),
410Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"),
414"-f", Path.Combine("..", "..", "..", "..", "pom.xml"),
417$"-DoutputDirectory={Path.Combine("target", "aspire-deps")}",
432File.Exists(Path.Combine(resolution.ProjectDirectory.FullName, "target", "aspire-deps", "library-1.0-SNAPSHOT.jar")),
442var localRepository = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-maven-repository"));
452Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"),
456"-f", Path.Combine("..", "..", "..", "..", "pom.xml"),
480Path.Combine(workspace.Path, "pom.xml"),
484var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "standalone"));
485File.WriteAllText(Path.Combine(appHostDirectory.FullName, "pom.xml"), "<project />");
496$"-DoutputDirectory={Path.Combine("target", "aspire-deps")}",
504File.WriteAllText(Path.Combine(root, "pom.xml"), """
521var libraryDirectory = Directory.CreateDirectory(Path.Combine(root, "library"));
522File.WriteAllText(Path.Combine(libraryDirectory.FullName, "pom.xml"), """
534var librarySources = Directory.CreateDirectory(Path.Combine(libraryDirectory.FullName, "src", "main", "java", "com", "example"));
536Path.Combine(librarySources.FullName, "Library.java"),
539var appHostProjectDirectory = Directory.CreateDirectory(Path.Combine(root, "apphost"));
540File.WriteAllText(Path.Combine(appHostProjectDirectory.FullName, "pom.xml"), """
560Path.Combine(appHostProjectDirectory.FullName, "src", "main", "java"));
562Path.Combine(appHostDirectory.FullName, "AppHost.java"),
565var wrapperSource = Path.Combine(
571Path.Combine(wrapperSource, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"),
572Path.Combine(root, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"));
573var wrapperDirectory = Directory.CreateDirectory(Path.Combine(root, ".mvn", "wrapper"));
575Path.Combine(wrapperSource, ".mvn", "wrapper", "maven-wrapper.properties"),
576Path.Combine(wrapperDirectory.FullName, "maven-wrapper.properties"));
583File.WriteAllText(Path.Combine(root, "pom.xml"), """
596var appHostProjectDirectory = Directory.CreateDirectory(Path.Combine(root, "apphost"));
597File.WriteAllText(Path.Combine(appHostProjectDirectory.FullName, "pom.xml"), """
606Path.Combine(appHostProjectDirectory.FullName, "src", "main", "java"));
608Path.Combine(appHostDirectory.FullName, "AppHost.java"),
611var wrapperSource = Path.Combine(
617Path.Combine(wrapperSource, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"),
618Path.Combine(root, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"));
619var wrapperDirectory = Directory.CreateDirectory(Path.Combine(root, ".mvn", "wrapper"));
621Path.Combine(wrapperSource, ".mvn", "wrapper", "maven-wrapper.properties"),
622Path.Combine(wrapperDirectory.FullName, "maven-wrapper.properties"));
680=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
693File.WriteAllText(Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? windowsWrapperName : wrapperName), "");
695var innerCheckout = Directory.CreateDirectory(Path.Combine(workspace.Path, "inner"));
696Directory.CreateDirectory(Path.Combine(innerCheckout.FullName, ".git"));
697File.WriteAllText(Path.Combine(innerCheckout.FullName, useMaven ? "pom.xml" : "build.gradle"), "");
709File.WriteAllText(Path.Combine(directory, "pom.xml"), "");
713File.WriteAllText(Path.Combine(directory, "settings.gradle"), "");
721File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), "");
723var scriptPath = Path.Combine(workspace.Path, ".aspire", "aspire-gradle-init.gradle");
740File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), "");
745var script = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".aspire", "aspire-gradle-init.gradle"));
756File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
758var dependencyDirectory = Path.Combine(workspace.Path, "target", "aspire-deps");
760await File.WriteAllTextAsync(Path.Combine(dependencyDirectory, "library-1.0.jar"), "");
773File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
777Assert.False(Directory.Exists(Path.Combine(workspace.Path, "target")));
784File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), "");
787var dependencyDirectory = Path.Combine(workspace.Path, "build", "aspire-deps");
789await File.WriteAllTextAsync(Path.Combine(dependencyDirectory, "library-1.0.jar"), "");
806File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
823File.WriteAllText(Path.Combine(workspace.Path, buildFileName), "");
824var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java"));
838File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
839var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "a", "b", "c"));
848File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
850var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java"));
857var toProjectRoot = Path.Combine("..", "..", "..");
859Assert.Contains(Path.Combine(toProjectRoot, "pom.xml"), spec.InstallDependencies.Args);
864Assert.Contains($"-DoutputDirectory={Path.Combine("target", "aspire-deps")}", spec.InstallDependencies.Args);
870"-classpath", Path.Combine(toProjectRoot, "target", "aspire-deps", "*"),
871"-sourcepath", $".{Path.PathSeparator}{Path.Combine("src", "main", "java")}",
872"-d", Path.Combine(toProjectRoot, "target", "classes"),
880$"{Path.Combine(toProjectRoot, "target", "classes")}{Path.PathSeparator}{Path.Combine(toProjectRoot, "target", "aspire-deps", "*")}",
890File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), "");
892var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java"));
899var scriptPath = Path.Combine(workspace.Path, ".aspire", "aspire-gradle-init.gradle");
904Assert.Equal(scriptPath, Path.GetFullPath(Path.Combine(appHostDirectory.FullName, initScriptArgument)));
Projects\LanguageInfoTests.cs (7)
65File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"), "");
76File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp.csproj"), "");
87var nested = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "AppHost");
89File.WriteAllText(Path.Combine(nested, "apphost.cs"), "");
101var deep = Path.Combine(workspace.WorkspaceRoot.FullName, "a", "b", "c", "d", "e", "f");
103File.WriteAllText(Path.Combine(deep, "apphost.cs"), "");
121var result = s_csharp.FindInDirectory(Path.Combine("C:", "NonExistent", "Dir"));
Projects\PrebuiltAppHostServerTests.cs (116)
33var path = Path.Combine(workspace.WorkspaceRoot.FullName, "IntegrationRestore.csproj");
50var path = Path.Combine(workspace.WorkspaceRoot.FullName, "IntegrationRestore.csproj");
63var path = Path.Combine(workspace.WorkspaceRoot.FullName, "IntegrationRestore.csproj");
123var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
141var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
146var packagesProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props");
162var leaf = Path.Combine(workspace.WorkspaceRoot.FullName, "Leaf.csproj");
164var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
182var leaf = Path.Combine(workspace.WorkspaceRoot.FullName, "Leaf.csproj");
184var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
197var first = Path.Combine(workspace.WorkspaceRoot.FullName, "First.csproj");
198var second = Path.Combine(workspace.WorkspaceRoot.FullName, "Second.csproj");
214var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
228var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
243var referencedProject = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Hosting.Java.csproj");
354var objDir = Path.Combine(restoreDir, "obj");
358File.WriteAllText(Path.Combine(objDir, "project.assets.json"), "{}");
361File.WriteAllText(Path.Combine(objDir, "aspire-restore.stamp"), fingerprint);
462Path.Combine("/custom/output/path", "bin") + Path.DirectorySeparatorChar,
465Path.Combine("/custom/output/path", "obj") + Path.DirectorySeparatorChar,
475var integrationProjectPath = Path.Combine(integrationDirectory.FullName, "MyIntegration.csproj");
486var projectPath = Path.Combine(projectDirectory.FullName, "GeneratedClosure.csproj");
487var nuGetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config");
505Path.Combine(projectDirectory.FullName, "Directory.Build.props"),
528Assert.True(File.Exists(Path.Combine(restoreDirectory.FullName, "obj", IntegrationClosureBuilder.ProjectAssetsFileName)));
529Assert.True(File.Exists(Path.Combine(restoreDirectory.FullName, "bin", "Debug", "net10.0", "GeneratedClosure.dll")));
530Assert.False(Directory.Exists(Path.Combine(projectDirectory.FullName, "obj")));
531Assert.False(Directory.Exists(Path.Combine(projectDirectory.FullName, "bin")));
534Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName));
535Assert.Equal(["MyIntegration.dll", "MyIntegration.pdb"], sourcePaths.Select(Path.GetFileName));
539await File.ReadAllLinesAsync(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName)));
542await File.ReadAllLinesAsync(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureTargetsFileName)));
545await File.ReadAllLinesAsync(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ProjectRefAssemblyNamesFileName)));
555Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ClosureMetadataFileName), doc.Descendants(ns + "AspireClosureMetadataFile").FirstOrDefault()?.Value);
556Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ClosureSourcesFileName), doc.Descendants(ns + "AspireClosureSourcesFile").FirstOrDefault()?.Value);
557Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ClosureTargetsFileName), doc.Descendants(ns + "AspireClosureTargetsFile").FirstOrDefault()?.Value);
558Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ProjectRefAssemblyNamesFileName), doc.Descendants(ns + "AspireProjectRefAssemblyNamesFile").FirstOrDefault()?.Value);
692var rootDirectory = Path.Combine(normalizedWorkspaceRoot, ".aspire", "integrations", "apphosts");
694var parentDirectory = Path.GetDirectoryName(workingDirectory);
716var firstAppHost = workspace.CreateDirectory(Path.Combine("apps", "api"));
717var secondAppHost = workspace.CreateDirectory(Path.Combine("apps", "web"));
731var appHostsRoot = Path.Combine(normalizedWorkspaceRoot, ".aspire", "integrations", "apphosts");
758var linkDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "linked-apphost");
774await File.WriteAllTextAsync(Path.Combine(lexicalWorkspace.FullName, AspireConfigFile.FileName), "{}");
776var linkedAppHostPath = Path.Combine(lexicalWorkspace.FullName, "apphost");
784Path.Combine(lexicalWorkspace.FullName, ".aspire", "integrations", "apphosts")) + Path.DirectorySeparatorChar,
921Assert.True(Path.IsPathFullyQualified(gpfValue), $"globalPackagesFolder value must be an absolute path. Got: {gpfValue}");
932var expectedCachePath = Path.Combine(
980Assert.True(Path.IsPathFullyQualified(gpfValue), $"globalPackagesFolder value must be an absolute path. Got: {gpfValue}");
989var expectedCachePath = Path.Combine(
1103Assert.True(Path.IsPathFullyQualified(gpfValue), $"globalPackagesFolder value must be an absolute path. Got: {gpfValue}");
1112var expectedCachePath = Path.Combine(
1410new(new DirectoryInfo(Path.GetTempPath()),
1411new DirectoryInfo(Path.Combine(Path.GetTempPath(), "hives")),
1412new DirectoryInfo(Path.Combine(Path.GetTempPath(), "cache")),
1413new DirectoryInfo(Path.Combine(Path.GetTempPath(), "sdks")),
1414new DirectoryInfo(Path.Combine(Path.GetTempPath(), "logs")),
1523var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1553var appSettingsPath = Path.Combine(workingDirectory, "appsettings.json");
1586Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "integrations", "package-restore"),
1693var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1742var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1792var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1841var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1891var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1935var missingPackageSource = Path.Combine(workspace.WorkspaceRoot.FullName, "this-hive-was-deleted");
1937var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1995var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2062var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2151var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2233var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2453Assert.True(File.Exists(Path.Combine(layoutPath, "libs", "MyIntegration.dll")));
2456Assert.Equal(Path.Combine(layoutPath, "libs"), startInfo.Environment[KnownConfigNames.IntegrationLibsPath]);
2490Assert.Single(Directory.GetDirectories(Path.Combine(workingDirectory, "project-layouts", "items")));
2519var copiedLibs = Directory.GetFiles(Path.Combine(layoutPath, "libs"), "*", SearchOption.AllDirectories)
2520.Select(path => Path.GetRelativePath(Path.Combine(layoutPath, "libs"), path).Replace('\\', '/'))
2536assembly.GetProperty("path").GetString() == Path.Combine(workingDirectory, "integration-restore", "closure-sources", "Aspire.Hosting.Redis.dll"));
2573var copiedLibs = Directory.GetFiles(Path.Combine(layoutPath, "libs"), "*", SearchOption.AllDirectories)
2574.Select(path => Path.GetRelativePath(Path.Combine(layoutPath, "libs"), path).Replace('\\', '/'))
2664var copiedFilePath = Path.Combine(layoutPath, "libs", "MyIntegration.dll");
2672Assert.Single(Directory.GetDirectories(Path.Combine(workingDirectory, "project-layouts", "items")));
2701var lockedFilePath = Path.Combine(firstLayoutPath, "libs", "MyIntegration.dll");
2713Assert.True(File.Exists(Path.Combine(secondLayoutPath, "libs", "MyIntegration.dll")));
2729var firstSourcePath = Path.Combine(firstPackageRoot.FullName, "Aspire.Hosting.Redis.dll");
2730var secondSourcePath = Path.Combine(secondPackageRoot.FullName, "Aspire.Hosting.Redis.dll");
2774var firstPackagePath = Path.Combine(firstPackageRoot.FullName, "Aspire.Hosting.Redis.dll");
2775var secondPackagePath = Path.Combine(secondPackageRoot.FullName, "Aspire.Hosting.Redis.dll");
2776var projectPath = Path.Combine(projectRoot.FullName, "MyIntegration.dll");
2823var sourcePath = Path.Combine(restoreDirectory.FullName, "MyIntegration.dll ");
2827Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName),
2830Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName),
2833Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureTargetsFileName),
2835var intermediateOutputPath = Path.Combine(restoreDirectory.FullName, "obj");
2840Path.Combine(intermediateOutputPath, IntegrationClosureBuilder.ProjectAssetsFileName),
2872var packageSourcePath = Path.Combine(workingDirectory, "integration-restore", "closure-sources", "Aspire.Hosting.Redis.dll");
2878Assert.Single(Directory.GetDirectories(Path.Combine(workingDirectory, "project-layouts", "items")));
2945Path.Combine(
2966var sourcePath = Path.Combine(sourceRoot.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar));
2967var sourcePathDirectory = Path.GetDirectoryName(sourcePath);
2979targetPaths.Add(relativePath.Replace('/', Path.DirectorySeparatorChar));
2986File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName), metadataLines);
2987File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName), sourcePaths);
2988File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureTargetsFileName), targetPaths);
2989File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ProjectRefAssemblyNamesFileName), projectReferenceAssemblyNames);
3032File.WriteAllText(Path.Combine(objDirectory.FullName, "project.assets.json"), projectAssetsContent);
3128var dashboardPath = Path.Combine(
Projects\ProjectLocatorTests.cs (302)
39var appHostFile = new FileInfo(Path.Combine(directory.FullName, "apphost.cs"));
71var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
75var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
78var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
102var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
106var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
109var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
131var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
135var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
138var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
164var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
168var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
171var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
197var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
201var firstAlternative = new FileInfo(Path.Combine(alternativesDirectory.FullName, "FirstAlternative.csproj"));
203var secondAlternative = new FileInfo(Path.Combine(alternativesDirectory.FullName, "SecondAlternative.csproj"));
206var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
230var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
234var alternativeAppHost = new FileInfo(Path.Combine(alternativeDirectory.FullName, "Alternative.csproj"));
237var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
259var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
262var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
283var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
286var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
308var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, $"AppHost{index}.csproj"));
313var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
363var configuredPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
365var differentlyCasedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.csproj");
380var configuredPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
382var differentlyCasedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.csproj");
398var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
402var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
405var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
429var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
433var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
436var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
465var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj"));
469var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj"));
472var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
514var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
535var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
556Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)));
567var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj"));
571var decoyAppHost = new FileInfo(Path.Combine(decoyDirectory.FullName, "HealthyAppHost.csproj"));
574var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"));
576var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json"));
579appHostPath = Path.GetRelativePath(aspireSettingsDir.FullName, brokenAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
592var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"));
606Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)));
617var outsideAppHost = new FileInfo(Path.Combine(outsideDirectory.FullName, "OutsideAppHost.csproj"));
621var configPath = Path.Combine(workingDirectory.FullName, AspireConfigFile.FileName);
626path = Path.GetRelativePath(workingDirectory.FullName, outsideAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
655var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
687var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Missing.csproj"));
718var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebApp.csproj"));
747var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
751var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
755var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
760appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
780var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
784var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
789appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
811var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
815var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
820appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
838var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
843var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
879var staleProjectFile = new FileInfo(Path.Combine(staleProjectDirectory.FullName, "StaleProject.csproj"));
882var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
886var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
891appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, staleProjectFile.FullName)
932var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
955var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
990var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
994var decoyAppHostProjectFile = new FileInfo(Path.Combine(decoyAppHostDirectory.FullName, "DecoyAppHost.csproj"));
997var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1002path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, targetAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/')
1028var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
1032var decoyAppHostProjectFile = new FileInfo(Path.Combine(decoyAppHostDirectory.FullName, "DecoyAppHost.csproj"));
1035var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1040path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, targetAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/')
1065var guestAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
1068var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1102var configuredAppHostProjectFile = new FileInfo(Path.Combine(configuredAppHostDirectory.FullName, "ConfiguredAppHost.csproj"));
1105var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
1108var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1113path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/')
1155var configuredAppHostProjectFile = new FileInfo(Path.Combine(configuredAppHostDirectory.FullName, "ConfiguredAppHost.csproj"));
1158var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
1161var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1166path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/')
1207var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
1211var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
1214var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1219path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, targetAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/')
1244var settingsAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SettingsAppHost.csproj"));
1250var configPath = Path.Combine(workingDirectory.FullName, AspireConfigFile.FileName);
1275Assert.Contains(Path.Join("..", "SettingsAppHost.csproj"), displayedSubtleMessages);
1283var settingsAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.custom"));
1286var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1318var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
1322var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
1325var relativePath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName);
1326var forwardSlashPath = relativePath.Replace(Path.DirectorySeparatorChar, '/');
1348var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj"));
1351var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj"));
1366var appHostProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1369var webProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebProject.csproj"));
1412var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectFileExtension}"));
1430var onDiskProjectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj"));
1463var onDiskProjectFile = new FileInfo(Path.Combine(realDirectory.FullName, "RealAppHost.csproj"));
1466var linkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "LinkedAppHost");
1469var linkedProjectFile = new FileInfo(Path.Combine(linkDirectory, onDiskProjectFile.Name));
1494var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1509var legacyAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
1510var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"));
1513await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), JsonSerializer.Serialize(new
1522var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
1548var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
1557var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
1568var settingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName));
1585var appHostFile = new FileInfo(Path.Combine(srcDirectory.FullName, "apphost.ts"));
1588var adjacentConfigPath = Path.Combine(srcDirectory.FullName, AspireConfigFile.FileName);
1612var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"));
1633Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)));
1652var appHost1File = new FileInfo(Path.Combine(appHost1Directory.FullName, "apphost.ts"));
1654var appHost1ConfigPath = Path.Combine(appHost1Directory.FullName, AspireConfigFile.FileName);
1664var appHost2File = new FileInfo(Path.Combine(appHost2Directory.FullName, "apphost.ts"));
1666var appHost2ConfigPath = Path.Combine(appHost2Directory.FullName, AspireConfigFile.FileName);
1681var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"));
1703Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)));
1722var appHostFile = new FileInfo(Path.Combine(srcDirectory.FullName, "apphost.ts"));
1736var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"));
1757Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)));
1771var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "MyAppHost.csproj"));
1778var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"));
1779var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json"));
1780var relativeAppHostPath = Path
1782.Replace(Path.DirectorySeparatorChar, '/');
1786var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
1801var aspireConfigFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
1815var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1840var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
1866var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs"));
1876var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj"));
1881var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs"));
1921var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1941var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj"));
1946var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs"));
1982var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2009var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
2033var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
2054var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
2057var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2080var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
2091var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj"));
2106var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt"));
2126var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2131var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
2203? Path.Combine(executionContext.HomeDirectory.FullName, ".aspire", AspireConfigFile.FileName)
2204: Path.Combine(executionContext.WorkingDirectory.FullName, AspireConfigFile.FileName);
2318var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj"));
2373var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "UnbuildableAppHost.csproj"));
2391Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)));
2403var first = new FileInfo(Path.Combine(firstProjectDirectory.FullName, "FirstAppHost.csproj"));
2406var second = new FileInfo(Path.Combine(secondProjectDirectory.FullName, "SecondAppHost.csproj"));
2443var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj"));
2448var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2453path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, brokenAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
2485var healthyAppHost = new FileInfo(Path.Combine(healthyDirectory.FullName, "HealthyAppHost.csproj"));
2490var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj"));
2493var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2498path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, healthyAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
2526var configuredAppHost = new FileInfo(Path.Combine(configuredDirectory.FullName, "ConfiguredAppHost.csproj"));
2531var firstAppHost = new FileInfo(Path.Combine(firstDirectory.FullName, "FirstAppHost.csproj"));
2534var secondAppHost = new FileInfo(Path.Combine(secondDirectory.FullName, "SecondAppHost.csproj"));
2537var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2542path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
2571var unsupportedAppHost = new FileInfo(Path.Combine(unsupportedDirectory.FullName, "UnsupportedAppHost.csproj"));
2576var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2581path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, unsupportedAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
2611var directory = new DirectoryInfo(Path.Combine(Path.GetPathRoot(Environment.CurrentDirectory)!, "repo", "Apps"));
2612var file = new FileInfo(Path.Combine(Path.GetPathRoot(Environment.CurrentDirectory)!, "repo", "apps", "AppHost.csproj"));
2627var appHostFile = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj"));
2630var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
2645var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj"));
2649var firstHealthy = new FileInfo(Path.Combine(firstHealthyDirectory.FullName, "FirstHealthyAppHost.csproj"));
2653var secondHealthy = new FileInfo(Path.Combine(secondHealthyDirectory.FullName, "SecondHealthyAppHost.csproj"));
2656var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
2661path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, brokenAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
2695var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj"));
2697var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj"));
2732var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs"));
2760var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj"));
2799var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj"));
2804var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.cs"));
2842var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj"));
2846var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs"));
2884var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs"));
2907var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2928var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
2950var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
3002var normalProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp", "AppHost.csproj"));
3007var nugetCacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".nuget", "packages",
3010var cachedProject = new FileInfo(Path.Combine(nugetCacheDir, "Aspire.AppHost1.csproj"));
3020["NUGET_PACKAGES"] = Path.Combine(workspace.WorkspaceRoot.FullName, ".nuget", "packages")
3039var project1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "App1", "AppHost.csproj"));
3043var project2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "samples", "App2", "AppHost.csproj"));
3070var normalProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp", "AppHost.csproj"));
3075var customCacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, "custom-nuget-cache");
3076var cachedProjectDir = Path.Combine(customCacheDir, "aspire.projecttemplates", "9.1.0", "content");
3078var cachedProject = new FileInfo(Path.Combine(cachedProjectDir, "Aspire.AppHost1.csproj"));
3107var customCacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache");
3110var siblingDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache-extra", "MyApp");
3112var siblingProject = new FileInfo(Path.Combine(siblingDir, "AppHost.csproj"));
3116var cachedProjectDir = Path.Combine(customCacheDir, "aspire.projecttemplates", "9.1.0", "content");
3118var cachedProject = new FileInfo(Path.Combine(cachedProjectDir, "Aspire.AppHost1.csproj"));
3148var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyAppHost.csproj"));
3171var appHost1File = new FileInfo(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"));
3177var appHost2File = new FileInfo(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"));
3201var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "RealAppHost.csproj"));
3225await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "Not a real apphost");
3228await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "Not a real apphost");
3246var appHost1File = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj"));
3249var appHost2File = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj"));
3252var slowValidationFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SlowValidation.csproj"));
3305var appHost1File = new FileInfo(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"));
3309var appHost2File = new FileInfo(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"));
3313var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"));
3315var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json"));
3316var relativeAppHostPath = Path
3318.Replace(Path.DirectorySeparatorChar, '/');
3338var appHost1File = new FileInfo(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"));
3342var appHost2File = new FileInfo(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"));
3346var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"));
3348var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json"));
3349var relativeAppHostPath = Path
3351.Replace(Path.DirectorySeparatorChar, '/');
3372var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3377var staleAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj"));
3400var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3404var staleAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj"));
3429var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3433var skipListedAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj"));
3458var buildableAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Buildable", "AppHost.csproj"));
3462var unbuildableAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Unbuildable", "AppHost.csproj"));
3497var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3502var staleAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj"));
3537var configuredAppHost = new FileInfo(Path.Combine(configuredDirectory.FullName, "ConfiguredAppHost.csproj"));
3541var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
3546path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
3572var trackedAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3576var ignoredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "legacy", "Stale.csproj"));
3607var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3612var nodeModulesAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj"));
3644var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj"));
3649var phantomAppHost = Path.Combine(workspace.WorkspaceRoot.FullName, "Removed", "AppHost.csproj");
3701var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
3705var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3711appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, appHostProjectFile.FullName)
3739var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3768var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.unknown"));
3772var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3778appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, appHostProjectFile.FullName)
3801var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
3805var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3811appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, appHostProjectFile.FullName)
3849var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3884var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
3915var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3942var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
3967var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
3992var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
4022var settingsPath = Path.Combine(workspaceSettingsDirectory.FullName, "settings.json");
4049var settingsPath = Path.Combine(workspaceSettingsDirectory.FullName, "settings.json");
4076var settingsPath = Path.Combine(workspaceSettingsDirectory.FullName, "settings.json");
4114var realAppHost = new FileInfo(Path.Combine(realAppDirectory.FullName, "AppHost.csproj"));
4121var linkDirectory = Path.Combine(nodeModulesDir.FullName, "link");
4135var pathThroughLink = Path.Combine(linkDirectory, "AppHost.csproj");
4143var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
4186var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
4189var differentlyCasedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "APPHOST.csproj");
4197var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
4220var configuredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "Configured", "AppHost.csproj"));
4224var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
4229path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
Projects\ProjectUpdaterTests.cs (80)
31var appHostProject = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj"));
34var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
36var appHostProjectViaSymlink = new FileInfo(Path.Combine(symlinkDirectory, appHostProject.Name));
48var lowerCaseProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.csproj"));
50var upperCaseProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
66var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
69var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
72var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
176var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
179var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
182var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
195var aspireConfigFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"));
340var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
343var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
346var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
358var aspireConfigFile = new FileInfo(Path.Combine(appHostFolder.FullName, "aspire.config.json"));
447var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
450var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
453var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
463var aspireConfigFile = new FileInfo(Path.Combine(appHostFolder.FullName, "aspire.config.json"));
617var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
737var sharedProjectFile = new FileInfo(Path.Combine(sharedProjectFolder.FullName, "SharedProject.csproj"));
740var projectAFile = new FileInfo(Path.Combine(projectAFolder.FullName, "ProjectA.csproj"));
743var projectBFile = new FileInfo(Path.Combine(projectBFolder.FullName, "ProjectB.csproj"));
746var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "DiamondTest.AppHost.csproj"));
870var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
873var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
875var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1006var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1008var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1108var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1110var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1230var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1232var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1341var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1420var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1497var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1498var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1597Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")));
1598Assert.False(File.Exists(Path.Combine(appHostProjectFile.DirectoryName!, "nuget.config")));
1612var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
1637Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet", "NuGet.Config")
1666Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")));
1672var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1809var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1811var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1922var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1924var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
2046var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2048var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
2160var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2162var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
2271var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2365var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2367var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
2467var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2546var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2628var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
2721var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
2815var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
2891var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
2973var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3059var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3137var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3215var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3339var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3341var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
3466var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3499var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3531var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3568var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3604var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3637var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3674var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}");
3692var directoryPackagesPropsFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props");
3745var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "Issue15891.AppHost.csproj"));
3859var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3936var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
3990var existingConfigFile = new FileInfo(Path.Combine(executionContext.WorkingDirectory.FullName, "nuget.config"));
4026var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
Projects\RepositoryToolUpdaterTests.cs (23)
26var workingDirectory = root.CreateSubdirectory(Path.Combine("src", "app"));
60var unrelatedPath = Path.Combine(child.CreateSubdirectory(".config").FullName, "dotnet-tools.json");
80var rootManifestPath = Path.Combine(child.CreateSubdirectory(".config").FullName, "dotnet-tools.json");
105var gitPath = Path.Combine(root.FullName, ".git");
142var unrelatedPath = Path.Combine(child.FullName, "package.json");
167var link = Path.Combine(root.FullName, directoryLink ? ".config" : "package.json");
169var alias = Path.Combine(workspace.WorkspaceRoot.FullName, "alias");
193var manifestPath = Path.Combine(configDirectory.FullName, "dotnet-tools.json");
212var unrelatedPath = Path.Combine(root.FullName, "package.json");
215var workingDirectory = root.CreateSubdirectory(Path.Combine("src", "app"));
216var localManifestPath = Path.Combine(workingDirectory.CreateSubdirectory(".config").FullName, "dotnet-tools.json");
253var manifestPath = Path.Combine(root.FullName, "package.json");
317var lockPath = Path.Combine(root.FullName, "package-lock.json");
385Assert.False(File.Exists(Path.Combine(root.FullName, "package-lock.json")));
386Assert.False(File.Exists(Path.Combine(root.FullName, "npm-shrinkwrap.json")));
461var lockPath = Path.Combine(root.FullName, "package-lock.json");
552var path = Path.Combine(root.FullName, isNpm ? "package.json" : "dotnet-tools.json");
576var lockPath = Path.Combine(root.FullName, "package-lock.json");
609var dotNetPath = Path.Combine(root.FullName, "dotnet-tools.json");
610var npmPath = Path.Combine(root.FullName, "package.json");
731var path = Path.Combine(directory.FullName, isNpm ? "package.json" : "dotnet-tools.json");
762var packageLockPath = Path.Combine(directory.FullName, "package-lock.json");
763var shrinkwrapPath = Path.Combine(directory.FullName, "npm-shrinkwrap.json");
Projects\TypeScriptAppHostToolchainResolverTests.cs (41)
18File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }");
29File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"deno@2.9.0\" }");
42var packageJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "package.json");
57File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
58File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "deno.lock"), "{ \"version\": \"5\" }");
70File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
71File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "deno.json"), "{}");
83File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
84File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "deno.jsonc"), "{ /* Deno configuration */ }");
96File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
97File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "pnpm-lock.yaml"), "lockfileVersion: '9.0'");
108var packageJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "package.json");
120File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"yarn@4.14.1\" }");
131File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
132var yarnLockPath = Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock");
146File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }");
147File.WriteAllText(Path.Combine(parentDirectory.FullName, "package.json"), "{ \"name\": \"workspace\" }");
148var yarnLockPath = Path.Combine(parentDirectory.FullName, "yarn.lock");
162File.WriteAllText(Path.Combine(parentDirectory.FullName, "package.json"), "{ \"name\": \"workspace\" }");
163File.WriteAllText(Path.Combine(parentDirectory.FullName, "yarn.lock"), string.Empty);
164File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }");
165File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package-lock.json"), "{}");
177File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
178File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package-lock.json"), "{}");
179File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock"), string.Empty);
191File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
192Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".yarn"));
203File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
214File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }");
215File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock"), string.Empty);
234File.WriteAllText(Path.Combine(appHostDirectory.Parent!.FullName, "package.json"), "{ \"packageManager\": \"pnpm@10.12.1\" }");
235File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }");
248File.WriteAllText(Path.Combine(appHostDirectory.Parent!.FullName, "package.json"), "{ \"packageManager\": \"pnpm@10.12.1\" }");
249File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }");
254Assert.Equal($"packageManager 'bun@1.2.0' found in {Path.Combine(appHostDirectory.FullName, "package.json")}", resolution.Reason);
263File.WriteAllText(Path.Combine(appHostDirectory.Parent!.FullName, "package.json"), "{ \"packageManager\": \"yarn@4.14.1\" }");
264File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }");
265File.WriteAllText(Path.Combine(appHostDirectory.FullName, "pnpm-lock.yaml"), "lockfileVersion: '9.0'");
277File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }");
289var directory = new DirectoryInfo(Path.GetPathRoot(Path.GetTempPath())!);
Scaffolding\ScaffoldingServiceTests.cs (12)
36File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{}");
41Path.Combine(rootDirectory.FullName, ScaffoldingService.BrownfieldTypeScriptAppHostDirectoryName),
74File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{}");
156var appHostDirectory = Directory.CreateDirectory(Path.Combine(rootDirectory.FullName, ScaffoldingService.BrownfieldTypeScriptAppHostDirectoryName));
157File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{ \"packageManager\": \"npm@10.0.0\" }");
158File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"packageManager\": \"pnpm@10.0.0\" }");
228var scaffoldDirectory = Directory.CreateDirectory(Path.Combine(rootDirectory.FullName, ScaffoldingService.BrownfieldTypeScriptAppHostDirectoryName));
251File.WriteAllText(Path.Combine(rootDirectory.FullName, ".gitignore"), "node_modules/\n");
252File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{}");
253File.WriteAllText(Path.Combine(rootDirectory.FullName, "apphost.mts"), string.Empty);
290Directory.CreateDirectory(Path.Combine(rootDirectory.FullName, ".vscode"));
291File.WriteAllText(Path.Combine(rootDirectory.FullName, ".vscode", "settings.json"), "{}");
Telemetry\InternalMicrosoftDetectorTests.cs (64)
43var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
44Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
85var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
111var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
112Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
135var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
136Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
174Path.Combine(workspace.Path, "cache", "detector.json"),
210Path.Combine(workspace.Path, "cache", "detector.json"),
256Path.Combine(workspace.Path, "cache", "detector.json"),
286Path.Combine(workspace.Path, "cache", "detector.json"),
329Path.Combine(workspace.Path, "cache", "detector.json"),
356Path.Combine(workspace.Path, "cache", "detector.json"),
372var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
391var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
392Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
418var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
441var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
467Path.Combine(workspace.Path, "cache", "detector.json"),
490var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
491Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
524var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
563var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
564Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
589Path.Combine(workspace.Path, "cache", "detector.json"),
610Path.Combine(workspace.Path, "cache", "detector.json"),
630await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty);
631await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty);
642Path.Combine(workspace.Path, "cache", "detector.json"),
668await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty);
669await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty);
679Path.Combine(workspace.Path, "cache", "detector.json"),
702await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty);
703await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty);
710Path.Combine(workspace.Path, "cache", "detector.json"),
849var appSsoPath = Path.Combine(workspace.Path, "usr", "bin", "app-sso");
850Directory.CreateDirectory(Path.GetDirectoryName(appSsoPath)!);
871Path.Combine(workspace.Path, "cache", "detector.json"),
890Path.Combine(workspace.Path, "cache", "detector.json"),
893macPlatformSsoPath: Path.Combine(workspace.Path, "missing-app-sso"));
906var appSsoPath = Path.Combine(workspace.Path, "app-sso");
936Path.Combine(workspace.Path, "cache", "detector.json"),
950Path.Combine(workspace.Path, "full-detector-cache", "detector.json"),
1023Path.Combine(workspace.Path, "cache", "detector.json"),
1044await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty);
1045await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty);
1051Path.Combine(workspace.Path, "cache", "detector.json"),
1075await File.WriteAllTextAsync(Path.Combine(workspace.Path, executable), string.Empty);
1085Path.Combine(workspace.Path, "cache", "detector.json"),
1106await File.WriteAllTextAsync(Path.Combine(workspace.Path, executable), string.Empty);
1116Path.Combine(workspace.Path, "cache", "detector.json"),
1140Path.Combine(workspace.Path, "cache", "detector.json"),
1165Path.Combine(workspace.Path, "cache", "detector.json"),
1182var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json");
1213Path.Combine(workspace.Path, "cache", "detector.json"),
1237Path.Combine(workspace.Path, "cache", "detector.json"),
1261Path.Combine(workspace.Path, "cache", "detector.json"),
1285Path.Combine(workspace.Path, "cache", "detector.json"),
1308Path.Combine(workspace.Path, "cache", "detector.json"),
1340Path.Combine(workspace.Path, "cache", "detector.json"),
1365Path.Combine(workspace.Path, "cache", "detector.json"),
1574Path.Combine(workspace.Path, "cache", "detector.json"),
1624Path.Combine(workspace.Path, "cache", "detector.json"),
1669new DirectoryInfo(Path.GetDirectoryName(cacheFilePath) ?? AppContext.BaseDirectory),
Templating\DotNetTemplateFactoryTests.cs (17)
39var path = Path.Combine(dir.FullName, "nuget.config");
64var nugetConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
96var nugetConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
109var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
134var parentConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
140var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
153var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
176var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
190var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
203var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
207var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
220var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
229var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
230var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
241var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
250var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
251var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
Templating\JavaAppHostTemplateTests.cs (15)
45var path = Path.Combine(GetJavaStarterDirectory(), ".vscode", "settings.json");
81var apiDirectory = Path.Combine(GetJavaStarterDirectory(), "api");
83var buildPath = Path.Combine(apiDirectory, "build.gradle");
90var settingsPath = Path.Combine(apiDirectory, "settings.gradle");
95.Select(path => Path.GetFileName(path))
111var path = Path.Combine(GetJavaStarterDirectory(), "aspire.config.json");
132var apiDirectory = Path.Combine(GetJavaStarterDirectory(), "api");
136var path = Path.Combine(apiDirectory, relativePath);
140var propertiesPath = Path.Combine(apiDirectory, "gradle", "wrapper", "gradle-wrapper.properties");
149var path = Path.Combine(apiDirectory, relativePath);
167var viteConfig = File.ReadAllText(Path.Combine(GetJavaStarterDirectory(), "frontend", "vite.config.ts"));
173var path = Path.Combine(GetJavaStarterDirectory(), "AppHost.java");
180=> Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates", "java-starter");
183=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\JavaStarterScaffoldTests.cs (16)
38var wrapperPath = Path.Combine(outputDirectory, "api", "gradlew");
62.EnumerateFiles(Path.Combine(outputDirectory, "api"), "*", SearchOption.AllDirectories)
63.Select(path => Path.GetRelativePath(outputDirectory, path).Replace(Path.DirectorySeparatorChar, '/'))
81var templateWrapperJarPath = Path.Combine(
92var scaffoldedWrapperJarPath = Path.Combine(outputDirectory, "api", "gradle", "wrapper", "gradle-wrapper.jar");
95Assert.True(File.Exists(Path.Combine(outputDirectory, "frontend", "vite.config.ts")));
96Assert.True(File.Exists(Path.Combine(outputDirectory, "AppHost.java")));
105Assert.True(File.Exists(Path.Combine(outputDirectory, ".project")));
106Assert.True(File.Exists(Path.Combine(outputDirectory, ".classpath")));
107Assert.True(File.Exists(Path.Combine(outputDirectory, ".settings", "org.eclipse.jdt.core.prefs")));
108Assert.Contains("<name>JavaStarterOut</name>", File.ReadAllText(Path.Combine(outputDirectory, ".project")));
110using var config = JsonDocument.Parse(File.ReadAllText(Path.Combine(outputDirectory, "aspire.config.json")));
151return new ScaffoldedTemplate(workspace, Path.Combine(workspace.WorkspaceRoot.FullName, outputDirectoryName));
155=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\OutputPathHelperTests.cs (6)
36File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content");
52File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content");
67File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content");
99var path = Path.Combine(workspace.WorkspaceRoot.FullName, "new-dir");
122File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content");
159File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content");
Templating\TemplateGitIgnoreTests.cs (8)
14var filePath = Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates", templateName, ".gitignore");
25var templatesDirectory = Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates");
28.Where(path => string.Equals(Path.GetFileName(Path.GetDirectoryName(path)), "frontend", StringComparison.Ordinal))
29.Select(path => Directory.GetParent(Path.GetDirectoryName(path)!)!.FullName)
37var gitIgnorePath = Path.Combine(starterDirectory, ".gitignore");
47=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\TemplateNuGetConfigServiceTests.cs (30)
31Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"),
60var doc = XDocument.Load(Path.Combine(outputDirectory.FullName, "nuget.config"));
101var doc = XDocument.Load(Path.Combine(outputDirectory.FullName, "nuget.config"));
115Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"),
125Path.Combine(outputDirectory.FullName, "nuget.config"),
145var doc = XDocument.Load(Path.Combine(outputDirectory.FullName, "nuget.config"));
179Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")));
444var nestedDirectory = Directory.CreateDirectory(Path.Combine(
449Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"),
589var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
647File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty);
648File.WriteAllText(Path.Combine(prPackagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0-dev.nupkg"), string.Empty);
721File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty);
722File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0.nupkg"), string.Empty);
758var nestedDirectory = Directory.CreateDirectory(Path.Combine(
763Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.6.0.nupkg"),
800File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0-dev.nupkg"), string.Empty);
801File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.99.0.0.nupkg"), string.Empty);
836File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.99.0.0.nupkg"), string.Empty);
877File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0-dev.nupkg"), string.Empty);
878File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.7.0-dev.nupkg"), string.Empty);
978File.WriteAllText(Path.Combine(packagesDir.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty);
1029var templatePackagePath = Path.Combine(
1034Directory.CreateDirectory(Path.GetDirectoryName(templatePackagePath)!);
1123var configPath = Path.Combine(outputDir.FullName, "nuget.config");
1161Assert.False(File.Exists(Path.Combine(outputDir.FullName, "nuget.config")));
1172Path.Combine(outputDir.FullName, "nuget.config"),
1206var configPath = Path.Combine(outputDir.FullName, "nuget.config");
1233Path.Combine(outputDir.FullName, "nuget.config"),
1262var configPath = Path.Combine(outputDir.FullName, "nuget.config");
Templating\TemplatePackageLockTests.cs (11)
13var filePath = Path.Combine(
38var filePath = Path.Combine(
63var filePath = Path.Combine(
94var filePath = Path.Combine(
127var filePath = Path.Combine(
142var filePath = Path.Combine(
160var filePath = Path.Combine(
196"Aspire.Cli" => Path.Combine(GetRepoRoot(), "src", projectName, "Templating", "Templates", templateName),
197"Aspire.ProjectTemplates" => Path.Combine(GetRepoRoot(), "src", projectName, "templates", templateName),
202=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
TestServices\FakePlaywrightServices.cs (11)
66_bundleDirectory = new DirectoryInfo(Path.Combine(executionContext.WorkingDirectory.FullName, ".fake-aspire-skills-bundle"));
100[(CommonAgentApplicators.AspireSkillName, Path.Combine("references", "app-commands.md"))] = "# App commands",
101[(CommonAgentApplicators.AspireSkillName, Path.Combine("evals", "evals.json"))] = "{}",
120[(CommonAgentApplicators.AspireDeploymentSkillName, Path.Combine("references", "preflight.md"))] = "# Preflight",
157[(AspireProjectV2MigrationSkillName, Path.Combine("references", "migration-patterns.md"))] = "# Migration patterns",
158[(AspireProjectV2MigrationSkillName, Path.Combine("references", "compatibility-and-validation.md"))] = "# Compatibility and validation",
159[(AspireProjectV2MigrationSkillName, Path.Combine("evals", "eval.yaml"))] = "stimuli: []"
164var path = Path.Combine(_bundleDirectory.FullName, "skills", skillName, relativePath);
165Directory.CreateDirectory(Path.GetDirectoryName(path)!);
190await File.WriteAllTextAsync(Path.Combine(_bundleDirectory.FullName, "skill-manifest.json"), manifestJson, cancellationToken);
205Sha512 = ComputeSha512(Path.Combine(_bundleDirectory.FullName, "skills", skillName, entry.Key.RelativePath))
Utils\AspireRepositoryDetectorTests.cs (6)
41File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty);
43var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "src", "Project")).FullName;
67File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty);
72var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "playground", "polyglot")).FullName;
88File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty);
90var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "src", "Project")).FullName;
Utils\CliPathHelperTests.cs (33)
25Assert.Equal(Path.GetFileName(socketPath1), socketPath1);
26Assert.Equal(Path.GetFileName(socketPath2), socketPath2);
32var expectedDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "cli", "bch");
33Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath1));
34Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath2));
35Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath1));
36Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath2));
55var expectedDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "cli", "bch");
56Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath1));
57Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath2));
58Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath1));
59Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath2));
156var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
157var binDir = Path.Combine(installPrefix, "bin");
169var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-pr-test");
170var binDir = Path.Combine(installPrefix, "dogfood", "pr-17159", "bin");
198var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "portable");
199var binDir = Path.Combine(installPrefix, "dogfood", "pr-17159", "bin");
223Assert.Equal(Path.Combine("/home/user", ".aspire"), result);
239var path = Path.Combine("relative", "path", "aspire");
243Assert.Equal(Path.GetFullPath(path), result);
259var target = Path.Combine(workspace.WorkspaceRoot.FullName, "target-aspire");
262var link = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire");
334var realPath = Path.Combine(workspace.WorkspaceRoot.FullName, "binary-under-test");
350var realPath = Path.Combine(workspace.WorkspaceRoot.FullName, "binary-under-test");
370var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "portable");
371var binDir = Path.Combine(installPrefix, "dogfood", "pr-17105", "bin");
389var binaryPath = Path.Combine(binaryDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
391File.WriteAllText(Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"}""");
403Directory.CreateDirectory(Path.GetDirectoryName(staleFile)!);
412var socketDirectory = Path.GetDirectoryName(staleFile)!;
432Directory.CreateDirectory(Path.GetDirectoryName(matching)!);
441var socketDirectory = Path.GetDirectoryName(matching)!;
Utils\DevCertsCheckTests.cs (28)
68var certUtilPath = Path.Combine(directory.FullName, CertificateHelpers.CertUtilCommand);
81? Path.Combine(directory.FullName, "openssl.cmd")
82: Path.Combine(directory.FullName, "openssl");
116File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificatePem);
117File.WriteAllText(Path.Combine(trustDirectory.FullName, hashEntryName), certificatePem);
343["PATH"] = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N"))
406var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
450var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
501var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
556var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
557File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem());
606var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
607File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem());
665var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
666File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem());
722var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
723File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem());
764var trustDirectory = Path.Combine(tempDirectory.FullName, "missing-trust");
808var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
852var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
854File.WriteAllText(Path.Combine(trustDirectory.FullName, corruptCertificateFileName), "not a certificate");
898var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
900File.WriteAllText(Path.Combine(trustDirectory.FullName, corruptCertificateFileName), "not a certificate");
944var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
946File.WriteAllText(Path.Combine(trustDirectory.FullName, "unrelated.pem"), "not a certificate");
988var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust"));
989File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), staleCertificate.ExportCertificatePem());
1042["PATH"] = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N"))
Utils\FileSystemHelperTests.cs (68)
16var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
19File.WriteAllText(Path.Combine(sourceDir.FullName, "file1.txt"), "content1");
20File.WriteAllText(Path.Combine(sourceDir.FullName, "file2.txt"), "content2");
21File.WriteAllText(Path.Combine(sourceDir.FullName, "file3.cs"), "using System;");
28Assert.True(File.Exists(Path.Combine(destDir, "file1.txt")));
29Assert.True(File.Exists(Path.Combine(destDir, "file2.txt")));
30Assert.True(File.Exists(Path.Combine(destDir, "file3.cs")));
32Assert.Equal("content1", File.ReadAllText(Path.Combine(destDir, "file1.txt")));
33Assert.Equal("content2", File.ReadAllText(Path.Combine(destDir, "file2.txt")));
34Assert.Equal("using System;", File.ReadAllText(Path.Combine(destDir, "file3.cs")));
43var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
49File.WriteAllText(Path.Combine(sourceDir.FullName, "root.txt"), "root content");
50File.WriteAllText(Path.Combine(subDir1.FullName, "level1.txt"), "level 1 content");
51File.WriteAllText(Path.Combine(subDir2.FullName, "level2.txt"), "level 2 content");
58Assert.True(File.Exists(Path.Combine(destDir, "root.txt")));
59Assert.True(Directory.Exists(Path.Combine(destDir, "subdir1")));
60Assert.True(File.Exists(Path.Combine(destDir, "subdir1", "level1.txt")));
61Assert.True(Directory.Exists(Path.Combine(destDir, "subdir1", "subdir2")));
62Assert.True(File.Exists(Path.Combine(destDir, "subdir1", "subdir2", "level2.txt")));
64Assert.Equal("root content", File.ReadAllText(Path.Combine(destDir, "root.txt")));
65Assert.Equal("level 1 content", File.ReadAllText(Path.Combine(destDir, "subdir1", "level1.txt")));
66Assert.Equal("level 2 content", File.ReadAllText(Path.Combine(destDir, "subdir1", "subdir2", "level2.txt")));
75var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "empty_destination");
91var nonExistentSource = Path.Combine(workspace.WorkspaceRoot.FullName, "nonexistent");
92var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
104var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
128var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
153var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
156var binaryFilePath = Path.Combine(sourceDir.FullName, "binary.dat");
165var copiedFilePath = Path.Combine(destDir, "binary.dat");
178var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
185File.WriteAllText(Path.Combine(current.FullName, $"file{i}.txt"), $"content at level {i}");
195currentDest = Path.Combine(currentDest, $"level{i}");
197var filePath = Path.Combine(currentDest, $"file{i}.txt");
209var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
212File.WriteAllText(Path.Combine(sourceDir.FullName, "file1.txt"), "new content 1");
213File.WriteAllText(Path.Combine(sourceDir.FullName, "file2.txt"), "new content 2");
216File.WriteAllText(Path.Combine(subDir.FullName, "project.assets.json"), "new assets");
217File.WriteAllText(Path.Combine(subDir.FullName, "project.csproj.nuget.dgspec.json"), "new dgspec");
221File.WriteAllText(Path.Combine(destDir, "file1.txt"), "old content 1");
222File.WriteAllText(Path.Combine(destDir, "file2.txt"), "old content 2");
224var destSubDir = Directory.CreateDirectory(Path.Combine(destDir, "obj"));
225File.WriteAllText(Path.Combine(destSubDir.FullName, "project.assets.json"), "old assets");
226File.WriteAllText(Path.Combine(destSubDir.FullName, "project.csproj.nuget.dgspec.json"), "old dgspec");
232Assert.Equal("new content 1", File.ReadAllText(Path.Combine(destDir, "file1.txt")));
233Assert.Equal("new content 2", File.ReadAllText(Path.Combine(destDir, "file2.txt")));
234Assert.Equal("new assets", File.ReadAllText(Path.Combine(destDir, "obj", "project.assets.json")));
235Assert.Equal("new dgspec", File.ReadAllText(Path.Combine(destDir, "obj", "project.csproj.nuget.dgspec.json")));
244var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
247File.WriteAllText(Path.Combine(sourceDir.FullName, "file1.txt"), "new content");
251File.WriteAllText(Path.Combine(destDir, "file1.txt"), "old content");
284Assert.Equal(Path.Combine("folder1", "Project.csproj"), result[paths[0]]);
285Assert.Equal(Path.Combine("folder2", "Project.csproj"), result[paths[1]]);
299Assert.Equal(Path.Combine("folder1", "Project.csproj"), result[paths[0]]);
300Assert.Equal(Path.Combine("folder2", "Project.csproj"), result[paths[1]]);
314Assert.Equal(Path.Combine("a", "shared", "Project.csproj"), result[paths[0]]);
315Assert.Equal(Path.Combine("b", "shared", "Project.csproj"), result[paths[1]]);
325Assert.Equal(Path.Combine("MyApp", "AppHost.cs"), result[paths[0]]);
348Assert.Equal(Path.Combine("App1", "AppHost.cs"), result[paths[0]]);
362Assert.Equal(Path.Combine("App1", "AppHost.cs"), result[paths[0]]);
363Assert.Equal(Path.Combine("App2", "AppHost.cs"), result[paths[1]]);
377Assert.Equal(Path.Combine("a", "src", "AppHost.cs"), result[paths[0]]);
378Assert.Equal(Path.Combine("b", "src", "AppHost.cs"), result[paths[1]]);
393Assert.Equal(Path.Combine("App2", "AppHost.cs"), result[paths[1]]);
416Assert.Equal(Path.Combine("folder1", "Project.csproj"), result[paths[0]]);
417Assert.Equal(Path.Combine("folder2", "Project.csproj"), result[paths[1]]);
449Assert.Equal(Path.Combine("Folder", "Project.csproj"), result[paths[0]]);
450Assert.Equal(Path.Combine("folder", "Project.csproj"), result[paths[1]]);
Utils\LegacySettingsFileCheckTests.cs (17)
15var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
17await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}");
21var subDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src"));
43Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
60var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
62await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}");
64Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
83Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName),
88var subDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src"));
105var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
107await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}");
111var subDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyProject"));
131var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
133await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}");
136var childDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "project"));
139Path.Combine(childDir.FullName, AspireConfigFile.FileName),
143var workingDir = new DirectoryInfo(Path.Combine(childDir.FullName, "src"));
Utils\PathNormalizerTests.cs (20)
20var file = new FileInfo(Path.Combine(subdir.FullName, "app.csproj"));
41var file = new FileInfo(Path.Combine(directory.FullName, "App.csproj"));
43var caseVariantPath = Path.Combine(workspace.WorkspaceRoot.FullName, "mixedcase", "app.CSPROJ");
60var file = new FileInfo(Path.Combine(directory.FullName, "App.csproj"));
62var caseVariantPath = Path.Combine(workspace.WorkspaceRoot.FullName, "mixedcase", "app.CSPROJ");
77var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Missing", "App.csproj");
78var expectedPath = Path.Combine(
91var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "target.csproj"));
94var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "link.csproj");
116var file = new FileInfo(Path.Combine(nested.FullName, "app.csproj"));
119var linkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
124var pathThroughLink = Path.Combine(linkDirectory, "nested", "app.csproj");
137var missingTarget = Path.Combine(workspace.WorkspaceRoot.FullName, "missing.csproj");
138var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "broken-link.csproj");
156var projectFile = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj"));
159var linkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link");
162var linkPath = Path.Combine(linkDirectory, projectFile.Name);
176var file = new FileInfo(Path.Combine(tempDirectory.FullName, "AppHost.csproj"));
200var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Missing.AppHost", "Missing.AppHost.csproj");
204Assert.EndsWith(Path.Combine("Missing.AppHost", "Missing.AppHost.csproj"), resolved, StringComparison.Ordinal);
Utils\ReparsePointTests.cs (71)
16var target = Path.Combine(root, "real");
18File.WriteAllText(Path.Combine(target, "marker"), "hello");
20var link = Path.Combine(root, "link");
27Assert.Equal("hello", File.ReadAllText(Path.Combine(link, "marker")));
43var target1 = Path.Combine(root, "t1");
44var target2 = Path.Combine(root, "t2");
47File.WriteAllText(Path.Combine(target1, "id"), "one");
48File.WriteAllText(Path.Combine(target2, "id"), "two");
50var link = Path.Combine(root, "link");
52Assert.Equal("one", File.ReadAllText(Path.Combine(link, "id")));
58Assert.Equal("two", File.ReadAllText(Path.Combine(link, "id")));
77var real = Path.Combine(root, "link");
79File.WriteAllText(Path.Combine(real, "legacy"), "legacy");
81var target = Path.Combine(root, "target");
90Assert.True(File.Exists(Path.Combine(real, "legacy")));
97var dir = Path.Combine(workspace.WorkspaceRoot.FullName, "plain");
107Assert.False(ReparsePoint.IsReparsePoint(Path.Combine(workspace.WorkspaceRoot.FullName, "nope")));
116var target = Path.Combine(root, "target");
118var markerPath = Path.Combine(target, "keep");
121var link = Path.Combine(root, "link");
134var dir = Path.Combine(workspace.WorkspaceRoot.FullName, "plain");
135Directory.CreateDirectory(Path.Combine(dir, "nested"));
136File.WriteAllText(Path.Combine(dir, "nested", "f"), "x");
147ReparsePoint.RemoveIfExists(Path.Combine(workspace.WorkspaceRoot.FullName, "missing"));
156var link = Path.Combine(root, "bundle");
157var target = Path.Combine(root, "versions", "v1");
159var resolvedTarget = ReparsePoint.ResolveTargetPath(link, Path.Combine("versions", "v1"));
161Assert.Equal(Path.GetFullPath(target), resolvedTarget);
170var link = Path.Combine(root, "bundle");
173Directory.CreateSymbolicLink(link, Path.Combine("versions", "missing"));
210var target = Path.Combine(root, "real");
212File.WriteAllText(Path.Combine(target, "marker"), "hello");
214var link = Path.Combine(root, "junction");
223Assert.Equal("hello", File.ReadAllText(Path.Combine(link, "marker")));
241var target = Path.Combine(root, "real");
242var nestedDir = Path.Combine(target, "nested");
244File.WriteAllText(Path.Combine(nestedDir, "data.txt"), "payload");
246var link = Path.Combine(root, "junction");
254var nestedThroughLink = Path.Combine(link, "nested");
256Assert.Equal("payload", File.ReadAllText(Path.Combine(nestedThroughLink, "data.txt")));
260.Select(p => Path.GetFileName(p))
280var target = Path.Combine(root, "real");
282var markerPath = Path.Combine(target, "keep");
285var link = Path.Combine(root, "junction");
304var target = Path.Combine(root, "real");
307var link = Path.Combine(root, "junction");
318Path.GetFullPath(target).TrimEnd(Path.DirectorySeparatorChar),
319Path.GetFullPath(linkTarget!).TrimEnd(Path.DirectorySeparatorChar));
348var targetV1 = Path.Combine(root, "v1");
349var targetV2 = Path.Combine(root, "v2");
352File.WriteAllText(Path.Combine(targetV1, "id"), "one");
353File.WriteAllText(Path.Combine(targetV2, "id"), "two");
355var link = Path.Combine(root, "link");
362Assert.Equal("one", File.ReadAllText(Path.Combine(link, "id")));
372Assert.Equal("two", File.ReadAllText(Path.Combine(link, "id")));
377Path.GetFullPath(targetV2).TrimEnd(Path.DirectorySeparatorChar),
378Path.GetFullPath(resolvedTarget!).TrimEnd(Path.DirectorySeparatorChar));
382Assert.True(File.Exists(Path.Combine(targetV1, "id")));
404var probe = Path.Combine(root, "symlink-probe");
405var probeTarget = Path.Combine(root, "probe-target");
428var targetV1 = Path.Combine(root, "v1");
429var targetV2 = Path.Combine(root, "v2");
432File.WriteAllText(Path.Combine(targetV1, "id"), "one");
433File.WriteAllText(Path.Combine(targetV2, "id"), "two");
435var link = Path.Combine(root, "link");
453Assert.Equal("two", File.ReadAllText(Path.Combine(link, "id")));
456Assert.True(File.Exists(Path.Combine(targetV1, "id")));
Utils\TestExecutionContextHelper.cs (6)
61hivesDirectory ??= new DirectoryInfo(Path.Combine(root, ".aspire", "hives"));
62homeDirectory ??= new DirectoryInfo(Path.Combine(root, ".home"));
63var cacheDirectory = new DirectoryInfo(Path.Combine(root, ".aspire", "cache"));
64var sdksDirectory = new DirectoryInfo(Path.Combine(root, ".aspire", "sdks"));
65var logsDirectory = new DirectoryInfo(Path.Combine(root, ".aspire", "logs"));
66logFilePath ??= Path.Combine(logsDirectory.FullName, "test.log");
Aspire.Components.Common.TestUtilities (1)
Aspire.Dashboard (61)
ServiceClient\DashboardRunStore.cs (22)
133DatabasePath = Path.Combine(CurrentWorkingDirectory, DatabaseFileName);
140CurrentWorkingDirectory = Path.Combine(_runsDirectory, runId);
141DatabasePath = Path.Combine(CurrentWorkingDirectory, DatabaseFileName);
149File.WriteAllText(Path.Combine(CurrentWorkingDirectory, _applicationMarkerFileName), string.Empty);
157_metadataPath = Path.Combine(CurrentWorkingDirectory, "run.json");
162CurrentWorkingDirectory = Path.Combine(resumesDirectory, _applicationMarkerFileName);
163DatabasePath = Path.Combine(CurrentWorkingDirectory, DatabaseFileName);
205DatabaseFileName = Path.GetFileName(DatabasePath)
222!File.Exists(Path.Combine(directory, DatabaseFileName)))
311var runDirectory = Path.GetDirectoryName(storedRun.DatabasePath)!;
326var metadataPath = Path.Combine(runDirectory, "run.json");
382var runDirectory = Path.GetDirectoryName(storedRun.DatabasePath)!;
414if (!File.Exists(Path.Combine(directory, _applicationMarkerFileName)))
419var metadataPath = Path.Combine(directory, "run.json");
519var directory = Path.GetDirectoryName(run.DatabasePath)!;
547var metadataPath = Path.Combine(runDirectory, "run.json");
607Path.Combine(runDirectory, metadata.DatabaseFileName),
616return Path.Combine(GetResumesDirectory(dataRoot), GetApplicationDirectoryName(applicationName));
619internal static string GetRunsDirectory(string? dataRoot) => Path.Combine(GetDataRoot(dataRoot), "runs");
621internal static string GetResumesDirectory(string? dataRoot) => Path.Combine(GetDataRoot(dataRoot), "resumes");
623private static string GetDataRoot(string? dataRoot) => Path.GetFullPath(
625? Path.Combine(AspireHomeDirectory.GetDefault(), "dashboard")
Aspire.Dashboard.Components.Tests (9)
Aspire.Dashboard.Tests (98)
BlazorAssetsTests.cs (8)
14var imaskPath = Path.Combine(repoRoot, "src", "Aspire.Dashboard", "wwwroot", "js", "imask-7.6.1.min.js");
15var appPath = Path.Combine(repoRoot, "src", "Aspire.Dashboard", "Components", "App.razor");
33var appPath = Path.Combine(GetRepoRoot(), "src", "Aspire.Dashboard", "Components", "App.razor");
44var componentsPath = Path.Combine(GetRepoRoot(), "src", "Aspire.Dashboard", "Components");
48File.ReadAllText(Path.Combine(componentsPath, "Layout", "TerminalDock.razor.cs")),
52File.ReadAllText(Path.Combine(componentsPath, "Pages", "TerminalWindow.razor.cs")),
56File.ReadAllText(Path.Combine(componentsPath, "Controls", "TerminalWindowButton.razor.cs")),
63while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "Aspire.slnx")))
Model\DashboardDataSourceTests.cs (41)
40var expectedRunsDirectory = Path.Combine(workspace.Path, "runs");
42Assert.True(File.Exists(Path.Combine(runStore.CurrentWorkingDirectory, applicationDirectoryName)));
43Assert.False(Directory.Exists(Path.Combine(workspace.Path, applicationDirectoryName)));
55var expectedResumesDirectory = Path.Combine(workspace.Path, "resumes");
56Assert.Equal(Path.Combine(expectedResumesDirectory, applicationDirectoryName), runStore.CurrentWorkingDirectory);
57Assert.True(File.Exists(Path.Combine(expectedResumesDirectory, $"{applicationDirectoryName}.lock")));
64var expectedDirectory = Path.Combine(
120Assert.Equal(runStore.RunId, Path.GetFileName(runStore.CurrentWorkingDirectory));
142var metadataPath = Path.Combine(runStore.CurrentWorkingDirectory, "run.json");
176using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(runStore.CurrentWorkingDirectory, "run.json")));
199metadataPath = Path.Combine(historicalRunStore.CurrentWorkingDirectory, "run.json");
256using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(currentRunStore.CurrentWorkingDirectory, "run.json")));
284Assert.False(File.Exists(Path.Combine(runStore.CurrentWorkingDirectory, "run.json")));
403File.WriteAllText(Path.Combine(abandonedDirectory, "dashboard.db"), string.Empty);
425var temporaryRoot = Path.GetTempPath();
426var abandonedLockPath = Path.Combine(temporaryRoot, $"aspire-dashboard-{Guid.NewGuid():N}.lock");
427var activeLockPath = Path.Combine(temporaryRoot, $"aspire-dashboard-{Guid.NewGuid():N}.lock");
428var unrelatedLockPath = Path.Combine(temporaryRoot, $"unrelated-{Guid.NewGuid():N}.lock");
507File.WriteAllText(Path.Combine(otherDirectory, "dashboard.db"), string.Empty);
648var databasePath = Path.Combine(workspace.Path, $"malformed-{Guid.NewGuid():N}.db");
755var metadataPath = Path.Combine(incompatibleRunDirectory, "run.json");
796var metadataPath = Path.Combine(futureRunDirectory, "run.json");
840var metadataPath = Path.Combine(incompatibleRunDirectory, "run.json");
858var runsDirectory = Path.GetDirectoryName(currentRunStore.CurrentWorkingDirectory)!;
936var runsDirectory = Path.GetDirectoryName(currentRunStore.CurrentWorkingDirectory)!;
951var abandonedLockPath = Path.Combine(runsDirectory, "abandoned.lock");
952var activeLockPath = Path.Combine(runsDirectory, "active.lock");
1036pinnedRunDirectories.Add(Path.GetDirectoryName(run.DatabasePath)!);
1038using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(pinnedRunDirectories[^1], "run.json")));
1082var runsDirectory = Path.GetDirectoryName(currentRunStore.CurrentWorkingDirectory)!;
1213using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(Path.GetDirectoryName(historicalRun.DatabasePath)!, "run.json")));
1295var malformedRunDirectory = Path.GetDirectoryName(malformedDatabasePath)!;
1307var historicalDirectory = Path.Combine(workspace.Path, "historical");
1308var historicalDatabasePath = Path.Combine(historicalDirectory, DashboardRunStore.DatabaseFileName);
1313var malformedDirectory = Path.Combine(workspace.Path, "malformed");
1314var malformedDatabasePath = Path.Combine(malformedDirectory, DashboardRunStore.DatabaseFileName);
1340DatabasePath = Path.Combine(workspace.Path, "unavailable", DashboardRunStore.DatabaseFileName),
1373var database = new DashboardSqliteDatabase(Path.Combine(workspace.Path, "connection.db"));
1542DatabasePath = Path.Combine(workspace.Path, "incompatible", DashboardRunStore.DatabaseFileName),
1676var runDirectory = Path.GetDirectoryName(run.DatabasePath)!;
Model\DashboardSqliteDatabaseTests.cs (11)
27using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
38var databasePath = Path.Combine(_workspace.Path, "dashboard.db");
56using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
74using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
106using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
129using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
146using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
165using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
185using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false);
206using var observedDatabase = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "observed.db"), pooling: false);
207using var otherDatabase = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "other.db"), pooling: false);
Aspire.Deployment.EndToEnd.Tests (204)
AcaExpressDeploymentTests.cs (7)
58var projectDirectory = Path.Combine(workspace.Path, ProjectName);
182var appHostPath = Path.Combine(projectDirectory, "apphost.cs");
210File.Delete(Path.Combine(projectDirectory, "Api", "Properties", "launchSettings.json"));
211File.Delete(Path.Combine(projectDirectory, "Frontend", "Properties", "launchSettings.json"));
212File.WriteAllText(Path.Combine(projectDirectory, "Api", "Program.cs"), $$"""
228File.WriteAllText(Path.Combine(projectDirectory, "Frontend", "Program.cs"), """
331var summary = File.ReadAllText(Path.Combine(projectDirectory, DeploymentLogFile));
AcaStarterDeploymentTests.cs (6)
105var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
106var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost");
107var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
135DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(projectDir, $"{projectName}.ApiService", "Program.cs"),
140DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(projectDir, $"{projectName}.Web", "Program.cs"),
174var frontendUrlFile = Path.Combine(projectDir, "frontend-url.txt");
AppServiceDotnetProjectDeploymentTests.cs (6)
37var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
38var appHostFile = Path.Combine(projectDir, $"{projectName}.AppHost", "AppHost.cs");
46DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(projectDir, $"{projectName}.Server", "Program.cs"),
53var publicDir = Directory.CreateDirectory(Path.Combine(projectDir, "frontend", "public"));
54File.WriteAllText(Path.Combine(publicDir.FullName, "deployment-marker.txt"), $"static:{marker}");
64var urlFile = Path.Combine(projectDir, "server-url.txt");
AzureSandboxesDeploymentTests.cs (19)
59var defaultUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-default-url.txt");
60var anonymousUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-anonymous-url.txt");
61var deployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-deploy-output.txt");
62var stateMarkerFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-state-marker");
248var firstDeployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "first-deploy-output.txt");
249var secondDeployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "second-deploy-output.txt");
250var firstUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "first-url.txt");
251var secondUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "second-url.txt");
252var stateMarkerFile = Path.Combine(workspace.WorkspaceRoot.FullName, "state-marker");
419var siteDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "site"));
420File.WriteAllText(Path.Combine(siteDir.FullName, "Dockerfile"), """
425File.WriteAllText(Path.Combine(siteDir.FullName, "index.html"), $$"""
433File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), """
465var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
466var appHostFilePath = Path.Combine(projectDir, "apphost.cs");
511var serviceDir = Path.Combine(projectDir, serviceName);
512var propertiesDir = Directory.CreateDirectory(Path.Combine(serviceDir, "Properties"));
558File.WriteAllText(Path.Combine(serviceDir, "Program.cs"), program);
559File.WriteAllText(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """
FoundryHostedAgentDeploymentTests.cs (8)
97var appHostFilePath = Path.Combine(
756var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName);
757var hostedAgentDir = Path.Combine(projectDir, "DotNetHostedAgent");
758var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost");
768File.WriteAllText(Path.Combine(hostedAgentDir, "DotNetHostedAgent.csproj"), """
792File.WriteAllText(Path.Combine(hostedAgentDir, "Program.cs"), """
864File.WriteAllText(Path.Combine(hostedAgentDir, ".dockerignore"), """
883var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
Helpers\DeploymentE2ETestHelpers.cs (3)
199candidates.Add(Path.Combine(home, ".aspire", "dogfood", $"pr-{prNumber}", "bin", "aspire"));
202candidates.Add(Path.Combine(home, ".aspire", "bin", "aspire"));
203candidates.Add(Path.Combine(home, ".aspire", "aspire"));
TypeScriptJavaScriptHostingDeploymentTests.cs (7)
123var apiDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "api"));
124File.WriteAllText(Path.Combine(apiDir.FullName, "package.json"), """
134File.WriteAllText(Path.Combine(apiDir.FullName, "server.js"), """
144var staticSiteDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "staticsite"));
145File.WriteAllText(Path.Combine(staticSiteDir.FullName, "package.json"), """
155File.WriteAllText(Path.Combine(staticSiteDir.FullName, "index.html"), """
168File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), """
Aspire.EndToEnd.Tests (61)
tests\Shared\TemplatesTesting\AspireProject.cs (21)
23Path.Combine(BuildEnvironment.TestAssetsPath, "nuget8.config");
32public string ServiceDefaultsProjectPath => Path.Combine(RootDir, $"{Id}.ServiceDefaults");
33public string TestsProjectDirectory => Path.Combine(RootDir, $"{Id}.Tests");
48LogPath = Path.Combine(_buildEnv.LogRootPath, Id);
50AppHostProjectDirectory = Path.Combine(RootDir, $"{Id}.AppHost");
65File.WriteAllText(Path.Combine(dir, "Directory.Build.props"), "<Project />");
66File.WriteAllText(Path.Combine(dir, "Directory.Build.targets"), "<Project />");
72string targetNuGetConfigPath = Path.Combine(dir, "nuget.config");
93projectDir = Path.Combine(rootDir, id);
97rootDir = projectDir = Path.Combine(BuildEnvironment.TestRootPath, id);
100string logPath = Path.Combine(BuildEnvironment.ForDefaultFramework.LogRootPath, id);
107File.WriteAllText(Path.Combine(rootDir, "Directory.Build.props"), "<Project />");
108File.WriteAllText(Path.Combine(rootDir, "Directory.Build.targets"), "<Project />");
115cmd.WithWorkingDirectory(Path.GetDirectoryName(projectDir)!)
153File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "EndPointWriterHook_cs"), Path.Combine(project.AppHostProjectDirectory, "EndPointWriterHook.cs"));
154string programCsPath = Path.Combine(project.AppHostProjectDirectory, "AppHost.cs");
253_testOutput.WriteLine($"----------- [{Path.GetFileName(AppHostProjectDirectory)}] app has exited -------------");
332workingDirectory ??= Path.Combine(RootDir, $"{Id}.AppHost");
336var res = await restoreCmd.ExecuteAsync($"restore \"-bl:{Path.Combine(LogPath!, $"{Id}-restore.binlog")}\" /p:TreatWarningsAsErrors=true");
339var buildArgs = $"build \"-bl:{Path.Combine(LogPath!, $"{Id}-build.binlog")}\" /p:TreatWarningsAsErrors=true";
tests\Shared\TemplatesTesting\BuildEnvironment.cs (23)
25? Path.GetTempPath()
26: Environment.GetEnvironmentVariable("DEV_TEMP") is { } devTemp && Path.Exists(devTemp)
28: Path.GetTempPath();
31public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets");
32public static readonly string TestRootPath = Path.Combine(TempDir, "templates-testroot");
82var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName);
85sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath);
90string workloadsProjString = Path.Combine("tests", "workloads.proj");
101.Split(Path.PathSeparator)
102.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
108sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
114BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping");
124.Split(Path.PathSeparator)
125.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
131sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
141string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath);
147sdkForTemplatePath = Path.Combine(baseDir, sdkDirName);
162sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath);
168NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null;
176EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}";
200DotNet = Path.Combine(sdkForTemplatePath!, "dotnet");
208LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath);
213LogRootPath = Path.Combine(AppContext.BaseDirectory, "logs");
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (10)
29? Path.Combine(Path.GetTempPath(), $"templates-${s_tmpDirSuffix}")
30: Path.Combine(AppContext.BaseDirectory, "templates");
31_customHiveDirectory = Path.Combine(customHiveBaseDirectory, customHiveDirName);
32_stampFilePath = Path.Combine(_customHiveDirectory, ".stamp-installed");
87.Where(p => packageNameRegex.IsMatch(Path.GetFileName(p)));
91throw new ArgumentException($"Cannot find {templatePackageId}*.nupkg in {builtNuGetsPath}. Packages found in {builtNuGetsPath}: {string.Join(", ", Directory.EnumerateFiles(builtNuGetsPath).Select(Path.GetFileName))}");
95throw new ArgumentException($"Found more than one {templatePackageId}*.nupkg in {builtNuGetsPath}: {string.Join(", ", packages.Select(Path.GetFileName))}");
104? Path.GetTempPath()
105: Path.Combine(BuildEnvironment.TempDir, "templates", "working"); // avoid running from the repo
Aspire.Hosting (256)
Dcp\ExecutableConfigurationResolver.cs (17)
39var bundleOutputPath = Path.Join(certificatesRootDirectory, "cert.pem");
40var customBundleOutputPath = Path.Join(certificatesRootDirectory, "bundles");
41var certificatesOutputPath = Path.Join(certificatesRootDirectory, "certs");
42var baseServerAuthOutputPath = Path.Join(certificatesRootDirectory, "private");
57Path.PathSeparator,
73CertificateDirectoriesPath = ReferenceExpression.Create($"{string.Join(Path.PathSeparator, directories)}"),
79CertificatePath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.crt")}"),
80KeyPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.key")}"),
81CertificateWithKeyPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.pem")}"),
82PfxPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.pfx")}"),
109File.WriteAllBytes(Path.Join(customBundleOutputPath, bundleFactory.Key), bundleBytes);
125File.WriteAllText(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.crt"), publicCertificatePem);
130File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.key"), keyBytes);
134Path.Join(baseServerAuthOutputPath, $"{thumbprint}.pem"),
144File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.pfx"), pfxBytes);
174return Path.Join(_aspireStore.BasePath, "dcp", "executables", executable.Metadata.Name, "certificates");
177return Path.Join(_locations.DcpSessionDir, executable.Metadata.Name);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Aspire.Hosting.Analyzers (2)
Aspire.Hosting.Analyzers.Tests (1)
Aspire.Hosting.Azure (20)
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Hosting.Azure.Functions (11)
Aspire.Hosting.Azure.Kubernetes (1)
Aspire.Hosting.Azure.Kubernetes.Tests (6)
Aspire.Hosting.Azure.Kusto (2)
Aspire.Hosting.Azure.Kusto.Tests (3)
Aspire.Hosting.Azure.PostgreSQL (2)
Aspire.Hosting.Azure.Provisioning.Tests (2)
Aspire.Hosting.Azure.Sandboxes (5)
Aspire.Hosting.Azure.Sql (2)
Aspire.Hosting.Azure.Storage (2)
Aspire.Hosting.Azure.Tests (71)
AzureEnvironmentResourceTests.cs (22)
38var mainBicepPath = Path.Combine(workspace.FullName, "main.bicep");
42var envBicepPath = Path.Combine(workspace.FullName, "env", "env.bicep");
75var mainBicepPath = Path.Combine(workspace.FullName, "main.bicep");
126var mainBicepPath = Path.Combine(workspace.FullName, "main.bicep");
174var mainBicep = File.ReadAllText(Path.Combine(workspace.FullName, "main.bicep"));
175var storageBicep = File.ReadAllText(Path.Combine(workspace.FullName, "storage", "storage.bicep"));
203var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep"));
248var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep"));
264var outputPath = Path.Combine(workspace.Path, "exclude-main");
273Assert.False(File.Exists(Path.Combine(outputPath, "main.bicep")));
274Assert.True(File.Exists(Path.Combine(outputPath, "mod", "mod.bicep")));
293var outputPath = Path.Combine(workspace.Path, "write-main");
303Assert.True(File.Exists(Path.Combine(outputPath, "mod", "mod.bicep")));
309var mainBicep = await File.ReadAllTextAsync(Path.Combine(outputPath, "main.bicep"));
367var mainBicepPath = Path.Combine(workspace.Path, "main.bicep");
372var includedStorageBicepPath = Path.Combine(workspace.Path, "included-storage", "included-storage.bicep");
376var excludedStorageBicepPath = Path.Combine(workspace.Path, "excluded-storage", "excluded-storage.bicep");
398var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile");
425var bicepFilePath = Path.Combine(workspace, bicepFileName);
444var outputDir = Path.Combine(workspace, "output");
461var mainBicepPath = Path.Combine(outputDir, "main.bicep");
464var resourceBicepPath = Path.Combine(outputDir, "custom-resource", "custom-resource.bicep");
Aspire.Hosting.Blazor (35)
BlazorGatewayExtensions.cs (23)
60var gatewayDir = Path.GetDirectoryName(gatewayPath)!;
200new(CustomResourceKnownProperties.Source, Path.GetFileName(projectPath))
216var resolvedPath = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, projectPath));
224new(CustomResourceKnownProperties.Source, Path.GetFileName(resolvedPath))
381var gatewayOutputRoot = Path.Combine(
418var outputDir = Path.Combine(gatewayOutputRoot, "output");
437var mergedRuntimePath = Path.Combine(outputDir, "merged.staticwebassets.runtime.json");
457var projectDir = Path.GetDirectoryName(projectPath)!;
459var relativeProjectPath = Path.GetRelativePath(solutionRoot, projectDir)
483var relativePath = Path.GetRelativePath(parentPath, childPath);
484return !Path.IsPathRooted(relativePath)
486&& !relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal);
603var destEndpoints = Path.Combine(outputDir, $"{reg.Resource.Name}.endpoints.json");
625var relativeProjectPath = Path.GetRelativePath(
631var scriptDest = Path.Combine(project.SolutionRoot, ".aspire", "scripts", "PrefixEndpoints.cs");
632Directory.CreateDirectory(Path.GetDirectoryName(scriptDest)!);
634var scriptRelativePath = Path.GetRelativePath(project.SolutionRoot, scriptDest)
678var projectDirectory = Path.GetDirectoryName(relativeProjectPath)?.Replace('\\', '/');
679var projectFileName = Path.GetFileName(relativeProjectPath);
733var assemblyDir = Path.GetDirectoryName(typeof(BlazorGatewayExtensions).Assembly.Location)!;
734var scriptPath = Path.Combine(assemblyDir, "Scripts", scriptName);
755return Path.Combine(storePath, ".aspire", "blazor");
Aspire.Hosting.Blazor.Tests (58)
AddBlazorGatewayTests.cs (31)
37Path.Combine("Scripts", "Gateway.cs"),
170var clientDirectory = Path.Combine(directory.Path, "Client");
172await File.WriteAllTextAsync(Path.Combine(clientDirectory, "global.json"),
174File.Copy(Path.Combine(clientDirectory, "global.json"), Path.Combine(directory.Path, "global.json"));
176Path.Combine(Path.GetDirectoryName(typeof(BlazorGatewayExtensions).Assembly.Location)!, "Scripts", "PrefixEndpoints.cs"));
177await File.WriteAllTextAsync(Path.Combine(directory.Path, "PrefixEndpoints.cs"),
190await File.WriteAllTextAsync(Path.Combine(directory.Path, "Dockerfile"), dockerfile);
209var clientDirectory = Path.Combine(directory.Path, "Client");
211await File.WriteAllTextAsync(Path.Combine(directory.Path, "Test.slnx"), "<Solution />");
219var client = publishBuilder.AddBlazorWasmApp("app", Path.Combine(clientDirectory, "Client.csproj"))
228var gatewayDirectory = Directory.CreateDirectory(Path.Combine(directory.Path, "Gateway")).FullName;
230await File.WriteAllTextAsync(Path.Combine(gatewayDirectory, "Gateway.cs"),
231restoreDirective + await File.ReadAllTextAsync(Path.Combine(gatewayBuild.ContextPath, "Gateway.cs")));
233gatewayContainer.Annotations.Add(new DockerfileBuildAnnotation(gatewayDirectory, Path.Combine(gatewayDirectory, "Dockerfile"), stage: null)
239var prefixScriptPath = Path.Combine(directory.Path, ".aspire", "scripts", "PrefixEndpoints.cs");
335Directory.CreateDirectory(Path.Combine(clientDirectory, "wwwroot"));
336await File.WriteAllTextAsync(Path.Combine(clientDirectory, "Client.csproj"),
348await File.WriteAllTextAsync(Path.Combine(clientDirectory, "Program.cs"),
353await File.WriteAllTextAsync(Path.Combine(clientDirectory, "wwwroot", "index.html"),
383var projectPath = Path.Combine(directory.FullName, "Client.csproj");
417var projectPath = Path.Combine(directory.Path, "Client.csproj");
435File.WriteAllText(Path.Combine(solutionRoot.FullName, "Test.slnx"), "<Solution />");
436var appHostDirectory = Directory.CreateDirectory(Path.Combine(solutionRoot.FullName, "src", "AppHost")).FullName;
438var projectDirectory = Directory.CreateDirectory(Path.Combine(solutionRoot.FullName, "src", "Client")).FullName;
454var appHostDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "AppHost")).FullName;
456var projectDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "Client")).FullName;
475var appHostDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "AppHost")).FullName;
476File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.slnx"), "<Solution />");
477var projectDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "Client")).FullName;
EndpointsManifestTransformerTests.cs (13)
15_tempDir = Path.Combine(Path.GetTempPath(), "BlazorHostingTests", Guid.NewGuid().ToString("N"));
39var manifestPath = Path.Combine(_tempDir, "endpoints.json");
64var manifestPath = Path.Combine(_tempDir, "endpoints.json");
123var manifestPath = Path.Combine(_tempDir, "endpoints.json");
167var manifestPath = Path.Combine(_tempDir, "endpoints.json");
200var manifestPath = Path.Combine(_tempDir, "endpoints.json");
258var app1Path = Path.Combine(_tempDir, "app1.runtime.json");
259var app2Path = Path.Combine(_tempDir, "app2.runtime.json");
273var outputPath = Path.Combine(_tempDir, "merged.json");
322var app1Path = Path.Combine(_tempDir, "app1.runtime.json");
323var app2Path = Path.Combine(_tempDir, "app2.runtime.json");
337var outputPath = Path.Combine(_tempDir, "merged.json");
Aspire.Hosting.Browsers (44)
BrowserUserDataPathResolver.cs (10)
59BrowserUserDataMode.Shared => Path.Combine(root, "shared", browserSegment),
60BrowserUserDataMode.Isolated => Path.Combine(root, "isolated", GetAppHostSegment(configuration), browserSegment),
76return Path.Combine(
84return Path.Combine(
97: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share");
98return Path.Combine(dataHome, "aspire", "browser-data");
122var name = Path.IsPathRooted(browser) || Path.IsPathFullyQualified(browser)
123? Path.GetFileNameWithoutExtension(browser)
138var invalidChars = Path.GetInvalidFileNameChars();
ChromiumBrowserResolver.cs (12)
24if (Path.IsPathRooted(browser) && File.Exists(browser))
33if (Path.IsPathRooted(candidate))
80var localStatePath = Path.Combine(userDataDirectory, "Local State");
136if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)) ||
166var localStatePath = Path.Combine(userDataDirectory, "Local State");
196var directoryName = Path.GetFileName(directoryPath);
241Path.Combine(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"),
242Path.Combine(programFiles, "Microsoft", "Edge", "Application", "msedge.exe"),
247Path.Combine(programFilesX86, "Google", "Chrome", "Application", "chrome.exe"),
248Path.Combine(programFiles, "Google", "Chrome", "Application", "chrome.exe"),
267var directoryName = Path.GetFileName(directoryPath);
292if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)))
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Hosting.Browsers.Tests (80)
BrowserLogsSessionManagerTests.cs (27)
25var executablePath = Path.Combine(userDataDirectory, "browser");
27var identityWithTrailingSeparator = new BrowserHostIdentity(executablePath, userDataDirectory + Path.DirectorySeparatorChar);
64var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser");
104var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser");
139var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser");
173var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser");
259Path.Combine(userDataDirectory.FullName, "browser"),
289Path.Combine(userDataDirectory.FullName, "bröwser"),
319Path.Combine(userDataDirectory.FullName, "browser"),
352Path.Combine(userDataDirectory.FullName, "browser"),
382Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1"));
395Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default"));
396Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1"));
398Path.Combine(userDataDirectory, "Local State"),
425Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default"));
426Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1"));
427Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 2"));
428Directory.CreateDirectory(Path.Combine(userDataDirectory, "System Profile"));
430Path.Combine(userDataDirectory, "Local State"),
480Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default"));
481Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1"));
482File.WriteAllText(Path.Combine(userDataDirectory, "Local State"), "{");
508Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default"));
509Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1"));
511Path.Combine(userDataDirectory, "Local State"),
631Path.Combine(AppContext.BaseDirectory, "browser"),
632Path.Combine(AppContext.BaseDirectory, "user-data")),
src\Aspire.Hosting.Browsers\BrowserUserDataPathResolver.cs (10)
59BrowserUserDataMode.Shared => Path.Combine(root, "shared", browserSegment),
60BrowserUserDataMode.Isolated => Path.Combine(root, "isolated", GetAppHostSegment(configuration), browserSegment),
76return Path.Combine(
84return Path.Combine(
97: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share");
98return Path.Combine(dataHome, "aspire", "browser-data");
122var name = Path.IsPathRooted(browser) || Path.IsPathFullyQualified(browser)
123? Path.GetFileNameWithoutExtension(browser)
138var invalidChars = Path.GetInvalidFileNameChars();
src\Aspire.Hosting.Browsers\ChromiumBrowserResolver.cs (12)
24if (Path.IsPathRooted(browser) && File.Exists(browser))
33if (Path.IsPathRooted(candidate))
80var localStatePath = Path.Combine(userDataDirectory, "Local State");
136if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)) ||
166var localStatePath = Path.Combine(userDataDirectory, "Local State");
196var directoryName = Path.GetFileName(directoryPath);
241Path.Combine(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"),
242Path.Combine(programFiles, "Microsoft", "Edge", "Application", "msedge.exe"),
247Path.Combine(programFilesX86, "Google", "Chrome", "Application", "chrome.exe"),
248Path.Combine(programFiles, "Google", "Chrome", "Application", "chrome.exe"),
267var directoryName = Path.GetFileName(directoryPath);
292if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)))
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Hosting.CodeGeneration.Go (2)
Aspire.Hosting.CodeGeneration.Go.Tests (2)
Aspire.Hosting.CodeGeneration.Java (4)
Aspire.Hosting.CodeGeneration.Java.Tests (23)
JavaLanguageSupportDetectionTests.cs (10)
25var expected = relativePath.Replace('/', Path.DirectorySeparatorChar);
26var appHostPath = Path.Combine(workspace.Path, expected);
27Directory.CreateDirectory(Path.GetDirectoryName(appHostPath)!);
46File.WriteAllText(Path.Combine(workspace.Path, "AppHost.java"), "void main(String[] args) { }");
47var nested = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java"));
48File.WriteAllText(Path.Combine(nested.FullName, "AppHost.java"), "void main(String[] args) { }");
57File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />");
75var path = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar));
76Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Aspire.Hosting.CodeGeneration.Python (3)
Aspire.Hosting.CodeGeneration.Python.Tests (4)
Aspire.Hosting.CodeGeneration.Rust (2)
Aspire.Hosting.CodeGeneration.Rust.Tests (13)
RustLanguageSupportTests.cs (5)
42File.WriteAllText(Path.Combine(workspace.Path, "apphost.rs"), "// marker");
43File.WriteAllText(Path.Combine(workspace.Path, "Cargo.toml"), "[package]");
57File.WriteAllText(Path.Combine(workspace.Path, "apphost.ts"), "// typescript");
58File.WriteAllText(Path.Combine(workspace.Path, "Cargo.toml"), "[package]");
70File.WriteAllText(Path.Combine(workspace.Path, "apphost.rs"), "// marker");
Aspire.Hosting.CodeGeneration.TypeScript (5)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (13)
Aspire.Hosting.Containers.Tests (17)
Aspire.Hosting.DevTunnels (2)
Aspire.Hosting.DevTunnels.Tests (2)
Aspire.Hosting.Docker (20)
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Hosting.Docker.Tests (66)
DockerComposePublisherTests.cs (50)
100var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
101var envPath = Path.Combine(workspace.Path, ".env");
123var compose = File.ReadAllText(Path.Combine(workspace.Path, "docker-compose.yaml"));
161var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
162var envPath = Path.Combine(workspace.Path, ".env");
184var compose = File.ReadAllText(Path.Combine(workspace.Path, "docker-compose.yaml"));
185var environment = File.ReadAllText(Path.Combine(workspace.Path, ".env"));
209var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
238var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
289var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
291var envPath = Path.Combine(workspace.Path, ".env");
302var envFilePath = Path.Combine(workspace.Path, ".env");
333var envFilePath = Path.Combine(workspace.Path, ".env");
388var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
414var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
446var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
477var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
505var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
539var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
563var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
591var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
621var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
650var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
682var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
707var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile");
731var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
758var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production"));
787var envFilePath = Path.Combine(workspace.Path, ".env.Staging");
821var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production"));
843var envFilePath = Path.Combine(workspace.Path, ".env.Production");
877var envFilePath = Path.Combine(workspace.Path, ".env.Staging");
910var composeContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml"));
911var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production"));
943var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production"));
969var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production"));
994var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
995var envPath = Path.Combine(workspace.Path, ".env");
1021var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1052var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1053var envPath = Path.Combine(workspace.Path, ".env");
1080var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1104envVar.DefaultValue = "./" + Path.GetFileName(mount.Source);
1116var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1117var envPath = Path.Combine(workspace.Path, ".env");
1164var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1165var envPath = Path.Combine(workspace.Path, ".env");
1198var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1199var envPath = Path.Combine(workspace.Path, ".env");
1242var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
1276var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
Aspire.Hosting.Dotnet (59)
DotnetProjectBuildArtifactManager.cs (11)
55var coordinationLockPath = Path.Combine(BuildDirectory, ".coordination.lock");
164Path.Combine(BuildDirectory, $"{BuildProjectFilePrefix}{hash}{BuildProjectFileExtension}");
167Path.Combine(GetStateDirectory(), $"{hash}{StateFileExtension}");
180var temporaryPath = Path.Combine(BuildDirectory, $".{Path.GetRandomFileName()}.tmp");
227var fileName = Path.GetFileName(buildProjectPath);
318var hash = Path.GetFileNameWithoutExtension(statePath);
427var temporaryPath = Path.Combine(stateDirectory, $".{Path.GetRandomFileName()}.tmp");
455Path.Combine(BuildDirectory, ".leases", "v1", hash);
458Path.Combine(BuildDirectory, ".artifacts", "v1");
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Aspire.Hosting.Dotnet.Tests (239)
DotnetProjectBuildArtifactManagerTests.cs (14)
18var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
45var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
56Directory.Delete(Path.Combine(buildDirectory, ".artifacts"), recursive: true);
78var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
114var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
139var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
146Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(statePath)!, ".*.tmp"));
153var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
168var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build");
169var stateDirectory = Path.Combine(buildDirectory, ".artifacts", "v1");
174Path.Combine(buildDirectory, ".old.tmp"),
175Path.Combine(stateDirectory, ".old.tmp"),
179Path.Combine(buildDirectory, ".recent.tmp"),
180Path.Combine(stateDirectory, ".recent.tmp"),
DotnetProjectBuildCoordinatorTests.cs (159)
42var apiPath = Path.Combine(builder.AppHostDirectory, "Api", "Api.csproj");
43var workerPath = Path.Combine(builder.AppHostDirectory, "Worker", "Worker.csproj");
80Path.Combine(builder.Configuration["Aspire:Store:Path"]!, ".aspire", "build"),
132var globalJsonPath = Path.Combine(workspace.Path, "global.json");
204var firstDotnetPath = Path.Combine(workspace.Path, "first-sdk");
205var secondDotnetPath = Path.Combine(workspace.Path, "second-sdk");
374var hash = Path.GetFileNameWithoutExtension(buildProjectPath)["projects.".Length..];
409var filePath = Path.Combine(workspace.Path, "worker.cs");
480var fileDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "worker"));
481var filePath = Path.Combine(fileDirectory.FullName, "worker.cs");
570var firstSentinel = Path.Combine(workspace.Path, "first-ran.txt");
571var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt");
636var appPath = Path.Combine(workspace.Path, "worker.cs");
637var sentinelPath = Path.Combine(workspace.Path, "worker-ran.txt");
689var projectPath = Path.Combine(builder.AppHostDirectory, "Api", "Api.csproj");
736NormalizeBuildProjectPath(Path.GetRelativePath(buildResource.BuildDirectory, firstProject)).Replace("'", "%27", StringComparison.Ordinal),
740NormalizeBuildProjectPath(Path.GetRelativePath(buildResource.BuildDirectory, secondProject)),
753var customTargetsPath = Path.Combine(workspace.Path, "CustomNuGet.targets");
764Path.Combine(workspace.Path, "obj", ".aspire", "build"),
817Path.Combine(workspace.Path, "obj", ".aspire", "build"),
827var missingTargetsPath = Path.Combine(workspace.Path, "missing", "NuGet.targets");
855Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(projectPath)!, "restore-ran.txt")));
864var aspireStoreRoot = Path.Combine(workspace.Path, "custom-obj");
873Assert.Equal(Path.Combine(aspireStoreRoot, ".aspire", "build"), buildResource.BuildDirectory);
883var buildDirectory = Path.Combine(workspace.Path, "obj", ".aspire", "build");
923Assert.Equal(Path.GetDirectoryName(projectPath), buildResource.WorkingDirectory);
936var feed = Directory.CreateDirectory(Path.Combine(projectRoot, "feed")).FullName;
939var feedSource = new Uri(feed + Path.DirectorySeparatorChar).AbsoluteUri;
942File.WriteAllText(Path.Combine(projectRoot, "nuget.config"), $$"""
950File.WriteAllText(Path.Combine(projectRoot, "Directory.Build.props"), """
962var versionsPath = Path.Combine(projectRoot, "Directory.Packages.props");
999var escapedDirectory = Path.Combine(projectRoot, "First's Project;100% (test)");
1000Directory.Move(Path.GetDirectoryName(firstProject)!, escapedDirectory);
1001firstProject = Path.Combine(escapedDirectory, Path.GetFileName(firstProject));
1005Path.Combine(workspace.Path, "obj", ".aspire", "build"),
1019File.ReadAllText(Path.Combine(Path.GetDirectoryName(project)!, "package-version.txt")));
1020Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(project)!, "packages.lock.json")));
1023Path.Combine(Path.GetDirectoryName(sharedProject)!, "obj", "project.assets.json"))))
1038File.ReadAllText(Path.Combine(Path.GetDirectoryName(project)!, "package-version.txt")));
1046File.ReadAllText(Path.Combine(Path.GetDirectoryName(project)!, "package-version.txt")));
1059Path.Combine(workspace.Path, "obj", ".aspire", "build"),
1062var caseVariantPath = Path.Combine(workspace.Path, "service", "app.CSPROJ");
1091var aspireStoreRoot = Path.Combine(workspace.Path, "custom-obj");
1108Path.Combine(aspireStoreRoot, ".aspire", "build"),
1122Assert.Equal(Path.GetDirectoryName(workerPath), directBuild.WorkingDirectory);
1558var appPath = Path.Combine(workspace.Path, "app.cs");
1685Assert.Equal(Path.GetDirectoryName(projectPath), launchConfiguration.BuildWorkingDirectory);
2017var projectDirectory = Path.GetDirectoryName(projectPath)!;
2018var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime")).FullName;
2019var sdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime")).FullName;
2066var projectDirectory = Path.GetDirectoryName(projectPath)!;
2067var firstSdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime-1")).FullName;
2068var secondSdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime-2")).FullName;
2110var sourceRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "source")).FullName;
2111File.WriteAllText(Path.Combine(sourceRoot, "global.json"), "{}");
2114var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime")).FullName;
2136Directory.CreateDirectory(Path.Combine(workspace.Path, "source")).FullName,
2139var projectDirectory = Path.GetDirectoryName(projectPath)!;
2140var foreignRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "foreign")).FullName;
2141File.WriteAllText(Path.Combine(foreignRoot, "global.json"), "{}");
2142var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(foreignRoot, "runtime")).FullName;
2221var filePath = Path.Combine(workspace.Path, "worker.cs");
2272File.WriteAllText(Path.Combine(Path.GetDirectoryName(firstPath)!, "global.json"), """
2296Assert.True(File.Exists(Path.Combine(firstBuild.WorkingDirectory, "global.json")));
2302Assert.Equal(Path.GetDirectoryName(secondPath), secondBuild.WorkingDirectory);
2317var physicalRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "Physical"));
2319File.WriteAllText(Path.Combine(physicalRoot.FullName, "global.json"), """
2327var linkPath = Path.Combine(workspace.Path, "Alias");
2337var aliasProjectPath = Path.Combine(linkPath, "Service", Path.GetFileName(linkedProjectPath));
2351Assert.True(File.Exists(Path.Combine(linkedBuild.WorkingDirectory, "global.json")));
2356Assert.Equal(Path.GetDirectoryName(otherProjectPath), otherBuild.WorkingDirectory);
2370var resource = new DotnetProjectResource("service", Path.GetDirectoryName(projectPath)!);
2394var removedResource = new DotnetProjectResource("removed", Path.GetDirectoryName(removedProjectPath)!);
2401var activeResource = new DotnetProjectResource("active", Path.GetDirectoryName(activeProjectPath)!);
2544var missingPath = Path.Combine(workspace.Path, "Missing", "Missing.csproj");
2571File.WriteAllText(Path.Combine(Path.GetDirectoryName(firstPath)!, "global.json"), """
2629var linkDirectory = Path.Combine(workspace.Path, "ServiceAlias");
2633Directory.CreateSymbolicLink(linkDirectory, Path.GetDirectoryName(projectPath)!);
2640var aliasPath = Path.Combine(linkDirectory, Path.GetFileName(projectPath));
2656Assert.Equal(Path.GetDirectoryName(coordinatedProjectPath), first.Resource.WorkingDirectory);
2657Assert.Equal(Path.GetDirectoryName(coordinatedProjectPath), second.Resource.WorkingDirectory);
2669Path.Combine(workspace.Path, "obj", ".aspire", "build"),
2713var escapedDirectory = Path.Combine(workspace.Path, "Api's Project 100% (test)");
2714Directory.Move(Path.GetDirectoryName(apiProject)!, escapedDirectory);
2715apiProject = Path.Combine(escapedDirectory, Path.GetFileName(apiProject));
2716var apiSentinel = Path.Combine(workspace.Path, "api-ran.txt");
2717var workerSentinel = Path.Combine(workspace.Path, "worker-ran.txt");
2757var restoreCountPath = Path.Combine(Path.GetDirectoryName(project)!, "restore-count.txt");
2773File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), """
2780var sentinels = Directory.CreateDirectory(Path.Combine(workspace.Path, "instances")).FullName;
2868var firstSentinel = Path.Combine(workspace.Path, "first-ran.txt");
2869var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt");
2913var secondBuildMarker = Path.Combine(workspace.Path, "second-built.txt");
2919var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt");
2975File.WriteAllText(Path.Combine(Path.GetDirectoryName(validProject)!, "Program.cs"), """
2978var sentinelPath = Path.Combine(workspace.Path, "valid-ran.txt");
2979var missingProject = Path.Combine(workspace.Path, "Missing", "Missing.csproj");
3030var missingPath = Path.Combine(workspace.Path, "Missing", $"Missing.{extension}");
3078var sentinelPath = Path.Combine(workspace.Path, "environment-build-ran.txt");
3079File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), """
3130var sentinelPath = Path.Combine(Path.GetDirectoryName(projectPath)!, "build-sentinel.txt");
3186var filePath = Path.Combine(workspace.Path, "worker.cs");
3419var filePath = Path.Combine(workspace.Path, "worker.cs");
3453var filePath = Path.Combine(workspace.Path, "worker.cs");
3519Path.Combine(workspace.Path, "missing-dotnet");
3555var fileApp = Path.Combine(workspace.Path, "worker.cs");
3556var sentinel = Path.Combine(workspace.Path, "worker-ran.txt");
3617var releaseBuild = Path.Combine(workspace.Path, "release-build");
3619var fileApp = Path.Combine(workspace.Path, "worker.cs");
3620var sentinel = Path.Combine(workspace.Path, "worker-ran.txt");
3730using var archive = ZipFile.Open(Path.Combine(feed, $"Aspire.RestoreTest.{version}.nupkg"), ZipArchiveMode.Create);
3758var directory = Directory.CreateDirectory(Path.Combine(root, directoryName));
3759var path = Path.Combine(directory.FullName, projectFileName);
3767Path.Combine(Path.GetDirectoryName(projectPath)!, "Properties"));
3768File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), $$"""
3803File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "SharedValue.cs"), """
3816var directory = Directory.CreateDirectory(Path.Combine(root, name));
3817var relativeSharedProject = Path.GetRelativePath(directory.FullName, sharedProject);
3818var projectPath = Path.Combine(directory.FullName, $"{name}.csproj");
3837File.WriteAllText(Path.Combine(directory.FullName, "Program.cs"), """
3858File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), """
3877File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "BuildGate.cs"), $$"""
3907var projectDirectory = Path.GetDirectoryName(projectPath)!;
3908File.WriteAllText(Path.Combine(projectDirectory, "Program.cs"), "System.Console.WriteLine(\"Started\");");
3925File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), "this does not compile");
3931var directory = Directory.CreateDirectory(Path.Combine(root, name));
3932var projectPath = Path.Combine(directory.FullName, $"{name}.csproj");
3939var directory = Directory.CreateDirectory(Path.Combine(root, name));
3940var appPath = Path.Combine(directory.FullName, $"{name}.cs");
3941var relativeSharedProject = Path.GetRelativePath(directory.FullName, sharedProject)
3942.Replace(Path.DirectorySeparatorChar, '/');
3952Path.Combine(Path.GetDirectoryName(projectPath)!, "build-count.txt");
3955path.Replace(Path.DirectorySeparatorChar, '/');
3958Path.GetFullPath(path);
4075foreach (var directory in Directory.EnumerateDirectories(Path.GetTempPath(), "aspire-msbuild-*"))
4077var responseFilePath = Path.Combine(directory, "build-properties.rsp");
DotnetProjectResourceTests.cs (55)
39var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
55var appPath = Path.Combine(builder.AppHostDirectory, "service.cs");
71var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
75Assert.Equal(Path.GetDirectoryName(projectPath), app.Resource.WorkingDirectory);
155var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
182var expectedPath = Path.GetRelativePath(workspace.Path, metadata.ProjectPath).Replace('\\', '/');
260await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Dockerfile"), "FROM scratch");
299var appPath = Path.Combine(workspace.Path, "app.cs");
306var archivePath = Path.Combine(workspace.Path, "app.tar.gz");
334var sentinelDockerfilePath = Path.Combine(workspace.Path, "Dockerfile.sentinel");
335await File.WriteAllTextAsync(Path.Combine(workspace.Path, "sentinel.txt"), marker, cancellation.Token);
382var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "project"));
383var projectPath = Path.Combine(projectDirectory.FullName, "Project.csproj");
396Path.Combine(projectDirectory.FullName, "Program.cs"),
398var archivePath = Path.Combine(workspace.Path, "project.tar.gz");
425var projectPath = Path.Combine(workspace.Path, "Project.csproj");
432context.OutputPath = Path.Combine(workspace.Path, "project.tar");
451var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "project"));
453var runtimeDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime"));
454File.WriteAllText(Path.Combine(projectDirectory.FullName, "Dockerfile"), "FROM scratch");
477var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService"));
478var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj");
495var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "AmbiguousService"));
496File.WriteAllText(Path.Combine(projectDir.FullName, "First.csproj"), "<Project />");
497File.WriteAllText(Path.Combine(projectDir.FullName, "Second.csproj"), "<Project />");
524var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", projectFileName);
562var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService"));
563var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj");
566var propertiesDir = Directory.CreateDirectory(Path.Combine(projectDir.FullName, "Properties"));
567await File.WriteAllTextAsync(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """
594var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
608var appPath = Path.Combine(builder.AppHostDirectory, "service.cs");
639var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
665var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService"));
666var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj");
669var propertiesDir = Directory.CreateDirectory(Path.Combine(projectDir.FullName, "Properties"));
670await File.WriteAllTextAsync(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """
699var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
716var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
735var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService"));
736var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj");
739var propertiesDir = Directory.CreateDirectory(Path.Combine(projectDir.FullName, "Properties"));
740await File.WriteAllTextAsync(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """
789var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
815var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
834var appPath = Path.Combine(builder.AppHostDirectory, "service.cs");
869var appPath = Path.Combine(builder.AppHostDirectory, "service.cs");
893var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
924var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
955var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
985var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
1014var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj");
1057var appPath = Path.Combine(builder.AppHostDirectory, "service.cs");
1141var projectDirectory = Directory.CreateDirectory(Path.Combine(workspacePath, "MyService"));
1148var path = Path.Combine(directory, fileName);
Aspire.Hosting.EntityFrameworkCore (13)
Aspire.Hosting.EntityFrameworkCore.Tests (7)
Aspire.Hosting.Foundry.Tests (2)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.Go (7)
Aspire.Hosting.Go.Tests (35)
AddGoAppTests.cs (28)
88File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
95var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
509var packageDirectory = Path.Combine(sourceDir.FullName, "cmd", "server");
779File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.23\n");
780File.WriteAllText(Path.Combine(sourceDir.FullName, "main.go"), "package main\nfunc main() {}");
787var dockerfilePath = Path.Combine(outputDir.FullName, "api.Dockerfile");
807var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
819File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.22\n");
829var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
841File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
851var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
864File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch");
880File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.22\n");
888var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
902File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
910var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
922File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
930var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
978File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
995var dockerfile = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
1012File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
1035var dockerfile = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
1080File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
1087var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
1154File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
1161var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
1173File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n");
1181var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"));
GoVersionDetectorTests.cs (5)
22File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n\ngo 1.23\n");
33File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n\ngo 1.23.4\n");
44File.WriteAllText(Path.Combine(workspace.Path, "go.mod"),
57File.WriteAllText(Path.Combine(workspace.Path, "go.mod"),
69File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n");
Aspire.Hosting.Java (80)
JavaBuildToolResolver.cs (8)
31var hasMaven = File.Exists(Path.Combine(appDirectory, "pom.xml"));
32var hasGradle = s_gradleBuildFileNames.Any(fileName => File.Exists(Path.Combine(appDirectory, fileName)));
78FindWrapperInBuildRoot(appDirectory, wrapperName, tool) ?? Path.Combine(appDirectory, wrapperName));
86var candidate = Path.Combine(directory.FullName, wrapperName);
99var gitPath = Path.Combine(directory.FullName, ".git");
116JavaBuildTool.Gradle => File.Exists(Path.Combine(directory, "settings.gradle"))
117|| File.Exists(Path.Combine(directory, "settings.gradle.kts")),
120JavaBuildTool.Maven => File.Exists(Path.Combine(directory, "pom.xml")),
JavaDockerfileGenerator.cs (17)
123&& !File.Exists(Path.Combine(appDirectory, ".dockerignore")))
393/// <see cref="Path.IsPathRooted(string)"/> applies only the rules of the host it runs on, so an AppHost
407=> Path.IsPathRooted(path)
413/// Detected without <see cref="Path.IsPathRooted(string)"/> so the answer is the same on every
784var path = Path.Combine(appDirectory, fileName);
844var propertiesPath = Path.Combine(
846wrapperSupportPath.Replace('/', Path.DirectorySeparatorChar),
947var propertiesPath = Path.Combine(
949wrapperSupportPath.Replace('/', Path.DirectorySeparatorChar),
993var wrapperDirectory = Path.GetDirectoryName(wrapper.AsSpan());
1001var propertiesPath = Path.Combine(
1003supportPath.Replace('/', Path.DirectorySeparatorChar),
1041var relative = Path.GetRelativePath(appDirectory, resolvedWrapperPath).Replace('\\', '/');
1075if (Path.GetExtension(relative) is ".cmd" or ".bat")
1077var posixSibling = relative[..^Path.GetExtension(relative).Length];
1079if (!File.Exists(Path.Combine(appDirectory, posixSibling.Replace('/', Path.DirectorySeparatorChar))))
JavaHostingExtensions.cs (25)
94Path.Combine(builder.AppHostDirectory, appDirectory));
117if (File.Exists(Path.Combine(appDirectory, "Dockerfile")))
956Path.Combine(builder.Resource.WorkingDirectory, wrapperPath));
1164return Path.Combine(outputDirectory, "agent", "opentelemetry-javaagent.jar");
1244resolved = Path.GetFullPath(Path.Combine(builder.Resource.WorkingDirectory, authored));
1501var relativeWrapperPath = Path.GetRelativePath(workingDirectory, wrapperPath);
1805if (!Path.IsPathFullyQualified(command))
1810var fileName = Path.GetFileName(command);
1861var jarPath = Path.GetFullPath(Path.Combine(resource.WorkingDirectory, NormalizeJarPathForJava(jar.JarPath)));
1895JavaBuildTool.Maven => Path.Combine(resource.WorkingDirectory, "target"),
1896JavaBuildTool.Gradle => Path.Combine(resource.WorkingDirectory, "build", "libs"),
1973var runJar = Path.Combine(
1979return File.Exists(runJar) ? Path.GetFullPath(runJar) : null;
1988Path.TrimEndingDirectorySeparator(Path.GetFullPath(left)),
1989Path.TrimEndingDirectorySeparator(Path.GetFullPath(right)),
1994var fileName = Path.GetFileName(jarPath);
2015JavaBuildTool.Maven => TryReadMavenArtifactId(Path.Combine(resource.WorkingDirectory, "pom.xml")),
2082var settingsPath = Path.Combine(workingDirectory, fileName);
2107var directoryName = Path.GetFileName(workingDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
JavaVersionDetector.cs (6)
45DetectFromGradle(Path.Combine(appDirectory, "build.gradle")),
46DetectFromGradle(Path.Combine(appDirectory, "build.gradle.kts")),
47DetectFromPom(Path.Combine(appDirectory, "pom.xml"), buildArgs: null),
52Path.Combine(appDirectory, "pom.xml"),
54DetectFromGradle(Path.Combine(appDirectory, "build.gradle")),
55DetectFromGradle(Path.Combine(appDirectory, "build.gradle.kts")),
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Aspire.Hosting.Java.Tests (193)
AddJavaAppPublishTests.cs (89)
48Directory.CreateDirectory(Path.Combine(workspace.Path, "build", "libs"));
52await File.WriteAllTextAsync(Path.Combine(workspace.Path, "build", "libs", "reports service.jar"), "");
54var destination = Path.Combine(workspace.Path, "app.jar");
234File.WriteAllText(Path.Combine(sourceDir.FullName, "build.gradle"), "");
406File.WriteAllText(Path.Combine(source, ".dockerignore"), "secrets/\n");
421File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n");
427Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
442File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n");
473File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n");
505var manifest = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "aspire-manifest.json"), TestContext.Current.CancellationToken);
522File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), $"""
543File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
571File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
594File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
618File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
689File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "plugins { id 'java' }");
699File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
724File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
908File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), script);
1020File.WriteAllText(Path.Combine(appDirectory.Path, fileName), script);
1030File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), """
1043File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
1046File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "sourceCompatibility = '21'");
1062File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
1065File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "sourceCompatibility = '21'");
1079File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
1082File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "plugins { id 'java' }");
1094File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
1117File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
1139File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """
1160File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), "<project>");
1192File.WriteAllText(Path.Combine(appDirectory.Path, fileName), "");
1209File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), "<project />");
1210File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "");
1256File.WriteAllText(Path.Combine(sourceDir.FullName, "pom.xml"), "<project/>");
1280.WithWrapperPath(Path.Combine("..", "sibling", "mvnw"));
1381var wrapperDirectory = Path.Combine(source, "scripts");
1382WriteWrapper(wrapperDirectory, Path.GetFileName(posixWrapper));
1383WriteWrapper(wrapperDirectory, Path.GetFileName(windowsWrapper));
1405File.Delete(Path.Combine(sourceDir.FullName, "mvnw"));
1431Directory.Delete(Path.Combine(sourceDir.FullName, supportDirectory), recursive: true);
1453Directory.CreateDirectory(Path.Combine(source, "scripts"));
1454WriteWrapper(Path.Combine(source, "scripts"), "custom-mvnw");
1458.WithWrapperPath(Path.Combine("scripts", "custom-mvnw")));
1470Directory.CreateDirectory(Path.Combine(source, "target"));
1471File.WriteAllText(Path.Combine(source, "target", "worker.jar"), "");
1473jarPath: Path.Combine("target", "worker.jar"));
1490Directory.CreateDirectory(Path.Combine(source, "target"));
1491File.WriteAllText(Path.Combine(source, "target", "worker.jar"), "");
1493jarPath: Path.Combine("target", "worker.jar"),
1506Directory.CreateDirectory(Path.Combine(source, "target"));
1507File.WriteAllText(Path.Combine(source, "target", "worker.jar"), "");
1509jarPath: Path.Combine("target", "worker.jar"));
1523jarPath: Path.Combine("target", "api.jar"));
1541Path.Combine(sourceDir.FullName, "App.java"),
1562builder.AddJavaApp("api", sourceDir.FullName, Path.Combine("target", "app.jar"), ["--greeting", "hello"]);
1571await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "aspire-manifest.json"), TestContext.Current.CancellationToken));
1581Path.Combine(outputDir.FullName, "api.Dockerfile"),
1582Path.Combine(sourceDir.FullName, "Dockerfile"));
1584Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"),
1585Path.Combine(sourceDir.FullName, ".dockerignore"));
1621Path.Combine(sourceDir.FullName, "pom.xml"),
1652var sourcePath = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "src", "main", "java"));
1654Path.Combine(sourcePath.FullName, "App.java"),
1688Path.Combine(outputDir.FullName, "api.Dockerfile"),
1689Path.Combine(sourceDir.FullName, "Dockerfile"));
1691Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"),
1692Path.Combine(sourceDir.FullName, ".dockerignore"));
1824var stagingDirectory = Path.Combine(workspace.Path, "staged");
1865Assert.Equal("runner", File.ReadAllText(Path.Combine(stagingDirectory, "quarkus-run.jar")));
1867var expectedDependency = Path.Combine(stagingDirectory, "lib", "dependency.jar");
1870Assert.False(Directory.Exists(Path.Combine(stagingDirectory, "lib")));
1925Path.Combine(source, ".mvn", "wrapper", "maven-wrapper.properties"),
2088Path.Combine(source, "pom.xml"),
2089File.ReadAllText(Path.Combine(source, "pom.xml")).Replace(
2134var nested = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "build tools"));
2140.WithWrapperPath(Path.Combine("build tools", "mvnw"));
2172File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")),
2198return await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
2421return await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
2445var ignorePath = Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore");
2456File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), $"""
2473File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), """
2499File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), $"""
2516File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), $"""
2544File.WriteAllText(Path.Combine(sourceDirectory, "build.gradle"), contents);
2550File.WriteAllText(Path.Combine(sourceDirectory, wrapperName), "#!/bin/sh\nexit 0\n");
2556var supportDirectory = Path.Combine(sourceDirectory, gradle ? "gradle" : ".mvn", "wrapper");
2568Path.Combine(supportDirectory, gradle ? "gradle-wrapper.properties" : "maven-wrapper.properties"),
AddJavaAppTests.cs (68)
46Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper), tempDir.Path, "spring-boot:run"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource));
59Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper), tempDir.Path, "bootRun", "--no-daemon"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource));
139var expectedPath = Path.GetFullPath(tempDir.Path, builder.AppHostDirectory);
320var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper));
338var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper));
351File.WriteAllText(Path.Combine(repo.Path, "settings.gradle"), "include 'services:api'");
352var module = Directory.CreateDirectory(Path.Combine(repo.Path, "services", "api")).FullName;
353File.WriteAllText(Path.Combine(module, "build.gradle"), "");
359var expectedWrapper = Path.GetFullPath(Path.Combine(repo.Path, JavaHostingExtensions.s_defaultGradleWrapper));
371File.WriteAllText(Path.Combine(repo.Path, "pom.xml"), "<project />");
372var module = Directory.CreateDirectory(Path.Combine(repo.Path, "services", "api")).FullName;
373File.WriteAllText(Path.Combine(module, "pom.xml"), "<project />");
379var expectedWrapper = Path.GetFullPath(Path.Combine(repo.Path, JavaHostingExtensions.s_defaultMavenWrapper));
391var module = Directory.CreateDirectory(Path.Combine(repo.Path, "services", "api")).FullName;
392File.WriteAllText(Path.Combine(module, JavaHostingExtensions.s_defaultGradleWrapper), "#!/bin/sh\n");
398var expectedWrapper = Path.GetFullPath(Path.Combine(module, JavaHostingExtensions.s_defaultGradleWrapper));
409var workingDirectory = Path.Combine(Path.GetTempPath(), "repo", "services", "api");
410var wrapperPath = Path.Combine(Path.GetTempPath(), "repo", "build tools", wrapperName);
415Assert.Equal(["/c", "call", Path.Combine("..", "..", "build tools", wrapperName)], leadingArgs);
423var wrapperPath = Path.Combine(Path.GetTempPath(), "repo", "mvnw");
426wrapperPath, Path.Combine(Path.GetTempPath(), "repo", "services", "api"), isWindows: false);
553var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, "scripts/custom-mvnw"));
571var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, "scripts/custom-gradlew"));
779var customWrapper = Path.Combine(tempDir.Path, "tools", "mvnw");
780Directory.CreateDirectory(Path.GetDirectoryName(customWrapper)!);
788.WithWrapperPath(Path.Combine("tools", "mvnw"));
802ExpectedWrapperInvocation.Args(Path.GetFullPath(customWrapper), Path.GetFullPath(tempDir.Path), "spring-boot:run"),
815var wrapper = Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper);
974.WithOtelAgent(Path.Combine("target", "agent", "opentelemetry-javaagent.jar"));
983var expected = Path.GetFullPath(
984Path.Combine(app.Resource.WorkingDirectory, "target", "agent", "opentelemetry-javaagent.jar"));
987Assert.True(Path.IsPathFullyQualified(expected));
1314var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, "tools/mvn"));
1376var javaExecutable = Path.Combine(tempDir.Path, fileName);
1392var command = Path.Combine(tempDir.Path, fileName);
1404var command = Path.Combine("bin", OperatingSystem.IsWindows() ? "java.exe" : "java");
1418var javaExecutable = Path.Combine(tempDir.Path, OperatingSystem.IsWindows() ? "java.exe" : "java");
1445var javaExecutable = Path.Combine(tempDir.Path, OperatingSystem.IsWindows() ? "java.exe" : "java");
1470var wrapperCommand = Path.Combine(tempDir.Path, OperatingSystem.IsWindows() ? "cmd.exe" : "sh");
1509Path.Combine(outputDirectory, "quarkus-app", "quarkus-run.jar"),
1526var jarPath = Path.Combine(directory, fileName);
1527Directory.CreateDirectory(Path.GetDirectoryName(jarPath)!);
1558return Path.GetFullPath(jarPath);
1659Assert.Equal(Path.Combine(tempDir.Path, "no-main.jar"), Assert.Single(noMainClassConfiguration.ClassPaths!));
1663Assert.Equal(Path.Combine(tempDir.Path, "does-not-exist.jar"), Assert.Single(missingConfiguration.ClassPaths!));
1679Path.Combine(outputDirectory, "catalog-0.0.1-SNAPSHOT.jar"),
1689Path.Combine(tempDir.Path, tool == "maven" ? "pom.xml" : "settings.gradle"),
1797File.WriteAllText(Path.Combine(tempDir.Path, "pom.xml"), """
1827File.WriteAllText(Path.Combine(tempDir.Path, "settings.gradle"), "rootProject.name = 'orders'\n");
1849Path.GetFileName(tempDir.Path.TrimEnd(Path.DirectorySeparatorChar)),
1861Path.Combine(tempDir.Path, "settings.gradle"),
1882File.WriteAllText(Path.Combine(tempDir.Path, "pom.xml"), """
1894Path.Combine("target", "worker-0.0.1-SNAPSHOT.jar"),
1898.AddJavaApp("worker", tempDir.Path, Path.Combine("target", "worker-0.0.1-SNAPSHOT.jar"))
AddSpringBootAppTests.cs (9)
26Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper), tempDir.Path, "spring-boot:run"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource));
43Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper), tempDir.Path, "bootRun"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource));
119Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper),
246var expected = Path.GetFullPath(Path.Combine(tempDir.Path, outputDirectory, "agent", "opentelemetry-javaagent.jar"));
277var expected = Path.GetFullPath(Path.Combine(tempDir.Path, outputDirectory, "agent", "opentelemetry-javaagent.jar"));
321.WithOtelAgent(Path.Combine(Path.GetTempPath(), "opentelemetry-javaagent.jar"));
JavaBuildToolResolverTests.cs (16)
26Assert.Equal(Path.GetFullPath(Path.Combine(tempDir.Path, expectedWrapperName)), wrapperPath);
40Assert.Equal(Path.GetFullPath(Path.Combine(tempDir.Path, "tools", "custom-wrapper")), wrapperPath);
54Assert.Equal(Path.GetFullPath(Path.Combine(root.RootPath, "mvnw")), wrapperPath);
78Assert.Equal(Path.GetFullPath(Path.Combine(module, "mvnw")), wrapperPath);
105Assert.Equal(Path.GetFullPath(Path.Combine(root.RootPath, "mvnw")), wrapperPath);
120Path.Combine(root.RootPath, "mvnw"),
129Assert.Equal(Path.GetFullPath(Path.Combine(module, "mvnw")), wrapperPath);
143File.WriteAllText(Path.Combine(_root.FullName, "pom.xml"), "<project/>");
144File.WriteAllText(Path.Combine(_root.FullName, "mvnw"), "#!/bin/sh\n");
152File.WriteAllText(Path.Combine(module.FullName, "pom.xml"), "<project/>");
Aspire.Hosting.JavaScript (68)
JavaScriptHostingExtensions.cs (44)
154appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
186if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
274if (File.Exists(Path.Combine(appDirectory, "package.json")))
482appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
514if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
679if (File.Exists(Path.Combine(appDirectory, "package.json")))
825appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
888if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
1042if (File.Exists(Path.Combine(appDirectory, "package.json")) ||
1043File.Exists(Path.Combine(appDirectory, "deno.json")) ||
1044File.Exists(Path.Combine(appDirectory, "deno.jsonc")))
1176appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
1686if (File.Exists(Path.Combine(appDirectory, "Dockerfile")))
2016appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
2089var candidatePath = Path.GetFullPath(Path.Join(appDirectory, configFile));
2103var absoluteConfigPath = Path.GetFullPath(configTarget, appDirectory);
2123var aspireConfigDir = Path.Join(nodeModulesDir, ".aspire", appHostId, resource.Name);
2127var relativeConfigPath = Path.GetRelativePath(aspireConfigDir, absoluteConfigPath).Replace("\\", "/");
2133var aspireConfigPath = Path.Join(aspireConfigDir, $"aspire.{Path.GetFileName(configTarget)}");
2217appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
2395var hasBunLock = File.Exists(Path.Combine(workingDirectory, "bun.lock")) ||
2396File.Exists(Path.Combine(workingDirectory, "bun.lockb"));
2401if (File.Exists(Path.Combine(workingDirectory, "bun.lock")))
2405if (File.Exists(Path.Combine(workingDirectory, "bun.lockb")))
2486if (File.Exists(Path.Combine(workingDirectory, manifest)))
2549File.Exists(Path.Combine(resource.Resource.WorkingDirectory, "package-lock.json"))
2567var hasYarnLock = File.Exists(Path.Combine(workingDirectory, "yarn.lock"));
2568var hasYarnrc = File.Exists(Path.Combine(workingDirectory, ".yarnrc.yml"));
2569var hasYarnBerryDir = Directory.Exists(Path.Combine(workingDirectory, ".yarn"));
2646var hasPnpmLock = File.Exists(Path.Combine(workingDirectory, "pnpm-lock.yaml"));
2647var hasPnpmWorkspace = File.Exists(Path.Combine(workingDirectory, "pnpm-workspace.yaml"));
2701var packageJsonPath = Path.Combine(workingDirectory, "package.json");
2813var workingDirectory = Path.GetFullPath(resource.WorkingDirectory);
2843ScriptPath = Path.GetFullPath(scriptPath, workingDirectory),
2867var workingDirectory = Path.GetFullPath(resource.WorkingDirectory);
3161var configPath = Path.Combine(appDirectory, configFileName);
3209var current = Path.GetFullPath(startDirectory);
3212var candidate = Path.Join(current, "node_modules");
3218var parent = Path.GetDirectoryName(current);
3286var nvmrcPath = Path.Combine(workingDirectory, ".nvmrc");
3299var nodeVersionPath = Path.Combine(workingDirectory, ".node-version");
3312var toolVersionsPath = Path.Combine(workingDirectory, ".tool-versions");
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Aspire.Hosting.JavaScript.Tests (325)
AddBunAppTests.cs (19)
36var appDir = Path.Combine(workspace.Path, "js");
41File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
48var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
64var appDir = Path.Combine(workspace.Path, "js");
66File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
75await Verify(File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")));
84var appDir = Path.Combine(workspace.Path, "js");
86File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
95var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore");
101Assert.False(File.Exists(Path.Combine(appDir, ".dockerignore")), "Aspire should not write a .dockerignore into the user's source tree.");
115var appDir = Path.Combine(workspace.Path, "js");
117File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
123var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore");
129var userIgnorePath = Path.Combine(appDir, ".dockerignore");
145File.WriteAllText(Path.Combine(workspace.Path, "server.ts"), "console.log('hi');");
167File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}");
351File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}");
373Assert.Equal(Path.GetFullPath("server.ts", workspace.Path), launchConfig.ScriptPath);
384File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}");
AddDenoAppTests.cs (133)
63var appDir = Path.Combine(workspace.Path, "js");
68File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
75var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
91var appDir = Path.Combine(workspace.Path, "js");
93File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
102var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
114var appDir = Path.Combine(workspace.Path, "js");
116File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
125var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore");
131Assert.False(File.Exists(Path.Combine(appDir, ".dockerignore")), "Aspire should not write a .dockerignore into the user's source tree.");
146var appDir = Path.Combine(workspace.Path, "js");
153var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
181var appDir = Path.Combine(workspace.Path, "js");
184File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}");
190var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
201var appDir = Path.Combine(workspace.Path, "js");
203File.WriteAllText(Path.Combine(appDir, "custom.lock"), "{}");
213var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
225var appDir = Path.Combine(workspace.Path, "js");
227File.WriteAllText(Path.Combine(appDir, "custom.lock"), "{}");
239await Verify(File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")));
248var appDir = Path.Combine(workspace.Path, "js");
250File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}""");
257var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
268var appDir = Path.Combine(workspace.Path, "js");
270File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}""");
271File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}");
282var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
295var appDir = Path.Combine(workspace.Path, "js");
297File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"build":"deno run -A build.ts","start":"deno run -A main.ts"}}""");
306var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
321var appDir = Path.Combine(workspace.Path, "js");
324Path.Combine(appDir, "deno.json"),
337var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
352var appDir = Path.Combine(workspace.Path, "js");
372var appDir = Path.Combine(workspace.Path, "js");
392var appDir = Path.Combine(workspace.Path, "js");
394File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"importMap":"import_map.json","tasks":{"start":"deno run main.ts"}}""");
395File.WriteAllText(Path.Combine(appDir, "import_map.json"), """{"imports":{}}""");
402var dockerfileLines = File.ReadAllLines(Path.Combine(workspace.Path, "js.Dockerfile"));
416var appDir = Path.Combine(workspace.Path, "js");
418File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"importMap":"import_map.json","tasks":{"start":"deno run main.ts"}}""");
419File.WriteAllText(Path.Combine(appDir, "import_map.json"), """{"imports":{}}""");
427var dockerfileLines = File.ReadAllLines(Path.Combine(workspace.Path, "js.Dockerfile"));
441var appDir = Path.Combine(workspace.Path, "js");
447var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
459var appDir = Path.Combine(workspace.Path, "js");
466var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
478var appDir = Path.Combine(workspace.Path, "js");
487var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
505var appDir = Path.Combine(workspace.Path, "js");
524var appDir = Path.Combine(workspace.Path, "js");
526File.WriteAllText(Path.Combine(appDir, "Dockerfile"), "FROM denoland/deno:2.9.0");
533Assert.False(File.Exists(Path.Combine(workspace.Path, "js.Dockerfile")));
542var appDir = Path.Combine(workspace.Path, "js");
544File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);");
554var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
569var appDir = Path.Combine(workspace.Path, "js");
571File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);");
585var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
612var appDir = Path.Combine(workspace.Path, "js");
614File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);");
623var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
633var appDir = Path.Combine(workspace.Path, "js");
635File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);");
644var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
654var appDir = Path.Combine(workspace.Path, "js");
656File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"build prod":"deno run -A build.ts","start":"deno run -A main.ts"}}""");
665var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
676var appDir = Path.Combine(workspace.Path, "js");
678File.WriteAllText(Path.Combine(appDir, "package.json"), """{"scripts":{"build prod":"echo build","start":"node main.js"}}""");
688var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
698var appDir = Path.Combine(workspace.Path, "js");
700File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}""");
709var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
727var appDir = Path.Combine(workspace.Path, "js");
729File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}""");
747var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
758var appDir = Path.Combine(workspace.Path, "js");
760File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}""");
768var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
862var appDir = Path.Combine(workspace.Path, "js");
864File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}""");
874var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
886var appDir = Path.Combine(workspace.Path, "js");
888File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}");
895var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
905var appDir = Path.Combine(workspace.Path, "js");
907File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}");
914var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
953var appDir = Path.Combine(workspace.Path, "js");
962var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
974var appDir = Path.Combine(workspace.Path, "js");
976File.WriteAllText(Path.Combine(appDir, "custom lock's.lock"), "{}");
985var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
997var appDir = Path.Combine(workspace.Path, "js");
1006var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1023var appDir = Path.Combine(workspace.Path, "js");
1031var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1041var appDir = Path.Combine(workspace.Path, "js");
1050var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1062var appDir = Path.Combine(workspace.Path, "js");
1071var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1083var appDir = Path.Combine(workspace.Path, "js");
1095var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1107var appDir = Path.Combine(workspace.Path, "js");
1125var appDir = Path.Combine(workspace.Path, "js");
1152var appDir = Path.Combine(workspace.Path, "js");
1181var appDir = Path.Combine(workspace.Path, "js");
1200var appDir = Path.Combine(workspace.Path, "js");
1229var appDir1 = Path.Combine(workspace.Path, "js1");
1230var appDir2 = Path.Combine(workspace.Path, "js2");
1244var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js2.Dockerfile"));
1254File.WriteAllText(Path.Combine(workspace.Path, "main.ts"), "console.log('hi');");
1276File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}");
1303File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}");
1325File.WriteAllText(Path.Combine(workspace.Path, "main.ts"), "console.log('hi');");
1579var appDir = Path.Combine(workspace.Path, "js");
1588var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1603var appDir = Path.Combine(workspace.Path, "js");
1613var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1630var appDir = Path.Combine(workspace.Path, "js");
1639var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1650var appDir = Path.Combine(workspace.Path, "js");
1658var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
1685var appDir = Path.Combine(workspace.Path, "js");
2349var appDir = Path.Combine(workspace.Path, "deno-app");
2351await File.WriteAllTextAsync(Path.Combine(appDir, "main.ts"), """
2360var dockerfilePath = Path.Combine(workspace.Path, "deno-app.Dockerfile");
2576Assert.Equal(Path.GetFullPath("main.ts", workspace.Path), launchConfig.ScriptPath);
2587File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}");
2605File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}");
2624File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}");
AddJavaScriptAppTests.cs (44)
27var appDir = Path.Combine(workspace.Path, "js");
36var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
49var appDir = Path.Combine(workspace.Path, "js");
59var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
69var appDir = Path.Combine(workspace.Path, "js");
79var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
89var appDir = Path.Combine(workspace.Path, "js");
99var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
112var appDir = Path.Combine(workspace.Path, "js");
117File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), string.Empty);
126var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
138var appDir = Path.Combine(workspace.Path, "js");
147var dockerfileLines = await File.ReadAllLinesAsync(Path.Combine(workspace.Path, "js.Dockerfile"));
172var appDir = Path.Combine(workspace.Path, "js");
177File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), string.Empty);
187var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
350var appDir = Path.Combine(workspace.Path, "js");
353File.WriteAllText(Path.Combine(appDir, "pnpm-workspace.yaml"), "allowBuilds: {}\n");
361var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
381var appDir = Path.Combine(workspace.Path, "js");
384Path.Combine(appDir, "package.json"),
397var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile"));
415var appDir = Path.Combine(workspace.Path, "js");
418Path.Combine(appDir, "package.json"),
432var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile"));
447var appDir = Path.Combine(workspace.Path, "js");
450Path.Combine(appDir, "package.json"),
463var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile"));
476var appDir = Path.Combine(workspace.Path, "js");
479Path.Combine(appDir, "package.json"),
492var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile"));
515var appDir = Path.Combine(workspace.Path, "js");
517var packageJsonPath = Path.Combine(appDir, "package.json");
542var appDir = Path.Combine(workspace.Path, "pnpm-app");
556await File.WriteAllTextAsync(Path.Combine(appDir, "package.json"), packageJson);
564var dockerfilePath = Path.Combine(workspace.Path, "pnpm-app.Dockerfile");
579var dockerfileInContext = Path.Combine(appDir, "Dockerfile");
637var appDir = Path.Combine(workspace.Path, "pnpm-app");
651await File.WriteAllTextAsync(Path.Combine(appDir, "package.json"), packageJson);
660var dockerfilePath = Path.Combine(workspace.Path, "pnpm-app.Dockerfile");
669var dockerfileInContext = Path.Combine(appDir, "Dockerfile");
715var appDir = Path.Combine(rootDirectory, "js");
725File.WriteAllText(Path.Combine(appDir, "Dockerfile"), dockerfile);
726File.WriteAllText(Path.Combine(appDir, "package.json"), """
AddNodeAppTests.cs (20)
101var appDir = Path.Combine(workspace.Path, "js");
106File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
107File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "{}");
114var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
169var appDir = Path.Combine(workspace.Path, "js");
171File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
183var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile");
216var appDir = Path.Combine(workspace.Path, "js");
218File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
229var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"));
238File.WriteAllText(Path.Combine(workspace.Path, "app.js"), "{}");
265File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}");
339File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent);
340File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent);
365var nodeDockerfilePath = Path.Combine(outputDir.FullName, "nodeapp.Dockerfile");
396File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent);
397File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent);
422var nodeDockerfilePath = Path.Combine(outputDir.FullName, "nodeapp.Dockerfile");
562File.WriteAllText(Path.Combine(workspace.Path, "app.js"), "console.log('hello');");
607Assert.Equal(Path.GetFullPath("app.js", workspace.Path), launchConfig.ScriptPath);
AddViteAppTests.cs (92)
28var viteDir = Path.Combine(workspace.Path, "vite");
32File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty");
63var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile");
89var viteDir = Path.Combine(workspace.Path, "vite");
91File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty");
99var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile");
115var viteDir = Path.Combine(workspace.Path, "vite");
117File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty");
119var apiDir = Path.Combine(workspace.Path, "api");
121File.WriteAllText(Path.Combine(apiDir, "package-lock.json"), "empty");
132var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile");
142var viteDir = Path.Combine(workspace.Path, "vite");
144File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty");
163var viteDir = Path.Combine(workspace.Path, "vite");
165File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty");
167var apiDir = Path.Combine(workspace.Path, "api");
169File.WriteAllText(Path.Combine(apiDir, "package-lock.json"), "empty");
193var appDir = Path.Combine(workspace.Path, "angular");
195File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "empty");
203var dockerfilePath = Path.Combine(workspace.Path, "angular.Dockerfile");
219var appDir = Path.Combine(workspace.Path, "vite");
221File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "empty");
229var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile");
242var nextDir = Path.Combine(workspace.Path, "nextjs");
244File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty");
251var dockerfilePath = Path.Combine(workspace.Path, "nextjs.Dockerfile");
263var nextDir = Path.Combine(workspace.Path, "nextjs");
265File.WriteAllText(Path.Combine(nextDir, "pnpm-lock.yaml"), "");
272var dockerfilePath = Path.Combine(workspace.Path, "nextjs.Dockerfile");
282var appDir = Path.Combine(workspace.Path, "nuxt");
284File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), "");
292var dockerfilePath = Path.Combine(workspace.Path, "nuxt.Dockerfile");
302var appDir = Path.Combine(workspace.Path, "nuxt");
304File.WriteAllText(Path.Combine(appDir, "bun.lock"), "");
312var dockerfilePath = Path.Combine(workspace.Path, "nuxt.Dockerfile");
322File.WriteAllText(Path.Combine(workspace.Path, ".nvmrc"), "18.20.0");
330var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
342File.WriteAllText(Path.Combine(workspace.Path, ".node-version"), "v21.5.0");
350var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
367File.WriteAllText(Path.Combine(workspace.Path, ".tool-versions"), toolVersions);
375var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
393File.WriteAllText(Path.Combine(workspace.Path, ".tool-versions"), toolVersions);
401var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
419File.WriteAllText(Path.Combine(workspace.Path, "package.json"), packageJson);
427var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
444var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
460File.WriteAllText(Path.Combine(workspace.Path, ".nvmrc"), versionString);
468var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
490var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile"));
548Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules"));
551var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js");
596Assert.Contains(Path.Combine("node_modules", ".aspire"), newConfigPath);
609Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules"));
612var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js");
713var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js");
756Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules"));
759var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js");
811var repoRoot = Path.Combine(workspace.Path, "repo");
812var appDir = Path.Combine(repoRoot, "packages", "frontend");
814Directory.CreateDirectory(Path.Combine(repoRoot, "node_modules"));
817var viteConfigPath = Path.Combine(appDir, "vite.config.ts");
858var expectedDir = Path.Combine(repoRoot, "node_modules", ".aspire", appHostId, "test-app");
877var absoluteConfigPath = Path.GetFullPath(viteConfigPath);
887var repoRoot = Path.Combine(workspace.Path, "repo");
888var firstAppDirectory = Path.Combine(repoRoot, "packages", "frontend-a");
889var secondAppDirectory = Path.Combine(repoRoot, "packages", "frontend-b");
892Directory.CreateDirectory(Path.Combine(repoRoot, "node_modules"));
894var firstConfigPath = Path.Combine(firstAppDirectory, "vite.config.ts");
895var secondConfigPath = Path.Combine(secondAppDirectory, "vite.config.ts");
937var firstWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", appHostId, "frontend-a", "aspire.vite.config.ts");
938var secondWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", appHostId, "frontend-b", "aspire.vite.config.ts");
941Assert.Contains(Path.GetFullPath(firstConfigPath).Replace("\\", "\\\\"), File.ReadAllText(firstWrapperPath));
942Assert.Contains(Path.GetFullPath(secondConfigPath).Replace("\\", "\\\\"), File.ReadAllText(secondWrapperPath));
950var repoRoot = Path.Combine(workspace.Path, "repo");
951var firstAppDirectory = Path.Combine(repoRoot, "apps", "first");
952var secondAppDirectory = Path.Combine(repoRoot, "apps", "second");
955Directory.CreateDirectory(Path.Combine(repoRoot, "node_modules"));
957var firstConfigPath = Path.Combine(firstAppDirectory, "vite.config.ts");
958var secondConfigPath = Path.Combine(secondAppDirectory, "vite.config.ts");
976var expectedFirstWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", firstAppHostSha[..10], "frontend", "aspire.vite.config.ts");
977var expectedSecondWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", secondAppHostSha[..10], "frontend", "aspire.vite.config.ts");
980Assert.Contains(Path.GetFullPath(firstConfigPath).Replace("\\", "\\\\"), File.ReadAllText(firstWrapperPath));
981Assert.Contains(Path.GetFullPath(secondConfigPath).Replace("\\", "\\\\"), File.ReadAllText(secondWrapperPath));
996Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules"));
999var viteConfigPath = Path.Combine(workspace.Path, configFileName);
1050var nextDir = Path.Combine(workspace.Path, "nextjs");
1052File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty");
1066var nextDir = Path.Combine(workspace.Path, "nextjs");
1068File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty");
1083var nextDir = Path.Combine(workspace.Path, "nextjs");
1085File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty");
1086File.WriteAllText(Path.Combine(nextDir, "next.config.ts"), "const nextConfig = {}; export default nextConfig;");
PackageInstallationTests.cs (8)
458File.WriteAllText(Path.Combine(workspace.Path, "package-lock.json"), "empty");
485File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty");
506File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty");
507File.WriteAllText(Path.Combine(workspace.Path, ".yarnrc.yml"), "empty");
522File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty");
523Directory.CreateDirectory(Path.Combine(workspace.Path, ".yarn", "releases"));
538File.WriteAllText(Path.Combine(workspace.Path, "pnpm-lock.yaml"), "empty");
553File.WriteAllText(Path.Combine(workspace.Path, "bun.lock"), "empty");
Aspire.Hosting.Kafka.Tests (1)
Aspire.Hosting.Keycloak (2)
Aspire.Hosting.Keycloak.Tests (2)
Aspire.Hosting.Kubernetes (26)
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Hosting.Kubernetes.Tests (150)
KubernetesDeployTests.cs (35)
846var chartYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "Chart.yaml"));
877var chartYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "Chart.yaml"));
899var deploymentYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "svc", "deployment.yaml"));
940var outputPath = Path.Combine(workspace.Path, "env");
951await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), valuesYaml);
970var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env"));
987var outputPath = Path.Combine(workspace.Path, "env");
990await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), "parameters: {}\nsecrets: {}\nconfig: {}");
999var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1007var outputPath = Path.Combine(workspace.Path, "env");
1010await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), "parameters: {}\nsecrets: {}\nconfig: {}");
1029var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1081var outputPath = Path.Combine(workspace.Path, "env");
1084await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), "parameters: {}\nsecrets: {}\nconfig: {}");
1105var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1238var outputPath = Path.Combine(workspace.Path, "env");
1249await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), valuesYaml);
1274var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1288var outputPath = Path.Combine(workspace.Path, "env");
1298var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1337var valuesPath = Path.Combine(workspace.Path, "values.yaml");
1360var serverSecretsTemplatePath = Path.Combine(workspace.Path, "templates", "server", "secrets.yaml");
1412var valuesPath = Path.Combine(workspace.Path, "values.yaml");
1439var outputPath = Path.Combine(workspace.Path, "deploy");
1471var overridePath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("myenv"));
1529var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1590var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1635var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1675var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"));
1676await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml")
1678await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "myapp", "config.yaml")),
1753var valuesPath = Path.Combine(workspace.Path, "values.yaml");
1792var valuesPath = Path.Combine(workspace.Path, "values.yaml");
1827var valuesPath = Path.Combine(workspace.Path, "values.yaml");
1863var valuesPath = Path.Combine(workspace.Path, "values.yaml");
KubernetesGatewayTests.cs (15)
34var gatewayDir = Path.Combine(workspace.Path, "templates", "public");
41var gatewayFile = files.FirstOrDefault(f => Path.GetFileName(f) == "public.yaml");
75var gatewayDir = Path.Combine(workspace.Path, "templates", "public");
106var gatewayPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
107var routePath = Path.Combine(workspace.Path, "templates", "public", "route.yaml");
108var valuesPath = Path.Combine(workspace.Path, "values.yaml");
136var routePath = Path.Combine(workspace.Path, "templates", "public", "route.yaml");
256var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
291var gatewayDir = Path.Combine(workspace.Path, "templates", "public");
322var gatewayDir = Path.Combine(workspace.Path, "templates", "public");
356var gatewayDir = Path.Combine(workspace.Path, "templates", "empty");
434var templatesDir = Path.Combine(workspace.Path, "templates", "myapi");
464var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
513var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
596var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
KubernetesIngressTests.cs (23)
34var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
64var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
108var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
115var valuesPath = Path.Combine(workspace.Path, "values.yaml");
149var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
177var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
178var valuesPath = Path.Combine(workspace.Path, "values.yaml");
204var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
228var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
253var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
282var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
315var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
343var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
367var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
393var ingressDir = Path.Combine(workspace.Path, "templates", "empty");
459var ingressDir = Path.Combine(workspace.Path, "templates", "public");
556var ingressDir = Path.Combine(workspace.Path, "templates", "empty");
576var templatesDir = Path.Combine(workspace.Path, "templates", "myapi");
612var publicPath = Path.Combine(workspace.Path, "templates", "public-ingress", "public-ingress.yaml");
613var internalPath = Path.Combine(workspace.Path, "templates", "internal-ingress", "internal-ingress.yaml");
647var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
682var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
798var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
KubernetesPublisherTests.cs (71)
71var filePath = Path.Combine(workspace.Path, expectedFile);
72var fileExtension = Path.GetExtension(filePath)[1..];
110var deploymentPath = Path.Combine(workspace.Path, "templates/service/deployment.yaml");
168var filePath = Path.Combine(workspace.Path, expectedFile);
169var fileExtension = Path.GetExtension(filePath)[1..];
212var manifestPath = Path.Combine(workspace.Path, "templates/myapp/scaler.yaml");
295var filePath = Path.Combine(workspace.Path, expectedFile);
296var fileExtension = Path.GetExtension(filePath)[1..];
351var filePath = Path.Combine(workspace.Path, expectedFile);
352var fileExtension = Path.GetExtension(filePath)[1..];
383var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile");
458var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml");
507var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml");
542var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml");
635var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml");
731var filePath = Path.Combine(workspace.Path, expectedFile);
732var fileExtension = Path.GetExtension(filePath)[1..];
759await Verify(File.ReadAllText(Path.Combine(workspace.Path, "Chart.yaml")), "yaml")
760.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "values.yaml")), "yaml")
761.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "deployment.yaml")), "yaml")
762.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "service.yaml")), "yaml")
763.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "config.yaml")), "yaml");
796var filePath = Path.Combine(workspace.Path, expectedFile);
797var fileExtension = Path.GetExtension(filePath)[1..];
840var filePath = Path.Combine(workspace.Path, expectedFile);
866var servicePath = Path.Combine(workspace.Path, "templates/database/service.yaml");
902var filePath = Path.Combine(workspace.Path, expectedFile);
903var fileExtension = Path.GetExtension(filePath)[1..];
954var filePath = Path.Combine(workspace.Path, expectedFile);
955var fileExtension = Path.GetExtension(filePath)[1..];
999var filePath = Path.Combine(workspace.Path, expectedFile);
1000var fileExtension = Path.GetExtension(filePath)[1..];
1044var filePath = Path.Combine(workspace.Path, expectedFile);
1045var fileExtension = Path.GetExtension(filePath)[1..];
1199var filePath = Path.Combine(workspace.Path, expectedFile);
1200var fileExtension = Path.GetExtension(filePath)[1..];
1245var filePath = Path.Combine(workspace.Path, expectedFile);
1246var fileExtension = Path.GetExtension(filePath)[1..];
1306var filePath = Path.Combine(workspace.Path, expectedFile);
1307var fileExtension = Path.GetExtension(filePath)[1..];
1357var filePath = Path.Combine(workspace.Path, expectedFile);
1358var fileExtension = Path.GetExtension(filePath)[1..];
1419var filePath = Path.Combine(workspace.Path, expectedFile);
1420var fileExtension = Path.GetExtension(filePath)[1..];
1478var filePath = Path.Combine(workspace.Path, expectedFile);
1479var fileExtension = Path.GetExtension(filePath)[1..];
1532var filePath = Path.Combine(workspace.Path, expectedFile);
1533var fileExtension = Path.GetExtension(filePath)[1..];
1589var filePath = Path.Combine(workspace.Path, expectedFile);
1608var legacyPv = Path.Combine(workspace.Path, "templates", "service", "data-pv.yaml");
1638var deploymentPath = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml");
1683var filePath = Path.Combine(workspace.Path, expectedFile);
1696var legacyPvc = Path.Combine(workspace.Path, "templates", "service", "data-pvc.yaml");
1700var deploymentPath = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml");
1738var filePath = Path.Combine(workspace.Path, expectedFile);
1778var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml");
1805var omittedClaimPath = Path.Combine(workspace.Path, "templates", "omitted", "omitted.yaml");
1806var emptyClaimPath = Path.Combine(workspace.Path, "templates", "empty", "empty.yaml");
1847var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", name, $"{name}.yaml"));
1885var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", name, $"{name}.yaml"));
1921var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "data", "data.yaml"));
1947var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml");
1974var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml");
2025var filePath = Path.Combine(workspace.Path, expectedFile);
2105var filePath = Path.Combine(workspace.Path, expectedFile);
2143var statefulSetPath = Path.Combine(workspace.Path, "templates", "service", "statefulset.yaml");
2149var pvcPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml");
2213var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml");
2287var pvcPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml");
2299var valuesPath = Path.Combine(workspace.Path, "values.yaml");
2321var claimPath = Path.Combine(workspacePath, "templates", volumeName, $"{volumeName}.yaml");
Aspire.Hosting.Maui (31)
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Aspire.Hosting.Maui.Tests (67)
MauiPlatformExtensionsTests.cs (38)
98var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
121var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
141var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
160var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
189var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
237var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
256var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
280var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
309var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
335var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
358var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
381var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
404var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
432var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
457var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
486var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
511var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
538var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
565var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
632var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
662var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
686var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
709var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
747var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
800var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
865var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
904var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
957var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1023var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1060var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1077var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1099var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1130var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1157var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1187var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1269var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1305var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
1368var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiWithArgsTests.cs (11)
21var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
39var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
58var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
78var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
95var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
115var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
132var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
151var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
168var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
188var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
210var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
Aspire.Hosting.Milvus (2)
Aspire.Hosting.Milvus.Tests (2)
Aspire.Hosting.MongoDB (3)
Aspire.Hosting.MongoDB.Tests (4)
Aspire.Hosting.MySql (3)
Aspire.Hosting.MySql.Tests (4)
Aspire.Hosting.Oracle (3)
Aspire.Hosting.Oracle.Tests (2)
Aspire.Hosting.PostgreSQL (3)
Aspire.Hosting.PostgreSQL.Tests (8)
Aspire.Hosting.Python (37)
PythonAppResourceBuilderExtensions.cs (33)
363var resource = createResource(name, "python", Path.GetFullPath(appDirectory, builder.AppHostDirectory));
434if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
510var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
512if (File.Exists(Path.Combine(appDirectoryFullPath, "pyproject.toml")) ||
513File.Exists(Path.Combine(appDirectoryFullPath, "requirements.txt")))
532var uvLockPath = Path.Combine(resource.WorkingDirectory, "uv.lock");
641var requirementsTxtPath = Path.Combine(resource.WorkingDirectory, "requirements.txt");
681var pyprojectTomlPath = Path.Combine(resource.WorkingDirectory, "pyproject.toml");
759var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
763var appHostParentDirectory = Path.GetDirectoryName(builder.AppHostDirectory);
769var relativePath = Path.GetRelativePath(appHostParentDirectory, appDirectoryFullPath);
771!Path.IsPathRooted(relativePath);
776return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath);
784var venvPath = Path.Combine(currentDirectory, virtualEnvironmentPath);
802var parentDirectory = Path.GetDirectoryName(currentDirectory);
814return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath);
870var resolvedPath = Path.IsPathRooted(virtualEnvironmentPath)
872: Path.GetFullPath(virtualEnvironmentPath, builder.Resource.WorkingDirectory);
952programPath = Path.GetFullPath(entrypoint, workingDirectory);
973var venvPath = Path.IsPathRooted(annotation.VirtualEnvironment.VirtualEnvironmentPath)
975: Path.GetFullPath(annotation.VirtualEnvironment.VirtualEnvironmentPath, workingDirectory);
979interpreterPath = Path.Join(venvPath, "Scripts", "python.exe");
983interpreterPath = Path.Join(venvPath, "bin", "python");
1157if (File.Exists(Path.Combine(workingDirectory, "pyproject.toml")))
1162else if (File.Exists(Path.Combine(workingDirectory, "requirements.txt")))
1268foreach (var directory in pathVariable.Split(Path.PathSeparator))
1270var fullPath = Path.Combine(directory, commandWithExt);
1281foreach (var directory in pathVariable.Split(Path.PathSeparator))
1283var fullPath = Path.Combine(directory, command);
1376var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath)
1378: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
1512var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath)
1514: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
Aspire.Hosting.Python.Tests (151)
AddPythonAppTests.cs (142)
29var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
33options.ProjectDirectory = Path.GetFullPath(projectDirectory);
67var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
71options.ProjectDirectory = Path.GetFullPath(projectDirectory);
167Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
171Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
206Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
210Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
249Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
253Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
278var pythonExecutable = Path.Combine(projectDirectory,
289var scriptPath = Path.Combine(projectDirectory, "main.py");
292var requirementsPath = Path.Combine(projectDirectory, "requirements.txt");
296var dockerFilePath = Path.Combine(projectDirectory, "Dockerfile");
330var relativePipPath = Path.Combine(
335var pipPath = Path.GetFullPath(relativePipPath, projectDirectory);
368? Path.Join(expectedVenvPath, "Scripts", "python.exe")
369: Path.Join(expectedVenvPath, "bin", "python");
419var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path));
423Assert.Equal(Path.Join(expectedProjectDirectory, "custom-venv", "Scripts", "python.exe"), pythonProjectResource.Command);
427Assert.Equal(Path.Join(expectedProjectDirectory, "custom-venv", "bin", "python"), pythonProjectResource.Command);
454Assert.Equal(Path.Join(venvDir.FullName, "Scripts", "python.exe"), pythonProjectResource.Command);
458Assert.Equal(Path.Join(venvDir.FullName, "bin", "python"), pythonProjectResource.Command);
532var appVenvPath = Path.Combine(appDir.FullName, ".venv");
545var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, appDir.FullName));
546var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv");
562var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
566var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
608var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
612var appVenvPath = Path.Combine(appDirPath, ".venv");
615var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
665var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, appDir.FullName));
666var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv");
682var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
686var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
690var customVenvPath = Path.Combine(appDirPath, "custom-venv");
742var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path));
992var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path));
997Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
1001Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
1026var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path));
1030Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
1034Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
1060var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path));
1064Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", $"{executableName}.exe"), pythonProjectResource.Command);
1068Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", executableName), pythonProjectResource.Command);
1269File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1270File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent);
1271File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1273var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
1292var scriptDockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile");
1295var moduleDockerfilePath = Path.Combine(outputDir.FullName, "module-app.Dockerfile");
1298var executableDockerfilePath = Path.Combine(outputDir.FullName, "executable-app.Dockerfile");
1335File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1337File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1339var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
1358var scriptDockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile");
1361var moduleDockerfilePath = Path.Combine(outputDir.FullName, "module-app.Dockerfile");
1364var executableDockerfilePath = Path.Combine(outputDir.FullName, "executable-app.Dockerfile");
1397var appDirectory = Path.Combine(workspace.Path, "myapp");
1399var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1441var appDirectory = Path.Combine(workspace.Path, "myapp");
1443var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1481var appDirectory = Path.Combine(workspace.Path, "myapp");
1483var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1516var appDirectory = Path.Combine(workspace.Path, "myapp");
1518var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1527Assert.Equal(Path.Combine(appDirectory, "main.py"), launchConfig.ProgramPath);
1537var appDirectory = Path.Combine(workspace.Path, "myapp");
1539var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1561var appDirectory = Path.Combine(workspace.Path, "myapp");
1563var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1585var appDirectory = Path.Combine(workspace.Path, "myapp");
1587var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1589var customWorkingDirectory = Path.Combine(workspace.Path, "custom");
1600Path.Combine(builder.AppHostDirectory, customWorkingDirectory));
1612var appDirectory = Path.Combine(workspace.Path, "myapp");
1614var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1616var customWorkingDirectory = Path.Combine(workspace.Path, "custom");
1626Path.Combine(builder.AppHostDirectory, customWorkingDirectory));
1628Assert.Equal(Path.Combine(expectedWorkingDirectory, "main.py"), launchConfig.ProgramPath);
1653var appDirectory = Path.Combine(workspace.Path, "myapp");
1655var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1686var appDirectory = Path.Combine(workspace.Path, "myapp");
1688var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv");
1795File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1796File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent);
1797File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1812var dockerfilePath = Path.Combine(outputDir.FullName, "custom-images-app.Dockerfile");
1842File.WriteAllText(Path.Combine(projectDirectory, "requirements.txt"), requirementsContent);
1843File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1854var dockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile");
1892File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1893File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1904var dockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile");
1925File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1936var dockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile");
1959File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1960File.WriteAllText(Path.Combine(projectDirectory, ".python-version"), pythonVersionContent);
1973var scriptDockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile");
1976var moduleDockerfilePath = Path.Combine(outputDir.FullName, "module-app.Dockerfile");
1979var executableDockerfilePath = Path.Combine(outputDir.FullName, "executable-app.Dockerfile");
2008var scriptPath = Path.Combine(workspace.Path, scriptName);
2012var pyprojectPath = Path.Combine(workspace.Path, "pyproject.toml");
2042var scriptPath = Path.Combine(workspace.Path, scriptName);
2046var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2077var scriptPath = Path.Combine(workspace.Path, scriptName);
2081var pyprojectPath = Path.Combine(workspace.Path, "pyproject.toml");
2083var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2107var scriptPath = Path.Combine(workspace.Path, scriptName);
2131var scriptPath = Path.Combine(workspace.Path, scriptName);
2154var scriptPath = Path.Combine(workspace.Path, scriptName);
2158var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2182var scriptPath = Path.Combine(workspace.Path, scriptName);
2186var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2211var scriptPath = Path.Combine(workspace.Path, "main.py");
2239var scriptPath = Path.Combine(workspace.Path, "main.py");
2243var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2282var scriptPath = Path.Combine(workspace.Path, "main.py");
2285var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2312var scriptPath = Path.Combine(workspace.Path, "main.py");
2315var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2346var scriptPath = Path.Combine(workspace.Path, "main.py");
2349var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2382var scriptPath = Path.Combine(workspace.Path, "main.py");
2385var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2412var scriptPath = Path.Combine(workspace.Path, "main.py");
2415var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2444var scriptPath = Path.Combine(workspace.Path, "main.py");
2447var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2476var scriptPath = Path.Combine(workspace.Path, "main.py");
2479var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
2512var scriptPath = Path.Combine(workspace.Path, "main.py");
2566var scriptPath = Path.Combine(workspace.Path, scriptName);
2569var requirementsPath = Path.Combine(workspace.Path, "requirements.txt");
Aspire.Hosting.Qdrant (2)
Aspire.Hosting.Qdrant.Tests (2)
Aspire.Hosting.Radius (19)
Publishing\RadiusDeploymentPipelineStep.cs (10)
172var kubeConfigPath = Path.Combine(kubeConfigHome.FullName, ".kube", "config");
173Directory.CreateDirectory(Path.GetDirectoryName(kubeConfigPath)!);
284["KUBECONFIG"] = Path.Combine(kubeConfigHome, ".kube", "config"),
300Pin("AZURE_CONFIG_DIR", Path.Combine(realHome, ".azure"));
304Pin("AWS_CONFIG_FILE", Path.Combine(realHome, ".aws", "config"));
305Pin("AWS_SHARED_CREDENTIALS_FILE", Path.Combine(realHome, ".aws", "credentials"));
309Pin("CLOUDSDK_CONFIG", Path.Combine(realHome, ".config", "gcloud"));
525var bicepPath = Path.Combine(outputDir, "app.bicep");
700var filePath = Path.Combine(directory.FullName, "parameters.json");
741var directory = Path.GetDirectoryName(parametersFilePath);
Aspire.Hosting.Radius.Tests (35)
Deployment\ControlPlaneVersionGateTests.cs (20)
85var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test");
86var expectedKubeConfig = Path.Combine(home, ".kube", "config");
116var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test");
117var realHome = Path.Combine(Path.GetTempPath(), "aspire-radius-real-home");
125Assert.Equal(Path.Combine(home, ".kube", "config"), environment["KUBECONFIG"]);
128Assert.Equal(Path.Combine(realHome, ".azure"), environment["AZURE_CONFIG_DIR"]);
129Assert.Equal(Path.Combine(realHome, ".aws", "config"), environment["AWS_CONFIG_FILE"]);
130Assert.Equal(Path.Combine(realHome, ".aws", "credentials"), environment["AWS_SHARED_CREDENTIALS_FILE"]);
131Assert.Equal(Path.Combine(realHome, ".config", "gcloud"), environment["CLOUDSDK_CONFIG"]);
142var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test");
143var realHome = Path.Combine(Path.GetTempPath(), "aspire-radius-real-home");
151Assert.Equal(Path.Combine(realHome, ".config", "gcloud"), environment["CLOUDSDK_CONFIG"]);
161var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test");
282Assert.Equal(Path.Combine(version.Environment!["HOME"]!, ".kube", "config"), kubeConfig);
Aspire.Hosting.Redis (2)
Aspire.Hosting.Redis.Tests (1)
Aspire.Hosting.RemoteHost (23)
Aspire.Hosting.RemoteHost.Tests (41)
AssemblyLoaderTests.cs (13)
30[integrationLibs.Path, applicationBase.Path, Path.Combine(applicationBase.Path, "missing")]);
82var runtimeAssemblyPath = System.IO.Path.Combine(packageAssemblyDirectory.Path, "Aspire.Hosting.Azure.OperationalInsights.dll");
83var resourceAssemblyPath = System.IO.Path.Combine(packageAssemblyDirectory.Path, "de", "Aspire.Hosting.resources.dll");
85Directory.CreateDirectory(System.IO.Path.GetDirectoryName(resourceAssemblyPath)!);
88var manifestPath = System.IO.Path.Combine(manifestDirectory.Path, "integration-package-probe-manifest.json");
108applicationBasePath: System.IO.Path.Combine(manifestDirectory.Path, "missing"),
128var packageAssemblyPath = System.IO.Path.Combine(packageAssemblyDirectory.Path, "Aspire.Hosting.PackageIntegration.dll");
131var manifestPath = System.IO.Path.Combine(manifestDirectory.Path, "integration-package-probe-manifest.json");
145applicationBasePath: System.IO.Path.Combine(manifestDirectory.Path, "missing"),
204var firstAssemblyPath = System.IO.Path.Combine(closureDirectory.Path, "Aspire.Hosting.Test.First.dll");
205var secondAssemblyPath = System.IO.Path.Combine(closureDirectory.Path, "Aspire.Hosting.Test.Second.dll");
209var manifestPath = System.IO.Path.Combine(manifestDirectory.Path, IntegrationPackageProbeManifest.FileName);
282File.WriteAllText(System.IO.Path.Combine(Path, fileName), string.Empty);
IntegrationLoadContextTests.cs (8)
41var assemblyPath = Path.Combine(AppContext.BaseDirectory, "Aspire.Hosting.CodeGeneration.Go.dll");
47var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json");
75var nativeLibraryPath = Path.Combine(manifestDirectory.FullName, "runtimes", "linux-x64", "native", "libe_sqlite3.so");
76Directory.CreateDirectory(Path.GetDirectoryName(nativeLibraryPath)!);
79var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json");
104var resourceAssemblyPath = Path.Combine(manifestDirectory.FullName, "fr", "Aspire.Hosting.Redis.resources.dll");
105Directory.CreateDirectory(Path.GetDirectoryName(resourceAssemblyPath)!);
108var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json");
Aspire.Hosting.Rust (57)
RustDockerfileGenerator.cs (21)
63var workingDirectory = Path.GetFullPath(resource.WorkingDirectory);
68&& !File.Exists(Path.Combine(workingDirectory, ".dockerignore")))
210if (Path.IsPathRooted(manifestPath))
218? manifestPath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar)
221var filesystemWorkingDirectory = Path.GetFullPath(workingDirectory);
222var filesystemManifest = Path.GetFullPath(platformManifestPath, workingDirectory);
236var relativeManifest = Path.GetRelativePath(canonicalWorkingDirectory, canonicalManifest);
238if (Path.IsPathRooted(relativeManifest)
240|| relativeManifest.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal)
241|| relativeManifest.StartsWith($"..{Path.AltDirectorySeparatorChar}", StringComparison.Ordinal))
257var relativePath = Path.GetRelativePath(workingDirectory, path);
263if (Path.IsPathRooted(relativePath)
265|| relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal)
266|| relativePath.StartsWith($"..{Path.AltDirectorySeparatorChar}", StringComparison.Ordinal))
272[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
278var candidate = Path.Combine(current, segments[i]);
283current = Path.Combine(current, segments[i]);
308string.Equals(Path.GetFileName(entry), segments[i], StringComparison.Ordinal))
311Path.GetFileName(entry).Normalize(NormalizationForm.FormC),
src\Shared\PathNormalizer.cs (22)
18path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
20return Path.GetFullPath(path);
64var root = Path.GetPathRoot(path);
71[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
82var candidate = Path.Combine(current, segment);
91!Path.Exists(Path.Combine(current, caseVariant)))
103var entryName = Path.GetFileName(entry);
210var fullPath = Path.GetFullPath(path);
211var root = Path.GetPathRoot(fullPath);
221[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
227current = Path.Combine(current, segments[i]);
276current = Path.Combine(current, segments[j]);
299var fullPath = Path.GetFullPath(path);
300var root = Path.GetPathRoot(fullPath);
309[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
315current = Path.Combine(current, segments[i]);
328current = Path.Combine(current, segments[j]);
Aspire.Hosting.Rust.Tests (99)
AddRustAppPublishTests.cs (59)
40File.WriteAllText(Path.Combine(source, "rust-toolchain.toml"), """
418Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
473Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
497File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n");
503Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
515File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n");
521Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
531var customDockerfile = Path.Combine(customContext.FullName, "Dockerfile.prod");
545Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
566Path.Combine(outputDir.FullName, "api.Dockerfile"),
590var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "Crates", "API"));
591File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n");
593var differentlyCasedPath = Path.Combine("crates", "api", "cargo.toml");
594if (!File.Exists(Path.Combine(sourceDir.FullName, differentlyCasedPath)))
604var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
617var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, decomposedDirectoryName));
619File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n");
621var composedManifestPath = Path.Combine(composedDirectoryName, "Cargo.toml");
622if (!File.Exists(Path.Combine(sourceDir.FullName, composedManifestPath)))
627var storedDirectoryName = Path.GetFileName(Assert.Single(Directory.EnumerateDirectories(sourceDir.FullName)));
634var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
651var sourceDir = Directory.CreateDirectory(Path.Combine(restrictedAncestor.FullName, "source"));
652var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "Crates", "API"));
655File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n");
679Path.Combine(outputDir.FullName, "api.Dockerfile"),
717var manifestDirectory = Directory.CreateDirectory(Path.Combine(source, @"crates\api"));
718File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n");
746var canonicalManifest = Path.Combine(canonicalSourceDir, "crates", "api", "Cargo.toml");
747var manifestPath = Path.GetRelativePath(sourceDir.FullName, canonicalManifest);
754var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
771var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "Crates", "API"));
773File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n");
780var differentlyCasedCanonicalManifest = Path.Combine(canonicalSourceDir, "crates", "api", "cargo.toml");
786var manifestPath = Path.GetRelativePath(sourceDir.FullName, differentlyCasedCanonicalManifest);
793var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
805File.WriteAllText(Path.Combine(outsideDir.FullName, "Cargo.toml"), "[package]\nname = \"outside\"\n");
806CreateDirectorySymbolicLinkOrSkip(Path.Combine(sourceDir.FullName, "linked"), outsideDir.FullName);
813Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
822var firstLink = Path.Combine(sourceDir.FullName, "linked");
823var secondLink = Path.Combine(sourceDir.FullName, "loop");
836Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")));
863configureResource: app => app.WithCargoManifestPath(Path.Combine(Path.GetTempPath(), "Cargo.toml"))));
874File.WriteAllText(Path.Combine(source, "Cargo.lock"), "version = 4\n"));
883configureSource: source => File.WriteAllText(Path.Combine(source, "Cargo.lock"), "version = 4\n"),
927var first = await File.ReadAllTextAsync(Path.Combine(firstOutputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
928var second = await File.ReadAllTextAsync(Path.Combine(secondOutputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
945var first = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
946var second = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "worker.Dockerfile"), TestContext.Current.CancellationToken);
974var ignore = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"), TestContext.Current.CancellationToken);
988File.WriteAllText(Path.Combine(sourceDir.FullName, ".dockerignore"), "*.md\n");
995Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore")));
1010File.WriteAllText(Path.Combine(relocatedDir.FullName, "Dockerfile"), "FROM scratch\n");
1031Assert.Equal(Path.Combine(relocatedDir.FullName, "Dockerfile"), dockerfile.DockerfilePath);
1053File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Cargo.lock"), "version = 4\n");
1057File.WriteAllText(Path.Combine(sourceDir.FullName, "Cargo.lock"), "version = 4\n");
1062builder.AddRustApp("api", sourceDir.FullName + Path.DirectorySeparatorChar)
1066var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
1143return await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
RustDockerfileShellTests.cs (16)
17var currentArtifact = Path.Combine(targetDirectory, "release", "api");
19$"mkdir -p {ShellQuote(Path.GetDirectoryName(currentArtifact)!)} && " +
31Assert.Equal("current", File.ReadAllText(Path.Combine(artifactDirectory, "api")));
41var cargoStub = Path.Combine(workspace.WorkspaceRoot.FullName, "cargo-stub");
56Assert.False(File.Exists(Path.Combine(artifactDirectory, "api")));
66var rootCandidate = Path.Combine(targetDirectory, "release", "api");
67var staleTargetCandidate = Path.Combine(targetDirectory, "stale-target", "release", "api");
68var currentTargetCandidate = Path.Combine(targetDirectory, "current-target", "release", "api");
69Directory.CreateDirectory(Path.GetDirectoryName(rootCandidate)!);
70Directory.CreateDirectory(Path.GetDirectoryName(staleTargetCandidate)!);
74$"mkdir -p {ShellQuote(Path.GetDirectoryName(currentTargetCandidate)!)} && " +
87Assert.Equal("current", File.ReadAllText(Path.Combine(artifactDirectory, "api")));
97var markerPath = Path.Combine(workspace.WorkspaceRoot.FullName, "command-substitution-ran");
121var invocationLog = Path.Combine(workspace.WorkspaceRoot.FullName, "invocations");
153var invocationLog = Path.Combine(workspace.WorkspaceRoot.FullName, "invocations");
181var stubPath = Path.Combine(directory, name);
RustPublicApiTests.cs (12)
242Assert.Equal(Path.GetFullPath(builder.AppHostDirectory), launchConfig.WorkingDirectory);
296var expected = Path.Combine("/app/target", "debug", OperatingSystem.IsWindows() ? "my-service.exe" : "my-service");
327var expected = Path.Combine(
328Path.GetFullPath("/elsewhere", builder.AppHostDirectory),
359Directory.CreateDirectory(Path.Combine(crate.Path, "src"));
360crate.Write(Path.Combine("src", "main.rs"), "fn main() {}");
381Path.Combine("debug", OperatingSystem.IsWindows() ? "first.exe" : "first"),
384Path.Combine("debug", OperatingSystem.IsWindows() ? "second.exe" : "second"),
419Assert.StartsWith(Path.GetFullPath("/first-target", builder.AppHostDirectory), Assert.IsType<RustCargoLaunchTarget>(first.Cargo).ExecutablePath);
420Assert.StartsWith(Path.GetFullPath("/second-target", builder.AppHostDirectory), Assert.IsType<RustCargoLaunchTarget>(second.Cargo).ExecutablePath);
448Assert.EndsWith(Path.Combine("debug", OperatingSystem.IsWindows() ? "first.exe" : "first"), Assert.IsType<RustCargoLaunchTarget>(first.Cargo).ExecutablePath);
449Assert.EndsWith(Path.Combine("debug", OperatingSystem.IsWindows() ? "second.exe" : "second"), Assert.IsType<RustCargoLaunchTarget>(second.Cargo).ExecutablePath);
Aspire.Hosting.Sdk.Tests (145)
AppHostSdkTargetsTests.cs (139)
104var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
128var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
167var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
197var emptyPathDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-path"));
223var nonExecutableDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "non-executable"));
224var nonExecutableDnxPath = Path.Combine(nonExecutableDirectory.FullName, "dnx");
231var executableDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "executable"));
234var path = $"{nonExecutableDirectory.FullName}{Path.PathSeparator}{CreatePathWithoutAspire(executableDirectory.FullName)}";
252var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(project.ProjectDirectory, RelativeCliDirectory));
263Assert.True(Path.IsPathFullyQualified(properties["_AspireResolvedCliPath"]));
271var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
292var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
307var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake cli !& (shim)^,;=+[]{}~@"));
325var emptyPathDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-path"));
332var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
350var appHostDirectory = Path.Combine(workspace.Path, "FileApp");
352var appHostFile = Path.Combine(appHostDirectory, "apphost.cs");
373var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
424var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "selected cli"));
425var captureFile = Path.Combine(workspace.Path, "aspire-args.txt");
461var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "selected cli"));
462var captureFile = Path.Combine(workspace.Path, "dnx-args.txt");
504var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "native aspire"));
505var captureFile = Path.Combine(workspace.Path, "aspire-native-args.txt");
544var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake cli !& (shim)^,;=+[]{}~@"));
545var captureFile = Path.Combine(workspace.Path, "aspire-args.txt");
581var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
582var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
597var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
604var aspireHome = Path.Combine(workspace.Path, "aspire-home");
630var staleCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "stale-cli"));
636var dnxDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, dnxDirectoryName));
641var aspireHome = Path.Combine(workspace.Path, aspireHomeDirectoryName);
664Assert.Equal(dnxBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"]));
665Assert.Equal(dnxBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"]));
667Assert.NotEqual(staleBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"]));
678var managedDir = Path.Combine(workspace.Path, "bundle", "managed");
681File.Move(bundle.DashboardPath, Path.Combine(managedDir, Path.GetFileName(bundle.DashboardPath)));
711var managedDir = Path.Combine(workspace.Path, "bundle", "managed");
712var managedPath = Path.Combine(managedDir, OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed");
718expectedDashboardPath = Path.Combine(managedDir, Path.GetFileName(bundle.DashboardPath));
736Assert.Equal(bundle.DcpDirectory + Path.DirectorySeparatorChar, task.DcpDir);
737Assert.Equal(expectedDashboardDir + Path.DirectorySeparatorChar, task.AspireDashboardDir);
739Assert.Equal(managedDir + Path.DirectorySeparatorChar, task.AspireTerminalHostDir);
751Path.Combine(workspace.Path, "cli $HOME `aspire-test-command`"));
753var aspireHome = Path.Combine(workspace.Path, "empty-aspire-home");
765Assert.Equal(selectedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"]));
766Assert.Equal(selectedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"]));
775var selectedCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "selected-cli"));
777var staleCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "stale-cli"));
780var aspireHome = Path.Combine(workspace.Path, "aspire-home");
793Assert.Equal(selectedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"]));
794Assert.Equal(selectedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"]));
796Assert.NotEqual(staleBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"]));
806var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "native%ASPIRE_TEST_LITERAL%"));
808var aspireHome = Path.Combine(workspace.Path, "aspire-home");
820Assert.Equal(selectedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"]));
821Assert.Equal(selectedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"]));
824Assert.False(Directory.Exists(Path.Combine(workspace.Path, "nativeexpanded")));
832var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
835var aspireHome = Path.Combine(workspace.Path, "aspire-home");
861var fakeCommandDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-command"));
863var commandShimPath = Path.Combine(fakeCommandDirectory.FullName, "aspire.cmd");
869var childPidPath = Path.Combine(workspace.Path, "child.pid");
871var projectPath = Path.Combine(workspace.Path, "RunAspireCliCommand.proj");
929var commandPath = Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "hang.cmd" : "hang");
998var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1000var environmentAspireHome = Path.Combine(workspace.Path, "environment-aspire-home");
1001var propertyAspireHome = Path.Combine(workspace.Path, "property-aspire-home");
1015Assert.False(Directory.Exists(Path.Combine(propertyAspireHome, "bundle")));
1023var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1049var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1050var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1065var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1066var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1081var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1082var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1097var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1098var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1113var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli"));
1114var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1129var emptyPathDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-path"));
1143var projectDirectory = Path.Combine(workspace.Path, "AppHost");
1146var sdkTargetsPath = SecurityElement.Escape(Path.Combine(repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets"));
1147var packageReferencesPath = Path.Combine(projectDirectory, "obj", "package-references.txt");
1149await File.WriteAllTextAsync(Path.Combine(projectDirectory, "AppHost.csproj"),
1189var projectDirectory = Path.Combine(workspace, "AppHost");
1192var appHostTargetsPath = SecurityElement.Escape(Path.Combine(repoRoot, "src", "Aspire.Hosting.AppHost", "build", "Aspire.Hosting.AppHost.in.targets"));
1193var projectFile = Path.Combine(projectDirectory, "AppHost.csproj");
1224await File.WriteAllTextAsync(Path.Combine(projectDirectory, "Program.cs"), """
1299var aspirePath = Path.Combine(fakeCliDirectory, "aspire");
1315var aspirePath = Path.Combine(fakeCliDirectory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1352Directory.CreateDirectory(Path.Combine(layoutRoot, "bundle", "managed"));
1354File.WriteAllText(Path.Combine(bundle.DcpDirectory, OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), "");
1356Path.Combine(layoutRoot, "bundle", "managed", OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"),
1364var bundleRoot = Path.Combine(layoutRoot, "bundle");
1365var dcpDirectory = Path.Combine(bundleRoot, "dcp");
1366var dashboardDirectory = Path.Combine(bundleRoot, "dashboard");
1367var dashboardPath = Path.Combine(dashboardDirectory, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard");
1373var aspirePath = Path.Combine(fakeCliDirectory, $"aspire{extension}");
1409var dnxPath = Path.Combine(fakeCliDirectory, OperatingSystem.IsWindows() ? "dnx.cmd" : "dnx");
1413var fakeSdkDirectory = Directory.CreateDirectory(Path.Combine(fakeCliDirectory, "sdk", AspireCliVersion));
1414await File.WriteAllTextAsync(Path.Combine(fakeSdkDirectory.FullName, "dotnet.dll"), "");
1464await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "fail-version"), "");
1478var aspirePath = Path.Combine(fakeCliDirectory, "aspire.exe");
1486var sourceDirectory = Path.GetDirectoryName(fakeCommandHostPath)!;
1489File.Copy(sourcePath, Path.Combine(destinationDirectory, Path.GetFileName(sourcePath)), overwrite: true);
1492return Path.Combine(destinationDirectory, Path.GetFileName(fakeCommandHostPath));
1497var captureFile = Path.Combine(workingDirectory, $"{command}-shadow-invoked.txt");
1501Path.Combine(workingDirectory, $"{command}.cmd"),
1516await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), $$"""
1528var aspirePath = Path.Combine(fakeCliDirectory, "aspire");
1544await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), $$"""
1557var aspirePath = Path.Combine(fakeCliDirectory, "aspire");
1578await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), """
1591var aspirePath = Path.Combine(fakeCliDirectory, "aspire");
1608await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), """
1625var aspirePath = Path.Combine(fakeCliDirectory, "aspire");
1646await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), """
1662var aspirePath = Path.Combine(fakeCliDirectory, "aspire");
1715var vswherePath = Path.Combine(
1727Path.GetDirectoryName(vswherePath)!,
1764=> OperatingSystem.IsWindows() ? Path.Combine(Path.GetDirectoryName(dnxPath)!, "dotnet.exe") : dnxPath;
1789? $"exec \"{Path.Combine(Path.GetDirectoryName(dnxPath)!, "sdk", AspireCliVersion, "dotnet.dll")}\" dnx "
1838File.Exists(Path.Combine(aspireHome, "bundle", "dcp", OperatingSystem.IsWindows() ? "dcp.exe" : "dcp")),
1841File.Exists(Path.Combine(aspireHome, "bundle", "managed", OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed")),
1849return Path.Combine(project.ProjectDirectory, "bin", "Debug", "net8.0", executableName);
1858? $"{directory}{Path.PathSeparator}{Environment.GetEnvironmentVariable(pathEnvironmentVariable)}"
1878.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)
1881return string.Join(Path.PathSeparator, firstDirectories.Concat(pathDirectories));
1890return executableNames.Any(executableName => File.Exists(Path.Combine(directory.Trim().Trim('"'), executableName)));
1999while (directory is not null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
Aspire.Hosting.Seq.Tests (3)
Aspire.Hosting.SqlServer (3)
Aspire.Hosting.Tasks (33)
ResolveAspireCliBundle.cs (24)
175var candidateCliPaths = EnumerateCandidateCliPaths(Path.GetFullPath(cliPath));
178var cliDirectory = Path.GetDirectoryName(candidateCliPath);
211var fullPath = Path.GetFullPath(layoutPath);
217if (TryResolveBundleRoot(Path.Combine(fullPath, BundleDirectoryName), out resolution))
229var dcpDir = Path.Combine(bundleRoot, "dcp");
230var dcpPath = Path.Combine(dcpDir, IsWindows() ? "dcp.exe" : "dcp");
231var managedDir = Path.Combine(bundleRoot, "managed");
232var managedPath = Path.Combine(managedDir, IsWindows() ? "aspire-managed.exe" : "aspire-managed");
238var dashboardDir = Path.Combine(bundleRoot, "dashboard");
239var dashboardPath = Path.Combine(dashboardDir, IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard");
250dashboardPath = Path.Combine(managedDir, IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard");
269return path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) ||
270path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal)
272: path + Path.DirectorySeparatorChar;
275private static bool IsWindows() => Path.DirectorySeparatorChar == '\\';
318"script" or "pr" or "localhive" => Path.GetDirectoryName(cliDirectory) ?? cliDirectory,
322yield return Path.GetDirectoryName(cliDirectory);
327var storeRoot = Path.Combine(cliDirectory, ".store", "aspire.cli");
363var versionsRoot = Path.Combine(layoutPath, VersionsDirectoryName);
369.ThenByDescending(Path.GetFileName, StringComparer.OrdinalIgnoreCase))
384var directoryName = Path.GetFileName(path);
439var directoryName = Path.GetFileName(path);
459var sidecarPath = Path.Combine(cliDirectory, InstallSidecarFileName);
486? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire")
Aspire.Hosting.Testing (3)
Aspire.Hosting.Testing.Tests (10)
Aspire.Hosting.Tests (667)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (18)
73var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}");
103var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}");
139var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}");
179var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}");
222var dockerfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Dockerfile");
223var differentCasingDockerfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "DOCKERFILE");
242var contextPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app");
243var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "out");
247var dockerfilePath = Path.Combine(outputPath, "Dockerfile");
261await File.WriteAllTextAsync(Path.Combine(contextPath, ".dockerignore"), "secrets\n");
272var contextPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app");
273var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "out");
277var dockerfilePath = Path.Combine(outputPath, "Dockerfile");
279await File.WriteAllTextAsync(Path.Combine(contextPath, ".dockerignore"), "secrets\n");
Backchannel\AuxiliaryBackchannelTests.cs (12)
307Assert.True(Path.IsPathRooted(appHostInfo.AppHostPath), $"Expected absolute path but got: {appHostInfo.AppHostPath}");
331var fileName = Path.GetFileName(service.SocketPath);
334var directory = Path.GetDirectoryName(service.SocketPath);
336Assert.EndsWith(Path.Combine(".aspire", "cli", "bch"), directory);
684var realDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "real"));
685var symlinkDirectory = Path.Combine(tempRoot.FullName, "link");
688var appHostFileViaSymlink = Path.Combine(symlinkDirectory, "apphost.cs");
696var socketAppHostId = Path.GetFileName(socket.SocketPath)[..BackchannelConstants.CompactAppHostIdLength];
718var appHostFile = new FileInfo(Path.Combine(tempRoot.FullName, "AppHost.cs"));
720var differentlyCasedPath = Path.Combine(tempRoot.FullName, "APPHOST.CS");
729var socketAppHostId = Path.GetFileName(socket.SocketPath)[..BackchannelConstants.CompactAppHostIdLength];
750var appHostFile = Path.Combine(tempRoot.FullName, "apphost.cs");
Dashboard\DashboardEventHandlersTests.cs (16)
587var tempDir = Path.GetTempFileName();
593var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
594var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
676var tempDir = Path.GetTempFileName();
682var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard.exe");
683var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
684var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
745var tempDir = Path.GetTempFileName();
751var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard");
752var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
753var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
814var tempDir = Path.GetTempFileName();
820var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
821var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
885var dashboardExecutable = Path.Combine(tempDir.FullName, executableName);
914var dashboardDll = Path.Combine(tempDirectory.FullName, "Aspire.Dashboard.dll");
Dcp\ConfigureDefaultDcpOptionsTests.cs (10)
21var managedPath = Path.Combine(Path.GetTempPath(), "aspire-fake-bundle", "managed", managedExe);
38var dashboardDll = Path.Combine(Path.GetTempPath(), "fake-dashboard", "Aspire.Dashboard.dll");
63var managedPath = Path.Combine(Path.GetTempPath(), "aspire-fake-bundle", "managed", managedExe);
64var explicitTerminalHostPath = Path.Combine(Path.GetTempPath(), "custom-terminalhost", "Aspire.TerminalHost.exe");
86var managedPath = Path.Combine(Path.GetTempPath(), "aspire-fake-bundle", "managed", managedExe);
Dcp\DcpCliArgsTests.cs (11)
93var explicitDcpPath = Path.Combine("explicit", "dcp");
94var explicitDashboardPath = Path.Combine("explicit", "dashboard");
96builder.Configuration[BundleDiscovery.DcpPathEnvVar] = Path.Combine("bundle", "dcp");
97builder.Configuration[BundleDiscovery.DashboardPathEnvVar] = Path.Combine("bundle", "dashboard");
104Assert.Equal(Path.Combine("explicit", "ext"), dcpOptions.ExtensionsPath);
112var bundleDcpPath = Path.Combine("bundle", "dcp");
113var bundleDashboardPath = Path.Combine("bundle", "dashboard");
123Assert.Equal(Path.Combine(bundleDcpPath, "ext"), dcpOptions.ExtensionsPath);
131var bundleDcpPath = Path.Combine("bundle", "dcp");
132var bundleDashboardPath = Path.Combine("bundle", "dashboard");
142Assert.Equal(Path.Combine(bundleDcpPath, "ext"), dcpOptions.ExtensionsPath);
Dcp\DcpExecutorTests.cs (23)
6046var expectedCertificatesRoot = Path.Join(aspireStoreDirectory.Path, ".aspire", "dcp", "executables", "TestExecutable-12345678", "certificates");
6048Assert.Equal(Path.Join(expectedCertificatesRoot, "certs"), sslCertDir);
6049Assert.Equal(Path.Join(expectedCertificatesRoot, "cert.pem"), sslCertFile);
6094var certificatesRoot = Path.Join(aspireStoreDirectory.Path, ".aspire", "dcp", "executables", "TestExecutable-12345678", "certificates");
6095var bundlesDirectory = Path.Join(certificatesRoot, "bundles");
6147var sslCertDirs = sslCertDir.Split(Path.PathSeparator);
6148Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]);
6158options.StartInfo.Environment["SSL_CERT_DIR"] = string.Join(Path.PathSeparator, expectedExistingSslCertDirs);
6167var sslCertDirs = sslCertDir.Split(Path.PathSeparator);
6168Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]);
6169Assert.Equal(expectedExistingSslCertDir.Split(Path.PathSeparator), sslCertDirs.Skip(1));
6170}, string.Join(Path.PathSeparator, expectedExistingSslCertDirs), options).Dispose();
6184var sslCertDirs = sslCertDir.Split(Path.PathSeparator);
6186Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]);
6203var sslCertDirs = sslCertDir.Split(Path.PathSeparator);
6205Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]);
6217var sslCertDirs = sslCertDir.Split(Path.PathSeparator);
6218Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]);
7461? Path.GetFullPath(Path.Combine("test-dotnet-root", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"))
8055var projectPath = Path.Combine("src", "app.cs");
8101var projectPath = Path.Combine("src", "app.cs");
11427var aspireStore = new AspireStore(Path.Join(aspireStoreDirectory, ".aspire"), fileSystemService);
Dcp\DcpHostNotificationTests.cs (21)
582var terminalHostPath = Path.Combine(directory.FullName, "aspire-managed.exe");
584File.WriteAllText(Path.Combine(directory.FullName, "conpty.dll"), "");
585Directory.CreateDirectory(Path.Combine(directory.FullName, architectureDirectory));
586File.WriteAllText(Path.Combine(directory.FullName, architectureDirectory, "OpenConsole.exe"), "");
612var terminalHostPath = Path.Combine(directory.FullName, "aspire-managed.exe");
614var nativeDirectory = Path.Combine(directory.FullName, "runtimes", runtimeIdentifier, "native");
615Directory.CreateDirectory(Path.Combine(nativeDirectory, nativeHostDirectory));
616File.WriteAllText(Path.Combine(nativeDirectory, "conpty.dll"), "");
617File.WriteAllText(Path.Combine(nativeDirectory, nativeHostDirectory, "OpenConsole.exe"), "");
642var terminalHostPath = Path.Combine(directory.FullName, "aspire-managed.exe");
646File.WriteAllText(Path.Combine(directory.FullName, "conpty.dll"), "");
652Directory.CreateDirectory(Path.Combine(directory.FullName, architectureDirectory));
653File.WriteAllText(Path.Combine(directory.FullName, architectureDirectory, "OpenConsole.exe"), "");
803Path.Combine(Directory.GetCurrentDirectory(), "tests", "Shared", "TestCertificates", "testCert.pfx"),
804Path.Combine(AppContext.BaseDirectory, "shared", "TestCertificates", "testCert.pfx"),
805Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "tests", "Shared", "TestCertificates", "testCert.pfx"))
970var appHostDirectory = Path.Combine(Path.GetTempPath(), "aspire-apphost-test");
1144var appHostDirectory = Path.Combine(Path.GetTempPath(), "aspire-apphost-test");
DistributedApplicationBuilderTests.cs (43)
127Path.Combine(projectDirectory, "appsettings.json"),
143Path.Combine(projectDirectory, "appsettings.PolyglotTest.json"),
156AppHostFilePath = Path.Combine(projectDirectory, "apphost.mts")
173Path.Combine(projectDirectory, "appsettings.json"),
187AppHostFilePath = Path.Combine(projectDirectory, "apphost.mts")
215Assert.Equal(Path.Combine(projectDirectory, "aspire-output"), outputService.GetOutputDirectory());
227Assert.Equal(Path.GetFullPath(outputPath), outputService.GetOutputDirectory());
238Assert.Equal(Path.Combine(Environment.CurrentDirectory, "aspire-output"), outputService.GetOutputDirectory());
406var directory = Path.GetDirectoryName(userSecretsPath);
535var appHostPath = Path.Combine(projectDirectory.FullName, "apphost.ts");
548AppHostFilePath = Path.Combine(projectDirectory.FullName, "AppHost.ts"),
584var appHostPath = Path.Combine(realDirectory.FullName, "apphost.ts");
587var symlinkDirectory = Path.Combine(projectDirectory.FullName, "link");
589var appHostPathViaSymlink = Path.Combine(symlinkDirectory, "apphost.ts");
600var previousIdentityPath = PathNormalizer.ResolvePathCasing(Path.GetFullPath(appHostPathViaSymlink));
617var legacyAppHostPath = Path.GetFullPath(Path.Join(projectDirectory.FullName, projectName));
620var legacyDirectory = Path.Combine(
625var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json");
637AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"),
642canonicalDirectory = Path.Combine(
685AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"),
710AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"),
716var deploymentsDirectory = Path.Combine(
720var currentDirectory = Path.Combine(deploymentsDirectory, currentSha);
721var legacyDirectory = Path.Combine(deploymentsDirectory, legacySha);
722var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json");
723var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json");
769AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"),
775var deploymentsDirectory = Path.Combine(
779var currentDirectory = Path.Combine(deploymentsDirectory, currentSha);
780var legacyDirectory = Path.Combine(deploymentsDirectory, legacySha);
781var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json");
782var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json");
833AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"),
839var deploymentsDirectory = Path.Combine(
843var currentDirectory = Path.Combine(deploymentsDirectory, currentSha);
844var legacyDirectory = Path.Combine(deploymentsDirectory, legacySha);
845var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json");
846var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json");
895AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"),
900var currentDirectory = Path.Combine(
905var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json");
MSBuildTests.cs (123)
28var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost");
31File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
60File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
85var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost");
88File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
116File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
126var metadataDirectory = Path.Combine(appHostDirectory, "obj", "Debug", "net8.0", "Aspire", "references");
127var appHostMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "_AppHost.ProjectMetadata.g.cs"));
128var appMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "App.ProjectMetadata.g.cs"));
141.Replace(Path.DirectorySeparatorChar, '/');
155File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"),
167File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"),
182var libraryDirectory = Path.Combine(basePath, name);
185File.WriteAllText(Path.Combine(libraryDirectory, $"{name}.csproj"),
197File.WriteAllText(Path.Combine(libraryDirectory, "Class1.cs"),
209var appDirectory = Path.Combine(basePath, name);
212File.WriteAllText(Path.Combine(appDirectory, $"{name}.csproj"),
223File.WriteAllText(Path.Combine(appDirectory, "Program.cs"),
254var workingDirectory = Path.GetDirectoryName(projectFile);
328var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Plain.AppHost.csproj");
368var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
380var layoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "layout");
392var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
404var layoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "layout");
416var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
450var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin"));
452var bundle = CreateFakeCliBundle(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home"));
462var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
474var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home");
475var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli"));
487var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
488var bundleRoot = Path.Combine(workspace.WorkspaceRoot.FullName, BundleDiscovery.BundleDirectoryName);
489var expectedDcpDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, "dcp"));
490var expectedDashboardDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DashboardDirectoryName));
493Assert.Equal(Path.Combine(expectedDashboardDir, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"), resolvedPaths[2]);
494Assert.False(Directory.Exists(Path.Combine(aspireHome, BundleDiscovery.BundleDirectoryName)));
503var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home");
504var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli"));
522Assert.False(Directory.Exists(Path.Combine(aspireHome, BundleDiscovery.BundleDirectoryName)));
523Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, BundleDiscovery.BundleDirectoryName)));
532var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home");
533var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli"));
562var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home");
563var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli"));
592var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home");
594var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, literalSegment));
611var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
612var bundleRoot = Path.Combine(workspace.WorkspaceRoot.FullName, BundleDiscovery.BundleDirectoryName);
613Assert.Equal(EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DcpDirectoryName)), resolvedPaths[0]);
614Assert.Equal(EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DashboardDirectoryName)), resolvedPaths[1]);
626var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, literalSegment));
639["ASPIRE_HOME"] = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"),
654var bundle = CreateFakeCliBundle(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home"));
665var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
677var toolsDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".dotnet", "tools"));
679var nativeCliDirectory = Directory.CreateDirectory(Path.Combine(
690File.WriteAllText(Path.Combine(nativeCliDirectory.FullName, ".aspire-install.json"), """{"source":"dotnet-tool"}""");
701var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
714var repoDcpDir = EnsureTrailingSeparator(Path.Combine(workspace.WorkspaceRoot.FullName, "repo-dcp"));
715var repoDashboardDir = EnsureTrailingSeparator(Path.Combine(workspace.WorkspaceRoot.FullName, "repo-dashboard"));
730var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt"));
733Assert.Contains(Path.Combine(repoDashboardDir, "Aspire.Dashboard"), resolvedPaths[2]);
742var missingBundlePath = Path.Combine(workspace.WorkspaceRoot.FullName, "missing-bundle");
780var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli"));
781var dnxPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "dnx.exe" : "dnx");
786File.Copy(Path.Combine(Environment.SystemDirectory, "where.exe"), dnxPath);
798["ASPIRE_HOME"] = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"),
817var missingCliPath = Path.Combine(workspace.WorkspaceRoot.FullName, "missing-aspire");
839var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost");
841File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.fsproj"),
862var property = await File.ReadAllTextAsync(Path.Combine(appHostDirectory, "obj", "aspire-use-cli-bundle.txt"));
886var metadataPath = Path.Combine(appHostDirectory, "obj", "Debug", "net8.0", "Aspire", "references", "App.ProjectMetadata.g.cs");
899var appHostDirectory = Path.Combine(basePath, "AppHost");
902File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
940File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
957File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"),
967File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"),
982return CreateFakeCliBundleAtLayoutRoot(Path.Combine(basePath, "layout"));
987return CreateFakeCliBundleRoot(layoutRoot, Path.Combine(layoutRoot, "bundle"));
992return CreateFakeCliBundleRoot(layoutRoot, Path.Combine(layoutRoot, "versions", versionId));
997var dcpDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, "dcp"));
998var managedDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, "managed"));
999var dashboardDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DashboardDirectoryName));
1004File.WriteAllText(Path.Combine(dcpDir, OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), "");
1005var managedPath = Path.Combine(managedDir, OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed");
1007var dashboardPath = Path.Combine(dashboardDir, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard");
1015var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire");
1022var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1060var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1086var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire");
1112return path.EndsWith(Path.DirectorySeparatorChar) ? path : path + Path.DirectorySeparatorChar;
1118var dotnetDirectory = Path.GetDirectoryName(dotnetPath);
1129.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)
1132return string.Join(Path.PathSeparator, pathDirectories.Prepend(firstDirectory));
1141return executableNames.Any(executableName => File.Exists(Path.Combine(directory.Trim().Trim('"'), executableName)));
1156var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost");
1159File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
1188File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
1215var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost");
1218File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
1247File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
1268var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "MyHostingExtension");
1271File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"),
1288File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"),
1317var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "MyHostingExtension");
1320File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"),
1337File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"),
1366var packageOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "packages");
1370Path.Combine(repoRoot, "src", "Aspire.Hosting.Integration.Analyzers", "Aspire.Hosting.Integration.Analyzers.csproj"),
1393var packageOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "packages");
1397Path.Combine(repoRoot, "src", "Aspire.Hosting.Blazor", "Aspire.Hosting.Blazor.csproj"),
1439var packageOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "packages");
1443Path.Combine(repoRoot, "src", "Aspire.Hosting.Integration.Analyzers", "Aspire.Hosting.Integration.Analyzers.csproj"),
1449var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "MyHostingExtension");
1451var nuGetConfigPath = Path.Combine(projectDirectory, "NuGet.config");
1495File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"),
1518File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"),
1545File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"),
1557File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"),
1582var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost");
1585File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
1613File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
PathLookupHelperTests.cs (56)
13var binPath = Path.Combine(workspace.WorkspaceRoot.FullName, "bin");
17var executablePath = Path.Combine(binPath, executableName);
47var firstBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "first-bin");
48var secondBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "second-bin");
52var nonExecutablePath = Path.Combine(firstBinPath, "mycommand");
56var executablePath = Path.Combine(secondBinPath, "mycommand");
62new Dictionary<string, string> { ["PATH"] = string.Join(Path.PathSeparator, firstBinPath, secondBinPath) });
74var binPath = Path.Combine(workspace.WorkspaceRoot.FullName, "bin");
76File.WriteAllText(Path.Combine(binPath, "mycommand"), string.Empty);
94var binPath = Path.Combine(workspace.WorkspaceRoot.FullName, "bin");
96File.WriteAllText(Path.Combine(binPath, "mycommand.exe"), string.Empty);
111Path.Combine("/usr/bin", "mycommand")
118Assert.Equal(Path.Combine("/usr/bin", "mycommand"), result);
166Path.Combine("/first/path", "mycommand"),
167Path.Combine("/second/path", "mycommand")
174Assert.Equal(Path.Combine("/first/path", "mycommand"), result);
180var firstPath = Path.Combine("/first/path", "mycommand");
181var secondPath = Path.Combine("/second/path", "mycommand");
212var firstBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "first-bin");
213var secondBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "second-bin");
217var nonExecutablePath = Path.Combine(firstBinPath, "mycommand");
221var executablePath = Path.Combine(secondBinPath, "mycommand");
243string.Join(Path.PathSeparator, firstBinPath, secondBinPath),
244Path.PathSeparator,
254var firstExePath = Path.Combine("first", "bin", "code.EXE");
255var firstCmdPath = Path.Combine("first", "bin", "code.CMD");
256var secondCmdPath = Path.Combine("second", "bin", "code.CMD");
264var path = string.Join(';', Path.Combine("first", "bin"), Path.Combine("second", "bin"));
275var dir = Path.Combine("testdir", "bin");
276var expectedPath = Path.Combine(dir, "mycommand");
293var dir = Path.Combine("testdir", "bin");
294var expectedPath = Path.Combine(dir, "code.CMD");
312var dir = Path.Combine("testdir", "bin");
313var exePath = Path.Combine(dir, "code.EXE");
314var cmdPath = Path.Combine(dir, "code.CMD");
336var dir = Path.Combine("testdir", "bin");
337var exactPath = Path.Combine(dir, "code");
338var cmdPath = Path.Combine(dir, "code.CMD");
357var dir = Path.Combine("testdir", "bin");
358var exactPath = Path.Combine(dir, "mytool");
376var dir = Path.Combine("testdir", "bin");
377var expectedPath = Path.Combine(dir, "code.CMD");
395var dir = Path.Combine("testdir", "bin");
410var dir = Path.Combine("testdir", "bin");
411var cmdPath = Path.Combine(dir, "code.CMD");
433Path.Combine(dir, "code.cmd")
450Path.Combine(dir, "code.cmd")
467var dir1 = Path.Combine("first", "bin");
468var dir2 = Path.Combine("second", "bin");
469var dir1CmdPath = Path.Combine(dir1, "code.CMD");
470var dir2ExePath = Path.Combine(dir2, "code.EXE");
489var dir1 = Path.Combine("first", "bin");
490var dir2 = Path.Combine("second", "bin");
491var dir1ExactPath = Path.Combine(dir1, "mytool");
492var dir2ExePath = Path.Combine(dir2, "mytool.EXE");
Publishing\ContainerImageArchiveRewriterTests.cs (22)
20var sourceArchive = Path.Combine(workspace.Path, "source.tar");
21var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
105var sourceArchive = Path.Combine(workspace.Path, "source.tar");
106var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
181var sourceArchive = Path.Combine(workspace.Path, "source.tar");
182var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
217var sourceArchive = Path.Combine(workspace.Path, "source.tar");
218var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
290var sourceArchive = Path.Combine(workspace.Path, "source.tar");
291var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
311var sourceArchive = Path.Combine(workspace.Path, "source.tar");
312var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
333var sourceArchive = Path.Combine(workspace.Path, "source.tar");
334var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
357var sourceArchive = Path.Combine(workspace.Path, "source.tar");
358var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
390var sourceArchive = Path.Combine(workspace.Path, "source.tar");
391var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
412var sourceArchive = Path.Combine(workspace.Path, "source.tar");
413var destinationArchive = Path.Combine(workspace.Path, "destination.tar");
436var sourceArchive = Path.Combine(workspace.Path, "source.tar");
437var compressedArchive = Path.Combine(workspace.Path, "custom-extension.archive");
Publishing\DeploymentStateManagerTests.cs (14)
392var stateDirectory = Path.GetDirectoryName(stateFilePath);
408var statePath = Path.Combine(
416var stateDirectory = Path.GetDirectoryName(statePath);
434Path.Combine(_aspireHome.FullName, "deployments", sha, "development.json"),
457Path.Combine(
593Directory.CreateDirectory(Path.GetDirectoryName(legacyStatePath)!);
620Directory.CreateDirectory(Path.GetDirectoryName(statePath)!);
996Assert.False(File.Exists(Path.Combine(
1019var legacyStatePath = Path.Combine(
1024Directory.CreateDirectory(Path.GetDirectoryName(legacyStatePath)!);
1197var legacyDirectory = Path.Combine(_aspireHome.FullName, "deployments", legacySha);
1204var canonicalPath = Path.Combine(_aspireHome.FullName, "deployments", Guid.NewGuid().ToString("N"), "production.json");
1205var legacyDirectory = Path.Combine(_aspireHome.FullName, "deployments", Guid.NewGuid().ToString("N"));
1206var legacyPath = Path.Combine(legacyDirectory, "production.json");
Publishing\DotnetProgramArchiveTests.cs (13)
41var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar");
77var firstArchive = Path.Combine(firstWorkspace.WorkspaceRoot.FullName, "program.tar");
78var secondArchive = Path.Combine(secondWorkspace.WorkspaceRoot.FullName, "program.tar");
136var resource = AddArchiveResource(builder, workspace.WorkspaceRoot.FullName, Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"));
182var resource = AddArchiveResource(builder, workspace.WorkspaceRoot.FullName, Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"));
220var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar.gz");
262var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar");
285var blockedDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output");
290Path.Combine(blockedDirectory, "program.tar.gz"));
318var resource = AddArchiveResource(builder, workspace.WorkspaceRoot.FullName, Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"));
348var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, path);
351outputPath += Path.DirectorySeparatorChar;
382return builder.AddProject("program", Path.Combine(workspacePath, "program.csproj"), static options => options.ExcludeLaunchProfile = true)
Publishing\PodmanSaveArgumentsTests.cs (9)
24OutputPath = Path.Combine("out", "archives"),
30var expectedPath = Path.Combine("out", "archives", "myapp-latest.tar");
41OutputPath = Path.Combine("out", "archives"),
47var expectedPath = Path.Combine("out", "archives", "myapp-latest.tar");
58OutputPath = Path.Combine("out", "archives")
63var expectedPath = Path.Combine("out", "archives", "myapp-latest.tar");
72var outputPath = Path.Combine("out", "archives");
95var outputPath = Path.Combine("out", "archives");
147Assert.Contains($"--output \"{Path.Combine("out", "container-abc123.tar")}\"", arguments, StringComparison.Ordinal);
Publishing\ResourceContainerImageManagerTests.cs (40)
60var appPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs");
66var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar.gz");
266var tempOutputPath = Path.GetTempPath();
309var tempOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NewFolder"); // tests that the folder is created if it doesn't exist
464var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar;
618var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar;
634Assert.False(buildCall.contextPath.EndsWith(Path.DirectorySeparatorChar.ToString()));
635Assert.False(buildCall.contextPath.EndsWith(Path.AltDirectorySeparatorChar.ToString()));
638Assert.Equal(Path.GetFullPath(tempContextPath), Path.GetFullPath(buildCall.contextPath));
690.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "missing.csproj")))
721.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj")))
754.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "missing.csproj")))
801.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj")))
811context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar");
839var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj");
852context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar");
868Assert.Equal(Path.GetDirectoryName(processSpec.ArgumentList![1]), processSpec.WorkingDirectory);
893var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar.gz");
895var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj");
982var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar.gz");
985.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj")))
1033.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs")))
1038context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar");
1074var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "app.cs" : "app.csproj");
1080context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar");
1114var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "app.cs" : "app.csproj");
1144Assert.Equal(Path.GetDirectoryName(projectPath), query.WorkingDirectory);
1175var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "app.cs" : "app.csproj");
1210var probePath = Path.Combine(workspace.WorkspaceRoot.FullName, "properties.proj");
1258var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.csproj");
1259var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archive;100%.tar");
1285var probePath = Path.Combine(workspace.WorkspaceRoot.FullName, "properties.proj");
1402var tempFile = Path.GetTempFileName();
1554var tempSecretFile = System.IO.Path.Combine(workspace.WorkspaceRoot.FullName, ".npmrc");
1939ctx.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archives");
2063ctx.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archives");
2130var dockerfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Dockerfile");
2177? string.Join(", ", Directory.EnumerateFiles(outputPath, "*.tar").Select(Path.GetFileName).Take(10))
Schema\SchemaTests.cs (16)
59var tempPath = Path.GetTempPath();
60var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName());
62var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile");
71var tempPath = Path.GetTempPath();
72var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName());
74var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile");
89var tempPath = Path.GetTempPath();
90var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName());
92var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile");
123var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile");
219var relativePath = Path.Combine("Schema", "aspire-8.0.json");
220var schemaPath = Path.GetFullPath(relativePath);
232var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: Path.Combine(manifestDir, "not-used.json"), step: "publish-json-manifest");
Terminals\Hex1bPtySocketTests.cs (23)
32var directory = Path.Combine(root.FullName, "custom");
63var directory = Path.Combine(root.FullName, "custom");
70var originalOverride = Path.Combine(directory, "..", "custom");
79EnvironmentVariables = { [Hex1bPtySocketHelper.SocketDirectoryEnvironmentVariable] = Path.Combine(root.FullName, "child") }
92Assert.Empty(Directory.EnumerateFileSystemEntries(Path.Combine(directory, "proxy")));
117Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire"));
118var directory = Path.Combine(root.FullName, ".aspire", "pty");
120var value = bool.Parse(sharedRootValue) ? Path.GetTempPath() : directory;
152var directory = Directory.CreateDirectory(Path.Combine(root.FullName, "custom"));
193Assert.Equal(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "pty", "proxy"),
194Path.GetDirectoryName(socketPath));
195Assert.False(Path.Exists(socketPath));
210var directory = Path.Combine(root.FullName, new string('a', 108));
242var directory = Path.Combine(root.FullName, ".aspire", "pty");
243_ = new UnixDomainSocketEndPoint(Path.Combine(directory, $"hex1bpty-{new string('0', 32)}.socket"));
262EnvironmentVariables = { [Hex1bPtySocketHelper.SocketDirectoryEnvironmentVariable] = Path.Combine(root.FullName, "child") },
275var laterDirectory = Path.Combine(root.FullName, "later");
277Assert.Empty(Directory.EnumerateFileSystemEntries(Path.Combine(directory, "proxy")));
282var sockets = Directory.GetFiles(Path.Combine(directory, "proxy"), "*.socket");
285Assert.False(Directory.Exists(Path.Combine(root.FullName, "child")));
304Assert.Empty(Directory.EnumerateFileSystemEntries(Path.Combine(directory, "proxy")));
305Assert.Equal(Path.Combine(root.FullName, "later"), Environment.GetEnvironmentVariable(Hex1bPtySocketHelper.SocketDirectoryEnvironmentVariable));
321directory.MoveTo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), directory.Name));
Utils\DotnetSdkVersionProviderTests.cs (8)
220File.WriteAllText(Path.Combine(workspace.Path, "global.json"), "{}");
221var firstDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "First")).FullName;
222var secondDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "Second")).FullName;
242var firstDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "First")).FullName;
243var secondDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "Second")).FullName;
244File.WriteAllText(Path.Combine(firstDirectory, "global.json"), "{}");
245File.WriteAllText(Path.Combine(secondDirectory, "global.json"), "{}");
267var globalJsonPath = Path.Combine(workspace.Path, "global.json");
Utils\SocketPermissionHelperTests.cs (45)
25var directory = Path.Combine(root.FullName, "custom");
31var socketPath = Path.Combine(directory, "s.sock");
69var directory = Path.Combine(root.FullName, ".aspire", "pty");
71var socketPath = Path.Combine(directory, "occupied");
96var directory = Path.Combine(root.FullName, "custom");
138var directory = SocketPermissionHelper.CreateDirectory(Path.Combine(root.FullName, "custom"), repairExisting: false);
164Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire"));
165var directory = Path.Combine(root.FullName, ".aspire", "pty");
169Assert.ThrowsAny<IOException>(() => SocketPermissionHelper.Bind(socket, Path.Combine(directory, "s.sock")));
191var target = Directory.CreateDirectory(Path.Combine(root.FullName, "target"));
192Directory.CreateDirectory(Path.Combine(target.FullName, "home"));
193var link = Path.Combine(root.FullName, "homes");
195var profile = Path.Combine(link, "home");
196var path = Path.Combine(profile, ".aspire", "cli", "bch");
202AssertDirectoryPermissions(Path.Combine(target.FullName, "home", ".aspire", "cli", "bch"));
225var target = Directory.CreateDirectory(Path.Combine(root.FullName, "target"));
227var link = Path.Combine(root.FullName, "base");
229var path = Path.Combine(link, ".aspire", "trmnl");
230var targetDirectory = Path.Combine(target.FullName, ".aspire", "trmnl");
274var home = Directory.CreateDirectory(Path.Combine(root.FullName, "home"));
275var profile = Path.Combine(root.FullName, "profile");
277var target = Path.Combine(root.FullName, "target");
280var link = Path.Combine(profile, linkedSuffix);
281Directory.CreateDirectory(Path.GetDirectoryName(link)!);
285Path.Combine(profile, ".aspire", "cli", "bch"), repairExisting,
310var target = Path.Combine(root.FullName, "target");
315var profile = Path.Combine(root.FullName, "profile");
319Path.Combine(profile, ".aspire", "trmnl"), repairExisting: true,
346var target = Path.Combine(root.FullName, "target");
349Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire"));
350var link = Path.Combine(root.FullName, ".aspire", "pty");
366Assert.Throws<IOException>(() => SocketPermissionHelper.CreateDirectory(Path.GetTempPath(), repairExisting: false));
367Assert.Throws<IOException>(() => SocketPermissionHelper.CreateDirectory(Path.GetPathRoot(Path.GetTempPath())!, repairExisting: false));
385var directory = Path.GetFullPath(Path.Combine(root.FullName, "base", relativePath));
391var socketPath = Path.Combine(directory, "s.sock");
418var directory = Path.Combine(root.FullName, ".aspire", "pty");
451Assert.Equal(Path.Combine(root.FullName, "custom"), directory.FullName);
468var directory = Path.Combine(root.FullName, dcpLayout ? "aspire-dcp-test" : ".aspire/pty");
499var target = Directory.CreateDirectory(Path.Combine(root.FullName, "target"));
500var directory = Path.Combine(target.FullName, "pty");
503Directory.CreateSymbolicLink(Path.Combine(root.FullName, ".aspire"), target.FullName);
506Path.Combine(root.FullName, ".aspire", "pty"), repairExisting: false));
527var directory = Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire", "pty")).FullName;
WithTerminalTests.cs (29)
20private string _terminalDirectory => Path.Combine(_terminalRoot, "terminals");
481Assert.Equal(_terminalDirectory, Path.GetDirectoryName(host.Layout.MetadataPath));
513var orphanMetadataPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.MetadataSuffix}");
514var orphanProducerPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.ProducerSockPurpose}.sock");
515var orphanConsumerPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.ConsumerSockPurpose}.sock");
516var orphanControlPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.ControlSockPurpose}.sock");
568var liveMetadataPath = Path.Combine(trmnlDirectory, $"{liveId}.{TerminalHostPaths.MetadataSuffix}");
569var liveProducerPath = Path.Combine(trmnlDirectory, $"{liveId}.{TerminalHostPaths.ProducerSockPurpose}.sock");
619var metadataPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.MetadataSuffix}");
620var producerPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.ProducerSockPurpose}.sock");
651var metadataPath = Path.Combine(trmnlDirectory, $"{fileReplicaId}.{TerminalHostPaths.MetadataSuffix}");
657var sentinelPath = Path.Combine(trmnlDirectory, maliciousPrefix + "-sentinel.tmp");
786var metadataPath = Path.Combine(trmnlDirectory, $"{invalidReplicaId}.{TerminalHostPaths.MetadataSuffix}");
787var producerPath = Path.Combine(trmnlDirectory, $"{invalidReplicaId}.{TerminalHostPaths.ProducerSockPurpose}.sock");
816var metadataPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.MetadataSuffix}");
817var producerPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.ProducerSockPurpose}.sock");
999var publishDirectory = Path.Combine(_terminalDirectory, "publish");
1171Assert.StartsWith(hosts[i].Layout.ReplicaId + ".", Path.GetFileName(hosts[i].Layout.ProducerUdsPath));
1172Assert.StartsWith(hosts[i].Layout.ReplicaId + ".", Path.GetFileName(hosts[i].Layout.ConsumerUdsPath));
1219Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.ProducerUdsPath));
1220Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.ConsumerUdsPath));
1221Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.ControlUdsPath));
1222Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.MetadataPath));
1224Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.ProducerUdsPath));
1225Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.ConsumerUdsPath));
1226Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.ControlUdsPath));
1227Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.MetadataPath));
1394var directory = Path.Combine(_terminalRoot, "custom");
1403Assert.Equal(directory, Path.GetDirectoryName(host.Layout.MetadataPath));
Aspire.Hosting.TestUtilities (19)
Aspire.Hosting.Valkey.Tests (3)
Aspire.Hosting.Yarp.Tests (3)
Aspire.Managed.Tests (19)
TerminalHostSignalTests.cs (13)
25var socketDirectory = new DirectoryInfo(Path.Combine(root.FullName, "terminals"));
26var producerPath = Path.Combine(socketDirectory.FullName, "p.sock");
27var consumerPath = Path.Combine(socketDirectory.FullName, "h.sock");
28var controlPath = Path.Combine(socketDirectory.FullName, "c.sock");
99var socketDirectory = new DirectoryInfo(Path.Combine(root.FullName, "terminals"));
100var parentProducerPath = Path.Combine(socketDirectory.FullName, "pp.sock");
101var parentConsumerPath = Path.Combine(socketDirectory.FullName, "ph.sock");
102var parentControlPath = Path.Combine(socketDirectory.FullName, "pc.sock");
104var producerPath = Path.Combine(socketDirectory.FullName, "p.sock");
105var consumerPath = Path.Combine(socketDirectory.FullName, "h.sock");
106var controlPath = Path.Combine(socketDirectory.FullName, "c.sock");
219startInfo.ArgumentList.Add(Path.ChangeExtension(testAssemblyPath, ".runtimeconfig.json"));
221startInfo.ArgumentList.Add(Path.ChangeExtension(testAssemblyPath, ".deps.json"));
Aspire.Playground.Tests (14)
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Templates.Tests (80)
LocalhostTldHostnameTests.cs (4)
67"aspire-ts-cs-starter" or "aspire-starter" => Path.Combine(project.RootDir, $"{projectName}.AppHost", "Properties", "launchSettings.json"),
68"aspire" => Path.Combine(project.RootDir, $"{projectName}.AppHost", "Properties", "launchSettings.json"),
69"aspire-apphost" => Path.Combine(project.RootDir, "Properties", "launchSettings.json"),
70"aspire-apphost-singlefile" => Path.Combine(project.RootDir, "apphost.run.json"),
NewUpAndBuildStandaloneTemplateTests.cs (6)
110var webProjectDirectory = Path.Combine(project.RootDir, $"{project.Id}.Web");
112var appContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "App.razor"));
116var importsContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "_Imports.razor"));
119var errorPageContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "Pages", "Error.razor"));
122var navMenuContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "Layout", "NavMenu.razor"));
129Assert.True(File.Exists(Path.Combine(webProjectDirectory, "Components", "Layout", "NavMenu.razor.js")));
tests\Shared\TemplatesTesting\AspireProject.cs (21)
23Path.Combine(BuildEnvironment.TestAssetsPath, "nuget8.config");
32public string ServiceDefaultsProjectPath => Path.Combine(RootDir, $"{Id}.ServiceDefaults");
33public string TestsProjectDirectory => Path.Combine(RootDir, $"{Id}.Tests");
48LogPath = Path.Combine(_buildEnv.LogRootPath, Id);
50AppHostProjectDirectory = Path.Combine(RootDir, $"{Id}.AppHost");
65File.WriteAllText(Path.Combine(dir, "Directory.Build.props"), "<Project />");
66File.WriteAllText(Path.Combine(dir, "Directory.Build.targets"), "<Project />");
72string targetNuGetConfigPath = Path.Combine(dir, "nuget.config");
93projectDir = Path.Combine(rootDir, id);
97rootDir = projectDir = Path.Combine(BuildEnvironment.TestRootPath, id);
100string logPath = Path.Combine(BuildEnvironment.ForDefaultFramework.LogRootPath, id);
107File.WriteAllText(Path.Combine(rootDir, "Directory.Build.props"), "<Project />");
108File.WriteAllText(Path.Combine(rootDir, "Directory.Build.targets"), "<Project />");
115cmd.WithWorkingDirectory(Path.GetDirectoryName(projectDir)!)
153File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "EndPointWriterHook_cs"), Path.Combine(project.AppHostProjectDirectory, "EndPointWriterHook.cs"));
154string programCsPath = Path.Combine(project.AppHostProjectDirectory, "AppHost.cs");
253_testOutput.WriteLine($"----------- [{Path.GetFileName(AppHostProjectDirectory)}] app has exited -------------");
332workingDirectory ??= Path.Combine(RootDir, $"{Id}.AppHost");
336var res = await restoreCmd.ExecuteAsync($"restore \"-bl:{Path.Combine(LogPath!, $"{Id}-restore.binlog")}\" /p:TreatWarningsAsErrors=true");
339var buildArgs = $"build \"-bl:{Path.Combine(LogPath!, $"{Id}-build.binlog")}\" /p:TreatWarningsAsErrors=true";
tests\Shared\TemplatesTesting\BuildEnvironment.cs (23)
25? Path.GetTempPath()
26: Environment.GetEnvironmentVariable("DEV_TEMP") is { } devTemp && Path.Exists(devTemp)
28: Path.GetTempPath();
31public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets");
32public static readonly string TestRootPath = Path.Combine(TempDir, "templates-testroot");
82var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName);
85sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath);
90string workloadsProjString = Path.Combine("tests", "workloads.proj");
101.Split(Path.PathSeparator)
102.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
108sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
114BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping");
124.Split(Path.PathSeparator)
125.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
131sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
141string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath);
147sdkForTemplatePath = Path.Combine(baseDir, sdkDirName);
162sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath);
168NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null;
176EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}";
200DotNet = Path.Combine(sdkForTemplatePath!, "dotnet");
208LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath);
213LogRootPath = Path.Combine(AppContext.BaseDirectory, "logs");
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (10)
29? Path.Combine(Path.GetTempPath(), $"templates-${s_tmpDirSuffix}")
30: Path.Combine(AppContext.BaseDirectory, "templates");
31_customHiveDirectory = Path.Combine(customHiveBaseDirectory, customHiveDirName);
32_stampFilePath = Path.Combine(_customHiveDirectory, ".stamp-installed");
87.Where(p => packageNameRegex.IsMatch(Path.GetFileName(p)));
91throw new ArgumentException($"Cannot find {templatePackageId}*.nupkg in {builtNuGetsPath}. Packages found in {builtNuGetsPath}: {string.Join(", ", Directory.EnumerateFiles(builtNuGetsPath).Select(Path.GetFileName))}");
95throw new ArgumentException($"Found more than one {templatePackageId}*.nupkg in {builtNuGetsPath}: {string.Join(", ", packages.Select(Path.GetFileName))}");
104? Path.GetTempPath()
105: Path.Combine(BuildEnvironment.TempDir, "templates", "working"); // avoid running from the repo
Aspire.TerminalHost (16)
Aspire.TerminalHost.Tests (20)
TerminalHostAppTests.cs (14)
43var dcpDir = Path.Combine(workspace.Path, "terminals");
48var producer = Path.Combine(dcpDir, "p.sock");
49var consumer = Path.Combine(hostDir, "r.sock");
50var control = Path.Combine(ctrlDir, "c.sock");
700Directory.CreateDirectory(Path.Combine(workspace.Path, ".aspire"));
701var parentFile = Path.Combine(workspace.Path, ".aspire", "trmnl");
706Path.Combine(parentFile, "consumer.sock"),
716var socketPath = Path.Combine(workspace.Path, ".aspire", "trmnl", "consumer.sock");
1255Directory.CreateDirectory(Path.Combine(workspace.Path, ".aspire"));
1256var parentFile = Path.Combine(workspace.Path, ".aspire", "trmnl");
1260Path.Combine(parentFile, "producer.sock"), CancellationToken.None));
1295var directory = Path.GetDirectoryName(control)!;
1334var path = Path.GetDirectoryName(socketPath)!;
1357var directoryPath = Path.GetDirectoryName(socketPath)!;
Aspire.TestTools (3)
Aspire.TestUtilities (8)
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
Aspire.Tray.Tests (301)
AppHostPresentationTests.cs (15)
152var host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null);
155Assert.Equal($"{Path.Combine("worktree-a", "apphost")} \u00b7 PID 42", AppHostPresentation.GetSubtitle(host));
156Assert.Equal($"apphost - {Path.Combine("worktree-a", "apphost")} (PID 42)", AppHostPresentation.GetLabel(host));
157Assert.Equal(Path.GetFullPath("worktree-a/apphost"), AppHostPresentation.GetDirectory(host));
170var host = new AppHostInfo(Path.GetFullPath(path), 42, null);
179var first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null);
180var second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null);
184Assert.Equal($"{Path.Combine("worktree-a", "Shop.AppHost")} \u00b7 PID 42", AppHostPresentation.GetSubtitle(first));
185Assert.Equal($"{Path.Combine("worktree-b", "Shop.AppHost")} \u00b7 PID 43", AppHostPresentation.GetSubtitle(second));
197var host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null);
213var path = Path.GetFullPath($"worktree\nbranch/apphost/{name}.cs");
215var location = Path.Combine("worktree branch", "apphost");
222Assert.Equal(Path.GetDirectoryName(path), AppHostPresentation.GetDirectory(host));
233Assert.Null(new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, url).DashboardUri);
240Assert.Equal(Url, new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, Url).DashboardUri?.AbsoluteUri);
CliAppHostCommandsTests.cs (20)
16var path = Path.GetFullPath(Path.Combine("MyWorktree", "Shop.AppHost", "AppHost.cs"));
19var startInfo = CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), host.Id);
27var executable = Path.GetFullPath("cli path/aspire");
47CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), Host() with { AppHostPid = pid }));
55CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), Host() with { AppHostPath = "apphost.cs" }));
65Path.GetFullPath("aspire"), Host() with { ProcessStartTimeUnixMilliseconds = startedAt }));
197var commands = new CliAppHostCommands(Path.GetFullPath("does-not-exist"), TimeSpan.FromSeconds(30));
205Assert.Throws<ArgumentOutOfRangeException>(() => new CliAppHostCommands(Path.GetFullPath("aspire"), TimeSpan.Zero));
206Assert.Throws<ArgumentOutOfRangeException>(() => new CliAppHostCommands(Path.GetFullPath("aspire"), Timeout.InfiniteTimeSpan));
214var executable = Path.GetFullPath("configured cli path/aspire");
220Assert.Equal(Path.GetDirectoryName(appHost), info.WorkingDirectory);
233var commands = new CliAppHostCommands(Path.GetFullPath("missing-cli"), TimeSpan.FromSeconds(60));
235Assert.Throws<ArgumentException>(() => CliAppHostCommands.CreateStartStartInfo(Path.GetFullPath("aspire"), "apphost.cs"));
237CliAppHostCommands.CreateStartStartInfo(Path.GetFullPath("aspire"), Path.GetDirectoryName(appHost)!));
337var commands = new CliAppHostCommands(Path.GetFullPath("missing-cli"), TimeSpan.FromSeconds(60));
346var commands = new CliAppHostCommands(Path.GetFullPath("missing-cli"), TimeSpan.FromSeconds(60));
349Path.GetFullPath("missing-apphost.cs"), new CancellationToken(canceled: true)));
352private static AppHostId Host() => new(Path.GetFullPath("project with spaces & apostrophe's/apphost.cs"), 42, 1000);
Helpers\TestTrayBundle.cs (6)
12public string AppPath => Path.Combine(Root, "tray", "Aspire Tray.app");
16Root = Path.Combine(_directory.FullName, "layout with spaces");
17CliPath = Path.Combine(_directory.FullName, "aspire cli");
18Directory.CreateDirectory(Path.Combine(AppPath, "Contents", "MacOS"));
20File.WriteAllText(Path.Combine(AppPath, "Contents", "Info.plist"), "");
21File.WriteAllText(Path.Combine(AppPath, "Contents", "MacOS", "aspire-tray"), "");
Helpers\TestTrayStartupInstallation.cs (8)
15public string BundleRoot => Path.Combine(Root, "versions", "test-version");
16public string MacCli => Path.Combine(Root, "aspire mac");
17public string WindowsCli => Path.Combine(Root, "aspire.exe");
18public string SourceGui => Path.Combine(BundleRoot, "tray", "aspire-tray.exe");
19public string Bootstrap => Path.Combine(Root, "state", "aspire-tray-login.exe");
20public string LaunchAgents => Path.Combine(Root, "isolated home", "Library", "LaunchAgents");
24Root = Path.Combine(_directory.FullName, "i & s");
31WindowsTrayTestPayload.Create(Path.GetDirectoryName(SourceGui)!, "win-x64");
MacTrayLauncherTests.cs (17)
20Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!);
42File.GetUnixFileMode(Path.GetDirectoryName(directory.LogPath)!));
52var targetDirectory = Directory.CreateDirectory(Path.Combine(directory.Root, "target")).FullName;
53var target = Path.Combine(targetDirectory, "tray.log");
57Directory.CreateSymbolicLink(Path.GetDirectoryName(directory.LogPath)!, targetDirectory);
61Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!);
74Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!);
75var target = Path.Combine(directory.Root, "target");
91Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!);
103var leasePath = Path.Combine(directory.Root, "parent.lease");
138var targetDirectory = Directory.CreateDirectory(Path.Combine(directory.Root, "target")).FullName;
139var target = Path.Combine(targetDirectory, "tray.log");
145var moved = Path.Combine(directory.Root, "retained");
146Directory.Move(Path.GetDirectoryName(directory.LogPath)!, moved);
147retained = Path.Combine(moved, "tray.log");
148Directory.CreateSymbolicLink(Path.GetDirectoryName(directory.LogPath)!, targetDirectory);
152retained = Path.Combine(directory.Root, "retained.log");
MacTrayPayloadTests.cs (11)
31var script = Path.Combine(workspace.FullName, "tools", "CreateLayout", "verify-tray-payload.sh");
32Directory.CreateDirectory(Path.GetDirectoryName(script)!);
33File.Copy(Path.Combine(AppContext.BaseDirectory, "verify-tray-payload.sh"), script);
34var app = Path.Combine(workspace.FullName, rid, "tray", "Aspire Tray.app");
35Directory.CreateDirectory(Path.Combine(app, "Contents", "MacOS"));
36Directory.CreateDirectory(Path.Combine(app, "Contents", "Resources"));
37var executable = Path.Combine(app, "Contents", "MacOS", "aspire-tray");
38var icon = Path.Combine(app, "Contents", "Resources", "Aspire.icns");
40File.WriteAllText(Path.Combine(app, "Contents", "Info.plist"), """
51var source = Path.Combine(workspace.FullName, "main.c");
67var archive = Path.Combine(workspace.FullName, "payload.tar.gz");
TrayConfigurationTests.cs (15)
122AssertConfigurationError(Path.GetDirectoryName(path)!);
136var root = Path.GetDirectoryName(marker)!;
138File.WriteAllText(Path.Combine(Path.GetDirectoryName(binary)!, ".aspire-install.json"),
141Assert.Equal(Path.Combine(root, expectedHome, "aspire.config.json"),
142TrayConfiguration.GetSettingsPath(binary, Path.Combine(root, "configured"), Path.Combine(root, "user")));
143Assert.Equal(Path.Combine(root, expectedHome, "tray", "apphosts.json"),
144TrayConfiguration.GetSavedStatePath(binary, Path.Combine(root, "configured"), Path.Combine(root, "user")));
152var user = Path.GetDirectoryName(binary)!;
154Assert.Equal(Path.Combine(user, ".aspire", "aspire.config.json"),
156Assert.Equal(Path.Combine(user, ".aspire", "tray", "apphosts.json"),
158Assert.Equal(Path.Combine(user, "custom-home", "tray", "apphosts.json"),
159TrayConfiguration.GetSavedStatePath(binary, Path.Combine(user, "custom-home"), user));
TraySavedStateTests.cs (22)
17Assert.Equal(Path.GetFullPath(path), path);
37Assert.Equal([directory.StatePath], Directory.GetFiles(Path.GetDirectoryName(directory.StatePath)!));
43var paths = Enumerable.Range(0, 30).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray();
67var paths = Enumerable.Range(0, 52).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray();
83var pinned = Path.GetFullPath("pinned/apphost.cs");
84var recent = Path.GetFullPath("recent/apphost.cs");
85var other = Path.GetFullPath("other/apphost.cs");
128var paths = Enumerable.Range(0, count).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray();
140.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), false, true)).ToArray());
154var differentlyCased = Path.Combine(Path.GetDirectoryName(original)!, "APPHOST.CS");
172var missing = Path.GetFullPath("deleted/apphost.cs");
173var recent = Path.GetFullPath("other/apphost.cs");
189var pinned = Path.GetFullPath("pinned/apphost.cs");
190var recent = Path.GetFullPath("recent/apphost.cs");
191var retained = Path.GetFullPath("retained/apphost.cs");
218Assert.Throws<InvalidDataException>(() => store.Save(TraySavedState.Empty.Remember(Path.GetFullPath("apphost.cs"))));
230Assert.Throws<IOException>(() => store.Save(TraySavedState.Empty.Remember(Path.GetFullPath("apphost.cs"))));
245Assert.Equal([directory.StatePath], Directory.GetFiles(Path.GetDirectoryName(directory.StatePath)!));
260File.GetUnixFileMode(Path.GetDirectoryName(directory.StatePath)!));
279var link = Path.Combine(Path.GetDirectoryName(target)!, "linked.cs");
TrayStartupOptionsTests.cs (9)
18File.WriteAllText(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), "");
19var startup = Path.Combine(bundle.Root, "installed & stable CLI");
55File.WriteAllText(Path.ChangeExtension(options.CliPath, ".runtimeconfig.json"), "{}");
68var cli = Path.Combine(installation.BundleRoot, "aspire");
81var cli = Path.Combine(installation.Root, store, "aspire", "1.0.0", "aspire");
82Directory.CreateDirectory(Path.GetDirectoryName(cli)!);
94var link = Path.Combine(installation.Root, "stable-installation");
99var versioned = Path.Combine(installation.BundleRoot, "aspire");
119File.WriteAllText(Path.ChangeExtension(installation.WindowsCli, ".runtimeconfig.json"), "{}");
WindowsTrayLaunchCommandTests.cs (4)
15var executable = Path.Combine(bundle.Root, "tray", "aspire-tray.exe");
21Assert.Equal(Path.Combine(bundle.Root, "tray"), start.WorkingDirectory);
36Assert.Equal(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), error.FileName);
43File.WriteAllText(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), "");
WindowsTrayLogTests.cs (14)
20var path = Path.Combine(directory.UserProfilePath, "Aspire", "Tray");
31Assert.Equal("first\nsecond\n", File.ReadAllText(Path.Combine(path, "aspire-tray.log")));
48link = Path.Combine(link, components[i]);
50Directory.CreateDirectory(Path.GetDirectoryName(link)!);
54targetLogDirectory = Path.Combine(targetLogDirectory, components[i]);
57var sentinel = Path.Combine(targetLogDirectory, "aspire-tray.log");
59var result = await TestNativeCommand.RunAsync(Path.Combine(Environment.SystemDirectory, "cmd.exe"),
64Assert.Throws<IOException>(() => WindowsTrayLog.OpenLog(Path.Combine(root, Path.Combine(components))));
81File.CreateSymbolicLink(Path.Combine(path, "aspire-tray.log"), target);
95var result = await TestNativeCommand.RunAsync(Path.Combine(Environment.SystemDirectory, "cmd.exe"),
96"/d", "/c", "mklink", "/H", Path.Combine(path, "aspire-tray.log"), target);
142var log = Path.Combine(path, "aspire-tray.log");
145Assert.Throws<IOException>(() => File.Move(log, Path.Combine(path, "old.log")));
WindowsTrayStartupSettingsTests.cs (8)
55Assert.False(Directory.Exists(Path.GetDirectoryName(installation.Bootstrap)));
117store.Value = WindowsTrayStartupSettings.BuildRunCommand(installation.Bootstrap, Path.Combine(installation.Root, "different.exe"));
141Directory.CreateDirectory(Path.GetDirectoryName(installation.Bootstrap)!);
157File.WriteAllText(Path.ChangeExtension(installation.SourceGui, ".runtimeconfig.json"), "{}");
171var cli = Path.Combine(installation.Root, "%INSTALL%.exe");
211var bootstrap = Path.Combine(installation.Root, new string('a', 150), new string('b', 150), "aspire-tray-login.exe");
227var cli = Path.Combine(installation.Root, new string('a', length - originalLength) + Path.GetFileName(installation.WindowsCli));
Binding.UDS.IntegrationTests (4)
blazor-devserver (6)
CatalogService (1)
cdac-build-tool (4)
CodeStyleConfigFileGenerator (4)
ConfigurationSchemaGenerator (1)
ConfigurationSchemaGenerator.Tests (2)
CreateLayout (43)
Program.cs (41)
141_outputPath = Path.GetFullPath(outputPath);
142_artifactsPath = Path.GetFullPath(artifactsPath);
188var destination = Path.Combine(_outputPath, "tray");
194File.Copy(Path.Combine(_windowsTrayPath, name), Path.Combine(destination, name), overwrite: true);
212var path = Path.Combine(_trayAppPath, relativePath);
219var executablePath = Path.Combine(_trayAppPath, "Contents", "MacOS", "aspire-tray");
231CopyDirectory(_trayAppPath, Path.Combine(_outputPath, "tray", "Aspire Tray.app"), excludeSymbols: false);
245var managedDir = Path.Combine(_outputPath, "managed");
253var managedExePath = Path.Combine(managedPublishPath, managedExeName);
259File.Copy(managedExePath, Path.Combine(managedDir, managedExeName), overwrite: true);
273var destination = Path.Combine(managedDir, relativePath);
274Directory.CreateDirectory(Path.GetDirectoryName(destination)!);
275File.Copy(Path.Combine(managedPublishPath, relativePath), destination, overwrite: true);
296var dashboardExePath = Path.Combine(dashboardPublishPath, dashboardExeName);
302var wwwrootPath = Path.Combine(dashboardPublishPath, "wwwroot");
308var blazorScriptPath = Path.Combine(wwwrootPath, "_framework", "blazor.web.js");
317var sqliteLibraryPath = Path.Combine(dashboardPublishPath, sqliteLibraryName);
325var dashboardDir = Path.Combine(_outputPath, "dashboard");
345var dcpDir = Path.Combine(_outputPath, "dcp");
357var archivePath = Path.Combine(Path.GetDirectoryName(_outputPath)!, archiveName + ".tar.gz");
373var topLevelDir = Path.GetFileName(_outputPath);
376var relativePath = Path.GetRelativePath(Path.GetDirectoryName(_outputPath)!, filePath).Replace('\\', '/');
397Arguments = $"{(OperatingSystem.IsMacOS() ? "--no-xattrs " : "")}-czf \"{archivePath}\" -C \"{Path.GetDirectoryName(_outputPath)}\" \"{Path.GetFileName(_outputPath)}\"",
432Path.Combine(_artifactsPath, "bin", projectName, _rid, _configuration, targetFramework, _rid, "publish"),
434Path.Combine(_artifactsPath, "bin", projectName, _configuration, targetFramework, _rid, "publish"),
436Path.Combine(_artifactsPath, "bin", projectName, _configuration, targetFramework, _rid, "native"),
445Path.Combine(_artifactsPath, "bin", projectName, _configuration, targetFramework, "publish"),
464?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
481var dcpPackagePath = Path.Combine(nugetPackages, dcpPackageName);
487.Select(d => (Path: d, Version: Version.TryParse(Path.GetFileName(d), out var v) ? v : null))
494var toolsPath = Path.Combine(latestVersion.Path, "tools");
505var oldPackagePath = Path.Combine(nugetPackages, oldPackageName);
515var toolsPath = Path.Combine(latestVersion, "tools");
538var destFile = Path.Combine(destination, Path.GetFileName(file));
555var destDir = Path.Combine(destination, Path.GetFileName(dir));
crossgen2 (18)
Crossgen2Tasks (52)
PrepareForReadyToRunCompilation.cs (20)
186outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb");
187outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb");
188crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\"";
209outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension);
210outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension);
211crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\"";
278MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec));
281string compositeR2RImageBaseRelativePath = Path.ChangeExtension(
283"r2r" + Path.GetExtension(mainAssemblyRelativePath));
307compositePDBImage = Path.ChangeExtension(compositeR2RImage, ".ni.pdb");
308compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb");
314compositePDBImage = Path.ChangeExtension(compositeR2RImage, perfmapExtension);
315compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension);
363: Path.ChangeExtension(relativePath, compilerExtension);
366: Path.ChangeExtension(relativePath, publishExtension);
368compilerOutputPath = Path.Combine(OutputPath, compilerOutputRelativePath);
369string publishOutputPath = Path.Combine(OutputPath, publishOutputRelativePath);
486bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec)));
487bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R;
491bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ResolveReadyToRunCompilers.cs (26)
310_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
311_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
312_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll");
317_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe");
318_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll");
319_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll");
326_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
327_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
328_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll");
338_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe");
339_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll");
340_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll");
345_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
346_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
349_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll");
353_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll");
363_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
364_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so");
369_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen");
370_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so");
379_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
380_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so");
391_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
392_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib");
427_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName);
434_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
csc (20)
CSharpSyntaxGenerator (5)
csi (3)
datacollector (4)
datacollector.arm64 (4)
dotnet (8)
Program.cs (8)
8Console.WriteLine($"13.5.0 [{Path.Combine(AppContext.BaseDirectory, "sdk")}]");
39var dcpDirectory = Directory.CreateDirectory(Path.Combine(setupInstallPath, "bundle", "dcp"));
40var managedDirectory = Directory.CreateDirectory(Path.Combine(setupInstallPath, "bundle", "managed"));
41var dashboardDirectory = Directory.CreateDirectory(Path.Combine(setupInstallPath, "bundle", "dashboard"));
42File.WriteAllText(Path.Combine(dcpDirectory.FullName, OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), "");
43File.WriteAllText(Path.Combine(managedDirectory.FullName, OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"), "");
44File.WriteAllText(Path.Combine(dashboardDirectory.FullName, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"), "");
50if (File.Exists(Path.Combine(AppContext.BaseDirectory, "fail-version")))
dotnet-aot (203)
parent\dotnet\Commands\Run\FileBasedAppRunPlan.cs (11)
93var successCacheFile = new FileInfo(Path.Join(artifactsPath, BuildSuccessCacheFileName));
144string successCachePath = Path.Join(artifactsPath, BuildSuccessCacheFileName);
321FileSystemInfo implicitBuildFileInfo = new FileInfo(Path.Join(directory.FullName, implicitBuildFile.Name));
345string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(entryPointFileFullPath);
346string binDirectory = Path.Join(artifactsPath, "bin", "debug");
348Path.Join(binDirectory, fileNameWithoutExtension + FileNameSuffixes.CurrentPlatform.Exe),
349Path.Join(binDirectory, fileNameWithoutExtension + ".dll"),
350Path.Join(binDirectory, fileNameWithoutExtension + FileNameSuffixes.RuntimeConfigJson));
418var successCacheFile = new FileInfo(Path.Join(inputs.ArtifactsPath, BuildSuccessCacheFileName));
425var startCacheFile = new FileInfo(Path.Join(inputs.ArtifactsPath, BuildStartCacheFileName));
452Path.IsPathFullyQualified(previousRunCommand) &&
parent\dotnet\Commands\Test\MTP\TestResultsDirectoryResolver.cs (25)
30[.. Path.GetInvalidFileNameChars(), Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
113string resolved = Path.GetFullPath(
114Path.Combine(resultsRoot, GetProjectDirectoryName(module), GetPivotDirectoryName(module)));
133return Path.Combine(artifactsPath, ArtifactsTestDirectoryName);
137? Path.Combine(workingDirectory, DefaultResultsDirectoryName)
154string normalizedRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(root));
155string relative = Path.GetRelativePath(normalizedRoot, candidate);
158&& !relative.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal)
159&& !relative.StartsWith(".." + Path.AltDirectorySeparatorChar, StringComparison.Ordinal)
160&& !Path.IsPathRooted(relative);
173string? moduleDirectory = Path.GetDirectoryName(GetProjectPath(module, workingDirectory));
196string firstRoot = Path.GetPathRoot(first) ?? string.Empty;
197string secondRoot = Path.GetPathRoot(second) ?? string.Empty;
203char[] separators = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
215return Path.Combine(firstRoot, string.Join(Path.DirectorySeparatorChar, firstSegments, 0, shared));
272? Path.GetFileNameWithoutExtension(module.TargetPath)
273: Path.GetFileNameWithoutExtension(module.ProjectFullPath);
290string relativePath = Path.GetRelativePath(identityRoot, path)
291.Replace(Path.DirectorySeparatorChar, '/');
300return string.IsNullOrEmpty(path) ? string.Empty : Path.GetFullPath(path, basePath);
parent\dotnet\Commands\Workload\Install\WorkloadAdvertisingManifestUpdater.cs (14)
102string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "default.json");
113Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
129var workloadSetVersionFilePath = Path.Combine(advertisedPath, Constants.workloadSetVersionFileName);
173var overlayProvider = new TempDirectoryWorkloadManifestProvider(Path.Combine(_userProfileDir, "sdk-advertising", _sdkFeatureBand.ToString()), _sdkFeatureBand.ToString());
204Path.GetFileName(path).StartsWith(manifestPackageId.ToString(), StringComparison.OrdinalIgnoreCase) &&
222File.WriteAllText(Path.Combine(adManifestPath, "AdvertisedManifestFeatureBand.txt"), band.ToString());
235File.WriteAllText(Path.Combine(adManifestPath, Constants.workloadSetVersionFileName), workloadSetVersion);
261var versionDir = Path.GetDirectoryName(packagePath);
266var idDir = Path.GetDirectoryName(versionDir);
297var manifestPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "WorkloadManifest.json");
307var adManifestFeatureBandPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "AdvertisedManifestFeatureBand.txt");
369private string GetAdvertisingManifestSentinelPath(SdkFeatureBand featureBand) => Path.Combine(_userProfileDir, $".workloadAdvertisingManifestSentinel{featureBand}");
373internal static string GetAdvertisingWorkloadsFilePath(string userProfileDir, SdkFeatureBand featureBand) => Path.Combine(userProfileDir, $".workloadAdvertisingUpdates{featureBand}");
375private string GetAdvertisingManifestPath(SdkFeatureBand featureBand, ManifestId manifestId) => Path.Combine(_userProfileDir, "sdk-advertising", featureBand.ToString(), manifestId.ToString());
parent\dotnet\Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any())
22.Select(path => new SdkFeatureBand(Path.GetFileName(path)));
32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir);
36.Select(file => new WorkloadId(Path.GetFileName(file)));
46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
49var pathDir = Path.GetDirectoryName(path);
60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
parent\dotnet\Telemetry\DevDeviceIDGetter.cs (7)
56cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceid");
60cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid");
71string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid");
104cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceId");
108cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid");
116string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid");
124string directory = Path.GetDirectoryName(filePath);
dotnet-dev-certs (37)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
242var certPath = Path.Combine(certDir, nickname) + ".pem";
356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
358: homeDirectory + Path.DirectorySeparatorChar;
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
370var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
371var certDirFullPath = Path.GetFullPath(certDir);
381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
471var certPath = Path.Combine(certDir, nickname) + ".pem";
561return Path.Combine(homeDirectory, ".pki", "nssdb");
566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
571return Path.Combine(homeDirectory, ".mozilla", "firefox");
576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
600var searchFolders = searchPath.Split(Path.PathSeparator);
610if (File.Exists(Path.Combine(searchFolder, command)))
813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
848var nssDb = Path.GetFullPath(path);
1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
dotnet-format (25)
dotnet-getdocument (14)
dotnet-Microsoft.XmlSerializer.Generator (5)
dotnet-openapi (15)
dotnet-razorpagegenerator (4)
dotnet-sourcelink (1)
dotnet-sql-cache (3)
dotnet-suggest (11)
dotnet-svcutil-lib (165)
CommandProcessorOptions.cs (23)
171fileOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(fileUri.LocalPath)));
395workingDirectory = Path.IsPathRooted(this.OutputFile.OriginalPath()) ?
396Path.GetDirectoryName(this.OutputFile.FullName) : Path.GetDirectoryName(Path.Combine(Directory.GetCurrentDirectory(), this.OutputFile.OriginalPath()));
403new DirectoryInfo(Path.Combine(workingDirectory, this.UpdateServiceReferenceFolder)) :
413if (!Path.IsPathRooted(originalDirSpec))
416this.OutputDir = new DirectoryInfo(Path.Combine(workingDirectory, originalDirSpec));
492var updateFileName = Path.GetFileName(this.UpdateServiceReferenceFolder);
497this.UpdateServiceReferenceFolder = Path.GetDirectoryName(this.UpdateServiceReferenceFolder);
506var paramsFiles = jsonFiles.Except(excludeJsonFiles).Where(fn => Path.GetFileName(fn).Equals(CommandProcessorOptions.SvcutilParamsFileName, RuntimeEnvironmentHelper.FileStringComparison) ||
507Path.GetFileName(fn).Equals(CommandProcessorOptions.WCFCSParamsFileName, RuntimeEnvironmentHelper.FileStringComparison));
521var svcRefNames = paramsFiles.Select(pf => { PathHelper.GetRelativePath(Path.GetDirectoryName(pf), new DirectoryInfo(projectDir), out var relPath); return relPath; })
531var svcutilParmasFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.SvcutilParamsFileName);
534var wcfcsParamsFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.WCFCSParamsFileName);
542var relDir = Path.GetDirectoryName(fileRelPath);
551if (Path.GetFileName(paramsFilePath).Equals(CommandProcessorOptions.WCFCSParamsFileName))
561updateOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(paramsFilePath)));
580var tempDir = Path.GetTempPath();
584this.BootstrapPath = new DirectoryInfo(Path.Combine(tempDir, baseDirName, sessionDirName));
704var projectFullPath = Path.Combine(this.BootstrapPath.FullName, "TFMResolver", "TFMResolver.csproj");
710Directory.Delete(Path.GetDirectoryName(projectFullPath));
853string projFolder = Path.Combine(this.BootstrapPath.FullName, nameof(SvcutilBootstrapper));
Shared\MSBuildProj.cs (31)
67public string FullPath { get { return Path.Combine(DirectoryPath, FileName); } }
161using (var safeLogger = await SafeLogger.WriteStartOperationAsync(logger, $"Parsing project {Path.GetFileName(projectFullPath)}").ConfigureAwait(false))
163projectFullPath = Path.GetFullPath(projectFullPath);
167FileName = Path.GetFileName(projectFullPath),
168DirectoryPath = Path.GetDirectoryName(projectFullPath)
297if (!Path.IsPathRooted(binReference))
316fullPath = new FileInfo(Path.Combine(msbuildProj.DirectoryPath, binReference)).FullName;
338fullPath = Path.Combine(fullPath, binReference);
340else if (Directory.Exists(Path.Combine(msbuildProj.DirectoryPath, fullPath)))
342fullPath = Path.Combine(msbuildProj.DirectoryPath, fullPath, binReference);
385fullPath = Path.GetFullPath(fullPath);
387string projectName = Path.GetFileNameWithoutExtension(fullPath);
388string projectExtension = Path.GetExtension(fullPath);
389string projectDir = Path.GetDirectoryName(fullPath);
427string filePath = Path.Combine(dirPath, DirBuildProps);
558basePath = dependency.FullPath.Substring(0, dependency.FullPath.LastIndexOf(Path.DirectorySeparatorChar));
563new XAttribute("Include", Path.Combine(basePath, $"{framework}\\**")),
802var assetsFile = new FileInfo(Path.Combine(this.DirectoryPath, "obj", "project.assets.json")).FullName;
821if (Path.GetExtension(compiletimeAssembly.Path) == ".dll")
823var dependency = ProjectDependency.FromPackage(Path.GetFileNameWithoutExtension(compiletimeAssembly.Path), lib.Name, lib.Version.ToNormalizedString());
879if (!Path.IsPathRooted(outputPath))
881outputPath = Path.Combine(this.DirectoryPath, outputPath.Trim(new char[] { '\"' }));
885Path.Combine(outputPath, $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json") :
900var targetLib = Path.GetFileName(this._resolvedProperties["TargetPath"].Trim('\"'));
903targetLib = $"{Path.ChangeExtension(this.FileName, ".dll")}";
917if (!Path.GetFileName(assetPath).Equals(targetLib, RuntimeEnvironmentHelper.FileStringComparison))
919dependency = ProjectDependency.FromAssembly(Path.Combine(outputPath, assetPath));
1001var fileName = $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json";
1010.Where(d => Path.GetFileName(d).Equals(fileName, RuntimeEnvironmentHelper.FileStringComparison))
1011.Where(f => PathHelper.GetFolderName(Path.GetDirectoryName(f)) == this.TargetFramework || Directory.GetParent(Directory.GetParent(f).FullName).Name == this.TargetFramework)
Shared\ProjectDependency.cs (12)
75if (!string.IsNullOrWhiteSpace(filePath) && Path.GetInvalidPathChars().Intersect(filePath).Count() > 0)
80if (!string.IsNullOrWhiteSpace(packageName) && Path.GetInvalidFileNameChars().Intersect(packageName).Count() > 0)
108if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(AssemblyName), ext, StringComparison.OrdinalIgnoreCase) == 0))
115(s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0));
118if (s_exeExtensions.Any((ext) => String.Compare(Path.GetExtension(packageName), ext, StringComparison.OrdinalIgnoreCase) == 0))
133fileHasKnownExtension = s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0);
137fileHasKnownExtension = s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0);
145this.FullPath = fileHasKnownExtension ? Path.GetFullPath(filePath) : filePath;
150fileHasKnownExtension ? Path.GetFileNameWithoutExtension(filePath) : Path.GetFileName(filePath);
310if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0))
315else if (s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0))
Shared\Utilities\PathHelper.cs (21)
61if (!isUrl && (Uri.TryCreate(Path.Combine(basePath, input), UriKind.Absolute, out var uri)) && uri.Scheme == "file")
85filePath = Path.Combine(directory.FullName, relPath);
109if (Path.IsPathRooted(childPath))
112var childFileName = Path.GetFileName(childPath);
113var childDirectory = childFileName.Contains("*") ? Path.GetDirectoryName(childPath) : childPath;
114var parentSegments = Path.GetFullPath(parentPath.FullName).Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
115var childSegments = Path.GetFullPath(childDirectory).Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
133builder.Append($"..{Path.AltDirectorySeparatorChar}");
142builder.Append($"{childSegments[idx]}{Path.AltDirectorySeparatorChar}");
151relativePath = builder.ToString().Trim(Path.AltDirectorySeparatorChar);
168return path.Split(new char[] { '/', '\\', Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
178var directory = new DirectoryInfo(Path.Combine(parentDirInfo.FullName, directoryName));
198directory = new DirectoryInfo(Path.Combine(parentDirInfo.FullName, directoryName + nextIndex));
215var dstFilePath = Path.Combine(destinationDir, fileName);
253fullPath = EnumerateItems(workingDir).Where(item => Path.GetFileName(item).Equals(itemName, RuntimeEnvironmentHelper.FileStringComparison)).FirstOrDefault();
259workingDir = Path.GetDirectoryName(workingDir);
dotnet-svcutil-lib.Tests (142)
E2ETests.cs (27)
20this_TestGroupBaselinesDir = Path.Combine(g_BaselinesDir, this_TestCaseName);
21this_TestGroupOutputDir = Path.Combine(g_TestResultsDir, this_TestCaseName);
22this_TestGroupBootstrapDir = Path.Combine(g_TestBootstrapDir, this_TestCaseName);
23this_TestGroupProjDir = Path.Combine(g_TestResultsDir, this_TestCaseName, "Project");
92Directory.CreateDirectory(Path.Combine(this_TestCaseOutputDir, "SvcutilBootstrapper"));
94var uri = $"\"\"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}\"\"";
123var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl");
173var wsdlFile = Path.Combine(this_TestGroupOutputDir, "wsdl", "tempuri.org.wsdl");
176var wsdlDocsSrdDir = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService");
177FileUtil.CopyDirectory(wsdlDocsSrdDir, Path.GetDirectoryName(wsdlFile));
182uri = uri.Replace("$wsdlDir$", $"{Path.GetDirectoryName(wsdlFile)}{Path.DirectorySeparatorChar}");
198var url = $"{Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl")}";
214var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
222var libProjPath = Path.Combine(this_TestGroupOutputDir, "TypesLib", "TypesLib.csproj");
223var binProjPath = Path.Combine(this_TestGroupOutputDir, "BinLib", "BinLib.csproj");
224var assemblyPath = Path.Combine(Path.GetDirectoryName(binProjPath), "bin", "Debug", "netstandard1.3", "BinLib.dll");
228var typeReuseProjectsPath = Path.Combine(g_TestCasesDir, "TypeReuse");
250Directory.CreateDirectory(Path.Combine(this_TestCaseBootstrapDir, "SvcutilBootstrapper"));
252var uri = PathHelper.GetRelativePath(Path.Combine(this_TestGroupOutputDir, "TypeReuseSvc.wsdl"), new DirectoryInfo(this_TestCaseOutputDir));
368var srcParamsFilePath = Path.Combine(g_TestCasesDir, filePath, paramsFileName);
374File.Copy(f, Path.Combine(this_TestCaseProject.DirectoryPath, Path.GetFileName(f)));
501string wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "memberNamedSystem.wsdl");
512string wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "mcMemberNamedSystem.wsdl");
523string wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "TypeNameUseReservedKeyword.wsdl");
GlobalToolTests.cs (36)
64var wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl");
84var wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "InternalTypes_DataSetWrapper.wsdl");
135Directory.CreateDirectory(Path.Combine(this_TestCaseOutputDir, "SvcutilBootstrapper"));
137var uri = $"\"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}\"";
158File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.cs"), Path.Combine(this_TestCaseOutputDir, "FullFramework.cs"), true);
159File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.csproj"), Path.Combine(this_TestCaseOutputDir, "FullFramework.csproj"), true);
161var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl");
162var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
179this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testCaseName);
181this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName);
182this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{testCaseName}.log");
183this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testCaseName);
186File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, "Program.cs"), Path.Combine(this_TestCaseOutputDir, "Program.cs"), true);
187File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, $"{testCaseName}.csproj"), Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), true);
188this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), null, CancellationToken.None);
193var uri = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl");
194var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
207this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testClientFolder);
210this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName);
211this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{this_TestCaseName}.log");
212this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testClientFolder);
215FileUtil.CopyDirectory(Path.Combine(g_TestCasesDir, this_TestCaseName), this_TestGroupOutputDir, true);
216this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testClientFolder}.csproj"), null, CancellationToken.None);
223var uri = Path.Combine(g_TestCasesDir, "wsdl", "TypeReuseSvc.wsdl");
224var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
242var url = $"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}";
246var paramsFilePath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.params.json");
277var uri = Path.Combine(g_TestCasesDir, "TypeReuse", "TypeReuseIXmlSerializable.wsdl");
278var refs = Path.Combine(g_TestCasesDir, "TypeReuse", "CommonTypes.dll");
300var uri = Path.Combine(g_TestCasesDir, "wsdl", "CollectionTypes.wsdl");
TestInit.cs (47)
60File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.props"), "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" />");
61File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.targets"), "<Project></Project>");
62var projectPath = Path.Combine(g_TestOutputDir, "TestStarterProject", "TestStarterProject.csproj");
92var fileName = Path.GetFileNameWithoutExtension(this_TestGroupProjectName);
93var filePath = Path.Combine(this_TestGroupProjDir, this_TestGroupProjectName);
111var projectPath = Path.Combine(outputDir, $"{projectName}.csproj");
112var programPath = Path.Combine(outputDir, $"{projectName}.cs");
119.Replace(Path.GetFileNameWithoutExtension(project.FileName), projectName));
143g_TestOutputDir = Path.Combine(g_RepositoryRoot, "artifacts", "TestOutput");
144g_TestResultsDir = Path.Combine(g_TestOutputDir, "TestResults");
145g_TestBootstrapDir = Path.Combine(g_TestOutputDir, "TestBootstrap");
146g_TestCasesDir = Path.Combine(vsTestsRoot, "TestCases");
147g_BaselinesDir = Path.Combine(vsTestsRoot, "Baselines");
173File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.props"), "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" />");
174File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.targets"), "<Project></Project>");
179string pkgPath = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "Shipping");
182pkgPath = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "NonShipping");
210var projectPath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj");
234var projectPath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj");
242this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testCaseName);
247this_TestCaseBootstrapDir = Path.Combine(this_TestGroupBootstrapDir, testCaseName);
250this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{testCaseName}.log");
266this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testCaseName);
267var linuxBaselinePath = Path.Combine(this_TestCaseBaselinesDir, "Linux");
268if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && File.Exists(Path.Combine(linuxBaselinePath, Path.GetFileName(this_TestCaseLogFile))))
353var linuxBaselinePath = Path.Combine(this_TestCaseBaselinesDir, "Linux");
354if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && File.Exists(Path.Combine(linuxBaselinePath, Path.GetFileName(this_TestCaseLogFile))))
365var nonRefbaselineFiles = baselineFiles.Where(f => f.EndsWith(".cs") && !f.EndsWith(Path.DirectorySeparatorChar + "reference.cs", StringComparison.OrdinalIgnoreCase)).ToList();
375.Any(e => e.Equals(Path.GetExtension(f), RuntimeEnvironmentHelper.FileStringComparison))).ToList();
377var nonRefGeneratedFiles = generatedFiles.Where(f => f.EndsWith(".cs") && !f.EndsWith(Path.DirectorySeparatorChar + "reference.cs", StringComparison.OrdinalIgnoreCase)).ToList();
428var expected = Path.Combine(baselineDir, relativePath);
429Directory.CreateDirectory(Path.GetDirectoryName(expected));
445var scriptPath = Path.Combine(g_TestOutputDir, @"TestScripts", $"{this_TestCaseName}.cmd");
446var globalScriptPath = Path.Combine(g_TestOutputDir, @"TestScripts\deleteAll.cmd");
457Directory.CreateDirectory(Path.GetDirectoryName(scriptPath));
479var isLogFile = Path.GetExtension(baselineFile).Equals(".log", StringComparison.OrdinalIgnoreCase);
537if (!Directory.Exists(Path.Combine(vstestDir, "TestCases")))
539vstestDir = new DirectoryInfo(Path.Combine(g_RepositoryRoot, "src", "dotnet-svcutil", "lib", "tests")).FullName;
555var binDir = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "Shipping");
558binDir = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "NonShipping");
568nugetId = Path.GetFileNameWithoutExtension(nugetFile.Name);
573nugetId = Path.GetFileNameWithoutExtension(nugetFiles[0]);
592g_RepositoryRoot = Path.GetDirectoryName(rootSolutionFolder);
606File.WriteAllText(Path.Combine(directory, "global.json"), globalConfig);
624File.WriteAllText(Path.Combine(g_TestOutputDir, "nuget.config"), nugetConfigText.Replace("$svcutilTestFeed$", g_SvcutilNugetFeed));
UnitTest.cs (16)
61var uri = Path.Combine(g_TestCasesDir, "wsdl", "brokenWsdl.wsdl");
128var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl");
150var uri = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl");
218var wsdlFilesDstDir = Path.Combine(this_TestGroupOutputDir, "wsdl");
221var wsdlFilesSrcDir = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService");
222FileUtil.CopyDirectory(wsdlFilesSrcDir.Replace("$testCasesDir$", g_TestCasesDir), Path.Combine(wsdlFilesDstDir, "WcfProjectNService"), overwrite: true);
224Directory.CreateDirectory(Path.Combine(this_TestGroupOutputDir, "wsdl"));
225File.Copy(Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl"), Path.Combine(this_TestGroupOutputDir, "wsdl", "Simple.wsdl"));
327var jsonFilesRoot = Path.Combine(g_TestCasesDir, "options", "JSON");
329var jsonFileSrcPath = Path.Combine(jsonFilesRoot, jsonFile);
330var jsonFileDstPath = Path.Combine(this_TestCaseOutputDir, Path.GetFileName(jsonFileSrcPath));
347var outputDir = Path.GetTempPath();
353var outJsonFile = Path.Combine(outputDir, Path.GetFileName(jsonFileSrcPath));
dotnet-svcutil.xmlserializer (18)
dotnet-svcutil.xmlserializer.IntegrationTests (1)
dotnet-user-jwts (38)
dotnet-user-secrets (22)
dotnet-watch (18)
Program.cs (10)
40sdkRootDirectory = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "..");
122project = new ProjectRepresentation(projectPath: null, entryPointFilePath: Path.GetFullPath(Path.Combine(workingDirectory, options.FilePath)));
170entryPointPath = Path.GetFullPath(Path.Combine(workingDirectory, firstArg));
191projectPath = Path.GetFullPath(Path.Combine(workingDirectory, projectPath));
205.Where(p => !PathUtilities.OSSpecificPathComparer.Equals(Path.GetExtension(p), ".shproj"))];
378var roslynPath = Path.Combine(sdkRootDirectory, "Roslyn", "bincore");
384var loadedAssembly = context.LoadFromAssemblyPath(Path.Combine(roslynPath, assembly.Name + ".dll"));
DotnetTool.AppHost (4)
GenerateAnalyzerNuspec (32)
Program.cs (32)
142string assemblyNameWithoutExtension = Path.GetFileNameWithoutExtension(assembly);
146string assemblyFolder = Path.Combine(artifactsBinDir, assemblyNameWithoutExtension, configuration, tfm);
147string assemblyPathForNuspec = Path.Combine(assemblyFolder, assembly);
158var resourceAssemblyFullPath = Path.Combine(directory, resourceAssemblyName);
161var directoryName = Path.GetFileName(directory);
162string resourceAssemblyPathForNuspec = Path.Combine(artifactsBinDir, assemblyNameWithoutExtension, configuration, tfm, directoryName, resourceAssemblyName);
163string targetForNuspec = Path.Combine(target, directoryName);
174var fileWithPath = Path.IsPathRooted(file) ? file : Path.Combine(projectDir, file);
180readmeFile = Path.IsPathRooted(readmeFile) ? readmeFile : Path.GetFullPath(Path.Combine(projectDir, readmeFile));
181var directoryName = Path.GetDirectoryName(readmePackageLocation) ?? string.Empty;
189var fileWithPath = Path.Combine(artifactsBinDir, Path.GetFileNameWithoutExtension(file), configuration, tfm, file);
194result.AppendLine(FileElement(fileWithPath, Path.Combine("lib", tfm)));
206string folderPath = Path.Combine(artifactsBinDir, folder, configuration, tfm);
209var fileExtension = Path.GetExtension(file);
212var fileName = Path.GetFileName(file);
216var fileWithPath = Path.Combine(folderPath, file);
217var targetPath = tfms.Length > 1 ? Path.Combine(folder, tfm) : folder;
224result.AppendLine(FileElement(Path.Combine(assetsDir, "Install.ps1"), "tools"));
225result.AppendLine(FileElement(Path.Combine(assetsDir, "Uninstall.ps1"), "tools"));
232if (Path.GetExtension(ruleset) == ".ruleset")
234result.AppendLine(FileElement(Path.Combine(rulesetsDir, ruleset), "rulesets"));
246result.AppendLine(FileElement(Path.Combine(directory, editorconfig), $"editorconfig\\{directoryName}"));
255if (Path.GetExtension(globalconfig) == ".globalconfig")
257result.AppendLine(FileElement(Path.Combine(globalAnalyzerConfigsDir, globalconfig), $"buildTransitive\\config"));
268var fileWithPath = Path.Combine(analyzerDocumentationFileDir, analyzerDocumentationFileName);
277var fileWithPath = Path.Combine(analyzerSarifFileDir, analyzerSarifFileName);
286var fileWithPath = Path.Combine(analyzerConfigurationFileDir, analyzerConfigurationFileName);
293result.AppendLine(FileElement(Path.Combine(assetsDir, "ThirdPartyNotices.txt"), ""));
GenerateDocumentationAndConfigFiles (47)
Program.cs (21)
273var assemblyName = Path.GetFileNameWithoutExtension(assembly);
274string path = Path.Combine(args.BinDirectory, assemblyName, args.Configuration, args.Tfm, assembly);
433var fileWithPath = Path.Combine(directory.FullName, args.PropsFileName);
442fileWithPath = Path.Combine(directory.FullName, args.PropsFileToDisableNetAnalyzersInNuGetPackageName);
544var fileWithPath = Path.Combine(directory.FullName, args.AnalyzerDocumentationFileName);
548var fileTitle = Path.GetFileNameWithoutExtension(args.AnalyzerDocumentationFileName);
640var fileWithPath = Path.Combine(directory.FullName, args.AnalyzerSarifFileName);
734Validate(Path.Combine(directory.FullName, args.AnalyzerSarifFileName), stringWriter.ToString(), fileNamesWithValidationFailures);
776var fileWithPath = Path.Combine(directory.FullName, "RulesMissingDocumentation.md");
899var assemblyDir = Path.GetDirectoryName(assemblyPath);
905var assemblyName = Path.GetFileNameWithoutExtension(assembly);
906var shippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.ShippedFileName);
907var unshippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.UnshippedFileName);
1079var assemblyName = Path.GetFileNameWithoutExtension(assembly);
1080var assemblyDir = Path.Combine(args.BinDirectory, assemblyName, args.Configuration, args.Tfm);
1081return Path.Combine(assemblyDir, assembly);
1112var rulesetFilePath = Path.Combine(directory.FullName, rulesetFileName);
1176var directory = Directory.CreateDirectory(Path.Combine(analyzerEditorconfigsDir, editorconfigFolder));
1177var editorconfigFilePath = Path.Combine(directory.FullName, ".editorconfig");
1400var configFilePath = Path.Combine(directory.FullName, fileName.ToLowerInvariant());
1612var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
GenerateTemplateManifest (50)
Program.cs (17)
27var packagePath = Path.Combine(Path.GetDirectoryName(lockPath)!, "package.json");
77if (!File.Exists(Path.Combine(Path.GetDirectoryName(packagePath)!, "package-lock.json")))
84File.WriteAllText(Path.Combine(restoreDirectory, "Directory.Build.props"), "<Project />");
85File.WriteAllText(Path.Combine(restoreDirectory, "Directory.Build.targets"), "<Project />");
86File.WriteAllText(Path.Combine(restoreDirectory, "Directory.Packages.props"), "<Project />");
138Settings.LoadSpecificSettings(Path.GetDirectoryName(nugetConfigPath)!, Path.GetFileName(nugetConfigPath)));
139var privateCache = Path.Combine(restoreDirectory, "packages");
143var packagePath = Path.GetFullPath(Path.Combine(privateCache, package.ToLowerInvariant().Replace('/', Path.DirectorySeparatorChar)));
144if (!packagePath.StartsWith(privateCache + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
174var restoreConfigPath = Path.Combine(restoreDirectory, "nuget.config");
214var assetsPath = Path.Combine(restoreDirectory, project.Name, "obj", "project.assets.json");
219Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!);
TemplateRestorePlan.cs (33)
26var snapshot = Path.Combine(workDirectory, "template-inputs");
31var templateRoot = Path.GetDirectoryName(Path.GetDirectoryName(configPath))!;
32var relativeRoot = Path.GetRelativePath(sourceDirectory, templateRoot);
33var destination = Path.Combine(snapshot, relativeRoot);
34Directory.CreateDirectory(Path.Combine(destination, ".template.config"));
40if (Path.GetExtension(sourcePath) is ".props" or ".targets")
44var relative = Path.GetRelativePath(sourceDirectory, sourcePath);
45var output = Path.Combine(snapshot, relative);
46Directory.CreateDirectory(Path.GetDirectoryName(output)!);
47File.Copy(Path.Combine(processedDirectory, relative), output, overwrite: true);
49File.Copy(Path.Combine(processedDirectory, Path.GetRelativePath(sourceDirectory, configPath)),
50Path.Combine(destination, ".template.config", "template.json"), overwrite: true);
57settingsLocation: Path.Combine(workDirectory, "template-hive"));
72var configPath = Path.Combine(snapshot, template.ConfigPlace.TrimStart('/', '\\').Replace('/', Path.DirectorySeparatorChar));
74var templateRoot = Path.GetDirectoryName(Path.GetDirectoryName(configPath))!;
81var output = Path.Combine(workDirectory, "rendered", ConfigurationCount.ToString("D4", CultureInfo.InvariantCulture));
138documents.Add(Path.GetFullPath(path), XDocument.Load(path).Root!);
175documents.Add(Path.ChangeExtension(path, ".csproj"), project);
198var relative = reference.Attribute("Include")!.Value.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
199var referencedPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path)!, relative));
298var projectDirectory = Path.Combine(directory, project.Name);
300new XDocument(root).Save(Path.Combine(projectDirectory, $"{project.Name}.csproj"));
302var solutionPath = Path.Combine(directory, "TemplateDependencies.slnx");
308private static bool IsProject(string path) => Path.GetExtension(path) is ".csproj" or ".esproj";
309private static bool IsDependencyInput(string path) => IsProject(path) || Path.GetExtension(path) is ".props" or ".targets" ||
310Path.GetExtension(path) == ".cs" && File.ReadLines(path).Any(line => line.StartsWith("#:", StringComparison.Ordinal));
GetDocument.Insider (8)
HelixTestTasks (1)
ilasm (7)
ilc (13)
ILCompiler.Build.Tasks (3)
ILCompiler.Compiler (12)
ILCompiler.Diagnostics (8)
ILCompiler.ReadyToRun (36)
ILCompiler.RyuJit (1)
illink (26)
Linker.Steps\OutputStep.cs (13)
158using (var fs = File.Open(Path.Combine(Context.OutputDirectory, Context.PInvokesListFile), FileMode.Create))
176File.Delete(Path.ChangeExtension(target, "pdb"));
219var satelliteAssembly = Path.Combine(subDirectory, resourceFile);
223string cultureName = subDirectory.Substring(subDirectory.LastIndexOf(Path.DirectorySeparatorChar) + 1);
224string culturePath = Path.Combine(directory, cultureName);
227File.Copy(satelliteAssembly, Path.Combine(culturePath, resourceFile), true);
237string target = Path.GetFullPath(GetConfigFile(GetAssemblyFileName(assembly, directory)));
247return Path.GetFileNameWithoutExtension(assembly) + ".resources.dll";
263string target = Path.GetFullPath(Path.Combine(directory, fi.Name));
277var pdb = Path.ChangeExtension(source, "pdb");
279File.Copy(pdb, Path.ChangeExtension(target, "pdb"), true);
285return Path.Combine(directory, file);
ILLink.Tasks (6)
Infrastructure.Common (3)
Infrastructure.Tests (1421)
BuildWarningPolicyTests.cs (17)
21var script = Path.Combine(workspace.Path, "evaluate.ps1");
90var common = Directory.CreateDirectory(Path.Combine(root, "eng", "common")).FullName;
93File.Copy(Path.Combine(RepoRoot.Path, "eng", file), Path.Combine(root, "eng", file));
98File.Copy(Path.Combine(RepoRoot.Path, file), Path.Combine(root, file));
102await File.WriteAllTextAsync(Path.Combine(root, "Directory.Build.props"), scenario == "invalid-policy" || clean ? "<Project>" : """
114await File.WriteAllTextAsync(Path.Combine(root, "eng", "Logger.proj"), """
121await File.WriteAllTextAsync(Path.Combine(common, "tools.ps1"), """
133await File.WriteAllTextAsync(Path.Combine(common, "tools.sh"), """
146await File.WriteAllTextAsync(Path.Combine(common, "build.ps1"), """
166var commonBash = Path.Combine(common, "build.sh");
204File.SetUnixFileMode(Path.Combine(root, "eng", "build.sh"), UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
269var harness = Path.Combine(root, "run.ps1");
279var report = Path.Combine(root, "report.txt");
280var bootstrap = Path.Combine(root, "bootstrap.txt");
321var dotnet = Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (23)
72var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
84Path.Combine(fixtureDirectory, "search-issue.json"),
89Path.Combine(fixtureDirectory, "create-issue.json"),
123Path.Combine(fixtureDirectory, "search-issue.json"),
133File.WriteAllText(Path.Combine(fixtureDirectory, "add-issue-comment.json"), "{}");
153var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
164Path.Combine(fixtureDirectory, "search-issue.json"),
174File.WriteAllText(Path.Combine(fixtureDirectory, "reopen-issue.json"), "{}");
175File.WriteAllText(Path.Combine(fixtureDirectory, "add-issue-comment.json"), "{}");
195var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
206Path.Combine(fixtureDirectory, "search-issue.json"),
211Path.Combine(fixtureDirectory, "create-issue.json"),
237var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
248Path.Combine(fixtureDirectory, "search-issue.json"),
258Path.Combine(fixtureDirectory, "create-issue.json"),
285var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
431var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
530var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
560var queuedDiagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
586var failedDiagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log"));
691var fixtureDirectory = Path.Combine(_workspace.Path, Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture));
832var fixtureDirectory = Path.Combine(_workspace.Path, Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture));
988return Path.Combine(fixtureDirectory, $"{fileName}{extension}");
CreateLayout\CreateLayoutTests.cs (29)
18using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "win-x64", configuration, "1.0.0", verbose: false, trayAppPath: null, windowsTrayPath: null);
39using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "win-x64", "Debug", "1.0.0", verbose: false, trayAppPath: null, windowsTrayPath: null);
51var outputPath = Path.Combine(workspace.Path, "layout");
97var filePath = Path.Combine(publishPath, relativePath);
98Directory.CreateDirectory(Path.GetDirectoryName(filePath)!);
102var outputPath = Path.Combine(workspace.Path, "layout");
107var dashboardPath = Path.Combine(outputPath, "dashboard");
109.Select(path => Path.GetRelativePath(dashboardPath, path).Replace(Path.DirectorySeparatorChar, '/'));
113Assert.Equal(File.ReadAllBytes(Path.Combine(publishPath, relativePath)), File.ReadAllBytes(Path.Combine(dashboardPath, relativePath)));
122var wwwrootPath = Path.Combine(publishPath, "wwwroot");
124var outputPath = Path.Combine(workspace.Path, "layout");
130Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard")));
140var blazorScriptPath = Path.Combine(publishPath, "wwwroot", "_framework", "blazor.web.js");
150var outputPath = Path.Combine(workspace.Path, "layout");
156Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard")));
170var sqliteLibraryPath = Path.Combine(publishPath, sqliteLibraryName);
180var outputPath = Path.Combine(workspace.Path, "layout");
186Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard")));
191var publishPath = Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", rid, "Debug", "net11.0", rid, "publish");
192var frameworkPath = Path.Combine(publishPath, "wwwroot", "_framework");
195File.WriteAllText(Path.Combine(publishPath, executableName), "executable");
196File.WriteAllText(Path.Combine(publishPath, sqliteLibraryName), "sqlite");
197File.WriteAllText(Path.Combine(frameworkPath, "blazor.web.js"), "static asset");
204Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", "win-x64", configuration, "net11.0", "win-x64", "publish"),
205Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", configuration, "net11.0", "win-x64", "publish"),
206Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", configuration, "net11.0", "win-x64", "native"),
207Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", configuration, "net11.0", "publish")
ExtractTestPartitions\ExtractTestPartitionsTests.cs (22)
31var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
37var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
56var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
62var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
77var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
83var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
101var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
104var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
119var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
126var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
144var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
151var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
167var nonExistentPath = Path.Combine(_workspace.Path, "DoesNotExist.dll");
168var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
193var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
199var outputFile = Path.Combine(_workspace.Path, "nested", "dir", "partitions.txt");
213var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
218var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
235var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
242var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
260var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
267var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
GenerateTestSummary\GenerateTestSummaryToolTests.cs (20)
31var trxPath = Path.Combine(_workspace.Path, "sample.trx");
53var trxPath = Path.Combine(_workspace.Path, "mixed.trx");
60var jsonPath = Path.Combine(_workspace.Path, "failed.json");
81var trxPath = Path.Combine(_workspace.Path, "aborted.trx");
87var jsonPath = Path.Combine(_workspace.Path, "failed.json");
104var trxPath = Path.Combine(_workspace.Path, "allpass.trx");
110var jsonPath = Path.Combine(_workspace.Path, "failed.json");
133var trxDir = Path.Combine(_workspace.Path, "corrupt");
135await File.WriteAllTextAsync(Path.Combine(trxDir, "broken.trx"), "this is not valid trx xml <<<");
137var jsonPath = Path.Combine(_workspace.Path, "failed.json");
160var trxDir = Path.Combine(_workspace.Path, "partial");
163Path.Combine(trxDir, "clean.trx"),
165await File.WriteAllTextAsync(Path.Combine(trxDir, "broken.trx"), "this is not valid trx xml <<<");
167var jsonPath = Path.Combine(_workspace.Path, "failed.json");
187var trxDir = Path.Combine(_workspace.Path, "partial-with-failure");
190Path.Combine(trxDir, "failed.trx"),
192await File.WriteAllTextAsync(Path.Combine(trxDir, "broken.trx"), "this is not valid trx xml <<<");
194var jsonPath = Path.Combine(_workspace.Path, "failed.json");
216var trxPath = Path.Combine(_workspace.Path, "timestamped.trx");
225var jsonPath = Path.Combine(_workspace.Path, "failed.json");
Hex1bNativePublishingTests.cs (39)
20Path.Combine(RepoRoot.Path, "artifacts", "tests", nameof(Hex1bNativePublishingTests), Guid.NewGuid().ToString("N"))));
49var destination = Path.Combine(_workspace.Path, "publish", relativePath);
83var artifacts = Path.Combine(_workspace.Path, "artifacts");
84var publish = Path.Combine(artifacts, "bin", "Aspire.Managed", "Release", "net10.0", rid, "publish");
96WriteFile(Path.Combine(publish, file), file);
100var dashboardPublish = Path.Combine(artifacts, "bin", "Aspire.Dashboard", rid, "Release", "net11.0", rid, "publish");
112WriteFile(Path.Combine(dashboardPublish, file), file);
126var packages = Path.Combine(_workspace.Path, "packages");
127WriteFile(Path.Combine(packages, $"microsoft.developercontrolplane.{packageRid}", "1.0.0", "tools", "dcp"), "dcp");
128var layout = Path.Combine(_workspace.Path, "layout");
131["exec", "--runtimeconfig", Path.ChangeExtension(testAssembly, ".runtimeconfig.json"),
132"--depsfile", Path.ChangeExtension(testAssembly, ".deps.json"),
139var tray = Path.Combine(_workspace.Path, "windows-tray");
154Assert.Contains(Path.GetFileName(missingSidecar), result.Output);
160var managed = Path.Combine(layout, "managed");
162.Select(path => Path.GetRelativePath(managed, path).Replace('\\', '/')).Order(StringComparer.Ordinal));
165Assert.True(File.ReadAllBytes(Path.Combine(publish, file)).SequenceEqual(File.ReadAllBytes(Path.Combine(managed, file))), file);
168var dashboard = Path.Combine(layout, "dashboard");
170.Select(path => Path.GetRelativePath(dashboard, path).Replace('\\', '/')).Order(StringComparer.Ordinal));
173Assert.True(File.ReadAllBytes(Path.Combine(dashboardPublish, file)).SequenceEqual(File.ReadAllBytes(Path.Combine(dashboard, file))), file);
184var layout = Path.Combine(_workspace.Path, "layout");
185var marker = Path.Combine(layout, "existing.txt");
193["exec", "--runtimeconfig", Path.ChangeExtension(testAssembly, ".runtimeconfig.json"),
194"--depsfile", Path.ChangeExtension(testAssembly, ".deps.json"),
196"--output", layout, "--artifacts", Path.Combine(_workspace.Path, "missing-artifacts"), "--rid", rid, "--configuration", "Release"]);
213var repositoryTargets = XDocument.Load(Path.Combine(RepoRoot.Path, "Directory.Build.targets"));
216var hostingTargets = XDocument.Load(Path.Combine(RepoRoot.Path, "src", "Aspire.Hosting", "buildTransitive", "Aspire.Hosting.targets"));
218var hostingProject = XDocument.Load(Path.Combine(RepoRoot.Path, "src", "Aspire.Hosting", "Aspire.Hosting.csproj"));
228var signingProps = XDocument.Load(Path.Combine(RepoRoot.Path, "eng", "Signing.props"));
250var pipeline = await File.ReadAllTextAsync(Path.Combine(
273var source = Path.Combine(_workspace.Path, "package", pathInPackage);
279new XElement("DestinationSubPath", rid.Length == 0 ? pathInPackage : Path.GetFileName(pathInPackage)),
283var unrelatedSource = Path.Combine(_workspace.Path, "other", "OpenConsole.exe");
298new XAttribute("Include", Path.Combine(_workspace.Path, "duplicate", "OpenConsole.exe")),
316new XElement("Import", new XAttribute("Project", Path.Combine(RepoRoot.Path, "src", "Aspire.Hosting", "buildTransitive", "Aspire.Hosting.targets"))),
332var projectPath = Path.Combine(_workspace.Path, "Publish.proj");
349Directory.CreateDirectory(Path.GetDirectoryName(path)!);
MicrosoftTestingPlatformTests.cs (5)
21var script = Path.Combine(workspace.Path, "evaluate.ps1");
30.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"))
51var script = Path.Combine(workspace.Path, "runner-help.ps1");
58.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"))
63var target = XDocument.Load(Path.Combine(RepoRoot.Path, "eng", "Xunit3", "Microsoft.Testing.Platform.targets"));
Pipelines\NixCliPackageTests.cs (14)
73var outputPath = Path.Combine(_workspace.Path, "versions.json");
74var fakeBinPath = Path.Combine(_workspace.Path, "bin");
77var curlPath = Path.Combine(fakeBinPath, "curl");
94Path.Combine(RepoRoot.Path, "eng", "nix", "update-versions.sh"),
98["PATH"] = fakeBinPath + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
118var outputPath = Path.Combine(_workspace.Path, "versions.json");
119var fakeBinPath = Path.Combine(_workspace.Path, "bin");
124var curlPath = Path.Combine(fakeBinPath, "curl");
156Path.Combine(RepoRoot.Path, "eng", "nix", "update-versions.sh"),
160["PATH"] = fakeBinPath + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")
180var outputPath = Path.Combine(_workspace.Path, "versions.json");
185Path.Combine(RepoRoot.Path, "eng", "nix", "update-versions.sh"),
252=> Path.IsPathRooted(relativePath)
254: File.ReadAllTextAsync(Path.Combine(RepoRoot.Path, relativePath));
Pipelines\NpmCliPackageTests.cs (37)
36_packScriptPath = Path.Combine(_repoRoot, "eng", "scripts", "pack-cli-npm-package.ps1");
169Path.Combine(pointerPackageRoot, "bin", "aspire.js"),
180var testScriptPath = Path.Combine(_workspace.Path, $"{Path.GetRandomFileName()}.js");
202Path.Combine(pointerPackageRoot, "bin", "aspire.js"),
220var testScriptPath = Path.Combine(_workspace.Path, $"{Path.GetRandomFileName()}.js");
236Path.Combine(pointerPackageRoot, "bin", "aspire.js"),
249var packageJson = ReadJsonObject(Path.Combine(package.PointerPackageRoot, "package.json"));
265var packageMap = ReadJsonObject(Path.Combine(package.PointerPackageRoot, "bin", "aspire-package-map.json"));
270var readme = await File.ReadAllTextAsync(Path.Combine(package.PointerPackageRoot, "README.md"));
335var packageJson = ReadJsonObject(Path.Combine(package.RidPackageRoot, "package.json"));
353Assert.True(File.Exists(Path.Combine(package.RidPackageRoot, "bin", expectation.BinaryName)));
355var readme = await File.ReadAllTextAsync(Path.Combine(package.RidPackageRoot, "README.md"));
572=> File.ReadAllTextAsync(Path.Combine(_repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)));
576var testRoot = Path.Combine(_workspace.Path, Path.GetRandomFileName());
577var nodeModulesRoot = Path.Combine(testRoot, "node_modules");
578var pointerPackageRoot = Path.Combine(nodeModulesRoot, "@microsoft", "aspire-cli");
579var pointerBinRoot = Path.Combine(pointerPackageRoot, "bin");
583Path.Combine(_repoRoot, "eng", "clipack", "npm", "aspire.js"),
584Path.Combine(pointerBinRoot, "aspire.js"));
587Path.Combine(pointerPackageRoot, "package.json"),
601await File.WriteAllTextAsync(Path.Combine(pointerBinRoot, "aspire-package-map.json"), packageMap.ToJsonString());
607var ridPackageRoot = Path.Combine(nodeModulesRoot, "@microsoft", $"aspire-cli-{rid.Rid}");
608var ridBinRoot = Path.Combine(ridPackageRoot, "bin");
612Path.Combine(ridPackageRoot, "package.json"),
620await File.WriteAllTextAsync(Path.Combine(ridBinRoot, "aspire"), "native binary stub");
621await File.WriteAllTextAsync(Path.Combine(ridBinRoot, "aspire.exe"), "native binary stub");
641var testRoot = Path.Combine(_workspace.Path, Path.GetRandomFileName());
642var stagingRoot = Path.Combine(testRoot, "staging");
643var outputPath = Path.Combine(testRoot, "output");
644var nativeBinaryPath = Path.Combine(testRoot, "native-aspire-stub");
665Path.Combine(stagingRoot, "rid"),
666Path.Combine(stagingRoot, "pointer"));
Pipelines\TrayBundleTests.cs (49)
53File.Delete(Path.Combine(source, missingFile));
54using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "osx-arm64", "Debug", "test", false, source, null);
58Assert.Contains(Path.Combine(source, missingFile), error.Message);
68File.SetUnixFileMode(Path.Combine(source, "Contents/MacOS/aspire-tray"), UnixFileMode.UserRead);
69using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "osx-arm64", "Debug", "test", false, source, null);
83var layout = Path.Combine(workspace.Path, "osx-arm64");
84var destination = Path.Combine(layout, "tray", "Aspire Tray.app");
90.Select(file => Path.GetRelativePath(source, file)).Order().ToArray();
92.Select(file => Path.GetRelativePath(destination, file)).Order().ToArray());
95Assert.Equal(File.ReadAllBytes(Path.Combine(source, file)), File.ReadAllBytes(Path.Combine(destination, file)));
96Assert.Equal(File.GetUnixFileMode(Path.Combine(source, file)), File.GetUnixFileMode(Path.Combine(destination, file)));
114Assert.Equal(File.GetUnixFileMode(Path.Combine(source, relativePath)), entry.Mode);
117Assert.Equal(File.ReadAllBytes(Path.Combine(source, relativePath)), content.ToArray());
167var pipeline = File.ReadAllText(Path.Combine(RepoRoot.Path, "eng/pipelines/templates/build_sign_native.yml"));
185var archivePath = Path.Combine(workspace.Path, "signing", "AspireTray.zip");
186var scriptPath = Path.Combine(workspace.Path, "prepare-signing.ps1");
207.Select(file => $"{Path.GetFileName(source)}/{Path.GetRelativePath(source, file)}").Order().ToArray();
211var file = Path.Combine(Path.GetDirectoryName(source)!, entry.FullName);
245Path.Combine(RepoRoot.Path, "eng/github-ci/test-trigger-map.yml"),
279var source = Path.Combine(workspace.Path, "publish with spaces");
281File.WriteAllText(Path.Combine(source, "smoke.stdout.log"), "not runtime content");
282var layout = Path.Combine(workspace.Path, rid);
301Assert.Equal(File.ReadAllBytes(Path.Combine(source, Path.GetFileName(entry.Name))), content.ToArray());
316var source = Path.Combine(workspace.Path, "publish");
320File.Delete(Path.Combine(source, "Aspire.ico"));
324File.Delete(Path.Combine(source, "aspire-tray.exe"));
328File.Copy(typeof(TrayBundleTests).Assembly.Location, Path.Combine(source, "aspire-tray.exe"), overwrite: true);
330using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path,
359var pipeline = File.ReadAllText(Path.Combine(RepoRoot.Path, "eng/pipelines/templates/build_sign_native.yml"));
369var workflow = File.ReadAllText(Path.Combine(RepoRoot.Path, ".github/workflows/build-cli-native-archives.yml"));
407var publish = File.ReadAllText(Path.Combine(RepoRoot.Path, "src/Aspire.Tray/Windows/publish.ps1"));
428var source = Path.Combine(workspace.Path, "source");
430File.Copy(Path.Combine(RepoRoot.Path, "src/Shared/Aspire.ico"), Path.Combine(source, "Aspire.ico"), overwrite: true);
431var layout = Path.Combine(workspace.Path, rid);
434var tray = Path.Combine(layout, "tray");
439File.Copy(Path.Combine(source, "Aspire.ico"), Path.Combine(tray, "Aspire.ico"), overwrite: true);
442File.Delete(Path.Combine(tray, "Aspire.ico"));
445File.WriteAllText(Path.Combine(tray, "Aspire.ico"), "wrong icon");
448File.WriteAllText(Path.Combine(tray, "smoke.log"), "unexpected runtime content");
451File.Copy(typeof(TrayBundleTests).Assembly.Location, Path.Combine(tray, "aspire-tray.exe"), overwrite: true);
455using var command = new PowerShellCommand(Path.Combine(RepoRoot.Path, "tools/CreateLayout/verify-windows-tray-payload.ps1"), output)
467private static XDocument LoadProject(string path) => XDocument.Load(Path.Combine(RepoRoot.Path, path));
PowerShellScripts\BuildTestMatrixTests.cs (72)
23_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "build-test-matrix.ps1");
33var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
37Path.Combine(artifactsDir, "MyProject.tests-metadata.json"),
42var outputFile = Path.Combine(_workspace.Path, "matrix.json");
63var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
67Path.Combine(artifactsDir, "ProjectA.tests-metadata.json"),
72Path.Combine(artifactsDir, "ProjectB.tests-metadata.json"),
76var outputFile = Path.Combine(_workspace.Path, "matrix.json");
95var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
99Path.Combine(artifactsDir, "SplitProject.tests-metadata.json"),
105Path.Combine(artifactsDir, "SplitProject.tests-partitions.json"),
108var outputFile = Path.Combine(_workspace.Path, "matrix.json");
136var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
140Path.Combine(artifactsDir, "ClassSplitProject.tests-metadata.json"),
146Path.Combine(artifactsDir, "ClassSplitProject.tests-partitions.json"),
149var outputFile = Path.Combine(_workspace.Path, "matrix.json");
172var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
177Path.Combine(artifactsDir, "NoTimeouts.tests-metadata.json"),
181var outputFile = Path.Combine(_workspace.Path, "matrix.json");
199var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
203Path.Combine(artifactsDir, "CustomTimeouts.tests-metadata.json"),
208var outputFile = Path.Combine(_workspace.Path, "matrix.json");
226var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
230Path.Combine(artifactsDir, "NeedsNugets.tests-metadata.json"),
236Path.Combine(artifactsDir, "NoNugets.tests-metadata.json"),
241var outputFile = Path.Combine(_workspace.Path, "matrix.json");
260var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
264Path.Combine(artifactsDir, "FilterTest.tests-metadata.json"),
269Path.Combine(artifactsDir, "FilterTest.tests-partitions.json"),
272var outputFile = Path.Combine(_workspace.Path, "matrix.json");
290var emptyArtifactsDir = Path.Combine(_workspace.Path, "empty-artifacts");
293var outputFile = Path.Combine(_workspace.Path, "matrix.json");
310var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
314Path.Combine(artifactsDir, "SplitProject.tests-metadata.json"),
322Path.Combine(artifactsDir, "SplitProject.tests-partitions.json"),
325var outputFile = Path.Combine(_workspace.Path, "matrix.json");
351var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
355Path.Combine(artifactsDir, "SdkProject.tests-metadata.json"),
360var outputFile = Path.Combine(_workspace.Path, "matrix.json");
378var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
382Path.Combine(artifactsDir, "LinuxOnly.tests-metadata.json"),
387var outputFile = Path.Combine(_workspace.Path, "matrix.json");
406var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
410Path.Combine(artifactsDir, "OsRestrictedSplit.tests-metadata.json"),
417Path.Combine(artifactsDir, "OsRestrictedSplit.tests-partitions.json"),
420var outputFile = Path.Combine(_workspace.Path, "matrix.json");
443var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
447Path.Combine(artifactsDir, "CustomRunner.tests-metadata.json"),
452var outputFile = Path.Combine(_workspace.Path, "matrix.json");
472var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
476Path.Combine(artifactsDir, "NoRunner.tests-metadata.json"),
480var outputFile = Path.Combine(_workspace.Path, "matrix.json");
498var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
502Path.Combine(artifactsDir, "SplitRunner.tests-metadata.json"),
509Path.Combine(artifactsDir, "SplitRunner.tests-partitions.json"),
512var outputFile = Path.Combine(_workspace.Path, "matrix.json");
534var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
538Path.Combine(artifactsDir, "ClassRunner.tests-metadata.json"),
549Path.Combine(artifactsDir, "ClassRunner.tests-partitions.json"),
552var outputFile = Path.Combine(_workspace.Path, "matrix.json");
577var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
581Path.Combine(artifactsDir, "DefaultProps.tests-metadata.json"),
585var outputFile = Path.Combine(_workspace.Path, "matrix.json");
612var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
628Path.Combine(artifactsDir, "PartialProps.tests-metadata.json"),
631var outputFile = Path.Combine(_workspace.Path, "matrix.json");
658var propsPath = Path.Combine(RepoRoot.Path, "eng", "testing", "CITestsProperties.props");
699var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
703Path.Combine(artifactsDir, "SplitProps.tests-metadata.json"),
710Path.Combine(artifactsDir, "SplitProps.tests-partitions.json"),
713var outputFile = Path.Combine(_workspace.Path, "matrix.json");
757var propsPath = Path.Combine(RepoRoot.Path, "eng", "testing", "CITestsProperties.props");
PowerShellScripts\DownloadNativeArchivesTests.cs (20)
23_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "download-native-archives.ps1");
143.Select(p => Path.GetRelativePath(archivesDir, p).Replace(Path.DirectorySeparatorChar, '/'))
155.Select(p => Path.GetRelativePath(nupkgsDir, p).Replace(Path.DirectorySeparatorChar, '/'))
169var dashboardArtifactsDir = Path.Combine(Path.GetDirectoryName(archivesDir)!, "dashboard-artifacts");
171.Select(p => Path.GetRelativePath(dashboardArtifactsDir, p).Replace(Path.DirectorySeparatorChar, '/'))
208File.Exists(Path.Combine(_workspace.Path, "escaped", "aspire-cli-linux-x64-13.4.0.tar.gz")),
247Assert.True(File.Exists(Path.Combine(
283Assert.True(File.Exists(Path.Combine(
346Assert.True(File.Exists(Path.Combine(
384Assert.True(File.Exists(Path.Combine(
415"-DashboardArtifactsTargetDir", $"\"{Path.Combine(Path.GetDirectoryName(archivesTargetDir)!, "dashboard-artifacts")}\"",
436var unique = Path.GetRandomFileName();
437var archives = Path.Combine(_workspace.Path, unique, "archives");
438var nupkgs = Path.Combine(_workspace.Path, unique, "nupkgs");
607var fileName = Path.GetFileNameWithoutExtension(path); // strip .zip
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (46)
23_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "expand-test-matrix-github.ps1");
39var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
42var outputFile = Path.Combine(_workspace.Path, "expanded.json");
66var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
69var outputFile = Path.Combine(_workspace.Path, "expanded.json");
92var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
95var outputFile = Path.Combine(_workspace.Path, "expanded.json");
116var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
119var outputFile = Path.Combine(_workspace.Path, "expanded.json");
142var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
145var outputFile = Path.Combine(_workspace.Path, "expanded.json");
169var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
172var outputFile = Path.Combine(_workspace.Path, "expanded.json");
200var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
203var outputFile = Path.Combine(_workspace.Path, "expanded.json");
238var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
241var outputFile = Path.Combine(_workspace.Path, "expanded.json");
265var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
268var outputFile = Path.Combine(_workspace.Path, "expanded.json");
282var nonExistentFile = Path.Combine(_workspace.Path, "does-not-exist.json");
283var outputFile = Path.Combine(_workspace.Path, "expanded.json");
301var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
304var outputFile = Path.Combine(_workspace.Path, "expanded.json");
327var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
330var outputFile = Path.Combine(_workspace.Path, "expanded.json");
353var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
356var outputFile = Path.Combine(_workspace.Path, "expanded.json");
386var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
389var outputFile = Path.Combine(_workspace.Path, "expanded.json");
413var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
416var outputFile = Path.Combine(_workspace.Path, "expanded.json");
452var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
455var outputFile = Path.Combine(_workspace.Path, "expanded.json");
486var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json");
489var outputFile = Path.Combine(_workspace.Path, "expanded.json");
509var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
513Path.Combine(artifactsDir, "RegularProject.tests-metadata.json"),
519Path.Combine(artifactsDir, "SplitMultiOS.tests-metadata.json"),
526Path.Combine(artifactsDir, "SplitMultiOS.tests-partitions.json"),
530Path.Combine(artifactsDir, "LinuxE2E.tests-metadata.json"),
538Path.Combine(artifactsDir, "CliE2E.tests-metadata.json"),
547var buildMatrixScript = Path.Combine(RepoRoot.Path, "eng", "scripts", "build-test-matrix.ps1");
548var canonicalFile = Path.Combine(_workspace.Path, "canonical.json");
558var expandedFile = Path.Combine(_workspace.Path, "expanded.json");
563var splitScriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "split-test-matrix-by-deps.ps1");
564var githubOutputFile = Path.Combine(_workspace.Path, "github_output.txt");
PowerShellScripts\SplitTestProjectsTests.cs (11)
32_scriptPath = Path.Combine(_repoRoot, "eng", "scripts", "split-test-projects-for-ci.ps1");
42var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
48var outputFile = Path.Combine(_workspace.Path, "partitions.json");
72var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
77var outputFile = Path.Combine(_workspace.Path, "partitions.json");
100var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
106var outputFile = Path.Combine(_workspace.Path, "partitions.json");
131var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll");
138var outputFile = Path.Combine(_workspace.Path, "partitions.json");
166var nonExistentPath = Path.Combine(_workspace.Path, "DoesNotExist.dll");
167var outputFile = Path.Combine(_workspace.Path, "partitions.json");
PowerShellScripts\ValidateNpmPackageSignaturesTests.cs (13)
28_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "validate-npm-package-signatures.ps1");
37var missing = Path.Combine(_workspace.Path, "does-not-exist");
54var filePath = Path.Combine(_workspace.Path, "not-a-directory.txt");
71File.WriteAllText(Path.Combine(shipping, "Aspire.Hosting.13.4.0.nupkg"), "decoy");
84var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz");
100var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz");
118var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz");
137var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz");
163var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz");
187var tgzMissing = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz");
188var tgzBadPrefix = Path.Combine(shipping, "microsoft-aspire-cli-win-x64-13.4.0.tgz");
213var unique = Path.GetRandomFileName();
214var path = Path.Combine(_workspace.Path, unique, "Shipping");
PowerShellScripts\WriteClassModeTestPropsTests.cs (14)
19_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "write-class-mode-test-props.ps1");
28var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
32Path.Combine(artifactsDir, "RegularProject.tests-metadata.json"),
37Path.Combine(artifactsDir, "PartitionSplitProject.tests-metadata.json"),
42Path.Combine(artifactsDir, "PartitionSplitProject.tests-partitions.json"),
46Path.Combine(artifactsDir, "ClassSplitProject.tests-metadata.json"),
50var outputPropsPath = Path.Combine(_workspace.Path, "ClassModeProjects.props");
67var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
71Path.Combine(artifactsDir, "PartitionSplitProject.tests-metadata.json"),
76Path.Combine(artifactsDir, "PartitionSplitProject.tests-partitions.json"),
79var outputPropsPath = Path.Combine(_workspace.Path, "ClassModeProjects.props");
94var artifactsDir = Path.Combine(_workspace.Path, "artifacts");
98Path.Combine(artifactsDir, "Broken.tests-metadata.json"),
106var outputPropsPath = Path.Combine(_workspace.Path, "ClassModeProjects.props");
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions)
84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions);
194path = Path.Combine(directory, fileName);
222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal)
223|| Path.IsPathRooted(executablePath);
TemplateManifest\TemplateManifestBuildTargetTests.cs (15)
20var intermediate = Path.Combine(root, "artifacts", "obj");
21var restore = Directory.CreateDirectory(Path.Combine(intermediate, "template-cg-restore")).FullName;
22File.WriteAllText(Path.Combine(restore, "project.assets.json"), "{}");
23var sibling = Path.Combine(intermediate, "keep.txt");
25var manifest = Path.Combine(root, "artifacts", "cg", "templates", "cgmanifest.json");
26Directory.CreateDirectory(Path.GetDirectoryName(manifest)!);
31var templateProject = XDocument.Load(Path.Combine(RepoRoot.Path, "src", "Aspire.ProjectTemplates", "Aspire.ProjectTemplates.csproj"));
32var projectPath = Path.Combine(root, "cleanup.proj");
33var generator = Path.Combine(root, "generator.ps1");
36new XElement("RepoRoot", root + Path.DirectorySeparatorChar),
37new XElement("IntermediateOutputPath", Path.Combine(intermediate, "unused", "..")),
38new XElement("ArtifactsShippingPackagesDir", Path.Combine(root, "artifacts", "packages") + Path.DirectorySeparatorChar)),
56var runner = Path.Combine(root, "run.ps1");
64.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"))
TemplateManifest\TemplateManifestCommandTests.cs (7)
61arguments[0] = Path.Combine(workspace.Path, "missing");
64arguments[1] = Path.Combine(workspace.Path, "missing");
67arguments[3] = Path.Combine(workspace.Path, "missing.config");
106var config = Path.Combine(workspace.Path, "nuget.config");
110source, processed, Path.Combine(workspace.Path, "cgmanifest.json"), config,
111Path.Combine(workspace.Path, "package feed"), Path.Combine(workspace.Path, "restore directory")
TemplateManifest\TemplateManifestGenerationTests.cs (11)
21var feed = customFeed ? Path.Combine(root, "custom feed") : Path.Combine(root, "artifacts", "packages", configuration, "Shipping");
25var report = Path.Combine(root, "invocations.txt");
39var manifestPath = Path.Combine(root, "artifacts", "cg", "templates", "cgmanifest.json");
40Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!);
65var feed = Path.Combine(root, "artifacts", "packages", "Debug", "Shipping");
80.WithEnvironmentVariable("TEMPLATE_CG_REPORT", Path.Combine(root, "invocations.txt"))
90new PowerShellCommand(Path.Combine(RepoRoot.Path, "eng", "scripts", "generate-template-cgmanifest.ps1"), output)
95using var archive = ZipFile.Open(Path.Combine(directory, $"Aspire.ProjectTemplates.{version}.nupkg"), ZipArchiveMode.Create);
108File.WriteAllText(Path.Combine(root, "dotnet.cmd"), """
116var path = Path.Combine(root, "dotnet.sh");
TemplateManifest\TemplateManifestTestEnvironment.cs (12)
30TemplateDirectory = Directory.CreateDirectory(Path.Combine(SourceDirectory, "template")).FullName;
34RestoreDirectory = Path.Combine(workspace.Path, "restore");
35ManifestPath = Path.Combine(workspace.Path, "cgmanifest.json");
36ConfigPath = Path.Combine(workspace.Path, "nuget.config");
38Directory.CreateDirectory(Path.Combine(TemplateDirectory, ".template.config"));
39File.WriteAllText(Path.Combine(TemplateDirectory, ".template.config", "template.json"), """
91var dotnet = Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
93var script = Path.Combine(_workspace.Path, scriptName);
100.WithEnvironmentVariable("PATH", Path.GetDirectoryName(dotnet) + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH"))
103.WithEnvironmentVariable("NUGET_HTTP_CACHE_PATH", Path.Combine(_workspace.Path, "http-cache"))
114var path = Path.Combine(feed, $"{name}.{version}.nupkg");
TemplateManifest\TemplateRestorePlanTests.cs (13)
71var configPath = Path.Combine(source, "choices", ".template.config", "template.json");
102File.WriteAllText(Path.Combine(source, "edges", "Child.csproj"), """
160var path = Path.Combine(directory, "App.csproj");
167using var assets = JsonDocument.Parse(File.ReadAllText(Path.Combine(directory, "obj", "project.assets.json")));
196var path = Path.Combine(workspace.Path, "normalized.proj");
198var script = Path.Combine(workspace.Path, "evaluate.ps1");
205.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"))
249File.Delete(Path.Combine(source, "single", "App.csproj"));
250File.WriteAllText(Path.Combine(source, "single", "apphost.cs"), """
285var directory = Path.Combine(source, identity);
286Directory.CreateDirectory(Path.Combine(directory, ".template.config"));
287File.WriteAllText(Path.Combine(directory, "App.csproj"), project);
304File.WriteAllText(Path.Combine(directory, ".template.config", "template.json"), config.ToJsonString());
TestTriggerMap\GraphAffectedProjectsTests.cs (17)
318var changedFilesPath = System.IO.Path.Combine(_workspace.Path, "changed.txt");
320return GraphAffectedProjects.Compute(_workspace.Path, System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), from: null, to: null, changedFilesPath: changedFilesPath).AffectedProjects;
325var changedFilesPath = System.IO.Path.Combine(_workspace.Path, "changed.txt");
327return GraphAffectedProjects.Compute(_workspace.Path, System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), from: null, to: null, changedFilesPath: changedFilesPath);
334System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"),
348var fullPath = System.IO.Path.Combine(_workspace.Path, relativePath.Replace('\\', System.IO.Path.DirectorySeparatorChar));
349Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!);
356compiles.Select(c => $""" <Compile Include="{c}" Link="{System.IO.Path.GetFileName(c)}" />""")
440var newFull = System.IO.Path.Combine(_workspace.Path, newRelativePath.Replace('/', System.IO.Path.DirectorySeparatorChar));
441Directory.CreateDirectory(System.IO.Path.GetDirectoryName(newFull)!);
445return GraphAffectedProjects.Compute(_workspace.Path, System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), from: baseSha, to: "HEAD", changedFilesPath: null).AffectedProjects;
450var fullPath = System.IO.Path.Combine(_workspace.Path, relativePath.Replace('\\', System.IO.Path.DirectorySeparatorChar));
451Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!);
458compiles.Select(c => $""" <Compile Include="{c}" Link="{System.IO.Path.GetFileName(c)}" />""")
TestTriggerMap\SelectTestsAcceptanceTests.cs (32)
124var path = Path.Combine(NewMapDir(), "map.yml");
809var mapPath = Path.Combine(NewMapDir(), "map.yml");
834var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
918var mapPath = Path.Combine(NewMapDir(), "map.yml");
942var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
963var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
979var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
990var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1012var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1037var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1049var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1068var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1089var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1112var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1141var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1164var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1179var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1204var srcDir = Path.Combine(RepoRoot.Path, "src");
1205var polyglotRoot = Path.Combine(RepoRoot.Path, "tests", "PolyglotAppHosts");
1213var name = Path.GetFileName(projectDir);
1219var baseline = Path.Combine(projectDir, "api", $"{name}.ats.txt");
1220if (File.Exists(baseline) && Directory.Exists(Path.Combine(polyglotRoot, name)))
1231var polyglotRoot = Path.Combine(RepoRoot.Path, "tests", "PolyglotAppHosts");
1233.Select(Path.GetFileName)
1260var componentsRoot = Path.Combine(RepoRoot.Path, "src", "Components");
1261foreach (var dir in Directory.EnumerateDirectories(componentsRoot).Select(Path.GetFileName).Order(StringComparer.Ordinal))
1275var testsDir = Path.Combine(RepoRoot.Path, "tests");
1277.Select(Path.GetFileName)
1278.Where(name => name is not null && File.Exists(Path.Combine(testsDir, name!, $"{name}.csproj")))
1285var testsDir = Path.Combine(RepoRoot.Path, "tests");
1287.Select(path => Path.GetFileNameWithoutExtension(path))
1295var slnx = File.ReadAllText(Path.Combine(RepoRoot.Path, "Aspire.slnx"));
TestTriggerMap\SelectTestsCliTests.cs (47)
99Assert.Contains("## SelectTests", File.ReadAllText(Path.Combine(repoRoot, "summary")));
164var slnxPath = Path.Combine(dir.FullName, "custom", "MyApp.slnx");
165Directory.CreateDirectory(Path.GetDirectoryName(slnxPath)!);
167File.WriteAllText(Path.Combine(dir.FullName, "map.yml"), Map);
171var propsPath = Path.Combine(dir.FullName, "BeforeBuildProps.props");
220var commentPath = Path.Combine(repoRoot, "comment.md");
272var commentPath = Path.Combine(repoRoot, "comment.md");
328var commentPath = Path.Combine(repoRoot, "comment.md");
369var commentPath = Path.Combine(repoRoot, "comment.md");
400var commentPath = Path.Combine(repoRoot, "comment.md");
446var commentPath = Path.Combine(repoRoot, "comment.md");
462var summary = File.ReadAllText(Path.Combine(repoRoot, "summary"));
499var commentPath = Path.Combine(repoRoot, "comment.md");
524var solution = File.ReadAllText(Path.Combine(RepoRoot.Path, "Aspire.slnx"));
532var project = File.ReadAllText(Path.Combine(RepoRoot.Path, projectPath));
537.Select(Path.GetFileNameWithoutExtension)
540var runsheetTargets = File.ReadAllText(Path.Combine(
575var commentPath = Path.Combine(repoRoot, "comment.md");
618var jsonPath = Path.Combine(repoRoot, "selection.json");
662var missing = Path.Combine(repoRoot, "does-not-exist.txt");
664var unwritableSummary = Path.Combine(repoRoot, "no", "such", "dir", "summary.md");
856var missing = Path.Combine(repoRoot, "does-not-exist.txt");
863var summary = File.ReadAllText(Path.Combine(repoRoot, "summary"));
901var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props");
939var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props");
965var summary = File.ReadAllText(Path.Combine(repoRoot, "summary"));
988var commentPath = Path.Combine(repoRoot, "comment.md");
989var jsonPath = Path.Combine(repoRoot, "selection.json");
1002var summary = File.ReadAllText(Path.Combine(repoRoot, "summary"));
1043var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props");
1084var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props");
1122var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props");
1138var changed = Path.Combine(repoRoot, "changed.txt");
1243File.WriteAllText(Path.Combine(repoRoot, "skip-patterns.txt"), "# docs\n**.md\n");
1249var summary = File.ReadAllText(Path.Combine(repoRoot, "summary"));
1257File.WriteAllText(Path.Combine(repoRoot, "skip-patterns.txt"), ".github/workflows/**\n");
1280MapPath: Path.Combine(repoRoot, "map.yml"),
1281SlnxPath: slnxPath ?? Path.Combine(repoRoot, "Aspire.slnx"),
1294var changed = Path.Combine(repoRoot, "changed.txt");
1310File.WriteAllText(Path.Combine(dir.FullName, "Aspire.slnx"), slnx);
1311File.WriteAllText(Path.Combine(dir.FullName, "map.yml"), map);
1314body(dir.FullName, Path.Combine(dir.FullName, "BeforeBuildProps.props"), output));
1348var outputPath = Path.Combine(dir, "output");
1350Environment.SetEnvironmentVariable("GITHUB_STEP_SUMMARY", Path.Combine(dir, "summary"));
1393var fullPath = Path.Combine(repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar));
1394Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
TestTriggerMap\SelectTestsLayer1IntegrationTests.cs (27)
39var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props");
45MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"),
46SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"),
79var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props");
85MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"),
86SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"),
134var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props");
139MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"),
140SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"),
170var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props");
174var commentPath = System.IO.Path.Combine(fixture.Path, "comment.md");
175var jsonPath = System.IO.Path.Combine(fixture.Path, "selection.json");
184MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"),
185SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"),
197var summary = File.ReadAllText(System.IO.Path.Combine(fixture.Path, "summary"));
233var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props");
237var commentPath = System.IO.Path.Combine(fixture.Path, "comment.md");
238var jsonPath = System.IO.Path.Combine(fixture.Path, "selection.json");
247MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"),
248SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"),
381var changed = System.IO.Path.Combine(_workspace.Path, "changed.txt");
412var outputPath = System.IO.Path.Combine(_workspace.Path, "output");
414Environment.SetEnvironmentVariable("GITHUB_STEP_SUMMARY", System.IO.Path.Combine(_workspace.Path, "summary"));
445var fullPath = System.IO.Path.Combine(_workspace.Path, relativePath.Replace('\\', System.IO.Path.DirectorySeparatorChar));
446Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!);
453compiles.Select(c => $""" <Compile Include="{c}" Link="{System.IO.Path.GetFileName(c)}" />""")
TestTriggerMap\SelectTestsWorkflowTests.cs (6)
250=> Path.Combine(RepoRoot.Path, ".github", "actions", "select-tests", "action.yml");
253=> Path.Combine(RepoRoot.Path, ".github", "actions", "check-changed-files", "action.yml");
256=> Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml");
259=> Path.Combine(RepoRoot.Path, "eng", "Versions.props");
262=> Path.Combine(RepoRoot.Path, ".github", "workflows", "build-cli-native-archives.yml");
265=> Path.Combine(RepoRoot.Path, ".github", "workflows", "native-dashboard-validation.yml");
TestTriggerMap\TestTriggerMapTests.cs (35)
270var slnx = File.ReadAllText(Path.Combine(RepoRoot.Path, "Aspire.slnx"));
292var testsRoot = Path.Combine(RepoRoot.Path, "tests");
295.Select(Path.GetFileName)
298.Where(rel => File.Exists(Path.Combine(RepoRoot.Path, rel)))
313.Select(path => Path.GetFileNameWithoutExtension(path))
337.Select(p => Path.GetFileNameWithoutExtension(p))
419var workflowsDir = Path.Combine(RepoRoot.Path, ".github", "workflows");
420var testsYml = File.ReadAllText(Path.Combine(workflowsDir, "tests.yml"));
422bool WorkflowExists(string file) => File.Exists(Path.Combine(workflowsDir, file));
465var documentation = File.ReadAllText(Path.Combine(RepoRoot.Path, "docs", "ci", "test-trigger-map.md"));
472var map = File.ReadAllText(Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"));
1134using (var reader = new StringReader(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"))))
1181var testsYml = File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"));
1253var testsYml = File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"));
1290using (var reader = new StringReader(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"))))
1339using (var reader = new StringReader(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"))))
1395Path.Combine(RepoRoot.Path, ".github", "workflows", "extension-e2e-tests.yml"))))
1419var testsYml = File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"));
1436var testsYml = File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"));
1460.Where(name => !File.Exists(Path.Combine(RepoRoot.Path, "tests", name, $"{name}.csproj")))
1474Assert.True(File.Exists(Path.Combine(RepoRoot.Path, s_map.Prefilter.PatternsFile!)),
1538var prefilterPatterns = File.ReadAllLines(Path.Combine(RepoRoot.Path, "eng", "github-ci", "ci-skip-entirely-patterns.txt"))
1552var workflowsDir = Path.Combine(RepoRoot.Path, ".github", "workflows");
1623.Select(projectPath => Path.GetFileNameWithoutExtension(projectPath)!)
1639.Select(projectPath => Path.GetFileNameWithoutExtension(projectPath)!)
1643Path.Combine(RepoRoot.Path, "tests"), "*.csproj", SearchOption.AllDirectories)
1644.Select(Path.GetFileNameWithoutExtension)
1652.Select(projectPath => Path.GetDirectoryName(projectPath)!.Replace('\\', '/'))
1654var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml");
1717var solutionPath = Path.Combine(RepoRoot.Path, "Aspire.slnx");
1733var solutionPath = Path.Combine(RepoRoot.Path, "Aspire.slnx");
1757Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath)!,
1767var relativePath = Path.GetRelativePath(RepoRoot.Path, projectPath).Replace('\\', '/');
1769&& Path.GetFileNameWithoutExtension(relativePath).EndsWith(".Tests", StringComparison.Ordinal);
1785Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml"))))
TypeScriptApiCompat\TypeScriptApiCompatTests.cs (19)
126var baselineRoot = Path.Combine(workspace.Path, "baseline");
127var currentRoot = Path.Combine(workspace.Path, "current");
197var suppressionPath = Path.Combine(workspace.Path, "Pkg.tscompat.suppression.txt");
227var currentSuppressionPath = Path.Combine(workspace.Path, "current", "Pkg.tscompat.suppression.txt");
228var baselineSuppressionPath = Path.Combine(workspace.Path, "baseline", "Pkg.tscompat.suppression.txt");
229Directory.CreateDirectory(Path.GetDirectoryName(currentSuppressionPath)!);
230Directory.CreateDirectory(Path.GetDirectoryName(baselineSuppressionPath)!);
240var currentSuppressions = ApiCompatSuppressionLoader.Load(Path.Combine(workspace.Path, "current"));
241var baselineSuppressions = ApiCompatSuppressionLoader.Load(Path.Combine(workspace.Path, "baseline"));
253var baselineRoot = Path.Combine(workspace.Path, "baseline");
254var currentRoot = Path.Combine(workspace.Path, "current");
255var reportPath = Path.Combine(workspace.Path, "report.md");
289var baselineRoot = Path.Combine(workspace.Path, "baseline");
290var currentRoot = Path.Combine(workspace.Path, "current");
291var reportPath = Path.Combine(workspace.Path, "report.md");
292var excludedPackagesPath = Path.Combine(workspace.Path, "excluded-packages.txt");
293var suppressionPath = Path.Combine(workspace.Path, "Excluded.tscompat.suppression.txt");
328var apiDirectory = Path.Combine(rootPath, "src", packageName, "api");
330File.WriteAllText(Path.Combine(apiDirectory, $"{packageName}.ats.txt"), content);
WorkflowScripts\AnalyzeCiFailureWorkflowTests.cs (546)
24Path.Combine(RepoRoot.Path, ValidationScriptRelativePath));
26Path.Combine(RepoRoot.Path, CandidatesScriptRelativePath));
28Path.Combine(RepoRoot.Path, IssueScriptRelativePath));
30Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath));
68var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
69var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log");
70var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
98["GITHUB_OUTPUT"] = Path.Combine(_workspace.Path, "github-output"),
101["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
266var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
267var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
270Path.Combine(_workspace.Path, ".github", "workflows")).FullName;
272Path.Combine(RepoRoot.Path, HistoryScriptRelativePath),
273Path.Combine(workflowDirectory, Path.GetFileName(HistoryScriptRelativePath)));
275Path.Combine(RepoRoot.Path, CandidatesScriptRelativePath),
276Path.Combine(workflowDirectory, Path.GetFileName(CandidatesScriptRelativePath)));
277var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log");
286["GITHUB_OUTPUT"] = Path.Combine(_workspace.Path, "github-output"),
289["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
297await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-failure-data", "triggering-merge-pr.json")));
311var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
312var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
354Path.Combine(fakeBinDirectory, "git"),
360Path.Combine(_workspace.Path, ".github", "workflows")).FullName;
362Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
363Path.Combine(workflowDirectory, Path.GetFileName(PersistenceScriptRelativePath)));
365var githubOutputPath = Path.Combine(_workspace.Path, "github-output");
376["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
390Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"))).Trim());
394Path.Combine(_workspace.Path, "ci-failure-data", "test-evidence.json"))).Trim());
434var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
435var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
445var githubOutputPath = Path.Combine(_workspace.Path, "github-output");
453["GH_CALL_LOG"] = Path.Combine(_workspace.Path, "gh-calls.log"),
455["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
464var ghCalls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"));
509var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
510var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
512var githubOutputPath = Path.Combine(_workspace.Path, "github-output");
513var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log");
525["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
573var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
574var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
576var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log");
586["GITHUB_OUTPUT"] = Path.Combine(_workspace.Path, "github-output"),
589["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
652var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
653var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
662var githubOutputPath = Path.Combine(_workspace.Path, "github-output");
663var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log");
674["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
699var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
735var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
749var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
770var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
787var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
804Path.Combine(_workspace.Path, "ci-failure-data", "prior-causes")).FullName;
806Path.Combine(priorCausesDirectory, "nuget-timeout.json"),
809var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
826Path.Combine(_workspace.Path, "ci-failure-data", "prior-causes")).FullName;
828Path.Combine(priorCausesDirectory, "flaky-failure.json"),
831var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
852var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
884var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
911var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
943var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
959Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
962var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
966await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json")));
992Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
995var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1022Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
1030var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1034await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json")));
1058var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1079var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1100var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1116Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
1119var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1139var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1159var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1179Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
1182var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1198Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
1201var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1221Path.Combine(_workspace.Path, "ci-failure-data", "test-failures.json"),
1224var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1256var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1289var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1325var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1342File.Delete(Path.Combine(_workspace.Path, "ci-failure-data", "run.json"));
1344var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1362Path.Combine(_workspace.Path, "ci-failure-data", "run.json"),
1365var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1414var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1449var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1496var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1500await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json")));
1526var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1546var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1605var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1621var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1644var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1675var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1711var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1715await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "flaky-failure.json")));
1738var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1758Path.Combine(_workspace.Path, "ci-failure-data", "prior-causes")).FullName;
1761Path.Combine(priorCausesDirectory, "nuget-timeout.json"),
1770var causePath = Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "nuget-timeout.json");
1771var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1790var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1810var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1835var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
1877var analysisPath = Path.Combine(_workspace.Path, "analysis.json");
1878var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json");
1885Path.Combine(RepoRoot.Path, CommentScriptRelativePath),
1904var analysisPath = Path.Combine(_workspace.Path, "analysis.json");
1905var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json");
1935Path.Combine(RepoRoot.Path, CommentScriptRelativePath),
1950var analysisPath = Path.Combine(_workspace.Path, "analysis.json");
1951var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json");
1993Path.Combine(RepoRoot.Path, CommentScriptRelativePath),
2149var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
2200var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
2223var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
2242var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
2270var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
2291var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
2324var causePath = Path.Combine(_workspace.Path, "main-build-break.json");
2325var runContextPath = Path.Combine(_workspace.Path, "run-context.json");
2326var lastSuccessfulRunPath = Path.Combine(_workspace.Path, "last-successful-main-run.json");
2327var triggeringMergePath = Path.Combine(_workspace.Path, "triggering-merge-pr.json");
2328var candidateHistoryStatusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
2329var bodyPath = Path.Combine(_workspace.Path, "issue-body.md");
2330var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json");
2342Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
2407var causePath = Path.Combine(_workspace.Path, "main-build-break.json");
2408var runContextPath = Path.Combine(_workspace.Path, "run-context.json");
2409var lastSuccessfulRunPath = Path.Combine(_workspace.Path, "last-successful-main-run.json");
2410var triggeringMergePath = Path.Combine(_workspace.Path, "triggering-merge-pr.json");
2411var candidateHistoryStatusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
2412var bodyPath = Path.Combine(_workspace.Path, "issue-body.md");
2413var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json");
2427Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
2487var causePath = Path.Combine(_workspace.Path, "flaky-failure.json");
2488var bodyPath = Path.Combine(_workspace.Path, "issue-body.md");
2489var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json");
2505Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
2801Path.Combine(_workspace.Path, ".github", "workflows")).FullName;
2803Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
2804Path.Combine(workflowDirectory, Path.GetFileName(PersistenceScriptRelativePath)));
2806Path.Combine(_workspace.Path, "ci-failure-data")).FullName;
2808Path.Combine(failureDataDirectory, "run-context.json"),
2810await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "failed-jobs.json"), "[]");
2812Path.Combine(failureDataDirectory, "last-successful-main-run.json"),
2815Path.Combine(failureDataDirectory, "triggering-merge-pr.json"),
2818Path.Combine(failureDataDirectory, "candidate-merge-history-status.json"),
2821Path.Combine(failureDataDirectory, "candidate-merges.json"),
2839Path.Combine(failureDataDirectory, "analysis-summary.md"));
3033var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3039var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3042Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3047Assert.Equal("00001.trx", Path.GetFileName(extractedFile));
3055var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3061var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3064Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3078Assert.Equal("00001.json", Path.GetFileName(extractedFile));
3086var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3091var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3094Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3106var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3111var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3114Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3126var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3131var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3135Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3158var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3170var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3173Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3185var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3190var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3193Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3205var archivePath = Path.Combine(_workspace.Path, "test-results.zip");
3214var outputDirectory = Path.Combine(_workspace.Path, "extracted");
3217Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3229var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3243var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3258Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3279var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3300var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3314Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3339var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3341var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3353Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3370var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3382var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3394Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3415var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3443var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3465Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3490var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3492var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3506Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3526var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3528var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3542Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3562var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3564var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3578Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3598var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json");
3612var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3631Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3651var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3653Path.Combine(testResultsDirectory.FullName, "00001.trx"),
3670var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3676var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3679Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3700var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3702Path.Combine(testResultsDirectory.FullName, "00001.json"),
3713var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3717var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3720Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3742var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3744Path.Combine(testResultsDirectory.FullName, "00001.json"),
3755var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3759var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3762Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3780var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3782Path.Combine(testResultsDirectory.FullName, "00001.json"),
3799var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3803var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3806Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3824var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3826var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3830var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3833Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3851var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3853Path.Combine(testResultsDirectory.FullName, "00001.json"),
3856var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3860var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3863Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3885var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3887Path.Combine(testResultsDirectory.FullName, "00001.trx"),
3896Path.Combine(testResultsDirectory.FullName, "00002.trx"),
3898var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3902var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3905Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3926var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3928Path.Combine(testResultsDirectory.FullName, "00001.trx"),
3930var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3934var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3937Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3958var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3959await File.WriteAllTextAsync(Path.Combine(testResultsDirectory.FullName, "results.xml"), "<TestRun />");
3960var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
3964var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
3967Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
3988var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results"));
3990Path.Combine(testResultsDirectory.FullName, "00001.trx"),
3998var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json");
4002var outputPath = Path.Combine(_workspace.Path, "test-failures.json");
4005Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
4037var openIssuesPath = Path.Combine(_workspace.Path, "open-issues.json");
4038var closedIssuesPath = Path.Combine(_workspace.Path, "closed-issues.json");
4043Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
4048["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4080Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
4086["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4108Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
4112["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4130Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
4134["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4145var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log");
4156var openIssuesPath = Path.Combine(_workspace.Path, "open-issues.json");
4157var closedIssuesPath = Path.Combine(_workspace.Path, "closed-issues.json");
4160Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
4165["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4224var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4225var gitCallLog = Path.Combine(_workspace.Path, "git-calls.log");
4227Path.Combine(fakeBinDirectory, "gh"),
4230Path.Combine(fakeBinDirectory, "git"),
4244["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4245["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4248["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4264var causesDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output", "causes")).FullName;
4266Path.Combine(causesDirectory, "nuget-timeout.json"),
4268var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4269var tempDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "temp")).FullName;
4270var ghCallLog = Path.Combine(_workspace.Path, "gh-calls.log");
4272Path.Combine(fakeBinDirectory, "gh"),
4284Path.Combine(fakeBinDirectory, "git"),
4295["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4296["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4299["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4325var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output");
4326var causesDirectory = Directory.CreateDirectory(Path.Combine(analysisDirectory, "causes")).FullName;
4327var failureDataDirectory = Path.Combine(_workspace.Path, "ci-failure-data");
4332Path.Combine(analysisDirectory, "analysis-result.json"),
4335Path.Combine(causesDirectory, "main-failure.json"),
4338Path.Combine(failureDataDirectory, "run-context.json"),
4341Path.Combine(failureDataDirectory, "last-successful-main-run.json"),
4344Path.Combine(failureDataDirectory, "triggering-merge-pr.json"),
4347Path.Combine(failureDataDirectory, "candidate-merge-history-status.json"),
4350var currentBodyPath = Path.Combine(_workspace.Path, "current-issue-body.md");
4351var storedCausePath = Path.Combine(_workspace.Path, "stored-main-cause.json");
4352var editedBodyPath = Path.Combine(_workspace.Path, "edited-issue-body.md");
4353var editedTitlePath = Path.Combine(_workspace.Path, "edited-issue-title.txt");
4354var editedLabelsPath = Path.Combine(_workspace.Path, "edited-issue-labels.txt");
4410var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4412Path.Combine(fakeBinDirectory, "git"),
4426Path.Combine(fakeBinDirectory, "gh"),
4478["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4479["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4481["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4523var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4524var ghCallLog = Path.Combine(_workspace.Path, "gh-calls.log");
4526Path.Combine(fakeBinDirectory, "gh"),
4543["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4544["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4546["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4561var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4562var tempDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "temp")).FullName;
4563var ghCallLog = Path.Combine(_workspace.Path, "gh-calls.log");
4565Path.Combine(fakeBinDirectory, "gh"),
4583["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4584["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4586["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4603var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4604var ghCallLog = Path.Combine(_workspace.Path, "gh-calls.log");
4606Path.Combine(fakeBinDirectory, "gh"),
4625["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4626["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4628["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
4644var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
4645var tempDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "temp")).FullName;
4646var ghCallLog = Path.Combine(_workspace.Path, "gh-calls.log");
4647var prLookupCountPath = Path.Combine(_workspace.Path, "pr-lookup-count");
4649Path.Combine(fakeBinDirectory, "gh"),
4680["GH_AW_AGENT_OUTPUT"] = Path.Combine(_workspace.Path, "output.json"),
4681["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output"),
4683["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
5130Path.Combine(_workspace.Path, "last-success.json"));
5133using var output = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "last-success.json")));
5136Assert.Contains("per_page=100", await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")), StringComparison.Ordinal);
5138await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")),
5164var outputPath = Path.Combine(_workspace.Path, "last-success.json");
5199var outputPath = Path.Combine(_workspace.Path, "last-success.json");
5206await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")),
5234var outputPath = Path.Combine(_workspace.Path, "last-success.json");
5242await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")),
5264Path.Combine(_workspace.Path, "last-success.json"));
5282Path.Combine(_workspace.Path, "last-success.json"));
5309Path.Combine(_workspace.Path, "last-success.json"));
5312using var output = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "last-success.json")));
5314Assert.True(int.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-call-count"))) >= 2);
5316(await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")))
5343Path.Combine(_workspace.Path, "last-success.json"));
5346using var output = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "last-success.json")));
5348Assert.Equal(2, int.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-call-count"))));
5351(await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")))
5364Path.Combine(_workspace.Path, "last-success.json"));
5377var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5378var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5398var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5399var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5442var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5443var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5491var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5492var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5503var ghCalls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"));
5551var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5552var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5563await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")),
5592var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5593var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5636var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5637var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5676var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json");
5677var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
5719var outputPath = Path.Combine(_workspace.Path, "persisted-main.json");
5777var outputPath = Path.Combine(_workspace.Path, $"persisted-{historyState}.json");
5818var outputPath = Path.Combine(_workspace.Path, "persisted-pr.json");
5871var outputPath = Path.Combine(_workspace.Path, "persisted-pr.json");
5903var outputPath = Path.Combine(_workspace.Path, "persisted-pr.json");
5922var failureDataDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-failure-data")).FullName;
5924Path.Combine(failureDataDirectory, "run-context.json"),
5926var causeFile = Path.Combine(_workspace.Path, "cause.json");
5932Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
5948var newCausePath = Path.Combine(_workspace.Path, "new-cause.json");
5949var existingCausePath = Path.Combine(_workspace.Path, "existing-cause.json");
5950var outputPath = Path.Combine(_workspace.Path, "merged-cause.json");
5959Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
5976var causePath = Path.Combine(_workspace.Path, "prior-cause.json");
5993Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6012var metadataPath = Path.Combine(_workspace.Path, "metadata.json");
6026Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6044var diagnosticsPath = Path.Combine(_workspace.Path, "diagnostics.json");
6053Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6067var logPath = Path.Combine(_workspace.Path, "job.log");
6073Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6120var inputPath = Path.Combine(_workspace.Path, "job.log");
6121var outputPath = Path.Combine(_workspace.Path, "sanitized.log");
6125Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6136var inputPath = Path.Combine(_workspace.Path, "job.log");
6137var outputPath = Path.Combine(_workspace.Path, "sanitized.log");
6143Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6156var causePath = Path.Combine(_workspace.Path, "cause.json");
6157var bodyPath = Path.Combine(_workspace.Path, "issue-body.md");
6158var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json");
6164Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
6222var analysisPath = Path.Combine(_workspace.Path, "analysis.json");
6223var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json");
6251Path.Combine(RepoRoot.Path, CommentScriptRelativePath),
6281var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md");
6282var outputPath = Path.Combine(_workspace.Path, "updated-body.md");
6305Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6325var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md");
6326var canonicalBodyPath = Path.Combine(_workspace.Path, "canonical-body.md");
6327var outputPath = Path.Combine(_workspace.Path, "updated-body.md");
6398Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6446var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md");
6447var outputPath = Path.Combine(_workspace.Path, "updated-body.md");
6464Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6499var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md");
6500var outputPath = Path.Combine(_workspace.Path, "updated-body.md");
6521Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6538var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md");
6539var firstOutputPath = Path.Combine(_workspace.Path, "first-output.md");
6540var secondOutputPath = Path.Combine(_workspace.Path, "second-output.md");
6561Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6570Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6604var causePath = Path.Combine(_workspace.Path, "cause.json");
6605var bodyPath = Path.Combine(_workspace.Path, "issue-body.md");
6606var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json");
6612Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
6664var causePath = Path.Combine(_workspace.Path, "cause.json");
6665var runContextPath = Path.Combine(_workspace.Path, "run-context.json");
6666var lastSuccessfulPath = Path.Combine(_workspace.Path, "last-successful.json");
6667var triggeringMergePath = Path.Combine(_workspace.Path, "triggering-merge.json");
6668var candidateHistoryStatusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json");
6669var bodyPath = Path.Combine(_workspace.Path, "issue-body.md");
6670var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json");
6686Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
6713var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json");
6714var buildCausePath = Path.Combine(_workspace.Path, "build-cause.json");
6715var testCausePath = Path.Combine(_workspace.Path, "test-cause.json");
6716var multiJobCausePath = Path.Combine(_workspace.Path, "multi-job-cause.json");
6727var failureDataDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-failure-data")).FullName;
6729Path.Combine(failureDataDirectory, "run-context.json"),
6733Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6736Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6739Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6742Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6745Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
6777var buildBodyPath = Path.Combine(_workspace.Path, "build-body.md");
6778var buildMetadataPath = Path.Combine(_workspace.Path, "build-metadata.json");
6779var testBodyPath = Path.Combine(_workspace.Path, "test-body.md");
6780var testMetadataPath = Path.Combine(_workspace.Path, "test-metadata.json");
6782Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
6798Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
6912=> File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", fileName));
6916var scriptPath = Path.Combine(RepoRoot.Path, ValidationScriptRelativePath);
6927process.StartInfo.Environment["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ci-analysis-output");
6946var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
6947var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
6957Path.Combine(RepoRoot.Path, HistoryScriptRelativePath),
6961["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
6962["GH_CALL_LOG"] = Path.Combine(_workspace.Path, "gh-calls.log"),
6963["GH_CALL_COUNT_FILE"] = Path.Combine(_workspace.Path, "gh-call-count"),
6969var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName;
6970var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
6980Path.Combine(RepoRoot.Path, CandidatesScriptRelativePath),
6984["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
6985["GH_CALL_LOG"] = Path.Combine(_workspace.Path, "gh-calls.log"),
7003var analysisDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output")).FullName;
7004var causesDirectory = Directory.CreateDirectory(Path.Combine(analysisDirectory, "causes")).FullName;
7005var failureDataDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-failure-data")).FullName;
7007Path.Combine(_workspace.Path, "output.json"),
7012await File.WriteAllTextAsync(Path.Combine(analysisDirectory, "analysis-result.json"), analysis);
7013await File.WriteAllTextAsync(Path.Combine(causesDirectory, "nuget-timeout.json"), cause);
7015Path.Combine(failureDataDirectory, "run-context.json"),
7024Path.Combine(failureDataDirectory, "failed-jobs.json"),
7027Path.Combine(failureDataDirectory, "test-evidence.json"),
7030Path.Combine(failureDataDirectory, "test-failures.json"),
7034var priorCausesDirectory = Directory.CreateDirectory(Path.Combine(failureDataDirectory, "prior-causes")).FullName;
7035await File.WriteAllTextAsync(Path.Combine(priorCausesDirectory, "nuget-timeout.json"), priorCause);
7045var requestPath = Path.Combine(_workspace.Path, "rerun-request.json");
7046var outputPath = Path.Combine(_workspace.Path, "rerun-result.json");
7053agentOutputPath = Path.Combine(_workspace.Path, "output.json"),
7054analysisDir = Path.Combine(_workspace.Path, "ci-analysis-output"),
7065Path.Combine(RepoRoot.Path, "tests", "Infrastructure.Tests", "WorkflowScripts", "analyze-ci-failure-rerun.harness.js"),
7076var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, $"fake-bin-{Guid.NewGuid():N}")).FullName;
7077var fakeGhPath = Path.Combine(fakeBinDirectory, "gh");
7085var workflowDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, ".github", "workflows")).FullName;
7087Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
7088Path.Combine(workflowDirectory, Path.GetFileName(PersistenceScriptRelativePath)));
7090Path.Combine(RepoRoot.Path, CommentScriptRelativePath),
7091Path.Combine(workflowDirectory, Path.GetFileName(CommentScriptRelativePath)));
7093Path.Combine(RepoRoot.Path, IssueScriptRelativePath),
7094Path.Combine(workflowDirectory, Path.GetFileName(IssueScriptRelativePath)));
7096var analysisDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output")).FullName;
7097var failureDataDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-failure-data")).FullName;
7099Path.Combine(analysisDirectory, "analysis-result.json"),
7102Path.Combine(failureDataDirectory, "run-context.json"),
7105Path.Combine(failureDataDirectory, "failed-jobs.json"),
7108Path.Combine(failureDataDirectory, "run.json"),
7110await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "output.json"), """{"items":[]}""");
7200var analysisDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output")).FullName;
7201var failureDataDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-failure-data")).FullName;
7202await File.WriteAllTextAsync(Path.Combine(analysisDirectory, "analysis-result.json"), analysis);
7203await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "run-context.json"), runContext);
7204await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "run.json"), run);
7205await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "failed-jobs.json"), trustedFailedJobs);
7206await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "triggering-merge-pr.json"), triggeringMerge);
7207await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "last-successful-main-run.json"), lastSuccessfulRun);
7208await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "candidate-merges.json"), candidateMerges);
7209await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "candidate-merge-history-status.json"), candidateHistoryStatus);
7210await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "pr-metadata.json"), prMetadata);
7218Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"),
7227Path.Combine(RepoRoot.Path, PersistenceScriptRelativePath),
7231["CI_FAILURE_DATA_DIR"] = Path.Combine(_workspace.Path, "ci-failure-data"),
7289var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output");
7290var failureDataDirectory = Path.Combine(_workspace.Path, "ci-failure-data");
7294await File.WriteAllTextAsync(Path.Combine(analysisDirectory, "analysis-result.json"), analysis);
7295await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "run-context.json"), runContext);
7296await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "failed-jobs.json"), trustedFailedJobs);
7298Path.Combine(failureDataDirectory, "run.json"),
7301Path.Combine(failureDataDirectory, "test-evidence.json"),
7335Path.Combine(failureDataDirectory, "test-failures.json"),
7356var causesDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output", "causes")).FullName;
7359await File.WriteAllTextAsync(Path.Combine(causesDirectory, fileName), cause);
7365var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
7376var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (12)
304var changelogPath = Path.Combine(_workspace.Path, "extension", "CHANGELOG.md");
305Directory.CreateDirectory(Path.GetDirectoryName(changelogPath)!);
315var scriptPath = Path.Combine(RepoRoot.Path, ScriptRelativePath);
358await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("extension", "src", "baseline.txt"), "baseline");
377await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("extension", "src", "feature.txt"), "feature-one");
404await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("extension", "src", "late-main.txt"), "late extension change");
408await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("docs", "late-main.md"), "non-extension main change");
441Path.Combine("extension", "package.json"),
451=> await WriteWorkspaceFileAsync(workingDirectory, Path.Combine("extension", "CHANGELOG.md"), content);
455var fullPath = Path.Combine(workingDirectory, relativePath);
456Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
522var workflowPath = Path.Combine(RepoRoot.Path, WorkflowRelativePath);
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (14)
14private static readonly string s_releaseWorkflowPath = Path.Combine(RepoRoot.Path, ".github", "workflows", "extension-release.yml");
15private static readonly string s_changelogWorkflowPath = Path.Combine(RepoRoot.Path, ".github", "workflows", "extension-changelog.md");
16private static readonly string s_changelogWorkflowLockPath = Path.Combine(RepoRoot.Path, ".github", "workflows", "extension-changelog.lock.yml");
17private static readonly string s_releaseNotesGeneratorPath = Path.Combine(
23private static readonly string s_applyTriggerLabelScriptPath = Path.Combine(
29private static readonly string s_prBodyValidatorPath = Path.Combine(
549var bodyPath = Path.Combine(tempDirectory.FullName, "pr_body.md");
568var bodyPath = Path.Combine(tempDirectory.FullName, "pr_body.md");
589var commitsPath = Path.Combine(tempDirectory.FullName, "commits.txt");
590var outputPath = Path.Combine(tempDirectory.FullName, "release_notes.md");
792var binDirectory = Path.Combine(rootDirectory, "bin");
795var callLogPath = Path.Combine(rootDirectory, "gh-call-log.txt");
796var fakeGhPath = Path.Combine(binDirectory, "gh");
826return new FakeGhFixture(callLogPath, $"{binDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
WorkflowScripts\PrDocsCheckWorkflowTests.cs (6)
119Path.Combine(RepoRoot.Path, ".github", "workflows", "pr-docs-check", "validate_outcome.py"));
231var outcomeFile = Path.Combine(workspace.Path, "outcome.json");
240var requestPath = Path.Combine(workspace.Path, "request.json");
241var resultPath = Path.Combine(workspace.Path, "result.json");
248Path.Combine(RepoRoot.Path, "tests", "Infrastructure.Tests", "WorkflowScripts", "pr-docs-check-notification.harness.js"),
351=> File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", fileName));
WorkflowScripts\SelectTestsCommentScriptTests.cs (6)
33_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "select-tests-comment.harness.js");
105var missingPath = Path.Combine(_workspace.Path, "does-not-exist.md");
180var path = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.md");
230var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
231var outputPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.result.json");
252var lines = File.ReadAllText(Path.Combine(_repoRoot, ".github", "workflows", "tests.yml"))
installer.tasks (10)
Microsoft.Agents.AI.ProjectTemplates.Tests (21)
test\ProjectTemplates\Infrastructure\WellKnownPaths.cs (6)
33ProjectTemplatesArtifactsRoot = Path.Combine(RepoRoot, "artifacts", "ProjectTemplates");
34TemplateSandboxSource = Path.Combine(RepoRoot, "test", "ProjectTemplates", "Infrastructure", "TemplateSandbox");
35TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxSource, "nuget.config");
37LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping");
46var gitPath = Path.Combine(directory, ".git");
66var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
Microsoft.Analyzers.Extra.Tests (4)
Microsoft.Analyzers.Local (2)
Microsoft.Analyzers.Local.Tests (4)
Microsoft.Arcade.Common (13)
Microsoft.AspNetCore (8)
Microsoft.AspNetCore.Components.Testing (13)
Microsoft.AspNetCore.Components.Testing.Tasks (8)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Components.WebAssembly.Server (11)
Microsoft.AspNetCore.Components.WebView (3)
Microsoft.AspNetCore.Components.WebView.Maui (4)
Microsoft.AspNetCore.Components.WebView.WindowsForms (10)
Microsoft.AspNetCore.Components.WebView.Wpf (10)
Microsoft.AspNetCore.DataProtection (10)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (32)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
242var certPath = Path.Combine(certDir, nickname) + ".pem";
356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
358: homeDirectory + Path.DirectorySeparatorChar;
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
370var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
371var certDirFullPath = Path.GetFullPath(certDir);
381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
471var certPath = Path.Combine(certDir, nickname) + ".pem";
561return Path.Combine(homeDirectory, ".pki", "nssdb");
566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
571return Path.Combine(homeDirectory, ".mozilla", "firefox");
576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
600var searchFolders = searchPath.Split(Path.PathSeparator);
610if (File.Exists(Path.Combine(searchFolder, command)))
813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
848var nssDb = Path.GetFullPath(path);
1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.Diagnostics (2)
Microsoft.AspNetCore.Hosting (13)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Results (2)
Microsoft.AspNetCore.HttpLogging (4)
Microsoft.AspNetCore.Identity.UI (4)
Microsoft.AspNetCore.InternalTesting (16)
Microsoft.AspNetCore.Mvc.Core (3)
Microsoft.AspNetCore.Mvc.Localization (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
Microsoft.AspNetCore.Mvc.RazorPages (1)
Microsoft.AspNetCore.Mvc.Testing (5)
Microsoft.AspNetCore.Razor.Utilities.Shared (12)
Microsoft.AspNetCore.Server.IIS (4)
Microsoft.AspNetCore.Server.IntegrationTesting (22)
Microsoft.AspNetCore.Server.Kestrel.Core (49)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
242var certPath = Path.Combine(certDir, nickname) + ".pem";
356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
358: homeDirectory + Path.DirectorySeparatorChar;
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
370var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
371var certDirFullPath = Path.GetFullPath(certDir);
381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
471var certPath = Path.Combine(certDir, nickname) + ".pem";
561return Path.Combine(homeDirectory, ".pki", "nssdb");
566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
571return Path.Combine(homeDirectory, ".mozilla", "firefox");
576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
600var searchFolders = searchPath.Split(Path.PathSeparator);
610if (File.Exists(Path.Combine(searchFolder, command)))
813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
848var nssDb = Path.GetFullPath(path);
1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.SpaProxy (6)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (5)
Microsoft.AspNetCore.StaticFiles (2)
Microsoft.AspNetCore.TestHost (2)
Microsoft.AspNetCore.WebUtilities (6)
Microsoft.Build (280)
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (10)
762? Path.Combine(GetOrInitializeX64Clr2Path(toolName, basePath64), toolName)
763: Path.Combine(GetOrInitializeX32Clr2Path(toolName, basePath), toolName);
768return Path.Combine(s_pathToX64Clr4 ??= basePath64, toolName);
773return Path.Combine(s_pathToArm64Clr4 ??= basePathArm64, toolName);
776return Path.Combine(s_pathToX32Clr4 ??= basePath, toolName);
854string lastDirectoryName = Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar));
888string fullPath = Path.Combine(envPath, toolName);
1276string appHostPath = Path.Combine(msbuildAssemblyPath, Constants.MSBuildExecutableName);
1279: (Path.Combine(msbuildAssemblyPath, Constants.MSBuildAssemblyName), false);
Evaluation\Evaluator.cs (9)
1330string projectFileWithoutExtension = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_projectRootElement.FullPath));
1331string projectExtension = EscapingUtilities.Escape(Path.GetExtension(_projectRootElement.FullPath));
1334string projectFullPath = Path.Combine(projectDirectory, projectFile);
1336int rootLength = Path.GetPathRoot(projectDirectory).Length;
1999ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(sdkResult.Path, project),
2012ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(additionalPath, project),
2049string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(sdkResult.Path, 5), Constants.DotnetProcessName);
2263if (directoryOfImportingFile != null && !Path.IsPathRooted(importFileUnescaped))
2265importFileUnescaped = Path.Combine(directoryOfImportingFile, importFileUnescaped);
Evaluation\Expander\WellKnownFunctions.cs (24)
38var logFile = Path.Combine(Directory.GetCurrentDirectory(), fileName);
50if (string.Equals(methodName, nameof(Path.Combine), StringComparison.OrdinalIgnoreCase))
62returnVal = Path.Combine(arg0);
69returnVal = Path.Combine(arg0, arg1);
76returnVal = Path.Combine(arg0, arg1, arg2);
83returnVal = Path.Combine(arg0, arg1, arg2, arg3);
90returnVal = Path.Combine(Array.ConvertAll(args, o => (string)o));
96else if (string.Equals(methodName, nameof(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase))
100returnVal = Path.DirectorySeparatorChar;
104else if (string.Equals(methodName, nameof(Path.GetFullPath), StringComparison.OrdinalIgnoreCase))
109? Path.GetFullPath(Path.Combine(FileUtilities.CurrentThreadWorkingDirectory, arg0))
110: Path.GetFullPath(arg0);
114else if (string.Equals(methodName, nameof(Path.IsPathRooted), StringComparison.OrdinalIgnoreCase))
118returnVal = Path.IsPathRooted(arg0);
122else if (string.Equals(methodName, nameof(Path.GetTempPath), StringComparison.OrdinalIgnoreCase))
126returnVal = Path.GetTempPath();
130else if (string.Equals(methodName, nameof(Path.GetFileName), StringComparison.OrdinalIgnoreCase))
134returnVal = Path.GetFileName(arg0);
138else if (string.Equals(methodName, nameof(Path.GetDirectoryName), StringComparison.OrdinalIgnoreCase))
142returnVal = Path.GetDirectoryName(arg0);
146else if (string.Equals(methodName, nameof(Path.GetFileNameWithoutExtension), StringComparison.OrdinalIgnoreCase))
150returnVal = Path.GetFileNameWithoutExtension(arg0);
856else if (receiverType == typeof(Path))
Microsoft.Build.Framework (178)
BuildEnvironmentHelper.cs (13)
165return TryFromStandaloneMSBuildExe(Path.Combine(sdkRoot, Constants.MSBuildExecutableName))
166?? TryFromStandaloneMSBuildExe(Path.Combine(sdkRoot, Constants.MSBuildAssemblyName));
240var msBuildExecutableCandidate = Path.Combine(Path.GetDirectoryName(buildAssembly), Constants.MSBuildExecutableName);
368return TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildExecutableName))
370?? TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildAssemblyName));
392string directory = Path.GetDirectoryName(msBuildAssembly);
430var processFileName = Path.GetFileNameWithoutExtension(processName);
606CurrentMSBuildConfigurationFile = Path.ChangeExtension(currentMSBuildExePath, configFileExtension);
656MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory;
660MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory;
667? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild")
725defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
FileUtilities.cs (42)
25using NewPath = System.IO.Path;
26using Path = System.IO.Path;
87string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}");
139internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString();
152cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id));
178return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar);
199return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == WindowsDirectorySeparator ? path : path.Replace(WindowsDirectorySeparator, UnixDirectorySeparator);
213fileSpec += Path.DirectorySeparatorChar;
300path.Value + Path.DirectorySeparatorChar,
356return new AbsolutePath(FixFilePath(NewPath.GetFullPath(path.Value)),
403if (NewPath.IsPathFullyQualified(path))
413return new AbsolutePath(NewPath.GetFullPath(path, workingDir!));
468string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt");
517string.Concat(path.AsSpan(start), new(in Path.DirectorySeparatorChar)));
607while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar)
706string fullPath = NewPath.GetFullPath(path);
712return NormalizePath(Path.Combine(directory, file));
717return NormalizePath(Path.Combine(paths));
869return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString())))
880string? directory = Path.GetDirectoryName(FixFilePath(fileSpec));
892directory += Path.DirectorySeparatorChar;
937if (allowedExtensions != null && Path.HasExtension(fileName))
969string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec));
983fullPath += Path.DirectorySeparatorChar;
1047var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath));
1381string fullBase = NewPath.GetFullPath(basePath);
1382string fullPath = NewPath.GetFullPath(path);
1391while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar)
1422sb.Append("..").Append(Path.DirectorySeparatorChar);
1426sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar);
1429if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar)
1466return Path.IsPathRooted(FixFilePath(path));
1512return paths.Aggregate(root, Path.Combine);
1540var separator = Path.DirectorySeparatorChar;
1680string? lookInDirectory = NewPath.GetFullPath(startingDirectory);
1685string possibleFileDirectory = Path.Combine(lookInDirectory, fileName);
1699lookInDirectory = Path.GetDirectoryName(lookInDirectory);
1719if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Utilities\FileMatcher.cs (26)
128private static readonly string s_directorySeparatorString = Path.DirectorySeparatorChar.ToString();
417Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) &&
621longPath = Path.Combine(longPath, parts[i]);
649longParts[i - startingElement] = Path.GetFileName(longPath);
815return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
1796return IsMatch(Path.GetFileName(path.AsSpan()), pattern);
2148Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
2244fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart);
2575|| (projectDirectory is null && !Path.IsPathRooted(excludeSpec)))
2586&& (FileUtilities.IsAnySlash(spec[0]) || Path.IsPathRooted(spec));
2599string? root = Path.GetPathRoot(directory);
2614if (isLegalFileSpec && projectRoot is not null && !Path.IsPathRooted(fixedDirectoryPart))
2618fixedDirectoryPart = Path.Combine(projectRoot, fixedDirectoryPart);
2673&& !Path.IsPathRooted(fileSpec))
2821includeBaseDirectory = Path.Combine(projectDirectory, includeBaseDirectory);
2822excludeBaseDirectory = Path.Combine(projectDirectory, excludeBaseDirectory);
2874bool includeIsRooted = Path.IsPathRooted(fileSpec);
2888Path.IsPathRooted(excludeSpec),
2931: Path.Combine(projectDirectory, includeBaseDirectory.ToString());
2934: Path.Combine(projectDirectory, excludeBaseDirectory.ToString());
3265string directoryName = Path.GetFileName(subdirectory);
3268: Path.Combine(parentRelativeDirectory, directoryName);
3507Path.Combine(_enumerationRoot, relativeDirectory.ToString()),
3607FileMatcher.Normalize(Path.GetFullPath(string.IsNullOrEmpty(directory) ? "." : directory));
3743builder.Append(Path.DirectorySeparatorChar);
Utilities\FrameworkLocationHelper.cs (30)
445? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11)
455? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20)
465? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30)
475? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35)
485? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40)
495? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45)
505? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11)
515? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20)
592Path.DirectorySeparatorChar.ToString(),
596Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin");
601s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar;
641s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools");
836var frameworkPath = Path.Combine(NativeMethods.FrameworkBasePath, prefix ?? string.Empty);
846return Path.Combine(complusInstallRoot, complusVersion);
851string leaf = Path.GetFileName(currentRuntimePath);
859string baseLocation = Path.GetDirectoryName(currentRuntimePath);
979combinedPath = Path.GetFullPath(combinedPath);
987? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework")
988: Path.Combine(NativeMethods.FrameworkBasePath, "xbuild-frameworks");
990return Path.GetFullPath(combinedPath);
1038string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString());
1041path = Path.Combine(path, "Profile", frameworkName.Profile);
1044return Path.GetFullPath(path);
1066var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)
1068Path.AltDirectorySeparatorChar.ToString(),
1087fixedPath += Path.DirectorySeparatorChar;
1145string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix);
1468(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, Constants.MSBuildExecutableName)) &&
1469!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll"))))
1501frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
Microsoft.Build.NuGetSdkResolver (5)
Microsoft.Build.TaskAuthoring.Analyzer (2)
Microsoft.Build.Tasks.CodeAnalysis (34)
Microsoft.Build.Tasks.Core (283)
AssemblyDependency\ReferenceTable.cs (16)
487if (!Path.IsPathRooted(assemblyFileName))
537string simpleName = Path.GetFileNameWithoutExtension(assemblyFileName);
776pathRooted = Path.IsPathRooted(finalName);
914Path.GetExtension(itemSpec));
974if (!String.IsNullOrEmpty(implementationFile) && Path.GetExtension(implementationFile) == ".dll")
976companionFile = Path.Combine(Path.GetDirectoryName(baseName), implementationFile);
1014string cultureName = Path.GetFileName(subDirectory);
1020string satelliteAssembly = Path.Combine(subDirectory, satelliteFilename);
1024reference.AddSatelliteFile(Path.Combine(cultureName, satelliteFilename));
1043string serializationAssemblyPath = Path.Combine(reference.DirectoryName, serializationAssemblyFilename);
2828AddRelatedItem(serializationAssemblyItems, relatedItemBase, Path.Combine(reference.DirectoryName, serializationAssemblyFile));
2834AddRelatedItem(scatterItems, relatedItemBase, Path.Combine(reference.DirectoryName, scatterFile));
2846relatedItemBase.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile)));
2847AddRelatedItem(satelliteItems, relatedItemBase, Path.Combine(reference.DirectoryName, satelliteFile));
2913yield return new KeyValuePair<string, string>(ItemMetadataNames.winmdImplmentationFile, Path.GetFileName(reference.ImplementationAssembly));
BootstrapperUtil\BootstrapperBuilder.cs (27)
176string strOutputExe = System.IO.Path.Combine(settings.OutputPath, SETUP_EXE);
363string setupSourceFile = System.IO.Path.Combine(bootstrapperPath, SETUP_BIN);
432invariantPath = Util.AddTrailingChar(invariantPath, System.IO.Path.DirectorySeparatorChar);
455packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar)));
459string folder = System.IO.Path.GetDirectoryName(file);
505private string BootstrapperPath => System.IO.Path.Combine(Path, ENGINE_PATH);
507private string PackagePath => System.IO.Path.Combine(Path, PACKAGE_PATH);
509private string SchemaPath => System.IO.Path.Combine(Path, SCHEMA_PATH);
530string startDirectory = System.IO.Path.Combine(BootstrapperPath, RESOURCES_PATH);
537string resourceDirectory = System.IO.Path.Combine(startDirectory, subDirectory);
538string resourceFilePath = System.IO.Path.Combine(resourceDirectory, SETUP_RESOURCES_FILE);
608if (strSubDirectory[nStartIndex] == System.IO.Path.DirectorySeparatorChar)
882string strSubDirectoryFullPath = System.IO.Path.Combine(packagePath, strSubDirectory);
885string strBaseManifestFilename = System.IO.Path.Combine(strSubDirectoryFullPath, ROOT_MANIFEST_FILE);
886string strBaseManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA);
924UpdatePackageFileNodes(packageFilesNode, System.IO.Path.Combine(packagePath, strSubDirectory), strSubDirectory);
937string strLangManifestFilename = System.IO.Path.Combine(strLanguageDirectory, CHILD_MANIFEST_FILE);
938string strLangManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA);
969System.IO.Path.DirectorySeparatorChar)
1174string strSourceFile = System.IO.Path.Combine(strSourcePath, relativePath);
1178targetPathAttribute.Value = System.IO.Path.Combine(strTargetPath, relativePath);
1181string newNameValue = System.IO.Path.Combine(strTargetPath, relativePath);
1470string strDestinationFileName = System.IO.Path.Combine(settings.OutputPath, packageFileDestination.Value);
1479EnsureFolderExists(System.IO.Path.GetDirectoryName(strDestinationFileName));
2005using (var xmlwriter = new XmlTextWriter(System.IO.Path.Combine(s_logPath, fileName), Encoding.UTF8))
2047using (var fileWriter = new StreamWriter(System.IO.Path.Combine(s_logPath, fileName), append))
2208string logPath = System.IO.Path.Combine(
GenerateResource.cs (17)
578commandLineBuilder.AppendFileNameIfNotNull(Path.Combine(_resgenPath, "resgen.exe"));
1599string extension = Path.GetExtension(sourceFilePath);
2140OutputResources[i] = new TaskItem(Path.ChangeExtension(Sources[i].ItemSpec, ".resources"));
2617_assemblyNames[i] = new AssemblyNameExtension(Path.GetFileNameWithoutExtension(assemblyFile.ItemSpec));
2747string priDirectory = Path.Combine(outFileOrDir ?? String.Empty,
2749currentOutputDirectory = Path.Combine(priDirectory,
2757currentOutputFile = Path.Combine(currentOutputDirectory, currentOutputFileNoPath);
2900return Path.GetFullPath(currentOutputFile);
2911currentOutputFile = Path.GetFullPath(currentOutputFile);
2921string shorterPath = Path.Combine(outputDirectory ?? String.Empty, cultureName ?? String.Empty);
2926currentOutputFile = Path.Combine(shorterPath, currentOutputFileNoPath);
2931currentOutputFile = Path.GetFullPath(currentOutputFile);
2982extension = Path.GetExtension(filename);
3012_logger.LogErrorWithCodeFromResources("GenerateResource.UnknownFileExtension", Path.GetExtension(filename), filename);
3506_stronglyTypedClassName = Path.GetFileNameWithoutExtension(outFile);
3551_logger.LogWarningWithCodeFromResources(null, Path.GetFullPath(inputFileName), 0, 0, 0, 0, messageKey, [skipped.Key, .. skipped.AdditionalMessageArgs]);
3574return Path.ChangeExtension(outputResourcesFile, provider.FileExtension);
GetSDKReferenceFiles.cs (12)
512string directory = Path.GetDirectoryName(reference.AssemblyLocation);
513string fileNameNoExtension = Path.GetFileNameWithoutExtension(reference.AssemblyLocation);
514string xmlFile = Path.Combine(directory, fileNameNoExtension + ".xml");
553if (Path.GetExtension(file.RedistFile).Equals(".PRI", StringComparison.OrdinalIgnoreCase))
578string fileExtension = Path.GetExtension(file);
630string targetPath = Path.Combine(targetPathRoot, relativeToBase);
731FileName = Path.GetFileNameWithoutExtension(assemblyLocation);
960referencesCacheFile = Path.Combine(_cacheFileDirectory, GetCacheFileName(saveContext.SdkIdentity, saveContext.SdkRoot, cacheFileInfo.Hash.ToString("X", CultureInfo.InvariantCulture)));
1030group reference by Path.GetDirectoryName(reference);
1085string referencesCacheFile = Path.Combine(cacheFileFolder, GetCacheFileName(sdkIdentity, sdkRoot, hash.ToString("X", CultureInfo.InvariantCulture)));
1165string redistPath = Path.Combine(sdkRoot, "Redist");
1179string referencesPath = Path.Combine(sdkRoot, "References");
InstalledSDKResolver.cs (4)
60string referenceAssemblyFilePath = Path.Combine(sdkDirectory, "References", configuration, architecture);
61string referenceAssemblyCommonArchFilePath = Path.Combine(sdkDirectory, "References", "CommonConfiguration", architecture);
62string referenceAssemblyPathNeutral = Path.Combine(sdkDirectory, "References", configuration, "Neutral");
63string referenceAssemblyArchFilePathNeutral = Path.Combine(sdkDirectory, "References", "CommonConfiguration", "Neutral");
Microsoft.Build.Tasks.Git (61)
GitDataReader\GitConfig.Reader.cs (12)
103return Path.Combine(xdgConfigHome, "git");
108return Path.Combine(_environment.HomeDirectory, ".config", "git");
119var programDataConfig = Path.Combine(_environment.ProgramDataDirectory, "git", "config");
130var systemConfig = Path.Combine(systemDir, "gitconfig");
141var xdgConfig = Path.Combine(xdgDir, "config");
151var globalConfig = Path.Combine(_environment.HomeDirectory, ".gitconfig");
159var localConfig = Path.Combine(_commonDirectory, "config");
180var mingwEtc = Path.Combine(_environment.SystemDirectory, "..", "mingw64", "etc");
283root = Path.GetDirectoryName(basePath) ?? "";
288return Path.GetFullPath(Path.Combine(root, relativePath));
334pattern = PathUtils.CombinePosixPaths(PathUtils.ToPosixPath(Path.GetDirectoryName(configFilePath)!), pattern[2..]);
GitDataReader\GitRepository.cs (18)
139return Path.GetFullPath(Path.Combine(location.GitDirectory, value));
182var dotGitPath = Path.Combine(submoduleWorkingDirectoryFullPath, GitDirName);
244fullPath = Path.GetFullPath(Path.Combine(workingDirectory, path));
281var submodulesConfigFile = Path.Combine(workingDirectory, GitModulesFileName);
323var commonInfoExclude = Path.Combine(CommonDirectory, "info", "exclude");
341directory = Path.GetFullPath(directory);
364dir = Path.GetFullPath(dir);
381dir = Path.GetDirectoryName(dir);
391var dotGitPath = Path.Combine(directory, GitDirName);
449return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path)!, link));
460if (!File.Exists(Path.Combine(directory, GitHeadFileName)))
467var commonLinkPath = Path.Combine(directory, CommonDirFileName);
472commonDirectory = Path.Combine(directory, File.ReadAllText(commonLinkPath).TrimEnd(CharUtils.AsciiWhitespace));
474commonDirectory = Path.GetFullPath(commonDirectory);
Microsoft.Build.Utilities.Core (67)
ToolLocationHelper.cs (48)
664string legacyWindowsMetadataLocation = Path.Combine(sdkRoot, "Windows Metadata");
845propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName);
849propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName, targetPlatformIdentifier, targetPlatformVersion);
1039winmdLocation = Path.Combine(sdkRoot, referencesFolderName, commonConfigurationFolderName, neutralArchitectureName);
1132string referencesRoot = Path.Combine(targetPlatformSdkRoot, referencesFolderName, targetPlatformSdkVersion);
1137string contractPath = Path.Combine(referencesRoot, contract.Name, contract.Version);
1224return Path.Combine(sdkLocation, folderName);
1237? Path.Combine(matchingSdk.Path, folderName, targetPlatformVersion)
1238: Path.Combine(matchingSdk.Path, folderName);
1436var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder));
1501string fullPath = Path.Combine(root, file);
1766if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll")))
1840if (legacyMsCorlib20Path != null && FileSystems.Default.FileExists(Path.Combine(legacyMsCorlib20Path, "mscorlib.dll")))
1857if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll")))
2258Path.DirectorySeparatorChar.ToString(),
2261dotNetFrameworkReferenceAssemblies[i] += Path.DirectorySeparatorChar;
2426string referenceAssemblyPath = Path.Combine(sdkRoot, contentFolderName, targetConfiguration, targetArchitecture);
2553string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml");
2628string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version);
2629string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml");
2652string sdkFolderPath = Path.Combine(platformSDKDirectory, "ExtensionSDKs");
2747string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml");
2825string sdkManifestFileLocation = Path.Combine(directoryName, "SDKManifest.xml");
2903string localAppdataFolder = Path.Combine(userLocalAppData, "Microsoft SDKs");
2910string defaultProgramFilesLocation = Path.Combine(
3028string platformsRoot = Path.Combine(sdk.Path, platformsFolderName);
3056string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml");
3094string path = Path.GetFullPath(targetFrameworkDirectory);
3115string redistListFolder = Path.Combine(path, "RedistList");
3116string redistFilePath = Path.Combine(redistListFolder, "FrameworkList.xml");
3200pathToReturn = Path.Combine(pathToReturn, includeFramework);
3201pathToReturn = Path.GetFullPath(pathToReturn);
3349pathToSdk = Path.Combine(pathToSdk, "x64");
3352pathToSdk = Path.Combine(pathToSdk, "ia64");
3360string filePath = Path.Combine(pathToSdk, fileName);
3469pathToSdk = Path.Combine(pathToSdk, "bin");
3510pathToSdk = Path.Combine(pathToSdk, "x86");
3513pathToSdk = Path.Combine(pathToSdk, "x64");
3521string filePath = Path.Combine(pathToSdk, fileName);
3584toolPath = Path.Combine(toolPath, fileName);
3614return pathToFx == null ? null : Path.Combine(pathToFx, fileName);
3622public static string GetPathToSystemFile(string fileName) => Path.Combine(PathToSystem, fileName);
3840string frameworkIdentifierPath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier);
3898string frameworkProfilePath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier);
3899frameworkProfilePath = Path.Combine(frameworkProfilePath, frameworkVersion);
3900frameworkProfilePath = Path.Combine(frameworkProfilePath, "Profiles");
3945string dotNextFx30RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV30);
3952string dotNextFx35RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV35);
Microsoft.CodeAnalysis (86)
Microsoft.CodeAnalysis.Analyzers (36)
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
Microsoft.CodeAnalysis.BuildClient.Package (19)
Microsoft.CodeAnalysis.CodeStyle (19)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
Microsoft.CodeAnalysis.Extensions.Package (1)
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Microsoft.CodeAnalysis.Features (57)
EditAndContinue\TraceLog.cs (6)
44path = Path.Combine(_logDirectory, _traceLog._name + ".log");
56var directory = Path.Combine(_logDirectory, sessionId.Ordinal.ToString(), relativePath);
74var directory = CreateSessionDirectory(updateId.SessionId, Path.Combine(document.Project.Name, relativeDir));
75return Path.Combine(directory, $"{fileName}.{updateId.Ordinal}.{generation?.ToString() ?? "-"}.{suffix}{extension}");
83path = Path.Combine(CreateSessionDirectory(sessionId, directory), fileName);
97path = Path.Combine(CreateSessionDirectory(sessionId, directory), fileName);
PdbSourceDocument\ImplementationAssemblyLookupService.cs (10)
29private static readonly string PathSeparatorString = Path.DirectorySeparatorChar.ToString();
44var pathParts = referencedDllPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
58var basePath = Path.GetDirectoryName(dllPath);
81dllPath = Path.Combine(basePath, $"{assemblyName}.dll");
132var pathToTry = Path.Combine(
156var frameworkXml = Path.Combine(referencedDllPath, "..", "..", "..", "data", "FrameworkList.xml");
180var basePath = Path.GetFullPath(Path.Combine(referencedDllPath, "..", "..", "..", "..", "..", ".."));
181var dllPath = Path.Combine(basePath, "shared", sdkName, packVersion, dllFileName);
Microsoft.CodeAnalysis.NetAnalyzers (10)
Microsoft.CodeAnalysis.Razor.Compiler (11)
Microsoft.CodeAnalysis.Rebuild (2)
Microsoft.CodeAnalysis.ResxSourceGenerator (30)
Microsoft.CodeAnalysis.Scripting (30)
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (18)
87_baseDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
385string directory = Path.GetDirectoryName(fullPath);
410string shadowCopyPath = Path.Combine(assemblyCopyDir, Path.GetFileName(originalPath));
467originalDirectory = Path.GetDirectoryName(originalPath);
468shadowCopyDirectory = Path.GetDirectoryName(shadowCopyPath);
472originalPath: Path.Combine(originalDirectory, moduleName),
473shadowCopyPath: Path.Combine(shadowCopyDirectory, moduleName));
512string dir = Path.Combine(basePath, Guid.NewGuid().ToString());
545string assemblyDirectory = Path.GetDirectoryName(originalAssemblyPath);
546string assemblyFileName = Path.GetFileName(originalAssemblyPath);
560Directory.CreateDirectory(Path.Combine(assemblyCopyDirectory, xmlSubdirectory));
568string xmlCopyPath = Path.Combine(assemblyCopyDirectory, xmlSubdirectory, xmlFileName);
569string xmlOriginalPath = Path.Combine(assemblyDirectory, xmlSubdirectory, xmlFileName);
588docFileName = Path.ChangeExtension(assemblyFileName, ".xml");
593if (File.Exists(Path.Combine(assemblyDirectory, docSubdirectory, docFileName)))
603if (File.Exists(Path.Combine(assemblyDirectory, docFileName)))
Microsoft.CodeAnalysis.Workspaces (91)
Microsoft.CodeAnalysis.Workspaces.MSBuild (39)
MSBuild\BuildHostProcessManager.cs (8)
36private static string MSBuildWorkspaceDirectory => Path.GetDirectoryName(typeof(BuildHostProcessManager).Assembly.Location) ?? AppContext.BaseDirectory;
37private static bool IsLoadedFromNuGetPackage => File.Exists(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "microsoft.codeanalysis.workspaces.msbuild.nuspec"));
163dotnetPath = Path.GetFullPath(Path.Combine(msbuildLocation.Path, $"../../{DotnetExecutable}"));
266processStartInfo.Environment["DOTNET_ROOT"] = Path.GetDirectoryName(dotnetPath);
335buildHostPath = Path.GetFullPath(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "contentFiles", "any", "any", contentFolderName, assemblyName));
340buildHostPath = Path.Combine(MSBuildWorkspaceDirectory, contentFolderName, assemblyName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (20)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (10)
Microsoft.Data.Analysis.Tests (7)
Microsoft.Deployment.DotNet.Releases (3)
Microsoft.Diagnostics.DataContractReader.Legacy (1)
Microsoft.Diagnostics.NETCore.Client (9)
Microsoft.DiaSymReader (1)
Microsoft.DotNet.ApiCompat.Task (6)
Microsoft.DotNet.ApiSymbolExtensions (11)
Microsoft.DotNet.Arcade.Sdk (22)
src\InstallDotNetCore.cs (6)
206string dotNetPath = Path.TrimEndingDirectorySeparator(DotNetPath);
297dotnetRoot = Path.Combine(dotnetRoot, architecture.ToLowerInvariant());
302"dotnet" => Path.Combine(dotnetRoot, "shared", "Microsoft.NETCore.App", version),
303"aspnetcore" => Path.Combine(dotnetRoot, "shared", "Microsoft.AspNetCore.App", version),
304"windowsdesktop" => Path.Combine(dotnetRoot, "shared", "Microsoft.WindowsDesktop.App", version),
305_ => Path.Combine(dotnetRoot, "shared", version)
Microsoft.DotNet.Build.Tasks.FileCatalog (1)
Microsoft.DotNet.Build.Tasks.Installers (78)
src\CreateWixBuildWixpack.cs (49)
105WixpackWorkingDir = Path.Combine(Path.GetTempPath(), "WixpackTemp", Guid.NewGuid().ToString().Split('-')[0]);
109_installerFilename = Path.GetFileName(InstallerFile);
124AbsolutePath destPathAbsolute = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, Path.GetFileName(projectPath)));
157OutputFile = Path.Combine(OutputFolder, $"{_installerFilename}{_packageExtension}");
192var randomDirName = Path.GetRandomFileName();
195AbsolutePath destinationDir = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, randomDirName));
219var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
282_defineConstantsDictionary["ProjectPath"] = Path.GetFileName(projectPath);
300_defineConstantsDictionary["TargetPath"] = Path.Combine("%outputfolder%", Path.GetFileName(targetPath));
304InstallerFile = Path.Combine("%outputfolder%", Path.GetFileName(InstallerFile));
312PdbFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(PdbFile.ItemSpec));
318BindTrackingFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(BindTrackingFile.ItemSpec));
446commandLineArgs.Add($"{Path.GetFileName(sourceFile.ItemSpec)}");
452AbsolutePath responseFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, "create.rsp"));
467AbsolutePath commandFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, "create.cmd"));
541var copiedXmlPath = Path.Combine(WixpackWorkingDir, Path.GetFileName(xmlPath));
544string sourceFileFolder = Path.GetDirectoryName(xmlPath);
622var filePath = Path.Combine(dir, Path.GetFileName(source));
623CopySourceFile(Path.GetFileName(dir), filePath);
634id = Path.GetFileName(source);
640var newSourceValue = $"{id}\\{Path.GetFileName(source)}";
678string id = Path.GetFileName(includeFilePath);
691var potentialPath = Path.Combine(wixpackWorkingDir, searchPath, Path.GetFileName(includeFilePath));
1042AbsolutePath destDir = TaskEnvironment.GetAbsolutePath(Path.Combine(WixpackWorkingDir, fileId));
1050AbsolutePath destPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destDir, Path.GetFileName(source)));
1065string filename = Path.GetFileName(extensionPath);
1069Extensions[i] = new TaskItem(Path.Combine(filename, filename));
1081string wixpackSubfolder = Path.GetRandomFileName();
1109string filename = Path.GetFileName(localizationPath);
1113LocalizationFiles[i] = new TaskItem(Path.Combine(filename, filename));
1120if (!Path.IsPathRooted(source))
1123Path.Combine(_wixprojDir, source) :
1124Path.Combine(relativeRoot, source);
1137AbsolutePath destinationFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(destDir, Path.GetFileName(file)));
1144AbsolutePath destinationSubdirectoryPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destDir, Path.GetFileName(dir)));
src\CreateWixCommandPackageDropBase.cs (17)
74OutputFile = Path.Combine(OutputFolder, $"{Path.GetFileName(InstallerFile)}{_packageExtension}");
90AbsolutePath commandFilename = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, $"create.cmd"));
106commandString.Append($" -out %outputfolder%{Path.GetFileName(InstallerFile)}");
115commandString.Append($" -loc {Path.GetFileName(locItem.ItemSpec)}");
129commandString.Append($" {Path.GetFileName(wixSrcFile.ItemSpec)}");
153AbsolutePath newWixSrcFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, Path.GetFileName(wixSrcFile.ItemSpec)));
156string wixSrcFileExtension = Path.GetExtension(wixSrcFile.ItemSpec);
185AbsolutePath destinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, Path.GetFileName(locItem.ItemSpec)));
292else if (!Path.IsPathRooted(oldPath))
301AbsolutePath possiblePath = TaskEnvironment.GetAbsolutePath(Path.Combine(additionalBasePath.ItemSpec, oldPath));
319newRelativePath = Path.Combine(id, Path.GetFileName(oldPath));
334AbsolutePath newFolder = TaskEnvironment.GetAbsolutePath(Path.Combine(outputPath, id));
340File.Copy(TaskEnvironment.GetAbsolutePath(oldPath), TaskEnvironment.GetAbsolutePath(Path.Combine(outputPath, newRelativePath)), true);
Microsoft.DotNet.Build.Tasks.Packaging (63)
NuGetPack.cs (13)
25@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar),
26@"src\**\*".Replace('\\', Path.DirectorySeparatorChar)
33@"content\**\*".Replace('\\', Path.DirectorySeparatorChar),
34@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar)
212string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory;
263return Path.Combine(nupkgOutputDirectory, $"{id}.{version}{nupkgExtension}");
268bool creatingSymbolsPackage = packSymbols && (Path.GetExtension(nupkgPath) == _symbolsPackageExtension);
274string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory;
311var directory = Path.GetDirectoryName(nupkgPath);
392if(Path.GetFileName(fileName) == "runtime.json" && file.Target == "")
394string packedPackageSourcePath = Path.Combine(Path.GetDirectoryName(fileName), string.Join(".", _packageNamePrefix, Path.GetFileName(fileName)));
Microsoft.DotNet.Build.Tasks.Templating (2)
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
Microsoft.DotNet.Build.Tasks.Workloads (23)
Microsoft.DotNet.Cli.CoreUtils (7)
Microsoft.DotNet.Cli.Definitions (16)
Microsoft.DotNet.Cli.InternalMicrosoft (10)
Microsoft.DotNet.Cli.Utils (46)
PathUtility.cs (33)
19return string.Equals(Path.GetFileName(path), "_._", StringComparison.Ordinal);
32dir = Path.GetFullPath(dir);
34candidate = Path.GetFullPath(candidate);
43if (lastChar == Path.DirectorySeparatorChar)
54string? directory = Path.GetDirectoryName(filePath);
92var dir = Path.GetDirectoryName(path);
101dir = Path.GetDirectoryName(dir);
116return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true);
124if (!Path.IsPathRooted(path1) || !Path.IsPathRooted(path2))
129return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true);
138return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, false);
161if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare))
173var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
174var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
246path = path.TrimEnd(Path.DirectorySeparatorChar);
247return path.Substring(Path.GetDirectoryName(path)?.Length ?? 0).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
262if (Path.DirectorySeparatorChar == '/')
279var components = path.Split(Path.DirectorySeparatorChar);
296result += Path.DirectorySeparatorChar;
301result = Path.Combine(result, component);
305if (path[path.Length - 1] == Path.DirectorySeparatorChar)
307result += Path.DirectorySeparatorChar;
322return Path.GetExtension(filePath).Equals(extension, comparison);
336return Path.GetFullPath(path);
368return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/');
373return Regex.Escape(Path.DirectorySeparatorChar.ToString());
382var filePath = Path.Combine(directory.FullName, relativeFilePath);
Microsoft.DotNet.CMake.Sdk (9)
Microsoft.DotNet.CodeAnalysis (2)
Microsoft.DotNet.Configurer (11)
Microsoft.DotNet.GenFacades (6)
Microsoft.DotNet.HotReload.Utils.Generator (5)
Microsoft.DotNet.HotReload.Watch (82)
Microsoft.DotNet.HotReload.WebAssembly.Browser (3)
Microsoft.DotNet.InternalAbstractions (12)
Microsoft.DotNet.MacOsPkg.Core (14)
Microsoft.DotNet.NativeWrapper (8)
Microsoft.DotNet.NuGetRepack.Tasks (5)
Microsoft.DotNet.PackageTesting (5)
Microsoft.DotNet.PackageValidation (2)
Microsoft.DotNet.ProjectTools (27)
Microsoft.DotNet.SdkResolver (1)
Microsoft.DotNet.SharedFramework.Sdk (16)
Microsoft.DotNet.SourceBuild.Tasks (12)
Microsoft.DotNet.TemplateLocator (46)
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests");
93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests");
109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt");
112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt");
130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator)
205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json");
302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json");
344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json");
363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory));
372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString);
387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString);
392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory;
452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir));
480string manifestId = Path.GetFileName(manifestDirectory);
488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json")))
491return (directory: dir, version: Path.GetFileName(dir));
500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json")))
502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json");
526.Select(dir => Path.GetFileName(dir))
532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId)))
557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(),
559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json")))
607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString());
624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory);
634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName);
639var workloadSetVersion = Path.GetFileName(workloadSetDirectory);
668string globalJsonPath = Path.Combine(directory, "global.json");
673directory = Path.GetDirectoryName(directory);
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine(
40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt");
48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray();
329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion);
333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg");
337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg");
341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
Microsoft.DotNet.VersionTools.Cli (1)
Microsoft.DotNet.XliffTasks (46)
Tasks\TransformTemplates.cs (14)
70string templateName = Path.GetFileNameWithoutExtension(template.ItemSpec);
72string templateDirectory = Path.GetDirectoryName(templatePath);
77? Path.Combine(TranslatedOutputDirectory, $"{templateName}.default.1033")
78: Path.Combine(TranslatedOutputDirectory, $"{templateName}.{language}");
80string cultureSpecificTemplateFile = Path.Combine(localizedTemplateDirectory, Path.GetFileName(template.ItemSpec));
86string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value);
87File.Copy(TaskEnvironment.GetAbsolutePath(projectFileFullPath), TaskEnvironment.GetAbsolutePath(Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value))), overwrite: true);
93string templateItemFullPath = Path.Combine(templateDirectory, templateItem.Value);
94string templateItemDestinationPath = Path.Combine(localizedTemplateDirectory, templateItem.Value);
112Path.GetFileNameWithoutExtension(unstructuredResource.ItemSpec),
115Path.GetExtension(unstructuredResource.ItemSpec));
116File.Copy(TaskEnvironment.GetAbsolutePath(Path.Combine(TranslatedOutputDirectory, localizedFileName)), templateItemDestinationAbsolutePath, overwrite: true);
Microsoft.Extensions.AI (3)
Microsoft.Extensions.AI.Abstractions (7)
Microsoft.Extensions.AI.Abstractions.Tests (64)
Contents\DataContentTests.cs (49)
316string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.json");
327Assert.Equal(Path.GetFileName(tempPath), content.Name);
343string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.bin");
354Assert.Equal(Path.GetFileName(tempPath), content.Name);
370string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.unknownextension");
396string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.png");
408Assert.Equal(Path.GetFileName(tempPath), content.Name);
459string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.bin");
486string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}");
516string tempDir = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}");
518string expectedPath = Path.Combine(tempDir, "myfile.json");
545string tempDir = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}");
574string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.txt");
602string expectedAbsolute = Path.Combine(cwdBefore, filename);
610Assert.Equal(filename, Path.GetFileName(savedPath));
638Assert.Equal(content.Name, Path.GetFileName(savedPath));
660string expectedAbsolute = Path.Combine(cwdBefore, content.Name!);
668Assert.Equal(content.Name, Path.GetFileName(savedPath));
710string tempDir = Path.Combine(Path.GetTempPath(), $"test_subdir_{Guid.NewGuid()}");
711string subDir = Path.Combine(tempDir, "subdir");
716string filePath = Path.Combine(subDir, "nested.html");
743string tempDir = Path.Combine(Path.GetTempPath(), $"test_dir_noname_{Guid.NewGuid()}");
770string tempPath = Path.Combine(Path.GetTempPath(), $"test_cancel_{Guid.NewGuid()}.txt");
801string tempPath = Path.Combine(Path.GetTempPath(), $"test_save_cancel_{Guid.NewGuid()}.bin");
841string tempDir = Path.Combine(Path.GetTempPath(), $"test_dir_name_{Guid.NewGuid()}");
843string expectedPath = Path.Combine(tempDir, content.Name);
869string tempDir = Path.Combine(Path.GetTempPath(), $"test_nonexist_{Guid.NewGuid()}");
871string filePath = Path.Combine(tempDir, "newfile");
898string tempPath = Path.Combine(Path.GetTempPath(), $"test_large_{Guid.NewGuid()}.bin");
927string tempPath = Path.Combine(Path.GetTempPath(), $"test_save_large_{Guid.NewGuid()}.bin");
950string tempPath = Path.Combine(Path.GetTempPath(), $"test_existing_{Guid.NewGuid()}.bin");
Files\HostedFileClientExtensionsTests.cs (15)
63var tempFile = Path.Combine(Path.GetTempPath(), $"test-{Guid.NewGuid()}.txt");
89Assert.Equal(Path.GetFileName(tempFile), capturedFileName);
123var tempFile = Path.Combine(Path.GetTempPath(), $"download-{Guid.NewGuid()}.bin");
150var tempDir = Path.Combine(Path.GetTempPath(), $"dldir-{Guid.NewGuid()}");
162Assert.Equal(Path.Combine(tempDir, "result.bin"), savedPath);
175var tempDir = Path.Combine(Path.GetTempPath(), $"dldir2-{Guid.NewGuid()}");
187Assert.Equal(Path.Combine(tempDir, "file-id-fallback"), savedPath);
210string expectedAbsolute = Path.Combine(cwdBefore, fileName);
218Assert.False(Path.IsPathRooted(savedPath));
232var tempFile = Path.Combine(Path.GetTempPath(), $"existing-{Guid.NewGuid()}.bin");
Microsoft.Extensions.AI.Evaluation.Console (7)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
Microsoft.Extensions.AI.Evaluation.Reporting (26)
Storage\DiskBasedResultStore.cs (12)
48storageRootPath = Path.GetFullPath(storageRootPath);
49_resultsRootPath = Path.Combine(storageRootPath, "results");
102Path.Combine(_resultsRootPath, result.ExecutionName, result.ScenarioName)));
106var resultFile = new FileInfo(Path.Combine(resultDir.FullName, $"{result.IterationName}.json"));
139Path.Combine(_resultsRootPath, executionName)));
152Path.Combine(_resultsRootPath, executionName, scenarioName)));
165Path.Combine(_resultsRootPath, executionName, scenarioName, $"{iterationName}.json")));
262yield return Path.GetFileNameWithoutExtension(resultFile.Name);
293Path.Combine(_resultsRootPath, executionName)));
326var scenarioDir = new DirectoryInfo(Path.Combine(executionDir.FullName, scenarioName));
351.OrderBy(f => Path.GetFileNameWithoutExtension(f.Name), IterationNameComparer.Default);
362var resultFile = new FileInfo(Path.Combine(scenarioDir.FullName, $"{iterationName}.json"));
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (7)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (80)
DiskBased\PathValidationTests.cs (59)
112string root = Path.Combine(Path.GetTempPath(), "testroot");
113string child = Path.Combine(root, "sub", "file.txt");
117Assert.Equal(Path.GetFullPath(child), result);
123string root = Path.Combine(Path.GetTempPath(), "testroot");
124string child = Path.Combine(root, "a", "b", "c", "d.json");
128Assert.Equal(Path.GetFullPath(child), result);
134string root = Path.Combine(Path.GetTempPath(), "testroot") + Path.DirectorySeparatorChar;
135string child = Path.Combine(root, "file.txt");
139Assert.Equal(Path.GetFullPath(child), result);
149string root = Path.Combine(Path.GetTempPath(), "testroot");
150string escaped = Path.Combine(root, "..", "outside");
159string root = Path.Combine(Path.GetTempPath(), "testroot", "nested");
160string escaped = Path.Combine(root, "..", "..", "outside");
169string root = Path.Combine(Path.GetTempPath(), "testroot");
170string other = Path.Combine(Path.GetTempPath(), "other", "file.txt");
180string root = Path.Combine(Path.GetTempPath(), "testroot");
181string sibling = Path.Combine(Path.GetTempPath(), "testroot-sibling", "file.txt");
190string root = Path.Combine(Path.GetTempPath(), "testroot");
194Assert.Equal(Path.GetFullPath(root), result);
204string storagePath = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.PathTests", Path.GetRandomFileName());
232string storagePath = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.PathTests", Path.GetRandomFileName());
271Assert.Equal(Path.GetFullPath(child), result);
319Assert.Equal(Path.GetFullPath(root), result);
337string longRoot = Path.Combine(Path.GetTempPath(), "LongDirectoryName_ForTesting");
348string longChild = Path.Combine(longRoot, "file.txt");
352Path.GetFullPath(shortRoot),
353Path.GetFullPath(longRoot),
360Assert.Equal(Path.GetFullPath(longChild), result);
385string longRoot = Path.Combine(Path.GetTempPath(), "LongDirectoryName_ForTesting");
397string child = Path.Combine(shortRoot, "file.txt");
398File.WriteAllText(Path.Combine(longRoot, "file.txt"), string.Empty);
402Assert.Equal(Path.GetFullPath(child), result);
420string root = Path.GetTempPath().Replace('\\', '/') + "testroot";
421string child = Path.Combine(root, "sub", "file.txt");
425Assert.Equal(Path.GetFullPath(child), result);
431string root = Path.Combine(Path.GetTempPath(), "TestRoot");
432string child = Path.Combine(Path.GetTempPath(), "testroot", "file.txt");
438Assert.Equal(Path.GetFullPath(child), result);
458Assert.Equal(Path.GetFullPath(child), result);
483Assert.Equal(Path.GetFullPath(child), result);
Microsoft.Extensions.AI.OpenAI (5)
Microsoft.Extensions.AI.OpenAI.Tests (4)
Microsoft.Extensions.AI.Templates.Tests (21)
test\ProjectTemplates\Infrastructure\WellKnownPaths.cs (6)
33ProjectTemplatesArtifactsRoot = Path.Combine(RepoRoot, "artifacts", "ProjectTemplates");
34TemplateSandboxSource = Path.Combine(RepoRoot, "test", "ProjectTemplates", "Infrastructure", "TemplateSandbox");
35TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxSource, "nuget.config");
37LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping");
46var gitPath = Path.Combine(directory, ".git");
66var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
Microsoft.Extensions.Configuration.FileExtensions (4)
Microsoft.Extensions.Configuration.UserSecrets (4)
Microsoft.Extensions.DataIngestion.Abstractions (1)
Microsoft.Extensions.DataIngestion.MarkItDown (3)
Microsoft.Extensions.DataIngestion.Tests (13)
Microsoft.Extensions.DependencyModel (21)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Microsoft.Extensions.DotNetDeltaApplier (5)
Microsoft.Extensions.FileProviders.Embedded (9)
Microsoft.Extensions.FileProviders.Embedded.Manifest.Task (2)
Microsoft.Extensions.FileProviders.Physical (26)
Microsoft.Extensions.FileSystemGlobbing (29)
InMemoryDirectoryInfo.cs (24)
18private static readonly char[] DirectorySeparators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
54Name = isParentPath ? ".." : Path.GetFileName(rootDir);
63string normalizedRoot = Path.GetFullPath(rootDir.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
68string fileWithNormalSeparators = file.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
69if (Path.IsPathRooted(file))
71fileList.Add(Path.GetFullPath(fileWithNormalSeparators));
75fileList.Add(Path.GetFullPath(Path.Combine(normalizedRoot, fileWithNormalSeparators)));
93new InMemoryDirectoryInfo(Path.GetDirectoryName(FullName)!, _files, true, _comparisonType);
139(rootDir[rootDirLength - 1] == Path.DirectorySeparatorChar ||
140filePath.IndexOf(Path.DirectorySeparatorChar, rootDirLength) == rootDirLength);
152normPath = Path.GetDirectoryName(FullName) ?? FullName;
156string combinedPath = Path.Combine(FullName, path);
157normPath = Path.GetFullPath(combinedPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
170string combinedPath = Path.Combine(FullName, path);
171string normPath = Path.GetFullPath(combinedPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Microsoft.Extensions.Hosting (5)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Resilience.Tests (6)
Microsoft.Extensions.Localization (4)
Microsoft.Extensions.Logging.AzureAppServices (4)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.ML.Tests (4)
Microsoft.Extensions.ServiceDiscovery.Dns (8)
DnsSrvServiceEndpointProviderFactory.cs (8)
17private static readonly string s_serviceAccountPath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount");
18private static readonly string s_serviceAccountNamespacePath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount", "namespace");
19private static readonly string s_resolveConfPath = Path.Combine($"{Path.DirectorySeparatorChar}etc", "resolv.conf");
133var tokenPath = Path.Combine(s_serviceAccountPath, "token");
139var certPath = Path.Combine(s_serviceAccountPath, "ca.crt");
Microsoft.Gen.BuildMetadata (2)
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
Microsoft.Gen.ComplianceReports (5)
Microsoft.Gen.ComplianceReports.Unit.Tests (8)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
Microsoft.Gen.Logging (2)
Microsoft.Gen.Logging.Unit.Tests (9)
Microsoft.Gen.MetadataExtractor (7)
Microsoft.Gen.MetadataExtractor.Unit.Tests (13)
Microsoft.Gen.Metrics (2)
Microsoft.Gen.Metrics.Unit.Tests (3)
Microsoft.Gen.MetricsReports (3)
Microsoft.Gen.MetricsReports.Unit.Tests (13)
Microsoft.Maui (1)
Microsoft.Maui.Controls (1)
Microsoft.Maui.Controls.Build.Tasks (6)
Microsoft.Maui.Controls.SourceGen (10)
Microsoft.Maui.Essentials (6)
Microsoft.Maui.Resizetizer (56)
Microsoft.ML.AutoML (5)
Microsoft.ML.AutoML.Samples (5)
Microsoft.ML.AutoML.Tests (24)
ColumnInferenceTests.cs (8)
81var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "DatasetWithEmptyColumn.txt"), DefaultColumnNames.Label, groupColumns: false);
89var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "BinaryDatasetWithBoolColumn.txt"), DefaultColumnNames.Label);
108var filePath = Path.Combine("TestData", "DatasetWithoutHeader.txt");
136var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "NameColumnIsOnlyFeatureDataset.txt"), DefaultColumnNames.Label);
153.InferColumns(Path.Combine("TestData", "DatasetWithDefaultColumnNames.txt"),
173var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "DatasetWithDefaultColumnNames.txt"),
204var dataset = Path.Combine("TestData", "DatasetWithNewlineBetweenQuotes.txt");
245var wiki = Path.Combine("TestData", "wiki-column-inference.json");
DatasetUtil.cs (14)
27public static string TrivialMulticlassDatasetPath = Path.Combine("TestData", "TrivialMulticlassDataset.txt");
49return Path.Combine(TestCommon.GetRepoRoot(), "test", "data", fileName);
132string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs",
139string fullImagesetFolderPath = Path.Combine(
166var extension = Path.GetExtension(file).ToLower();
174var label = Path.GetFileName(file);
191UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);
193return Path.GetFileNameWithoutExtension(fileName);
199destFileName = Path.GetFileName(new Uri(url).AbsolutePath); ;
203string relativeFilePath = Path.Combine(destDir, destFileName);
223var flag = gzArchiveName.Split(Path.DirectorySeparatorChar)
228if (File.Exists(Path.Combine(destFolder, flag)))
232File.Create(Path.Combine(destFolder, flag));
236Path.Combine(new FileInfo(typeof(
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.ML.CodeGenerator (12)
Microsoft.ML.Core (45)
Microsoft.ML.Core.Tests (19)
UnitTests\TestEntryPoints.cs (5)
237var entryPointsSubDir = Path.Combine("..", "Common", "EntryPoints");
265var entryPointsSubDir = Path.Combine("..", "Common", "EntryPoints");
4560TestEntryPointPipelineRoutine(GetDataPath(Path.Combine("Timeseries", "A4Benchmark-TS1.csv")), "sep=, col=Features:R4:1 header=+",
4589TestEntryPointPipelineRoutine(GetDataPath(Path.Combine("Timeseries", "real_1.csv")), "sep=, col=Features:R4:1 header=+",
4613TestEntryPointPipelineRoutine(GetDataPath(Path.Combine("Timeseries", "A4Benchmark-TS2.csv")), "sep=, col=Features:R4:1 header=+",
Microsoft.ML.CpuMath.UnitTests (1)
Microsoft.ML.Data (16)
Microsoft.ML.DnnImageFeaturizer.AlexNet (3)
AlexNetExtension.cs (3)
28return AlexNet(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "AlexNetPrepOnnx", "AlexNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Dropout234_Output_0" }, new[] { "Input140" }, Path.Combine(modelDir, "AlexNetOnnx", "AlexNet.onnx"));
Microsoft.ML.DnnImageFeaturizer.ResNet101 (3)
ResNet101Extension.cs (3)
28return ResNet101(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "ResNetPrepOnnx", "ResNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Pooling2286_Output_0" }, new[] { "Input1600" }, Path.Combine(modelDir, "ResNet101Onnx", "ResNet101.onnx"));
Microsoft.ML.DnnImageFeaturizer.ResNet18 (3)
ResNet18Extension.cs (3)
28return ResNet18(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "ResNetPrepOnnx", "ResNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Pooling395_Output_0" }, new[] { "Input247" }, Path.Combine(modelDir, "ResNet18Onnx", "ResNet18.onnx"));
Microsoft.ML.DnnImageFeaturizer.ResNet50 (3)
ResNet50Extension.cs (3)
28return ResNet50(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "ResNetPrepOnnx", "ResNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Pooling1096_Output_0" }, new[] { "Input750" }, Path.Combine(modelDir, "ResNet50Onnx", "ResNet50.onnx"));
Microsoft.ML.Ensemble (2)
Microsoft.ML.EntryPoints (1)
Microsoft.ML.ImageAnalytics (4)
Microsoft.ML.IntegrationTests (5)
Microsoft.ML.Maml (4)
Microsoft.ML.OneDal (1)
Microsoft.ML.OnnxConverter (1)
Microsoft.ML.OnnxTransformer (4)
Microsoft.ML.OnnxTransformerTest (21)
Microsoft.ML.Parquet (6)
Microsoft.ML.PerformanceTests (33)
Microsoft.ML.Predictor.Tests (14)
CompareBaselines.cs (14)
58log.WriteLine("Comparison of baselines {0} to {1}", Path.GetFileName(root1), Path.GetFileName(root2));
66string dir1 = Path.Combine(root1, rel);
67string dir2 = Path.Combine(root2, rel);
70.ToDictionary(s => Path.GetFileName(s).ToLowerInvariant(), s => false);
73string name = Path.GetFileName(path1);
74string relCur = Path.Combine(rel, name);
89log.WriteLine("*** Missing left file: '{0}'", Path.Combine(rel, kvp.Key));
93.ToDictionary(s => Path.GetFileName(s).ToLowerInvariant(), s => false);
96string name = Path.GetFileName(path1);
97string relCur = Path.Combine(rel, name);
112log.WriteLine("*** Missing left directory: '{0}'", Path.Combine(rel, kvp.Key));
167using (var rdr1 = OpenReader(Path.Combine(root1, rel)))
168using (var rdr2 = OpenReader(Path.Combine(root2, rel)))
Microsoft.ML.ResultProcessor (1)
Microsoft.ML.Samples (71)
Microsoft.ML.Samples.GPU (62)
Microsoft.ML.SamplesUtils (11)
SamplesDatasetUtils.cs (11)
27while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null)
36return Path.Combine(directory, "test", "data", fileName);
179string varPath = Path.Combine(path, "variables");
183Download(Path.Combine(remotePath, "saved_model.pb"), Path.Combine(path, "saved_model.pb")).Wait();
184Download(Path.Combine(remotePath, "imdb_word_index.csv"), Path.Combine(path, "imdb_word_index.csv")).Wait();
185Download(Path.Combine(remotePath, "variables", "variables.data-00000-of-00001"), Path.Combine(varPath, "variables.data-00000-of-00001")).Wait();
186Download(Path.Combine(remotePath, "variables", "variables.index"), Path.Combine(varPath, "variables.index")).Wait();
Microsoft.ML.SearchSpace.Tests (2)
Microsoft.ML.Sweeper (5)
Microsoft.ML.TensorFlow (11)
Microsoft.ML.TensorFlow.Tests (51)
TensorflowTests.cs (48)
34tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
35assetsPath = Path.Combine(tempFolder, "assets");
36parentWorkspacePath = Path.Combine(assetsPath, "cached");
66string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs",
73_fullImagesetFolderPath = Path.Combine(
122var imageFolder = Path.GetDirectoryName(dataFile);
489var imageFolder = Path.GetDirectoryName(dataFile);
525var imageFolder = Path.GetDirectoryName(dataFile);
750var varDir = Path.Combine(modelLocation, "variables");
995var imageFolder = Path.GetDirectoryName(dataFile);
1054var imageFolder = Path.GetDirectoryName(dataFile);
1097var imageFolder = Path.GetDirectoryName(dataFile);
1132var imageFolder = Path.GetDirectoryName(dataFile);
1169var mlModelLocation = DeleteOutputPath(Path.ChangeExtension(modelLocation, ".zip"));
1209var imageFolder = Path.GetDirectoryName(dataFile);
1433if (Directory.Exists(workspacePath) && File.Exists(Path.Combine(workspacePath, trainSetBottleneckCachedValuesFileName))
1434&& File.Exists(Path.Combine(workspacePath, validationSetBottleneckCachedValuesFileName)))
1449string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int)arch);
1549ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg")
1555ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg")
1708ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg")
1714ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg")
1734Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.TrainSetBottleneckCachedValuesFileName)));
1735Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.ValidationSetBottleneckCachedValuesFileName)));
1736Assert.True(File.Exists(Path.Combine(Path.GetTempPath(), "MLNET", ImageClassificationTrainer.ModelFileName[options.Arch])));
1828string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs",
1834string fullImagesetFolderPath = Path.Combine(
1908if (Path.GetExtension(file) != ".jpg")
1911var label = Path.GetFileName(file);
1942UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);
1944if (!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias)))
1945Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder, "FPTSUT"));
1955UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);
1957return Path.GetFileNameWithoutExtension(fileName);
1963destFileName = url.Split(Path.DirectorySeparatorChar).Last();
1967string relativeFilePath = Path.Combine(destDir, destFileName);
1978var flag = gzArchiveName.Split(Path.DirectorySeparatorChar)
1983if (File.Exists(Path.Combine(destFolder, flag)))
1987File.Create(Path.Combine(destFolder, flag));
2010string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
2025string imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.TestFramework (23)
BaseTestBaseline.cs (12)
37private readonly string _logRootRelPath = Path.Combine("Logs", BuildString); // Relative to OutDir.
94string baselineRootDir = Path.Combine(RootDir, TestDir, "BaselineOutput");
97_baselineCommonDir = Path.Combine(baselineRootDir, "Common");
100string logDir = Path.Combine(OutDir, _logRootRelPath);
103string logPath = Path.Combine(logDir, FullTestName + LogSuffix);
288baselinePath = Path.GetFullPath(Path.Combine(_baselineCommonDir, subDir, baselineConfigDir, name));
297return Path.GetFullPath(Path.Combine(_baselineCommonDir, subDir, name));
411Contracts.Assert(!Path.IsPathRooted(name), "file name should not be a full path");
412Contracts.Assert(!Path.IsPathRooted(nameBase), "file nameBase should not be a full path");
414string relPath = Path.Combine(dir, name);
Microsoft.ML.TestFrameworkCommon (19)
Microsoft.ML.Tests (54)
OnnxConversionTest.cs (14)
87var subDir = Path.Combine("Onnx", "Regression", "Adult");
165var subDir = Path.Combine("Onnx", "Cluster", "BreastCancer");
207var subDir = Path.Combine("Onnx", "Regression", "Adult");
442var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
584var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
610var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
635var subDir = Path.Combine("Onnx", "MultiClassClassification", "BreastCancer");
647string modelPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.bin";
648string onnxPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.onnx";
649string onnxJsonPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.onnx.json";
817var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
856var subDir = Path.Combine("Onnx", "Transforms", "Sentiment");
1172var subDir = Path.Combine("Onnx", "Transforms");
1901var subDir = Path.Combine("Onnx", "Transforms");
Microsoft.ML.TimeSeries.Tests (4)
Microsoft.ML.Tokenizers.Data.Tests (3)
Microsoft.ML.Tokenizers.Tests (38)
BpeTests.cs (9)
366using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json"));
367using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt"));
380string vocabFile = Path.Combine(@"Gpt-2", "vocab.json");
381string mergesFile = Path.Combine(@"Gpt-2", "merges.txt");
546using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json"));
547using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt"));
894BpeOptions options = new BpeOptions(Path.Combine(@"Gpt-2", "vocab.json"), Path.Combine(@"Gpt-2", "merges.txt"))
951using Stream jsonModelStream = File.OpenRead(Path.Combine(@"DeepSeek", "tokenizer-DeepSeek-R1.json"));
Microsoft.ML.TorchSharp (12)
Microsoft.ML.TorchSharp.Tests (1)
Microsoft.ML.Transforms (5)
Microsoft.ML.Vision (25)
DnnRetrainTransform.cs (16)
118var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(DnnRetrainTransformer) + "_" + Guid.NewGuid()));
130string fullFilePath = Path.Combine(tempDirPath, relativeFile);
131string fullFileDir = Path.GetDirectoryName(fullFilePath);
409var path = Path.Combine(modelDir, DefaultModelFileNames.TmpMlnetModel);
416var variablesPath = Path.Combine(modelDir, DefaultModelFileNames.VariablesFolder);
417var archivePath = Path.Combine(variablesPath + "-" + Guid.NewGuid().ToString());
420File.Copy(f, Path.Combine(archivePath, Path.GetFileName(f)));
439var destination = Path.Combine(variablesPath, DefaultModelFileNames.Data);
446var destination = Path.Combine(variablesPath, DefaultModelFileNames.Index);
533_modelLocation = Path.IsPathRooted(modelLocation) ? modelLocation : Path.Combine(Directory.GetCurrentDirectory(), modelLocation);
705Path.Combine(_modelLocation, DefaultModelFileNames.Graph),
706Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Data),
707Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index),
ImageClassificationTrainer.cs (9)
537_resourcePath = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, "MLNET");
570_checkpointPath = Path.Combine(_options.WorkspacePath, _options.FinalModelPrefix +
572_sizeFile = Path.Combine(_options.WorkspacePath, "TrainingSetSize.txt");
668string trainSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath,
671string validationSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath,
856Path.Combine(_options.WorkspacePath, _options.ValidationSetBottleneckCachedValuesFileName),
954trainWriter = tf.summary.FileWriter(Path.Combine(_options.WorkspacePath, "train"),
1149var evalGraph = LoadMetaGraph(Path.Combine(_resourcePath, ModelFileName[_options.Arch]));
1313var modelFilePath = Path.Combine(_resourcePath, modelFileName);
Microsoft.NET.Build.Containers (23)
Microsoft.NET.Build.Extensions.Tasks (9)
Microsoft.NET.Build.Tasks (235)
FrameworkPackages\FrameworkPackages.cs (8)
128var packsFolder = Path.Combine(targetingPackRoot, frameworkName + ".Ref");
129var originalPacksFolder = Path.Combine(targetingPackRoot.OriginalValue, frameworkName + ".Ref");
135log.LogMessage("Pack directories found: {0}", string.Join(Environment.NewLine, packDirectories.Select(d => Path.Combine(originalPacksFolder, Path.GetFileName(d)))));
137.Select(d => (Overrides: Path.Combine(d, "data", "PackageOverrides.txt"), OriginalOverrides: Path.Combine(originalPacksFolder, Path.GetFileName(d), "data", "PackageOverrides.txt"), Version: ParseVersion(Path.GetFileName(d))))
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests");
93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests");
109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt");
112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt");
130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator)
205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json");
302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json");
344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json");
363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory));
372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString);
387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString);
392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory;
452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir));
480string manifestId = Path.GetFileName(manifestDirectory);
488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json")))
491return (directory: dir, version: Path.GetFileName(dir));
500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json")))
502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json");
526.Select(dir => Path.GetFileName(dir))
532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId)))
557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(),
559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json")))
607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString());
624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory);
634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName);
639var workloadSetVersion = Path.GetFileName(workloadSetDirectory);
668string globalJsonPath = Path.Combine(directory, "global.json");
673directory = Path.GetDirectoryName(directory);
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine(
40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt");
48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray();
329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion);
333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg");
337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg");
341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
PrepareForReadyToRunCompilation.cs (26)
170var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath);
182outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb");
183outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb");
184crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\"";
205outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension);
206outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension);
207crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\"";
250r2rFileToPublish.ItemSpec = Path.Combine(OutputPath, Path.GetFileName(outputR2RImageRelativePath));
259r2rFileToPublish.ItemSpec = Path.Combine(OutputPath, Path.GetFileName(outputR2RImageRelativePath));
303MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec));
306compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, "r2r" + Path.GetExtension(compositeR2RImageRelativePath));
323compositePDBImage = Path.ChangeExtension(compositeR2RImageOutputPath, ".ni.pdb");
324compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb");
330compositePDBImage = Path.ChangeExtension(compositeR2RImageOutputPath, perfmapExtension);
331compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension);
371r2rImageRelativePath = Path.ChangeExtension(r2rImageRelativePath, ".o");
372r2rFinalImageRelativePath = Path.ChangeExtension(r2rImageRelativePath, ".dylib");
375intermediateR2RImage = Path.Combine(OutputPath, r2rImageRelativePath);
376var r2rImageFinal = Path.Combine(OutputPath, r2rFinalImageRelativePath);
502bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec)));
503bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R;
504bool partialImage = (partialSet != null && partialSet.Contains(Path.GetFileName(file.ItemSpec)));
508bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ResolveReadyToRunCompilers.cs (26)
321_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
322_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
323_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll");
328_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe");
329_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll");
330_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll");
337_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
338_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
339_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll");
349_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe");
350_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll");
351_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll");
356_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
357_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
360_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll");
364_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll");
374_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
375_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so");
380_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen");
381_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so");
390_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
391_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so");
402_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
403_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib");
438_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName);
445_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
ResolveRuntimePackAssets.cs (11)
151string runtimeListPath = Path.Combine(runtimePackRoot, "data", "RuntimeList.xml");
152AbsolutePath absoluteRuntimeListPath = new(Path.Combine("data", "RuntimeList.xml"), absoluteRuntimePackRoot);
209? Path.GetFullPath(absoluteRuntimePackRoot)
210: Path.GetFullPath(new AbsolutePath(pathAttributeValue, absoluteRuntimePackRoot));
233throw new BuildErrorException($"Culture not set in runtime manifest for {Path.GetFullPath(Path.Combine(runtimePack.GetMetadata(MetadataKeys.PackageDirectory), fileElement.Attribute("Path").Value))}");
243throw new BuildErrorException($"Unrecognized file type '{typeAttributeValue}' in {Path.Combine(absoluteRuntimePackRoot.OriginalValue, absoluteRuntimeListPath.OriginalValue)}");
280assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.GetFileName(assetPath));
284assetItem.SetMetadata(MetadataKeys.DestinationSubDirectory, culture + Path.DirectorySeparatorChar);
285assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.Combine(culture, Path.GetFileName(assetPath)));
ResolveTargetingPackAssets.cs (13)
212Path.Combine(targetingPackRoot.OriginalValue, "ref", targetingPackTargetFramework));
220Path.Combine(targetingPackRoot.OriginalValue, "ref", targetingPackTargetFramework));
223string targetingPackOriginalDataPath = Path.Combine(targetingPackRoot.OriginalValue, "data");
226Path.Combine(targetingPackOriginalDataPath, "PlatformManifest.txt"));
229Path.Combine(targetingPackOriginalDataPath, "PackageOverrides.txt"));
232Path.Combine(targetingPackOriginalDataPath, "FrameworkList.xml"));
309Path.Combine(targetingPackRoot.OriginalValue, "build", targetingPackTargetFramework, "ref"));
313string itemSpec = Path.Combine(targetingPackAssetPath.OriginalValue, Path.GetFileName(dll));
321if (!Path.GetFileName(dll).Equals("netstandard.dll", StringComparison.OrdinalIgnoreCase))
410Path.Combine(definition.TargetingPackRoot.OriginalValue, fileElement.Attribute("Path").Value) :
467string dllPath = Path.Combine(targetingPackDllFolder, assemblyName + ".dll");
477var dllPath = Path.Combine(targetingPackDllFolder, assemblyName + ".dll");
Microsoft.NET.HostModel (7)
Microsoft.NET.ProjectData (141)
CachePathResolver.cs (51)
148 string? sdkParent = Path.GetDirectoryName(sdkDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
149 if (sdkParent is null || !string.Equals(Path.GetFileName(sdkParent), "sdk", StringComparison.OrdinalIgnoreCase))
154 string? dotnetRoot = Path.GetDirectoryName(sdkParent);
179 return Path.GetFullPath(Path.Join(projectDirectory, portablePath.Replace('/', Path.DirectorySeparatorChar)));
208 if (Path.IsPathRooted(body)) return false;
226 string objDir = Path.Combine(projectDirectory, "obj");
236 return Path.Combine(objDir, "NuGet");
239 string nativeSuffix = packageRelativePath.Replace('/', Path.DirectorySeparatorChar);
269 return Path.Combine(objDir, "NuGet", nativeSuffix);
286 : $"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}{configurationName}{Path.DirectorySeparatorChar}";
290 string excludeDebug = $"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}Debug{Path.DirectorySeparatorChar}";
315 string candidate = Path.Combine(hashDir, nativeSuffix);
374 PathSentinels.NetFxRef => this.ResolveNetFrameworkReferenceAssembly(body) ?? body.Replace('/', Path.DirectorySeparatorChar),
376 PathSentinels.Path => Path.GetFullPath(Path.Join(projectDirectory, body.Replace('/', Path.DirectorySeparatorChar))),
411 return relative.Replace('/', Path.DirectorySeparatorChar);
432 return this.ResolveNetFrameworkReferenceAssembly(body) ?? body.Replace('/', Path.DirectorySeparatorChar);
470 return relativePart.Replace('/', Path.DirectorySeparatorChar);
488 string candidate = Path.Join(root, "sdk", sdkVersion);
505 return NormalizeFolderPath(Path.Join(root, "sdk", sdkVersion));
531 string packDir = Path.Join(root, "packs", packName);
536 string versionName = Path.GetFileName(versionDir);
660 string candidate = Path.Join(packageDirectory, "build", ".NETFramework", entry.Replace('/', Path.DirectorySeparatorChar));
762 string file = Path.Join(this.netSdkPath, "Sdks", "Microsoft.NET.Sdk", "analyzers", "build", "config", fileName);
811 string file = Path.Join(this.netSdkPath, "Sdks", "Microsoft.NET.Sdk", "codestyle", language, "build", "config", $"analysislevelstyle_{mode.ToLowerInvariant()}.globalconfig");
874 string targetsPath = Path.Join(sdkPath, "Sdks", "Microsoft.NET.Sdk", "targets", "Microsoft.NET.Sdk.Analyzers.targets");
1050 string sdkVersion = Path.GetFileName(sdkPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
1111 string versionName = Path.GetFileName(versionDir);
1127 string direct = Path.Join(parent, childName);
1133 string lower = Path.Join(parent, childName.ToLowerInvariant());
1145 && value.IndexOfAny(Path.GetInvalidFileNameChars()) < 0
1269 string defaultFolder = Path.Join(userProfile, ".nuget", "packages");
1296 yield return Path.Join(programFiles, "dotnet");
1313 yield return Path.Join(userHome, ".dotnet");
1325 string candidate = Path.Join(programFilesX86, "Reference Assemblies", "Microsoft", "Framework", ".NETFramework");
1338 string full = Path.GetFullPath(path);
1340 if (!full.EndsWith(Path.DirectorySeparatorChar))
1342 full += Path.DirectorySeparatorChar;
1355 suffix.Replace('/', Path.DirectorySeparatorChar);
Donor\ProjectDataDonorIndex.cs (27)
81 Directory.CreateDirectory(Path.GetDirectoryName(lockPath)!);
103 ? Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName)
121 ? Path.GetFullPath(indexPathOverride)
132 candidateIndexPath ??= Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName);
143 string normalizedRoot = EnsureTrailingDirectorySeparator(Path.GetFullPath(root));
144 string normalizedFullPath = Path.GetFullPath(fullPath);
151 return relativePath.Length > 0 && !relativePath.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal);
156 if (path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) ||
157 path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal))
162 return path + Path.DirectorySeparatorChar;
170 string fullPath = Path.GetFullPath(path);
171 string root = Path.GetPathRoot(fullPath) ?? string.Empty;
173 ? fullPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
194 string? current = Path.GetDirectoryName(Path.GetFullPath(projectFilePath));
198 string gitPath = Path.Combine(currentDirectory, ".git");
232 gitDirectory = Path.IsPathRooted(value)
233 ? Path.GetFullPath(value)
234 : Path.GetFullPath(Path.Combine(Path.GetDirectoryName(gitFilePath)!, value));
245 string commonDirFilePath = Path.Combine(gitDirectory, "commondir");
251 return Path.IsPathRooted(commonDir)
252 ? Path.GetFullPath(commonDir)
253 : Path.GetFullPath(Path.Combine(gitDirectory, commonDir));
Donor\ProjectDataDonorIndex.Git.cs (8)
42 string gitPath = Path.Combine(workspaceRoot, ".git");
63 string headPath = Path.Combine(gitDirectory, "HEAD");
80 AppendFileFingerprint(fingerprint, Path.Combine(commonGitDirectory, "packed-refs"), gitQueryContext);
81 AppendFileFingerprint(fingerprint, Path.Combine(commonGitDirectory, "reftable", "tables.list"), gitQueryContext);
84 AppendFileFingerprint(fingerprint, Path.Combine(gitDirectory, "reftable", "tables.list"), gitQueryContext);
268 string relativePath = refName.Replace('/', Path.DirectorySeparatorChar);
269 string worktreeRefPath = Path.Combine(gitDirectory, relativePath);
274 : Path.Combine(commonGitDirectory, relativePath),
UserFolderCachePath.cs (5)
56 return Path.Combine(baseDir, hex.Substring(0, 2), hex.Substring(2));
93 return Path.Combine(localAppData, "Microsoft", CacheDirectoryName);
101 return Path.Combine(home, "Library", "Caches", CacheDirectoryName);
109 return Path.Combine(xdgCacheHome!, CacheDirectoryName);
115 return Path.Combine(home, ".cache", CacheDirectoryName);
Microsoft.NET.ProjectData.Generators (1)
Microsoft.NET.ProjectData.Tasks (124)
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\Donor\ProjectDataDonorIndex.cs (27)
81 Directory.CreateDirectory(Path.GetDirectoryName(lockPath)!);
103 ? Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName)
121 ? Path.GetFullPath(indexPathOverride)
132 candidateIndexPath ??= Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName);
143 string normalizedRoot = EnsureTrailingDirectorySeparator(Path.GetFullPath(root));
144 string normalizedFullPath = Path.GetFullPath(fullPath);
151 return relativePath.Length > 0 && !relativePath.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal);
156 if (path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) ||
157 path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal))
162 return path + Path.DirectorySeparatorChar;
170 string fullPath = Path.GetFullPath(path);
171 string root = Path.GetPathRoot(fullPath) ?? string.Empty;
173 ? fullPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
194 string? current = Path.GetDirectoryName(Path.GetFullPath(projectFilePath));
198 string gitPath = Path.Combine(currentDirectory, ".git");
232 gitDirectory = Path.IsPathRooted(value)
233 ? Path.GetFullPath(value)
234 : Path.GetFullPath(Path.Combine(Path.GetDirectoryName(gitFilePath)!, value));
245 string commonDirFilePath = Path.Combine(gitDirectory, "commondir");
251 return Path.IsPathRooted(commonDir)
252 ? Path.GetFullPath(commonDir)
253 : Path.GetFullPath(Path.Combine(gitDirectory, commonDir));
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\UserFolderCachePath.cs (5)
56 return Path.Combine(baseDir, hex.Substring(0, 2), hex.Substring(2));
93 return Path.Combine(localAppData, "Microsoft", CacheDirectoryName);
101 return Path.Combine(home, "Library", "Caches", CacheDirectoryName);
109 return Path.Combine(xdgCacheHome!, CacheDirectoryName);
115 return Path.Combine(home, ".cache", CacheDirectoryName);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (20)
Microsoft.NET.Sdk.Publish.Tasks (57)
Microsoft.NET.Sdk.Razor.Tasks (21)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (74)
Microsoft.NET.Sdk.WorkloadManifestReader (46)
SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests");
93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests");
109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt");
112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt");
130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator)
205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json");
302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json");
344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json");
363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory));
372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString);
387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString);
392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory;
452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir));
480string manifestId = Path.GetFileName(manifestDirectory);
488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json")))
491return (directory: dir, version: Path.GetFileName(dir));
500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json")))
502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json");
526.Select(dir => Path.GetFileName(dir))
532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId)))
557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(),
559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json")))
607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString());
624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory);
634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName);
639var workloadSetVersion = Path.GetFileName(workloadSetDirectory);
668string globalJsonPath = Path.Combine(directory, "global.json");
673directory = Path.GetDirectoryName(directory);
WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine(
40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt");
48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray();
329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion);
333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg");
337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg");
341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (20)
parent\parent\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any())
22.Select(path => new SdkFeatureBand(Path.GetFileName(path)));
32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir);
36.Select(file => new WorkloadId(Path.GetFileName(file)));
46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
49var pathDir = Path.GetDirectoryName(path);
60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
Microsoft.Private.Windows.Core (1)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\PathExtensions.cs (1)
8extension(Path)
Microsoft.SourceLink.AzureDevOpsServer.Git (7)
Microsoft.SourceLink.AzureRepos.Git (7)
Microsoft.SourceLink.Bitbucket.Git (7)
Microsoft.SourceLink.Common (7)
Microsoft.SourceLink.Gitea (7)
Microsoft.SourceLink.Gitee (7)
Microsoft.SourceLink.GitHub (7)
Microsoft.SourceLink.GitLab (7)
Microsoft.SourceLink.GitWeb (7)
Microsoft.TemplateEngine.Cli (20)
Microsoft.TemplateEngine.Core (9)
Microsoft.TemplateEngine.Edge (29)
Microsoft.TemplateEngine.IDE (2)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (5)
Microsoft.TemplateEngine.Utils (31)
InMemoryFileSystem.cs (15)
22_root = new FileSystemDirectory(Path.GetFileName(root.TrimEnd('/', '\\')), root);
26_root = new FileSystemDirectory(Path.GetFileName(newRoot.TrimEnd('/', '\\')), newRoot);
53dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
77dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
86targetFile = new FileSystemFile(parts[parts.Length - 1], Path.Combine(currentDir.FullPath, parts[parts.Length - 1]));
451dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
507dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
565dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
597dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
628dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
659dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i]));
699if (!Path.IsPathRooted(path))
701path = Path.Combine(GetCurrentDirectory(), path);
742processedPath = string.Join(Path.DirectorySeparatorChar + string.Empty, realParts);
743if (processedPath.Equals(_root.FullPath) || processedPath.StartsWith(_root.FullPath.TrimEnd('/', '\\') + Path.DirectorySeparatorChar))
Microsoft.TemplateSearch.Common (2)
Microsoft.TestPlatform.AdapterUtilities (1)
Microsoft.TestPlatform.Build (1)
Microsoft.TestPlatform.CommunicationUtilities (2)
Microsoft.TestPlatform.CoreUtilities (14)
Microsoft.TestPlatform.CrossPlatEngine (42)
Microsoft.TestPlatform.Extensions.BlameDataCollector (23)
Microsoft.TestPlatform.PlatformAbstractions (15)
Microsoft.TestPlatform.TestHostRuntimeProvider (33)
Microsoft.TestPlatform.Utilities (10)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (1)
Microsoft.VisualBasic.Forms (38)
Microsoft.VisualStudio.TestPlatform.Client (6)
Microsoft.VisualStudio.TestPlatform.Common (26)
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (4)
Microsoft.VisualStudio.TestPlatform.Extensions.TestIds.TestLogger (9)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (43)
Microsoft.VisualStudio.TestPlatform.ObjectModel (10)
Microsoft.Web.XmlTransform (3)
Mono.Cecil (8)
MSBuild (44)
XMake.cs (18)
164s_exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath());
1737parseConfigDirectory: Path.GetDirectoryName(Path.GetFullPath(projectFile)));
2780Console.WriteLine($"{Path.Combine(s_exePath, s_exeName)} {equivalentCommandLine} {projectFile}");
3621if (!extensionsToIgnore.Contains(Path.GetExtension(s)) && !s.EndsWith("~", StringComparison.CurrentCultureIgnoreCase))
3636if (!extensionsToIgnore.Contains(Path.GetExtension(s)))
3654string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]);
3655string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]);
3674string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]);
3675string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]);
3729|| Path.IsPathRooted(projectFile)
3738if (string.IsNullOrEmpty(logicalCurrentDirectory) || !Path.IsPathRooted(logicalCurrentDirectory))
3752string rebasedProjectFile = Path.GetFullPath(Path.Combine(logicalCurrentDirectory, projectFile));
3776InitializationException.VerifyThrow(string.Equals(extension, Path.GetExtension(extension), StringComparison.OrdinalIgnoreCase), "InvalidExtensionToIgnore", extension, null, false);
4238if (!string.IsNullOrEmpty(logFileName) && !Path.IsPathRooted(logFileName))
4241$"logFile={Path.Combine(Directory.GetCurrentDirectory(), logFileName)}");
4258fileParameters += $"logFile={Path.Combine(Directory.GetCurrentDirectory(), msbuildLogFileName)}";
MSBuild.Coordinator (1)
mscorlib (1)
netstandard (1)
NuGet.Build.Tasks (34)
NuGet.Build.Tasks.Console (15)
MSBuildStaticGraphRestore.cs (14)
145if ((string.Equals(Path.GetExtension(entryProjectFilePath), ".sln", StringComparison.OrdinalIgnoreCase)
146|| string.Equals(Path.GetExtension(entryProjectFilePath), ".slnx", StringComparison.OrdinalIgnoreCase))
622: Path.GetDirectoryName(solutionDir);
637return outputPath == null ? null : Path.GetFullPath(Path.Combine(project.Directory, outputPath));
644return outputPath == null ? null : Path.GetFullPath(Path.Combine(projectDirectory, outputPath));
716var extension = Path.GetExtension(entryProjectPath);
912var message = string.Format(CultureInfo.CurrentCulture, Strings.Error_ReadingProjectInformation, projectName ?? Path.GetFileNameWithoutExtension(projectPath), innerException.Message);
932outputPath ??= Path.Combine(projectDirectory, "obj");
937Name = projectName ?? Path.GetFileNameWithoutExtension(projectPath),
1487LoggingQueue.Enqueue(new ConsoleOutLogEmbedInBinlog(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName)));
1494LoggingQueue.Enqueue(new ConsoleOutLogEmbedInBinlog(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))));
NuGet.Build.Tasks.Pack (40)
PackTaskLogic.cs (32)
108var assetsFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName);
344string assetsFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName);
542targetPath = Path.GetFileName(finalOutputPath);
620packArgs.CurrentDirectory = Path.Combine(
622request.PackItem.GetProperty("Directory")).TrimEnd(Path.DirectorySeparatorChar);
639if (Path.IsPathRooted(request.NuspecOutputPath))
645packArgs.PackTargetArgs.NuspecOutputPath = Path.Combine(
716var fileName = Path.GetFileName(sourcePath);
720Compare(Path.GetExtension(fileName),
721Path.GetExtension(targetPath)) == 0
722&& !string.IsNullOrEmpty(Path.GetExtension(fileName))
724: Path.Combine(targetPath, recursiveDir));
744if (setOfTargetPaths.Remove("contentFiles" + Path.DirectorySeparatorChar)
750Path.Combine("contentFiles", language, framework.GetShortFolderName()
764!Path.GetFileName(sourcePath)
771if (Path.IsPathRooted(identity))
774identity = Path.GetDirectoryName(identity);
778else if (identity.EndsWith(Path.GetFileName(sourcePath), StringComparison.CurrentCultureIgnoreCase))
780identity = Path.GetDirectoryName(identity);
785var newTargetPath = Path.Combine(targetPath, identity);
802var fileName = Path.GetFileName(sourcePath);
803if (string.IsNullOrEmpty(Path.GetExtension(fileName)) ||
804!Path.GetExtension(fileName)
805.Equals(Path.GetExtension(targetPath), StringComparison.OrdinalIgnoreCase))
807currentPath = Path.Combine(targetPath, fileName);
829sourcePath = Path.Combine(sourceProjectFile.Replace(Path.GetFileName(sourceProjectFile), string.Empty), identity);
831return Path.GetFullPath(sourcePath);
860sourceProjectFile = Path.GetDirectoryName(sourceProjectFile);
923library => Path.GetFullPath(Path.Combine(
924Path.GetDirectoryName(assetsFile.PackageSpec.RestoreMetadata.ProjectPath),
NuGet.CommandLine.XPlat (25)
NuGet.Commands (122)
CommandRunners\PackCommandRunner.cs (30)
46@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar),
47@"src\**\*".Replace('\\', Path.DirectorySeparatorChar)
53@"content\**\*".Replace('\\', Path.DirectorySeparatorChar),
54@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar)
87var result = BuildPackage(Path.GetFullPath(Path.Combine(_packArgs.CurrentDirectory, _packArgs.Path)));
93string extension = Path.GetExtension(path);
117Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
202Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
204string resolvedNuSpecOutputPath = Path.Combine(
205Path.GetDirectoryName(outputPath),
230string tempOutputPath = Path.Combine(
232Path.GetRandomFileName());
250Directory.CreateDirectory(Path.GetDirectoryName(outputPath));
252string sha512OutputPath = Path.Combine(outputPath + ".sha512");
256string tempOutputPath = Path.Combine(
258Path.GetRandomFileName());
571WriteLine(Strings.Log_PackageCommandAttemptingToBuildSymbolsPackage, Path.GetFileName(path));
706var fileName = Path.GetFileName(filePath);
748path = path.Substring(index + basePath.Length).TrimStart(Path.DirectorySeparatorChar);
823List<IPackageFile> toRemove = files.Where(t => !string.Equals(Path.GetExtension(t.Path), ".pdb", StringComparison.OrdinalIgnoreCase)).ToList();
876return Path.Combine(finalOutputDirectory, outputFile);
911string directory = Path.GetDirectoryName(packArgs.Path);
919packArgs.OutputDirectory = Path.GetFullPath(packArgs.OutputDirectory);
924packArgs.BasePath = Path.GetFullPath(packArgs.BasePath);
948List<string> candidates = files.Where(file => AllowedExtensions.Contains(Path.GetExtension(file))).ToList();
953!Path.GetFileName(ext).Equals(ProjectJsonPathUtilities.ProjectConfigFileName, StringComparison.OrdinalIgnoreCase) &&
967candidates.RemoveAll(file => Path.GetExtension(file).Equals(NuGetConstants.ManifestExtension, StringComparison.OrdinalIgnoreCase));
975candidates.RemoveAll(file => Path.GetExtension(file).Equals(".json", StringComparison.OrdinalIgnoreCase));
987return Path.Combine(packArgs.CurrentDirectory, result);
MSBuildProjectFactory.cs (19)
103var manifestDirectory = Path.GetDirectoryName(manifestPath);
134var extension = Path.GetExtension(file.FinalOutputPath);
148Target = IsTool ? Path.Combine(targetFolders[i], targetPath) : Path.Combine(targetFolders[i], tfm, targetPath)
160var fileExtension = Path.GetExtension(packageFile.Source);
195Target = target.EndsWith(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal) || string.IsNullOrEmpty(target)
196? Path.Combine(target, Path.GetFileName(sourcePath))
204var includePath = PathUtility.GetRelativePath("contentFiles" + Path.DirectorySeparatorChar, packageFile.Target, '/');
207if (!Path.GetExtension(includePath)
208.Equals(Path.GetExtension(sourcePath), StringComparison.OrdinalIgnoreCase))
210includePath = Path.Combine(includePath, Path.GetFileName(sourcePath));
258var projectName = Path.GetFileName(projectDirectory);
259var targetPath = Path.Combine(SourcesFolder, projectName);
270var relativePath = Path.GetDirectoryName(sourcePath).Replace(projectDirectoryWithSeparatorChar, string.Empty, StringComparison.Ordinal);
282targetPath = Path.Combine(targetPath, relativePath);
285var finalTargetPath = Path.Combine(targetPath, Path.GetFileName(sourcePath));
RestoreCommand\Utility\LockFileUtils.cs (14)
312if (Path.GetFileName(btItem.Path).Equals(Path.GetFileName(buildItem.Path), StringComparison.OrdinalIgnoreCase))
450lockFileLib.RuntimeAssemblies = lockFileLib.RuntimeAssemblies.Where(p => !p.Path.StartsWith("lib/", StringComparison.Ordinal) || referenceFilter.Contains(Path.GetFileName(p.Path))).ToList();
451lockFileLib.CompileTimeAssemblies = lockFileLib.CompileTimeAssemblies.Where(p => !p.Path.StartsWith("lib/", StringComparison.Ordinal) || referenceFilter.Contains(Path.GetFileName(p.Path))).ToList();
637string relativePath = PathUtility.GetPathWithForwardSlashes(Path.Combine("bin", "placeholder", $"{localMatch.Library.Name}.dll"));
805int lastSeparator = path.LastIndexOf(Path.AltDirectorySeparatorChar);
809int separator = path.IndexOf(Path.AltDirectorySeparatorChar, segmentStart);
878Path.GetFileName(c.Path),
889Path.GetFileName(c.Path),
979var fileName = Path.GetFileName(firstItem.Path);
1145if (Path.DirectorySeparatorChar == '/')
1150return path.Replace('/', Path.DirectorySeparatorChar);
1235item => Path.GetFileName(item.Path).Equals(Path.GetFileName(currentBuildItem.Path), StringComparison.OrdinalIgnoreCase));
NuGet.Common (108)
PathUtil\NuGetEnvironment.cs (18)
64var tempPath = Path.GetTempPath();
68nuGetScratch = Path.Combine(tempPath,
113return Path.Combine(machineWideBaseDir,
117return Path.Combine(
122return Path.Combine(
127return Path.Combine(
134return Path.Combine(
141return Path.Combine(
150return Path.Combine(
157return Path.Combine(
171return Path.Combine(programFilesPath, "MSBuild", "14.0", "Bin", "MSBuild.exe");
238return Path.Combine(_getHome.Value, ".nuget");
254return Path.Combine(_getHome.Value, ".local", "share");
361foreach (var dir in path.Split(Path.PathSeparator))
363var fullPath = Path.Combine(dir, executable);
375var fullPath = Path.Combine(programFiles, DotNet, DotNetExe);
385var fullPath = Path.Combine(programFiles, DotNet, DotNetExe);
397var fullPath = Path.Combine(localBin, DotNet);
PathUtil\PathUtility.cs (31)
99return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar);
140dir = Path.GetFullPath(dir);
142candidate = Path.GetFullPath(candidate);
163return (ch == Path.DirectorySeparatorChar ||
164ch == Path.AltDirectorySeparatorChar);
168return ch == Path.DirectorySeparatorChar;
174string? directory = Path.GetDirectoryName(filePath);
190return GetRelativePath(path1, path2, Path.DirectorySeparatorChar);
213if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare))
225var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
226var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
298path = path.TrimEnd(Path.DirectorySeparatorChar);
299string? fullDirectoryPath = Path.GetDirectoryName(path);
304return path.Substring(fullDirectoryPath.Length).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
314if (Path.DirectorySeparatorChar == '/')
334return Uri.UnescapeDataString(path.Replace('/', Path.DirectorySeparatorChar));
378var folder = path.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? string.Empty;
380folder = Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar;
382var root = Path.GetPathRoot(path);
417basePath = basePath.TrimEnd(Path.DirectorySeparatorChar);
423return path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
428return path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
485string? parentDirectory = Path.GetFullPath(path);
494parentDirectory = Path.GetDirectoryName(parentDirectory);
NuGet.Configuration (52)
Settings\Settings.cs (25)
507.OrderByDescending(file => file.FullName.Count(c => c == Path.DirectorySeparatorChar))
592var defaultSettingsFilePath = Path.Combine(userSettingsDir, DefaultSettingsFileName);
624Path.Combine(rootDirectory, configFileName));
638? Path.Combine(rootDirectory, "TestingGlobalPath")
644return Path.Combine(userSettingsDirectory, ConfigurationConstants.Config);
671var combinedPath = Path.Combine(paths);
690var index = combinedPath.LastIndexOf(Path.DirectorySeparatorChar);
721if (Path.IsPathRooted(settingsPath))
723fileName = Path.GetFileName(settingsPath);
724directory = Path.GetDirectoryName(settingsPath)!;
728var fullPath = Path.Combine(root ?? string.Empty, settingsPath);
729fileName = Path.GetFileName(fullPath);
730directory = Path.GetDirectoryName(fullPath)!;
784var rawPath = Path.Combine(originDirectoryPath, ResolvePath(Path.GetDirectoryName(originFilePath)!, path));
802root = Path.GetPathRoot(value)!;
816&& (root[0] == Path.DirectorySeparatorChar || value[0] == Path.AltDirectorySeparatorChar))
818return Path.Combine(Path.GetPathRoot(configDirectory)!, value.Substring(1));
820return Path.Combine(configDirectory, value);
829if (!Path.IsPathRooted(settingsPath) && !string.IsNullOrWhiteSpace(settingsRoot))
831settingsPath = Path.Combine(settingsRoot, settingsPath);
880var file = Path.Combine(directory, nugetConfigCasing);
896current = Path.GetDirectoryName(current);
NuGet.Credentials (3)
NuGet.PackageManagement (88)
Projects\FolderNuGetProject.cs (11)
155nuGetProjectContext.Log(MessageLevel.Info, Strings.AddingPackageToFolder, packageIdentity, Path.GetFullPath(Root));
215nuGetProjectContext.Log(MessageLevel.Info, Strings.AddedPackageToFolder, packageIdentity, Path.GetFullPath(Root));
221nuGetProjectContext.Log(MessageLevel.Debug, Strings.AddedPackageToFolderFromSource, packageIdentity, Path.GetFullPath(Root), downloadResourceResult.PackageSource);
432var installPath = Path.GetFullPath(Path.Combine(packageDirectory, packageName));
488var installPath = Path.GetFullPath(Path.Combine(packageDirectory, manifestName));
517var filePath = Path.GetFullPath(Path.Combine(packageDirectory, fileName));
546return Path.GetDirectoryName(installFilePath);
583var packageDirectoryPath = Path.GetDirectoryName(packageFilePath);
Projects\PackagesConfigNuGetProject.cs (6)
76PackagesConfigPath = Path.Combine(folderPath, "packages.config");
79PackagesProjectNameConfigPath = Path.Combine(folderPath, "packages." + projectName + ".config");
125nuGetProjectContext.Log(MessageLevel.Warning, Strings.PackageAlreadyExistsInPackagesConfig, packageIdentity, Path.GetFileName(FullPath));
181nuGetProjectContext.Log(MessageLevel.Info, Strings.AddedPackageToPackagesConfig, packageIdentity, Path.GetFileName(FullPath));
202nuGetProjectContext.Log(MessageLevel.Warning, Strings.PackageDoesNotExisttInPackagesConfig, packageIdentity, Path.GetFileName(FullPath));
235nuGetProjectContext.Log(MessageLevel.Info, Strings.RemovedPackageFromPackagesConfig, packageIdentity, Path.GetFileName(FullPath));
Utility\FileSystemUtility.cs (28)
46return Path.Combine(root, path);
72|| string.IsNullOrEmpty(Path.GetFileName(path)))
77Directory.CreateDirectory(GetFullPath(root, Path.GetDirectoryName(path)));
96var folderPath = Path.GetDirectoryName(path);
100nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_AddedFileToFolder, Path.GetFileName(path), folderPath);
104nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_AddedFile, Path.GetFileName(path));
127if (string.IsNullOrEmpty(Path.GetFileName(fullPath)))
142if (string.IsNullOrEmpty(Path.GetFileName(fullPath)))
148Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
155|| string.IsNullOrEmpty(Path.GetFileName(fullPath)))
170path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path));
188trimmedPaths.Add(filePath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar));
192trimmedPaths.Add(filePath.TrimStart(Path.DirectorySeparatorChar));
224var folderPath = Path.GetDirectoryName(fullPath);
230Path.GetFileName(fullPath),
231Path.GetFullPath(folderPath));
235nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_RemovedFile, Path.GetFileName(fullPath));
273var directoryLookup = filesToDelete.ToLookup(p => Path.GetDirectoryName(p));
285var dirPath = Path.Combine(packagesDir, directory);
294var path = Path.Combine(packagesDir, file);
303DeleteDirectorySafe(Path.Combine(packagesDir, dirPath), recursive: false, nuGetProjectContext: nuGetProjectContext);
398for (var path = Path.GetDirectoryName(filePath); !string.IsNullOrEmpty(path); path = Path.GetDirectoryName(path))
466foreach (var index in IndexOfAll(path, altDirectorySeparator ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar))
491return fullPath.TrimStart(Path.DirectorySeparatorChar);
493return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar);
498return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar);
NuGet.Packaging (137)
PackageCreation\Authoring\PackageBuilder.cs (22)
50: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic)
55: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic, logger, versionOverride: "")
60: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic, logger, versionOverride)
429(f.Path.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) ||
430f.Path.StartsWith(PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)));
440f.Path.StartsWith(PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) &&
450file.Path.StartsWith(PackagingConstants.Folders.ContentFiles + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase));
464file.Path.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) &&
506select Path.GetFileName(file.Path), StringComparer.OrdinalIgnoreCase);
599var ext = Path.GetExtension(licenseMetadata.License);
635var ext = Path.GetExtension(iconPath);
761var extension = Path.GetExtension(readmePath);
955var fileExtension = Path.GetExtension(file.Path);
990exclude = exclude?.Replace('\\', Path.DirectorySeparatorChar);
992List<PhysicalPackageFile> searchFiles = ResolveSearchPattern(basePath, source.Replace('\\', Path.DirectorySeparatorChar), destination, _includeEmptyDirectories).ToList();
997searchFiles.RemoveAll(file => Path.GetFileName(file.TargetPath) == PackagingConstants.PackageEmptyFileName
1050packagePath = fullPath.Substring(searchDirectory.Length).TrimStart(Path.DirectorySeparatorChar);
1052else if (!isWildcardSearch && Path.GetExtension(searchPattern).Equals(Path.GetExtension(targetPath), StringComparison.OrdinalIgnoreCase))
1060packagePath = Path.GetFileName(fullPath);
1062return Path.Combine(targetPath ?? string.Empty, packagePath);
1126var segments = path.Split(new[] { '/', '\\', Path.DirectorySeparatorChar }, StringSplitOptions.None)
NuGet.ProjectModel (13)
NuGet.Protocol (59)
Pipelines.AppHost (6)
Pipelines.Library (4)
PresentationBuildTasks (71)
PresentationCore (21)
PresentationFramework (20)
PresentationUI (11)
ProjectResourceExtensions.AppHost (2)
ReachFramework (4)
RepoTasks (43)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
242var certPath = Path.Combine(certDir, nickname) + ".pem";
356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
358: homeDirectory + Path.DirectorySeparatorChar;
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
370var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
371var certDirFullPath = Path.GetFullPath(certDir);
381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
471var certPath = Path.Combine(certDir, nickname) + ".pem";
561return Path.Combine(homeDirectory, ".pki", "nssdb");
566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
571return Path.Combine(homeDirectory, ".mozilla", "firefox");
576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
600var searchFolders = searchPath.Split(Path.PathSeparator);
610if (File.Exists(Path.Combine(searchFolder, command)))
813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
848var nssDb = Path.GetFullPath(path);
1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
ResultsOfTGenerator (2)
Roslyn.Diagnostics.Analyzers (26)
rzc (51)
ShadowCopyManager.cs (15)
24BaseDirectory = baseDirectory ?? Path.Combine(Path.GetTempPath(), "Razor", "ShadowCopy");
27UniqueDirectory = Path.Combine(BaseDirectory, guid);
42var destination = Path.Combine(assemblyDirectory, Path.GetFileName(filePath));
45var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath);
49foreach (var directory in Directory.EnumerateDirectories(Path.GetDirectoryName(filePath)))
51var directoryName = Path.GetFileName(directory);
53var resourcesPath = Path.Combine(directory, resourcesNameWithExtension);
56var resourcesShadowCopyPath = Path.Combine(assemblyDirectory, directoryName, resourcesNameWithExtension);
60resourcesPath = Path.Combine(directory, resourcesNameWithoutExtension, resourcesNameWithExtension);
63var resourcesShadowCopyPath = Path.Combine(assemblyDirectory, directoryName, resourcesNameWithoutExtension, resourcesNameWithExtension);
85var directory = Path.Combine(UniqueDirectory, id.ToString(CultureInfo.InvariantCulture));
92var directory = Path.GetDirectoryName(shadowCopyPath);
146if (!Mutex.TryOpenExisting(Path.GetFileName(directory).ToLowerInvariant(), out mutex))
sdk-tasks (70)
SelectTests (27)
Stress.ApiService (2)
Stress.AppHost (14)
CommandResources.cs (14)
500var processCommandScriptsDirectory = Path.Combine(builder.AppHostDirectory, "process-command-scripts");
501var processCommandStdinScriptPath = Path.Combine(processCommandScriptsDirectory, "stdin.js");
502var processCommandEnvironmentScriptPath = Path.Combine(processCommandScriptsDirectory, "environment.js");
503var processCommandWorkingDirectoryScriptPath = Path.Combine(processCommandScriptsDirectory, "working-directory.js");
504var processCommandStderrFailureScriptPath = Path.Combine(processCommandScriptsDirectory, "stderr-failure.js");
505var processCommandOutputLimitScriptPath = Path.Combine(processCommandScriptsDirectory, "output-limit.js");
506var processCommandBackupRestoreScriptPath = Path.Combine(processCommandScriptsDirectory, "backup-restore.js");
507var processCommandContainerExecScriptPath = Path.Combine(processCommandScriptsDirectory, "container-exec.js");
508var processCommandSampleBackupPath = Path.Combine(processCommandScriptsDirectory, "sample-backup.dump");
509var processCommandFileAppsDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, "..", "process-command-file-apps"));
510var processCommandCSharpArgumentsAndStdinAppPath = Path.Combine(processCommandFileAppsDirectory, "arguments-and-stdin.cs");
511var processCommandCSharpWorkingDirectoryFailureAppPath = Path.Combine(processCommandFileAppsDirectory, "working-directory-failure.cs");
512var processCommandIssueToolAppPath = Path.Combine(processCommandFileAppsDirectory, "issue-tool.cs");
SuperFileCheck (6)
System.CodeDom (5)
System.CommandLine (7)
System.CommandLine.StaticCompletions (1)
System.ComponentModel.Annotations (1)
System.ComponentModel.Composition (3)
System.ComponentModel.TypeConverter (3)
System.Configuration.ConfigurationManager (41)
System.Console (4)
System.Data.Common (3)
System.Data.Odbc (1)
System.Data.OleDb (1)
System.Diagnostics.EventLog (6)
System.Diagnostics.FileVersionInfo (2)
System.Diagnostics.PerformanceCounter (4)
System.Diagnostics.Process (12)
System.Diagnostics.TextWriterTraceListener (4)
System.Formats.Tar (68)
System.IO.Compression (2)
System.IO.Compression.ZipFile (14)
System.IO.FileSystem.AccessControl (7)
System.IO.FileSystem.DriveInfo (2)
System.IO.FileSystem.Watcher (9)
System.IO.IsolatedStorage (18)
System.IO.MemoryMappedFiles (4)
System.IO.Packaging (6)
System.IO.Pipes (8)
System.IO.Ports (2)
System.Management (1)
System.Net.Mail (8)
System.Net.NetworkInformation (3)
System.Net.Ping (2)
System.Net.Quic (2)
System.Net.Sockets (2)
System.Private.CoreLib (155)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (26)
55FileSystem.CopyFile(Path.GetFullPath(sourceFileName), Path.GetFullPath(destFileName), overwrite);
84FileSystem.DeleteFile(Path.GetFullPath(path));
100path = Path.GetFullPath(path);
170return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize);
210=> FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false);
241=> FileSystem.SetCreationTime(Path.GetFullPath(path), GetUtcDateTimeOffset(creationTimeUtc), asDirectory: false);
273=> FileSystem.GetCreationTime(Path.GetFullPath(path)).LocalDateTime;
298=> FileSystem.GetCreationTime(Path.GetFullPath(path)).UtcDateTime;
323=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), lastAccessTime, false);
354=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastAccessTimeUtc), false);
385=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).LocalDateTime;
410=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).UtcDateTime;
435=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), lastWriteTime, false);
466=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastWriteTimeUtc), false);
497=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).LocalDateTime;
522=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).UtcDateTime;
547=> FileSystem.GetAttributes(Path.GetFullPath(path));
571=> FileSystem.SetAttributes(Path.GetFullPath(path), fileAttributes);
1057Path.GetFullPath(sourceFileName),
1058Path.GetFullPath(destinationFileName),
1059destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null,
1079string fullSourceFileName = Path.GetFullPath(sourceFileName);
1080string fullDestFileName = Path.GetFullPath(destFileName);
1459string fullPath = Path.GetFullPath(path);
1481string fullPath = Path.GetFullPath(path);
System.Private.Windows.Core.TestUtilities (6)
System.Private.Xml (7)
System.Reflection.Metadata (3)
System.Reflection.MetadataLoadContext (4)
System.Runtime (1)
System.Runtime.Caching (2)
System.Runtime.Extensions (1)
System.Runtime.InteropServices (3)
System.Runtime.Serialization.Schema (1)
System.Security.Cryptography (1)
System.Speech (1)
System.Windows.Extensions (1)
System.Windows.Forms (24)
System.Windows.Forms.Design (3)
System.Windows.Forms.Primitives (6)
System.Xaml (1)
Terminals.AppHost (1)
testhost (5)
testhost.arm64 (5)
testhost.x86 (5)
TypeScriptApiCompat (4)
UIAutomationClient (1)
vbc (20)
VBCSCompiler (48)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (22)
133=> Path.Combine(_cachePath, dllName, hashKey);
152var cachedAssemblyPath = Path.Combine(entryDir, AssemblyFileName);
205return !File.Exists(Path.Combine(entryDir, cachedFileName));
215copyAndUpdateTimestamp(Path.Combine(entryDir, cachedFileName), targetPath, outputTimestampUtc);
242var dllCacheDir = Path.Combine(_cachePath, dllName);
253.Select(d => (Path: d, Name: Path.GetFileName(d)))
268var keyPath = Path.Combine(entryPath, dllName + ".key");
302var dllCacheDir = Path.Combine(_cachePath, dllName);
322stagingDir = Path.Combine(dllCacheDir, hashKey + "." + Guid.NewGuid().ToString("N") + ".tmp");
325File.Copy(outputFiles.AssemblyPath, Path.Combine(stagingDir, AssemblyFileName), overwrite: false);
327tryCopyOptional(outputFiles.PdbPath, Path.Combine(stagingDir, PdbFileName));
328tryCopyOptional(outputFiles.RefAssemblyPath, Path.Combine(stagingDir, RefAssemblyFileName));
329tryCopyOptional(outputFiles.XmlDocPath, Path.Combine(stagingDir, XmlDocFileName));
331File.WriteAllText(Path.Combine(stagingDir, dllName + ".key"), deterministicKey, Encoding.UTF8);
332File.WriteAllText(Path.Combine(stagingDir, CreatedFileName), DateTimeOffset.UtcNow.ToString("O", CultureInfo.InvariantCulture));
459var path = Path.Combine(entryDir, LastUsedFileName);
490var dllName = Path.GetFileName(dllDir);
494var dirName = Path.GetFileName(entryDir);
555var lastUsedPath = Path.Combine(entryDir, LastUsedFileName);
583var createdPath = Path.Combine(entryDir, CreatedFileName);
623var dllName = Path.GetFileName(dllDir);
627var dirName = Path.GetFileName(entryDir);
vbi (3)
vstest.console (25)
vstest.console.arm64 (25)
Yarp.AppHost (1)