11008 references to Path
AnalyzerRunner (8)
aspire (373)
Agents\Playwright\PlaywrightCliInstaller.cs (10)
58internal static readonly string s_primarySkillBaseDirectory = Path.Combine(".claude", "skills");
181var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-playwright-{Guid.NewGuid():N}");
254var primarySkillDir = Path.Combine(repoRoot, s_primarySkillBaseDirectory, PlaywrightCliSkillName);
270var targetSkillDir = Path.Combine(repoRoot, skillBaseDir, PlaywrightCliSkillName);
295var relativePath = Path.GetRelativePath(sourceDir, sourceFile);
296var targetFile = Path.Combine(targetDir, relativePath);
298var targetFileDir = Path.GetDirectoryName(targetFile);
312var relativePath = Path.GetRelativePath(targetDir, targetFile);
313var sourceFile = Path.Combine(sourceDir, relativePath);
Certificates\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Commands\InitCommand.cs (14)
235project => Path.GetFileNameWithoutExtension(project.ProjectFile.Name).EscapeMarkup(),
288project => Path.GetFileNameWithoutExtension(project.ProjectFile.Name).EscapeMarkup(),
310var tempProjectDir = Path.Combine(Path.GetTempPath(), $"aspire-init-{Guid.NewGuid()}");
390var finalAppHostDir = Path.Combine(initContext.SolutionDirectory.FullName, appHostProjectDir.Name);
391var finalServiceDefaultsDir = Path.Combine(initContext.SolutionDirectory.FullName, serviceDefaultsProjectDir.Name);
400var appHostProjectFile = new FileInfo(Path.Combine(finalAppHostDir, $"{appHostProjectDir.Name}.csproj"));
401var serviceDefaultsProjectFile = new FileInfo(Path.Combine(finalServiceDefaultsDir, $"{serviceDefaultsProjectDir.Name}.csproj"));
481InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
515InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
545var appHostPath = Path.Combine(workingDirectory.FullName, appHostFileName);
803public string SolutionName => Path.GetFileNameWithoutExtension(SelectedSolutionFile!.Name);
813public string ExpectedAppHostDirectory => Path.Combine(SolutionDirectory.FullName, $"{SolutionName}.AppHost");
818public string ExpectedServiceDefaultsDirectory => Path.Combine(SolutionDirectory.FullName, $"{SolutionName}.ServiceDefaults");
Projects\DotNetBasedAppHostServerProject.cs (29)
77_appPath = Path.GetFullPath(appPath);
81_repoRoot = Path.GetFullPath(repoRoot) + Path.DirectorySeparatorChar;
96_projectModelPath = Path.Combine(Path.GetTempPath(), FolderPrefix, AppsFolder, pathDir);
110public string BuildPath => Path.Combine(_projectModelPath, BuildFolder);
115public string GetProjectFilePath() => Path.Combine(_projectModelPath, ProjectFileName);
119var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName);
131var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName);
200var projectPath = Path.Combine(_repoRoot, "src", integration.Name, $"{integration.Name}.csproj");
219var hostingPath = Path.Combine(_repoRoot, "src", "Aspire.Hosting", "Aspire.Hosting.csproj");
241var appHostInTargets = Path.Combine(_repoRoot, "src", "Aspire.Hosting.AppHost", "build", "Aspire.Hosting.AppHost.in.targets");
242var sdkInTargets = Path.Combine(_repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets");
254var dashboardProject = Path.Combine(_repoRoot, "src", "Aspire.Dashboard", "Aspire.Dashboard.csproj");
261var remoteHostProject = Path.Combine(_repoRoot, "src", "Aspire.Hosting.RemoteHost", "Aspire.Hosting.RemoteHost.csproj");
283var objPath = Path.Combine(_projectModelPath, "obj");
300File.WriteAllText(Path.Combine(_projectModelPath, "Program.cs"), programCs);
334File.WriteAllText(Path.Combine(_projectModelPath, "appsettings.json"), appSettingsJson);
342var nugetConfigPath = Path.Combine(_projectModelPath, "nuget.config");
396var repoDirectoryPackagesProps = Path.Combine(_repoRoot, "Directory.Packages.props");
406File.WriteAllText(Path.Combine(_projectModelPath, "Directory.Packages.props"), directoryPackagesProps);
408var projectFileName = Path.Combine(_projectModelPath, ProjectFileName);
424var projectFile = new FileInfo(Path.Combine(_projectModelPath, ProjectFileName));
472var assemblyPath = Path.Combine(BuildPath, ProjectDllName);
573var workingDirFullPath = Path.GetFullPath(workingDirectory);
575var globalNuGetPath = Path.Combine(userProfile, ".nuget");
581var configFullPath = Path.GetFullPath(configPath);
582var configDir = Path.GetDirectoryName(configFullPath);
625var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props");
Projects\GuestAppHostProject.cs (8)
511var apphostRunPath = Path.Combine(directory.FullName, "apphost.run.json");
512var launchSettingsPath = Path.Combine(directory.FullName, "Properties", "launchSettings.json");
764var aspireCliPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels");
767return Path.Combine(aspireCliPath, socketName);
1035var outputPath = Path.Combine(appPath, GeneratedFolderName);
1040var filePath = Path.Combine(outputPath, fileName);
1041var directory = Path.GetDirectoryName(filePath);
1063var hashPath = Path.Combine(generatedPath, ".codegen-hash");
Projects\PrebuiltAppHostServer.cs (14)
64_appPath = Path.GetFullPath(appPath);
77_workingDirectory = Path.Combine(Path.GetTempPath(), ".aspire", "bundle-hosts", pathDir);
173var appHostDirectory = Path.GetDirectoryName(_appPath);
194var restoreDir = Path.Combine(_workingDirectory, "integration-restore");
197var outputDir = Path.Combine(restoreDir, "libs");
218var projectFilePath = Path.Combine(restoreDir, "IntegrationRestore.csproj");
230Path.Combine(restoreDir, "Directory.Packages.props"), directoryPackagesProps, cancellationToken);
234Path.Combine(restoreDir, "Directory.Build.props"), "<Project />", cancellationToken);
236Path.Combine(restoreDir, "Directory.Build.targets"), "<Project />", cancellationToken);
325new XAttribute("File", Path.Combine(outputDir, "_project-ref-assemblies.txt")),
339var localConfig = AspireJsonConfiguration.Load(Path.GetDirectoryName(_appPath)!);
515var filePath = Path.Combine(libsPath, "_project-ref-assemblies.txt");
572Path.Combine(_workingDirectory, "appsettings.json"),
Projects\ProjectLocator.cs (10)
93var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
102var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
139var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath);
203file => $"{file.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName).EscapeMarkup()})",
280MultipleAppHostProjectsFoundBehavior.Prompt => await interactionService.PromptForSelectionAsync(InteractionServiceStrings.SelectAppHostToUse, results.BuildableAppHost, projectFile => $"{projectFile.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName).EscapeMarkup()})", cancellationToken),
307var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
327var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
Aspire.Cli.EndToEnd.Tests (49)
ProjectReferenceTests.cs (11)
70var settingsPath = Path.Combine(workDir, ".aspire", "settings.json");
76var integrationDir = Path.Combine(workDir, "MyIntegration");
79File.WriteAllText(Path.Combine(integrationDir, "MyIntegration.csproj"), $$"""
95var aspireHome = Path.Combine(
97var hivesDir = Path.Combine(aspireHome, "hives");
104var packagesDir = Path.Combine(hiveDir, "packages");
107var hiveName = Path.GetFileName(hiveDir);
120File.WriteAllText(Path.Combine(workDir, "nuget.config"), nugetConfig);
123File.WriteAllText(Path.Combine(integrationDir, "MyIntegrationExtensions.cs"), """
154var modulesDir = Path.Combine(workDir, ".modules");
161File.WriteAllText(Path.Combine(workDir, "apphost.ts"), """
Aspire.Cli.Tests (858)
Agents\CopilotCliAgentEnvironmentScannerTests.cs (8)
57var mcpConfigPath = Path.Combine(copilotFolder.FullName, "mcp-config.json");
110var mcpConfigPath = Path.Combine(copilotFolder.FullName, "mcp-config.json");
150var mcpConfigPath = Path.Combine(copilotFolder.FullName, "mcp-config.json");
154var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".github", "skills", "aspire", "SKILL.md");
155Directory.CreateDirectory(Path.GetDirectoryName(skillFilePath)!);
237var mcpConfigPath = Path.Combine(copilotFolder.FullName, "mcp-config.json");
265var mcpConfigPath = Path.Combine(copilotFolder.FullName, "mcp-config.json");
290var mcpConfigPath = Path.Combine(copilotFolder.FullName, "mcp-config.json");
Agents\PlaywrightCliInstallerTests.cs (46)
19var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}");
112var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
114var tarballPath = Path.Combine(tempDir, "package.tgz");
142var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
144var tarballPath = Path.Combine(tempDir, "package.tgz");
182var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
184var tarballPath = Path.Combine(tempDir, "package.tgz");
217var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
219var tarballPath = Path.Combine(tempDir, "package.tgz");
257var tempPath = Path.GetTempFileName();
277var tempPath = Path.GetTempFileName();
293var tempPath = Path.GetTempFileName();
329var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
331var tarballPath = Path.Combine(tempDir, "package.tgz");
406var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-mirror-test-{Guid.NewGuid():N}");
412var primarySkillDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli");
414await File.WriteAllTextAsync(Path.Combine(primarySkillDir, "SKILL.md"), "# Playwright CLI Skill");
415Directory.CreateDirectory(Path.Combine(primarySkillDir, "subdir"));
416await File.WriteAllTextAsync(Path.Combine(primarySkillDir, "subdir", "extra.md"), "Extra content");
439context.AddSkillBaseDirectory(Path.Combine(".claude", "skills"));
440context.AddSkillBaseDirectory(Path.Combine(".github", "skills"));
441context.AddSkillBaseDirectory(Path.Combine(".opencode", "skill"));
446Assert.True(File.Exists(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "SKILL.md")));
447Assert.True(File.Exists(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "subdir", "extra.md")));
448Assert.Equal("# Playwright CLI Skill", await File.ReadAllTextAsync(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "SKILL.md")));
451Assert.True(File.Exists(Path.Combine(tempDir, ".opencode", "skill", "playwright-cli", "SKILL.md")));
452Assert.True(File.Exists(Path.Combine(tempDir, ".opencode", "skill", "playwright-cli", "subdir", "extra.md")));
466var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-sync-test-{Guid.NewGuid():N}");
467var sourceDir = Path.Combine(tempDir, "source");
468var targetDir = Path.Combine(tempDir, "target");
474File.WriteAllText(Path.Combine(sourceDir, "keep.md"), "keep");
478File.WriteAllText(Path.Combine(targetDir, "keep.md"), "old content");
479File.WriteAllText(Path.Combine(targetDir, "stale.md"), "should be removed");
480Directory.CreateDirectory(Path.Combine(targetDir, "stale-dir"));
481File.WriteAllText(Path.Combine(targetDir, "stale-dir", "old.md"), "should be removed");
486Assert.Equal("keep", File.ReadAllText(Path.Combine(targetDir, "keep.md")));
489Assert.False(File.Exists(Path.Combine(targetDir, "stale.md")));
490Assert.False(Directory.Exists(Path.Combine(targetDir, "stale-dir")));
Caching\DiskCacheTests.cs (10)
20var hives = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
21var cacheDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache"));
22var ctx = new CliExecutionContext(workspace.WorkspaceRoot, hives, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
72var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search");
118var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search");
123var nameNoExt = Path.GetFileNameWithoutExtension(current);
127var oldName = Path.Combine(diskPath, $"{hash}.{oldUnix}.json");
Commands\AgentMcpCommandTests.cs (5)
161AppHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
231AppHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
308AppHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
424AppHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
510AppHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\ConfigCommandTests.cs (13)
71var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
94var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
119var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
153var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
273var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
437var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
469var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
500var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
531var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
545var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
547var settingsPath = Path.Combine(settingsDir, "settings.json");
578var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
580var settingsPath = Path.Combine(settingsDir, "settings.json");
Commands\PsCommandTests.cs (5)
110AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
126AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"),
205AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
286AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
340AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
Commands\RunCommandTests.cs (43)
151var logsDirectory = Path.Combine(Path.GetTempPath(), "aspire-cli-tests");
156var fileName = Path.GetFileName(path);
465$"{InteractionServiceStrings.BuildingAppHost} src{Path.DirectorySeparatorChar}MyApp.AppHost{Path.DirectorySeparatorChar}MyApp.AppHost.csproj",
474var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost");
476var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj");
937var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
947workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
987var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
997workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
1033var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1043workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
1083var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1093workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
1128var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1138workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
1174var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1184workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
1220var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1230workingDirectory: workspace.WorkspaceRoot, hivesDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("hives"), cacheDirectory: workspace.WorkspaceRoot.CreateSubdirectory(".aspire").CreateSubdirectory("cache"), sdksDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory: new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), logFilePath: "test.log"
1361var originalSecretsDir = Path.GetDirectoryName(originalSecretsPath)!;
Commands\UpdateCommandTests.cs (22)
85var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
86var oldBackup1 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
87var oldBackup2 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.9876543210");
88var otherFile = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.something");
111var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
112var oldBackup = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
140var nonExistentPath = Path.Combine("C:", "NonExistent", "aspire.exe");
152var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
222return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
295return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
381var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
428var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
469var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
503return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
570return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
637return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
697return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
775return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
820return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
932var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
977var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
1010var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
DotNet\DotNetCliRunnerTests.cs (39)
24var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
25return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
32var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
72var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
101var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
140var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
169var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
198var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
236var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
277var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
355var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
395var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
437var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
484var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
532var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
584var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
644var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
708var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
713var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj"));
717var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj"));
737invocationOptions.StandardOutputCallback?.Invoke($"Project1{Path.DirectorySeparatorChar}Project1.csproj");
738invocationOptions.StandardOutputCallback?.Invoke($"Project2{Path.DirectorySeparatorChar}Project2.csproj");
755var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
758var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj"));
788var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
834var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
879var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
924var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
975var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1024var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1072var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1108var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1287var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1325var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1363var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1403var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Interaction\ConsoleInteractionServiceTests.cs (120)
27var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
40var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
61var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
86var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
111var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
142var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
169var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
194var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
221var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
240var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
254var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
269var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
284var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
306var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
339var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
372var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
399var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
426var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
455var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
484var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
511var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
538var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
564var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
591var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
619var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
646var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
674var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
701var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
730var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log", debugMode: true);
759var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
Mcp\ListAppHostsToolTests.cs (8)
47var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost");
111var inScopeAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "InScopeAppHost");
169var hivesDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "hives"));
170var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
171return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
NuGet\NuGetPackagePrefetcherTests.cs (6)
16var hivesDir = new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "hives"));
17var cacheDir = new DirectoryInfo(Path.Combine(workingDir.FullName, ".aspire", "cache"));
18var executionContext = new CliExecutionContext(workingDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
Packaging\NuGetConfigMergerSnapshotTests.cs (36)
47var path = Path.Combine(dir.FullName, "nuget.config");
65var cacheDir = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
66var executionContext = new CliExecutionContext(root, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
87var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
94var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
115var cacheDir2 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
116var executionContext = new CliExecutionContext(root, hivesDir, cacheDir2, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
150var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
157var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
178var cacheDir3 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
179var executionContext = new CliExecutionContext(root, hivesDir, cacheDir3, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
212var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
219var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
240var cacheDir4 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
241var executionContext = new CliExecutionContext(root, hivesDir, cacheDir4, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
272var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
279var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
300var cacheDir5 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
301var executionContext = new CliExecutionContext(root, hivesDir, cacheDir5, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
337var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
344var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
Packaging\NuGetConfigMergerTests.cs (16)
24var path = Path.Combine(dir.FullName, "nuget.config");
66var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
90var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
134var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
173var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
213var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
323var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
373var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
442var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
508var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config"));
581var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
611var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
661var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
683var originalContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "nuget.config")).DefaultTimeout();
704var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
726var targetConfigPath = Path.Combine(root.FullName, "nuget.config");
Packaging\PackagingServiceTests.cs (133)
46var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
47var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
48var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
81var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
82var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
83var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
125var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
126var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
127var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
158var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
159var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
160var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
191var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
192var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
193var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
223var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
224var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
225var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
254var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
255var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
256var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
285var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
286var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
287var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
316var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
317var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
318var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
358new CliExecutionContext(tempDir, tempDir, tempDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log"),
370var nugetConfigPath = Path.Combine(tempDir.FullName, "nuget.config");
394var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
395var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
399Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-10167"));
400Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-11832"));
402var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
451var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
452var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
456Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-12345"));
458var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
492var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
493var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
494var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
528var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
529var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
530var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
564var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
565var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
566var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
616new CliExecutionContext(tempDir, tempDir, tempDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log"),
628var nugetConfigPath = Path.Combine(tempDir.FullName, "nuget.config");
645var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
646var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
647var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
678var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
679var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
680var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
709var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
710var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
711var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
754var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
755var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
756var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
807var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
808var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
809var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
859var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
860var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
861var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
Projects\FallbackProjectParserTests.cs (15)
25var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
47var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
72var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
97var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
122var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
148var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
168var tempPath = Path.GetTempPath().Replace("\\", "/");
187var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj");
209var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
233var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
263var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
286var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
310var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
333var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs");
355var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.txt");
Projects\ProjectLocatorTests.cs (54)
28var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
29return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
37var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
55var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
59var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
63var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
68appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
89var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
93var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
97var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
102appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
120var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
125var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
161var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
165var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
168var relativePath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName);
169var forwardSlashPath = relativePath.Replace(Path.DirectorySeparatorChar, '/');
191var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj"));
194var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj"));
209var appHostProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
212var webProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebProject.csproj"));
255var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectFileExtension}"));
270var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
287var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
296var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
307var settingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"));
325var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
350var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
376var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs"));
386var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj"));
391var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs"));
431var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
451var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj"));
456var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs"));
492var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
516var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
537var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
548var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj"));
563var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt"));
583var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
588var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
697var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj"));
751var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj"));
753var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj"));
788var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs"));
816var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj"));
855var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj"));
860var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.cs"));
898var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj"));
902var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs"));
940var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs"));
Projects\ProjectUpdaterTests.cs (54)
30var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
33var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
36var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
140var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
143var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
146var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
271var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
274var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
277var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
421var sharedProjectFile = new FileInfo(Path.Combine(sharedProjectFolder.FullName, "SharedProject.csproj"));
424var projectAFile = new FileInfo(Path.Combine(projectAFolder.FullName, "ProjectA.csproj"));
427var projectBFile = new FileInfo(Path.Combine(projectBFolder.FullName, "ProjectB.csproj"));
430var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "DiamondTest.AppHost.csproj"));
554var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
557var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
559var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
690var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
692var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
792var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
794var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
895var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
896return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
925var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
927var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1038var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1040var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1162var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1164var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1276var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1278var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1387var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1481var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1483var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1583var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1662var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1744var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
1827var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
1909var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1995var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2073var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2151var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2258var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2260var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
2382var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2410var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2437var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2469var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2500var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2528var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2559var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
2577var directoryPackagesPropsFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props");
Templating\DotNetTemplateFactoryTests.cs (21)
59var path = Path.Combine(dir.FullName, "nuget.config");
84var nugetConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
116var nugetConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
129var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
154var parentConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
160var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
173var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
196var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
210var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
223var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
227var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
240var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
249var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
250var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
261var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
270var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config");
271var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
373var executionContext = new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), "test.log");
Utils\AppHostHelperTests.cs (25)
14var appHostPath = Path.Combine("path", "to", "MyApp.AppHost.csproj");
15var homeDirectory = Path.Combine(Path.GetTempPath(), "testuser");
21var fileName = Path.GetFileName(socketPrefix);
25var dir = Path.GetDirectoryName(socketPrefix);
75var fileName = Path.GetFileName(socketPrefix);
91var fileName = Path.GetFileName(socketPrefix);
209var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
216var hash = Path.GetFileName(prefix)["auxi.sock.".Length..];
219var socket1 = Path.Combine(backchannelsDir, $"auxi.sock.{hash}.12345");
220var socket2 = Path.Combine(backchannelsDir, $"auxi.sock.{hash}.67890");
225var otherSocket = Path.Combine(backchannelsDir, "auxi.sock.differenthash123.99999");
240var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
247var hash = Path.GetFileName(prefix)["auxi.sock.".Length..];
250var oldFormatSocket = Path.Combine(backchannelsDir, $"auxi.sock.{hash}");
254var newFormatSocket = Path.Combine(backchannelsDir, $"auxi.sock.{hash}.12345");
269var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
276var hash = Path.GetFileName(prefix)["auxi.sock.".Length..];
279var similarSocket = Path.Combine(backchannelsDir, $"auxi.sock.{hash}xyz.12345");
292var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
298var otherSocket = Path.Combine(backchannelsDir, "auxi.sock.differenthash123.99999");
310var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels");
320var oldFormatSocket = Path.Combine(backchannelsDir, $"auxi.sock.{hash}");
325var orphanedSocket = Path.Combine(backchannelsDir, $"auxi.sock.{hash}.{deadPid}");
330var liveSocket = Path.Combine(backchannelsDir, $"auxi.sock.{hash}.{currentPid}");
Utils\CliTestHelper.cs (10)
72var globalSettingsFilePath = Path.Combine(options.WorkingDirectory.FullName, ".aspire", "settings.global.json");
82var testLogsDirectory = Path.Combine(options.WorkingDirectory.FullName, ".aspire", "logs");
238var hivesDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "hives"));
239var cacheDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "cache"));
240var logsDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "logs"));
241var logFilePath = Path.Combine(logsDirectory.FullName, "test.log");
242return new CliExecutionContext(WorkingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory, logFilePath);
324var globalSettingsFilePath = Path.Combine(workingDirectory.FullName, ".aspire", "settings.global.json");
496var tmpDirectory = new DirectoryInfo(Path.Combine(executionContext.WorkingDirectory.FullName, "tmp"));
Utils\FileSystemHelperTests.cs (51)
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");
Aspire.Components.Common.TestUtilities (1)
Aspire.Dashboard (7)
Aspire.Dashboard.Tests (19)
Aspire.Deployment.EndToEnd.Tests (69)
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");
80var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName);
83sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath);
88string workloadsProjString = Path.Combine("tests", "workloads.proj");
99.Split(Path.PathSeparator)
100.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
106sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
112BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping");
122.Split(Path.PathSeparator)
123.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
129sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
139string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath);
145sdkForTemplatePath = Path.Combine(baseDir, sdkDirName);
160sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath);
162NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null;
170EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}";
189DotNet = Path.Combine(sdkForTemplatePath!, "dotnet");
197LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath);
202LogRootPath = 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 (166)
Dashboard\DashboardEventHandlers.cs (20)
121if (string.Equals(".dll", Path.GetExtension(assemblyPath), StringComparison.OrdinalIgnoreCase))
123runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json");
129var directory = Path.GetDirectoryName(assemblyPath)!;
130var fileName = Path.GetFileName(assemblyPath);
131var baseName = Path.GetExtension(fileName) switch
133".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe
136runtimeConfigPath = Path.Combine(directory, $"{baseName}.runtimeconfig.json");
192if (string.Equals(".dll", Path.GetExtension(dashboardPath), StringComparison.OrdinalIgnoreCase))
195originalRuntimeConfig = Path.ChangeExtension(dashboardPath, ".runtimeconfig.json");
201var directory = Path.GetDirectoryName(dashboardPath)!;
202var fileName = Path.GetFileName(dashboardPath);
203var baseName = Path.GetExtension(fileName) switch
205".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe
208originalRuntimeConfig = Path.Combine(directory, $"{baseName}.runtimeconfig.json");
286var fullyQualifiedDashboardPath = Path.GetFullPath(dashboardPath);
287var dashboardWorkingDirectory = Path.GetDirectoryName(fullyQualifiedDashboardPath);
308if (string.Equals(".dll", Path.GetExtension(fullyQualifiedDashboardPath), StringComparison.OrdinalIgnoreCase))
315var directory = Path.GetDirectoryName(fullyQualifiedDashboardPath)!;
316var fileName = Path.GetFileName(fullyQualifiedDashboardPath);
320dashboardDll = Path.Combine(directory, $"{baseName}.dll");
Dcp\DcpExecutor.cs (16)
58private static readonly string s_macOSUserDevCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "dev-certs", "https");
1455exe.Spec.WorkingDirectory = Path.GetDirectoryName(projectMetadata.ProjectPath);
1730var certificatesRootDir = Path.Join(_locations.DcpSessionDir, exe.Name());
1731var bundleOutputPath = Path.Join(certificatesRootDir, "cert.pem");
1732var certificatesOutputPath = Path.Join(certificatesRootDir, "certs");
1733var baseServerAuthOutputPath = Path.Join(certificatesRootDir, "private");
1746dirs.AddRange(existing.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries));
1754CertificateDirectoriesPath = ReferenceExpression.Create($"{string.Join(Path.PathSeparator, dirs)}"),
1759CertificatePath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{cert.Thumbprint}.crt")}"),
1760KeyPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{cert.Thumbprint}.key")}"),
1761PfxPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{cert.Thumbprint}.pfx")}"),
1803File.WriteAllText(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.crt"), publicCetificatePem);
1810File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.key"), keyBytes);
1818File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.pfx"), pfxBytes);
2752var keyFileName = Path.Join(s_macOSUserDevCertificateLocation, $"{lookup}.key");
2825var pfxFileName = Path.Join(s_macOSUserDevCertificateLocation, $"{lookup}.pfx");
Aspire.Hosting.Analyzers.Tests (1)
Aspire.Hosting.Azure (15)
Aspire.Hosting.Azure.Functions (8)
Aspire.Hosting.Azure.Kusto.Tests (3)
Aspire.Hosting.Azure.Tests (48)
AzureEnvironmentResourceTests.cs (14)
34var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
38var envBicepPath = Path.Combine(tempDir.FullName, "env", "env.bicep");
71var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
122var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
170var mainBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "main.bicep"));
171var storageBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "storage", "storage.bicep"));
204var mainBicepPath = Path.Combine(tempDir.Path, "main.bicep");
209var includedStorageBicepPath = Path.Combine(tempDir.Path, "included-storage", "included-storage.bicep");
213var excludedStorageBicepPath = Path.Combine(tempDir.Path, "excluded-storage", "excluded-storage.bicep");
235var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile");
259var bicepFilePath = Path.Combine(tempDir, bicepFileName);
278var outputDir = Path.Combine(tempDir, "output");
295var mainBicepPath = Path.Combine(outputDir, "main.bicep");
298var resourceBicepPath = Path.Combine(outputDir, "custom-resource", "custom-resource.bicep");
Aspire.Hosting.CodeGeneration.Go (2)
Aspire.Hosting.CodeGeneration.Go.Tests (2)
Aspire.Hosting.CodeGeneration.Java (1)
Aspire.Hosting.CodeGeneration.Java.Tests (2)
Aspire.Hosting.CodeGeneration.Python (3)
Aspire.Hosting.CodeGeneration.Python.Tests (2)
Aspire.Hosting.CodeGeneration.Rust (2)
Aspire.Hosting.CodeGeneration.Rust.Tests (2)
Aspire.Hosting.CodeGeneration.TypeScript (2)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (2)
Aspire.Hosting.Containers.Tests (12)
Aspire.Hosting.Docker (11)
Aspire.Hosting.Docker.Tests (49)
DockerComposePublisherTests.cs (36)
97var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
98var envPath = Path.Combine(tempDir.Path, ".env");
134var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
135var envPath = Path.Combine(tempDir.Path, ".env");
162var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
191var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
240var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
242var envPath = Path.Combine(tempDir.Path, ".env");
253var envFilePath = Path.Combine(tempDir.Path, ".env");
284var envFilePath = Path.Combine(tempDir.Path, ".env");
339var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
365var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
397var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
426var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
452var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
480var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
512var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
537var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile");
561var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
588var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, ".env.Production"));
617var envFilePath = Path.Combine(tempDir.Path, ".env.Staging");
651var envFileContent = await File.ReadAllTextAsync(Path.Combine(tempDir.Path, ".env.Production"));
673var envFilePath = Path.Combine(tempDir.Path, ".env.Production");
707var envFilePath = Path.Combine(tempDir.Path, ".env.Staging");
738var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
739var envPath = Path.Combine(tempDir.Path, ".env");
765var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
796var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
797var envPath = Path.Combine(tempDir.Path, ".env");
823envVar.DefaultValue = "./" + Path.GetFileName(mount.Source);
835var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
836var envPath = Path.Combine(tempDir.Path, ".env");
883var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
884var envPath = Path.Combine(tempDir.Path, ".env");
917var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
918var envPath = Path.Combine(tempDir.Path, ".env");
Aspire.Hosting.Garnet.Tests (4)
Aspire.Hosting.JavaScript (29)
JavaScriptHostingExtensions.cs (26)
119appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
151if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
255if (File.Exists(Path.Combine(appDirectory, "package.json")))
332appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
386if (File.Exists(Path.Combine(appDirectory, "Dockerfile")))
507appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
579var candidatePath = Path.GetFullPath(Path.Join(appDirectory, configFile));
593var absoluteConfigPath = Path.GetFullPath(configTarget, appDirectory);
595var relativeConfigPath = Path.GetRelativePath(Path.Join(appDirectory, "node_modules", ".bin"), absoluteConfigPath);
601var aspireConfigPath = Path.Join(appDirectory, "node_modules", ".bin", $"aspire.{Path.GetFileName(configTarget)}");
729var hasBunLock = File.Exists(Path.Combine(workingDirectory, "bun.lock")) ||
730File.Exists(Path.Combine(workingDirectory, "bun.lockb"));
735if (File.Exists(Path.Combine(workingDirectory, "bun.lock")))
739if (File.Exists(Path.Combine(workingDirectory, "bun.lockb")))
776File.Exists(Path.Combine(resource.Resource.WorkingDirectory, "package-lock.json"))
792var hasYarnLock = File.Exists(Path.Combine(workingDirectory, "yarn.lock"));
793var hasYarnrc = File.Exists(Path.Combine(workingDirectory, ".yarnrc.yml"));
794var hasYarnBerryDir = Directory.Exists(Path.Combine(workingDirectory, ".yarn"));
866var hasPnpmLock = File.Exists(Path.Combine(workingDirectory, "pnpm-lock.yaml"));
1016var nvmrcPath = Path.Combine(workingDirectory, ".nvmrc");
1028var nodeVersionPath = Path.Combine(workingDirectory, ".node-version");
1040var packageJsonPath = Path.Combine(workingDirectory, "package.json");
1065var toolVersionsPath = Path.Combine(workingDirectory, ".tool-versions");
Aspire.Hosting.JavaScript.Tests (65)
AddJavaScriptAppTests.cs (9)
20var appDir = Path.Combine(tempDir.Path, "js");
29var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile");
58var appDir = Path.Combine(tempDir.Path, "js");
63File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), string.Empty);
72var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile");
87var appDir = Path.Combine(tempDir.Path, "pnpm-app");
100await File.WriteAllTextAsync(Path.Combine(appDir, "package.json"), packageJson);
108var dockerfilePath = Path.Combine(tempDir.Path, "pnpm-app.Dockerfile");
120var dockerfileInContext = Path.Combine(appDir, "Dockerfile");
AddNodeAppTests.cs (18)
92var appDir = Path.Combine(tempDir.Path, "js");
97File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
98File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "{}");
105var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile");
160var appDir = Path.Combine(tempDir.Path, "js");
162File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
174var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile");
207var appDir = Path.Combine(tempDir.Path, "js");
209File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
220var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "js.Dockerfile"));
229File.WriteAllText(Path.Combine(tempDir.Path, "app.js"), "{}");
256File.WriteAllText(Path.Combine(tempDir.Path, "package.json"), "{}");
329File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent);
330File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent);
355var nodeDockerfilePath = Path.Combine(outputDir.Path, "nodeapp.Dockerfile");
385File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent);
386File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent);
411var nodeDockerfilePath = Path.Combine(outputDir.Path, "nodeapp.Dockerfile");
AddViteAppTests.cs (27)
22var viteDir = Path.Combine(tempDir.Path, "vite");
26File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty");
57var dockerfilePath = Path.Combine(tempDir.Path, "vite.Dockerfile");
91File.WriteAllText(Path.Combine(tempDir.Path, "package.json"), packageJson);
99var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
111File.WriteAllText(Path.Combine(tempDir.Path, ".nvmrc"), "18.20.0");
119var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
131File.WriteAllText(Path.Combine(tempDir.Path, ".node-version"), "v21.5.0");
139var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
156File.WriteAllText(Path.Combine(tempDir.Path, ".tool-versions"), toolVersions);
164var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
182var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
198File.WriteAllText(Path.Combine(tempDir.Path, ".nvmrc"), versionString);
206var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
228var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
286var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin");
290var viteConfigPath = Path.Combine(tempDir.Path, "vite.config.js");
347var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin");
351var viteConfigPath = Path.Combine(tempDir.Path, "vite.config.js");
451var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin");
455var viteConfigPath = Path.Combine(tempDir.Path, "vite.config.js");
506var subDir = Path.Combine(tempDir.Path, "my-app", "frontend");
510var nodeModulesBinDir = Path.Combine(subDir, "node_modules", ".bin");
514var viteConfigPath = Path.Combine(subDir, "vite.config.js");
562var absoluteConfigPath = Path.GetFullPath(viteConfigPath);
585var nodeModulesBinDir = Path.Combine(tempDir.Path, "node_modules", ".bin");
589var viteConfigPath = Path.Combine(tempDir.Path, configFileName);
PackageInstallationTests.cs (8)
458File.WriteAllText(Path.Combine(tempDir.Path, "package-lock.json"), "empty");
485File.WriteAllText(Path.Combine(tempDir.Path, "yarn.lock"), "empty");
506File.WriteAllText(Path.Combine(tempDir.Path, "yarn.lock"), "empty");
507File.WriteAllText(Path.Combine(tempDir.Path, ".yarnrc.yml"), "empty");
522File.WriteAllText(Path.Combine(tempDir.Path, "yarn.lock"), "empty");
523Directory.CreateDirectory(Path.Combine(tempDir.Path, ".yarn", "releases"));
538File.WriteAllText(Path.Combine(tempDir.Path, "pnpm-lock.yaml"), "empty");
553File.WriteAllText(Path.Combine(tempDir.Path, "bun.lock"), "empty");
Aspire.Hosting.Kafka.Tests (4)
Aspire.Hosting.Keycloak (2)
Aspire.Hosting.Keycloak.Tests (8)
Aspire.Hosting.Kubernetes (5)
Aspire.Hosting.Kubernetes.Tests (19)
Aspire.Hosting.Maui (9)
Aspire.Hosting.Maui.Tests (3)
Aspire.Hosting.Milvus.Tests (3)
Aspire.Hosting.MongoDB (1)
Aspire.Hosting.MongoDB.Tests (11)
Aspire.Hosting.MySql (1)
Aspire.Hosting.MySql.Tests (8)
Aspire.Hosting.Oracle (1)
Aspire.Hosting.Oracle.Tests (2)
Aspire.Hosting.PostgreSQL (1)
Aspire.Hosting.PostgreSQL.Tests (15)
Aspire.Hosting.Python (40)
PythonAppResourceBuilderExtensions.cs (33)
353var resource = createResource(name, "python", Path.GetFullPath(appDirectory, builder.AppHostDirectory));
424if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
500var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
502if (File.Exists(Path.Combine(appDirectoryFullPath, "pyproject.toml")) ||
503File.Exists(Path.Combine(appDirectoryFullPath, "requirements.txt")))
522var uvLockPath = Path.Combine(resource.WorkingDirectory, "uv.lock");
631var requirementsTxtPath = Path.Combine(resource.WorkingDirectory, "requirements.txt");
671var pyprojectTomlPath = Path.Combine(resource.WorkingDirectory, "pyproject.toml");
749var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
753var appHostParentDirectory = Path.GetDirectoryName(builder.AppHostDirectory);
759var relativePath = Path.GetRelativePath(appHostParentDirectory, appDirectoryFullPath);
761!Path.IsPathRooted(relativePath);
766return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath);
774var venvPath = Path.Combine(currentDirectory, virtualEnvironmentPath);
792var parentDirectory = Path.GetDirectoryName(currentDirectory);
804return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath);
858var resolvedPath = Path.IsPathRooted(virtualEnvironmentPath)
860: Path.GetFullPath(virtualEnvironmentPath, builder.Resource.WorkingDirectory);
932programPath = Path.GetFullPath(entrypoint, builder.Resource.WorkingDirectory);
951var venvPath = Path.IsPathRooted(annotation.VirtualEnvironment.VirtualEnvironmentPath)
953: Path.GetFullPath(annotation.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
957interpreterPath = Path.Join(venvPath, "Scripts", "python.exe");
961interpreterPath = Path.Join(venvPath, "bin", "python");
1155if (File.Exists(Path.Combine(workingDirectory, "pyproject.toml")))
1160else if (File.Exists(Path.Combine(workingDirectory, "requirements.txt")))
1264foreach (var directory in pathVariable.Split(Path.PathSeparator))
1266var fullPath = Path.Combine(directory, commandWithExt);
1277foreach (var directory in pathVariable.Split(Path.PathSeparator))
1279var fullPath = Path.Combine(directory, command);
1371var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath)
1373: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
1506var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath)
1508: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
Aspire.Hosting.Python.Tests (136)
AddPythonAppTests.cs (127)
28var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
32options.ProjectDirectory = Path.GetFullPath(projectDirectory);
66var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
70options.ProjectDirectory = Path.GetFullPath(projectDirectory);
166Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
170Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
205Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
209Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
248Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
252Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
266var projectDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
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, tempDir.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(tempVenvDir.Path, "Scripts", "python.exe"), pythonProjectResource.Command);
458Assert.Equal(Path.Join(tempVenvDir.Path, "bin", "python"), pythonProjectResource.Command);
531var appVenvPath = Path.Combine(tempAppDir.Path, ".venv");
544var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempAppDir.Path));
545var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv");
558var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
562var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
600var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
604var appVenvPath = Path.Combine(appDirPath, ".venv");
607var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
656var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempAppDir.Path));
657var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv");
669var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
673var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
677var customVenvPath = Path.Combine(appDirPath, "custom-venv");
729var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
979var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
984Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
988Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
1013var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
1017Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
1021Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
1047var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
1051Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", $"{executableName}.exe"), pythonProjectResource.Command);
1055Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", executableName), pythonProjectResource.Command);
1259File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1260File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent);
1261File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1263var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
1282var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1285var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile");
1288var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile");
1324File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1326File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1328var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
1347var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1350var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile");
1353var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile");
1386var appDirectory = Path.Combine(tempDir.Path, "myapp");
1388var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1424var appDirectory = Path.Combine(tempDir.Path, "myapp");
1426var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1464var appDirectory = Path.Combine(tempDir.Path, "myapp");
1466var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1501var appDirectory = Path.Combine(tempDir.Path, "myapp");
1503var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1534var appDirectory = Path.Combine(tempDir.Path, "myapp");
1536var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1642File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1643File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent);
1644File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1659var dockerfilePath = Path.Combine(outputDir.Path, "custom-images-app.Dockerfile");
1688File.WriteAllText(Path.Combine(projectDirectory, "requirements.txt"), requirementsContent);
1689File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1700var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1737File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1738File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1749var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1769File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1780var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1802File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1803File.WriteAllText(Path.Combine(projectDirectory, ".python-version"), pythonVersionContent);
1816var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1819var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile");
1822var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile");
1851var scriptPath = Path.Combine(tempDir.Path, scriptName);
1855var pyprojectPath = Path.Combine(tempDir.Path, "pyproject.toml");
1885var scriptPath = Path.Combine(tempDir.Path, scriptName);
1889var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
1920var scriptPath = Path.Combine(tempDir.Path, scriptName);
1924var pyprojectPath = Path.Combine(tempDir.Path, "pyproject.toml");
1926var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
1950var scriptPath = Path.Combine(tempDir.Path, scriptName);
1974var scriptPath = Path.Combine(tempDir.Path, scriptName);
1997var scriptPath = Path.Combine(tempDir.Path, scriptName);
2001var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2025var scriptPath = Path.Combine(tempDir.Path, scriptName);
2029var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2054var scriptPath = Path.Combine(tempDir.Path, "main.py");
2082var scriptPath = Path.Combine(tempDir.Path, "main.py");
2086var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2125var scriptPath = Path.Combine(tempDir.Path, "main.py");
2128var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2155var scriptPath = Path.Combine(tempDir.Path, "main.py");
2158var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2189var scriptPath = Path.Combine(tempDir.Path, "main.py");
2192var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2225var scriptPath = Path.Combine(tempDir.Path, "main.py");
2228var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2255var scriptPath = Path.Combine(tempDir.Path, "main.py");
2258var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2287var scriptPath = Path.Combine(tempDir.Path, "main.py");
2290var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2319var scriptPath = Path.Combine(tempDir.Path, "main.py");
2322var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2355var scriptPath = Path.Combine(tempDir.Path, "main.py");
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.Redis.Tests (4)
Aspire.Hosting.Seq.Tests (4)
Aspire.Hosting.SqlServer (1)
Aspire.Hosting.SqlServer.Tests (3)
Aspire.Hosting.Testing (2)
Aspire.Hosting.Testing.Tests (6)
Aspire.Hosting.Tests (174)
Dashboard\DashboardLifecycleHookTests.cs (14)
275var tempDir = Path.GetTempFileName();
281var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
282var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
364var tempDir = Path.GetTempFileName();
370var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard.exe");
371var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
372var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
433var tempDir = Path.GetTempFileName();
439var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard");
440var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
441var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
502var tempDir = Path.GetTempFileName();
508var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
509var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
MSBuildTests.cs (27)
23var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
26File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
55File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
80var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
83File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
111File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
121var metadataDirectory = Path.Combine(appHostDirectory, "obj", "Debug", "net8.0", "Aspire", "references");
122var appHostMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "_AppHost.ProjectMetadata.g.cs"));
123var appMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "App.ProjectMetadata.g.cs"));
136.Replace(Path.DirectorySeparatorChar, '/');
150File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"),
160File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"),
175var libraryDirectory = Path.Combine(basePath, name);
178File.WriteAllText(Path.Combine(libraryDirectory, $"{name}.csproj"),
190File.WriteAllText(Path.Combine(libraryDirectory, "Class1.cs"),
202var appDirectory = Path.Combine(basePath, name);
205File.WriteAllText(Path.Combine(appDirectory, $"{name}.csproj"),
216File.WriteAllText(Path.Combine(appDirectory, "Program.cs"),
269var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
272File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
301File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
328var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
331File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
360File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
384var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
387File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
415File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
PathLookupHelperTests.cs (32)
15Path.Combine("/usr/bin", "mycommand")
22Assert.Equal(Path.Combine("/usr/bin", "mycommand"), result);
70Path.Combine("/first/path", "mycommand"),
71Path.Combine("/second/path", "mycommand")
78Assert.Equal(Path.Combine("/first/path", "mycommand"), result);
85var dir = Path.Combine("testdir", "bin");
86var expectedPath = Path.Combine(dir, "mycommand");
103var dir = Path.Combine("testdir", "bin");
104var expectedPath = Path.Combine(dir, "code.CMD");
122var dir = Path.Combine("testdir", "bin");
123var exePath = Path.Combine(dir, "code.EXE");
124var cmdPath = Path.Combine(dir, "code.CMD");
146var dir = Path.Combine("testdir", "bin");
147var exactPath = Path.Combine(dir, "code");
148var cmdPath = Path.Combine(dir, "code.CMD");
167var dir = Path.Combine("testdir", "bin");
168var exactPath = Path.Combine(dir, "mytool");
186var dir = Path.Combine("testdir", "bin");
187var expectedPath = Path.Combine(dir, "code.CMD");
205var dir = Path.Combine("testdir", "bin");
220var dir = Path.Combine("testdir", "bin");
221var cmdPath = Path.Combine(dir, "code.CMD");
243Path.Combine(dir, "code.cmd")
260Path.Combine(dir, "code.cmd")
277var dir1 = Path.Combine("first", "bin");
278var dir2 = Path.Combine("second", "bin");
279var dir1CmdPath = Path.Combine(dir1, "code.CMD");
280var dir2ExePath = Path.Combine(dir2, "code.EXE");
299var dir1 = Path.Combine("first", "bin");
300var dir2 = Path.Combine("second", "bin");
301var dir1ExactPath = Path.Combine(dir1, "mytool");
302var dir2ExePath = Path.Combine(dir2, "mytool.EXE");
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");
Aspire.Hosting.Valkey.Tests (4)
Aspire.Hosting.Yarp.Tests (3)
Aspire.Playground.Tests (6)
Aspire.Templates.Tests (74)
LocalhostTldHostnameTests.cs (4)
57"aspire-ts-cs-starter" or "aspire-starter" => Path.Combine(project.RootDir, $"{projectName}.AppHost", "Properties", "launchSettings.json"),
58"aspire" => Path.Combine(project.RootDir, $"{projectName}.AppHost", "Properties", "launchSettings.json"),
59"aspire-apphost" => Path.Combine(project.RootDir, "Properties", "launchSettings.json"),
60"aspire-apphost-singlefile" or "aspire-py-starter" => Path.Combine(project.RootDir, "apphost.run.json"),
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");
80var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName);
83sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath);
88string workloadsProjString = Path.Combine("tests", "workloads.proj");
99.Split(Path.PathSeparator)
100.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
106sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
112BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping");
122.Split(Path.PathSeparator)
123.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"))
129sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!;
139string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath);
145sdkForTemplatePath = Path.Combine(baseDir, sdkDirName);
160sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath);
162NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null;
170EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}";
189DotNet = Path.Combine(sdkForTemplatePath!, "dotnet");
197LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath);
202LogRootPath = 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.TestUtilities (3)
aspire-managed (20)
NuGet\Commands\LayoutCommand.cs (12)
109packagesPath = Path.Combine(
132var packagePath = Path.Combine(packagesPath, libraryName.ToLowerInvariant(), libraryVersion);
154var sourcePath = Path.Combine(packagePath, runtimeAssembly.Path.Replace('/', Path.DirectorySeparatorChar));
162var fileName = Path.GetFileName(sourcePath);
163var destPath = Path.Combine(outputPath, fileName);
179var xmlSourcePath = Path.ChangeExtension(sourcePath, ".xml");
182var xmlDestPath = Path.ChangeExtension(destPath, ".xml");
200var sourcePath = Path.Combine(packagePath, nativeLib.Path.Replace('/', Path.DirectorySeparatorChar));
208var fileName = Path.GetFileName(sourcePath);
209var destPath = Path.Combine(outputPath, fileName);
aspire-server (4)
AutobahnTestApp (1)
Binding.UDS.IntegrationTests (4)
blazor-devserver (6)
BoundTreeGenerator (1)
BuildActionTelemetryTable (6)
BuildBoss (48)
CompilerNuGetCheckerUtil.cs (15)
95var publishDataPath = Path.Combine(RepositoryDirectory, "eng", "config", "PublishData.json");
101var packagesDirectory = Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping");
104var packageFileName = Path.GetFileName(packageFullPath);
143FindNuGetPackage(Path.Combine(ArtifactsDirectory, "VSSetup", Configuration, "DevDivPackages"), "VS.Tools.Roslyn"),
161FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset.Arm64"),
170FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset.Framework"),
179FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset"),
215=> Path.Combine(ArtifactsDirectory, "bin", projectName, Configuration, tfm);
218=> Path.Combine(ArtifactsDirectory, "bin", projectName, Configuration, tfm, "publish");
254buildAssetRelativePath = Path.Combine(folderRelativePath, buildAssetRelativePath);
361var packageFilePath = FindNuGetPackage(Path.Combine(ArtifactsDirectory, "VSSetup", Configuration, "DevDivPackages"), "VS.ExternalAPIs.Roslyn");
384if (Path.GetExtension(name) is not (".dll" or ".exe"))
389foundDllNameSet.Add(Path.GetFileNameWithoutExtension(name));
431var fileName = Path.GetFileName(filePath);
441var directory = Path.Combine(ArtifactsDirectory, "VSSetup", Configuration);
BuildValidator (37)
CompilationDiff.cs (18)
219File.WriteAllText(Path.Combine(debugPath, "error.txt"), MiscErrorMessage);
227using var writer = new StreamWriter(Path.Combine(debugPath, "diagnostics.txt"), append: false);
237using var writer = new StreamWriter(Path.Combine(debugPath, "references.txt"), append: false);
282var originalDataFiles = createBuildArtifacts(Path.Combine(debugPath, "original"), assemblyFileName, originalInfo);
283var rebuildDataFiles = createBuildArtifacts(Path.Combine(debugPath, "rebuild"), assemblyFileName, rebuildInfo);
295File.WriteAllText(Path.Combine(debugPath, scriptName), $@"code --diff (Join-Path $PSScriptRoot ""{originalFilePath}"") (Join-Path $PSScriptRoot ""{rebuildFilePath}"")");
299var sourcesPath = Path.Combine(debugPath, "sources");
305var sourceFilePath = Path.Combine(sourcesPath, Path.GetFileName(tree.FilePath));
315var assemblyName = Path.GetFileNameWithoutExtension(assemblyFileName);
316var assemblyFilePath = Path.Combine(outputPath, assemblyFileName);
318AssemblyMdvFilePath: Path.Combine(outputPath, assemblyName + ".mdv"),
319PdbMdvFilePath: Path.Combine(outputPath, assemblyName + ".pdb.mdv"),
320ILFilePath: Path.Combine(outputPath, assemblyName + ".il"),
321PdbXmlFilePath: Path.Combine(outputPath, assemblyName + ".pdb.xml"),
322CustomDataFilePath: Path.Combine(outputPath, "custom-data.txt"));
330var pdbFilePath = Path.Combine(outputPath, assemblyName + ".extracted.pdb");
405writer.WriteLine($@"\t""{Path.GetFileName(info.SourceTextInfo.OriginalSourceFilePath)}"" - {hashString}");
CatalogService (1)
ClientSample (3)
CodeStyleConfigFileGenerator (4)
ConfigurationSchemaGenerator (1)
ConfigurationSchemaGenerator.Tests (2)
Crossgen2Tasks (53)
PrepareForReadyToRunCompilation.cs (21)
167var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath);
179outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb");
180outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb");
181crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\"";
202outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension);
203outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension);
204crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\"";
278MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec));
281compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, "r2r" + Path.GetExtension(compositeR2RImageRelativePath));
291compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".o");
292compositeR2RFinalImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".dylib");
295var compositeR2RImage = Path.Combine(OutputPath, compositeR2RImageRelativePath);
296var compositeR2RImageFinal = Path.Combine(OutputPath, compositeR2RFinalImageRelativePath);
314compositePDBImage = Path.ChangeExtension(compositeR2RImage, ".ni.pdb");
315compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb");
321compositePDBImage = Path.ChangeExtension(compositeR2RImage, perfmapExtension);
322compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension);
466bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec)));
467bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R;
471bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ResolveReadyToRunCompilers.cs (26)
299_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
300_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
301_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll");
306_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe");
307_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll");
308_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll");
315_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
316_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
317_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll");
327_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe");
328_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll");
329_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll");
334_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe");
335_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll");
338_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll");
342_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll");
352_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
353_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so");
358_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen");
359_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so");
368_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
369_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so");
380_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen");
381_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib");
416_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName);
423_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
csc (14)
CSharpSyntaxGenerator (5)
csi (3)
CustomEncryptorSample (1)
dotnet-dev-certs (37)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
dotnet-getdocument (14)
dotnet-openapi (15)
dotnet-razorpagegenerator (4)
dotnet-sql-cache (3)
dotnet-svcutil.xmlserializer (18)
dotnet-svcutil.xmlserializer.IntegrationTests (1)
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 (140)
E2ETests.cs (26)
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", "TypeNameUseReservedKeyword.wsdl");
GlobalToolTests.cs (35)
55var wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl");
90Directory.CreateDirectory(Path.Combine(this_TestCaseOutputDir, "SvcutilBootstrapper"));
92var uri = $"\"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}\"";
113File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.cs"), Path.Combine(this_TestCaseOutputDir, "FullFramework.cs"), true);
114File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.csproj"), Path.Combine(this_TestCaseOutputDir, "FullFramework.csproj"), true);
116var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl");
117var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
134this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testCaseName);
136this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName);
137this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{testCaseName}.log");
138this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testCaseName);
141File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, "Program.cs"), Path.Combine(this_TestCaseOutputDir, "Program.cs"), true);
142File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, $"{testCaseName}.csproj"), Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), true);
143this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), null, CancellationToken.None);
148var uri = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl");
149var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
162this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testClientFolder);
165this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName);
166this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{this_TestCaseName}.log");
167this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testClientFolder);
170FileUtil.CopyDirectory(Path.Combine(g_TestCasesDir, this_TestCaseName), this_TestGroupOutputDir, true);
171this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testClientFolder}.csproj"), null, CancellationToken.None);
178var uri = Path.Combine(g_TestCasesDir, "wsdl", "TypeReuseSvc.wsdl");
179var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference");
197var url = $"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}";
201var paramsFilePath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.params.json");
232var uri = Path.Combine(g_TestCasesDir, "TypeReuse", "TypeReuseIXmlSerializable.wsdl");
233var refs = Path.Combine(g_TestCasesDir, "TypeReuse", "CommonTypes.dll");
255var 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));
DotnetTool.AppHost (4)
dotnet-user-jwts (30)
dotnet-user-secrets (17)
FilesWebSite (10)
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 (48)
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);
GenerateRulesMissingDocumentation (3)
GetDocument.Insider (8)
HelixTestRunner (24)
TestRunner.cs (18)
36var nugetRestore = Path.Combine(helixDir, "nugetRestore");
38var dotnetEFFullPath = Path.Combine(nugetRestore, helixDir, "dotnet-ef.exe");
67DisplayContents(Path.Combine(Options.DotnetRoot, "host", "fxr"));
68DisplayContents(Path.Combine(Options.DotnetRoot, "shared", "Microsoft.NETCore.App"));
69DisplayContents(Path.Combine(Options.DotnetRoot, "shared", "Microsoft.AspNetCore.App"));
70DisplayContents(Path.Combine(Options.DotnetRoot, "packs", "Microsoft.AspNetCore.App.Ref"));
89ProcessUtil.PrintMessage(Path.GetFileName(file));
93ProcessUtil.PrintMessage(Path.GetFileName(file));
149var fileName = Path.GetFileNameWithoutExtension(efPackages[0]);
248var diagLog = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"), "vstest.log");
332var logName = $"{Path.GetFileName(Path.GetDirectoryName(file))}_{Path.GetFileName(file)}";
333ProcessUtil.PrintMessage($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, logName)}");
334File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, logName));
346var fileName = Path.GetFileName(file);
347ProcessUtil.PrintMessage($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName)}");
348File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName));
HttpClientApp (3)
HttpStress (4)
IdeBenchmarks (10)
IdeCoreBenchmarks (19)
IIS.FunctionalTests (38)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName);
75return Path.Combine(folder, $"W3SVC{result.DeploymentParameters.SiteName}");
92var destFileName = Path.Combine(target.FullName, fileInfo.Name);
99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config");
203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json");
226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"),
267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters));
48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName);
51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters));
72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS)
61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml");
65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
IIS.LongTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName);
75return Path.Combine(folder, $"W3SVC{result.DeploymentParameters.SiteName}");
92var destFileName = Path.Combine(target.FullName, fileInfo.Name);
99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config");
203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json");
226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"),
267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters));
48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName);
51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters));
72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS)
61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml");
65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));
214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll")));
215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger));
280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"),
281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"),
345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), "");
405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"));
616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path));
716Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory"));
742var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll");
743var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll");
962deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.Microbenchmarks (1)
IIS.NewHandler.FunctionalTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName);
75return Path.Combine(folder, $"W3SVC{result.DeploymentParameters.SiteName}");
92var destFileName = Path.Combine(target.FullName, fileInfo.Name);
99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config");
203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json");
226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"),
267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters));
48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName);
51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters));
72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS)
61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml");
65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));
214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll")));
215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger));
280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"),
281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"),
345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), "");
405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"));
616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path));
716Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory"));
742var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll");
743var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll");
962deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.ShadowCopy.Tests (47)
ShadowCopyTests.cs (26)
45var directoryName = Path.GetRandomFileName();
62var tempDirectoryPath = Path.Combine(deploymentResult.ContentRoot, directoryName);
188var deleteDirPath = Path.Combine(deploymentResult.ContentRoot, "wwwroot/deletethis");
190File.WriteAllText(Path.Combine(deleteDirPath, "file.dll"), "");
219DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true);
246DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true);
258Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped");
269Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "2")), "Expected 2 shadow copy directory");
286DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true);
287DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "3"), copySubDirs: true);
288DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "10"), copySubDirs: true);
300Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped");
311Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "11")), "Expected 11 shadow copy directory");
317Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "1")), "Expected 1 shadow copy directory to be deleted");
318Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "3")), "Expected 3 shadow copy directory to be deleted");
330DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true);
343Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy")));
345Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy")));
360DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true);
373Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy")));
375Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy")));
385var directoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
453string tempPath = Path.Combine(destDirName, file.Name);
466string tempPath = Path.Combine(destDirName, subdir.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName);
75return Path.Combine(folder, $"W3SVC{result.DeploymentParameters.SiteName}");
92var destFileName = Path.Combine(target.FullName, fileInfo.Name);
99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config");
203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json");
226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"),
267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters));
48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName);
51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters));
72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS)
61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml");
65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
IIS.Tests (5)
IISExpress.FunctionalTests (57)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName);
75return Path.Combine(folder, $"W3SVC{result.DeploymentParameters.SiteName}");
92var destFileName = Path.Combine(target.FullName, fileInfo.Name);
99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config");
203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" +
216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json");
226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"),
267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters));
48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName);
51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters));
72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));
214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll")));
215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger));
280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"),
281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"),
345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), "");
405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"));
616parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
624parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
632parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
640parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
648parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
656parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
687parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
696parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path));
716Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory"));
742var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll");
743var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll");
962deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
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 (1)
Infrastructure.Tests (141)
ExtractTestPartitions\ExtractTestPartitionsTests.cs (22)
30var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
36var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
55var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
61var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
76var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
82var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
100var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
103var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
118var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
125var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
143var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
150var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
166var nonExistentPath = Path.Combine(_tempDir.Path, "DoesNotExist.dll");
167var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
192var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
198var outputFile = Path.Combine(_tempDir.Path, "nested", "dir", "partitions.txt");
212var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
217var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
234var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
241var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
259var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
266var outputFile = Path.Combine(_tempDir.Path, "partitions.txt");
PowerShellScripts\BuildTestMatrixTests.cs (47)
22_scriptPath = Path.Combine(FindRepoRoot(), "eng", "scripts", "build-test-matrix.ps1");
32var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
36Path.Combine(artifactsDir, "MyProject.tests-metadata.json"),
41var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
62var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
66Path.Combine(artifactsDir, "ProjectA.tests-metadata.json"),
71Path.Combine(artifactsDir, "ProjectB.tests-metadata.json"),
75var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
94var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
98Path.Combine(artifactsDir, "SplitProject.tests-metadata.json"),
104Path.Combine(artifactsDir, "SplitProject.tests-partitions.json"),
107var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
135var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
139Path.Combine(artifactsDir, "ClassSplitProject.tests-metadata.json"),
145Path.Combine(artifactsDir, "ClassSplitProject.tests-partitions.json"),
148var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
171var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
176Path.Combine(artifactsDir, "NoTimeouts.tests-metadata.json"),
180var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
199var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
203Path.Combine(artifactsDir, "CustomTimeouts.tests-metadata.json"),
209var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
228var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
232Path.Combine(artifactsDir, "NeedsNugets.tests-metadata.json"),
238Path.Combine(artifactsDir, "NoNugets.tests-metadata.json"),
243var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
262var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
266Path.Combine(artifactsDir, "FilterTest.tests-metadata.json"),
271Path.Combine(artifactsDir, "FilterTest.tests-partitions.json"),
274var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
292var emptyArtifactsDir = Path.Combine(_tempDir.Path, "empty-artifacts");
295var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
312var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
316Path.Combine(artifactsDir, "SplitProject.tests-metadata.json"),
326Path.Combine(artifactsDir, "SplitProject.tests-partitions.json"),
329var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
357var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
361Path.Combine(artifactsDir, "SdkProject.tests-metadata.json"),
366var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
384var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
388Path.Combine(artifactsDir, "LinuxOnly.tests-metadata.json"),
393var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
412var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
416Path.Combine(artifactsDir, "OsRestrictedSplit.tests-metadata.json"),
423Path.Combine(artifactsDir, "OsRestrictedSplit.tests-partitions.json"),
426var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
466if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (41)
22_scriptPath = Path.Combine(FindRepoRoot(), "eng", "scripts", "expand-test-matrix-github.ps1");
38var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
41var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
65var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
68var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
91var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
94var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
115var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
118var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
141var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
144var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
168var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
171var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
199var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
202var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
238var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
241var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
266var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
269var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
283var nonExistentFile = Path.Combine(_tempDir.Path, "does-not-exist.json");
284var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
302var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
305var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
328var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
331var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
354var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
357var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
387var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
390var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
407var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
411Path.Combine(artifactsDir, "RegularProject.tests-metadata.json"),
417Path.Combine(artifactsDir, "SplitMultiOS.tests-metadata.json"),
424Path.Combine(artifactsDir, "SplitMultiOS.tests-partitions.json"),
428Path.Combine(artifactsDir, "LinuxE2E.tests-metadata.json"),
436Path.Combine(artifactsDir, "CliE2E.tests-metadata.json"),
445var buildMatrixScript = Path.Combine(FindRepoRoot(), "eng", "scripts", "build-test-matrix.ps1");
446var canonicalFile = Path.Combine(_tempDir.Path, "canonical.json");
456var expandedFile = Path.Combine(_tempDir.Path, "expanded.json");
461var splitScriptPath = Path.Combine(FindRepoRoot(), "eng", "scripts", "split-test-matrix-by-deps.ps1");
462var githubOutputFile = Path.Combine(_tempDir.Path, "github_output.txt");
592if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
PowerShellScripts\SplitTestProjectsTests.cs (12)
31_scriptPath = Path.Combine(_repoRoot, "eng", "scripts", "split-test-projects-for-ci.ps1");
41var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
47var outputFile = Path.Combine(_tempDir.Path, "partitions.json");
71var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
76var outputFile = Path.Combine(_tempDir.Path, "partitions.json");
99var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
105var outputFile = Path.Combine(_tempDir.Path, "partitions.json");
130var assemblyPath = Path.Combine(_tempDir.Path, "TestAssembly.dll");
137var outputFile = Path.Combine(_tempDir.Path, "partitions.json");
165var nonExistentPath = Path.Combine(_tempDir.Path, "DoesNotExist.dll");
166var outputFile = Path.Combine(_tempDir.Path, "partitions.json");
215if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
InMemory.FunctionalTests (5)
InProcessWebSite (2)
installer.tasks (10)
InteractiveHost.UnitTests (15)
Interop.FunctionalTests (13)
Http3\Http3TlsTests.cs (5)
418new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
444Directory.CreateDirectory(Path.GetDirectoryName(path));
519var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null;
520basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null);
521return Path.Combine(basePath, $"{typeof(Http3TlsTests).Assembly.GetName().Name}.pfx");
InteropTests (2)
InteropWebsite (2)
IOperationGenerator (3)
KeyManagementSample (1)
Metrics (31)
Metrics.Legacy (31)
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.Arcade.Test.Common (4)
Microsoft.AspNetCore (8)
Microsoft.AspNetCore.Analyzer.Testing (4)
Microsoft.AspNetCore.Analyzers.Test (1)
Microsoft.AspNetCore.App.Analyzers.Test (5)
Microsoft.AspNetCore.App.UnitTests (36)
TargetingPackTests.cs (21)
28_targetingPackRoot = Path.Combine(
38var actualAssemblies = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll")
39.Select(Path.GetFileNameWithoutExtension)
73IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories);
78var expectedVersion = repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path)) ?
82var fileName = Path.GetFileNameWithoutExtension(path);
90if (repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path)))
113IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories);
127Assert.True(result, $"In {Path.GetFileName(path)}, {reference.GetAssemblyName()} has unexpected version {reference.Version}.");
135var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt");
211IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories);
243var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt");
248var fileName = Path.GetFileName(i);
308var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml");
321var analyzersDir = Path.Combine(_targetingPackRoot, "analyzers");
324.Select(p => Path.GetFileNameWithoutExtension(p))
375var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml");
385var targetingPackPath = Path.Combine(
417var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml");
431string expectedLanguage = Path.GetFileName(Path.GetDirectoryName(assemblyPath));
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (92)
Microsoft.AspNetCore.BrowserTesting (12)
BrowserTestBase.cs (7)
42var basePath = Path.GetDirectoryName(typeof(BrowserTestBase).Assembly.Location);
49.AddJsonFile(Path.Combine(basePath, "playwrightSettings.json"))
50.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.{os}.json"), optional: true);
54builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.ci.json"), optional: true)
55.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.ci.{os}.json"), optional: true);
60builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.container.json"), optional: true);
65builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.debug.json"), optional: true);
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
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.Photino (3)
Microsoft.AspNetCore.Components.WebView.Test (1)
Microsoft.AspNetCore.Components.WebView.WindowsForms (10)
Microsoft.AspNetCore.Components.WebView.Wpf (10)
Microsoft.AspNetCore.Components.WebViewE2E.Test (3)
Microsoft.AspNetCore.DataProtection (10)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (12)
DataProtectionProviderTests.cs (12)
51var keysPath = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName());
121var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx");
148var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCertWithoutPrivateKey.pfx"), "password");
176var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3WithoutPrivateKey.pfx"), "password3", X509KeyStorageFlags.Exportable);
193var certWithKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3.pfx"), "password3");
216var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx");
245var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx");
287var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx");
323string uniqueTempPath = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName());
340=> Path.Combine(AppContext.BaseDirectory, "TestFiles");
Microsoft.AspNetCore.DataProtection.Tests (17)
Repositories\FileSystemXmlRepositoryTests.cs (10)
19? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET")
20: Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".aspnet");
21var expectedDir = new DirectoryInfo(Path.Combine(baseDir, "DataProtection-Keys")).FullName;
205var filePath1 = Path.Combine(dirInfo.FullName, "friendly1.xml");
206var filePath2 = Path.Combine(dirInfo.FullName, "friendly2.xml");
207var filePath3 = Path.Combine(dirInfo.FullName, "friendly3.xml");
222fileLock2 = new FileStream(Path.Combine(dirInfo.FullName, "friendly2.xml"), FileMode.Open, FileAccess.ReadWrite, FileShare.None);
255var filePath = Path.Combine(dirInfo.FullName, "friendly1.xml");
318string uniqueTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
XmlEncryption\EncryptedXmlDecryptorTests.cs (7)
18var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
32var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
33var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password");
50var fullCert = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
51var publicKeyOnly = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.PublicKeyOnly.cer"), "");
68var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
69var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (32)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (3)
Microsoft.AspNetCore.Diagnostics (2)
Microsoft.AspNetCore.Diagnostics.Tests (2)
Microsoft.AspNetCore.FunctionalTests (18)
WebApplicationFunctionalTests.cs (13)
16var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
21await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @"
59var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
64await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.Development.json"), @"
102var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
107await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @"
143await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @"
WebHostFunctionalTests.cs (5)
156var deploymentParameters = new DeploymentParameters(Path.Combine(GetTestSitesPath(), applicationName), ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
211var deploymentParameters = new DeploymentParameters(Path.Combine(GetTestSitesPath(), applicationName), ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitectures.Current)
242var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "DefaultBuilder.slnf"));
245return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "testassets"));
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Microsoft.AspNetCore.Hosting (13)
Microsoft.AspNetCore.Hosting.FunctionalTests (3)
Microsoft.AspNetCore.Hosting.Tests (39)
HostingEnvironmentExtensionsTests.cs (12)
24env.Initialize(Path.GetFullPath("."), webHostOptions);
26Assert.Equal(Path.GetFullPath("."), env.ContentRootPath);
27Assert.Equal(Path.GetFullPath("testroot"), env.WebRootPath);
37env.Initialize(Path.GetFullPath("testroot"), CreateWebHostOptions());
39Assert.Equal(Path.GetFullPath("testroot"), env.ContentRootPath);
40Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.WebRootPath);
50env.Initialize(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), CreateWebHostOptions());
52Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.ContentRootPath);
71env.Initialize(Path.GetFullPath("."), webHostOptions);
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
Microsoft.AspNetCore.Http.Microbenchmarks (7)
Microsoft.AspNetCore.Http.Results (2)
Microsoft.AspNetCore.Http.Results.Tests (59)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (40)
38var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
60Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
69var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
92Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
101var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
119Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
128var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
146Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
158var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
175Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
186var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
215var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
242var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
270var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
294var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
310Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
327var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt"));
337Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile_ASCII.txt")), sendFile.Name);
347var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt"));
357Assert.Equal(Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
Microsoft.AspNetCore.HttpLogging (4)
Microsoft.AspNetCore.HttpLogging.Tests (23)
FileLoggerProcessorTests.cs (21)
22TempPath = Path.Combine(Environment.CurrentDirectory, "_");
34var path = Path.Combine(TempPath, Path.GetRandomFileName());
70var path = Path.Combine(TempPath, Path.GetRandomFileName());
112var path = Path.Combine(TempPath, Path.GetRandomFileName());
152var path = Path.Combine(TempPath, Path.GetRandomFileName());
154File.WriteAllText(Path.Combine(path, "randomFile.txt"), "Text");
207var path = Path.Combine(TempPath, Path.GetRandomFileName());
272var path = Path.Combine(TempPath, Path.GetRandomFileName());
358var path = Path.Combine(TempPath, Path.GetRandomFileName());
421var path = Path.Combine(TempPath, Path.GetRandomFileName());
490var path = Path.Combine(TempPath, Path.GetRandomFileName());
589return Path.Combine(path, GetLogFileName(prefix, dateTime, fileNumber));
Microsoft.AspNetCore.Identity.Test (6)
IdentityUIScriptsTest.cs (6)
84var wwwrootDir = Path.Combine(GetProjectBasePath(), "assets", scriptTag.Version);
87Path.Combine(wwwrootDir, scriptTag.FallbackSrc.Replace("Identity", "").TrimStart('~').TrimStart('/')));
109var uiDirV4 = Path.Combine(GetProjectBasePath(), "Areas", "Identity", "Pages", "V4");
110var uiDirV5 = Path.Combine(GetProjectBasePath(), "Areas", "Identity", "Pages", "V5");
166return Directory.Exists(projectPath) ? projectPath : Path.Combine(FindHelixSlnFileDirectory(), "UI");
171var applicationPath = Path.GetDirectoryName(typeof(IdentityUIScriptsTest).Assembly.Location);
Microsoft.AspNetCore.Identity.UI (4)
Microsoft.AspNetCore.InternalTesting (16)
Microsoft.AspNetCore.InternalTesting.Tests (16)
Microsoft.AspNetCore.Mvc.Core (3)
Microsoft.AspNetCore.Mvc.Core.Test (62)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (40)
38var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
60Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
69var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
92Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
101var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
119Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
128var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
146Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
158var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
175Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
186var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
215var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
242var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
270var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
294var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt"));
310Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
327var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt"));
337Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile_ASCII.txt")), sendFile.Name);
347var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt"));
357Assert.Equal(Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
Microsoft.AspNetCore.Mvc.FunctionalTests (9)
Microsoft.AspNetCore.Mvc.Localization (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (18)
FileProviderRazorProjectFileSystemTest.cs (17)
53Assert.Equal(Path.Combine("BasePath", "File1.cshtml"), file.PhysicalPath);
60Assert.Equal(Path.Combine("BasePath", "File3.cshtml"), file.PhysicalPath);
89var file5 = fileProvider.AddFile(Path.Combine("Level1-Dir2", "File5.cshtml"), "content");
104Assert.Equal(Path.Combine("BasePath", "File1.cshtml"), file.PhysicalPath);
111Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File2.cshtml"), file.PhysicalPath);
112Assert.Equal(Path.Combine("Level1-Dir1", "File2.cshtml"), file.RelativePhysicalPath);
118Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File3.cshtml"), file.PhysicalPath);
119Assert.Equal(Path.Combine("Level1-Dir1", "File3.cshtml"), file.RelativePhysicalPath);
125Assert.Equal(Path.Combine("BasePath", "Level1-Dir2", "File5.cshtml"), file.PhysicalPath);
126Assert.Equal(Path.Combine("Level1-Dir2", "File5.cshtml"), file.RelativePhysicalPath);
154var file5 = fileProvider.AddFile(Path.Combine("Level1-Dir2", "File5.cshtml"), "content");
169Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File2.cshtml"), file.PhysicalPath);
170Assert.Equal(Path.Combine("Level1-Dir1", "File2.cshtml"), file.RelativePhysicalPath);
176Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File3.cshtml"), file.PhysicalPath);
177Assert.Equal(Path.Combine("Level1-Dir1", "File3.cshtml"), file.RelativePhysicalPath);
199Assert.Equal(Path.Combine("BasePath", "File3.cshtml"), item.PhysicalPath);
221Assert.Equal(Path.Combine("BasePath2", "File3.cshtml"), item.PhysicalPath);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
Microsoft.AspNetCore.Mvc.Testing (5)
Microsoft.AspNetCore.Mvc.Views.TestCommon (5)
Microsoft.AspNetCore.OpenApi.Build.Tests (16)
Microsoft.AspNetCore.OpenApi.Tests (3)
Microsoft.AspNetCore.OutputCaching.Tests (1)
Microsoft.AspNetCore.ResponseCaching.Tests (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
Microsoft.AspNetCore.Server.IIS (4)
Microsoft.AspNetCore.Server.IntegrationTesting (22)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (23)
IISDeployer.cs (11)
102_debugLogFile = Path.GetTempFileName();
115IISDeploymentParameters.ServerConfigLocation = Path.Combine(@"C:\inetpub\temp\apppools", _appPoolName, $"{_appPoolName}.config");
187var file = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, debugLogLocation);
318_configPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("D"));
319_applicationHostConfig = Path.Combine(_configPath, "applicationHost.config");
528HelixHelper.PreserveFile(Path.Combine(DeploymentParameters.PublishedApplicationRootPath, "web.config"), fileNamePrefix + ".web.config");
529HelixHelper.PreserveFile(Path.Combine(_configPath, "applicationHost.config"), fileNamePrefix + ".applicationHost.config");
530HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\ApplicationHost.config"), fileNamePrefix + ".inetsrv.applicationHost.config");
531HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\redirection.config"), fileNamePrefix + ".inetsrv.redirection.config");
532var tmpFile = Path.GetRandomFileName();
IISExpressDeployer.cs (7)
69var entryPoint = Path.Combine(dllRoot, DeploymentParameters.ApplicationName + executableExtension);
120dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.RuntimeArchitecture.ToString(),
126dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework);
187WorkingDirectory = Path.GetDirectoryName(iisExpressPath)
300var webConfigPath = Path.Combine(contentRoot, "web.config");
310DeploymentParameters.ServerConfigLocation = Path.GetTempFileName();
386var iisExpressPath = Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + "\\", programFiles, "IIS Express", "iisexpress.exe");
Microsoft.AspNetCore.Server.Kestrel.Core (49)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (23)
CertificatePathWatcherTests.cs (20)
22var fileName = Path.GetRandomFileName();
23var filePath = Path.Combine(dir, fileName);
79dirs[i] = Path.Combine(rootDir, $"dir{i}");
122var fileName = Path.GetRandomFileName();
123var filePath = Path.Combine(dir, fileName);
172var fileName = Path.GetRandomFileName();
173var filePath = Path.Combine(dir, fileName);
211var dir = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName());
222Path = Path.Combine(dir, "test.pfx"),
239var fileName = Path.GetRandomFileName();
240var filePath = Path.Combine(dir, fileName);
273var fileName = Path.GetRandomFileName();
274var filePath = Path.Combine(dir, fileName);
313var fileName = Path.GetRandomFileName();
314var filePath = Path.Combine(dir, fileName);
344var fileName = Path.GetRandomFileName();
345var filePath = Path.Combine(dir, fileName);
404var fileName = Path.GetRandomFileName();
405var filePath = Path.Combine(dir, fileName);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
Microsoft.AspNetCore.Server.Kestrel.Tests (48)
GeneratedCodeTests.cs (10)
24var httpHeadersGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpHeaders.Generated.cs");
25var httpProtocolGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpProtocol.Generated.cs");
26var httpUtilitiesGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpUtilities.Generated.cs");
27var transportMultiplexedConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportMultiplexedConnection.Generated.cs");
28var transportConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportConnection.Generated.cs");
30var testHttpHeadersGeneratedPath = Path.GetTempFileName();
31var testHttpProtocolGeneratedPath = Path.GetTempFileName();
32var testHttpUtilitiesGeneratedPath = Path.GetTempFileName();
33var testTransportMultiplexedConnectionGeneratedPath = Path.GetTempFileName();
34var testTransportConnectionGeneratedPath = Path.GetTempFileName();
HttpsConfigurationTests.cs (6)
33serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword");
105new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
146new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
183new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
220serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword");
253ServerCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"),
KestrelConfigurationLoaderTests.cs (29)
279Directory.CreateDirectory(Path.GetDirectoryName(path));
320Directory.CreateDirectory(Path.GetDirectoryName(devCertPath));
446Directory.CreateDirectory(Path.GetDirectoryName(path));
493Directory.CreateDirectory(Path.GetDirectoryName(path));
542Directory.CreateDirectory(Path.GetDirectoryName(path));
595new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
596new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key"))
619new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
620new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-ecdsa.key")),
644new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
645new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")),
669new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
670new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.pub")),
806certificateFilePath = Path.Combine(tempDir, $"test{extension}");
807certificateKeyPath = Path.Combine(tempDir, "test.key");
984Directory.CreateDirectory(Path.GetDirectoryName(path));
1140Directory.CreateDirectory(Path.GetDirectoryName(certificatePath));
1220var oldDir = Directory.CreateDirectory(Path.Combine(tempDir, "old"));
1221var newDir = Directory.CreateDirectory(Path.Combine(tempDir, "new"));
1222var oldCertPath = Path.Combine(oldDir.FullName, "tls.key");
1223var newCertPath = Path.Combine(newDir.FullName, "tls.key");
1225var dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./old");
1226var fileLink = File.CreateSymbolicLink(Path.Combine(tempDir, "tls.key"), "./link/tls.key");
1271dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./new");
1628var certPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.pem");
1629var keyPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.key");
2144var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null;
2145basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null);
2146return Path.Combine(basePath, $"TestApplication.pfx");
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
Microsoft.AspNetCore.Shared.Tests (39)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Microsoft.AspNetCore.SpaProxy (6)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (5)
Microsoft.AspNetCore.StaticAssets.Tests (13)
StaticAssetsIntegrationTests.cs (13)
325var filePath = Path.Combine(webRoot, "sample.txt");
382File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified");
435File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified");
502File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Short");
558File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified");
567Assert.Equal(GetGzipEtag(Path.Combine(webRoot, "sample.txt")), response.Headers.ETag.Tag);
596var contentRoot = Path.Combine(AppContext.BaseDirectory, appName);
597var webRoot = Path.Combine(contentRoot, "wwwroot");
605var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{appName}.staticwebassets.endpoints.json");
614var filePath = Path.Combine(webRoot, resource.Path);
637var compressedFilePath = Path.Combine(webRoot, resource.Path + ".gz");
1158return Path.GetExtension(filePath) switch
1207public string Name => Path.GetFileName(testResource.Path);
Microsoft.AspNetCore.StaticFiles (2)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
Microsoft.AspNetCore.StaticFiles.Tests (33)
StaticFileMiddlewareTests.cs (19)
51var badLink = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName() + ".txt");
53Process.Start("ln", $"-s \"/tmp/{Path.GetRandomFileName()}\" \"{badLink}\"").WaitForExit();
72var response = await server.CreateClient().GetAsync(Path.GetFileName(badLink));
177using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
185var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl));
213using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir));
224var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl));
253using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir));
266var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl));
296using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir));
316var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl));
340using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, ".")))
359var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl));
388using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, ".")))
444using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."));
470using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
478var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl));
530using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
Microsoft.AspNetCore.TestHost (2)
Microsoft.AspNetCore.TestHost.Tests (15)
UseSolutionRelativeContentRootTests.cs (15)
18_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")[..8]);
19_contentDirectory = Path.Combine(_tempDirectory, "src");
26var solutionFile = Path.Combine(_tempDirectory, "TestApp.sln");
44var solutionFile = Path.Combine(_tempDirectory, "TestApp.slnx");
69var subDirectory = Path.Combine(_tempDirectory, "sub");
72var slnFile = Path.Combine(subDirectory, "TestApp.sln");
73var slnxFile = Path.Combine(_tempDirectory, "TestApp.slnx");
98var expectedPath = Path.Combine(_contentDirectory, "sub");
101var slnFile = Path.Combine(_tempDirectory, "TestApp.sln");
102var slnxFile = Path.Combine(_contentDirectory, "TestApp.slnx");
127var slnFile = Path.Combine(_tempDirectory, "TestApp.sln");
128var slnxFile = Path.Combine(_tempDirectory, "TestApp.slnx");
167var subDirectory = Path.Combine(_tempDirectory, "sub", "folder");
170var solutionFile = Path.Combine(_tempDirectory, "TestApp.slnx");
Microsoft.AspNetCore.Tests (47)
WebApplicationTests.cs (47)
391var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
392var webRoot = Path.Combine(contentRoot, "wwwroot");
411var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
412var webRoot = Path.Combine(contentRoot, "wwwroot");
468var contentRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
476builder.Host.UseContentRoot(contentRoot + Path.DirectorySeparatorChar);
480builder.WebHost.UseContentRoot(contentRoot + Path.DirectorySeparatorChar);
502var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
504var fullWebRootPath = Path.Combine(contentRoot, "wwwroot2");
531var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
533var fullWebRootPath = Path.Combine(contentRoot, "wwwroot");
573var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
575var fullWebRootPath = Path.Combine(contentRoot, "wwwroot");
622builder.Host.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory));
626builder.WebHost.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory));
633Path.TrimEndingDirectorySeparator(Path.GetFullPath(unnormalizedPath));
788var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
791var fullWebRootPath = Path.Combine(contentRoot, webRoot);
831var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
834var fullWebRootPath = Path.Combine(contentRoot, webRoot);
880var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
883var fullWebRootPath = Path.Combine(contentRoot, webRoot);
1079var contentRoot = Path.GetTempPath().ToString();
2216var wwwroot = Path.Combine(AppContext.BaseDirectory, "wwwroot");
2249var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
2281ContentRootPath = Path.GetTempPath()
2300Assert.Equal(Path.GetTempPath(), hostEnv.ContentRootPath);
Microsoft.AspNetCore.WebSockets.ConformanceTests (9)
Microsoft.AspNetCore.WebUtilities (6)
Microsoft.AspNetCore.WebUtilities.Tests (3)
Microsoft.Build.Framework (23)
Microsoft.Build.Tasks.CodeAnalysis (33)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (33)
Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests (10)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (88)
CscTests.cs (9)
468csc.ToolExe = Path.Combine("path", "to", "custom_csc");
471Assert.Equal(Path.Combine("path", "to", "custom_csc"), csc.GeneratePathToTool());
474csc.ToolExe = Path.Combine("path", "to", "custom_csc");
477Assert.Equal(Path.Combine("path", "to", "custom_csc"), csc.GeneratePathToTool());
484csc.ToolPath = Path.Combine("path", "to", "custom_csc");
488AssertEx.Equal(Path.Combine("path", "to", "custom_csc", $"csc{PlatformInformation.ExeExtension}"), csc.GeneratePathToTool());
491csc.ToolPath = Path.Combine("path", "to", "custom_csc");
494AssertEx.Equal(Path.Combine("path", "to", "custom_csc", $"csc{PlatformInformation.ExeExtension}"), csc.GeneratePathToTool());
532Assert.Equal($@"/out:test.exe /analyzerconfig:.editorconfig /analyzerconfig:subdir\.editorconfig test.cs subdir{Path.DirectorySeparatorChar}test.cs", csc.GenerateResponseFileContents());
DotNetSdkTests.cs (36)
28var root1 = Path.GetFullPath(ProjectDir.Path + Path.DirectorySeparatorChar);
29var root2 = Path.GetFullPath(sourcePackageDir.Path + Path.DirectorySeparatorChar);
31root3 ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
32root3 += Path.DirectorySeparatorChar;
38var sourceLinkJsonPath = Path.Combine(ObjDir.Path, ProjectName + ".sourcelink.json");
54<SourceRoot Include=""{root1}sub1{Path.DirectorySeparatorChar}"" SourceControl=""git"" NestedRoot=""sub1"" ContainingRoot=""{root1}"" SourceLinkUrl=""https://raw.githubusercontent.com/M1/*""/>
55<SourceRoot Include=""{root1}sub2{Path.DirectorySeparatorChar}"" SourceControl=""git"" NestedRoot=""sub2"" ContainingRoot=""{root1}"" SourceLinkUrl=""https://raw.githubusercontent.com/M2/*""/>
100$@"{root1}sub1{Path.DirectorySeparatorChar}: /_/sub1/",
101$@"{root1}sub2{Path.DirectorySeparatorChar}: /_/sub2/",
140$@"{root1}sub1{Path.DirectorySeparatorChar}: {root1}sub1{Path.DirectorySeparatorChar}",
141$@"{root1}sub2{Path.DirectorySeparatorChar}: {root1}sub2{Path.DirectorySeparatorChar}",
150$@"[{root1}sub1{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M1/*]," +
151$@"[{root1}sub2{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M2/*]",
178$@"{root1}sub1{Path.DirectorySeparatorChar}: {root1}sub1{Path.DirectorySeparatorChar}",
179$@"{root1}sub2{Path.DirectorySeparatorChar}: {root1}sub2{Path.DirectorySeparatorChar}",
188$@"[{root1}sub1{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M1/*]," +
189$@"[{root1}sub2{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M2/*]",
216$@"{root1}sub1{Path.DirectorySeparatorChar}: {root1}sub1{Path.DirectorySeparatorChar}",
217$@"{root1}sub2{Path.DirectorySeparatorChar}: {root1}sub2{Path.DirectorySeparatorChar}",
226$@"[{root1}sub1{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M1/*]," +
227$@"[{root1}sub2{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M2/*]",
347$"X{Path.DirectorySeparatorChar}",
348$"Y{Path.DirectorySeparatorChar}",
349$"Z{Path.DirectorySeparatorChar}",
432Path.Combine(ProjectDir.Path, ".editorconfig"),
493Path.Combine(ProjectDir.Path, ".editorconfig"),
528Path.Combine(ProjectDir.Path, ".editorconfig"),
653Path.Combine(ProjectDir.Path, ".editorconfig"),
TestUtilities\DotNetSdkTestBase.cs (19)
64=> Path.Combine(dotnetInstallDir, "sdk", version);
68DotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe");
73=> dotnetDir != null && File.Exists(Path.Combine(dotnetDir, DotNetExeName)) && Directory.Exists(GetSdkPath(dotnetDir, DotNetSdkVersion));
78dotnetInstallDir = Environment.GetEnvironmentVariable("PATH")?.Split(Path.PathSeparator).FirstOrDefault(isMatchingDotNetInstance);
98var filePath = Path.Combine(objDirectory, projectFileName + ".TestHelpers.g.props");
116var filePath = Path.Combine(objDirectory, projectFileName + ".TestHelpers.g.targets");
126<MakeDir Directories=""{Path.GetDirectoryName(outputFile)}"" />
151DotNetPath = Path.Combine(DotNetInstallDir, DotNetExeName);
152var testBinDirectory = Path.GetDirectoryName(typeof(DotNetSdkTests).Assembly.Location) ?? string.Empty;
153var sdksDir = Path.Combine(DotNetSdkPath ?? string.Empty, "Sdks");
174var csharpCoreTargets = Path.Combine(testBinDirectory, "Microsoft.CSharp.Core.targets");
175var visualBasicCoreTargets = Path.Combine(testBinDirectory, "Microsoft.VisualBasic.Core.targets");
196Assert.True(File.Exists(Path.Combine(ObjDir.Path, "project.assets.json")));
197Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.props")));
198Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.targets")));
207var workingDirectory = Path.GetDirectoryName(projectFilePath)!;
210var projectFileName = Path.GetFileName(projectFilePath);
221var evaluationResultsFile = Path.Combine(OutDir.Path, "EvaluationResult.txt");
227var testBinDirectory = Path.GetDirectoryName(typeof(DotNetSdkTests).Assembly.Location);
Microsoft.Cci.Extensions (9)
Microsoft.CodeAnalysis (77)
Microsoft.CodeAnalysis.Analyzers (37)
Microsoft.CodeAnalysis.AnalyzerUtilities (25)
Microsoft.CodeAnalysis.BannedApiAnalyzers (28)
Microsoft.CodeAnalysis.CodeStyle (20)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.Collections.Package (1)
Microsoft.CodeAnalysis.Contracts.Package (1)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (27)
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (27)
35=> Path.Combine(Directory, Path.Combine(folders));
39var filePath = Path.Combine(directory ?? Directory, fileName);
385(Path.Combine(folder, "ABClass1.cs"), code1),
386(Path.Combine(folder, "ABClass2.cs"), code2),
399var folder = Path.Combine("B", "C");
532(Path.Combine(folder, "Class1.cs"), code1),
538(Path.Combine(folder, "Class1.cs"), fixed1),
640(Path.Combine(folder, "Class1.cs"), code1),
646(Path.Combine(folder, "Class1.cs"), fixed1),
750(Path.Combine(folder1, "Class1.cs"), code1),
751(Path.Combine(folder2, "Class2.cs"), code2),
752(Path.Combine(folder3, "Class3.cs"), code3),
757(Path.Combine(folder1, "Class1.cs"), fixed1),
758(Path.Combine(folder2, "Class2.cs"), fixed2),
759(Path.Combine(folder3, "Class3.cs"), fixed3),
861var project2folder = Path.Combine(project2Directory, "A", "B", "C");
901(Path.Combine(folder1, "Class1.cs"), code1),
902(Path.Combine(folder2, "Class2.cs"), code2),
903(Path.Combine(folder3, "Class3.cs"), code3),
910Sources = { (Path.Combine(project2folder, "P.cs"), project2Source) },
911AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) },
919(Path.Combine(folder1, "Class1.cs"), fixed1),
920(Path.Combine(folder2, "Class2.cs"), fixed2),
921(Path.Combine(folder3, "Class3.cs"), fixed3),
928Sources = { (Path.Combine(project2folder, "P.cs"), project2FixedSource) },
929AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) },
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (283)
CommandLineTests.cs (245)
64var cscDllPath = Path.Combine(
65Path.GetDirectoryName(typeof(CommandLineTests).GetTypeInfo().Assembly.Location),
66Path.Combine("dependency", "csc.dll"));
70var netStandardDllDir = Path.GetDirectoryName(netStandardDllPath);
73var runtimeConfigPath = Path.ChangeExtension(Assembly.GetExecutingAssembly().Location, "runtimeconfig.json");
77s_CSharpScriptExecutable = s_CSharpCompilerExecutable.Replace("csc.dll", Path.Combine("csi", "csi.dll"));
154string exePath = Path.Combine(dir.Path, "temp.exe");
174var xmlPath = Path.Combine(dir.Path, docName);
410var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path);
412Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932)));
430var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path);
432Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932)));
462AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "a.cs"), Path.Combine(WorkingDirectory, "b.cs") }, cmd.Arguments.SourceFiles.Select(file => file.Path));
479Func<string, string> prependBasePath = fileName => Path.Combine(basePath, fileName);
491{ Path.Combine(dirSubDir.Path, @"b.rsp"), @"
499{ Path.Combine(Path.GetPathRoot(basePath), @"d.rsp"), @"
1533Diagnostic(ErrorCode.ERR_OpenResponseFile).WithArguments(Path.Combine(WorkingDirectory, @"roslyn_test_non_existing_file")));
2012Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2025Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2032Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2099Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.PdbPath);
2100Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2104Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.PdbPath);
2105Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2112Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2116Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2151Assert.Equal(Path.Combine(Path.GetPathRoot(WorkingDirectory), @"MyFolder\MyPdb.pdb"), parsedArgs.PdbPath);
2215Assert.Equal(Path.Combine(WorkingDirectory, "sl.json"), parsedArgs.SourceLink);
2219Assert.Equal(Path.Combine(WorkingDirectory, "sl.json"), parsedArgs.SourceLink);
2223Assert.Equal(Path.Combine(WorkingDirectory, "s l.json"), parsedArgs.SourceLink);
2257var peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe"));
2289var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"));
2318var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"));
2337new[] { "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2343new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2349new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2355new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2361new[] { "a,b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2367new[] { "a.txt", "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2481using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe"))))
2488MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))))
2516symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")));
2546var name = Path.GetFileName(file);
2887Diagnostic(ErrorCode.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah"), "File not found."));
2888Assert.Equal(expected: Path.Combine(TempRoot.Root, "blah"), actual: parsedArgs.RuleSetPath);
2892Diagnostic(ErrorCode.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah;blah.ruleset"), "File not found."));
2893Assert.Equal(expected: Path.Combine(TempRoot.Root, "blah;blah.ruleset"), actual: parsedArgs.RuleSetPath);
3595" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3596" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3618" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context
3622" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3623" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3630" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context
3798Assert.Equal(Path.Combine(baseDirectory, "MyBinary.dll"), parsedArgs.GetOutputFilePath(parsedArgs.OutputFileName));
4109Assert.Equal(Path.Combine(baseDirectory, "MyBinary.xml"), parsedArgs.DocumentationPath);
4213Assert.Equal(Path.Combine(baseDirectory, "MyBinary.xml"), parsedArgs.ErrorLogOptions.Path);
4334var srcDirectory = Path.GetDirectoryName(srcFile.Path);
4367var srcDirectory = Path.GetDirectoryName(srcFile.Path);
4368string root = Path.GetPathRoot(srcDirectory); // Make sure we pick a drive that exists and is plugged in to avoid 'Drive not ready'
4504using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe"))))
5660Assert.Equal(Path.Combine(WorkingDirectory, "test.snk"), parsedArgs.CompilationOptions.CryptoKeyFile);
5924var baseDir = Path.GetDirectoryName(source);
5961var baseDir = Path.GetDirectoryName(source2);
5981var baseDir = Path.GetDirectoryName(source2);
5992Assert.Equal("error CS7041: Each linked resource and module must have a unique filename. Filename '" + Path.GetFileName(modfile) + "' is specified more than once in this assembly", outWriter.ToString().Trim());
6074var assemblyName = AssemblyName.GetAssemblyName(Path.Combine(tempDir, name));
6510baseDirectory: Path.DirectorySeparatorChar == '\\' ? @"c:\" : "/");
7094using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName))))
7813Path.GetFileName(sourceFile.Path),
7823string.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)),
7824Path.GetFileName(sourceFile.Path),
7833IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002);
8021outWriter.ToString().Replace(Path.GetFileName(src.Path), "{FILE}").Trim());
8269Assert.True(File.Exists(Path.Combine(dir.ToString(), "a.xml")));
8402var baseDir = Path.GetDirectoryName(source);
8403var fileName = Path.GetFileName(source);
8461CleanupAllGeneratedFiles(Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(source)), Path.GetFileName(source)));
8539var baseDir = Path.GetDirectoryName(source);
8540var fileName = Path.GetFileName(source);
8545Assert.Equal(Path.GetFileName(source) + "(7,17): warning CS1634: Expected 'disable' or 'restore'", outWriter.ToString().Trim());
8553exitCode = CreateCSharpCompiler(null, baseDir, new[] { "/nologo", "/preferreduilang:en", Path.Combine(baseDir, "nonexistent.cs"), source.ToString() }).Run(outWriter);
8555Assert.Equal("error CS2001: Source file '" + Path.Combine(baseDir, "nonexistent.cs") + "' could not be found.", outWriter.ToString().Trim());
8578var baseDir = Path.GetDirectoryName(source);
8579var fileName = Path.GetFileName(source);
8602var baseDir = Path.GetDirectoryName(source);
8603var fileName = Path.GetFileName(source);
8636var baseDir = Path.GetDirectoryName(source);
8637var fileName = Path.GetFileName(source);
8656var baseDir = Path.GetDirectoryName(source);
8657var fileName = Path.GetFileName(source);
8682var baseDir = Path.GetDirectoryName(source);
8683var fileName = Path.GetFileName(source);
8709var baseDir = Path.GetDirectoryName(source);
8710var fileName = Path.GetFileName(source);
8717System.IO.File.Delete(System.IO.Path.Combine(baseDir, "goo.dll"));
8864AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
8921AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
8962AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
8996var exePath = Path.Combine(Path.GetDirectoryName(srcPath), "test.exe");
9018var exePath = Path.Combine(Path.GetDirectoryName(srcPath), "test.exe");
9019var pdbPath = Path.ChangeExtension(exePath, "pdb");
9041var xmlPath = Path.Combine(Path.GetDirectoryName(srcPath), "test.xml");
9065var sourceLinkPath = Path.Combine(Path.GetDirectoryName(srcPath), "test.json");
9093string exePath = Path.Combine(Path.GetDirectoryName(sourcePath), "test.exe");
9118string exePath = Path.Combine(Path.GetDirectoryName(sourcePath), "test.exe");
9119string pdbPath = Path.ChangeExtension(exePath, ".pdb");
9144string xmlPath = Path.Combine(WorkingDirectory, "Test.xml");
9247string xmlPath = Path.Combine(WorkingDirectory, "Test.xml");
9443var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9475var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9502var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9562var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9595var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9635workingDirectory: Path.GetDirectoryName(srcFile.Path),
9655var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9680var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9702var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9730var expectedPath = Path.GetDirectoryName(WorkingDirectory);
9951Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles.Single().Path);
9956Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9957Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
9962Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9963Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[1].Path);
9967Assert.Equal(Path.Combine(WorkingDirectory, "..\\web.config"), args.AdditionalFiles.Single().Path);
9977Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path);
9978Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path);
9979Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path);
9984Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9985Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
9990Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9991Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
9996Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9997Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
10002Assert.Equal(Path.Combine(WorkingDirectory, "web.config,app.manifest"), args.AdditionalFiles[0].Path);
10007Assert.Equal(Path.Combine(WorkingDirectory, "web.config:app.manifest"), args.AdditionalFiles[0].Path);
10023Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths.Single());
10028Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]);
10029Assert.Equal(Path.Combine(WorkingDirectory, "subdir\\.editorconfig"), args.AnalyzerConfigPaths[1]);
10034Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]);
10035Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[1]);
10039Assert.Equal(Path.Combine(WorkingDirectory, "..\\.editorconfig"), args.AnalyzerConfigPaths.Single());
10044Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]);
10045Assert.Equal(Path.Combine(WorkingDirectory, "subdir\\.editorconfig"), args.AnalyzerConfigPaths[1]);
10125string fileName = Path.GetFileName(filePath);
11445Assert.True(File.Exists(Path.Combine(dir.ToString(), "doc.xml")));
11460using (var reader = new StreamReader(Path.Combine(dir.ToString(), "doc.xml")))
11466output = ProcessUtilities.RunAndGetOutput(Path.Combine(dir.ToString(), "out.exe"), startFolder: dir.ToString());
11483Assert.Equal(Path.Combine(baseDirectory, @"a.pdb"), args.PdbPath);
11516AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11520AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "@script.csx") }, args.SourceFiles.Select(f => f.Path));
11524AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "-script.csx") }, args.SourceFiles.Select(f => f.Path));
11528AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11532AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11536AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11541AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11546AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11551AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "--") }, args.SourceFiles.Select(f => f.Path));
11670var dir = Path.Combine(WorkingDirectory, "a");
11673Assert.Equal(Path.Combine(dir, @"data.pdb"), parsedArgs.PdbPath);
11696var exePath = Path.Combine(dir.Path, "a.exe");
11708var pdbPath = Path.Combine(dir.Path, "a.pdb");
11715var pdbPath = Path.Combine(dir.Path, "a.pdb");
11722var pdbPath = Path.Combine(dir.Path, "a.pdb");
11730var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb");
11738var pdbPath = Path.Combine(dir.Path, "a.pdb");
11745var pdbPath = Path.Combine(dir.Path, "a.pdb");
11752var pdbPath = Path.Combine(dir.Path, "a.pdb");
11815dir.CopyFile(Path.ChangeExtension(s_CSharpCompilerExecutable, ".exe.config"), "csc32.exe.config");
11816dir.CopyFile(Path.Combine(Path.GetDirectoryName(s_CSharpCompilerExecutable), "csc.rsp"));
11877var exe = Path.Combine(dir.Path, "a.exe");
11886var doc = Path.Combine(dir.Path, "doc.xml");
11910var refDll = Path.Combine(refDir.Path, "a.dll");
11941var dll = Path.Combine(dir.Path, "a.dll");
11944var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll"));
11993var refDll = Path.Combine(dir.Path, "a.dll");
12004var pdb = Path.Combine(dir.Path, "a.pdb");
12007var doc = Path.Combine(dir.Path, "doc.xml");
12308var cscDir = Path.GetDirectoryName(s_CSharpCompilerExecutable);
12313var fileName = Path.GetFileName(filePath);
12325var cscCopy = Path.Combine(dir.Path, "csc.exe");
12369var exePath = Path.Combine(dir.Path, "a.exe");
13557string binaryPath = Path.Combine(dir.Path, "temp.dll");
13560string pdbPath = Path.Combine(dir.Path, pdbName);
13563string xmlDocFilePath = Path.Combine(dir.Path, docName);
13603string binaryPath = Path.Combine(dir.Path, "temp.dll");
13606string pdbPath = Path.Combine(dir.Path, pdbName);
13609string xmlDocFilePath = Path.Combine(dir.Path, docName);
13653string binaryPath = Path.Combine(dir.Path, "temp.dll");
13656string pdbPath = Path.Combine(dir.Path, pdbName);
13659string xmlDocFilePath = Path.Combine(dir.Path, docName);
13684string binaryPath = Path.Combine(dir.Path, "temp.dll");
14002ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
14043ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14086{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1},
14087{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2},
14104var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14105var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14124using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb")))
14146var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14147var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14166using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb")))
14213{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14237ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14244ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14307var generatedPath = Path.Combine(subdir, generatedFileName);
14315{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14346var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll");
14350options: TestOptions.DebugDll.WithCryptoKeyFile(Path.GetFileName(snk.Path)).WithStrongNameProvider(virtualSnProvider),
14368{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14402var generatedDirPath = Path.Combine(dir.Path, "noexist");
14430ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14441string baseDirectory = Path.Combine(root, "abc", "def");
14457Assert.Equal(Path.Combine(baseDirectory, "outdir"), parsedArgs.GeneratedFilesOutputDirectory);
14461Assert.Equal(Path.Combine(baseDirectory, "outdir"), parsedArgs.GeneratedFilesOutputDirectory);
14465Assert.Equal(Path.Combine(baseDirectory, "out dir"), parsedArgs.GeneratedFilesOutputDirectory);
14469Assert.Equal(Path.Combine(baseDirectory, "out dir"), parsedArgs.GeneratedFilesOutputDirectory);
14471var absPath = Path.Combine(root, "outdir");
14480absPath = Path.Combine(root, "generated files");
14524string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write"));
15519var generatorPath = Path.Combine(directory.Path, "generator.dll");
15555Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1)));
15556Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2)));
15562string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2);
SarifErrorLoggerTests.cs (10)
43var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
74var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
108var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
140var errorLogFile = Path.Combine(outputDir.Path, "ErrorLog.txt");
141var outputFilePath = Path.Combine(outputDir.Path, "test.dll");
177var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
212var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
247var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
282var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
315var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
TouchedFileLoggingTests.cs (9)
40var touchedBase = Path.Combine(touchedDir.Path, "touched");
49Path.ChangeExtension(hello, "exe"),
68var touchedBase = Path.Combine(touchedDir.Path, "touched");
94Path.ChangeExtension(hello, "exe"),
115var touchedBase = Path.Combine(touchedDir.Path, "touched");
127Path.ChangeExtension(hello, "exe"),
154var touchedBase = Path.Combine(touchedDir.Path, "touched");
169Path.ChangeExtension(sourcePath, "dll"),
191</doc>", Path.GetFileNameWithoutExtension(sourcePath)).Trim(),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (81)
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (42)
34var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName;
35var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName;
36var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName;
46File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """
68var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName;
69var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName;
70var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName;
80File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """
104path = Path.Combine(path, "packs", "installed", "here");
106var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName;
107var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName;
108var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName;
118File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """
155var dllFilePath = Path.Combine(path, "implementation.dll");
156var sourceCodePath = Path.Combine(path, "implementation.cs");
157var pdbFilePath = Path.Combine(path, "implementation.pdb");
163var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
203var dllFilePath = Path.Combine(path, "implementation.dll");
204var sourceCodePath = Path.Combine(path, "implementation.cs");
205var pdbFilePath = Path.Combine(path, "implementation.pdb");
219var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
260var dllFilePath = Path.Combine(path, "implementation.dll");
261var sourceCodePath = Path.Combine(path, "implementation.cs");
262var pdbFilePath = Path.Combine(path, "implementation.pdb");
276var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
311var dllFilePath = Path.Combine(path, "implementation.dll");
312var sourceCodePath = Path.Combine(path, "implementation.cs");
313var pdbFilePath = Path.Combine(path, "implementation.pdb");
327var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
358var dllFilePath = Path.Combine(path, "implementation.dll");
359var sourceCodePath = Path.Combine(path, "implementation.cs");
360var pdbFilePath = Path.Combine(path, "implementation.pdb");
374var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
416var dllFilePath = Path.Combine(path, "implementation.dll");
417var sourceCodePath = Path.Combine(path, "implementation.cs");
418var pdbFilePath = Path.Combine(path, "implementation.pdb");
432var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
478var dllFilePath = Path.Combine(path, "implementation.dll");
479var sourceCodePath = Path.Combine(path, "implementation.cs");
480var pdbFilePath = Path.Combine(path, "implementation.pdb");
494var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll");
502var realImplementationDllFilePath = Path.Combine(path, "realimplementation.dll");
PdbSourceDocument\PdbSourceDocumentTests.cs (24)
323Directory.CreateDirectory(Path.Combine(path, "ref"));
324Directory.CreateDirectory(Path.Combine(path, "lib"));
328var (project, symbol) = await CompileAndFindSymbolAsync(Path.Combine(path, "ref"), Location.Embedded, Location.OnDisk, sourceText, c => c.GetMember("C.E"), buildReferenceAssembly: true);
331CompileTestSource(Path.Combine(path, "lib"), sourceText, project, Location.Embedded, Location.Embedded, buildReferenceAssembly: false, windowsPdb: false);
348var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName;
349var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName;
350var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName;
360File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """
381var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName;
382var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName;
383var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName;
401File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """
422var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName;
423var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName;
424var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName;
439var implementationDllFilePath = Path.Combine(sharedDir, "implementation.dll");
440var sourceCodePath = Path.Combine(sharedDir, "implementation.cs");
441var pdbFilePath = Path.Combine(sharedDir, "implementation.pdb");
447var typeForwardDllFilePath = Path.Combine(sharedDir, "reference.dll");
448sourceCodePath = Path.Combine(sharedDir, "reference.cs");
449pdbFilePath = Path.Combine(sharedDir, "reference.pdb");
459File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """
841CompileTestSource(dllFilePath, [Path.Combine(path, "source1.cs"), Path.Combine(path, "source2.cs")], pdbFilePath, "reference", [sourceText1, sourceText2], project, Location.Embedded, Location.Embedded, buildReferenceAssembly: false, windowsPdb: false);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (6)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
Microsoft.CodeAnalysis.CSharp.Features (4)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (33)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (5)
41AddTestDocument(source, path: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution;
457AddTestDocument(source, path: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution;
661var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs"));
707var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs"));
734var filePath = Path.Combine(TempRoot.Root, "src.cs");
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (27)
35=> Path.Combine(Directory, Path.Combine(folders));
39var filePath = Path.Combine(directory ?? Directory, fileName);
385(Path.Combine(folder, "ABClass1.cs"), code1),
386(Path.Combine(folder, "ABClass2.cs"), code2),
399var folder = Path.Combine("B", "C");
532(Path.Combine(folder, "Class1.cs"), code1),
538(Path.Combine(folder, "Class1.cs"), fixed1),
640(Path.Combine(folder, "Class1.cs"), code1),
646(Path.Combine(folder, "Class1.cs"), fixed1),
750(Path.Combine(folder1, "Class1.cs"), code1),
751(Path.Combine(folder2, "Class2.cs"), code2),
752(Path.Combine(folder3, "Class3.cs"), code3),
757(Path.Combine(folder1, "Class1.cs"), fixed1),
758(Path.Combine(folder2, "Class2.cs"), fixed2),
759(Path.Combine(folder3, "Class3.cs"), fixed3),
861var project2folder = Path.Combine(project2Directory, "A", "B", "C");
901(Path.Combine(folder1, "Class1.cs"), code1),
902(Path.Combine(folder2, "Class2.cs"), code2),
903(Path.Combine(folder3, "Class3.cs"), code3),
910Sources = { (Path.Combine(project2folder, "P.cs"), project2Source) },
911AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) },
919(Path.Combine(folder1, "Class1.cs"), fixed1),
920(Path.Combine(folder2, "Class2.cs"), fixed2),
921(Path.Combine(folder3, "Class3.cs"), fixed3),
928Sources = { (Path.Combine(project2folder, "P.cs"), project2FixedSource) },
929AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) },
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (11)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
SourceGeneration\GeneratorDriverTests.cs (5)
541Path.Combine(generator.GetType().Assembly.GetName().Name!, generator.GetType().FullName!, "source.cs"),
542Path.Combine(generator2.GetType().Assembly.GetName().Name!, generator2.GetType().FullName!, "source.cs")
3448context.AddSource(Path.GetFileName(text.Path), "");
4343""", Path.Combine(projectDir, "src", "Program.cs"));
4350driverOptions: new GeneratorDriverOptions(baseDirectory: Path.Combine(projectDir, "obj")));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (13)
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
Microsoft.CodeAnalysis.Debugging.Package (1)
Microsoft.CodeAnalysis.EditorFeatures (11)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (11)
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Microsoft.CodeAnalysis.Extensions.Package (1)
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Microsoft.CodeAnalysis.ExternalAccess.HotReload.UnitTests (19)
HotReloadMSBuildWorkspaceTests.cs (18)
36filePath: Path.Combine(TempRoot.Root, "P1.csproj"),
37outputFilePath: Path.Combine(TempRoot.Root, "P1.dll"),
45filePath: Path.Combine(TempRoot.Root, "A.cs"),
54outputRefFilePath: Path.Combine(TempRoot.Root, "ref", "P1.dll"))
58assemblyPath: Path.Combine(TempRoot.Root, "obj", "P1.dll"),
59generatedFilesOutputDirectory: Path.Combine(TempRoot.Root, "obj")));
73filePath: Path.Combine(TempRoot.Root, "P1.csproj"),
74outputFilePath: Path.Combine(TempRoot.Root, "P1.dll"),
82filePath: Path.Combine(TempRoot.Root, "A.cs"),
87filePath: Path.Combine(TempRoot.Root, "B.cs"),
96outputRefFilePath: Path.Combine(TempRoot.Root, "ref", "P1.dll"))
100assemblyPath: Path.Combine(TempRoot.Root, "obj", "P1.dll"),
101generatedFilesOutputDirectory: Path.Combine(TempRoot.Root, "obj")));
115Assert.Equal(Path.Combine(TempRoot.Root, "P1.csproj"), project2.FilePath);
116Assert.Equal(Path.Combine(TempRoot.Root, "P1.dll"), project2.OutputFilePath);
117Assert.Equal(Path.Combine(TempRoot.Root, "ref", "P1.dll"), project2.OutputRefFilePath);
120Assert.Equal(Path.Combine(TempRoot.Root, "obj", "P1.dll"), project2.CompilationOutputInfo.AssemblyPath);
121Assert.Equal(Path.Combine(TempRoot.Root, "obj"), project2.CompilationOutputInfo.GeneratedFilesOutputDirectory);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (5)
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (9)
Microsoft.CodeAnalysis.Features (62)
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.Features.Test.Utilities (10)
Microsoft.CodeAnalysis.Features.UnitTests (24)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (19)
122AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.Path, "dt1.cs"))).
238var sourceFilePath = Path.Combine(TempRoot.Root, "test");
250filePath: Path.Combine(TempRoot.Root, "dummy.proj"))
639var newRefOutPath = Path.Combine(TempRoot.Root, "newRef");
941var designTimeOnlyFilePath = Path.Combine(dir.Path, designTimeOnlyFileName);
2243var pathA = Path.Combine(TempRoot.Root, "A.cs");
2244var pathB = Path.Combine(TempRoot.Root, "B.cs");
2245var pathC = Path.Combine(TempRoot.Root, "C.cs");
2246var pathD = Path.Combine(TempRoot.Root, "D.cs");
2247var pathX = Path.Combine(TempRoot.Root, "X");
2248var pathY = Path.Combine(TempRoot.Root, "Y");
2249var pathCommon = Path.Combine(TempRoot.Root, "Common.cs");
2321var pathX = Path.Combine(TempRoot.Root, "X.cs");
2322var pathA = Path.Combine(TempRoot.Root, "A.cs");
2502var pathA = Path.Combine(TempRoot.Root, "A.txt");
2580var sourcePath = Path.Combine(TempRoot.Root, "A.cs");
3928var generatedFilePath = Path.Combine(
4300AddDocument("DocB", source1, filePath: Path.Combine(TempRoot.Root, "DocB.cs")).Project;
4807var filePath = withPath ? Path.Combine(TempRoot.Root, "test.cs") : null;
Microsoft.CodeAnalysis.InteractiveHost (23)
Microsoft.CodeAnalysis.LanguageServer (44)
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (22)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (44)
DefaultFileChangeWatcherTests.cs (33)
42var nonExistentPath = Path.Combine(TempRoot.Root, "NonExistent", "Directory", Guid.NewGuid().ToString());
71var filePath = Path.Combine(tempDirectory.Path, "test.cs");
86var filePath = Path.Combine(otherDir.Path, "test.cs");
100var filePath = Path.Combine(tempDirectory.Path, "test.cs");
113var filePath = Path.Combine(tempDirectory.Path, "test.txt");
128var filePath = Path.Combine(tempDirectory.Path, "multi.txt");
147var filePath = Path.Combine(subDirectory.Path, "nested.cs");
161var nonExistentPath = Path.Combine(TempRoot.Root, "NonExistent", "file.cs");
174var csFilePath = Path.Combine(tempDirectory.Path, "test.cs");
175var vbFilePath = Path.Combine(tempDirectory.Path, "test.vb");
176var txtFilePath = Path.Combine(tempDirectory.Path, "test.txt");
200var filePath = Path.Combine(level3.Path, "deep.cs");
216var filePath = Path.Combine(siblingDir.Path, "test.cs");
231var filePath = Path.Combine(rootDir.Path, "test.cs");
245var filePath = Path.Combine(tempDirectory.Path, "test.txt");
292var filePath = Path.Combine(tempDirectory.Path, "created.cs");
311var filePath = Path.Combine(tempDirectory.Path, "modified.cs");
333var filePath = Path.Combine(tempDirectory.Path, "deleted.cs");
355var filePath = Path.Combine(tempDirectory.Path, "filtered.cs");
374var txtFilePath = Path.Combine(tempDirectory.Path, "filtered.txt");
395var filePath = Path.Combine(subDirectory.Path, "nested.cs");
414var filePath = Path.Combine(tempDirectory.Path, "individual.txt");
437var filePath = Path.Combine(tempDirectory.Path, "individual_modify.txt");
463var filePath = Path.Combine(tempDirectory.Path, "disposed.txt");
495var file1 = Path.Combine(tempDirectory.Path, "file1.cs");
496var file2 = Path.Combine(tempDirectory.Path, "file2.cs");
497var file3 = Path.Combine(tempDirectory.Path, "file3.cs");
522var originalPath = Path.Combine(tempDirectory.Path, "original.cs");
523var renamedPath = Path.Combine(tempDirectory.Path, "renamed.cs");
545var originalPath = Path.Combine(tempDirectory.Path, "original.cs");
546var renamedPath = Path.Combine(tempDirectory.Path, "renamed.cs");
614var filePath = Path.Combine(tempDirectory.Path, "test.cs");
639var filePath = Path.Combine(tempDirectory.Path, "test.cs");
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (27)
Microsoft.CodeAnalysis.PooledObjects.Package (1)
Microsoft.CodeAnalysis.PublicApiAnalyzers (26)
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (3)
Microsoft.CodeAnalysis.Rebuild (2)
Microsoft.CodeAnalysis.Rebuild.UnitTests (14)
RebuildCommandLineTests.cs (14)
26internal static string OutputDirectory { get; } = Path.Combine(TestableCompiler.RootDirectory, "output");
38FilePathToStreamMap.Add(Path.Combine(BuildPaths.WorkingDirectory, filePath), new TestableFile(content));
45filePath = Path.Combine(OutputDirectory, filePath);
55PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "dll"),
60PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "netmodule"),
65PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "dll"),
74PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "exe"),
79PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "exe"),
84PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "exe"),
111Path.GetFileName(peFilePath),
194AddSourceFile(Path.Combine("dir1", "lib1.cs"), @"
228Permutate(new CommandInfo($"lib4.cs {Path.Combine("dir1", "lib1.cs")} /target:library", "test.dll", null),
390AddSourceFile(Path.Combine("dir1", "lib1.vb"), @"
424new CommandInfo(@$"lib2.vb {Path.Combine("dir1", "lib1.vb")} /target:library /debug:embedded", "test.dll", null),
Microsoft.CodeAnalysis.Remote.ServiceHub (9)
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (3)
Microsoft.CodeAnalysis.Remote.Workspaces (4)
Microsoft.CodeAnalysis.ResxSourceGenerator (31)
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (10)
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.Scripting.Desktop.UnitTests (8)
MetadataShadowCopyProviderTests.cs (7)
151AssertEx.SetEqual(new[] { "MultiModule.dll", "mod2.netmodule", "mod3.netmodule" }, scFiles.Select(p => Path.GetFileName(p)));
230Assert.Equal(Path.Combine(Path.GetDirectoryName(sc.PrimaryModule.FullPath), @"a.xml"), sc.DocumentationFile.FullPath);
236Assert.Equal(Path.Combine(Path.GetDirectoryName(sc.PrimaryModule.FullPath), @"el-GR", "a.xml"), sc.DocumentationFile.FullPath);
242Assert.Equal(Path.Combine(Path.GetDirectoryName(sc.PrimaryModule.FullPath), @"a.xml"), sc.DocumentationFile.FullPath);
Microsoft.CodeAnalysis.Scripting.TestUtilities (7)
Microsoft.CodeAnalysis.SemanticSearch.Extensions (1)
Microsoft.CodeAnalysis.Test.Utilities (67)
TestableCompiler.cs (8)
51clientDir: Path.Combine(RootDirectory, "compiler"),
52workingDir: Path.Combine(RootDirectory, "source"),
53sdkDir: Path.Combine(RootDirectory, "sdk"),
78filePath = Path.Combine(BuildPaths.WorkingDirectory, filePath);
86filePath = Path.Combine(BuildPaths.SdkDirectory!, filePath);
94filePath = Path.Combine(BuildPaths.WorkingDirectory, filePath);
174args.Add($@"-vbruntime:""{Path.Combine(buildPaths.SdkDirectory, "Microsoft.VisualBasic.dll")}""");
217fileSystem.Map[Path.Combine(sdkPath, referenceInfo.FileName)] = new TestableFile(referenceInfo.ImageBytes);
Microsoft.CodeAnalysis.Threading.Package (1)
Microsoft.CodeAnalysis.UnitTests (34)
Microsoft.CodeAnalysis.Workspaces (89)
Microsoft.CodeAnalysis.Workspaces.MSBuild (39)
MSBuild\BuildHostProcessManager.cs (7)
35private static string MSBuildWorkspaceDirectory => Path.GetDirectoryName(typeof(BuildHostProcessManager).Assembly.Location) ?? AppContext.BaseDirectory;
36private static bool IsLoadedFromNuGetPackage => File.Exists(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "microsoft.codeanalysis.workspaces.msbuild.nuspec"));
159dotnetPath = Path.GetFullPath(Path.Combine(msbuildLocation.Path, $"../../{DotnetExecutable}"));
310buildHostPath = Path.GetFullPath(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "contentFiles", "any", "any", contentFolderName, assemblyName));
315buildHostPath = Path.Combine(MSBuildWorkspaceDirectory, contentFolderName, assemblyName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (19)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (10)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (69)
NetCoreTests.cs (19)
44var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe");
56RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.Path, "restore.binlog")}");
61var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.Path, "build.binlog")}";
79var projectDir = Path.GetDirectoryName(projectFilePath);
86Assert.Equal(Path.Combine(projectDir, "bin", "Debug", "netcoreapp3.1", "Project.dll"), project.OutputFilePath);
87Assert.Equal(Path.Combine(projectDir, "obj", "Debug", "netcoreapp3.1", "Project.dll"), project.CompilationOutputInfo.AssemblyPath);
108var projectDir = Path.GetDirectoryName(projectFilePath);
109var binLogPath = Path.Combine(projectDir, "build.binlog");
133var projectDir = Path.GetDirectoryName(projectFilePath);
141Assert.Equal(Path.Combine(projectDir, "bin", "Debug", "netcoreapp3.1", "Project.dll"), projectFileInfo.OutputFilePath);
450Assert.Contains(fsharpLib.MetadataReferences, r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "FSharp.Core.dll");
453Assert.EndsWith(Path.Combine("obj", "Debug", "netstandard2.0", "fsharplib.dll"), fsharpLib.CompilationOutputInfo.AssemblyPath);
456var libraryFs = fsharpLib.Documents.Single(d => Path.GetFileName(d.FilePath) == "Library.fs");
474var reference = compilation.References.Single(r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "fsharplib.dll");
519Assert.Contains(fsharpProj.MetadataReferences, r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "FSharp.Core.dll");
520Assert.Contains(fsharpProj.Documents, d => Path.GetFileName(d.FilePath) == "Library.fs");
525Assert.Contains(csharpProj.MetadataReferences, r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "FSharp.Core.dll");
526Assert.Contains(csharpProj.Documents, d => Path.GetFileName(d.FilePath) == "Class1.cs");
662var depsJsonFile = Path.ChangeExtension(BuildHostProcessManager.GetNetCoreBuildHostPath(), "deps.json");
ProjectGuardFiles.cs (10)
19File.WriteAllText(Path.Combine(Path.GetTempPath(), "global.json"),
26File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.props"),
44File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.rsp"),
49File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.targets"),
58File.WriteAllText(Path.Combine(Path.GetTempPath(), "NuGet.Config"),
VisualStudioMSBuildWorkspaceTests.cs (18)
86var fileNames = new HashSet<string>(references.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)));
252Assert.Equal("CSharpProject.dll", Path.GetFileName(p1.OutputFilePath));
253Assert.Equal("VisualBasicProject.dll", Path.GetFileName(p2.OutputFilePath));
267Assert.Equal("CSharpProject.dll", Path.GetFileName(p1.CompilationOutputInfo.AssemblyPath));
268Assert.Equal("VisualBasicProject.dll", Path.GetFileName(p2.CompilationOutputInfo.AssemblyPath));
322Assert.Equal("CSharpProject.dll", Path.GetFileName(p1.OutputFilePath));
817var expectedOutputPath = Path.GetDirectoryName(project.FilePath);
818Assert.Equal(expectedOutputPath, Path.GetDirectoryName(project.OutputFilePath));
835var expectedOutputPath = Path.Combine(Path.GetDirectoryName(project.FilePath), @"bin");
836Assert.Equal(expectedOutputPath, Path.GetDirectoryName(Path.GetFullPath(project.OutputFilePath)));
902], project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)));
1189], project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)));
1553await AssertCSCompilationOptionsAsync("snKey.snk", options => Path.GetFileName(options.CryptoKeyFile));
3109var projectDirectory = Path.GetDirectoryName(projectFilePath);
3197project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)).OrderBy(StringComparer.Ordinal));
3284Assert.Equal("CSharpProject.csproj", Path.GetFileName(csharpProject.FilePath));
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (8)
Microsoft.CodeAnalysis.Workspaces.UnitTests (60)
SolutionTests\SolutionTests.cs (47)
46private static readonly string s_projectDir = Path.GetDirectoryName(typeof(SolutionTests).Assembly.Location)!;
57.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll")))
58.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", SourceText.From("public class Goo { }", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "goo.cs"))
60.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From(editorConfig ?? "#empty", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg"))));
1103.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll")).WithChecksumAlgorithm(SourceHashAlgorithm.Sha1))
1104.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, "proj2", "proj2", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj2.dll")))
1105.AddDocument(d1, "d1.cs", SourceText.From("class D1;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d1.cs"))
1106.AddDocument(d2, "d2.cs", SourceText.From("class D2;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d2.cs"))
1109.AddAnalyzerConfigDocument(c1, "c1", SourceText.From("#empty1", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg"))
1110.AddAnalyzerConfigDocument(c2, "c2", SourceText.From("#empty2", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg"));
1120loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD1;", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))),
1121filePath: Path.Combine(s_projectDir, "newD1.cs"),
1129loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1130filePath: Path.Combine(s_projectDir, "newD3.cs"),
1139loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))),
1140filePath: Path.Combine(s_projectDir, "newA1.txt"),
1148loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1149filePath: Path.Combine(s_projectDir, "newA3.txt"),
1158loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))),
1159filePath: Path.Combine(s_projectDir, "newC1"),
1167loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))),
1168filePath: Path.Combine(s_projectDir, "newC3"),
1175var generatedOutputDir = Path.Combine(TempRoot.Root, "obj");
1176var assemblyPath = Path.Combine(TempRoot.Root, "bin", "assemblyName.dll");
1322var docPath = Path.Combine(s_projectDir, "d.cs");
1325.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "P1", "P1", LanguageNames.CSharp, Path.Combine(s_projectDir, "P1.dll"), parseOptions: parseOptionsA, compilationOptions: compilationOptions))
1336projectId, VersionStamp.Default, "P2", "P2", LanguageNames.CSharp, Path.Combine(s_projectDir, "P2.dll"), parseOptions: parseOptionsB, compilationOptions: compilationOptions,
1359.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll")));
1394.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll")));
1429.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll")));
1464.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll")));
1542var objDir = Path.Combine(TempRoot.Root, "obj");
1543var binDir = Path.Combine(TempRoot.Root, "bin");
1544var otherDir = Path.Combine(TempRoot.Root, "other");
1553.WithOutputFilePath(Path.Combine(binDir, "output.dll"))
1555assemblyPath: Path.Combine(objDir, "output.dll"),
2373var solution4 = solution3.AddAnalyzerConfigDocument(editorConfigId, ".editorconfig", SourceText.From(editorConfigContent), filePath: Path.Combine(s_projectDir, "subfolder", ".editorconfig"));
2394var sourcePathOptions = project2.State.GetAnalyzerOptionsForPath(Path.Combine(s_projectDir, "x.cs"), CancellationToken.None);
2405sourcePathOptions = project2.State.GetAnalyzerOptionsForPath(Path.Combine(s_projectDir, "subfolder", "x.cs"), CancellationToken.None);
2454var filePath = Path.Combine(TempRoot.Root, "x.cs");
2485var filePath = Path.Combine(TempRoot.Root, "x.cs");
2642var filePath = Path.Combine(TempRoot.Root, "x.cs");
2671var filePath = Path.Combine(TempRoot.Root, "x.cs");
5711projectPath = string.IsNullOrEmpty(projectPath) ? projectPath : Path.Combine(TempRoot.Root, projectPath);
5712configPath = Path.Combine(TempRoot.Root, configPath);
5713sourcePath = string.IsNullOrEmpty(sourcePath) ? sourcePath : Path.Combine(TempRoot.Root, sourcePath);
5945.WithCompilationOutputInfo(new CompilationOutputInfo(assemblyPath: Path.Combine(TempRoot.Root, "assembly.dll"), generatedFilesOutputDirectory: null));
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.Data.Analysis.Tests (7)
Microsoft.DotNet.Arcade.Sdk (15)
Microsoft.DotNet.Arcade.Sdk.Tests (23)
Microsoft.DotNet.ArcadeAzureIntegration (2)
Microsoft.DotNet.ArcadeLogging (1)
Microsoft.DotNet.Baselines.Tasks (8)
Microsoft.DotNet.Build.Manifest.Tests (14)
Microsoft.DotNet.Build.Tasks.Feed (28)
src\PublishArtifactsInManifestBase.cs (17)
498string symbolPackageName = Path.GetFileName(symbolAsset.Id);
499string localSymbolPath = Path.Combine(temporarySymbolsDirectory, symbolPackageName);
558int result = await helper.AddPackagesToRequest(requestName, symbolPackages.Select(x => Path.Combine(BlobAssetsBasePath, x.Id)));
800FileInfo pdbStagingPath = new(Path.Combine(pdbStagePath, subPath));
824string extension = Path.GetExtension(looseFile);
827string relativePath = Path.GetRelativePath(pdbArtifactsBasePath, looseFile);
828FileInfo looseFileStagePath = new(Path.Combine(pdbStagePath, relativePath));
1230Path.Combine(PackageAssetsBasePath, $"{package.Id}.{package.Version}.nupkg");
1273Path.GetFullPath(Path.Combine(ArtifactsBasePath, Guid.NewGuid().ToString()));
1275string localPackagePath = Path.Combine(temporaryPackageDirectory, packageFilename);
1585Path.GetFullPath(Path.Combine(ArtifactsBasePath, Guid.NewGuid().ToString()));
1667var fileName = Path.GetFileName(targetBlobPath);
1668var localBlobPath = Path.Combine(temporaryBlobDirectory, fileName);
1747var fileName = Path.GetFileName(asset.Id);
1748var localBlobPath = Path.Combine(BlobAssetsBasePath, fileName);
Microsoft.DotNet.Build.Tasks.Feed.Tests (16)
Microsoft.DotNet.Build.Tasks.Installers (78)
src\CreateWixBuildWixpack.cs (49)
98WixpackWorkingDir = Path.Combine(Path.GetTempPath(), "WixpackTemp", Guid.NewGuid().ToString().Split('-')[0]);
101_installerFilename = Path.GetFileName(InstallerFile);
114string destPath = Path.Combine(WixpackWorkingDir, Path.GetFileName(projectPath));
147OutputFile = Path.Combine(OutputFolder, $"{_installerFilename}{_packageExtension}");
179var randomDirName = Path.GetRandomFileName();
182CopyDirectoryRecursive(fullSourceDir, Path.Combine(WixpackWorkingDir, randomDirName));
201var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
262_defineConstantsDictionary["ProjectPath"] = Path.GetFileName(projectPath);
280_defineConstantsDictionary["TargetPath"] = Path.Combine("%outputfolder%", Path.GetFileName(targetPath));
284InstallerFile = Path.Combine("%outputfolder%", Path.GetFileName(InstallerFile));
292PdbFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(PdbFile.ItemSpec));
298BindTrackingFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(BindTrackingFile.ItemSpec));
426commandLineArgs.Add($"{Path.GetFileName(sourceFile.ItemSpec)}");
432File.WriteAllText(Path.Combine(WixpackWorkingDir, "create.rsp"), string.Join(System.Environment.NewLine, commandLineArgs));
446File.WriteAllText(Path.Combine(WixpackWorkingDir, "create.cmd"), createCmdFileContents.ToString());
518var copiedXmlPath = Path.Combine(WixpackWorkingDir, Path.GetFileName(xmlPath));
520string sourceFileFolder = Path.GetDirectoryName(xmlPath);
597var filePath = Path.Combine(dir, Path.GetFileName(source));
598CopySourceFile(Path.GetFileName(dir), filePath);
609id = Path.GetFileName(source);
615var newSourceValue = $"{id}\\{Path.GetFileName(source)}";
653string id = Path.GetFileName(includeFilePath);
666var potentialPath = Path.Combine(WixpackWorkingDir, searchPath, Path.GetFileName(includeFilePath));
1016var destDir = Path.Combine(WixpackWorkingDir, fileId);
1023var destPath = Path.Combine(destDir, Path.GetFileName(source));
1038string filename = Path.GetFileName(extensionPath);
1042Extensions[i] = new TaskItem(Path.Combine(filename, filename));
1054string wixpackSubfolder = Path.GetRandomFileName();
1081string filename = Path.GetFileName(localizationPath);
1085LocalizationFiles[i] = new TaskItem(Path.Combine(filename, filename));
1092if (!Path.IsPathRooted(source))
1095Path.Combine(_wixprojDir, source) :
1096Path.Combine(relativeRoot, source);
1108File.Copy(file, Path.Combine(destDir, Path.GetFileName(file)), overwrite: true);
1113CopyDirectoryRecursive(dir, Path.Combine(destDir, Path.GetFileName(dir)));
src\CreateWixCommandPackageDropBase.cs (17)
67OutputFile = Path.Combine(OutputFolder, $"{Path.GetFileName(InstallerFile)}{_packageExtension}");
81string commandFilename = Path.Combine(packageDropOutputFolder, $"create.cmd");
97commandString.Append($" -out %outputfolder%{Path.GetFileName(InstallerFile)}");
106commandString.Append($" -loc {Path.GetFileName(locItem.ItemSpec)}");
120commandString.Append($" {Path.GetFileName(wixSrcFile.ItemSpec)}");
144string newWixSrcFilePath = Path.Combine(packageDropOutputFolder, Path.GetFileName(wixSrcFile.ItemSpec));
147string wixSrcFileExtension = Path.GetExtension(wixSrcFile.ItemSpec);
176var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(locItem.ItemSpec));
283else if (!Path.IsPathRooted(oldPath))
292var possiblePath = Path.Combine(additionalBasePath.ItemSpec, oldPath);
310newRelativePath = Path.Combine(id, Path.GetFileName(oldPath));
325string newFolder = Path.Combine(outputPath, id);
331File.Copy(oldPath, Path.Combine(outputPath, newRelativePath), true);
Microsoft.DotNet.Build.Tasks.Packaging (63)
NuGetPack.cs (13)
23@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar),
24@"src\**\*".Replace('\\', Path.DirectorySeparatorChar)
31@"content\**\*".Replace('\\', Path.DirectorySeparatorChar),
32@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar)
204string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory;
255return Path.Combine(nupkgOutputDirectory, $"{id}.{version}{nupkgExtension}");
260bool creatingSymbolsPackage = packSymbols && (Path.GetExtension(nupkgPath) == _symbolsPackageExtension);
265string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory;
302var directory = Path.GetDirectoryName(nupkgPath);
359if(Path.GetFileName(fileName) == "runtime.json" && file.Target == "")
361string packedPackageSourcePath = Path.Combine(Path.GetDirectoryName(fileName), string.Join(".", _packageNamePrefix, Path.GetFileName(fileName)));
Microsoft.DotNet.Build.Tasks.Packaging.Tests (5)
Microsoft.DotNet.Build.Tasks.Templating (2)
Microsoft.DotNet.Build.Tasks.Templating.Tests (11)
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
Microsoft.DotNet.Build.Tasks.VisualStudio.Tests (34)
OptProf\GenerateTrainingInputFilesTests.cs (24)
136var temp = Path.GetTempPath();
137var dir = Path.Combine(temp, Guid.NewGuid().ToString());
140var configPath = Path.Combine(dir, "OptProf.json");
143var insertionDir = Path.Combine(dir, "Insertion");
145CreateVsix(Path.Combine(insertionDir, "Setup.vsix"), manifestContent: s_manifestJson);
147var outputDir = Path.Combine(dir, "Output");
161Path.Combine(outputDir, @"DDRIT.RPS.CSharp"),
162Path.Combine(outputDir, @"TeamEng"),
163Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations"),
164Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging"),
165Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner"),
166Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.0.IBC.json"),
167Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.1.IBC.json"),
168Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\xyzMicrosoft.CodeAnalysis.0.IBC.json"),
169Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"),
170Path.Combine(outputDir, @"TeamEng\Configurations"),
171Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble"),
172Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.0.IBC.json"),
173Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"),
174Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.VisualBasic.0.IBC.json")
178var json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.0.IBC.json"));
189json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.1.IBC.json"));
200json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"));
210json = File.ReadAllText(Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.VisualBasic.0.IBC.json"));
Microsoft.DotNet.Build.Tasks.Workloads (60)
Msi\MsiBase.wix.cs (4)
129CompilerOutputPath = Utils.EnsureTrailingSlash(Path.Combine(baseIntermediateOutputPath, "wixobj", metadata.Id, $"{metadata.PackageVersion}", platform));
130WixSourceDirectory = Path.Combine(baseIntermediateOutputPath, "src", "wix", metadata.Id, $"{metadata.PackageVersion}", platform);
155string eulaRtf = Path.Combine(WixSourceDirectory, "eula.rtf");
247NuGetPackageFiles[Path.GetFullPath(msiJsonPath)] = "\\data\\msi.json";
Microsoft.DotNet.Build.Tasks.Workloads.Tests (83)
CreateVisualStudioWorkloadTests.cs (17)
26string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WL");
35new TaskItem(Path.Combine(TestBase.TestAssetsPath, "microsoft.net.workload.emscripten.manifest-6.0.200.6.0.4.nupkg"))
95Path.Combine(Path.GetDirectoryName(
100Path.Combine(Path.GetDirectoryName(
128string manifestMsiSwr = File.ReadAllText(Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200", "Emscripten.Manifest-6.0.200", "x64", "msi.swr"));
137string swixRootDirectory = Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200");
144string packMsiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(pythonPackSwixItem.ItemSpec), "msi.swr"));
162string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WLa64");
171new TaskItem(Path.Combine(TestBase.TestAssetsPath, "microsoft.net.workload.emscripten.manifest-6.0.200.6.0.4.nupkg"))
230Path.Combine(Path.GetDirectoryName(
250string manifestMsiSwr = File.ReadAllText(Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200", "Emscripten.Manifest-6.0.200", "arm64", "msi.swr"));
MsiTests.cs (9)
23string packageRootDirectory = Path.Combine(PackageRootDirectory, Guid.NewGuid().ToString("N"));
35ITaskItem msi603 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg"),
36msiOutputPath: Path.Combine(MsiOutputPath, "mrec"));
48ITaskItem msi603 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg"));
52ITaskItem msi604 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.4.nupkg"));
82string packageRootDirectory = Path.Combine(PackageRootDirectory, Guid.NewGuid().ToString("N"));
83TaskItem packageItem = new(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg"));
112string packageRootDirectory = Path.Combine(PackageRootDirectory, Guid.NewGuid().ToString("N"));
113string packagePath = Path.Combine(TestAssetsPath, "microsoft.ios.templates.15.2.302-preview.14.122.nupkg");
SwixComponentTests.cs (27)
19public string RandomPath => Path.Combine(AppContext.BaseDirectory, "obj", Path.GetFileNameWithoutExtension(Path.GetTempFileName()));
31string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
35string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr"));
60string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
65string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr"));
89string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
94string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr"));
115string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
129string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
158string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr"));
174string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
189string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr"));
198return WorkloadManifestReader.ReadWorkloadManifest(Path.GetFileNameWithoutExtension(filename),
199File.OpenRead(Path.Combine(TestAssetsPath, filename)), filename);
Microsoft.DotNet.CMake.Sdk (11)
src\GetCMakeArtifactsFromFileApi.cs (9)
48string replyDir = Path.Combine(CMakeOutputDir, ".cmake", "api", "v1", "reply");
82string codeModelFile = Path.Combine(replyDir, index.Reply.ClientReply.CodemodelV2.JsonFile);
104string normalizedSourceDir = Path.GetFullPath(SourceDirectory).Replace('\\', '/').TrimEnd('/');
130if (!Path.IsPathRooted(dirSource))
132dirSource = Path.Combine(sourceRoot, dirSource);
133dirSource = Path.GetFullPath(dirSource).Replace('\\', '/').TrimEnd('/');
165string targetFile = Path.Combine(replyDir, target.JsonFile);
184string fullPath = Path.Combine(CMakeOutputDir, artifact.Path);
185fullPath = Path.GetFullPath(fullPath);
Microsoft.DotNet.CodeAnalysis (2)
Microsoft.DotNet.GenAPI (1)
Microsoft.DotNet.GenFacades (6)
Microsoft.DotNet.Helix.JobSender (3)
Microsoft.DotNet.Helix.JobSender.Tests (1)
Microsoft.DotNet.Helix.Sdk (16)
Microsoft.DotNet.Helix.Sdk.Tests (4)
Microsoft.DotNet.Internal.SymbolHelper (21)
Microsoft.DotNet.MacOsPkg.Core (16)
Microsoft.DotNet.MacOsPkg.Tests (26)
UnpackPackTests.cs (26)
23private static readonly string pkgToolPath = Path.Combine(
24Path.GetDirectoryName(typeof(UnpackPackTests).Assembly.Location)!,
44(Path.Combine("Payload", "Sample.txt"), nonExecutableFileMode),
51(Path.Combine("Payload", "test.app"), nonExecutableFileMode),
56(Path.Combine("Contents", "Info.plist"), nonExecutableFileMode),
57(Path.Combine("Contents", "MacOS", "main"), executableFileMode),
58(Path.Combine("Contents", "Resources", "libexample.dylib"), executableFileMode)
78string unpackPath = Path.GetTempFileName();
91string unpackPath = Path.GetTempFileName();
104string unpackPkgPath = Path.GetTempFileName();
105string unpackAppPath = Path.GetTempFileName();
111Unpack(Path.Combine(unpackPkgPath, "Payload", "test.app"), unpackAppPath, appFiles);
119string unpackPath = Path.GetTempFileName();
132string unpackInstallerPath = Path.GetTempFileName();
133string unpackComponentPath = Path.GetTempFileName();
136string componentPkgPath = Path.Combine(unpackInstallerPath, "Simple.pkg");
150string unpackInstallerPath = Path.GetTempFileName();
151string unpackComponentPath = Path.GetTempFileName();
152string unpackAppPath = Path.GetTempFileName();
155string componentPkgPath = Path.Combine(unpackInstallerPath, "WithApp.pkg");
156string appPath = Path.Combine(unpackComponentPath, "Payload", "test.app");
207string unpackPath = Path.GetTempFileName();
235return Path.Combine(
236Path.GetDirectoryName(typeof(UnpackPackTests).Assembly.Location)!,
241private static string GetTempPkgPath() => $"{Path.GetTempFileName()}.pkg";
243private static string GetTempAppPath() => $"{Path.GetTempFileName()}.app";
Microsoft.DotNet.NuGetRepack.Tasks (8)
Microsoft.DotNet.NuGetRepack.Tests (41)
VersionUpdaterTests.cs (37)
59var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
63File.WriteAllBytes(a_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameA), TestResources.DailyBuildPackages.TestPackageA);
64File.WriteAllBytes(b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB);
65File.WriteAllBytes(c_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameC), TestResources.DailyBuildPackages.TestPackageC);
66File.WriteAllBytes(d_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameD), TestResources.DailyBuildPackages.TestPackageD);
67File.WriteAllBytes(g_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameG), TestResources.DailyBuildPackages.TestPackageG);
69var a_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameA);
70var b_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameB);
71var c_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameC);
72var d_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameD);
73var g_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameG);
75var a_rel = Path.Combine(dir, TestResources.ReleasePackages.NameA);
76var b_rel = Path.Combine(dir, TestResources.ReleasePackages.NameB);
77var c_rel = Path.Combine(dir, TestResources.ReleasePackages.NameC);
78var d_rel = Path.Combine(dir, TestResources.ReleasePackages.NameD);
79var g_rel = Path.Combine(dir, TestResources.ReleasePackages.NameG);
102var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
106File.WriteAllBytes(e_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameE), TestResources.DailyBuildPackages.TestPackageE);
107File.WriteAllBytes(f_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameF), TestResources.DailyBuildPackages.TestPackageF);
109var e_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameE);
110var f_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameF);
112var e_rel = Path.Combine(dir, TestResources.ReleasePackages.NameE);
113var f_rel = Path.Combine(dir, TestResources.ReleasePackages.NameF);
130var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
134File.WriteAllBytes(a_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameA), TestResources.DailyBuildPackages.TestPackageA);
135File.WriteAllBytes(b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB);
136File.WriteAllBytes(c_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameC), TestResources.DailyBuildPackages.TestPackageC);
169var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
170var outputDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
174File.WriteAllBytes(dotnet_tool = Path.Combine(dir, TestResources.MiscPackages.NameDotnetTool), TestResources.MiscPackages.DotnetTool);
176File.WriteAllBytes(normal_package_b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB);
181Assert.Single(Directory.EnumerateFiles(outputDir), fullPath => Path.GetFileNameWithoutExtension(fullPath) == "TestPackageB.1.0.0");
Microsoft.DotNet.Open.Api.Tools.Tests (40)
Microsoft.DotNet.PackageTesting (5)
Microsoft.DotNet.RemoteExecutor (16)
Microsoft.DotNet.SetupNugetSources.Tests (41)
Microsoft.DotNet.SharedFramework.Sdk (17)
Microsoft.DotNet.SignCheckLibrary (53)
Microsoft.DotNet.SignCheckTask (15)
Microsoft.DotNet.SignTool (101)
Microsoft.DotNet.SignTool.Tests (188)
Microsoft.DotNet.SourceBuild.Tasks (9)
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (4)
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
Microsoft.DotNet.VersionTools.Cli (1)
Microsoft.DotNet.XliffTasks (48)
Tasks\TransformTemplates.cs (14)
63string templateName = Path.GetFileNameWithoutExtension(template.ItemSpec);
65string templateDirectory = Path.GetDirectoryName(templatePath);
70? Path.Combine(TranslatedOutputDirectory, $"{templateName}.default.1033")
71: Path.Combine(TranslatedOutputDirectory, $"{templateName}.{language}");
73string cultureSpecificTemplateFile = Path.Combine(localizedTemplateDirectory, Path.GetFileName(template.ItemSpec));
79string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value);
80File.Copy(projectFileFullPath, Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value)), overwrite: true);
86string templateItemFullPath = Path.Combine(templateDirectory, templateItem.Value);
87string templateItemDestinationPath = Path.Combine(localizedTemplateDirectory, templateItem.Value);
104Path.GetFileNameWithoutExtension(unstructuredResource.ItemSpec),
107Path.GetExtension(unstructuredResource.ItemSpec));
108File.Copy(Path.Combine(TranslatedOutputDirectory, localizedFileName), templateItemDestinationPath, overwrite: true);
Microsoft.DotNet.XliffTasks.Tests (7)
Microsoft.DotNet.XUnitAssert.Tests (3)
Microsoft.Extensions.AI.Abstractions (4)
Microsoft.Extensions.AI.Abstractions.Tests (47)
Contents\DataContentTests.cs (47)
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");
608Assert.Equal(filename, Path.GetFileName(savedPath));
636Assert.Equal(content.Name, Path.GetFileName(savedPath));
664Assert.Equal(content.Name, Path.GetFileName(savedPath));
706string tempDir = Path.Combine(Path.GetTempPath(), $"test_subdir_{Guid.NewGuid()}");
707string subDir = Path.Combine(tempDir, "subdir");
712string filePath = Path.Combine(subDir, "nested.html");
739string tempDir = Path.Combine(Path.GetTempPath(), $"test_dir_noname_{Guid.NewGuid()}");
766string tempPath = Path.Combine(Path.GetTempPath(), $"test_cancel_{Guid.NewGuid()}.txt");
797string tempPath = Path.Combine(Path.GetTempPath(), $"test_save_cancel_{Guid.NewGuid()}.bin");
837string tempDir = Path.Combine(Path.GetTempPath(), $"test_dir_name_{Guid.NewGuid()}");
839string expectedPath = Path.Combine(tempDir, content.Name);
865string tempDir = Path.Combine(Path.GetTempPath(), $"test_nonexist_{Guid.NewGuid()}");
867string filePath = Path.Combine(tempDir, "newfile");
894string tempPath = Path.Combine(Path.GetTempPath(), $"test_large_{Guid.NewGuid()}.bin");
923string tempPath = Path.Combine(Path.GetTempPath(), $"test_save_large_{Guid.NewGuid()}.bin");
946string tempPath = Path.Combine(Path.GetTempPath(), $"test_existing_{Guid.NewGuid()}.bin");
Microsoft.Extensions.AI.Evaluation.Console (7)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
Microsoft.Extensions.AI.Evaluation.Reporting (18)
Storage\DiskBasedResultStore.cs (11)
48storageRootPath = Path.GetFullPath(storageRootPath);
49_resultsRootPath = Path.Combine(storageRootPath, "results");
93new DirectoryInfo(Path.Combine(_resultsRootPath, result.ExecutionName, result.ScenarioName));
97var resultFile = new FileInfo(Path.Combine(resultDir.FullName, $"{result.IterationName}.json"));
123var executionDir = new DirectoryInfo(Path.Combine(_resultsRootPath, executionName));
133new DirectoryInfo(Path.Combine(_resultsRootPath, executionName, scenarioName));
143new FileInfo(Path.Combine(_resultsRootPath, executionName, scenarioName, $"{iterationName}.json"));
235yield return Path.GetFileNameWithoutExtension(resultFile.Name);
263var executionDir = new DirectoryInfo(Path.Combine(_resultsRootPath, executionName));
296var scenarioDir = new DirectoryInfo(Path.Combine(executionDir.FullName, scenarioName));
332var resultFile = new FileInfo(Path.Combine(scenarioDir.FullName, $"{iterationName}.json"));
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (19)
Microsoft.Extensions.AI.OpenAI (3)
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.ApiDescription.Client (3)
Microsoft.Extensions.ApiDescription.Client.Tests (80)
GetOpenApiReferenceMetadataTest.cs (22)
23var identity = Path.Combine("TestProjects", "files", "NSwag.json");
25var outputPath = Path.Combine("obj", "NSwagClient.cs");
77var identity = Path.Combine("TestProjects", "files", "NSwag.json");
80var outputPath = Path.Combine("obj", $"NSwagClient.cs");
138var identity = Path.Combine("TestProjects", "files", "NSwag.json");
140var outputPath = Path.Combine("obj", "NSwagClient.cs");
197var identity = Path.Combine("TestProjects", "files", "NSwag.json");
200var outputPath = Path.Combine(Path.GetTempPath(), $"{className}.cs");
258var identity1 = Path.Combine("TestProjects", "files", "NSwag.json");
259var identity2 = Path.Combine("TestProjects", "files", "swashbuckle.json");
304var identity = Path.Combine("TestProjects", "files", "NSwag.json");
306var error = Resources.FormatDuplicateFileOutputPaths(Path.Combine("obj", "NSwagClient.cs"));
349var identity = Path.Combine("TestProjects", "files", "NSwag.json");
353var expectedOutputPath = Path.Combine("bin", outputPath);
415var identity = Path.Combine("TestProjects", "files", "NSwag.json");
417var expectedOutputPath = Path.Combine("bin", outputPath);
473var identity12 = Path.Combine("TestProjects", "files", "NSwag.json");
474var identity3 = Path.Combine("TestProjects", "files", "swashbuckle.json");
483var outputPath1 = Path.Combine("obj", $"{className12}.cs");
484var outputPath2 = Path.Combine("obj", $"{className12}.ts");
485var outputPath3 = Path.Combine("obj", $"{className3}.cs");
TargetTest.cs (48)
19private static string _assemblyLocation = Path.GetDirectoryName(_assembly.Location);
38var directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "build"));
41file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true);
43directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "build"));
46file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true);
50directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "files"));
53file.CopyTo(Path.Combine(files.Root, file.Name), overwrite: true);
60file.CopyTo(Path.Combine(tasks.Root, file.Name), overwrite: true);
80Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "azureMonitorClient.cs")}", process.Output);
81Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output);
103Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output);
104Assert.Contains($"TypeScriptCompile: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output);
123Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "azureMonitorClient.cs")}", process.Output);
124Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "NSwagClient.cs")}", process.Output);
125Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "swashbuckleClient.cs")}", process.Output);
126Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output);
127Assert.Contains($"FileWrites: {Path.Combine("obj", "NSwagClient.cs")}", process.Output);
128Assert.Contains($"FileWrites: {Path.Combine("obj", "swashbuckleClient.cs")}", process.Output);
149Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}", process.Output);
150Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}", process.Output);
152$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}",
155$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}",
178$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
180$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
203$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
205$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
228$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
230$"Options: '' OutputPath: '{Path.Combine("generated", "azureMonitorClient.cs")}'",
255$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
257$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
280$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
282$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'",
305$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
307$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
330$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
332$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
357$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
359$"Options: '' OutputPath: '{Path.Combine("obj", "Custom.cs")}'",
381$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
383$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
387$"{Path.Combine(_temporaryDirectory.Root, "files", "NSwag.json")} " +
389$"Options: '' OutputPath: '{Path.Combine("obj", "NSwagClient.cs")}'",
393$"{Path.Combine(_temporaryDirectory.Root, "files", "swashbuckle.json")} " +
395$"Options: '' OutputPath: '{Path.Combine("obj", "swashbuckleClient.cs")}'",
422$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
424$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
428$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
430$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'",
Microsoft.Extensions.ApiDescription.Tool.Tests (59)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
Microsoft.Extensions.Configuration.FileExtensions (7)
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.FileProviders.Embedded (9)
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
Microsoft.Extensions.FileProviders.Physical (22)
Microsoft.Extensions.FileSystemGlobbing (27)
InMemoryDirectoryInfo.cs (22)
18private static readonly char[] DirectorySeparators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
54Name = 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);
148return new InMemoryDirectoryInfo(Path.Combine(FullName, path), _files, true, _comparisonType);
152string normPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
164string normPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Microsoft.Extensions.Hosting (5)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Localization (4)
Microsoft.Extensions.Localization.Tests (5)
Microsoft.Extensions.Logging.AzureAppServices (4)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.ML.Tests (2)
Microsoft.Extensions.SecretManager.Tools.Tests (41)
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.Extensions.Validation.GeneratorTests (2)
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 (8)
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.McpServer.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.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.GenAI.Core.Tests (1)
Microsoft.ML.GenAI.LLaMA (3)
Microsoft.ML.GenAI.LLaMA.Tests (1)
Microsoft.ML.GenAI.Mistral (3)
Microsoft.ML.GenAI.Phi (5)
Microsoft.ML.GenAI.Phi.Tests (3)
Microsoft.ML.GenAI.Samples (11)
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 (35)
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 (53)
TensorflowTests.cs (50)
36tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
37assetsPath = Path.Combine(tempFolder, "assets");
38parentWorkspacePath = Path.Combine(assetsPath, "cached");
69string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs",
76_fullImagesetFolderPath = Path.Combine(
138var imageFolder = Path.GetDirectoryName(dataFile);
505var imageFolder = Path.GetDirectoryName(dataFile);
541var imageFolder = Path.GetDirectoryName(dataFile);
766var varDir = Path.Combine(modelLocation, "variables");
1011var imageFolder = Path.GetDirectoryName(dataFile);
1070var imageFolder = Path.GetDirectoryName(dataFile);
1113var imageFolder = Path.GetDirectoryName(dataFile);
1148var imageFolder = Path.GetDirectoryName(dataFile);
1185var mlModelLocation = DeleteOutputPath(Path.ChangeExtension(modelLocation, ".zip"));
1225var imageFolder = Path.GetDirectoryName(dataFile);
1449if (Directory.Exists(workspacePath) && File.Exists(Path.Combine(workspacePath, trainSetBottleneckCachedValuesFileName))
1450&& File.Exists(Path.Combine(workspacePath, validationSetBottleneckCachedValuesFileName)))
1465string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int)arch);
1565ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg")
1571ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg")
1724ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg")
1730ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg")
1750Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.TrainSetBottleneckCachedValuesFileName)));
1751Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.ValidationSetBottleneckCachedValuesFileName)));
1752Assert.True(File.Exists(Path.Combine(Path.GetTempPath(), "MLNET", ImageClassificationTrainer.ModelFileName[options.Arch])));
1844string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs",
1850string fullImagesetFolderPath = Path.Combine(
1924if (Path.GetExtension(file) != ".jpg")
1927var label = Path.GetFileName(file);
1958UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);
1960if (!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias)))
1961Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder, "FPTSUT"));
1971UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder);
1973return Path.GetFileNameWithoutExtension(fileName);
1979destFileName = url.Split(Path.DirectorySeparatorChar).Last();
1983string relativeFilePath = Path.Combine(destDir, destFileName);
1996var directory = Path.GetDirectoryName(errorResult.FileName);
1997var name = Path.GetFileName(errorResult.FileName);
2007var flag = gzArchiveName.Split(Path.DirectorySeparatorChar)
2012if (File.Exists(Path.Combine(destFolder, flag)))
2016File.Create(Path.Combine(destFolder, flag));
2039string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
2054string 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 (18)
Microsoft.ML.Tests (49)
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 (28)
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.VisualBasic.Core (78)
Microsoft\VisualBasic\FileIO\FileSystem.vb (60)
71baseDirectory = IO.Path.GetFullPath(baseDirectory) ' Throw exceptions if BaseDirectoryPath is invalid.
73Return NormalizePath(IO.Path.Combine(baseDirectory, relativePath))
92(file.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) Or
93file.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) Then
223Return IO.Path.GetFileName(path)
234''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath: If path is an invalid path.</exception>
241IO.Path.GetFullPath(path)
246Return IO.Path.GetDirectoryName(path.TrimEnd(
247IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar))
476directory = IO.Path.GetFullPath(directory)
545''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath() exceptions: if FilePath is invalid.</exception>
656''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If directory is invalid.</exception>
663directory = IO.Path.GetFullPath(directory)
699''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If file is invalid.</exception>
837''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath for possible exceptions.</exception>
840Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path)))
852If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or
853path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then
883''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If SourceDirectoryPath or TargetDirectoryPath is invalid.
938If TargetDirectoryFullPath.Chars(SourceDirectoryFullPath.Length) = IO.Path.DirectorySeparatorChar Then
965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source")
966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target")
1041CopyOrMoveFile(Operation, SubFilePath, IO.Path.Combine(SourceDirectoryNode.TargetPath, IO.Path.GetFileName(SubFilePath)),
1083''' <exception cref="IO.Path.GetFullPath">
1186Dim directoryFullPath As String = IO.Path.GetFullPath(directory)
1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath)
1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path)
1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path)
1464Dim FullPath As String = RemoveEndingSeparator(IO.Path.GetFullPath(IO.Path.Combine(Path, NewName)))
1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path")
1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1")
1498Return DInfo.GetFiles(IO.Path.GetFileName(FullPath))(0).FullName
1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1,
1502Return DInfo.GetDirectories(IO.Path.GetFileName(FullPath))(0).FullName
1538Path1 = Path1.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar)
1539Path2 = Path2.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar)
1540Return String.Equals(IO.Path.GetPathRoot(Path1), IO.Path.GetPathRoot(Path2), StringComparison.OrdinalIgnoreCase)
1556If Not IO.Path.IsPathRooted(Path) Then
1560Path = Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar)
1561Return String.Equals(Path, IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase)
1571If IO.Path.IsPathRooted(Path) Then
1576If Path.Equals(IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) Then
1582Return Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar)
1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath")
1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath")
1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path")
2056IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar, IO.Path.VolumeSeparatorChar}
2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath")
2103Dim SubTargetDirPath As String = IO.Path.Combine(m_TargetPath, IO.Path.GetFileName(SubDirPath))
Microsoft.VisualBasic.Forms.Tests (20)
Microsoft.VisualBasic.IntegrationTests (2)
Microsoft.VisualBasic.Tests (51)
Microsoft\VisualBasic\MyServices\FileSystemProxyTests.cs (48)
40Assert.Equal(_fileSystem.CombinePath(Root, "Test2"), Path.Join(Root, "Test2"));
48Assert.Equal(_fileSystem.CombinePath(TestDirectory, "Test"), Path.Join(TestDirectory, "Test"));
54string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory");
61string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory");
79string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory");
80string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory");
109string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory");
110string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory");
182string FullPathToNewDirectory = Path.Join(TestDirectory, "NewDirectory");
208string FullPathToNewDirectory = Path.Join(TestDirectory, "NewDirectory");
220string FullPathToNewDirectory = Path.Join(TestDirectory, "NewDirectory");
245Assert.False(_fileSystem.DirectoryExists(Path.Join(TestDirectory, "NewDirectory")));
272Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_DirectoryNewSubDirectory{i}"));
279Assert.Contains(Path.Join(TestDirectory, $"GetDirectories_DirectoryNewSubDirectory{i}"), DirectoryList);
282Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_DirectoryNewSubDirectory0", $"NewSubSubDirectory"));
294Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_Directory_SearchOptionNewSubDirectory{i}"));
301Assert.Contains(Path.Join(TestDirectory, $"GetDirectories_Directory_SearchOptionNewSubDirectory{i}"), DirectoryList);
304Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_Directory_SearchOptionNewSubDirectory0", $"NewSubSubDirectory"));
319CreatedDirectories.Add(Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory00{i}")).Name);
326string DirectoryName = Path.Join(TestDirectory, $"NewSubDirectory00{i}");
330Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory000", $"NewSubSubDirectory000"));
342Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory{i}"));
345Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory0", $"NewSubSubDirectory"));
403Assert.Contains(Path.Join(TestDirectory, $"NewFile{i}"), FileList);
406Directory.CreateDirectory(Path.Join(TestDirectory, "GetFiles_DirectoryNewSubDirectory"));
415string NewSubDirectoryPath = Path.Join(TestDirectory, "GetFiles_Directory_SearchOptionNewSubDirectory");
430Assert.Contains(Path.Join(TestDirectory, $"NewFile{i}"), FileList);
459string NewSubDirectoryPath = Path.Join(TestDirectory, "GetFiles_Directory_SearchOption_WildcardsNewSubDirectory");
470Assert.Equal(_fileSystem.GetName(TestDirectory), Path.GetFileName(TestDirectory));
476Assert.Equal(_fileSystem.GetParentPath(TestDirectory), Path.GetDirectoryName(TestDirectory));
491string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory");
492string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory");
517string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory");
518string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory");
555string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory");
556string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory");
578string DestinationFileNameWithPath = Path.Join(TestDirectory, "NewName");
596string DestinationFileNameWithPath = Path.Join(TestDirectory, "NewName");
613string DestinationFileNameWithPath = Path.Join(TestDirectory, "NewName");
641Assert.Throws<DirectoryNotFoundException>(() => _fileSystem.RenameDirectory(Path.Join(TestDirectory, "DoesNotExistDirectory"), "NewDirectory"));
642string OrigDirectoryWithPath = Path.Join(TestDirectory, "OriginalDirectory");
646string DirectoryNameWithPath = Path.Join(TestDirectory, "DoesNotExist");
650string NewFDirectoryPath = Path.Join(TestDirectory, "NewFDirectory");
665Assert.Throws<FileNotFoundException>(() => _fileSystem.RenameFile(Path.Join(TestDirectory, "DoesNotExistFile"), "NewFile"));
673string NewFileWithPath = Path.Join(TestDirectory, "NewFile");
678Directory.CreateDirectory(Path.Join(TestDirectory, "NewFDirectory"));
701TempFileNameWithPath = Path.Join(TempFileNameWithPath, PathFromBase);
704TempFileNameWithPath = Path.Join(TempFileNameWithPath, TestFileName);
Microsoft.VisualStudio.Extensibility.Testing.Xunit (36)
src\VisualStudio\IntegrationTest\Harness\XUnitShared\Harness\VisualStudioInstanceFactory.cs (26)
21using Path = System.IO.Path;
174var harnessAssemblyDirectory = Path.GetDirectoryName(typeof(VisualStudioInstanceFactory).Assembly.CodeBase);
188var productDir = Path.GetFullPath(result.GetInstallationPath());
223vsInstallDir = Path.GetFullPath(Path.Combine(vsInstallDir, @"..\.."));
234vsInstallDir = Path.GetFullPath(vsInstallDir);
235vsInstallDir = vsInstallDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
240installationPath = Path.GetFullPath(installationPath);
241installationPath = installationPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
266installationPath = Path.GetFullPath(installationPath);
267installationPath = installationPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
305var vsExeFile = Path.Combine(installationPath, @"Common7\IDE\devenv.exe");
306var vsRegEditExeFile = Path.Combine(installationPath, @"Common7\IDE\VsRegEdit.exe");
307var vsixInstallerExeFile = Path.Combine(installationPath, @"Common7\IDE\VSIXInstaller.exe");
309var temporaryFolder = Path.Combine(Path.GetTempPath(), "vs-extension-testing", Path.GetRandomFileName());
366var installerLog = Path.Combine(Path.GetTempPath(), logFileName);
369var logDestination = Path.Combine(logDir, logFileName);
441var path = Path.Combine(temporaryFolder, extensionFileName);
477ScreenshotService.TakeScreenshot(Path.Combine(Path.GetFullPath(directory), commandBeingExecuted, $"_after_{count * ReportTimeMinute}_min.png"));
Microsoft.VisualStudio.LanguageServices (65)
Microsoft.VisualStudio.LanguageServices.CSharp (5)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (35)
Microsoft.VisualStudio.LanguageServices.DevKit (1)
Microsoft.VisualStudio.LanguageServices.Implementation (20)
Microsoft.VisualStudio.LanguageServices.LiveShare (7)
Microsoft.Web.Xdt.Extensions.Tests (4)
mscorlib (1)
Mvc.Analyzers.Test (1)
Mvc.Api.Analyzers.Test (3)
netstandard (1)
NonDISample (1)
Pipelines.AppHost (6)
Pipelines.Library (4)
PrepareTests (41)
MinimizeUtil.cs (28)
27var duplicateDirectory = Path.Combine(destinationDirectory, duplicateDirectoryName);
38var outputPath = Path.Combine(destinationDirectory, individualFile);
39var outputDirectory = Path.GetDirectoryName(outputPath)!;
40CreateHardLink(outputPath, Path.Combine(sourceDirectory, individualFile));
53var artifactsDir = Path.Combine(sourceDirectory, "artifacts/bin");
56Path.Combine(sourceDirectory, "eng"),
57Path.Combine(sourceDirectory, "artifacts", "VSSetup"),
80var currentDirName = Path.GetDirectoryName(sourceFilePath)!;
81var currentRelativeDirectory = Path.GetRelativePath(sourceDirectory, currentDirName);
82var currentOutputDirectory = Path.Combine(destinationDirectory, currentRelativeDirectory);
88var fileName = Path.GetFileName(sourceFilePath);
95RelativePath: Path.Combine(currentRelativeDirectory, fileName),
101var destFilePath = Path.Combine(currentOutputDirectory, fileName);
109RelativePath: Path.Combine(currentRelativeDirectory, fileName),
133var destFilePath = Path.Combine(destinationDirectory, item.RelativePath);
141string getPeFilePath(Guid mvid) => Path.Combine(duplicateDirectory, getPeFileName(mvid));
172rehydrateAllBuilder.AppendLine(@"bash """ + Path.Combine("$scriptroot", group.Key, "rehydrate.sh") + @"""");
177rehydrateAllBuilder.AppendLine("call " + Path.Combine("%~dp0", group.Key, "rehydrate.cmd"));
180File.WriteAllText(Path.Combine(destinationDirectory, group.Key, fileName), builder.ToString());
192var file = Path.Combine(destinationDirectory, noDuplicate.Key, fileName);
199File.WriteAllText(Path.Combine(destinationDirectory, rehydrateAllFilename), rehydrateAllBuilder.ToString());
213var destFileName = Path.GetRelativePath(group.Key, tuple.FilePath.RelativePath);
214if (Path.GetDirectoryName(destFileName) is { Length: not 0 } directory)
264var destFilePath = Path.GetRelativePath(group.Key, tuple.FilePath.RelativePath);
276if (Path.GetDirectoryName(destFilePath) is { Length: not 0 } directory)
298while (Path.GetFileName(Path.GetDirectoryName(groupDirectory)) is not (null or "Debug" or "Release"))
299groupDirectory = Path.GetDirectoryName(groupDirectory);
TestDiscovery.cs (13)
21var binDirectory = Path.Combine(repoRootDirectory, "artifacts", "bin");
23var testDiscoveryWorkerFolder = Path.Combine(binDirectory, "TestDiscoveryWorker");
60var dir = Path.GetDirectoryName(typeof(TestDiscovery).Assembly.Location);
61var tfm = Path.GetFileName(dir)!;
62var configuration = Path.GetFileName(Path.GetDirectoryName(dir))!;
69var testDiscoveryWorkerFolder = Path.Combine(binDirectory, "TestDiscoveryWorker");
70return (Path.Combine(testDiscoveryWorkerFolder, configuration, tfm, "TestDiscoveryWorker.dll"),
71Path.Combine(testDiscoveryWorkerFolder, configuration, "net472", "TestDiscoveryWorker.exe"));
88var pathToOutput = Path.Combine(Path.GetDirectoryName(pathToAssembly)!, "testlist.json");
118return Path.GetFileName(Path.GetDirectoryName(path)) != "net472";
PresentationBuildTasks (71)
PresentationCore (21)
PresentationCore.Tests (2)
PresentationFramework (20)
PresentationUI (11)
ReachFramework (4)
Replay (25)
RepoTasks (41)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
ResultsOfTGenerator (2)
Roslyn.Compilers.Extension (4)
Roslyn.Diagnostics.Analyzers (27)
Roslyn.Test.Performance.Utilities (36)
Roslyn.VisualStudio.Next.UnitTests (28)
Remote\SnapshotSerializationTests.cs (7)
59.AddAnalyzerReference(new AnalyzerFileReference(Path.Combine(TempRoot.Root, "path1"), new TestAnalyzerAssemblyLoader()))
63.WithAnalyzerReferences([new AnalyzerFileReference(Path.Combine(TempRoot.Root, "path2"), new TestAnalyzerAssemblyLoader())])
392var reference = new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing_reference"), new MissingAnalyzerLoader());
406var reference = new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing_reference"), new MissingAnalyzerLoader());
504var analyzer = new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing_reference"), new MissingAnalyzerLoader());
538var analyzer = serializer.CreateChecksum(new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing"), new MissingAnalyzerLoader()), CancellationToken.None);
567var tempCorlibXml = tempDir.CreateFile(Path.ChangeExtension(tempCorlib.Path, "xml"));
Services\ServiceHubServicesTests.cs (6)
451assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
774assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
1511assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
1596assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
1675assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
1759assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
RulesetToEditorconfigConverter (4)
RulesetToEditorconfigConverter.UnitTests (6)
RunTests (53)
HelixTestRunner.cs (27)
65var payloadsDir = Path.Combine(options.ArtifactsDirectory, "payloads");
66var logsDir = Path.Combine(options.ArtifactsDirectory, "log", options.Configuration);
80var helixFilePath = Path.Combine(options.ArtifactsDirectory, "helix.proj");
83var arguments = $"build -bl:{Path.Combine(logsDir, "helix.binlog")} {helixFilePath}";
98File.Copy(helixFilePath, Path.Combine(logsDir, "helix.proj"));
150var duplicateDir = Path.Combine(Path.GetDirectoryName(artifactsDir)!, ".duplicate");
196var workItemPayloadDir = Path.Combine(payloadsDir, helixWorkItem.DisplayName);
199var binDir = Path.Combine(artifactsDir, "bin");
201.Select(x => Path.GetRelativePath(binDir, x))
206var name = Path.GetDirectoryName(assemblyRelativePath)!;
207var targetDir = Path.Combine(workItemPayloadDir, name);
208var sourceDir = Path.Combine(binDir, name);
209_ = Directory.CreateDirectory(Path.GetDirectoryName(targetDir)!);
215Path.Combine(workItemPayloadDir, rspFileName),
219path: Path.Combine(workItemPayloadDir, "eng"),
220pathToTarget: Path.Combine(artifactsDir, "..", "eng"));
222path: Path.Combine(workItemPayloadDir, "global.json"),
223pathToTarget: Path.Combine(artifactsDir, "..", "global.json"));
226File.WriteAllText(Path.Combine(workItemPayloadDir, commandFileName), commandContent);
229File.WriteAllText(Path.Combine(workItemPayloadDir, postCommandFileName), postCommandContent);
298var directoryName = Path.GetDirectoryName(assemblyRelativeFilePath);
400var globalJsonPath = Path.Join(path, "global.json");
405path = Path.GetDirectoryName(path);
488var relativePath = Path.GetRelativePath(payloadsDir, filePath);
489var destinationPath = Path.Combine(logsDir, relativePath);
490_ = Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
SemanticSearch.BuildTask (5)
ServerComparison.FunctionalTests (4)
SignalR.Client.FunctionalTestApp (4)
Sockets.BindTests (3)
Sockets.FunctionalTests (5)
StaticFilesAuth (8)
Stress.ApiService (2)
Swaggatherer (3)
System.CodeDom (5)
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.Diagnostics.FileVersionInfo (2)
System.Diagnostics.Process (18)
System.Diagnostics.TextWriterTraceListener (4)
System.Drawing.Common (14)
System.Drawing.Common.Tests (19)
System.Formats.Tar (47)
System.IO.Compression (2)
System.IO.Compression.ZipFile (14)
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.Net.Mail (8)
System.Net.NetworkInformation (3)
System.Net.Ping (2)
System.Net.Quic (2)
System.Net.Sockets (2)
System.Net.WebClient (4)
System.Private.CoreLib (161)
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);
1055Path.GetFullPath(sourceFileName),
1056Path.GetFullPath(destinationFileName),
1057destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null,
1077string fullSourceFileName = Path.GetFullPath(sourceFileName);
1078string fullDestFileName = Path.GetFullPath(destFileName);
1455string fullPath = Path.GetFullPath(path);
1477string 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 (11)
System.Text.RegularExpressions (1)
System.Windows.Forms (24)
System.Windows.Forms.Analyzers.Tests (27)
System.Windows.Forms.Design (3)
System.Windows.Forms.Design.Tests (4)
System.Windows.Forms.IntegrationTests.Common (6)
System.Windows.Forms.Primitives (6)
System.Windows.Forms.Primitives.Tests (1)
System.Windows.Forms.Primitives.TestUtilities (1)
System.Windows.Forms.Primitives.TestUtilities.Tests (1)
System.Windows.Forms.Tests (60)
System.Windows.Forms.UI.IntegrationTests (20)
System.Xaml (1)
TaskUsageLogger (2)
Templates.Blazor.Tests (83)
BlazorWasmTemplateTest.cs (9)
29var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
30Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
105var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
109Assert.False(File.Exists(Path.Combine(publishDir, "service-worker.published.js")), "service-worker.published.js should not be published");
110Assert.True(File.Exists(Path.Combine(publishDir, "service-worker.js")), "service-worker.js should be published");
111Assert.True(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "service-worker-assets.js should be published");
127var fullPath = Path.Combine(basePath, path);
131return File.ReadAllText(Path.Combine(basePath, path));
166var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
src\ProjectTemplates\Shared\Project.cs (10)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier);
57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish");
220var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll");
235var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll");
282var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
311var fullPath = Path.Combine(TemplateOutputDir, path);
367var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
459return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
581var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
583var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
WebWorkerTemplateE2ETest.cs (12)
22private static readonly string TestAssetsPath = Path.Combine(
23Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
90var parentDir = Path.GetDirectoryName(hostProject.TemplateOutputDir);
91var workerLibDir = Path.Combine(parentDir, "WorkerLib");
143var csprojPath = Path.Combine(workerLibDir, "WorkerLib.csproj");
157var csprojPath = Path.Combine(hostProject.TemplateOutputDir, $"{hostProject.ProjectName}.csproj");
187var testComponentSource = Path.Combine(TestAssetsPath, "WebWorkerTest.razor");
190var pagesDir = Path.Combine(hostProject.TemplateOutputDir, "Components", "Pages");
193pagesDir = Path.Combine(hostProject.TemplateOutputDir, "Pages");
196Path.Combine(pagesDir, "WebWorkerTest.razor"),
199var workerMethodsSource = Path.Combine(TestAssetsPath, "TestWorkerMethods.cs");
200File.Copy(workerMethodsSource, Path.Combine(hostProject.TemplateOutputDir, "TestWorkerMethods.cs"), overwrite: true);
Templates.Blazor.WebAssembly.Auth.Tests (67)
src\ProjectTemplates\Shared\Project.cs (10)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier);
57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish");
220var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll");
235var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll");
282var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
311var fullPath = Path.Combine(TemplateOutputDir, path);
367var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
459return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
581var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
583var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Templates.Blazor.WebAssembly.Tests (75)
BlazorWasmTemplateTest.cs (8)
35var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
36Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
45var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
46Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
55var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
56Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
65var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
66Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
src\ProjectTemplates\Shared\Project.cs (10)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier);
57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish");
220var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll");
235var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll");
282var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
311var fullPath = Path.Combine(TemplateOutputDir, path);
367var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
459return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
581var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
583var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Templates.Mvc.Tests (73)
src\ProjectTemplates\Shared\Project.cs (10)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier);
57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish");
220var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll");
235var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll");
282var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
311var fullPath = Path.Combine(TemplateOutputDir, path);
367var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
459return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
581var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
583var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Templates.Tests (87)
src\ProjectTemplates\Shared\Project.cs (10)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier);
57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish");
220var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll");
235var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll");
282var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
311var fullPath = Path.Combine(TemplateOutputDir, path);
367var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
459return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
581var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
583var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
110var sslCertDirs = sslCertDirString.Split(Path.PathSeparator);
113var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem");
241var certPath = Path.Combine(certDir, nickname) + ".pem";
355var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar
357: homeDirectory + Path.DirectorySeparatorChar;
360? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
369var existingDirs = existingSslCertDir.Split(Path.PathSeparator);
370var certDirFullPath = Path.GetFullPath(certDir);
380return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal);
404Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName);
470var certPath = Path.Combine(certDir, nickname) + ".pem";
560return Path.Combine(homeDirectory, ".pki", "nssdb");
565return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb");
570return Path.Combine(homeDirectory, ".mozilla", "firefox");
575return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox");
599var searchFolders = searchPath.Split(Path.PathSeparator);
609if (File.Exists(Path.Combine(searchFolder, command)))
816return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust");
848var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust
851var nssDb = Path.GetFullPath(path);
1057var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Test.Utilities (25)
TestDiscoveryWorker (3)
TestPassApp (2)
TestProject.AppHost (1)
TestTasks (3)
Text.Analyzers (27)
UIAutomationClient (1)
vbc (14)
VBCSCompiler (18)
VBCSCompiler.UnitTests (41)
CompilerServerTests.cs (21)
97var filePath = Path.Combine(currentDirectory.Path, "netstandard.dll");
167clientDir: Path.GetDirectoryName(typeof(CommonCompiler).Assembly.Location),
170tempDir: Path.GetTempPath());
224return new DisposableFile(Path.Combine(directory.Path, resultFileName));
231var result = ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path));
417var basePath = Path.GetDirectoryName(typeof(CompilerServerUnitTests).Assembly.Location);
418var compilerServerExecutable = Path.Combine(basePath, "VBCSCompiler.exe");
526Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe")));
556Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe")));
573Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "missingfile.exe")));
591Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe")));
616Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "app.exe")));
634Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "missingfile.exe")));
663Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hellovb.exe")));
692Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "app.exe")));
1030$"src1.cs /shared:{serverData.PipeName} /nologo /t:library /out:" + Path.Combine(libDirectory.Path, "lib.dll"),
1081$"src1.vb /shared:{serverData.PipeName} /vbruntime* /nologo /t:library /out:" + Path.Combine(libDirectory.Path, "lib.dll"),
1364var tmp = Path.Combine(_tempDirectory.Path, "Temp");
1398var tmp = Path.Combine(_tempDirectory.Path, "Temp");
1427var basePath = Path.GetDirectoryName(typeof(CompilerServerUnitTests).Assembly.Location);
1428var compilerServerExecutable = Path.Combine(basePath, "VBCSCompiler.exe");
TouchedFileLoggingTests.cs (6)
60var touchedBase = Path.Combine(touchedDir.Path, "touched");
69new BuildPaths(clientDirectory, _baseDirectory, RuntimeEnvironment.GetRuntimeDirectory(), Path.GetTempPath()),
77Path.ChangeExtension(source1, "exe"),
111var touchedBase = Path.Combine(touchedDir.Path, "touched");
120new BuildPaths(clientDirectory, _baseDirectory, RuntimeEnvironment.GetRuntimeDirectory(), Path.GetTempPath()),
128Path.ChangeExtension(source1, "exe"),
Wasm.Performance.ConsoleHost (3)
WindowsBase.Tests (2)
WinFormsControlsTest (11)
xunit.console (39)
Yarp.AppHost (1)