16060 references to Path
AnalyzerRunner (8)
aspire (397)
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)
269project => Path.GetFileNameWithoutExtension(project.ProjectFile.Name).EscapeMarkup(),
322project => Path.GetFileNameWithoutExtension(project.ProjectFile.Name).EscapeMarkup(),
345var tempProjectDir = Path.Combine(Path.GetTempPath(), $"aspire-init-{Guid.NewGuid()}");
425var finalAppHostDir = Path.Combine(initContext.SolutionDirectory.FullName, appHostProjectDir.Name);
426var finalServiceDefaultsDir = Path.Combine(initContext.SolutionDirectory.FullName, serviceDefaultsProjectDir.Name);
435var appHostProjectFile = new FileInfo(Path.Combine(finalAppHostDir, $"{appHostProjectDir.Name}.csproj"));
436var serviceDefaultsProjectFile = new FileInfo(Path.Combine(finalServiceDefaultsDir, $"{serviceDefaultsProjectDir.Name}.csproj"));
516InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
550InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}.");
580var appHostPath = Path.Combine(workingDirectory.FullName, appHostFileName);
842public string SolutionName => Path.GetFileNameWithoutExtension(SelectedSolutionFile!.Name);
852public string ExpectedAppHostDirectory => Path.Combine(SolutionDirectory.FullName, $"{SolutionName}.AppHost");
857public string ExpectedServiceDefaultsDirectory => Path.Combine(SolutionDirectory.FullName, $"{SolutionName}.ServiceDefaults");
Projects\DotNetBasedAppHostServerProject.cs (31)
58_appPath = Path.GetFullPath(appPath);
62_repoRoot = Path.GetFullPath(repoRoot) + Path.DirectorySeparatorChar;
77var tempPath = Path.GetTempPath();
90_projectModelPath = Path.Combine(tempPath, FolderPrefix, AppsFolder, pathDir);
104public string BuildPath => Path.Combine(_projectModelPath, BuildFolder);
109public string GetProjectFilePath() => Path.Combine(_projectModelPath, ProjectFileName);
113var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName);
125var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName);
194var projectPath = Path.Combine(_repoRoot, "src", integration.Name, $"{integration.Name}.csproj");
213var hostingPath = Path.Combine(_repoRoot, "src", "Aspire.Hosting", "Aspire.Hosting.csproj");
235var appHostInTargets = Path.Combine(_repoRoot, "src", "Aspire.Hosting.AppHost", "build", "Aspire.Hosting.AppHost.in.targets");
236var sdkInTargets = Path.Combine(_repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets");
248var dashboardProject = Path.Combine(_repoRoot, "src", "Aspire.Dashboard", "Aspire.Dashboard.csproj");
255var remoteHostProject = Path.Combine(_repoRoot, "src", "Aspire.Hosting.RemoteHost", "Aspire.Hosting.RemoteHost.csproj");
277var objPath = Path.Combine(_projectModelPath, "obj");
294File.WriteAllText(Path.Combine(_projectModelPath, "Program.cs"), programCs);
328File.WriteAllText(Path.Combine(_projectModelPath, "appsettings.json"), appSettingsJson);
336var nugetConfigPath = Path.Combine(_projectModelPath, "nuget.config");
390var repoDirectoryPackagesProps = Path.Combine(_repoRoot, "Directory.Packages.props");
401File.WriteAllText(Path.Combine(_projectModelPath, "Directory.Packages.props"), directoryPackagesProps);
406File.WriteAllText(Path.Combine(_projectModelPath, "Directory.Build.props"), "<Project />");
407File.WriteAllText(Path.Combine(_projectModelPath, "Directory.Build.targets"), "<Project />");
409var projectFileName = Path.Combine(_projectModelPath, ProjectFileName);
425var projectFile = new FileInfo(Path.Combine(_projectModelPath, ProjectFileName));
473var assemblyPath = Path.Combine(BuildPath, ProjectDllName);
574var workingDirFullPath = Path.GetFullPath(workingDirectory);
576var globalNuGetPath = Path.Combine(userProfile, ".nuget");
582var configFullPath = Path.GetFullPath(configPath);
583var configDir = Path.GetDirectoryName(configFullPath);
626var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props");
Projects\GuestAppHostProject.cs (8)
625var apphostRunPath = Path.Combine(directory.FullName, "apphost.run.json");
626var launchSettingsPath = Path.Combine(directory.FullName, "Properties", "launchSettings.json");
928var aspireCliPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels");
931return Path.Combine(aspireCliPath, socketName);
1208var outputPath = Path.Combine(appPath, GeneratedFolderName);
1213var filePath = Path.Combine(outputPath, fileName);
1214var directory = Path.GetDirectoryName(filePath);
1236var 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);
174var appHostDirectory = Path.GetDirectoryName(_appPath);
195var restoreDir = Path.Combine(_workingDirectory, "integration-restore");
198var outputDir = Path.Combine(restoreDir, "libs");
219var projectFilePath = Path.Combine(restoreDir, "IntegrationRestore.csproj");
231Path.Combine(restoreDir, "Directory.Packages.props"), directoryPackagesProps, cancellationToken);
235Path.Combine(restoreDir, "Directory.Build.props"), "<Project />", cancellationToken);
237Path.Combine(restoreDir, "Directory.Build.targets"), "<Project />", cancellationToken);
326new XAttribute("File", Path.Combine(outputDir, "_project-ref-assemblies.txt")),
340var localConfig = AspireJsonConfiguration.Load(Path.GetDirectoryName(_appPath)!);
516var filePath = Path.Combine(libsPath, "_project-ref-assemblies.txt");
573Path.Combine(_workingDirectory, "appsettings.json"),
Projects\ProjectLocator.cs (17)
125var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
134var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
141var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
192var qualifiedPath = Path.IsPathRooted(configAppHostPath)
194: Path.Combine(searchDirectory.FullName, configAppHostPath);
205var configFilePath = Path.Combine(searchDirectory.FullName, AspireConfigFile.FileName);
223var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath);
295file => $"{file.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName).EscapeMarkup()})",
387MultipleAppHostProjectsFoundBehavior.Prompt => await interactionService.PromptForSelectionAsync(InteractionServiceStrings.SelectAppHostToUse, results.BuildableAppHost, projectFile => $"{projectFile.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName).EscapeMarkup()})", cancellationToken),
414var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
435var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
453var newConfigPath = Path.Combine(executionContext.WorkingDirectory.FullName, AspireConfigFile.FileName);
458var aspireConfigFile = new FileInfo(Path.Combine(legacySettingsRootDirectory.FullName, AspireConfigFile.FileName));
470var configFilePath = Path.Combine(settingsRootDirectory.FullName, AspireConfigFile.FileName);
Aspire.Cli.EndToEnd.Tests (79)
CentralPackageManagementTests.cs (10)
47var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest");
48var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost");
49var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj");
50var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props");
69File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """
142var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest");
143var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost");
144var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj");
145var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props");
160File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """
ConfigMigrationTests.cs (14)
46var aspireHomeDir = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home");
125var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
126var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
191var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
192var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
240var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
243Path.Combine(aspireHomeDir, "globalsettings.json"),
299var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
300var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
369var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
370var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
453var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
454var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json");
576var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json");
ProjectReferenceTests.cs (11)
50var configPath = Path.Combine(workDir, "aspire.config.json");
56var integrationDir = Path.Combine(workDir, "MyIntegration");
59File.WriteAllText(Path.Combine(integrationDir, "MyIntegration.csproj"), $$"""
75var aspireHome = Path.Combine(
77var hivesDir = Path.Combine(aspireHome, "hives");
84var packagesDir = Path.Combine(hiveDir, "packages");
87var hiveName = Path.GetFileName(hiveDir);
100File.WriteAllText(Path.Combine(workDir, "nuget.config"), nugetConfig);
103File.WriteAllText(Path.Combine(integrationDir, "MyIntegrationExtensions.cs"), """
129var modulesDir = Path.Combine(workDir, ".modules");
136File.WriteAllText(Path.Combine(workDir, "apphost.ts"), """
Aspire.Cli.Tests (951)
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 (49)
19var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}");
69var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}");
88WorkingDirectory = new DirectoryInfo(Path.GetTempPath()),
152var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
154var tarballPath = Path.Combine(tempDir, "package.tgz");
182var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
184var tarballPath = Path.Combine(tempDir, "package.tgz");
222var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
224var tarballPath = Path.Combine(tempDir, "package.tgz");
257var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
259var tarballPath = Path.Combine(tempDir, "package.tgz");
297var tempPath = Path.GetTempFileName();
317var tempPath = Path.GetTempFileName();
333var tempPath = Path.GetTempFileName();
369var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}");
371var tarballPath = Path.Combine(tempDir, "package.tgz");
446var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-mirror-test-{Guid.NewGuid():N}");
452var primarySkillDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli");
454await File.WriteAllTextAsync(Path.Combine(primarySkillDir, "SKILL.md"), "# Playwright CLI Skill");
455Directory.CreateDirectory(Path.Combine(primarySkillDir, "subdir"));
456await File.WriteAllTextAsync(Path.Combine(primarySkillDir, "subdir", "extra.md"), "Extra content");
479context.AddSkillBaseDirectory(Path.Combine(".claude", "skills"));
480context.AddSkillBaseDirectory(Path.Combine(".github", "skills"));
481context.AddSkillBaseDirectory(Path.Combine(".opencode", "skill"));
486Assert.True(File.Exists(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "SKILL.md")));
487Assert.True(File.Exists(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "subdir", "extra.md")));
488Assert.Equal("# Playwright CLI Skill", await File.ReadAllTextAsync(Path.Combine(tempDir, ".github", "skills", "playwright-cli", "SKILL.md")));
491Assert.True(File.Exists(Path.Combine(tempDir, ".opencode", "skill", "playwright-cli", "SKILL.md")));
492Assert.True(File.Exists(Path.Combine(tempDir, ".opencode", "skill", "playwright-cli", "subdir", "extra.md")));
506var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-sync-test-{Guid.NewGuid():N}");
507var sourceDir = Path.Combine(tempDir, "source");
508var targetDir = Path.Combine(tempDir, "target");
514File.WriteAllText(Path.Combine(sourceDir, "keep.md"), "keep");
518File.WriteAllText(Path.Combine(targetDir, "keep.md"), "old content");
519File.WriteAllText(Path.Combine(targetDir, "stale.md"), "should be removed");
520Directory.CreateDirectory(Path.Combine(targetDir, "stale-dir"));
521File.WriteAllText(Path.Combine(targetDir, "stale-dir", "old.md"), "should be removed");
526Assert.Equal("keep", File.ReadAllText(Path.Combine(targetDir, "keep.md")));
529Assert.False(File.Exists(Path.Combine(targetDir, "stale.md")));
530Assert.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");
489var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
521var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
552var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
583var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
597var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
599var settingsPath = Path.Combine(settingsDir, "settings.json");
630var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire");
632var settingsPath = Path.Combine(settingsDir, "settings.json");
Commands\ExportCommandTests.cs (16)
27var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
116var customDir = Path.Combine(workspace.WorkspaceRoot.FullName, "custom", "nested");
117var outputPath = Path.Combine(customDir, "my-export.zip");
150var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
153var appHostDir = Path.Combine(workspace.WorkspaceRoot.FullName, "MyAppHost");
155var appHostProjectPath = Path.Combine(appHostDir, "MyAppHost.csproj");
183var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
193AppHostPath = Path.Combine("C:", "other", "OtherAppHost", "OtherAppHost.csproj"),
216AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TargetAppHost", "TargetAppHost.csproj"),
303var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
430var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
489var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
544var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
610var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
639var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip");
703AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\InitCommandTests.cs (14)
27var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
30var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectFileName));
66var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
84var appHostDir = Path.Combine(outputPath, "Test.AppHost");
85var serviceDefaultsDir = Path.Combine(outputPath, "Test.ServiceDefaults");
88File.WriteAllText(Path.Combine(appHostDir, "Test.AppHost.csproj"), "<Project />");
89File.WriteAllText(Path.Combine(serviceDefaultsDir, "Test.ServiceDefaults.csproj"), "<Project />");
110Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost", "Test.AppHost.csproj")));
111Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.ServiceDefaults", "Test.ServiceDefaults.csproj")));
164var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
219var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
345Assert.Equal(workspace.WorkspaceRoot.FullName, Path.GetFullPath(outputPath));
348var appHostFile = Path.Combine(outputPath, "apphost.cs");
503var appHostFile = Path.Combine(outputPath, "apphost.cs");
Commands\NewCommandTests.cs (10)
896File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost");
912Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")));
1018Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")));
1081var runProfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
1193var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestApp");
1255await File.WriteAllTextAsync(Path.Combine(context.TargetDirectory.FullName, "aspire.config.json"), """
1285var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
1347var modulesDir = Directory.CreateDirectory(Path.Combine(directory.FullName, ".modules"));
1348File.WriteAllText(Path.Combine(modulesDir.FullName, "aspire.ts"), "// generated sdk");
1362Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".modules", "aspire.ts")));
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 (44)
152var logsDirectory = Path.Combine(Path.GetTempPath(), "aspire-cli-tests");
157var fileName = Path.GetFileName(path);
466$"{InteractionServiceStrings.BuildingAppHost} src{Path.DirectorySeparatorChar}MyApp.AppHost{Path.DirectorySeparatorChar}MyApp.AppHost.csproj",
475var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost");
477var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj");
938var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
948workingDirectory: 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"
988var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
998workingDirectory: 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"
1034var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1044workingDirectory: 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"
1084var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1094workingDirectory: 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"
1129var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1139workingDirectory: 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"
1175var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1185workingDirectory: 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"
1221var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1231workingDirectory: 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"
1349var originalSecretsDir = Path.GetDirectoryName(originalSecretsPath)!;
1505var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
Commands\UpdateCommandTests.cs (22)
86var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
87var oldBackup1 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
88var oldBackup2 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.9876543210");
89var otherFile = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.something");
112var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
113var oldBackup = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
141var nonExistentPath = Path.Combine("C:", "NonExistent", "aspire.exe");
153var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
223return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
296return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
382var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
429var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
470var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
504return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
571return 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")));
695return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
773return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
818return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
930var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
975var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
1008var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
Configuration\AspireConfigFileTests.cs (10)
27var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
47var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
70var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
89var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
103var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
116var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
139var filePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
152var subDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "dir");
157Assert.True(File.Exists(Path.Combine(subDir, AspireConfigFile.FileName)));
173File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), "{}");
Configuration\ConfigurationServiceTests.cs (8)
18var globalSettingsFile = new FileInfo(Path.Combine(globalSettingsDir.FullName, AspireConfigFile.FileName));
20var settingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
26var logsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "logs"));
29new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")),
30new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache")),
31new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")),
117var sentinelPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
DotNet\DotNetCliRunnerTests.cs (41)
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"));
129var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
168var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
197var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
226var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
264var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
305var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
383var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
423var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
465var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
512var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
560var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
613var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
680var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
746var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
819var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
824var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj"));
828var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj"));
848invocationOptions.StandardOutputCallback?.Invoke($"Project1{Path.DirectorySeparatorChar}Project1.csproj");
849invocationOptions.StandardOutputCallback?.Invoke($"Project2{Path.DirectorySeparatorChar}Project2.csproj");
866var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
869var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj"));
899var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
945var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
990var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1035var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1086var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1135var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1183var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1219var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1398var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1436var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1474var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1514var 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");
456var 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");
485var 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");
512var 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");
539var 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");
565var 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");
592var 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);
620var 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);
647var 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);
675var 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);
702var 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);
731var 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);
760var 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 (66)
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, AspireConfigFile.FileName));
326var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "MyAppHost.csproj"));
331var decoyAppHostProjectFile = new FileInfo(Path.Combine(decoyAppHostDirectory.FullName, "DecoyAppHost.csproj"));
338var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"));
339var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json"));
340var relativeAppHostPath = Path
342.Replace(Path.DirectorySeparatorChar, '/');
346var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
361var aspireConfigFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
375var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
400var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
426var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs"));
436var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj"));
441var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs"));
481var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
501var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj"));
506var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs"));
542var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
566var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
587var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
598var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj"));
613var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt"));
633var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
638var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
705? Path.Combine(executionContext.HomeDirectory.FullName, ".aspire", AspireConfigFile.FileName)
706: Path.Combine(executionContext.WorkingDirectory.FullName, AspireConfigFile.FileName);
743var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj"));
797var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj"));
799var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj"));
834var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs"));
862var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj"));
901var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj"));
906var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.cs"));
944var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj"));
948var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs"));
986var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs"));
1009var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1030var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
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");
246var hivesDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "hives"));
247var cacheDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "cache"));
248var logsDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "logs"));
249var logFilePath = Path.Combine(logsDirectory.FullName, "test.log");
250return new CliExecutionContext(WorkingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks")), logsDirectory, logFilePath);
332var globalSettingsFilePath = Path.Combine(workingDirectory.FullName, ".aspire", "settings.global.json");
506var 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 (71)
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")}";
190DotNet = Path.Combine(sdkForTemplatePath!, "dotnet");
198LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath);
203LogRootPath = 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 (178)
Dashboard\DashboardEventHandlers.cs (20)
122if (string.Equals(".dll", Path.GetExtension(assemblyPath), StringComparison.OrdinalIgnoreCase))
124runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json");
130var directory = Path.GetDirectoryName(assemblyPath)!;
131var fileName = Path.GetFileName(assemblyPath);
132var baseName = Path.GetExtension(fileName) switch
134".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe
137runtimeConfigPath = Path.Combine(directory, $"{baseName}.runtimeconfig.json");
193if (string.Equals(".dll", Path.GetExtension(dashboardPath), StringComparison.OrdinalIgnoreCase))
196originalRuntimeConfig = Path.ChangeExtension(dashboardPath, ".runtimeconfig.json");
202var directory = Path.GetDirectoryName(dashboardPath)!;
203var fileName = Path.GetFileName(dashboardPath);
204var baseName = Path.GetExtension(fileName) switch
206".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe
209originalRuntimeConfig = Path.Combine(directory, $"{baseName}.runtimeconfig.json");
287var fullyQualifiedDashboardPath = Path.GetFullPath(dashboardPath);
288var dashboardWorkingDirectory = Path.GetDirectoryName(fullyQualifiedDashboardPath);
309if (string.Equals(".dll", Path.GetExtension(fullyQualifiedDashboardPath), StringComparison.OrdinalIgnoreCase))
316var directory = Path.GetDirectoryName(fullyQualifiedDashboardPath)!;
317var fileName = Path.GetFileName(fullyQualifiedDashboardPath);
321dashboardDll = Path.Combine(directory, $"{baseName}.dll");
Dcp\DcpExecutor.cs (18)
58private static readonly string s_macOSUserDevCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "dev-certs", "https");
1461exe.Spec.WorkingDirectory = Path.GetDirectoryName(projectMetadata.ProjectPath);
1750var certificatesRootDir = Path.Join(_locations.DcpSessionDir, exe.Name());
1751var bundleOutputPath = Path.Join(certificatesRootDir, "cert.pem");
1752var customBundleOutputPath = Path.Join(certificatesRootDir, "bundles");
1753var certificatesOutputPath = Path.Join(certificatesRootDir, "certs");
1754var baseServerAuthOutputPath = Path.Join(certificatesRootDir, "private");
1767dirs.AddRange(existing.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries));
1775CertificateDirectoriesPath = ReferenceExpression.Create($"{string.Join(Path.PathSeparator, dirs)}"),
1781CertificatePath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{cert.Thumbprint}.crt")}"),
1782KeyPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{cert.Thumbprint}.key")}"),
1783PfxPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{cert.Thumbprint}.pfx")}"),
1817File.WriteAllBytes(Path.Join(customBundleOutputPath, bundleId), bundleBytes);
1838File.WriteAllText(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.crt"), publicCetificatePem);
1845File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.key"), keyBytes);
1853File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.pfx"), pfxBytes);
2842var keyFileName = Path.Join(s_macOSUserDevCertificateLocation, $"{lookup}.key");
2915var 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 (51)
DockerComposePublisherTests.cs (38)
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");
961var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
995var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
Aspire.Hosting.Foundry.Tests (2)
Aspire.Hosting.Garnet.Tests (4)
Aspire.Hosting.JavaScript (29)
JavaScriptHostingExtensions.cs (29)
123appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
155if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
259if (File.Exists(Path.Combine(appDirectory, "package.json")))
338appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
392if (File.Exists(Path.Combine(appDirectory, "Dockerfile")))
515appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory));
587var candidatePath = Path.GetFullPath(Path.Join(appDirectory, configFile));
601var absoluteConfigPath = Path.GetFullPath(configTarget, appDirectory);
603var relativeConfigPath = Path.GetRelativePath(Path.Join(appDirectory, "node_modules", ".bin"), absoluteConfigPath);
609var aspireConfigPath = Path.Join(appDirectory, "node_modules", ".bin", $"aspire.{Path.GetFileName(configTarget)}");
739var hasBunLock = File.Exists(Path.Combine(workingDirectory, "bun.lock")) ||
740File.Exists(Path.Combine(workingDirectory, "bun.lockb"));
745if (File.Exists(Path.Combine(workingDirectory, "bun.lock")))
749if (File.Exists(Path.Combine(workingDirectory, "bun.lockb")))
786File.Exists(Path.Combine(resource.Resource.WorkingDirectory, "package-lock.json"))
803var hasYarnLock = File.Exists(Path.Combine(workingDirectory, "yarn.lock"));
804var hasYarnrc = File.Exists(Path.Combine(workingDirectory, ".yarnrc.yml"));
805var hasYarnBerryDir = Directory.Exists(Path.Combine(workingDirectory, ".yarn"));
878var hasPnpmLock = File.Exists(Path.Combine(workingDirectory, "pnpm-lock.yaml"));
954var workingDirectory = Path.GetFullPath(resource.WorkingDirectory);
966ScriptPath = Path.GetFullPath(scriptPath, workingDirectory),
982var workingDirectory = Path.GetFullPath(resource.WorkingDirectory);
1192var nvmrcPath = Path.Combine(workingDirectory, ".nvmrc");
1204var nodeVersionPath = Path.Combine(workingDirectory, ".node-version");
1216var packageJsonPath = Path.Combine(workingDirectory, "package.json");
1241var toolVersionsPath = Path.Combine(workingDirectory, ".tool-versions");
Aspire.Hosting.JavaScript.Tests (66)
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 (19)
101var appDir = Path.Combine(tempDir.Path, "js");
106File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
107File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "{}");
114var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile");
169var appDir = Path.Combine(tempDir.Path, "js");
171File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
183var dockerfilePath = Path.Combine(tempDir.Path, "js.Dockerfile");
216var appDir = Path.Combine(tempDir.Path, "js");
218File.WriteAllText(Path.Combine(appDir, "package.json"), "{}");
229var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "js.Dockerfile"));
238File.WriteAllText(Path.Combine(tempDir.Path, "app.js"), "{}");
265File.WriteAllText(Path.Combine(tempDir.Path, "package.json"), "{}");
338File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent);
339File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent);
364var nodeDockerfilePath = Path.Combine(outputDir.Path, "nodeapp.Dockerfile");
394File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent);
395File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent);
420var nodeDockerfilePath = Path.Combine(outputDir.Path, "nodeapp.Dockerfile");
559File.WriteAllText(Path.Combine(tempDir.Path, "app.js"), "console.log('hello');");
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 (25)
KubernetesPublisherTests.cs (20)
63var filePath = Path.Combine(tempDir.Path, expectedFile);
64var fileExtension = Path.GetExtension(filePath)[1..];
102var deploymentPath = Path.Combine(tempDir.Path, "templates/service/deployment.yaml");
158var filePath = Path.Combine(tempDir.Path, expectedFile);
159var fileExtension = Path.GetExtension(filePath)[1..];
212var filePath = Path.Combine(tempDir.Path, expectedFile);
213var fileExtension = Path.GetExtension(filePath)[1..];
267var filePath = Path.Combine(tempDir.Path, expectedFile);
268var fileExtension = Path.GetExtension(filePath)[1..];
299var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile");
394var filePath = Path.Combine(tempDir.Path, expectedFile);
395var fileExtension = Path.GetExtension(filePath)[1..];
438var filePath = Path.Combine(tempDir.Path, expectedFile);
439var fileExtension = Path.GetExtension(filePath)[1..];
495var filePath = Path.Combine(tempDir.Path, expectedFile);
496var fileExtension = Path.GetExtension(filePath)[1..];
549var filePath = Path.Combine(tempDir.Path, expectedFile);
550var fileExtension = Path.GetExtension(filePath)[1..];
606var filePath = Path.Combine(tempDir.Path, expectedFile);
607var fileExtension = Path.GetExtension(filePath)[1..];
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 (37)
PythonAppResourceBuilderExtensions.cs (33)
357var resource = createResource(name, "python", Path.GetFullPath(appDirectory, builder.AppHostDirectory));
428if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile")))
504var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
506if (File.Exists(Path.Combine(appDirectoryFullPath, "pyproject.toml")) ||
507File.Exists(Path.Combine(appDirectoryFullPath, "requirements.txt")))
526var uvLockPath = Path.Combine(resource.WorkingDirectory, "uv.lock");
635var requirementsTxtPath = Path.Combine(resource.WorkingDirectory, "requirements.txt");
675var pyprojectTomlPath = Path.Combine(resource.WorkingDirectory, "pyproject.toml");
753var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory);
757var appHostParentDirectory = Path.GetDirectoryName(builder.AppHostDirectory);
763var relativePath = Path.GetRelativePath(appHostParentDirectory, appDirectoryFullPath);
765!Path.IsPathRooted(relativePath);
770return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath);
778var venvPath = Path.Combine(currentDirectory, virtualEnvironmentPath);
796var parentDirectory = Path.GetDirectoryName(currentDirectory);
808return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath);
863var resolvedPath = Path.IsPathRooted(virtualEnvironmentPath)
865: Path.GetFullPath(virtualEnvironmentPath, builder.Resource.WorkingDirectory);
938programPath = Path.GetFullPath(entrypoint, builder.Resource.WorkingDirectory);
957var venvPath = Path.IsPathRooted(annotation.VirtualEnvironment.VirtualEnvironmentPath)
959: Path.GetFullPath(annotation.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
963interpreterPath = Path.Join(venvPath, "Scripts", "python.exe");
967interpreterPath = Path.Join(venvPath, "bin", "python");
1163if (File.Exists(Path.Combine(workingDirectory, "pyproject.toml")))
1168else if (File.Exists(Path.Combine(workingDirectory, "requirements.txt")))
1273foreach (var directory in pathVariable.Split(Path.PathSeparator))
1275var fullPath = Path.Combine(directory, commandWithExt);
1286foreach (var directory in pathVariable.Split(Path.PathSeparator))
1288var fullPath = Path.Combine(directory, command);
1380var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath)
1382: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
1515var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath)
1517: 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");
561var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
565var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
607var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
611var appVenvPath = Path.Combine(appDirPath, ".venv");
614var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
663var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempAppDir.Path));
664var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv");
680var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName);
684var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv");
688var customVenvPath = Path.Combine(appDirPath, "custom-venv");
740var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
990var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
995Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
999Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
1024var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
1028Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command);
1032Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command);
1058var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path));
1062Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", $"{executableName}.exe"), pythonProjectResource.Command);
1066Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", executableName), pythonProjectResource.Command);
1270File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1271File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent);
1272File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1274var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
1293var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1296var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile");
1299var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile");
1335File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1337File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1339var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json");
1358var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1361var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile");
1364var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile");
1397var appDirectory = Path.Combine(tempDir.Path, "myapp");
1399var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1435var appDirectory = Path.Combine(tempDir.Path, "myapp");
1437var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1475var appDirectory = Path.Combine(tempDir.Path, "myapp");
1477var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1512var appDirectory = Path.Combine(tempDir.Path, "myapp");
1514var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1545var appDirectory = Path.Combine(tempDir.Path, "myapp");
1547var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
1653File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1654File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent);
1655File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1670var dockerfilePath = Path.Combine(outputDir.Path, "custom-images-app.Dockerfile");
1699File.WriteAllText(Path.Combine(projectDirectory, "requirements.txt"), requirementsContent);
1700File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1711var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1748File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1749File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent);
1760var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1780File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1791var dockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1813File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent);
1814File.WriteAllText(Path.Combine(projectDirectory, ".python-version"), pythonVersionContent);
1827var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile");
1830var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile");
1833var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile");
1862var scriptPath = Path.Combine(tempDir.Path, scriptName);
1866var pyprojectPath = Path.Combine(tempDir.Path, "pyproject.toml");
1896var scriptPath = Path.Combine(tempDir.Path, scriptName);
1900var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
1931var scriptPath = Path.Combine(tempDir.Path, scriptName);
1935var pyprojectPath = Path.Combine(tempDir.Path, "pyproject.toml");
1937var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
1961var scriptPath = Path.Combine(tempDir.Path, scriptName);
1985var scriptPath = Path.Combine(tempDir.Path, scriptName);
2008var scriptPath = Path.Combine(tempDir.Path, scriptName);
2012var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2036var scriptPath = Path.Combine(tempDir.Path, scriptName);
2040var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2065var scriptPath = Path.Combine(tempDir.Path, "main.py");
2093var scriptPath = Path.Combine(tempDir.Path, "main.py");
2097var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2136var scriptPath = Path.Combine(tempDir.Path, "main.py");
2139var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2166var scriptPath = Path.Combine(tempDir.Path, "main.py");
2169var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2200var scriptPath = Path.Combine(tempDir.Path, "main.py");
2203var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2236var scriptPath = Path.Combine(tempDir.Path, "main.py");
2239var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2266var scriptPath = Path.Combine(tempDir.Path, "main.py");
2269var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2298var scriptPath = Path.Combine(tempDir.Path, "main.py");
2301var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2330var scriptPath = Path.Combine(tempDir.Path, "main.py");
2333var requirementsPath = Path.Combine(tempDir.Path, "requirements.txt");
2366var scriptPath = Path.Combine(tempDir.Path, "main.py");
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.Redis.Tests (4)
Aspire.Hosting.RemoteHost (8)
Aspire.Hosting.RemoteHost.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 (192)
Dashboard\DashboardLifecycleHookTests.cs (14)
277var tempDir = Path.GetTempFileName();
283var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
284var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
366var tempDir = Path.GetTempFileName();
372var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard.exe");
373var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
374var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
435var tempDir = Path.GetTempFileName();
441var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard");
442var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
443var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
504var tempDir = Path.GetTempFileName();
510var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll");
511var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
Dcp\DcpHostNotificationTests.cs (8)
505Path.Combine(Directory.GetCurrentDirectory(), "tests", "Shared", "TestCertificates", "testCert.pfx"),
506Path.Combine(AppContext.BaseDirectory, "shared", "TestCertificates", "testCert.pfx"),
507Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "tests", "Shared", "TestCertificates", "testCert.pfx"))
647var appHostDirectory = Path.Combine(Path.GetTempPath(), "aspire-apphost-test");
827var appHostDirectory = Path.Combine(Path.GetTempPath(), "aspire-apphost-test");
MSBuildTests.cs (35)
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"),
381var projectDirectory = Path.Combine(tempDirectory.Path, "MyHostingExtension");
384File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"),
401File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"),
430var projectDirectory = Path.Combine(tempDirectory.Path, "MyHostingExtension");
433File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"),
450File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"),
478File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"),
486File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"),
511var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost");
514File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"),
542File.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")}";
190DotNet = Path.Combine(sdkForTemplatePath!, "dotnet");
198LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath);
203LogRootPath = 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);
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-razorsyntaxgenerator (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 (49)
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)
108using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
126using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
180File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
117deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
212deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
216Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));
217Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll")));
218Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger));
283Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"),
284Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"),
348File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), "");
407File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
448File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"));
617parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
625parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
633parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
641parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
649parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
657parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
688parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
697parameters.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)
108using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
126using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
180File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
117deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
212deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
216Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));
217Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll")));
218Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger));
283Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"),
284Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"),
348File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), "");
407File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
448File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"));
617parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
625parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
633parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
641parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
649parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
657parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
688parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
697parameters.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");
285DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true);
286DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "3"), copySubDirs: true);
287DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "10"), copySubDirs: true);
299Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped");
310Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "11")), "Expected 11 shadow copy directory");
316Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "1")), "Expected 1 shadow copy directory to be deleted");
317Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "3")), "Expected 3 shadow copy directory to be deleted");
329DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true);
342Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy")));
344Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy")));
359DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true);
372Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy")));
374Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy")));
384var directoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
452string tempPath = Path.Combine(destDirName, file.Name);
465string 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)
108using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
126using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None))
180File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
117deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
212deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
216Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));
217Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll")));
218Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger));
283Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"),
284Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"),
348File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), "");
407File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"));
448File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"));
617parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments));
625parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments));
633parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments));
641parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments");
649parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\"");
657parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments");
688parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path));
697parameters.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 (166)
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 (61)
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");
449var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
453Path.Combine(artifactsDir, "CustomRunner.tests-metadata.json"),
458var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
478var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
482Path.Combine(artifactsDir, "NoRunner.tests-metadata.json"),
486var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
504var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
508Path.Combine(artifactsDir, "SplitRunner.tests-metadata.json"),
515Path.Combine(artifactsDir, "SplitRunner.tests-partitions.json"),
518var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
540var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
544Path.Combine(artifactsDir, "ClassRunner.tests-metadata.json"),
555Path.Combine(artifactsDir, "ClassRunner.tests-partitions.json"),
558var outputFile = Path.Combine(_tempDir.Path, "matrix.json");
596if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (47)
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");
414var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
417var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
453var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
456var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
487var canonicalMatrix = Path.Combine(_tempDir.Path, "canonical.json");
490var outputFile = Path.Combine(_tempDir.Path, "expanded.json");
510var artifactsDir = Path.Combine(_tempDir.Path, "artifacts");
514Path.Combine(artifactsDir, "RegularProject.tests-metadata.json"),
520Path.Combine(artifactsDir, "SplitMultiOS.tests-metadata.json"),
527Path.Combine(artifactsDir, "SplitMultiOS.tests-partitions.json"),
531Path.Combine(artifactsDir, "LinuxE2E.tests-metadata.json"),
539Path.Combine(artifactsDir, "CliE2E.tests-metadata.json"),
548var buildMatrixScript = Path.Combine(FindRepoRoot(), "eng", "scripts", "build-test-matrix.ps1");
549var canonicalFile = Path.Combine(_tempDir.Path, "canonical.json");
559var expandedFile = Path.Combine(_tempDir.Path, "expanded.json");
564var splitScriptPath = Path.Combine(FindRepoRoot(), "eng", "scripts", "split-test-matrix-by-deps.ps1");
565var githubOutputFile = Path.Combine(_tempDir.Path, "github_output.txt");
699if (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 (32)
Metrics.Legacy (32)
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.Testing (9)
Microsoft.AspNetCore.Components.Testing.Tasks (8)
Microsoft.AspNetCore.Components.Testing.Tests (28)
GenerateE2EManifestTaskTests.cs (28)
19_tempDir = Path.Combine(Path.GetTempPath(), "E2EManifestTests_" + Guid.NewGuid().ToString("N"));
36var manifestPath = Path.Combine(_tempDir, "manifest.json");
61var manifestPath = Path.Combine(_tempDir, "manifest.json");
75Assert.Equal(Path.Combine("e2e-apps", "MyApp"), entry.WorkingDirectory);
83var manifestPath = Path.Combine(_tempDir, "manifest.json");
99var appsOutputDir = Path.Combine(_tempDir, "e2e-apps");
101var manifestPath = Path.Combine(_tempDir, "manifest.json");
118Assert.Equal(Path.Combine("e2e-apps", "MyApp"), entry.WorkingDirectory);
126var appsOutputDir = Path.Combine(_tempDir, "e2e-apps");
128var manifestPath = Path.Combine(_tempDir, "manifest.json");
151var manifestPath = Path.Combine(_tempDir, "manifest.json");
167var appsOutputDir = Path.Combine(_tempDir, "e2e-apps");
169CreatePublishedApp(Path.Combine(appsOutputDir, "publish"), "MyApp", createExe: true);
170var manifestPath = Path.Combine(_tempDir, "manifest.json");
189Assert.Equal(Path.Combine("e2e-apps", "MyApp"), buildEntry.WorkingDirectory);
197Assert.Equal(Path.Combine("e2e-apps", "publish", "MyApp"), publishEntry.WorkingDirectory);
205var manifestPath = Path.Combine(_tempDir, "manifest.json");
219Assert.Equal(Path.Combine("test-apps", "MyApp"), entry!.WorkingDirectory);
228var manifestPath = Path.Combine(_tempDir, "manifest.json");
249var manifestPath = Path.Combine(_tempDir, "manifest.json");
272var dir = Path.Combine(_tempDir, "src", name);
274File.WriteAllText(Path.Combine(dir, name + ".csproj"), "<Project />");
280var dir = Path.Combine(appsOutputDir, name);
285File.WriteAllText(Path.Combine(dir, name + exeSuffix), "fake-exe");
289File.WriteAllText(Path.Combine(dir, name + ".dll"), "fake-dll");
295var item = new TaskItem(Path.Combine(projectDir, name + ".csproj"));
314E2EAppsOutputDir = appsOutputDir ?? Path.Combine(_tempDir, "e2e-apps"),
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 (19)
Repositories\FileSystemXmlRepositoryTests.cs (10)
24? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET")
25: Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".aspnet");
26var expectedDir = new DirectoryInfo(Path.Combine(baseDir, "DataProtection-Keys")).FullName;
210var filePath1 = Path.Combine(dirInfo.FullName, "friendly1.xml");
211var filePath2 = Path.Combine(dirInfo.FullName, "friendly2.xml");
212var filePath3 = Path.Combine(dirInfo.FullName, "friendly3.xml");
227fileLock2 = new FileStream(Path.Combine(dirInfo.FullName, "friendly2.xml"), FileMode.Open, FileAccess.ReadWrite, FileShare.None);
260var filePath = Path.Combine(dirInfo.FullName, "friendly1.xml");
325string uniqueTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
XmlEncryption\EncryptedXmlDecryptorTests.cs (7)
21var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
35var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
36var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password");
53var fullCert = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
54var publicKeyOnly = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.PublicKeyOnly.cer"), "");
71var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password");
72var 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.Razor.Language.UnitTests (42)
DefaultRazorProjectFileSystemTest.cs (28)
15private static string TestFolder { get; } = Path.Combine(
121Assert.Equal(Path.Combine(TestFolder, "Home.cshtml"), item.PhysicalPath);
129Assert.Equal(Path.Combine(TestFolder, "Views", "About", "About.cshtml"), item.PhysicalPath);
130Assert.Equal(Path.Combine("Views", "About", "About.cshtml"), item.RelativePhysicalPath);
136Assert.Equal(Path.Combine(TestFolder, "Views", "Home", "Index.cshtml"), item.PhysicalPath);
137Assert.Equal(Path.Combine("Views", "Home", "Index.cshtml"), item.RelativePhysicalPath);
143Assert.Equal(Path.Combine(TestFolder, "Views", "Home", "_ViewImports.cshtml"), item.PhysicalPath);
144Assert.Equal(Path.Combine("Views", "Home", "_ViewImports.cshtml"), item.RelativePhysicalPath);
150Assert.Equal(Path.Combine(TestFolder, "Views", "_ViewImports.cshtml"), item.PhysicalPath);
151Assert.Equal(Path.Combine("Views", "_ViewImports.cshtml"), item.RelativePhysicalPath);
157Assert.Equal(Path.Combine(TestFolder, "_ViewImports.cshtml"), item.PhysicalPath);
178Assert.Equal(Path.Combine(TestFolder, "Views", "About", "About.cshtml"), item.PhysicalPath);
179Assert.Equal(Path.Combine("About", "About.cshtml"), item.RelativePhysicalPath);
185Assert.Equal(Path.Combine(TestFolder, "Views", "Home", "Index.cshtml"), item.PhysicalPath);
186Assert.Equal(Path.Combine("Home", "Index.cshtml"), item.RelativePhysicalPath);
192Assert.Equal(Path.Combine(TestFolder, "Views", "Home", "_ViewImports.cshtml"), item.PhysicalPath);
193Assert.Equal(Path.Combine("Home", "_ViewImports.cshtml"), item.RelativePhysicalPath);
199Assert.Equal(Path.Combine(TestFolder, "Views", "_ViewImports.cshtml"), item.PhysicalPath);
200Assert.Equal(Path.Combine("_ViewImports.cshtml"), item.RelativePhysicalPath);
233Assert.Equal(Path.Combine(TestFolder, "_ViewImports.cshtml"), item.PhysicalPath);
240Assert.Equal(Path.Combine(TestFolder, "Views", "_ViewImports.cshtml"), item.PhysicalPath);
241Assert.Equal(Path.Combine("Views", "_ViewImports.cshtml"), item.RelativePhysicalPath);
247Assert.Equal(Path.Combine(TestFolder, "Views", "Home", "_ViewImports.cshtml"), item.PhysicalPath);
248Assert.Equal(Path.Combine("Views", "Home", "_ViewImports.cshtml"), item.RelativePhysicalPath);
266Assert.Equal(Path.Combine(TestFolder, "Views", "About", "About.cshtml"), item.PhysicalPath);
267Assert.Equal(Path.Combine("Views", "About", "About.cshtml"), item.RelativePhysicalPath);
286Assert.Equal(Path.Combine(lowerCaseTestFolder, "Views", "About", "About.cshtml"), item.PhysicalPath);
287Assert.Equal(Path.Combine("Views", "About", "About.cshtml"), item.RelativePhysicalPath);
DefaultRazorProjectItemTest.cs (8)
11private static string TestFolder { get; } = Path.Combine(
20var fileInfo = new FileInfo(Path.Combine(TestFolder, "Home.cshtml"));
40var fileInfo = new FileInfo(Path.Combine(TestFolder, "Home.cshtml"));
53var fileInfo = new FileInfo(Path.Combine(TestFolder, "Home.cshtml"));
66var fileInfo = new FileInfo(Path.Combine(TestFolder, "Home.cshtml"));
79var fileInfo = new FileInfo(Path.Combine(TestFolder, "Views", "FileDoesNotExist.cshtml"));
83"/Views", "/FileDoesNotExist.cshtml", Path.Combine("Views", "FileDoesNotExist.cshtml"), fileKind: null, fileInfo, cssScope: null);
93var fileInfo = new FileInfo(Path.Combine(TestFolder, "Home.cshtml"));
Microsoft.AspNetCore.Razor.Microbenchmarks (3)
Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler (4)
Microsoft.AspNetCore.Razor.Test.Common (55)
Language\IntegrationTests\IntegrationTestBase.cs (16)
145var workingDirectory = Path.GetDirectoryName(testFileName);
152var physicalPath = Path.Combine(workingDirectory, filePath).Replace('/', '\\');
184var sourceFileName = Path.ChangeExtension(fileName, FileExtension);
193var workingDirectory = Path.GetDirectoryName(fileName);
363var baselineFileName = Path.ChangeExtension(GetTestFileName(testName), ".ir.txt");
367var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName);
384var baselineFileName = Path.ChangeExtension(GetTestFileName(testName), ".codegen.html");
388var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName);
409var baselineFileName = Path.ChangeExtension(fileName, ".codegen.cs");
410var baselineDiagnosticsFileName = Path.ChangeExtension(fileName, ".diagnostics.txt");
414var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName);
417var baselineDiagnosticsFullPath = Path.Combine(TestProjectRoot, baselineDiagnosticsFileName);
459var baselineFileName = Path.ChangeExtension(GetTestFileName(testName), ".mappings.txt");
464var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName);
617var baselineFileName = Path.ChangeExtension(fileName, ".cs-diagnostics.txt");
639var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName);
Language\TestProject.cs (16)
30var razorRepoRoot = Directory.Exists(Path.Combine(repoRoot, "src", "Razor", "src"))
31? Path.Combine(repoRoot, "src", "Razor")
40? Path.Combine(razorRepoRoot, "src", layerFolderName, "test", normalizedDirectoryHint)
41: Path.Combine(razorRepoRoot, "src", layerFolderName, normalizedDirectoryHint, "test");
47projectDirectory = Path.Combine(razorRepoRoot, "src", "Compiler", "Microsoft.AspNetCore.Razor.Language", "test");
72if (File.Exists(Path.Combine(repoRoot, "eng", "targets", "RazorServices.props")))
86var razorRepoRoot = Directory.Exists(Path.Combine(repoRoot, "src", "Razor", "src"))
87? Path.Combine(repoRoot, "src", "Razor")
94? Path.Combine(razorRepoRoot, "src", layerFolderName, normalizedAssemblyName, "test")
95: Path.Combine(razorRepoRoot, "src", layerFolderName, "test", assemblyName);
100projectDirectory = Path.Combine(razorRepoRoot, "src", "Compiler", "Microsoft.AspNetCore.Razor.Language", "test");
106projectDirectory = Path.Combine(razorRepoRoot, "src", "Compiler", "Microsoft.AspNetCore.Razor.Language", "legacyTest");
113var testDirectoryFirstProjectDirectory = Path.Combine(razorRepoRoot, "src", layerFolderName, "test", assemblyName);
146if (Directory.Exists(Path.Combine(appContextBaseDirectory, "TestFiles")))
162return File.Exists(Path.Combine(appContextBaseDirectory, "eng", "targets", "RazorServices.props"))
171var fileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, fileName));
Microsoft.AspNetCore.Razor.Test.Common.Cohosting (12)
Microsoft.AspNetCore.Razor.Test.Common.Tooling (43)
Microsoft.AspNetCore.Razor.Utilities.Shared (12)
Microsoft.AspNetCore.Razor.Utilities.Shared.UnitTests (18)
PathUtilitiesTests.cs (18)
36{ Path.Combine("dir", "baz"), "dir" },
37{ "dir.foo" + Path.AltDirectorySeparatorChar + "baz.txt", "dir.foo" },
38{ Path.Combine("dir", "baz", "bar"), Path.Combine("dir", "baz") },
39{ Path.Combine("..", "..", "files.txt"), Path.Combine("..", "..") },
40{ Path.DirectorySeparatorChar + "foo", Path.DirectorySeparatorChar.ToString() },
41{ Path.DirectorySeparatorChar.ToString(), null }
85Assert.Equal(expected, Path.GetExtension(path));
86Assert.Equal(!string.IsNullOrEmpty(expected), Path.HasExtension(path));
190Assert.Equal(curDir, PathUtilities.GetDirectoryName(Path.Combine(curDir, "baz")));
192Assert.Null(PathUtilities.GetDirectoryName(Path.GetPathRoot(curDir)));
193Assert.True(PathUtilities.GetDirectoryName(Path.GetPathRoot(curDir).AsSpan()).IsEmpty);
238return $"{path1}{Path.DirectorySeparatorChar}{path2}";
252AssertEqual(curDir, PathUtilities.GetDirectoryName(Path.Combine(curDir, "baz").AsSpan()));
253Assert.True(PathUtilities.GetDirectoryName(Path.GetPathRoot(curDir).AsSpan()).IsEmpty);
268Assert.Equal(expected, Path.GetDirectoryName(path));
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)
34serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword");
106new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
147new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
184new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")),
221serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword");
254ServerCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"),
KestrelConfigurationLoaderTests.cs (29)
278Directory.CreateDirectory(Path.GetDirectoryName(path));
319Directory.CreateDirectory(Path.GetDirectoryName(devCertPath));
445Directory.CreateDirectory(Path.GetDirectoryName(path));
492Directory.CreateDirectory(Path.GetDirectoryName(path));
541Directory.CreateDirectory(Path.GetDirectoryName(path));
594new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
595new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key"))
618new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
619new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-ecdsa.key")),
643new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
644new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")),
668new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")),
669new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.pub")),
805certificateFilePath = Path.Combine(tempDir, $"test{extension}");
806certificateKeyPath = Path.Combine(tempDir, "test.key");
983Directory.CreateDirectory(Path.GetDirectoryName(path));
1139Directory.CreateDirectory(Path.GetDirectoryName(certificatePath));
1219var oldDir = Directory.CreateDirectory(Path.Combine(tempDir, "old"));
1220var newDir = Directory.CreateDirectory(Path.Combine(tempDir, "new"));
1221var oldCertPath = Path.Combine(oldDir.FullName, "tls.key");
1222var newCertPath = Path.Combine(newDir.FullName, "tls.key");
1224var dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./old");
1225var fileLink = File.CreateSymbolicLink(Path.Combine(tempDir, "tls.key"), "./link/tls.key");
1270dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./new");
1627var certPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.pem");
1628var keyPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.key");
2143var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null;
2144basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null);
2145return 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 (15)
StaticAssetsIntegrationTests.cs (15)
326var filePath = Path.Combine(webRoot, "sample.txt");
383File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified");
436File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified");
503File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Short");
559File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified");
568Assert.Equal(GetGzipEtag(Path.Combine(webRoot, "sample.txt")), response.Headers.ETag.Tag);
597var contentRoot = Path.Combine(AppContext.BaseDirectory, appName);
598var webRoot = Path.Combine(contentRoot, "wwwroot");
606var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{appName}.staticwebassets.endpoints.json");
615var filePath = Path.Combine(webRoot, resource.Path);
638var compressedFilePath = Path.Combine(webRoot, resource.Path + ".gz");
1159return Path.GetExtension(filePath) switch
1208public string Name => Path.GetFileName(testResource.Path);
1281var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{appName}.staticwebassets.endpoints.json");
1284File.WriteAllText(Path.Combine(webRoot, "index.html"), "Hello, World!");
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");
170var subDirectory = Path.Combine(_tempDirectory, "sub", "folder");
173var 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 (273)
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (10)
490? Path.Combine(GetOrInitializeX64Clr2Path(toolName, basePath64), toolName)
491: Path.Combine(GetOrInitializeX32Clr2Path(toolName, basePath), toolName);
496return Path.Combine(s_pathToX64Clr4 ??= basePath64, toolName);
501return Path.Combine(s_pathToArm64Clr4 ??= basePathArm64, toolName);
504return Path.Combine(s_pathToX32Clr4 ??= basePath, toolName);
582string lastDirectoryName = Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar));
616string fullPath = Path.Combine(envPath, toolName);
778string appHostPath = Path.Combine(msbuildAssemblyPath, Constants.MSBuildExecutableName);
828$"\"{Path.Combine(msbuildAssemblyPath, Constants.MSBuildAssemblyName)}\" {commandLineArgs}",
BackEnd\Components\Scheduler\Scheduler.cs (5)
2678using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerTrace_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true);
2706shouldWriteHeader = !FileSystems.Default.FileExists(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId));
2709using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true);
2833using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true);
2873using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true);
Evaluation\Evaluator.cs (9)
1186string projectFileWithoutExtension = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_projectRootElement.FullPath));
1187string projectExtension = EscapingUtilities.Escape(Path.GetExtension(_projectRootElement.FullPath));
1190string projectFullPath = Path.Combine(projectDirectory, projectFile);
1192int rootLength = Path.GetPathRoot(projectDirectory).Length;
1854ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(sdkResult.Path, project),
1867ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(additionalPath, project),
1904string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(sdkResult.Path, 5), Constants.DotnetProcessName);
2118if (directoryOfImportingFile != null && !Path.IsPathRooted(importFileUnescaped))
2120importFileUnescaped = Path.Combine(directoryOfImportingFile, importFileUnescaped);
Evaluation\Expander\WellKnownFunctions.cs (24)
38var logFile = Path.Combine(Directory.GetCurrentDirectory(), fileName);
50if (string.Equals(methodName, nameof(Path.Combine), StringComparison.OrdinalIgnoreCase))
62returnVal = Path.Combine(arg0);
69returnVal = Path.Combine(arg0, arg1);
76returnVal = Path.Combine(arg0, arg1, arg2);
83returnVal = Path.Combine(arg0, arg1, arg2, arg3);
90returnVal = Path.Combine(Array.ConvertAll(args, o => (string)o));
96else if (string.Equals(methodName, nameof(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase))
100returnVal = Path.DirectorySeparatorChar;
104else if (string.Equals(methodName, nameof(Path.GetFullPath), StringComparison.OrdinalIgnoreCase))
109? Path.GetFullPath(Path.Combine(FileUtilities.CurrentThreadWorkingDirectory, arg0))
110: Path.GetFullPath(arg0);
114else if (string.Equals(methodName, nameof(Path.IsPathRooted), StringComparison.OrdinalIgnoreCase))
118returnVal = Path.IsPathRooted(arg0);
122else if (string.Equals(methodName, nameof(Path.GetTempPath), StringComparison.OrdinalIgnoreCase))
126returnVal = Path.GetTempPath();
130else if (string.Equals(methodName, nameof(Path.GetFileName), StringComparison.OrdinalIgnoreCase))
134returnVal = Path.GetFileName(arg0);
138else if (string.Equals(methodName, nameof(Path.GetDirectoryName), StringComparison.OrdinalIgnoreCase))
142returnVal = Path.GetDirectoryName(arg0);
146else if (string.Equals(methodName, nameof(Path.GetFileNameWithoutExtension), StringComparison.OrdinalIgnoreCase))
150returnVal = Path.GetFileNameWithoutExtension(arg0);
859else if (receiverType == typeof(Path))
Microsoft.Build.BuildCheck.UnitTests (62)
ConfigurationProvider_Tests.cs (10)
33var configs = configurationProvider.GetConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
55var configs = configurationProvider.GetConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
89var customConfiguration = configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
115var buildConfig = configurationProvider.GetUserConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
146configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
151configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.Path, "test123.csproj"), "rule_id");
178configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
183configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.Path, "test123.csproj"), "rule_id");
209configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id");
214configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.Path, "test123.csproj"), "rule_id");
EndToEndTests.cs (42)
37private static string AssemblyLocation { get; } = Path.Combine(Path.GetDirectoryName(typeof(EndToEndTests).Assembly.Location) ?? AppContext.BaseDirectory);
39private static string TestAssetsRootPath { get; } = Path.Combine(AssemblyLocation, "TestAssets");
164FileUtilities.CopyDirectory(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.Path);
165ReplaceStringInFile(Path.Combine(workFolder.Path, referencedProjectName, $"{referencedProjectName}.csproj"),
168Path.Combine(workFolder.Path, referencedProjectName, "Resource1.resx"),
169Path.Combine(workFolder.Path, referencedProjectName, $"Resource1.{resourceExtension}.resx"));
171_env.SetCurrentDirectory(Path.Combine(workFolder.Path, entryProjectName));
178string[] depsFiles = Directory.GetFiles(Path.Combine(workFolder.Path, entryProjectName), $"{entryProjectName}.deps.json", SearchOption.AllDirectories);
259FileUtilities.CopyDirectory(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.Path);
261_env.SetCurrentDirectory(Path.Combine(workFolder.Path, entryProjectName));
371FileUtilities.CopyDirectory(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.Path);
372ReplaceStringInFile(Path.Combine(workFolder.Path, $"{projectName}.csproj"),
544$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore" +
579var projectDirectory = Path.GetDirectoryName(projectFile.Path);
583$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore {(checkRequested ? "-check" : string.Empty)} -bl:{logFile}",
592$"{logFile} -flp:logfile={Path.Combine(projectDirectory!, "logFile.log")};verbosity=diagnostic",
634$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check",
658string checkCandidatePath = Path.Combine(TestAssetsRootPath, "CheckCandidate");
664string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName);
674$"{Path.Combine(checkCandidatePath, $"CheckCandidate.csproj")} /m:1 -nr:False -restore -check -verbosity:n", out bool success, timeoutMilliseconds: 1200_0000);
693string? projectDirectory = Path.GetDirectoryName(projectFile.Path);
697$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -bl:{logFile}",
703$"{logFile} -flp:logfile={Path.Combine(projectDirectory!, "logFile.log")};verbosity=diagnostic {(checkRequested ? "-check" : string.Empty)}",
748$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds);
784$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds);
808$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check" +
838var checkCandidatePath = Path.Combine(TestAssetsRootPath, checkCandidate);
842$"{Path.Combine(checkCandidatePath, $"{checkCandidate}.csproj")} /m:1 -nr:False -restore -check -verbosity:n",
871string checkCandidatePath = Path.Combine(TestAssetsRootPath, checkCandidate);
875string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName);
882$"{Path.Combine(checkCandidatePath, $"{checkCandidate}.csproj")} /m:1 -nr:False -restore -check -verbosity:n", out bool _, timeoutMilliseconds: timeoutInMilliseconds);
900string checkCandidatePath = Path.Combine(TestAssetsRootPath, checkCandidate);
904string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName);
911$"{Path.Combine(checkCandidatePath, $"{checkCandidate}.csproj")} /m:1 -nr:False -restore -check -verbosity:n", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
931$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -t:restore -check",
971var nugetTemplatePath = Path.Combine(checkCandidatePath, "nugetTemplate.config");
985string checksPackagesPath = Path.Combine(Directory.GetParent(AssemblyLocation)?.Parent?.FullName ?? string.Empty, "CustomChecks");
998doc.Save(Path.Combine(checkCandidatePath, "nuget.config"));
1067_env.SetCurrentDirectory(Path.GetDirectoryName(projectFile.Path));
1077File.ReadAllText(Path.Combine(TestAssetsRootPath, testAssetsFolderName, fileName))
1101string configContent = File.ReadAllText(Path.Combine(TestAssetsRootPath, testAssetsFolderName, $"{EditorConfigFileName}test"));
Microsoft.Build.CommandLine.UnitTests (82)
XMake_Tests.cs (61)
85private static string TestAssetsRootPath { get; } = Path.Combine(Path.Combine(Path.GetDirectoryName(typeof(XMakeAppTests).Assembly.Location) ?? AppContext.BaseDirectory), "TestAssets");
1196string tempdir = Path.GetTempPath();
1197string projectFileName = Path.Combine(tempdir, "msbEnvironmenttest.proj");
1230string tempdir = Path.GetTempPath();
1231string projectFileName = Path.Combine(tempdir, "msbLoggertest.proj");
1232string logFile = Path.Combine(tempdir, "logFile");
1272? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe")
1324Directory.SetCurrentDirectory(Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe));
1347string projectPath = Path.Combine(directory, "my.proj");
1348string rspPath = Path.Combine(directory, AutoResponseFileName);
1454directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
1456string projectPath = Path.Combine(directory, "my.proj");
1457string rspPath = Path.Combine(directory, AutoResponseFileName);
1460string exePath = Path.Combine(exeDirectory, Constants.MSBuildExecutableName);
1461string mainRspPath = Path.Combine(exeDirectory, AutoResponseFileName);
1498string projectPath = Path.Combine(directory, "my.proj");
1499string rspPath = Path.Combine(directory, AutoResponseFileName);
1500string exePath = Path.Combine(directory, Constants.MSBuildExecutableName);
1613output.ShouldContain($"[A={directory.Path}{Path.DirectorySeparatorChar}]");
2057if (Path.GetExtension(file).Contains("proj"))
2073string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName;
2096string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName;
2214distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in"
2227distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"{fileLoggerParameters[0]};logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in"
2240distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"{fileLoggerParameters[0]};logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in"
2253distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($";Parameter1;logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in"
2270fileLoggerParameters = new[] { "Parameter1", "verbosity=Normal;logfile=" + Path.Combine("..", "cat.log") + ";Parameter1" };
2277distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"Parameter1;verbosity=Normal;logFile={Path.Combine(Directory.GetCurrentDirectory(), "..", "cat.log")};Parameter1", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in"
2286distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"Parameter1;Parameter;;;Parameter;Parameter;logFile={Path.Combine(Directory.GetCurrentDirectory(), "msbuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in"
2644var dllFilePath = Path.Combine(tempDir.Path, expectedLoggerName);
2669$"\"{Path.Combine(tempLoggerProjDir, "CustomLogger.csproj")}\" -restore -verbosity:n", out bool success);
2671var loggerDllPath = Path.Combine(tempLoggerProjDir, "artifacts", "bin", "netstandard2.0", expectedLoggerName);
2696$"{Path.Combine(tempLoggerProjDir, $"FaultyLogger.csproj")} -restore -verbosity:n", out bool success);
2698var loggerDllPath = Path.Combine(tempLoggerProjDir, "artifacts", "bin", "netstandard2.0", expectedLoggerName);
2777string binLog1 = Path.Combine(binLogLocation, "1.binlog");
2778string binLog2 = Path.Combine(binLogLocation, "2.binlog");
2779string binLog3 = Path.Combine(binLogLocation, "3.binlog");
2816string binLog1 = Path.Combine(binLogLocation, "1.binlog");
2817string binLog2 = Path.Combine(binLogLocation, "2.binlog");
2856string binLog1 = Path.Combine(binLogLocation, "with-imports.binlog");
2857string binLog2 = Path.Combine(binLogLocation, "no-imports.binlog");
3034string binlogPath = Path.Combine(testProject.TestRoot, match.Groups[1] + ".binlog");
3061string binlogPath = Path.Combine(testProject.TestRoot, match.Groups[1] + ".binlog");
3093var preprocessFile = Path.Combine(testProject.TestRoot, "Preprocess.xml");
3183string source = Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe);
3184dest = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
3196if (Path.GetFileName(d).Equals("TestTemp", StringComparison.InvariantCultureIgnoreCase))
3205File.Copy(file, Path.Combine(dest, Path.GetFileName(file)));
3210string dirName = Path.GetFileName(directory);
3211string destSubDir = Path.Combine(dest, dirName);
3250File.WriteAllText(Path.Combine(testProject.TestRoot, item.Key), item.Value);
3269var testAssetsPath = Path.Combine(TestAssetsRootPath, folderName);
3270var loggerProjDir = Path.Combine(testAssetsPath, "LoggerProject");
3274var tempLoggerProjDir = Path.Combine(tempDir.Path, "LoggerProject");
3280var destPath = Path.Combine(tempLoggerProjDir, relativePath);
3281Directory.CreateDirectory(Path.GetDirectoryName(destPath));
Microsoft.Build.EndToEnd.Tests (11)
Microsoft.Build.Engine.OM.UnitTests (151)
Construction\ProjectRootElement_Tests.cs (16)
160Assert.Equal(project.FullPath, Path.Combine(Directory.GetCurrentDirectory(), "X"));
189projectXml1.FullPath = Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc");
207ProjectRootElement projectXml2 = ProjectRootElement.Open(Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc"));
226ProjectRootElement projectXml2 = ProjectRootElement.Open(Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc"));
243projectXml1.FullPath = Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc");
536string path = Path.Combine(toolsPath, target);
635directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
637string path = Path.Combine(directory, file);
663Directory.SetCurrentDirectory(Path.GetTempPath()); // should be used for project.DirectoryPath; it must exist
667string file = "bar" + Path.DirectorySeparatorChar + "foo.proj";
668string path = Path.Combine(curDir, file);
669directory = Path.Combine(curDir, "bar");
1673var fullPath = Path.GetFullPath("foo");
1776projectFileAssert.Invoke(Path.GetDirectoryName(initialLocation), Path.GetDirectoryName(reloadLocation), rootElement.DirectoryPath);
Definition\DefinitionEditing_Tests.cs (17)
285string wildcard = Path.Combine(Path.GetDirectoryName(paths[0]), "*.xxx;");
667string directory = Path.GetDirectoryName(paths[0]);
668string wildcard = Path.Combine(directory, "*.xxx;");
788string directory = Path.GetDirectoryName(paths[0]);
789string wildcard = Path.Combine(directory, "*.xxx;");
1093string directory = Path.GetDirectoryName(paths[0]);
1094string wildcard = Path.Combine(directory, "*.xxx;");
1111ProjectCollection.Escape(Path.Combine(directory, "i2.xxx")));
1133string directory = Path.GetDirectoryName(paths[0]);
1134string wildcard = Path.Combine(directory, "*.xxx;");
1143item.Rename(Path.Combine(directory, "i2.xxx"));
1388string directory = Path.GetDirectoryName(paths[0]);
1389string wildcard = Path.Combine(directory, "*.xxx;");
1408ProjectCollection.Escape(Path.Combine(directory, "i2.xxx")));
2209string wildcard = Path.Combine(Path.GetDirectoryName(paths[0]), "*.xxx;");
Definition\Project_Tests.cs (42)
205string file = Path.GetTempPath() + Path.DirectorySeparatorChar + Guid.NewGuid().ToString("N");
653Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386", "foo.dll"));
684project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll"));
685projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll"));
689project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll"));
690projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll"));
720project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar);
721projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar);
756project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar);
757projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar);
776<IntermediateAssembly Include='obj" + Path.DirectorySeparatorChar + "i386"
777+ Path.DirectorySeparatorChar
795project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386"));
796projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386"));
1729testFileRoot = Path.Combine(Path.GetTempPath(), "foodir");
1735string filePath = Path.Combine(testFileRoot, fileName);
1741projectConstruction.AddItem("foo", Path.Combine(testFileRoot, "*.foo"));
2489directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
2490string subdirectory = Path.Combine(directory, "sub");
2493string projectPath = Path.Combine(subdirectory, "a.proj");
2494string targetsPath = Path.Combine(directory, "b.targets");
2496string unevaluatedInclude = ".." + Path.DirectorySeparatorChar + "*";
2497string evaluatedInclude = ".." + Path.DirectorySeparatorChar + "b.targets";
2595string myTempDir = Path.Combine(Path.GetTempPath() + "MyTempDir");
2602ProjectRootElement one = ProjectRootElement.Create(Path.Combine(myTempDir, "1.targets"));
2606ProjectRootElement two = ProjectRootElement.Create(Path.Combine(myTempDir, "2.targets"));
2610ProjectRootElement zero = ProjectRootElement.Create(Path.Combine(myTempDir, "0.targets"));
2614zero.AddImport(Path.Combine(myTempDir, "*.targets"));
3293var absoluteFile = Path.Combine(Path.GetDirectoryName(testFiles.ProjectFile), "1.foo");
3771var absoluteFile = Path.Combine(Path.GetDirectoryName(testFiles.ProjectFile), "a.cs");
4110string importPath = Path.Combine(pre.DirectoryPath, Guid.NewGuid().ToString());
4153string importGlob = Path.Combine(pre.DirectoryPath, @"__NoMatch__\**");
Definition\ProjectItem_Tests.cs (22)
350directory = Path.Combine(Path.GetTempPath(), "a");
356subdirectory = Path.Combine(directory, "b");
362file = Path.Combine(subdirectory, "c");
397directory = Path.Combine(Path.GetTempPath(), "a");
403subdirectory = Path.Combine(directory, "b");
409file = Path.Combine(subdirectory, "c");
761expectedInclude = expectedInclude.Select(p => setSlashes(p, Path.DirectorySeparatorChar)).ToArray();
1091? Path.GetFullPath(Path.Combine(testRoot, relativeFragmentFromRootToFile, file))
1092: Path.Combine(relativeFragmentFromRootToFile, file);
1102var projectFileDir = Path.GetDirectoryName(projectFile);
1985string projectDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
1989string sourceFile = Path.Combine(projectDirectory, "a.cs");
1990string renamedSourceFile = Path.Combine(projectDirectory, "b.cs");
1994project.FullPath = Path.Combine(projectDirectory, "test.proj"); // assign a path so the wildcards can lock onto something.
1998Assert.Equal(Path.GetFileName(sourceFile), projectItem.EvaluatedInclude);
2000projectItem.Rename(Path.GetFileName(renamedSourceFile));
2004Assert.Equal(Path.GetFileName(renamedSourceFile), projectItem.EvaluatedInclude);
Instance\ProjectInstance_Tests.cs (22)
284directory = Path.Combine(Path.GetTempPath(), "WildcardsInsideTargets");
286file1 = Path.Combine(directory, "a.exe");
287file2 = Path.Combine(directory, "b.exe");
288file3 = Path.Combine(directory, "c.bat");
293string path = Path.Combine(directory, "*.exe");
419projA.FullPath = Path.Combine(Path.GetTempPath(), "a.proj");
420projB.FullPath = Path.Combine(Path.GetTempPath(), "b.proj");
455projA.FullPath = Path.Combine(Path.GetTempPath(), "a.proj");
456projB.FullPath = Path.Combine(Path.GetTempPath(), "b.proj");
498string tempDir = Path.GetTempFileName();
501File.Create(Path.Combine(tempDir, "aItem.cs")).Dispose();
503projA.FullPath = Path.Combine(tempDir, "a.proj");
504projB.FullPath = Path.Combine(tempDir, "b.proj");
529string projectA = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj");
530string projectB = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj");
532string includeFileA = Path.Combine(ObjectModelHelpers.TempProjectDir, "aaa4.cs");
533string includeFileB = Path.Combine(ObjectModelHelpers.TempProjectDir, "bbb4.cs");
Microsoft.Build.Engine.UnitTests (944)
BackEnd\BuildRequestEngine_Tests.cs (3)
442BuildRequestData data = new BuildRequestData(Path.GetFullPath("TestFile"), new Dictionary<string, string>(), "TestToolsVersion", Array.Empty<string>(), null);
448BuildRequestData data2 = new BuildRequestData(Path.GetFullPath("OtherFile"), new Dictionary<string, string>(), "TestToolsVersion", Array.Empty<string>(), null);
466Assert.Equal(Path.GetFullPath("OtherFile"), _newConfiguration_Config.ProjectFullPath);
BackEnd\SdkResolverLoader_Tests.cs (29)
61var d1 = Directory.CreateDirectory(Path.Combine(root, "Resolver1"));
64var f1 = Path.Combine(d1.FullName, "Resolver1.dll");
67var f2 = Path.Combine(d1.FullName, "Dependency.dll");
68var f3 = Path.Combine(d1.FullName, "InvalidName.dll");
69var f4 = Path.Combine(d1.FullName, "NoResolver.txt");
94var testFolder = Directory.CreateDirectory(Path.Combine(root, "MyTestResolver"));
96var wrongResolverDll = Path.Combine(testFolder.FullName, "MyTestResolver.dll");
97var resolverManifest = Path.Combine(testFolder.FullName, "MyTestResolver.xml");
98var assemblyToLoad = Path.Combine(root, "SomeOtherResolver.dll");
220var resolverPath = Path.Combine(root, "MyTestResolver");
221var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml");
245var resolverPath = Path.Combine(root, "MyTestResolver");
246var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml");
272var resolverPath = Path.Combine(root, "MyTestResolver");
273var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml");
296var resolverPath = Path.Combine(root, "MyTestResolver");
312var resolverPath = Path.Combine(root, "MyTestResolver");
313var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml");
370var resolver1Path = Path.Combine(additionalRoot, resolver1, $"{resolver1}.dll");
371Directory.CreateDirectory(Path.Combine(testRoot, resolver1));
372File.WriteAllText(Path.Combine(testRoot, resolver1, $"{resolver1}.dll"), string.Empty);
373Directory.CreateDirectory(Path.Combine(additionalRoot, resolver1));
376var resolver2Path = Path.Combine(testRoot, resolver2, $"{resolver2}.dll");
377Directory.CreateDirectory(Path.Combine(testRoot, resolver2));
380var resolver3Path = Path.Combine(additionalRoot, resolver3, $"{resolver3}.dll");
381Directory.CreateDirectory(Path.Combine(additionalRoot, resolver3));
428msBuildExePath = Path.GetFullPath(Assembly.GetExecutingAssembly().Location);
442var resolverFolder = Path.Combine(testRoot, "Microsoft.DotNet.MSBuildSdkResolver");
445var assemblyFile = Path.Combine(resolverFolder, "Microsoft.DotNet.MSBuildSdkResolver.dll");
BackEnd\SdkResultOutOfProc_Tests.cs (10)
106string projectPath = Path.Combine(projectFolder, "TestProject.proj");
141string entryProjectPath = Path.Combine(projectFolder, "EntryProject.proj");
151string projectWithSdkImportPath = Path.Combine(projectFolder, "ProjectWithSdkImport.proj");
199var sdkResolver = SetupSdkResolver(Path.GetDirectoryName(projectPath));
215Directory.CreateDirectory(Path.Combine(projectFolder, "Sdk1"));
216Directory.CreateDirectory(Path.Combine(projectFolder, "Sdk2"));
232File.WriteAllText(Path.Combine(projectFolder, "Sdk1", "Sdk.props"), CleanupFileContents(sdk1propsContents));
233File.WriteAllText(Path.Combine(projectFolder, "Sdk2", "Sdk.props"), CleanupFileContents(sdk2propsContents));
240Path.Combine(projectFolder, "Sdk1"),
241Path.Combine(projectFolder, "Sdk2")
BinaryLogger_Tests.cs (18)
356RunnerUtilities.ExecMSBuild($"{_logFile} -flp:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic", out success);
359string text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile.log"));
413RunnerUtilities.ExecMSBuild($"{projectFile.Path} -nr:False -bl:{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile2.log")};verbosity=normal", out bool success);
418string text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile.log"));
422string text2 = File.ReadAllText(Path.Combine(logFolder.Path, "logFile2.log"));
425RunnerUtilities.ExecMSBuild($"{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile3.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile4.log")};verbosity=normal", out success);
427text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile3.log"));
431text2 = File.ReadAllText(Path.Combine(logFolder.Path, "logFile4.log"));
456var projectImportsZipPath = Path.ChangeExtension(_logFile, ".ProjectImports.zip");
476string symlinkPath = Path.Combine(testFolder2.Path, symlinkName);
477string symlinkLvl2Path = Path.Combine(testFolder2.Path, symlinkLvl2Name);
516var projectImportsZipPath = Path.ChangeExtension(_logFile, ".ProjectImports.zip");
563string logFilePath = Path.Combine(_env.DefaultTestDirectory.Path, "test.binlog");
696string expectedLog = Path.GetFullPath(expectedBinlogFile);
812Path.GetFileName(result).ShouldBe(expectedFileName);
824Path.IsPathRooted(result).ShouldBeTrue();
BuildEnvironmentHelper_Tests.cs (34)
21var msbuildPath = Path.GetDirectoryName(typeof(BuildEnvironmentHelper).GetAssemblyPath());
22string expectedMSBuildPath = Path.Combine(msbuildPath, Constants.MSBuildExecutableName).ToLowerInvariant();
31configFilePath.ShouldBe($"{Path.GetDirectoryName(actualMSBuildPath)}{Path.DirectorySeparatorChar}{Constants.MSBuildAssemblyName.ToLowerInvariant()}.config");
34Path.GetDirectoryName(expectedMSBuildPath).ShouldBe(toolsDirectoryPath);
44var msBuildPath = Path.Combine(path, Constants.MSBuildExecutableName);
45var msBuildConfig = Path.Combine(path,
76var msBuildPath = Path.Combine(msbuildBinDirectory, Constants.MSBuildExecutableName);
77var msBuildConfig = Path.Combine(msbuildBinDirectory, $"{Constants.MSBuildExecutableName}.config");
78var vsMSBuildDirectory = Path.Combine(env.TempFolderRoot, "MSBuild");
187Path.GetFileName(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath).ShouldBe(Constants.MSBuildExecutableName);
363var msBuild64Exe = Path.Combine(env.BuildDirectory, "amd64", Constants.MSBuildExecutableName);
368BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64"));
384BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64"));
409var entryProcess = Path.Combine(Path.GetTempPath(), "foo.exe");
414BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ShouldBe(Path.GetDirectoryName(entryProcess));
425var msBuildAssembly = Path.Combine(env.BuildDirectory, "Microsoft.Build.dll");
442var msBuildAssembly = Path.Combine(env.BuildDirectory64, "Microsoft.Build.dll");
467public string MSBuildExePath64 => Path.Combine(BuildDirectory64, Constants.MSBuildExecutableName);
475BuildDirectory = Path.Combine(TempFolderRoot, "MSBuild", toolsVersion, "Bin");
476BuildDirectory64 = Path.Combine(BuildDirectory, "amd64");
477DevEnvPath = Path.Combine(TempFolderRoot, "Common7", "IDE", "devenv.exe");
478BlendPath = Path.Combine(TempFolderRoot, "Common7", "IDE", "blend.exe");
483File.WriteAllText(Path.Combine(BuildDirectory, file), string.Empty);
489File.WriteAllText(Path.Combine(BuildDirectory64, file), string.Empty);
492Directory.CreateDirectory(Path.Combine(TempFolderRoot, "Common7", "IDE"));
511public string MSBuildExePath => Path.Combine(BuildDirectory, Constants.MSBuildExecutableName);
522TempFolderRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
523BuildDirectory = Path.Combine(TempFolderRoot, "MSBuild");
533Directory.CreateDirectory(Path.Combine(BuildDirectory, "amd64"));
534File.WriteAllText(Path.Combine(BuildDirectory, "amd64", msBuildExeName), string.Empty);
535File.WriteAllText(Path.Combine(BuildDirectory, "amd64", $"{MSBuildExePath}.config"), string.Empty);
Construction\SolutionFile_OldParser_Tests.cs (27)
168string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp");
219string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp");
220string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproja.proj");
320Project('{F14B399A-7131-4C87-9E4B-1186C45EF12D}') = 'RptProj', '" + Path.GetFileName(rptprojPath) + @"', '{CCCCCCCC-9925-4D57-9DAF-E0A9D936ABDB}'
324Project('{D2ABAB84-BF74-430A-B69E-9DC6D40DDA17}') = 'DwProj', '" + Path.GetFileName(dqprojPath) + @"', '{DEA89696-F42B-4B58-B7EE-017FF40817D1}'
344string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp");
345string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp");
539string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp");
540string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp");
541string proj3Path = Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest", "someproj3.etp");
586<FILE>" + Path.Combine("..", "SomeFolder", "ClassLibrary1.csproj") + @"</FILE>
594Directory.CreateDirectory(Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest"));
613solution.ProjectsInOrder[3].RelativePath.ShouldBe(Path.Combine("ETPProjUpgradeTest", "..", "SomeFolder", "ClassLibrary1.csproj"));
631string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp");
689string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp");
773var solutionFolder = env.CreateFolder(Path.Combine(FileUtilities.GetTemporaryDirectory(), "sln"));
774env.CreateFolder(Path.Combine(solutionFolder.Path, "RelativePath"));
777p.FullPath = Path.Combine(solutionFolder.Path, "RelativePath", "project file");
778p.SolutionFileDirectory = Path.GetFullPath(solutionFolder.Path);
786proj.RelativePath.ShouldBe(Path.Combine("RelativePath", "project file"));
803sp.SolutionFileDirectory = Path.GetTempPath();
2426string expectedRelativePath = Path.Combine("..", "ProjectA", "ProjectA.csproj");
2429solution.ProjectsInOrder[0].AbsolutePath.ShouldBe(Path.GetFullPath(Path.Combine(Path.GetDirectoryName(solution.FullPath)!, expectedRelativePath)));
2519if (project.AbsolutePath.Contains(Path.DirectorySeparatorChar.ToString()))
Construction\SolutionFilter_Tests.cs (30)
53TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "ClassLibrary"), createFolder: true);
54TransientTestFolder classLibSubFolder = testEnvironment.CreateFolder(Path.Combine(classLibFolder.Path, "ClassLibrary"), createFolder: true);
63TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "SimpleProject"), createFolder: true);
64TransientTestFolder simpleProjectSubFolder = testEnvironment.CreateFolder(Path.Combine(simpleProjectFolder.Path, "SimpleProject"), createFolder: true);
124Directory.GetCurrentDirectory().ShouldNotBe(Path.GetDirectoryName(filterFile.Path));
231TransientTestFolder src = testEnvironment.CreateFolder(Path.Combine(folder.Path, "src"), createFolder: true);
243Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build"", """ + Path.Combine("src", Path.GetFileName(microsoftBuild.Path)) + @""", ""{69BE05E2-CBDA-4D27-9733-44E12B0F5627}""
245Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""MSBuild"", """ + Path.Combine("src", Path.GetFileName(msbuild.Path)) + @""", ""{6F92CA55-1D15-4F34-B1FE-56C0B7EB455E}""
247Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.CommandLine.UnitTests"", """ + Path.Combine("src", Path.GetFileName(commandLineUnitTests.Path)) + @""", ""{0ADDBC02-0076-4159-B351-2BF33FAA46B2}""
249Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.Tasks.UnitTests"", """ + Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)) + @""", ""{CF999BDE-02B3-431B-95E6-E88D621D9CBF}""
269""" + Path.Combine("src", Path.GetFileName(microsoftBuild.Path)!).Replace("\\", "\\\\") + @""",
270""" + Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)!).Replace("\\", "\\\\") + @"""
275sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(microsoftBuild.Path)!)).ShouldBeTrue();
276sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)!)).ShouldBeTrue();
279(sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(commandLineUnitTests.Path)!))
280|| sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(msbuild.Path)!))
281|| sp.ProjectShouldBuild(Path.Combine("src", "notAProject.csproj")))
292folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, $"test@folder%special$symbols"), createFolder: true);
393TransientTestFolder src = testEnvironment.CreateFolder(Path.Combine(folder.Path, "src"), createFolder: true);
394TransientTestFolder nested = testEnvironment.CreateFolder(Path.Combine(src.Path, "nested"), createFolder: true);
Construction\SolutionProjectGenerator_Tests.cs (24)
121TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true);
131TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true);
166TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true);
182TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true);
241TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true);
257TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true);
909<ProjectConfiguration Project="{786E302A-96CE-43DC-B640-D6B6CC9BF6C0}" AbsolutePath="##temp##{{Path.Combine("Project1", "A.csproj")}}" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration>
910<ProjectConfiguration Project="{881C1674-4ECA-451D-85B6-D7C59B7F16FA}" AbsolutePath="##temp##{{Path.Combine("Project2", "B.csproj")}}" BuildProjectInSolution="True">Debug|AnyCPU<ProjectDependency Project="{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}" /></ProjectConfiguration>
911<ProjectConfiguration Project="{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}" AbsolutePath="##temp##{{Path.Combine("Project3", "C.csproj")}}" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration>
1157string tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "ClassLibrary1", "ClassLibrary1.csproj");
1160tempProjectPath = Path.GetFullPath(tempProjectPath);
1164tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "MainApp", "MainApp.vcxproj");
1165tempProjectPath = Path.GetFullPath(tempProjectPath);
2599string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"),
2619ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"),
2658string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"),
2678ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"),
2736string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"),
2756string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, projectName),
2768ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.props"),
2777ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.targets"),
2846projectInSolution.AbsolutePath.ShouldBe(Path.Combine(solution.SolutionFileDirectory, projectInSolution.RelativePath));
Definition\ProjectEvaluationContext_Tests.cs (53)
123{Path.Combine(_env.DefaultTestDirectory.Path, "1.file"), 1},
124{Path.Combine(_env.DefaultTestDirectory.Path, "2.file"), 1}
182{ Path.Combine(_env.DefaultTestDirectory.Path, "1.file"), 2 }
378File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.cs"), "");
388File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.cs"), "");
438File.WriteAllText(Path.Combine(projectDirectory1, $"1.{evaluationCount}.cs"), "");
439File.WriteAllText(Path.Combine(projectDirectory2, $"2.{evaluationCount}.cs"), "");
445Path.Combine(projectDirectory1, "1"),
448<i Include=`{Path.Combine("**", "*.cs")}` />
452Path.Combine(projectDirectory2, "2"),
455<i Include=`{Path.Combine("**", "*.cs")}` />
462var projectName = Path.GetFileNameWithoutExtension(project.FullPath);
472File.WriteAllText(Path.Combine(projectDirectory1, $"1.{evaluationCount}.cs"), "");
473File.WriteAllText(Path.Combine(projectDirectory2, $"2.{evaluationCount}.cs"), "");
493File.WriteAllText(Path.Combine(project1GlobDirectory, $"1.{evaluationCount}.cs"), "");
494File.WriteAllText(Path.Combine(project2GlobDirectory, $"2.{evaluationCount}.cs"), "");
500Path.Combine(project1Directory, "1"),
503<i Include=`{Path.Combine("..", "Glob", "**", "*.cs")}`/>
507Path.Combine(project2Directory, "2"),
510<i Include=`{Path.Combine("..", "Glob", "**", "*.cs")}`/>
517var projectName = Path.GetFileNameWithoutExtension(project.FullPath);
521.Select(i => Path.Combine("..", "Glob", projectName, $"{projectName}.{i}"))
529File.WriteAllText(Path.Combine(project1GlobDirectory, $"1.{evaluationCount}.cs"), "");
530File.WriteAllText(Path.Combine(project2GlobDirectory, $"2.{evaluationCount}.cs"), "");
555File.WriteAllText(Path.Combine(project1GlobDirectory, $"{evaluationCount}.cs"), "");
562Path.Combine(project1Directory.Path, "1"),
565<i Include=`{Path.Combine("Glob", "**", "*.cs")}` />
570Path.Combine(project2Directory.Path, "2"),
573<i Include=`{Path.Combine(project1Directory.Path, "Glob", "**", "*.cs")}` />
580var projectName = Path.GetFileNameWithoutExtension(project.FullPath);
584.Select(i => Path.Combine("Glob", "1", i))
591.Select(i => Path.Combine(project1Directory.Path, i))
600File.WriteAllText(Path.Combine(project1GlobDirectory, $"{evaluationCount}.cs"), "");
622File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), "");
628Path.Combine(project1Directory.Path, "1"),
635Path.Combine(project2Directory.Path, "2"),
645var projectName = Path.GetFileNameWithoutExtension(project.FullPath);
647? Path.Combine("..", "..", "glob")
648: Path.Combine("..", "..", "..", "glob");
652.Select(i => Path.Combine(globFixedDirectoryPart, i))
660File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), "");
686? Path.Combine("..", "GlobDirectory")
702prependedGlobExpansion[i] = Path.Combine(itemSpecDirectoryPart, globExpansion[i]);
710<i Include=`{Path.Combine("{0}", "**", "*.cs")}`/>
715<i Include=`{Path.Combine("{0}", "**", "*.cs")}`/>
720.Select((p, i) => new ProjectSpecification(Path.Combine(testDirectory.Path, $"ProjectDirectory{i}", $"Project{i}.proj"), p));
726File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), "");
736File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), "");
763File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.props"), $"<Project><ItemGroup><i Include=`{evaluationCount}.cs`/></ItemGroup></Project>".Cleanup());
773File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.props"), $"<Project><ItemGroup><i Include=`{evaluationCount}.cs`/></ItemGroup></Project>".Cleanup());
804var theFile = Path.Combine(projectDirectory, "0.cs");
958projectContents.Select((p, i) => new ProjectSpecification(Path.Combine(_env.DefaultTestDirectory.Path, $"Project{i}.proj"), p)),
992Directory.CreateDirectory(Path.GetDirectoryName(projectFilePath));
Evaluation\Evaluator_Tests.cs (146)
107TransientTestFolder projDirectory = env.CreateFolder(Path.Combine(env.CreateNewTempPath().TempPath, projectPathCandidate), createFolder: true);
140yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}')""", true };
141yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false };
142yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}""", false };
143yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "*.*proj")}""", true };
146yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}')""", true };
147yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false };
148yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}""", false };
149yield return new object[] { $@"Project=""{Path.Combine("realFolder", "*.*proj")}""", true };
152yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}"" Condition=""Exists('{Path.Combine("realFolder", "realFile.csproj")}')""", true };
153yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}"" Condition=""'true'""", true };
154yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}""", true };
155yield return new object[] { $@"Project=""{Path.Combine("realFolder", "*.*proj")}""", true };
160yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}')""", true };
161yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false };
162yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}""", false };
163yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "*.*proj")}""", true };
164yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "*.*proj")}""", true };
332string tempPath = Path.GetTempPath();
333string targetDirectory = Path.Combine(tempPath, "VerifyConditionsInsideOutsideTargets");
334string subDirectory = Path.Combine(targetDirectory, "subdir");
336string testTargetPath = Path.Combine(targetDirectory, "test.targets");
337string targetDirectoryTargetsPath = Path.Combine(targetDirectory, "targetdir.targets");
338string targetDirectoryTargetsPath2 = Path.Combine(targetDirectory, "targetdir2.targets");
339string subdirProjPath = Path.Combine(subDirectory, "test.proj");
340string projectDirectoryTargetsPath = Path.Combine(subDirectory, "projdir.targets");
341string projectDirectoryTargetsPath2 = Path.Combine(subDirectory, "projdir2.targets");
342string textTextPath = Path.Combine(targetDirectory, "test.txt");
461string tempPath = Path.GetTempPath();
462string targetDirectory = Path.Combine(tempPath, "VerifyConditionsInsideOutsideTargets");
463string subDirectory = Path.Combine(targetDirectory, "subdir");
465string testTargetPath = Path.Combine(targetDirectory, "test.targets");
466string targetDirectoryTargetsPath = Path.Combine(targetDirectory, "targetdir.targets");
467string targetDirectoryTargetsPath2 = Path.Combine(targetDirectory, "targetdir2.targets");
468string subdirProjPath = Path.Combine(subDirectory, "test.proj");
469string projectDirectoryTargetsPath = Path.Combine(subDirectory, "projdir.targets");
470string projectDirectoryTargetsPath2 = Path.Combine(subDirectory, "projdir2.targets");
471string textTextPath = Path.Combine(targetDirectory, "test.txt");
489logger.AssertLogContains("PropertyOutsideTarget: " + Path.Combine("..", "test.txt"));
491logger.AssertLogContains("PropertyInsideTarget: " + Path.Combine("..", "test.txt"));
492logger.AssertLogContains("PropertyGroupInsideTarget: " + Path.Combine("..", "test.txt"));
533string tempPath = Path.GetTempPath();
534string targetDirectory = Path.Combine(tempPath, "VerifyUsedUnInitializedPropertyInImports");
536string targetAPath = Path.Combine(targetDirectory, "targetA.targets");
537string targetBPath = Path.Combine(targetDirectory, "targetB.targets");
538string projectPath = Path.Combine(targetDirectory, "test.proj");
580string tempPath = Path.GetTempPath();
581string targetDirectory = Path.Combine(tempPath, "EmptyPropertyIsThenSet");
582string testTargetPath = Path.Combine(targetDirectory, "test.proj");
622string tempPath = Path.GetTempPath();
623string targetDirectory = Path.Combine(tempPath, "EmptyPropertyIsThenSet");
624string testTargetPath = Path.Combine(targetDirectory, "test.proj");
668string tempPath = Path.GetTempPath();
669string targetDirectory = Path.Combine(tempPath, "SetPropertyToItself");
670string testTargetPath = Path.Combine(targetDirectory, "test.proj");
714string tempPath = Path.GetTempPath();
715string targetDirectory = Path.Combine(tempPath, "UsePropertyInCondition");
716string testTargetPath = Path.Combine(targetDirectory, "test.proj");
758string tempPath = Path.GetTempPath();
759string targetDirectory = Path.Combine(tempPath, "UsePropertyBeforeSet");
760string testTargetPath = Path.Combine(targetDirectory, "test.proj");
804string tempPath = Path.GetTempPath();
805string targetDirectory = Path.Combine(tempPath, "UsePropertyBeforeSetDuplicates");
806string testTargetPath = Path.Combine(targetDirectory, "test.proj");
1156directory = Path.Combine(Path.GetTempPath(), "fol$der");
1157directory2 = Path.Combine(Path.GetTempPath(), "fol$der" + Path.DirectorySeparatorChar + "fol$der2");
1160string importPathRelativeEscaped = Path.Combine("fol$(x)$der2", "Escap%3beab$(x)leChar$ac%3BtersInI*tPa?h");
1161string importRelative1 = Path.Combine("fol$der2", "Escap;eableChar$ac;tersInImportPath");
1162string importRelative2 = Path.Combine("fol$der2", "Escap;eableChar$ac;tersInI_XXXX_tPath");
1163importPath1 = Path.Combine(directory, importRelative1);
1164importPath2 = Path.Combine(directory, importRelative2);
1185projectPath = Path.Combine(directory, "my.proj"); // project path has $ in too
1418logger.AssertLogContains(aProjName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar);
1425logger.AssertLogContains(targets1FileName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar);
1432logger.AssertLogContains(targets2FileName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar + "b" + Path.DirectorySeparatorChar);
2272string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative");
2273string directory2 = Path.Combine(directory, "sub");
2275VerifyImportTargetRelativePath(directory, directory2, new string[] { Path.Combine("**", "*.targets") });
2284string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative2");
2285string directory2 = Path.Combine(directory, "sub");
2290new string[] { Path.Combine(directory2, "*.targets"), Path.Combine(directory, "*.targets") });
2299string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative3");
2300string directory2 = Path.Combine(directory, "sub");
2307Path.Combine(directory2, "..", "*.targets"), Path.Combine(
2321string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsFullPath");
2322string directory2 = Path.Combine(directory, "sub");
2325string file1 = Path.Combine(directory, "1.targets");
2326string file2 = Path.Combine(directory2, "2.targets");
2327string file3 = Path.Combine(directory2, "3.cpp.targets");
3422string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyPropertySetInImportStillOverrides");
3433string primaryProject = Path.Combine(projectDirectory, "project.proj");
3434string import = Path.Combine(projectDirectory, "import.proj");
3483string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyInImportDoesntAffectParentProjectAboveIt");
3494string primaryProject = Path.Combine(projectDirectory, "project.proj");
3495string import = Path.Combine(projectDirectory, "import.proj");
3543string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyInImportAffectsParentProjectBelowIt");
3554string primaryProject = Path.Combine(projectDirectory, "project.proj");
3555string import = Path.Combine(projectDirectory, "import.proj");
3615string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyUnionBetweenImports");
3626string primaryProject = Path.Combine(projectDirectory, "project.proj");
3627string import = Path.Combine(projectDirectory, "import.proj");
3688string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyDuplicateTreatAsLocalProperty");
3699string primaryProject = Path.Combine(projectDirectory, "project.proj");
3700string import = Path.Combine(projectDirectory, "import.proj");
3753string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyGlobalPropertyPassedToP2P");
3764string primaryProject = Path.Combine(projectDirectory, "project.proj");
3765string project2 = Path.Combine(projectDirectory, "project2.proj");
3815string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyLocalPropertyPropagatesIfExplicitlyPassedToP2P");
3826string primaryProject = Path.Combine(projectDirectory, "project.proj");
3827string project2 = Path.Combine(projectDirectory, "project2.proj");
4388string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyDTDProcessingIsDisabled");
4399string projectFilename = Path.Combine(projectDirectory, "project.proj");
4541string projectDirectory = Path.Combine(Path.GetTempPath(), "ThrownInvalidProjectExceptionProperlyHandled");
4552string primaryProject = Path.Combine(projectDirectory, "project.proj");
4553string import = Path.Combine(projectDirectory, "import.proj");
5074string tempPath = Path.GetTempPath();
5075string targetDirectory = Path.Combine(tempPath, "LogPropertyAssignments");
5076string testTargetPath = Path.Combine(targetDirectory, "test.proj");
5221string file0 = Path.Combine(directory, "my.proj");
5222file1 = Path.Combine(directory, "1.targets");
5223file2 = Path.Combine(directory2, "2.targets");
5224file3 = Path.Combine(directory2, "3.cpp.targets");
5225file4 = Path.Combine(directory2, "4.nottargets");
Evaluation\Expander_Tests.cs (143)
43private static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString();
268Assert.Equal(Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory"), itemsTrue[0].EvaluatedInclude);
274Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"seconddirectory"), itemsDir[0].EvaluatedInclude);
294Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, itemsTrue[5].EvaluatedInclude);
350Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, result);
580log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar));
602log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar));
624log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar));
705Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, itemsTrue[5].EvaluatedInclude);
743Assert.Equal(Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory"), itemsTrue[5].EvaluatedInclude);
764Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"secondd;rectory"), items[5].EvaluatedInclude);
765Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"someo;herplace"), items[6].EvaluatedInclude);
806pi.SetMetadata("Meta" + m.ToString(), Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory", "file") + m.ToString() + ".ext");
808pi.SetMetadata("Meta9", Path.Combine("seconddirectory", "file.ext"));
809pi.SetMetadata("Meta10", String.Format(";{0};{1};", Path.Combine("someo%3bherplace", "foo.txt"), Path.Combine("secondd%3brectory", "file.ext")));
1480subdir1" + Path.DirectorySeparatorChar + @": aaa=111
1481subdir2" + Path.DirectorySeparatorChar + @": bbb=222
1531"subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar,
1583@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" +
1584Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi",
1605@"string$(p);dialogs%253b ; splash.bmp ; ; ; ; \jk ; l\mno%253bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%253bdef;ghi",
1716Assert.Equal(@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi", expander.ExpandIntoStringAndUnescape(value, ExpanderOptions.ExpandAll, MockElementLocation.Instance));
1744Assert.Equal("subdir1" + Path.DirectorySeparatorChar, expanded[5]);
1745Assert.Equal("subdir2" + Path.DirectorySeparatorChar, expanded[6]);
2192pg.Set(ProjectPropertyInstance.Create("RootPath", Path.Combine(s_rootPathPrefix, "this", "is", "the", "root")));
2193pg.Set(ProjectPropertyInstance.Create("MyPath", Path.Combine(s_rootPathPrefix, "this", "is", "the", "root", "my", "project", "is", "here.proj")));
2199Assert.Equal(Path.Combine(Path.DirectorySeparatorChar.ToString(), "my", "project", "is", "here.proj"), result);
2226pg.Set(ProjectPropertyInstance.Create("PathRoot", Path.Combine(s_rootPathPrefix, "goo")));
2227pg.Set(ProjectPropertyInstance.Create("PathRoot2", Path.Combine(s_rootPathPrefix, "goop") + Path.DirectorySeparatorChar));
2231string result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot2.Endswith(" + Path.DirectorySeparatorChar + "))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
2233result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot.Endswith(" + Path.DirectorySeparatorChar + "))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
2361pg.Set(ProjectPropertyInstance.Create("PathRoot", Path.Combine(s_rootPathPrefix, "goo")));
2362pg.Set(ProjectPropertyInstance.Create("PathRoot2", Path.Combine(s_rootPathPrefix, "goop") + Path.DirectorySeparatorChar));
2368@"'$(PathRoot2.Endswith(`" + Path.DirectorySeparatorChar + "`))' == 'true'",
2378@"'$(PathRoot.EndsWith(" + Path.DirectorySeparatorChar + "))' == 'false'",
2561pg.Set(ProjectPropertyInstance.Create("ParentPath", Path.Combine(s_rootPathPrefix, "abc", "def")));
2562pg.Set(ProjectPropertyInstance.Create("FilePath", Path.Combine(s_rootPathPrefix, "abc", "def", "foo.cpp")));
2579pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo", "file.txt")));
2585Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result);
2724pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo", "file.txt")));
2730Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result);
2740pg.Set(ProjectPropertyInstance.Create("File", "foo goo" + Path.DirectorySeparatorChar + "file.txt"));
2745Path.Combine(s_rootPathPrefix, "foo goo") + "`, `$(File)`))",
2748Assert.Equal(Path.Combine(s_rootPathPrefix, "foo goo", "foo goo", "file.txt"), result);
2758pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo bar", "baz.txt")));
2763Path.Combine(s_rootPathPrefix, "foo baz") + @"`, `$(File)`))",
2766Assert.Equal(Path.Combine(s_rootPathPrefix, "foo baz", "foo bar", "baz.txt"), result);
2776pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo bar", "baz.txt")));
2781Path.Combine(s_rootPathPrefix, "foo baz") + @" `, `$(File)`))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
2783Assert.Equal(Path.Combine(s_rootPathPrefix, "foo baz ", "foo bar", "baz.txt"), result);
2839pg.Set(ProjectPropertyInstance.Create("File", "foo" + Path.DirectorySeparatorChar + "file.txt"));
2847Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result);
2857pg.Set(ProjectPropertyInstance.Create("File", "foo" + Path.DirectorySeparatorChar + "file.txt"));
3450string tempFile = Path.GetFileName(FileUtilities.GetTemporaryFile());
3454string directoryStart = Path.Combine(tempPath, "one\\two\\three\\four\\five");
3485MockElementLocation mockElementLocation = new MockElementLocation(Path.Combine(ObjectModelHelpers.TempProjectDir, "one", "two", "three", "four", "five", Path.GetRandomFileName()));
3492pg.Set(ProjectPropertyInstance.Create("FileToFind", Path.GetFileName(fileToFind)));
3530string fileWithPath = Path.Combine("foo", "bar", "file.txt");
3680$"{Path.GetFullPath("one")}{Path.DirectorySeparatorChar}",
3684$"{Path.GetFullPath(Path.Combine("one", "two"))}{Path.DirectorySeparatorChar}",
3982pg.Set(ProjectPropertyInstance.Create("SomePath", Path.Combine(s_rootPathPrefix, "some", "path")));
3992Assert.Equal(Path.Combine(s_rootPathPrefix, "some", "path", "fOo.Cs"), result);
4410string path = Path.Combine("foo", "bar");
4421Assert.Equal(path + Path.DirectorySeparatorChar, result);
4426Assert.Equal(path + Path.DirectorySeparatorChar, result);
4985var expectedAlphaSquigglePath = Path.Combine("Alpha", ".squiggle");
4986var expectedBetaSquigglePath = Path.Combine("Beta", ".squiggle");
4987var expectedAlphaGammaSquigglePath = Path.Combine("Alpha", "Gamma", ".squiggle");
5032var alphaOnePath = Path.Combine("alpha", "One.cs");
5033var alphaThreePath = Path.Combine("alpha", "Three.cs");
5073var alphaBetaPath = Path.Combine("alpha", "beta");
5074var alphaDeltaPath = Path.Combine("alpha", "delta");
5257string reflectionInfoPath = Path.Combine(Directory.GetCurrentDirectory(), "PropertyFunctionsRequiringReflection");
5377File.WriteAllText(Path.Combine(correctDir.Path, "notes.txt"), "correct content");
5378File.WriteAllText(Path.Combine(wrongDir.Path, "notes.txt"), "wrong content");
5393File.WriteAllText(Path.Combine(correctDir.Path, "exists.txt"), "data");
5409string filePath = Path.Combine(correctDir.Path, "attrs.txt");
5427string filePath = Path.Combine(correctDir.Path, "time.txt");
5444string filePath = Path.Combine(correctDir.Path, "time.txt");
5461string filePath = Path.Combine(correctDir.Path, "time.txt");
5482Directory.CreateDirectory(Path.Combine(correctDir.Path, "subdir"));
5498Directory.CreateDirectory(Path.Combine(correctDir.Path, "parent", "child"));
5504Path.GetFileName(result).ShouldBe("parent");
5514string subDir = Path.Combine(correctDir.Path, "sub");
5516File.WriteAllText(Path.Combine(subDir, "a.txt"), "data");
5532Directory.CreateDirectory(Path.Combine(correctDir.Path, "parent", "child"));
5547string subDir = Path.Combine(correctDir.Path, "sub");
5564string subDir = Path.Combine(correctDir.Path, "sub");
5586File.WriteAllText(Path.Combine(correctDir.Path, "lines.txt"), "line1\nline2");
5587File.WriteAllText(Path.Combine(wrongDir.Path, "lines.txt"), "wrong");
5603File.WriteAllBytes(Path.Combine(correctDir.Path, "data.bin"), [0x42]);
5622File.Exists(Path.Combine(correctDir.Path, "output.txt")).ShouldBeTrue();
5623File.ReadAllText(Path.Combine(correctDir.Path, "output.txt")).ShouldBe("hello");
5624File.Exists(Path.Combine(wrongDir.Path, "output.txt")).ShouldBeFalse();
5635File.WriteAllText(Path.Combine(correctDir.Path, "append.txt"), "base");
5640File.ReadAllText(Path.Combine(correctDir.Path, "append.txt")).ShouldBe("base added");
5651string correctFile = Path.Combine(correctDir.Path, "todelete.txt");
5652string wrongFile = Path.Combine(wrongDir.Path, "todelete.txt");
5671string filePath = Path.Combine(correctDir.Path, "utc.txt");
5689string filePath = Path.Combine(correctDir.Path, "utc.txt");
5707string filePath = Path.Combine(correctDir.Path, "utc.txt");
5732Directory.Exists(Path.Combine(correctDir.Path, "newdir")).ShouldBeTrue();
5733Directory.Exists(Path.Combine(wrongDir.Path, "newdir")).ShouldBeFalse();
5744Directory.CreateDirectory(Path.Combine(correctDir.Path, "todel"));
5745Directory.CreateDirectory(Path.Combine(wrongDir.Path, "todel"));
5750Directory.Exists(Path.Combine(correctDir.Path, "todel")).ShouldBeFalse();
5751Directory.Exists(Path.Combine(wrongDir.Path, "todel")).ShouldBeTrue();
5764string filePath = Path.Combine(dir.Path, "abs.txt");
5780string filePath = Path.Combine(dir.Path, "abs.txt");
5795string subDir = Path.Combine(dir.Path, "subdir");
5815string absFile = Path.Combine(otherDir.Path, "abs.txt");
5832string absFile = Path.Combine(otherDir.Path, "abs.txt");
5853File.WriteAllText(Path.Combine(correctDir.Path, "source.txt"), "copy me");
5858File.Exists(Path.Combine(correctDir.Path, "dest.txt")).ShouldBeTrue();
5859File.ReadAllText(Path.Combine(correctDir.Path, "dest.txt")).ShouldBe("copy me");
5860File.Exists(Path.Combine(wrongDir.Path, "dest.txt")).ShouldBeFalse();
5871File.WriteAllText(Path.Combine(correctDir.Path, "movesrc.txt"), "move me");
5876File.Exists(Path.Combine(correctDir.Path, "movesrc.txt")).ShouldBeFalse();
5877File.Exists(Path.Combine(correctDir.Path, "movedst.txt")).ShouldBeTrue();
5878File.ReadAllText(Path.Combine(correctDir.Path, "movedst.txt")).ShouldBe("move me");
5889Directory.CreateDirectory(Path.Combine(correctDir.Path, "dirsrc"));
5894Directory.Exists(Path.Combine(correctDir.Path, "dirsrc")).ShouldBeFalse();
5895Directory.Exists(Path.Combine(correctDir.Path, "dirdst")).ShouldBeTrue();
5910string siblingDir = Path.Combine(rootDir.Path, "sibling");
5911string subDir = Path.Combine(rootDir.Path, "subdir");
5914File.WriteAllText(Path.Combine(siblingDir, "file.txt"), "traversal works");
5933string siblingDir = Path.Combine(rootDir.Path, "sibling");
5934string subDir = Path.Combine(rootDir.Path, "subdir");
5937File.WriteAllText(Path.Combine(siblingDir, "file.txt"), "backslash traversal works");
Evaluation\ImportFromMSBuildExtensionsPath_Tests.cs (40)
51extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), GetExtensionTargetsFileContent1());
56projColln.ResetToolsetsForTests(WriteConfigFileAndGetReader("MSBuildExtensionsPath", extnDir1, Path.Combine("tmp", "nonexistent")));
93string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContentWithCondition);
96CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir1, Path.Combine("tmp", "nonexistent") },
129string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1);
130string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn2.proj"),
134new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 },
159string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent);
197string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"),
199string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"),
205new[] { extnDir1, Path.Combine("tmp", "nonexistent"), extnDir2 },
247string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("circularwildcardtest", "extn.proj"),
249string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("circularwildcardtest", "extn.proj"),
251string extnDir3 = GetNewExtensionsPathAndCreateFile("extensions3", Path.Combine("circularwildcardtest", "extn3.proj"),
257string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("extensions2", "circularwildcardtest", "main.proj"), mainTargetsFileContent);
284string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent);
287CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { Path.Combine("tmp", "nonexistent"), extnDir1 },
301extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent);
306Path.Combine("tmp", "nonexistent")));
356string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1);
357string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), extnTargetsFileContent2);
360CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 },
400string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1);
401string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), extnTargetsFileContent2);
408projColln.ResetToolsetsForTests(WriteConfigFileAndGetReader("MSBuildExtensionsPath", Path.Combine("tmp", "non-existent"), extnDir1));
487extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"),
489extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("bar", "extn2.proj"),
491extnDir3 = GetNewExtensionsPathAndCreateFile("extensions3", Path.Combine("xyz", "extn3.proj"),
567extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"),
628extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"),
699extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("Microsoft", "VisualStudio", "v99", "DNX", "Microsoft.DNX.Props"),
764extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("file.props"),
805extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("file.props"), string.Empty);
838logger.AssertLogContains(@"MSB4226: The imported project """ + Path.Combine("$(UndefinedProperty)", "filenotfound.props")
890extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"),
892extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("bar", "extn2.proj"),
1000var extnDir = Path.Combine(ObjectModelHelpers.TempProjectDir, extnDirName);
1001Directory.CreateDirectory(Path.Combine(extnDir, Path.GetDirectoryName(relativeFilePath)));
1002File.WriteAllText(Path.Combine(extnDir, relativeFilePath), fileContents);
Evaluation\Preprocessor_Tests.cs (57)
94" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
102" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
109" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
138" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
146" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
153" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
182" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
190" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
197" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
226" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
234" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
244" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
274" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
308" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
319" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
326" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
386" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
429" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
441" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
451" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
487" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
499" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
509" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
516" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3
526" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
560" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
568" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
575" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
582" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3
589" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
621" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
629" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2
636" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
643" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3
650" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
681" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
707directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
711xml0.AddImport(directory + Path.DirectorySeparatorChar + "*.targets");
713xml1 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "1.targets");
717xml2 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "2.targets");
721xml3 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "3.xxxxxx");
737" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
743<Import Project=""" + Path.Combine(directoryXmlCommentFriendly, "*.targets") + @""">
745" + Path.Combine(directoryXmlCommentFriendly, "1.targets") + @"
758<Import Project=""" + Path.Combine(directoryXmlCommentFriendly, "*.targets") + @""">
760" + Path.Combine(directoryXmlCommentFriendly, "2.targets") + @"
770" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1
858string sdkPropsPath = Path.Combine(testSdkDirectory, "Sdk.props");
859string sdkTargetsPath = Path.Combine(testSdkDirectory, "Sdk.targets");
974string importedPropsPath = Path.Combine(testDirectory, "Import.props");
981string projectPath = Path.Combine(testDirectory, "TestProject.csproj");
1065string sdkPropsPath1 = Path.Combine(sdk1, "Sdk.props");
1066string sdkTargetsPath1 = Path.Combine(sdk1, "Sdk.targets");
1079string sdkPropsPath2 = Path.Combine(sdk2, "Sdk.props");
1080string sdkTargetsPath2 = Path.Combine(sdk2, "Sdk.targets");
1099string importPath = Path.GetFullPath(import.ProjectFile);
Evaluation\ProjectSdkImplicitImport_Tests.cs (13)
89_testSdkDirectory = Path.Combine(_testSdkRoot, SdkName, "Sdk");
90_sdkPropsPath = Path.Combine(_testSdkDirectory, "Sdk.props");
91_sdkTargetsPath = Path.Combine(_testSdkDirectory, "Sdk.targets");
192string testSdkDirectory = Directory.CreateDirectory(Path.Combine(_testSdkRoot, sdkName, "Sdk")).FullName;
194File.WriteAllText(Path.Combine(testSdkDirectory, "Sdk.props"), $"<Project><PropertyGroup><InitialImportProperty>{sdkName}</InitialImportProperty></PropertyGroup></Project>");
195File.WriteAllText(Path.Combine(testSdkDirectory, "Sdk.targets"), $"<Project><PropertyGroup><FinalImportProperty>{sdkName}</FinalImportProperty></PropertyGroup></Project>");
211VerifyPropertyFromImplicitImport(project, "InitialImportProperty", Path.Combine(_testSdkRoot, sdkNames.Last(), "Sdk", "Sdk.props"), sdkNames.Last());
212VerifyPropertyFromImplicitImport(project, "FinalImportProperty", Path.Combine(_testSdkRoot, sdkNames.Last(), "Sdk", "Sdk.targets"), sdkNames.Last());
359var p1Path = Path.Combine(projectFolder, "p1.proj");
360var p2Path = Path.Combine(projectFolder, "p2.proj");
548import.SdkResult.Path.ShouldBe(Path.GetDirectoryName(expectedSdkPath));
676var expectedSdkPath = Path.GetDirectoryName(_sdkPropsPath);
679expectedSdkPath.ShouldBe(Path.GetDirectoryName(_sdkTargetsPath));
Evaluation\SdkResultEvaluation_Tests.cs (37)
129string projectPath = Path.Combine(_testFolder, "project.proj");
162string projectPath = Path.Combine(_testFolder, "project.proj");
192Path.Combine(_testFolder, "Sdk"),
199new[] { Path.Combine(_testFolder, "Sdk") },
224string projectPath = Path.Combine(_testFolder, "project.proj");
234string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props");
235Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk"));
287Path.Combine(_testFolder, "Sdk1"),
288Path.Combine(_testFolder, "Sdk2")
312string projectPath = Path.Combine(_testFolder, "project.proj");
322string sdk1PropsPath = Path.Combine(_testFolder, "Sdk1", "Sdk.props");
323Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk1"));
333string sdk2PropsPath = Path.Combine(_testFolder, "Sdk2", "Sdk.props");
334Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk2"));
388new[] { Path.Combine(_testFolder, "Sdk") },
404string projectPath = Path.Combine(_testFolder, "project.proj");
414string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props");
415Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk"));
425string sdkTargetsPath = Path.Combine(_testFolder, "Sdk", "Sdk.targets");
481string projectPath = Path.Combine(_testFolder, "project.proj");
502factory.IndicateSuccess(Path.Combine(_testFolder, "Sdk"), "1.0.0", null, null, null, environmentVariablesToAdd: new Dictionary<string, string>
522string projectPath = Path.Combine(_testFolder, "project.proj");
527string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props");
528Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk"));
533string sdkTargetsPath = Path.Combine(_testFolder, "Sdk", "Sdk.targets");
556factory.IndicateSuccess(Path.Combine(_testFolder, "Sdk"), "1.0.0", null, null, null, environmentVariablesToAdd: new Dictionary<string, string>
574string projectPath = Path.Combine(_testFolder, "project.proj");
578string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props");
579Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk"));
583string sdkTargetsPath = Path.Combine(_testFolder, "Sdk", "Sdk.targets");
608return factory.IndicateSuccess(Path.Combine(_testFolder, "Sdk1"), "1.0.0", null, null, null, environmentVariablesToAdd: new Dictionary<string, string>
616return factory.IndicateSuccess(Path.Combine(_testFolder, "Sdk2"), "1.0.0", null, null, null, environmentVariablesToAdd: new Dictionary<string, string>
634string projectPath = Path.Combine(_testFolder, "project.proj");
638string sdk1PropsPath = Path.Combine(_testFolder, "Sdk1", "Sdk.props");
639Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk1"));
643string sdk2PropsPath = Path.Combine(_testFolder, "Sdk2", "Sdk.props");
644Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk2"));
FileLogger_Tests.cs (15)
335string directory = Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"));
336string log = Path.Combine(directory, "build.log");
494fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile.log");
496Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile3.log") + ";", StringComparison.OrdinalIgnoreCase));
500fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile.log");
502Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile4.log") + ";", StringComparison.OrdinalIgnoreCase));
505Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "tempura"));
507fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile.log");
509Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile1.log") + ";", StringComparison.OrdinalIgnoreCase));
514if (Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "tempura")))
516File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile1.log"));
517FileUtilities.DeleteWithoutTrailingBackslash(Path.Combine(Directory.GetCurrentDirectory(), "tempura"));
519File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile0.log"));
520File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile3.log"));
521File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile4.log"));
Graph\GetCompatiblePlatformGraph_Tests.cs (6)
354TransientTestFolder project1Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, firstProjectName), createFolder: true);
355TransientTestFolder project1SubFolder = testEnvironment.CreateFolder(Path.Combine(project1Folder.Path, firstProjectName), createFolder: true);
369TransientTestFolder project2Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, secondProjectName), createFolder: true);
370TransientTestFolder project2SubFolder = testEnvironment.CreateFolder(Path.Combine(project2Folder.Path, secondProjectName), createFolder: true);
380TransientTestFolder project3Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, thirdProjectName), createFolder: true);
381TransientTestFolder project3SubFolder = testEnvironment.CreateFolder(Path.Combine(project3Folder.Path, thirdProjectName), createFolder: true);
NetTaskHost_E2E_Tests.cs (30)
19private static string AssemblyLocation { get; } = Path.Combine(Path.GetDirectoryName(typeof(NetTaskHost_E2E_Tests).Assembly.Location) ?? AppContext.BaseDirectory);
21private static string TestAssetsRootPath { get; } = Path.Combine(AssemblyLocation, "TestAssets");
38string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj");
51var customTaskAssemblyLocation = Path.GetFullPath(Path.Combine(AssemblyLocation, "..", RunnerUtilities.LatestDotNetCoreForMSBuild, "ExampleTask.dll"));
56Path.Combine(RunnerUtilities.BootstrapRootPath, "net472", "MSBuild", "Current", "Bin", "Microsoft.Build.dll"),
67var coreDirectory = Path.Combine(RunnerUtilities.BootstrapRootPath, "core");
70string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj");
81testTaskOutput.ShouldNotContain("Process path: " + Path.Combine(env.GetEnvironmentVariable("DOTNET_ROOT") ?? "", "dotnet.exe"));
95string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj");
111string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj");
171string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestMSBuildTaskInNet", "TestMSBuildTaskInNet.csproj");
191var coreDirectory = Path.Combine(RunnerUtilities.BootstrapRootPath, "core");
194string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskCallback", "TestNetTaskCallback.csproj");
214var coreDirectory = Path.Combine(RunnerUtilities.BootstrapRootPath, "core");
217string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskResourceCallback", "TestNetTaskResourceCallback.csproj");
236var coreDirectory = Path.Combine(RunnerUtilities.BootstrapRootPath, "core");
239string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskBuildCallback", "TestNetTaskBuildCallback.csproj");
259string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj");
286var coreDirectory = Path.Combine(RunnerUtilities.BootstrapRootPath, "core");
287env.SetEnvironmentVariable("PATH", $"{coreDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
290string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj");
307var coreDirectory = Path.Combine(RunnerUtilities.BootstrapRootPath, "core");
310string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskHostReuse", "TestNetTaskHostReuse.csproj");
354string symlinkPath = Path.Combine(Path.GetTempPath(), $"msbuild_symlink_test_{Guid.NewGuid():N}");
363string apphostPath = Path.Combine(symlinkPath, "sdk", RunnerUtilities.BootstrapSdkVersion, Constants.MSBuildExecutableName);
373string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj");
383[Constants.DotnetHostPathEnvVarName] = Path.Combine(realSdkPath, "dotnet"),
Resources_Tests.cs (7)
53Path.Combine(GetRepoRoot(), "src", "Build"),
66Path.Combine(GetRepoRoot(), "src", "Tasks"),
79Path.Combine(GetRepoRoot(), "src", "Utilities"),
92Path.Combine(GetRepoRoot(), "src", "MSBuild"),
122var fullPath = Path.Combine(sourceDirectory, resxPath);
129var fullPath = Path.Combine(sourceDirectory, resxPath);
245while (currentDir != null && !File.Exists(Path.Combine(currentDir, "MSBuild.slnx")))
TypeLoader_Tests.cs (18)
21private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "PortableTask");
24private static string PortableTaskFolderPath = Path.GetFullPath(
25Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "..", "..", "..", "Samples", "PortableTask"));
67string projectFilePath = Path.Combine(dir.Path, ProjectFileName);
75string dllPath = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, dllName);
84string projectFilePath = Path.Combine(dir.Path, ProjectFileName);
90string dllPath = Path.Combine(dir.Path, DLLFileName);
104string newAssemblyLocation = Path.Combine(folder.Path, Path.GetFileName(currentAssembly));
107string portableTaskPath = Path.Combine(Directory.GetDirectories(PortableTaskFolderPath).First(), "netstandard2.0", "OldMSBuild");
108string utilities = Path.Combine(portableTaskPath, utilitiesName);
109File.Copy(utilities, Path.Combine(folder.Path, utilitiesName));
123string projectFilePath = Path.Combine(dir.Path, ProjectFileName);
124string originalDLLPath = Path.Combine(dir.Path, DLLFileName);
148string projectFilePath = Path.Combine(dir.Path, ProjectFileName);
149string originalDLLPath = Path.Combine(dir.Path, DLLFileName);
174var newDllPath = Path.Combine(temporaryDirectory, DLLFileName);
201var tempDirectoryPath = Path.GetDirectoryName(newDllPath);
Microsoft.Build.Framework (144)
FileUtilities.cs (38)
25using NewPath = System.IO.Path;
26using Path = System.IO.Path;
87string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}");
139internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString();
152cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id));
178return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar);
199return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == WindowsDirectorySeparator ? path : path.Replace(WindowsDirectorySeparator, UnixDirectorySeparator);
213fileSpec += Path.DirectorySeparatorChar;
340return new AbsolutePath(FixFilePath(NewPath.GetFullPath(path.Value)),
387if (NewPath.IsPathFullyQualified(path))
397return new AbsolutePath(NewPath.GetFullPath(path, workingDir!));
452string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt");
503path.Substring(start) + Path.DirectorySeparatorChar);
591while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar)
675return NormalizePath(Path.Combine(directory, file));
680return NormalizePath(Path.Combine(paths));
705return Path.GetFullPath(path);
894return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString())))
905string? directory = Path.GetDirectoryName(FixFilePath(fileSpec));
917directory += Path.DirectorySeparatorChar;
962if (allowedExtensions != null && Path.HasExtension(fileName))
994string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec));
1008fullPath += Path.DirectorySeparatorChar;
1072var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath));
1392while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar)
1423sb.Append("..").Append(Path.DirectorySeparatorChar);
1427sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar);
1430if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar)
1467return Path.IsPathRooted(FixFilePath(path));
1513return paths.Aggregate(root, Path.Combine);
1541var separator = Path.DirectorySeparatorChar;
1686string possibleFileDirectory = Path.Combine(lookInDirectory, fileName);
1700lookInDirectory = Path.GetDirectoryName(lookInDirectory);
1720if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Utilities\FrameworkLocationHelper.cs (31)
445? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11)
455? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20)
465? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30)
475? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35)
485? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40)
495? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45)
505? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11)
515? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20)
592Path.DirectorySeparatorChar.ToString(),
596Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin");
601s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar;
641s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools");
836var frameworkPath = Path.Combine(NativeMethods.FrameworkBasePath, prefix ?? string.Empty);
846return Path.Combine(complusInstallRoot, complusVersion);
851string leaf = Path.GetFileName(currentRuntimePath);
859string baseLocation = Path.GetDirectoryName(currentRuntimePath);
979combinedPath = Path.GetFullPath(combinedPath);
987? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework")
988: Path.Combine(NativeMethods.FrameworkBasePath, "xbuild-frameworks");
990return Path.GetFullPath(combinedPath);
1038string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString());
1041path = Path.Combine(path, "Profile", frameworkName.Profile);
1044return Path.GetFullPath(path);
1066var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)
1068Path.AltDirectorySeparatorChar.ToString(),
1087fixedPath += Path.DirectorySeparatorChar;
1145string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix);
1441Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName),
1453(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, Constants.MSBuildExecutableName)) &&
1454!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll"))))
1486frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
Microsoft.Build.Framework.UnitTests (127)
FileClassifier_Tests.cs (15)
32classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}");
33classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test2")}");
35classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue();
36classifier.IsNonModifiable(Path.Combine(volume, "Test2", "File.ext")).ShouldBeTrue();
37classifier.IsNonModifiable(Path.Combine(volume, "Test3", "File.ext")).ShouldBeFalse();
49classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}");
50classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test2")}");
53classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue();
54classifier.IsNonModifiable(Path.Combine(volume, "Test2", "File.ext")).ShouldBeTrue();
55classifier.IsNonModifiable(Path.Combine(volume, "Test3", "File.ext")).ShouldBeFalse();
64classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}");
68classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue();
69classifier.IsNonModifiable(Path.Combine(volume, "test1", "File.ext")).ShouldBeFalse();
73classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue();
74classifier.IsNonModifiable(Path.Combine(volume, "test1", "File.ext")).ShouldBeTrue();
FileMatcher_Tests.cs (57)
64File.WriteAllBytes(Path.Combine(testFolder.Path, file), new byte[1]);
78TransientTestFolder tf2 = _env.CreateFolder(Path.Combine(testFolder.Path, "subfolder"));
79string symlinkPath = Path.Combine(tf2.Path, "mySymlink");
103foreach (string fullPath in GetFilesComplexGlobbingMatchingInfo.FilesToCreate.Select(i => Path.Combine(testFolder.Path, i.ToPlatformSlash())))
105Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
125.Select(i => i.Replace(Path.DirectorySeparatorChar, '\\'))
617return new string[] { Path.Combine(path, "LongDirectoryName") };
624return new string[] { Path.Combine(path, "LongSubDirectory") };
631return new string[] { Path.Combine(path, "LongFileName.txt") };
638return new string[] { Path.Combine(path, "pomegranate") };
655private static readonly char S = Path.DirectorySeparatorChar;
786"Source" + Path.DirectorySeparatorChar + "**",
789"Source" + Path.DirectorySeparatorChar + "Bart.txt",
790"Source" + Path.DirectorySeparatorChar + "Sub" + Path.DirectorySeparatorChar + "Homer.txt",
794"Destination" + Path.DirectorySeparatorChar + "Bart.txt",
795"Destination" + Path.DirectorySeparatorChar + "Sub" + Path.DirectorySeparatorChar + "Homer.txt",
994ValidateFileMatch(Path.Combine(".", "File.txt"), Path.Combine(".", "File.txt"), false);
995ValidateNoFileMatch(Path.Combine(".", "File.txt"), Path.Combine(".", "File.bin"), false);
1001ValidateFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine("..", "..", "File.txt"), false);
1005ValidateFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine("..", "..", "File"), false);
1007ValidateNoFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine(new[] { "..", "..", "dir1", "dir2", "File.txt" }), false);
1008ValidateNoFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine(new[] { "..", "..", "dir1", "dir2", "File" }), false);
1019ValidateFileMatch(Path.Combine("**", "*.cs"), Path.Combine("dir1", "dir2", "file.cs"), true);
1020ValidateFileMatch(Path.Combine("**", "*.cs"), "file.cs", true);
1249string workingPathSubfolder = Path.Combine(workingPath, "SubDir");
1250string offendingPattern = Path.Combine(workingPath, @"*\..\bar");
1263string fileName = Path.Combine(workingPath, "MyFile.txt");
1264string offendingPattern = Path.Combine(workingPath, @"**\**");
1280string workingPathSubdir = Path.Combine(workingPath, "subdir");
1281string workingPathSubdirBing = Path.Combine(workingPathSubdir, "bing");
1283string offendingPattern = Path.Combine(workingPath, @"**\sub*\*.");
2093candidateDirectoryName = Path.GetDirectoryName(normalizedCandidate);
2135if (normalizedCandidate == Path.Combine(path, pattern))
2177string baseMatch = Path.GetFileName(normalizedCandidate.Substring(0, nextSlash));
2250string normalized = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
2251if (Path.DirectorySeparatorChar != '\\')
2253normalized = path.Replace("\\", Path.DirectorySeparatorChar.ToString());
2262normalized = normalized.Replace(@".." + Path.DirectorySeparatorChar, "<:PARENT:>");
2265string doubleSeparator = Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString();
2266normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString());
2267normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString());
2268normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString());
2271normalized = normalized.Replace(@"." + Path.DirectorySeparatorChar, "");
2275normalized = normalized.Replace("<:PARENT:>", @".." + Path.DirectorySeparatorChar);
2292if (path.Length == 0 && !Path.IsPathRooted(candidate))
2485return new string[] { Path.Combine(path, pattern) };
FileUtilities_Tests.cs (33)
45Assert.Equal(@"foo" + Path.DirectorySeparatorChar, modifier);
49Assert.Equal(@"foo" + Path.DirectorySeparatorChar, modifier);
419Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath)));
433Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath)));
536Assert.True(FileUtilities.FileOrDirectoryExistsNoThrow(Path.GetTempPath()));
780Assert.StartsWith(Path.GetTempPath(), path);
802Assert.StartsWith(Path.GetTempPath(), path);
817string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "subfolder");
848Assert.StartsWith(Path.GetTempPath(), path);
887var secondSlash = SystemSpecificAbsolutePath.Substring(1).IndexOf(Path.DirectorySeparatorChar) + 1;
911string firstDirectory = Path.GetDirectoryName(Path.GetDirectoryName(filePath));
912string tmpDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath)));
942string firstDirectory = Path.GetDirectoryName(Path.GetDirectoryName(filePath));
943string tmpDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath)));
971string projectDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath)));
972string unrelatedDirectory = Path.GetTempPath();
998string path = Path.Combine(root, "1", "2", "3", "4", "5");
1000Assert.Equal(Path.Combine(root, "1", "2", "3", "4", "5"), FileUtilities.GetFolderAbove(path, 0));
1001Assert.Equal(Path.Combine(root, "1", "2", "3", "4"), FileUtilities.GetFolderAbove(path));
1002Assert.Equal(Path.Combine(root, "1", "2", "3"), FileUtilities.GetFolderAbove(path, 2));
1003Assert.Equal(Path.Combine(root, "1", "2"), FileUtilities.GetFolderAbove(path, 3));
1004Assert.Equal(Path.Combine(root, "1"), FileUtilities.GetFolderAbove(path, 4));
1018Path.Combine(root, "path1"),
1022Path.Combine(root, "path1", "path2", "file.txt"),
1064expectedTruncatedPath = expectedTruncatedPath.Replace('/', Path.DirectorySeparatorChar);
Microsoft.Build.Tasks.CodeAnalysis (33)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (33)
Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests (10)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (106)
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"),
ManagedCompilerGlobalCacheTests.cs (18)
39var expectedPath = Path.Combine(Path.GetTempPath(), $"{(visualBasic ? "vb" : "cs")}-cache-path");
60var expectedPath = Path.Combine(Path.GetTempPath(), $"{(visualBasic ? "vb" : "cs")} cache path");
83var path = Path.Combine(Path.GetTempPath(), $"{(visualBasic ? "vb" : "cs")} cache path");
107var expectedPath = Path.Combine(Path.GetTempPath(), "custom-cache-path");
120var explicitPath = Path.Combine(Path.GetTempPath(), "explicit-cache-path");
123Path.Combine(Path.GetTempPath(), "environment-cache-path"),
134var expectedPath = Path.Combine(Path.GetTempPath(), $"{(visualBasic ? "vb" : "cs")}-cache-path");
149var expectedPath = Path.Combine(Path.GetTempPath(), $"{(visualBasic ? "vb" : "cs")}-cache-path");
163var expectedPath = Path.Combine(Path.GetTempPath(), $"{(visualBasic ? "vb" : "cs")}-cache-path");
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)}"" />
154DotNetPath = Path.Combine(DotNetInstallDir, DotNetExeName);
155var testBinDirectory = Path.GetDirectoryName(typeof(DotNetSdkTests).Assembly.Location) ?? string.Empty;
156var sdksDir = Path.Combine(DotNetSdkPath ?? string.Empty, "Sdks");
177var csharpCoreTargets = Path.Combine(testBinDirectory, "Microsoft.CSharp.Core.targets");
178var visualBasicCoreTargets = Path.Combine(testBinDirectory, "Microsoft.VisualBasic.Core.targets");
199Assert.True(File.Exists(Path.Combine(ObjDir.Path, "project.assets.json")));
200Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.props")));
201Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.targets")));
210var workingDirectory = Path.GetDirectoryName(projectFilePath)!;
213var projectFileName = Path.GetFileName(projectFilePath);
224var evaluationResultsFile = Path.Combine(OutDir.Path, "EvaluationResult.txt");
230var testBinDirectory = Path.GetDirectoryName(typeof(DotNetSdkTests).Assembly.Location);
Microsoft.Build.Tasks.Core (323)
AssemblyDependency\ReferenceTable.cs (17)
469if (!Path.IsPathRooted(assemblyFileName))
471reference.FullPath = Path.GetFullPath(assemblyFileName);
519string simpleName = Path.GetFileNameWithoutExtension(assemblyFileName);
756pathRooted = Path.IsPathRooted(finalName);
894Path.GetExtension(itemSpec));
954if (!String.IsNullOrEmpty(implementationFile) && Path.GetExtension(implementationFile) == ".dll")
956companionFile = Path.Combine(Path.GetDirectoryName(baseName), implementationFile);
993string cultureName = Path.GetFileName(subDirectory);
999string satelliteAssembly = Path.Combine(subDirectory, satelliteFilename);
1003reference.AddSatelliteFile(Path.Combine(cultureName, satelliteFilename));
1022string serializationAssemblyPath = Path.Combine(reference.DirectoryName, serializationAssemblyFilename);
2753AddRelatedItem(serializationAssemblyItems, relatedItemBase, Path.Combine(reference.DirectoryName, serializationAssemblyFile));
2759AddRelatedItem(scatterItems, relatedItemBase, Path.Combine(reference.DirectoryName, scatterFile));
2771relatedItemBase.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile)));
2772AddRelatedItem(satelliteItems, relatedItemBase, Path.Combine(reference.DirectoryName, satelliteFile));
2838yield return new KeyValuePair<string, string>(ItemMetadataNames.winmdImplmentationFile, Path.GetFileName(reference.ImplementationAssembly));
BootstrapperUtil\BootstrapperBuilder.cs (27)
174string strOutputExe = System.IO.Path.Combine(settings.OutputPath, SETUP_EXE);
361string setupSourceFile = System.IO.Path.Combine(bootstrapperPath, SETUP_BIN);
430invariantPath = Util.AddTrailingChar(invariantPath, System.IO.Path.DirectorySeparatorChar);
453packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar)));
457string folder = System.IO.Path.GetDirectoryName(file);
503private string BootstrapperPath => System.IO.Path.Combine(Path, ENGINE_PATH);
505private string PackagePath => System.IO.Path.Combine(Path, PACKAGE_PATH);
507private string SchemaPath => System.IO.Path.Combine(Path, SCHEMA_PATH);
528string startDirectory = System.IO.Path.Combine(BootstrapperPath, RESOURCES_PATH);
535string resourceDirectory = System.IO.Path.Combine(startDirectory, subDirectory);
536string resourceFilePath = System.IO.Path.Combine(resourceDirectory, SETUP_RESOURCES_FILE);
606if (strSubDirectory[nStartIndex] == System.IO.Path.DirectorySeparatorChar)
880string strSubDirectoryFullPath = System.IO.Path.Combine(packagePath, strSubDirectory);
883string strBaseManifestFilename = System.IO.Path.Combine(strSubDirectoryFullPath, ROOT_MANIFEST_FILE);
884string strBaseManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA);
922UpdatePackageFileNodes(packageFilesNode, System.IO.Path.Combine(packagePath, strSubDirectory), strSubDirectory);
935string strLangManifestFilename = System.IO.Path.Combine(strLanguageDirectory, CHILD_MANIFEST_FILE);
936string strLangManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA);
967System.IO.Path.DirectorySeparatorChar)
1172string strSourceFile = System.IO.Path.Combine(strSourcePath, relativePath);
1176targetPathAttribute.Value = System.IO.Path.Combine(strTargetPath, relativePath);
1179string newNameValue = System.IO.Path.Combine(strTargetPath, relativePath);
1468string strDestinationFileName = System.IO.Path.Combine(settings.OutputPath, packageFileDestination.Value);
1477EnsureFolderExists(System.IO.Path.GetDirectoryName(strDestinationFileName));
2001using (var xmlwriter = new XmlTextWriter(System.IO.Path.Combine(s_logPath, fileName), Encoding.UTF8))
2043using (var fileWriter = new StreamWriter(System.IO.Path.Combine(s_logPath, fileName), append))
2204string logPath = System.IO.Path.Combine(
GenerateResource.cs (24)
570commandLineBuilder.AppendFileNameIfNotNull(Path.Combine(_resgenPath, "resgen.exe"));
961internetSecurityManager.MapUrlToZone(Path.GetFullPath(filename), out zone, 0);
970string extension = Path.GetExtension(filename);
1102_resgenPath = Path.GetDirectoryName(_resgenPath);
1155if (!_resgenPath.Equals(Path.GetDirectoryName(NativeMethodsShared.GetLongFilePath(ToolLocationHelper.GetPathToDotNetFrameworkSdkFile("resgen.exe", TargetDotNetFrameworkVersion.Version35))), StringComparison.OrdinalIgnoreCase))
1522string extension = Path.GetExtension(sourceFilePath);
1750string extension = Path.GetExtension(source.ItemSpec);
2063OutputResources[i] = new TaskItem(Path.ChangeExtension(Sources[i].ItemSpec, ".resources"));
2540_assemblyNames[i] = new AssemblyNameExtension(Path.GetFileNameWithoutExtension(assemblyFile.ItemSpec));
2670string priDirectory = Path.Combine(outFileOrDir ?? String.Empty,
2672currentOutputDirectory = Path.Combine(priDirectory,
2680currentOutputFile = Path.Combine(currentOutputDirectory, currentOutputFileNoPath);
2827return Path.GetFullPath(currentOutputFile);
2838currentOutputFile = Path.GetFullPath(currentOutputFile);
2848string shorterPath = Path.Combine(outputDirectory ?? String.Empty, cultureName ?? String.Empty);
2853currentOutputFile = Path.Combine(shorterPath, currentOutputFileNoPath);
2858currentOutputFile = Path.GetFullPath(currentOutputFile);
2909extension = Path.GetExtension(filename);
2939_logger.LogErrorWithCodeFromResources("GenerateResource.UnknownFileExtension", Path.GetExtension(filename), filename);
3007String fullPath = Path.GetFullPath(filename);
3008resXReader.BasePath = Path.GetDirectoryName(fullPath);
3433_stronglyTypedClassName = Path.GetFileNameWithoutExtension(outFile);
3478_logger.LogWarningWithCodeFromResources(null, Path.GetFullPath(inputFileName), 0, 0, 0, 0, messageKey, [skipped.Key, .. skipped.AdditionalMessageArgs]);
3501return Path.ChangeExtension(outputResourcesFile, provider.FileExtension);
GetSDKReferenceFiles.cs (12)
512string directory = Path.GetDirectoryName(reference.AssemblyLocation);
513string fileNameNoExtension = Path.GetFileNameWithoutExtension(reference.AssemblyLocation);
514string xmlFile = Path.Combine(directory, fileNameNoExtension + ".xml");
553if (Path.GetExtension(file.RedistFile).Equals(".PRI", StringComparison.OrdinalIgnoreCase))
578string fileExtension = Path.GetExtension(file);
630string targetPath = Path.Combine(targetPathRoot, relativeToBase);
731FileName = Path.GetFileNameWithoutExtension(assemblyLocation);
960referencesCacheFile = Path.Combine(_cacheFileDirectory, GetCacheFileName(saveContext.SdkIdentity, saveContext.SdkRoot, cacheFileInfo.Hash.ToString("X", CultureInfo.InvariantCulture)));
1030group reference by Path.GetDirectoryName(reference);
1085string referencesCacheFile = Path.Combine(cacheFileFolder, GetCacheFileName(sdkIdentity, sdkRoot, hash.ToString("X", CultureInfo.InvariantCulture)));
1165string redistPath = Path.Combine(sdkRoot, "Redist");
1179string referencesPath = Path.Combine(sdkRoot, "References");
InstalledSDKResolver.cs (4)
60string referenceAssemblyFilePath = Path.Combine(sdkDirectory, "References", configuration, architecture);
61string referenceAssemblyCommonArchFilePath = Path.Combine(sdkDirectory, "References", "CommonConfiguration", architecture);
62string referenceAssemblyPathNeutral = Path.Combine(sdkDirectory, "References", configuration, "Neutral");
63string referenceAssemblyArchFilePathNeutral = Path.Combine(sdkDirectory, "References", "CommonConfiguration", "Neutral");
Microsoft.Build.Tasks.UnitTests (1282)
AddToWin32Manifest_Tests.cs (8)
23private static string TestAssetsRootPath { get; } = Path.Combine(
24Path.GetDirectoryName(typeof(AddToWin32Manifest_Tests).Assembly.Location) ?? AppContext.BaseDirectory,
52task.ApplicationManifest = new TaskItem(Path.Combine(TestAssetsRootPath, manifestName));
62string expectedManifest = Path.Combine(TestAssetsRootPath, $"{manifestName ?? "default.win32manifest"}_expected");
119File.Copy(Path.Combine(TestAssetsRootPath, manifestName), Path.Combine(projectFolder.Path, manifestName));
128byte[]? actualManifestBytes = AssemblyNativeResourceManager.GetResourceFromExecutable(Path.Combine(outputPath, "test.dll"), "#2", "#24");
133string expectedManifest = Path.Combine(TestAssetsRootPath, $"{manifestName ?? "default.win32manifest"}_expected");
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (228)
188protected static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString();
189protected static readonly string s_myProjectPath = Path.Combine(s_rootPathPrefix, "MyProject");
191protected static readonly string s_myVersion20Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v2.0.MyVersion");
192protected static readonly string s_myVersion40Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v4.0.MyVersion");
193protected static readonly string s_myVersion90Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v9.0.MyVersion");
197protected static readonly string s_myMissingAssemblyAbsPath = Path.Combine(s_rootPathPrefix, "MyProject", "MyMissingAssembly.dll");
198protected static readonly string s_myMissingAssemblyRelPath = Path.Combine("MyProject", "MyMissingAssembly.dll");
199protected static readonly string s_myPrivateAssemblyRelPath = Path.Combine("MyProject", "MyPrivateAssembly.exe");
201protected static readonly string s_frameworksPath = Path.Combine(s_rootPathPrefix, "Frameworks");
203protected static readonly string s_myComponents2RootPath = Path.Combine(s_rootPathPrefix, "MyComponents2");
204protected static readonly string s_myComponentsRootPath = Path.Combine(s_rootPathPrefix, "MyComponents");
205protected static readonly string s_myComponents10Path = Path.Combine(s_myComponentsRootPath, "1.0");
206protected static readonly string s_myComponents20Path = Path.Combine(s_myComponentsRootPath, "2.0");
207protected static readonly string s_myComponentsMiscPath = Path.Combine(s_myComponentsRootPath, "misc");
209protected static readonly string s_myComponentsV05Path = Path.Combine(s_myComponentsRootPath, "v0.5");
210protected static readonly string s_myComponentsV10Path = Path.Combine(s_myComponentsRootPath, "v1.0");
211protected static readonly string s_myComponentsV20Path = Path.Combine(s_myComponentsRootPath, "v2.0");
212protected static readonly string s_myComponentsV30Path = Path.Combine(s_myComponentsRootPath, "v3.0");
214protected static readonly string s_unifyMeDll_V05Path = Path.Combine(s_myComponentsV05Path, "UnifyMe.dll");
215protected static readonly string s_unifyMeDll_V10Path = Path.Combine(s_myComponentsV10Path, "UnifyMe.dll");
216protected static readonly string s_unifyMeDll_V20Path = Path.Combine(s_myComponentsV20Path, "UnifyMe.dll");
217protected static readonly string s_unifyMeDll_V30Path = Path.Combine(s_myComponentsV30Path, "UnifyMe.dll");
219protected static readonly string s_myComponents40ComponentPath = Path.Combine(s_myComponentsRootPath, "4.0Component");
220protected static readonly string s_40ComponentDependsOnOnlyv4AssembliesDllPath = Path.Combine(s_myComponents40ComponentPath, "DependsOnOnlyv4Assemblies.dll");
222protected static readonly string s_myLibrariesRootPath = Path.Combine(s_rootPathPrefix, "MyLibraries");
223protected static readonly string s_myLibraries_V1Path = Path.Combine(s_myLibrariesRootPath, "v1");
224protected static readonly string s_myLibraries_V2Path = Path.Combine(s_myLibrariesRootPath, "v2");
225protected static readonly string s_myLibraries_V1_EPath = Path.Combine(s_myLibraries_V1Path, "E");
227protected static readonly string s_myLibraries_ADllPath = Path.Combine(s_myLibrariesRootPath, "A.dll");
228protected static readonly string s_myLibraries_BDllPath = Path.Combine(s_myLibrariesRootPath, "B.dll");
229protected static readonly string s_myLibraries_CDllPath = Path.Combine(s_myLibrariesRootPath, "C.dll");
230protected static readonly string s_myLibraries_TDllPath = Path.Combine(s_myLibrariesRootPath, "T.dll");
232protected static readonly string s_myLibraries_V1_DDllPath = Path.Combine(s_myLibraries_V1Path, "D.dll");
233protected static readonly string s_myLibraries_V1_E_EDllPath = Path.Combine(s_myLibraries_V1_EPath, "E.dll");
234protected static readonly string s_myLibraries_V2_DDllPath = Path.Combine(s_myLibraries_V2Path, "D.dll");
235protected static readonly string s_myLibraries_V1_GDllPath = Path.Combine(s_myLibraries_V1Path, "G.dll");
236protected static readonly string s_myLibraries_V2_GDllPath = Path.Combine(s_myLibraries_V2Path, "G.dll");
238protected static readonly string s_regress454863_ADllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "A.dll");
239protected static readonly string s_regress454863_BDllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "B.dll");
241protected static readonly string s_regress444809RootPath = Path.Combine(s_rootPathPrefix, "Regress444809");
242protected static readonly string s_regress444809_ADllPath = Path.Combine(s_regress444809RootPath, "A.dll");
243protected static readonly string s_regress444809_BDllPath = Path.Combine(s_regress444809RootPath, "B.dll");
244protected static readonly string s_regress444809_CDllPath = Path.Combine(s_regress444809RootPath, "C.dll");
245protected static readonly string s_regress444809_DDllPath = Path.Combine(s_regress444809RootPath, "D.dll");
247protected static readonly string s_regress444809_V2RootPath = Path.Combine(s_regress444809RootPath, "v2");
248protected static readonly string s_regress444809_V2_ADllPath = Path.Combine(s_regress444809_V2RootPath, "A.dll");
250protected static readonly string s_regress442570_RootPath = Path.Combine(s_rootPathPrefix, "Regress442570");
251protected static readonly string s_regress442570_ADllPath = Path.Combine(s_regress442570_RootPath, "A.dll");
252protected static readonly string s_regress442570_BDllPath = Path.Combine(s_regress442570_RootPath, "B.dll");
254protected static readonly string s_myAppRootPath = Path.Combine(s_rootPathPrefix, "MyApp");
255protected static readonly string s_myApp_V05Path = Path.Combine(s_myAppRootPath, "v0.5");
256protected static readonly string s_myApp_V10Path = Path.Combine(s_myAppRootPath, "v1.0");
257protected static readonly string s_myApp_V20Path = Path.Combine(s_myAppRootPath, "v2.0");
258protected static readonly string s_myApp_V30Path = Path.Combine(s_myAppRootPath, "v3.0");
260protected static readonly string s_netstandardLibraryDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandardlibrary.dll");
261protected static readonly string s_netstandardDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandard.dll");
263protected static readonly string s_portableDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "Portable.dll");
264protected static readonly string s_systemRuntimeDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "System.Runtime.dll");
266protected static readonly string s_dependsOnNuGet_ADllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "A.dll");
267protected static readonly string s_dependsOnNuGet_NDllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.dll");
268protected static readonly string s_dependsOnNuGet_NExePath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.exe");
269protected static readonly string s_dependsOnNuGet_NWinMdPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.winmd");
271protected static readonly string s_nugetCache_N_Lib_NDllPath = Path.Combine(s_rootPathPrefix, "NugetCache", "N", "lib", "N.dll");
273protected static readonly string s_assemblyFolder_RootPath = Path.Combine(s_rootPathPrefix, "AssemblyFolder");
274protected static readonly string s_assemblyFolder_SomeAssemblyDllPath = Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.dll");
375Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"),
376Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"),
377Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"),
378Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"),
379Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"),
380Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"),
381Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"),
382Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"),
383Path.Combine(s_myVersion20Path, "System.Data.dll"),
384Path.Combine(s_myVersion20Path, "System.Xml.dll"),
385Path.Combine(s_myVersion20Path, "System.Xml.pdb"),
386Path.Combine(s_myVersion20Path, "System.Xml.xml"),
387Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.dll"),
388Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.pdb"),
389Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.config"),
390Path.Combine(s_myVersion20Path, "xx", "System.Xml.resources.dll"),
391Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.dll"),
392Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.pdb"),
393Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.config"),
394Path.Combine(s_rootPathPrefix, s_myPrivateAssemblyRelPath),
395Path.Combine(s_myProjectPath, "MyCopyLocalAssembly.dll"),
396Path.Combine(s_myProjectPath, "MyDontCopyLocalAssembly.dll"),
397Path.Combine(s_myVersion20Path, "BadImage.dll"), // An assembly that will give a BadImageFormatException from GetAssemblyName
398Path.Combine(s_myVersion20Path, "BadImage.pdb"),
399Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"),
400Path.Combine(s_myVersion20Path, "MyGacAssembly.pdb"),
401Path.Combine(s_myVersion20Path, "xx", "MyGacAssembly.resources.dll"),
402Path.Combine(s_myVersion20Path, "System.dll"),
403Path.Combine(s_myVersion40Path, "System.dll"),
404Path.Combine(s_myVersion90Path, "System.dll"),
405Path.Combine(s_myVersion20Path, "mscorlib.dll"),
406Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"),
408Path.Combine(s_myProjectPath, "mscorlib.dll"), // This is an mscorlib.dll that has no metadata (i.e. GetAssemblyName returns null)
409Path.Combine(s_myProjectPath, "System.Data.dll"), // This is a System.Data.dll that has the wrong pkt, it shouldn't be matched.
410Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), // A vendor component that we should find in the registry.
428Path.Combine(s_myComponentsV30Path, "MyControlWithFutureTargetNDPVersion.dll"), // The future version of a component.
429Path.Combine(s_myComponentsV20Path, "MyControlWithFutureTargetNDPVersion.dll"), // The current version of a component.
430Path.Combine(s_myComponentsV10Path, "MyNDP1Control.dll"), // A control that only has an NDP 1.0 version
431Path.Combine(s_myComponentsV20Path, "MyControlWithPastTargetNDPVersion.dll"), // The current version of a component.
432Path.Combine(s_myComponentsV10Path, "MyControlWithPastTargetNDPVersion.dll"), // The past version of a component.
436Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), // A devices mscorlib.
453Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"),
501Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pdb"),
502Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.xml"),
503Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pri"),
504Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.licenses"),
505Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.config"),
514Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"),
515Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"),
516Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"),
517Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"),
518Path.Combine(s_myAppRootPath, "DependsOnWeaklyNamedUnified.dll"),
519Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"),
525Path.Combine(s_myComponentsMiscPath, "DependsOnOnlyv4Assemblies.dll"), // Only depends on 4.0.0 assemblies
526Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), // Is in redist list and is a 9.0 assembly
527Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), // Depends on 9.0 assemblies
528Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), // Depends on 9.0 assemblies
529Path.Combine(s_myComponents10Path, "DependsOn9.dll"), // Depends on 9.0 assemblies
530Path.Combine(s_myComponents20Path, "DependsOn9.dll"), // Depends on 9.0 assemblies
548Path.Combine(s_myComponentsRootPath, "V.dll"),
549Path.Combine(s_myComponents2RootPath, "W.dll"),
550Path.Combine(s_myComponentsRootPath, "X.dll"),
551Path.Combine(s_myComponentsRootPath, "X.pdb"),
552Path.Combine(s_myComponentsRootPath, "Y.dll"),
553Path.Combine(s_myComponentsRootPath, "Z.dll"),
555Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"),
556Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"),
651string baseDir = Path.GetDirectoryName(file);
655string fileExtension = Path.GetExtension(file);
761else if (fullPath.StartsWith(@"C:\DirectoryContains", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase))
765else if (fullPath.StartsWith(@"C:\WinMDArchVerification", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase))
857if (!Path.IsPathRooted(path))
859path = Path.GetFullPath(path);
886Path.GetTempPath()
912Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx")
921Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx")
1051if (!Path.IsPathRooted(path))
1053path = Path.GetFullPath(path);
1075String.Equals(path, Path.Combine(s_myVersion20Path, "BadImage.dll"), StringComparison.OrdinalIgnoreCase))
1077throw new System.BadImageFormatException(@"The format of the file '" + Path.Combine(s_myVersion20Path, "BadImage.dll") + "' is invalid");
1082String.Equals(path, Path.Combine(s_myProjectPath, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)
1083|| String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)
1084|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase))
1092String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)
1093|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase))
1104if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase))
1109if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase))
1114if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase))
1202if (String.Equals(path, Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"), StringComparison.OrdinalIgnoreCase))
1207if (String.Equals(path, Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"), StringComparison.OrdinalIgnoreCase))
1212if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.XML.dll"), StringComparison.OrdinalIgnoreCase))
1219if (String.Equals(path, Path.Combine(s_myProjectPath, "System.Xml.dll"), StringComparison.OrdinalIgnoreCase))
1226if (String.Equals(path, Path.Combine(s_myProjectPath, "System.Data.dll"), StringComparison.OrdinalIgnoreCase))
1232if (path.EndsWith(Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"), StringComparison.Ordinal))
1238if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
1244if (String.Equals(path, Path.Combine(s_myVersion40Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
1250if (String.Equals(path, Path.Combine(s_myVersion90Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
1258String.Equals(path, Path.Combine(s_myVersion20Path, "System.Data.dll"), StringComparison.OrdinalIgnoreCase))
1299if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), StringComparison.OrdinalIgnoreCase))
1304if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
1319if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
1324if (String.Equals(path, Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
1329if (String.Equals(path, Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
1380if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), StringComparison.OrdinalIgnoreCase))
1386if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase))
1392if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), StringComparison.OrdinalIgnoreCase))
1397if (String.Equals(path, Path.Combine(s_myComponents10Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase))
1402if (String.Equals(path, Path.Combine(s_myComponents20Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase))
1437if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.pdb"), StringComparison.OrdinalIgnoreCase))
1485if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "V.dll"), StringComparison.OrdinalIgnoreCase))
1489if (String.Equals(path, Path.Combine(s_myComponents2RootPath, "W.dll"), StringComparison.OrdinalIgnoreCase))
1493if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.dll"), StringComparison.OrdinalIgnoreCase))
1498if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Z.dll"), StringComparison.OrdinalIgnoreCase))
1503if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Y.dll"), StringComparison.OrdinalIgnoreCase))
1508if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), StringComparison.OrdinalIgnoreCase))
1513if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), StringComparison.OrdinalIgnoreCase))
1780string defaultName = String.Format("{0}, Version=0.0.0.0, PublicKeyToken=null, Culture=Neutral", Path.GetFileNameWithoutExtension(path));
1822if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase))
1826else if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase))
1830else if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase))
1834else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase))
1838else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase))
1842else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase))
1857if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase))
1865if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase))
1873if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase))
1995if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
2091String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)
2092|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase))
2102if (String.Equals(path, Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"), StringComparison.OrdinalIgnoreCase))
2150if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), StringComparison.OrdinalIgnoreCase))
2211if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnWeaklyNamedUnified.dll"), StringComparison.OrdinalIgnoreCase))
2219if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), StringComparison.OrdinalIgnoreCase))
2227if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
2235if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
2243if (String.Equals(path, Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
2251if (String.Equals(path, Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase))
2275if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), StringComparison.OrdinalIgnoreCase))
2285if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase))
2295if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), StringComparison.OrdinalIgnoreCase))
2303if (String.Equals(path, Path.Combine(s_myComponents10Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase))
2311if (String.Equals(path, Path.Combine(s_myComponents20Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase))
2344if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "V.dll"), StringComparison.OrdinalIgnoreCase))
2352if (String.Equals(path, Path.Combine(s_myComponents2RootPath, "W.dll"), StringComparison.OrdinalIgnoreCase))
2357if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.dll"), StringComparison.OrdinalIgnoreCase))
2365if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Z.dll"), StringComparison.OrdinalIgnoreCase))
2370if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Y.dll"), StringComparison.OrdinalIgnoreCase))
2378if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), StringComparison.OrdinalIgnoreCase))
2383if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), StringComparison.OrdinalIgnoreCase))
2391if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
2400if (String.Equals(path, Path.Combine(s_myVersion40Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
2409if (String.Equals(path, Path.Combine(s_myVersion90Path, "System.dll"), StringComparison.OrdinalIgnoreCase))
2988string tempPath = Path.GetTempPath();
2989string redistListPath = Path.Combine(tempPath, Guid.NewGuid() + ".xml");
2990string rarCacheFile = Path.Combine(tempPath, Guid.NewGuid() + ".RarCache");
AssemblyDependency\SuggestedRedirects.cs (2)
205warningMessage.ShouldContain(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.FourSpaceIndent", ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.ReferenceDependsOn", "D, Version=1.0.0.0, CulTUre=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa", Path.Combine(s_myLibraries_V1Path, "D.dll"))));
250warningMessage.ShouldContain(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.FourSpaceIndent", ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.ReferenceDependsOn", "D, Version=1.0.0.0, CulTUre=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa", Path.Combine(s_myLibraries_V1Path, "D.dll"))));
AssignLinkMetadata_Tests.cs (9)
20private readonly string _defaultItemSpec = Path.Combine(Path.GetTempPath(), "SubFolder", "a.cs");
80Assert.Equal(Path.Combine("SubFolder", "a.cs"), t.OutputItems[0].GetMetadata("Link"));
107Assert.Equal(Path.Combine("SubFolder", "a.cs"), t.OutputItems[0].GetMetadata("Link"));
116ITaskItem item = GetParentedTaskItem(_defaultItemSpec, Path.Combine("SubFolder2", "SubSubFolder", "a.cs"));
137? Path.Combine("//subfolder/a.cs")
158ITaskItem item = new TaskItem(Path.Combine("SubFolder", "a.cs"));
179FullPath = Path.Combine(Path.GetTempPath(), "a.proj")
Copy_Tests.cs (96)
226Directory.Exists(Path.Combine(destinationFolder.Path, "source0")).ShouldBeTrue();
227Directory.Exists(Path.Combine(destinationFolder.Path, "source1")).ShouldBeTrue();
1036string destinationFolder = Path.Combine(Path.GetTempPath(), "2A333ED756AF4dc392E728D0F874A398");
1037string destination1 = Path.Combine(destinationFolder, Path.GetFileName(source1));
1038string destination2 = Path.Combine(destinationFolder, Path.GetFileName(source2));
1394string sourceFile = Path.GetTempPath();
1444string destinationFile = Path.GetTempFileName();
1445string sourceFile = Path.GetTempFileName();
1616string destinationFile = Path.GetTempPath();
1663string temp = Path.GetTempPath();
1664string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A392");
1665string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A393");
1667string validOutFile = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A394");
1752string temp = Path.GetTempPath();
1753string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395");
1826string file = Path.Combine(currdir, filename);
1878string temp = Path.GetTempPath();
1879string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395");
1880string invalidFile = NativeMethodsShared.IsUnixLike ? Path.Combine(temp, "!@#$%^&*()|") : "!@#$%^&*()|";
1944string temp = Path.GetTempPath();
1945string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
1946string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
2015string sourceFileEscaped = Path.GetTempPath() + "a%253A_" + Guid.NewGuid().ToString("N") + ".txt";
2017string temp = Path.GetTempPath();
2018string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2019string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
2078string tempPath = Path.GetTempPath();
2082new TaskItem(Path.Combine(tempPath, "a.cs")),
2083new TaskItem(Path.Combine(tempPath, "b.cs")),
2084new TaskItem(Path.Combine(tempPath, "a.cs")),
2085new TaskItem(Path.Combine(tempPath, "a.cs")),
2104DestinationFolder = new TaskItem(Path.Combine(tempPath, "foo")),
2123filesActuallyCopied.Select(f => Path.GetFileName(f.Key.Path)).ShouldBe(new[] { "a.cs", "b.cs" }, ignoreOrder: true);
2136string tempPath = Path.GetTempPath();
2140new TaskItem(Path.Combine(tempPath, "a.cs")),
2141new TaskItem(Path.Combine(tempPath, "b.cs")),
2142new TaskItem(Path.Combine(tempPath, "a.cs")),
2143new TaskItem(Path.Combine(tempPath, "a.cs")),
2144new TaskItem(Path.Combine(tempPath, "a.cs")),
2157new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs
2158new TaskItem(Path.Combine(tempPath, @"xa.cs")), // b.cs -> xa.cs should copy because it's a different source
2159new TaskItem(Path.Combine(tempPath, @"xb.cs")), // a.cs -> xb.cs should copy because it's a different destination
2160new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs should copy because it's a different source from the b.cs copy done previously
2161new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs should not copy because it's the same source
2191string xaPath = Path.Combine(tempPath, "xa.cs");
2194Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[0].Key.Path);
2195Assert.Equal(Path.Combine(tempPath, "b.cs"), xaCopies[1].Key.Path);
2196Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[2].Key.Path);
2198string xbPath = Path.Combine(tempPath, "xb.cs");
2201Assert.Equal(Path.Combine(tempPath, "a.cs"), xbCopies[0].Key.Path);
2214string temp = Path.GetTempPath();
2215string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2216string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A399");
2217string outFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A400");
2669string temp = Path.GetTempPath();
2670string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2671string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
2741string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2742string destFile1 = Path.Combine(destFolder, Path.GetFileName(sourceFile1));
2743string destFile2 = Path.Combine(destFolder, Path.GetFileName(sourceFile2));
2748string nothingFile = Path.Combine(destFolder, "nothing.txt");
2845string temp = Path.GetTempPath();
2846string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2847string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
2875string destLink = Path.Combine(destFolder, Path.GetFileNameWithoutExtension(sourceFile) + "." + n);
2928string temp = Path.GetTempPath();
2929string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2930string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
2995string temp = Path.GetTempPath();
2996string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
2997string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
3067string destFile = Path.Combine(destFolder.Path, "The Destination");
3113Path.Combine(Path.GetDirectoryName(sourceFile2.Path), ".", Path.GetFileName(sourceFile2.Path))) // sourceFile2.Path with a "." inserted before the file name
3228string tempPath = Path.GetTempPath();
3229string tempDir = Path.Combine(tempPath, "CopyTestDir" + Guid.NewGuid().ToString("N"));
3236string outputDir = Path.Combine(tempDir, "bin", "Debug", RunnerUtilities.LatestDotNetCoreForMSBuild);
3240string lowercaseDir = Path.Combine(outputDir, "cs");
3244string sourceDir = Path.Combine(tempDir, "CS", "obj", "Debug", RunnerUtilities.LatestDotNetCoreForMSBuild);
3247string sourceFile1 = Path.Combine(sourceDir, "apphost");
3248string sourceFile2 = Path.Combine(sourceDir, "app.dll");
3253string destFile1 = Path.Combine(outputDir, "CS");
3254string destFile2 = Path.Combine(outputDir, "app.dll");
GetInstalledSDKLocations_Tests.cs (55)
49string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory");
54Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0" }));
56Path.Combine(new[] { tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0" }));
58Path.Combine(new[] { tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0" }));
60Path.Combine(
64Path.Combine(
68Path.Combine(
74Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "v1.1" }));
77Directory.CreateDirectory(Path.Combine(tempPath, "Windows", "v3.0") + Path.DirectorySeparatorChar);
81Path.Combine(tempPath, "Windows", "NotAVersion") + Path.DirectorySeparatorChar);
85Path.Combine(
92Path.Combine(new[] { tempPath, "Doors", "2.0", "ExtensionSDKs", "MyAssembly", "3.0" }));
94Path.Combine(
100Directory.CreateDirectory(Path.Combine(tempPath, "Walls" + Path.DirectorySeparatorChar + "1.0" + Path.DirectorySeparatorChar));
101File.WriteAllText(Path.Combine(tempPath, "Walls", "1.0", "SDKManifest.xml"), "Hello");
117string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory2");
122Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "4.0" }));
124Path.Combine(new[] { tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "5.0" }));
126Path.Combine(new[] { tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "6.0" }));
128Path.Combine(
132Path.Combine(
136Path.Combine(
345Path.Combine(
347+ Path.DirectorySeparatorChar,
351Path.Combine(
353+ Path.DirectorySeparatorChar,
357Path.Combine(
359+ Path.DirectorySeparatorChar,
364Path.Combine(
366+ Path.DirectorySeparatorChar,
370Path.Combine(
372+ Path.DirectorySeparatorChar,
376Path.Combine(
378+ Path.DirectorySeparatorChar,
419Path.Combine(
421+ Path.DirectorySeparatorChar,
425Path.Combine(
427+ Path.DirectorySeparatorChar,
431Path.Combine(
433+ Path.DirectorySeparatorChar,
438Path.Combine(
440+ Path.DirectorySeparatorChar,
444Path.Combine(
446+ Path.DirectorySeparatorChar,
450Path.Combine(
452+ Path.DirectorySeparatorChar,
495string parentDir = Path.GetDirectoryName(_fakeSDKStructureRoot);
496string relativeName = Path.GetFileName(_fakeSDKStructureRoot);
500_env.SetCurrentDirectory(Path.GetTempPath());
GetSDKReference_Tests.cs (107)
49string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "FakeSDKForReferenceAssemblies");
50sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\");
51string referenceAssemblyDirectoryConfigx86 = Path.Combine(sdkDirectory, "References\\Retail\\X86");
52string referenceAssemblyDirectoryConfigx64 = Path.Combine(sdkDirectory, "References\\Retail\\X64");
53string referenceAssemblyDirectoryConfigNeutral = Path.Combine(sdkDirectory, "References\\Retail\\Neutral");
54string referenceAssemblyDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\Neutral");
55string referenceAssemblyDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\X86");
56string referenceAssemblyDirectoryCommonConfigX64 = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\X64");
58string redistDirectoryConfigx86 = Path.Combine(sdkDirectory, "Redist\\Retail\\X86");
59string redistDirectoryConfigx64 = Path.Combine(sdkDirectory, "Redist\\Retail\\X64");
60string redistDirectoryConfigNeutral = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral");
61string redistDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral");
62string redistDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\X86");
63string redistDirectoryCommonConfigX64 = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\X64");
65string designTimeDirectoryConfigx86 = Path.Combine(sdkDirectory, "DesignTime\\Retail\\X86");
66string designTimeDirectoryConfigNeutral = Path.Combine(sdkDirectory, "DesignTime\\Retail\\Neutral");
67string designTimeDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "DesignTime\\CommonConfiguration\\Neutral");
68string designTimeDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "DesignTime\\CommonConfiguration\\X86");
83Directory.CreateDirectory(Path.Combine(redistDirectoryConfigNeutral, "ASubDirectory\\TwoDeep"));
93string testWinMD = Path.Combine(referenceAssemblyDirectoryConfigx86, "A.winmd");
94string testWinMD64 = Path.Combine(referenceAssemblyDirectoryConfigx64, "A.winmd");
95string testWinMDNeutral = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "B.winmd");
96string testWinMDNeutralWinXML = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "B.xml");
97string testWinMDCommonConfigurationx86 = Path.Combine(referenceAssemblyDirectoryCommonConfigX86, "C.winmd");
98string testWinMDCommonConfigurationx64 = Path.Combine(referenceAssemblyDirectoryCommonConfigX64, "C.winmd");
99string testWinMDCommonConfigurationNeutral = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "D.winmd");
100string testWinMDCommonConfigurationNeutralDupe = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "A.winmd");
102string testRA = Path.Combine(referenceAssemblyDirectoryConfigx86, "E.dll");
103string testRA64 = Path.Combine(referenceAssemblyDirectoryConfigx64, "E.dll");
104string testRANeutral = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "F.dll");
105string testRACommonConfigurationx86 = Path.Combine(referenceAssemblyDirectoryCommonConfigX86, "G.dll");
106string testRACommonConfigurationx64 = Path.Combine(referenceAssemblyDirectoryCommonConfigX64, "G.dll");
107string testRACommonConfigurationNeutral = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "H.dll");
109string testRACommonConfigurationNeutralDupe = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "A.dll");
111string redist = Path.Combine(redistDirectoryConfigx86, "A.dll");
112string redist64 = Path.Combine(redistDirectoryConfigx64, "A.dll");
113string redistNeutral = Path.Combine(redistDirectoryConfigNeutral, "ASubDirectory\\TwoDeep\\B.dll");
114string redistNeutralPri = Path.Combine(redistDirectoryConfigNeutral, "B.pri");
115string redistCommonConfigurationx86 = Path.Combine(redistDirectoryCommonConfigX86, "C.dll");
116string redistCommonConfigurationx64 = Path.Combine(redistDirectoryCommonConfigX64, "C.dll");
117string redistCommonConfigurationNeutral = Path.Combine(redistDirectoryCommonConfigNeutral, "D.dll");
118string redistCommonConfigurationNeutralDupe = Path.Combine(redistDirectoryCommonConfigNeutral, "A.dll");
153string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "FakeSDKForReferenceAssemblies");
154sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\AnotherSDK\\2.0\\");
155string referenceAssemblyDirectoryConfigx86 = Path.Combine(sdkDirectory, "References\\Retail\\X86");
156string redistDirectoryConfigx86 = Path.Combine(sdkDirectory, "Redist\\Retail\\X86");
164string testWinMD = Path.Combine(referenceAssemblyDirectoryConfigx86, "B.winmd");
165string redist = Path.Combine(redistDirectoryConfigx86, "B.pri");
166string redist2 = Path.Combine(redistDirectoryConfigx86, "B.dll");
189private readonly string _cacheDirectory = Path.Combine(Path.GetTempPath(), "GetSDKReferenceFiles");
298Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[0]);
299Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[1]);
304Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[0]);
305Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[1]);
310Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\X86\\"), sdkFolders[0]);
311Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[1]);
312Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\X86\\"), sdkFolders[2]);
313Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[3]);
432string winmd = Path.Combine(_sdkDirectory, "References\\Retail\\X86\\A.winmd");
435Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true);
444Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true);
453Assert.Equal("A.winmd", Path.GetFileName(t.CopyLocalFiles[0].ItemSpec), true);
462Assert.Equal("E.dll", Path.GetFileName(t.CopyLocalFiles[5].ItemSpec), true);
471Assert.Equal("B.xml", Path.GetFileName(t.CopyLocalFiles[2].ItemSpec));
556Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true);
565Assert.Equal("B.winmd", Path.GetFileName(t.References[1].ItemSpec), true);
574Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true);
683Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec));
690Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec));
729Assert.Equal("A.dll", Path.GetFileName(t.References[0].ItemSpec), true);
736Assert.Equal("h.dll", Path.GetFileName(t.References[4].ItemSpec), true);
825Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec));
834Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec));
877Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec));
886Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec));
962Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec));
968Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true);
974Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[2].ItemSpec), true);
980Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[3].ItemSpec), true);
986Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[4].ItemSpec), true);
1235string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\B.pri");
1236string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.pri");
1237string referenceWinner = Path.Combine(_sdkDirectory, "References\\Retail\\Neutral\\B.WinMD");
1238string referenceVictim = Path.Combine(_sdkDirectory2, "References\\Retail\\X86\\B.WinMD");
1281string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\ASubDirectory\\TwoDeep\\B.dll");
1282string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.dll");
1324string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\B.pri");
1325string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.pri");
1326string referenceWinner = Path.Combine(_sdkDirectory, "References\\Retail\\Neutral\\B.WinMD");
1327string referenceVictim = Path.Combine(_sdkDirectory2, "References\\Retail\\X86\\B.WinMD");
1368Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec), true);
1374Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true);
1380Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[2].ItemSpec), true);
1386Assert.Equal("B.pri", Path.GetFileName(t.RedistFiles[3].ItemSpec), true);
1392Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[4].ItemSpec), true);
1398Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[5].ItemSpec), true);
1404Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[6].ItemSpec), true);
1413if (Path.GetFileName(path).Equals("C.winmd", StringComparison.OrdinalIgnoreCase))
1418if (Path.GetExtension(path).Equals(".winmd", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase))
1420string fileName = Path.GetFileNameWithoutExtension(path);
1429if (Path.GetFileName(path).Equals("A.winmd", StringComparison.OrdinalIgnoreCase))
1433if (Path.GetExtension(path).Equals(".winmd", StringComparison.OrdinalIgnoreCase))
1438if (Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase))
ManifestTaskEnvironmentTests.cs (14)
54var subFolder = Path.Combine(folder.Path, "sub");
57var resxPath = Path.Combine(subFolder, "Test.resx");
60var csPath = Path.Combine(subFolder, "Test.cs");
64var pathWithDotDot = Path.Combine(folder.Path, "sub", "..", "sub", "Test.resx");
84var subFolder = Path.Combine(folder.Path, "Resources");
87var resxPath = Path.Combine(subFolder, "Strings.resx");
110var subFolder = Path.Combine(folder.Path, "Sub", "Folder");
113var resxPath = Path.Combine(subFolder, "Test.resx");
158var validPath = Path.Combine(folder.Path, "Valid.resx");
162var valid2Path = Path.Combine(folder.Path, "Valid2.resx");
192var deepFolder = Path.Combine(folder.Path, "a", "b", "c", "d", "e");
195var resxPath = Path.Combine(deepFolder, "Test.resx");
215var spaceFolder = Path.Combine(folder.Path, "My Resources");
218var resxPath = Path.Combine(spaceFolder, "My Strings.resx");
Move_Tests.cs (15)
427string temp = Path.GetTempPath();
428string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A392");
429string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A393");
431string validOutFile = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A394");
606string file = Path.Combine(currdir, filename);
648string temp = Path.GetTempPath();
649string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395");
694string temp = Path.GetTempPath();
695string destFolder = Path.Combine(temp, "2A333ED756AF4d1392E728D0F864A398");
696string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile));
749string temp = Path.GetTempPath();
750string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398");
751string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A399");
752string outFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A400");
MSBuild_Tests.cs (8)
46Directory.SetCurrentDirectory(Path.GetTempPath());
61string fileName = Path.GetFileName(tempProject);
69int rootLength = Path.GetPathRoot(tempProject).Length;
400Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "ConsoleApplication1.csproj"), $@"
440Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "Program.cs"), @"
463Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), @"
481ObjectModelHelpers.BuildTempProjectFileExpectSuccess(Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), logger);
483ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("bug'533'369", "Sub;Dir", "binaries", "ConsoleApplication1.exe"));
RARPrecomputedCache_Tests.cs (8)
31{ Path.Combine(standardCache.Path, "assembly1"), new SystemState.FileState(now) },
32{ Path.Combine(standardCache.Path, "assembly2"), new SystemState.FileState(now) { Assembly = new Shared.AssemblyNameExtension("hi") } } };
75string dllName = Path.Combine(Path.GetDirectoryName(standardCache.Path), "randomFolder", "dll.dll");
116string dllName = Path.Combine(Path.GetDirectoryName(precomputedCache.Path), "randomFolder", "dll.dll");
118{ Path.Combine(precomputedCache.Path, "..", "assembly1", "assembly1"), new SystemState.FileState(DateTime.Now) },
119{ Path.Combine(precomputedCache.Path, "assembly2"), new SystemState.FileState(DateTime.Now) { Assembly = new Shared.AssemblyNameExtension("hi") } },
ResolveAssemblyReference_CustomCultureTests.cs (9)
25private static string TestAssetsRootPath { get; } = Path.Combine(
26Path.GetDirectoryName(typeof(AddToWin32Manifest_Tests).Assembly.Location) ?? AppContext.BaseDirectory,
50var projectBFolder = Path.Combine(solutionPath, projectBName);
52var projBContent = File.ReadAllText(Path.Combine(testAssetsPath, projectBName))
56env.CreateFile(Path.Combine(projectBFolder, projectBName), projBContent);
74var yueCultureResourceDll = Path.Combine(projBOutputPath, "yue", "ProjectA.resources.dll");
77var euyCultureResourceDll = Path.Combine(projBOutputPath, "euy", "ProjectA.resources.dll");
96var sourcePath = Path.Combine(sourceFolder, fileName);
98File.Copy(sourcePath, Path.Combine(destinationFolder, fileName));
ResolveNonMSBuildProjectOutput_Tests.cs (44)
136projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
142projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll"));
144projectOutputs, true, Path.Combine("obj", "correct.dll"));
148projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
149projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
150projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
156projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
157projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
158projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
159projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll"));
161projectOutputs, true, Path.Combine("obj", "correct.dll"));
223projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-000000000000}", Path.Combine("obj", "managed.dll"));
224projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "unmanaged.dll"));
226TestUnresolvedReferencesHelper(projectRefs, projectOutputs, path => (path == Path.Combine("obj", "managed.dll")), out unresolvedOutputs, out resolvedOutputs);
229Assert.True(resolvedOutputs.Contains(Path.Combine("obj", "managed.dll")));
230Assert.True(resolvedOutputs.Contains(Path.Combine("obj", "unmanaged.dll")));
231Assert.Equal("true", ((ITaskItem)resolvedOutputs[Path.Combine("obj", "managed.dll")]).GetMetadata("ManagedAssembly"));
232Assert.NotEqual("true", ((ITaskItem)resolvedOutputs[Path.Combine("obj", "unmanaged.dll")]).GetMetadata("ManagedAssembly"));
249projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
250projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
251projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
264projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
265projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
266projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
267projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll"));
272Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll")));
278projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
279projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
280projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
281projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll"));
282projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-000000000000}", Path.Combine("obj", "correct2.dll"));
287Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll")));
288Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct2.dll")));
293projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
294projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
295projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
306projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
307projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
308projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
309projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll"));
315Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll")));
320projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll"));
321projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll"));
322projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
ResolveSDKReference_Tests.cs (299)
123string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "TestMaxPlatformVersionWithTargetFrameworkVersion");
124string testDirectory = Path.Combine(new[] { testDirectoryRoot, "MyPlatform", "8.0", "ExtensionSDKs", "SDkWithManifest", "2.0" }) + Path.DirectorySeparatorChar;
176string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
462string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyDependsOnWarningFromManifest");
463string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
484string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
577string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit1");
578string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
588string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
632string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit2");
633string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
643string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
690string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit3");
691string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
701string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
745string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit4");
746string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
756string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
800string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit5");
801string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
811string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
855string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit6");
856string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
866string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
912string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit7");
913string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
923string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
967string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit8");
968string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
977string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1021string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit9");
1022string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
1032string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1491string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SDKFoundButBadlyFormattedSDKManifestWarnings");
1492string testDirectory = Path.Combine(testDirectoryRoot, "BadTestSDK", "2.0") + Path.DirectorySeparatorChar;
1498string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1550string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SDKFoundButBadlyFormattedSDKManifestErrors");
1551string testDirectory = Path.Combine(testDirectoryRoot, "BadTestSDK\\2.0\\");
1557string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1601string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "TestMaxPlatformVersionWithTargetFrameworkVersion");
1602string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
1654string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1707string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "EmptySDKManifestAttributes");
1708string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
1734string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1792string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestAttributes");
1793string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
1816string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1890string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigAndArch");
1891string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
1911string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
1963string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigOnly");
1964string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
1982string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2032string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "NoCopyOnPlatformIdentityFound");
2033string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2047string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2099string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigOnly");
2100string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2120string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2173string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ManifestOnlyHasArmLocation");
2174string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2189string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2241string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ManifestArmLocationWithOthers");
2242string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2259string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2312string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MatchNoNamesButNamesExistWarning");
2313string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2330string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2384string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MatchNoNamesButNamesExistError");
2385string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2402string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2453string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SingleSupportedArchitectureMatchesProject");
2454string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2472string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2526string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ProductFamilySetInManifest");
2527string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2546string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2591string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ProductFamilySetInManifestAndMetadata");
2592string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2611string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2658string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsNotInManifest");
2659string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2678string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2722string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsBadMetadata");
2723string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2743string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2790string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilySameName");
2791string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar;
2792string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
2793string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "3.0") + Path.DirectorySeparatorChar;
2821string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2822string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml");
2823string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml");
2888string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilyDiffName");
2889string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar;
2890string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK1", "2.0") + Path.DirectorySeparatorChar;
2891string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "3.0") + Path.DirectorySeparatorChar;
2919string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
2920string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml");
2921string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml");
2986string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilyDiffName");
2987string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar;
2988string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK2", "2.0") + Path.DirectorySeparatorChar;
2989string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "3.0") + Path.DirectorySeparatorChar;
2990string testDirectory4 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "4.0") + Path.DirectorySeparatorChar;
3024string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3025string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml");
3026string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml");
3027string sdkManifestFile4 = Path.Combine(testDirectory4, "SDKManifest.xml");
3099string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameSDKName");
3100string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar;
3101string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3102string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "3.0") + Path.DirectorySeparatorChar;
3130string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3131string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml");
3132string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml");
3205string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsVerifyManifestReading");
3206string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3226string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3279string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadata");
3280string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3300string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3356string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadataButMetadataDoesNotMatch");
3357string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3376string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3422string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadata");
3423string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3444string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3500string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SingleSupportedArchitectureDoesNotMatchProject");
3501string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3520string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3564string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MultipleSupportedArchitectureMatchesProject");
3565string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar;
3583string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3636string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MultipleSupportedArchitectureMatchesProject");
3638Path.Combine(new[] { testDirectoryRoot, "MyPlatform", "8.0", "ExtensionSDKs", "SDkWithManifest", "2.0" })
3639+ Path.DirectorySeparatorChar;
3657string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml");
3704string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsWithFramework");
3705string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\");
3706string archRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86");
3707string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral");
3708string archCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86");
3709string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral");
3711string sdkDirectory3 = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\FrameworkSDkWithManifest\\2.0\\");
3712string archRedist3 = Path.Combine(sdkDirectory3, "Redist\\Retail\\x64");
3713string archRedist33 = Path.Combine(sdkDirectory3, "Redist\\Retail\\Neutral");
3714string archCommonRedist3 = Path.Combine(sdkDirectory3, "Redist\\CommonConfiguration\\x64");
3785string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
3786string sdkManifestFile2 = Path.Combine(sdkDirectory3, "SDKManifest.xml");
3787string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
3794string redist1 = Path.Combine(archRedist, "A.dll");
3795string redist2 = Path.Combine(neutralRedist, "B.dll");
3796string redist3 = Path.Combine(archCommonRedist, "C.dll");
3797string redist4 = Path.Combine(neutralCommonRedist, "D.dll");
3798string redist5 = Path.Combine(archRedist33, "A.dll");
3799string redist6 = Path.Combine(archCommonRedist3, "B.dll");
3847string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsWithFramework");
3848string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\");
3849string archRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86");
3850string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral");
3851string archCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86");
3852string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral");
3854string sdkDirectory3 = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\FrameworkSDkWithManifest\\2.0\\");
3855string archRedist3 = Path.Combine(sdkDirectory3, "Redist\\Retail\\x64");
3856string archRedist33 = Path.Combine(sdkDirectory3, "Redist\\Retail\\Neutral");
3857string archCommonRedist3 = Path.Combine(sdkDirectory3, "Redist\\CommonConfiguration\\x64");
3926string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
3927string sdkManifestFile2 = Path.Combine(sdkDirectory3, "SDKManifest.xml");
3928string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
3935string redist1 = Path.Combine(archRedist, "A.dll");
3936string redist2 = Path.Combine(neutralRedist, "B.dll");
3937string redist3 = Path.Combine(archCommonRedist, "C.dll");
3938string redist4 = Path.Combine(neutralCommonRedist, "D.dll");
3939string redist5 = Path.Combine(archRedist3, "D.dll");
3940string redist6 = Path.Combine(archRedist33, "A.dll");
3941string redist7 = Path.Combine(archCommonRedist3, "B.dll");
3991string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsTargetArchitectureDoesNotExists");
3992string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\");
3993string x86Redist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86");
3994string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral");
3995string x86CommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86");
3996string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral");
4043string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
4044string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
4050string redist1 = Path.Combine(x86CommonRedist, "A.dll");
4051string redist2 = Path.Combine(x86Redist, "B.dll");
4052string redist3 = Path.Combine(neutralRedist, "C.dll");
4053string redist4 = Path.Combine(neutralCommonRedist, "D.dll");
4100string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "CheckDefaultingOfTargetConfigAndArchitecture");
4101string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\");
4102string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral");
4103string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral");
4145string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
4146string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
4151string redist1 = Path.Combine(neutralRedist, "B.dll");
4152string redist2 = Path.Combine(neutralCommonRedist, "C.dll");
4200new Dictionary<string, ITaskItem>() { { "sdkName, Version=1.0.2", new TaskItem(Path.GetTempFileName(), new Dictionary<string, string>() { { "PlatformVersion", "1.0.2" } }) } },
4220string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "CheckDefaultingOfTargetConfigAndArchitecture");
4221string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\v8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\");
4222string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral");
4223string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral");
4284string redist1 = Path.Combine(neutralRedist, "B.dll");
4285string redist2 = Path.Combine(neutralCommonRedist, "C.dll");
4292string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
4295string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
ResourceHandling\GenerateResource_Tests.cs (127)
72Assert.Equal(".resources", Path.GetExtension(resourcesFile));
74Assert.Equal(".resources", Path.GetExtension(resourcesFile));
111string expectedOutFile0 = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(resxFile0, ".resources"));
112string expectedOutFile1 = Path.Combine(Path.GetTempPath(), "resx1.foo.resources");
113string expectedOutFile2 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources"));
114string expectedOutFile3 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources"));
160Assert.Equal(".resources", Path.GetExtension(resourcesFile));
162Assert.Equal(".resources", Path.GetExtension(resourcesFile));
209Assert.Equal(".resources", Path.GetExtension(resourcesFile));
245t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".resx")) };
247Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec));
252t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".txt")) };
254Assert.Equal(".txt", Path.GetExtension(t2a.FilesWritten[0].ItemSpec));
261Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec));
295string outputFile = Path.ChangeExtension(resourcesFile, ".txt");
300Assert.Equal(".txt", Path.GetExtension(resourcesFile));
332Path.GetExtension(resourceOutput).ShouldBe(".resources");
333Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources");
409Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources");
410Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources");
475Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources");
576string outputResource = Path.ChangeExtension(Path.GetFullPath(resxFile), ".resources");
679Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources");
680Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources");
794Assert.Equal(".resources", Path.GetExtension(resourcesFile));
796Assert.Equal(".resources", Path.GetExtension(resourcesFile));
846resourcesFile1 = Path.ChangeExtension(resxFile, ".resources");
847resourcesFile2 = Path.ChangeExtension(txtFile, ".resources");
1082t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(textFile, ".resx")) };
1087Assert.Equal(".resx", Path.GetExtension(resourcesFile));
1115t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".resx")) };
1117Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec));
1122t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(t.FilesWritten[0].ItemSpec, ".resources")) };
1124Assert.Equal(".resources", Path.GetExtension(t2a.FilesWritten[0].ItemSpec));
1132Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec));
1168Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1179Assert.Equal(".txt", Path.GetExtension(resourcesFile));
1215string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec);
1217Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1219Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1222string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1278string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec);
1280Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1282Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1286string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1319Assert.Equal(t2.FilesWritten[2].ItemSpec, Path.ChangeExtension(t2.Sources[0].ItemSpec, ".cs"));
1357strFile = Path.ChangeExtension(resourcesFile, ".cs"); // STR filename should be generated from output not input filename
1369string stronglyTypedClassName = Path.GetFileNameWithoutExtension(resourcesFile);
1372Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1463Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1465Assert.Equal(".resources", Path.GetExtension(t.FilesWritten[0].ItemSpec));
1522string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".vb");
1526Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1528Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1582Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1584Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1589string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1594Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec));
1640Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1642Assert.Equal(".resources", Path.GetExtension(resourcesFile));
1647string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs");
1652Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec));
2032resourcesFile1 = Path.ChangeExtension(resxFile1, ".resources");
2033resourcesFile2 = Path.ChangeExtension(resxFile2, ".resources");
2109resourcesFile1 = Path.ChangeExtension(resxFile1, ".resources");
2110resourcesFile2 = Path.ChangeExtension(resxFile2, ".resources");
2208t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resxFile, ".txt")) };
2244Assert.Equal(".resources", Path.GetExtension(resourcesFile));
2318string resourcesFile = Path.ChangeExtension(resxFile, ".resources");
2369string resourcesFile = Path.ChangeExtension(textFile, ".resources");
2409string resourcesFile = Path.ChangeExtension(txtFile, ".resources");
2500string resourcesFile = Path.ChangeExtension(resxFile, ".resources");
2534string outputFile = Path.ChangeExtension(t.Sources[i].ItemSpec, ".resources");
2611File.Delete(Path.ChangeExtension(taskItem.ItemSpec, ".resources"));
2620string outputFile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources");
2623outputFile = Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources");
2627outputFile = Path.ChangeExtension(t.Sources[2].ItemSpec, ".resources");
2630outputFile = Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources");
2635Assert.Equal(t.FilesWritten[0].ItemSpec, Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources"));
2636Assert.Equal(t.FilesWritten[1].ItemSpec, Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources"));
2648Assert.Equal(t.FilesWritten[2].ItemSpec, Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources"));
2699Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.StronglyTypedFileName));
2733File.Delete(Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"));
2742Assert.Equal(t.StronglyTypedFileName, Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"));
2826File.Delete(Path.ChangeExtension(textFile, ".resources"));
2844resourcesFile = Path.ChangeExtension(txtFile, ".resources");
2920string newTextFile = Path.ChangeExtension(textFile, ".foo");
2953string resxFile = Path.ChangeExtension(textFile, ".foo");
2985string resxFile = Path.ChangeExtension(textFile, ".resources");
3080File.Delete(Path.ChangeExtension(resxFile, ".resources"));
3085File.Delete(Path.ChangeExtension(resxFile2, ".resources"));
3142string resourcesFile = Path.ChangeExtension(txtFile, ".resources");
3179string resourcesFile = Path.ChangeExtension(txtFile, ".resources");
3216string resourcesFile = Path.ChangeExtension(txtFile, ".resources");
3255resourcesFile = Path.ChangeExtension(txtFile, ".resources");
3257string csFile = Path.ChangeExtension(txtFile, ".cs");
3261dir = Path.Combine(Path.GetTempPath(), "directory");
3387string p2pReference = Path.Combine(ObjectModelHelpers.TempProjectDir, "bin", "debug", "lib1.dll");
3480t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) };
3629t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) };
3678string resourcesFile = Path.ChangeExtension(resxFile, ".resources");
3714resourcesFile = Path.ChangeExtension(resxFile, ".resources");
3753File.Delete(Path.ChangeExtension(resxFile, ".cs"));
3757resourcesFile = Path.ChangeExtension(resxFile, ".resources");
3800resourcesFile = Path.ChangeExtension(resxFile, ".myresources");
3803string resourcesFile1 = Path.ChangeExtension(resxFile1, ".myresources");
3899Assert.Equal(".resources", Path.GetExtension(resourcesFile));
3901Assert.Equal(".resources", Path.GetExtension(resourcesFile));
3942env.CreateFolder(Path.Combine(env.DefaultTestDirectory.Path, "tmp_dir")),
3957Path.GetExtension(outputResourceFile).ShouldBe(".resources");
4430Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "System.dll");
4475string filename = Path.ChangeExtension(f, extension);
4528Assert.Equal(Path.GetFileNameWithoutExtension(textFile), Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec));
4531string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec);
4535Assert.Equal(".resources", Path.GetExtension(resourcesFile));
4539Assert.Equal(".resources", Path.GetExtension(resourcesFile));
4544Assert.Equal(Path.ChangeExtension(t.Sources[0].ItemSpec, codeFileExtension), t.StronglyTypedFileName);
4551string STRFile = Path.ChangeExtension(textFile, codeFileExtension);
4555Assert.Contains("class " + Path.GetFileNameWithoutExtension(textFile).ToLower(), Utilities.ReadFileContent(STRFile).ToLower());
RoslynCodeTaskFactory_Tests.cs (12)
64<Reference Include=""" + Path.Combine(Path.GetDirectoryName(location), "..", "..", "..", "Samples", "Dependency",
130string output = RunnerUtilities.ExecMSBuild(assemblyProj.Path + $" /p:OutDir={Path.Combine(folder.Path, "subFolder")} /restore", out bool success);
138<Reference Include=""{Path.Combine(folder.Path, "subFolder", "5106.dll")}"" />
1240TransientTestFolder project1Folder = env.CreateFolder(Path.Combine(rootFolder.Path, "Project1"), createFolder: true);
1241TransientTestFolder project2Folder = env.CreateFolder(Path.Combine(rootFolder.Path, "Project2"), createFolder: true);
1332string projectFilePath = Path.Combine(testFolder.Path, "test.proj");
1382string projectFilePath = Path.Combine(projectFolder.Path, "test.proj");
1427TransientTestFolder projectFolder = env.CreateFolder(Path.Combine(rootFolder.Path, "Project"), createFolder: true);
1428string projectFilePath = Path.Combine(projectFolder.Path, "test.proj");
1443string relativePath = Path.Combine("..", "SharedTask.cs");
1544string projectFilePath = Path.Combine(testFolder.Path, "test.proj");
Unzip_Tests.cs (18)
90_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
91_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
136_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
137_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
138_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "subdir", "F83E9633685494E53BEF3794EDEEE6A6.txt"), customMessage: _mockEngine.Log);
139_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "subdir", "21D6D4596067723B3AC5DF9A8B3CBFE7.txt"), customMessage: _mockEngine.Log);
140Directory.Exists(Path.Combine(destination.Path, "emptyDir"));
249SourceFiles = new ITaskItem[] { new TaskItem(Path.Combine(testEnvironment.DefaultTestDirectory.Path, "foo.zip")), },
284_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
285_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
314_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log);
315_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log);
349_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "file1.js"), customMessage: _mockEngine.Log);
350_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "file1.js.map"), customMessage: _mockEngine.Log);
351_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "file2.js"), customMessage: _mockEngine.Log);
352_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "readme.txt"), customMessage: _mockEngine.Log);
353_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "sub", "subfile.js"), customMessage: _mockEngine.Log);
501string unzippedFilePath = Path.Combine(destination.Path, executableName);
VerifyFileHash_Tests.cs (4)
30File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
49File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
68File = Path.Combine(AppContext.BaseDirectory, "this_does_not_exist.txt"),
90File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
WriteCodeFragment_Tests.cs (42)
89task.OutputDirectory = new TaskItem(Path.GetTempPath());
94string file = Path.Combine(Path.GetTempPath(), "CombineFileDirectory.tmp");
113string expectedFile = Path.Combine(folder.ItemSpec, file.ItemSpec);
132TaskItem file = new TaskItem(Path.Combine(env.CreateFolder(folderPath: null, createFolder: false).Path, "File.tmp"));
159string fileName = Path.GetFileName(file.Path);
182string folder = Path.Combine(Path.GetTempPath(), "foo" + Path.DirectorySeparatorChar);
183string file = Path.Combine(folder, "CombineFileDirectory.tmp");
204string file = Path.Combine(Path.GetTempPath(), "NoAttributesShouldEmitNoFile.tmp");
232string file = Path.Combine(Path.GetTempPath(), "NoAttributesShouldEmitNoFile.tmp");
297string file = Path.Combine(Path.GetTempPath(), "OneAttribute.tmp");
338task.OutputDirectory = new TaskItem(Path.GetTempPath());
365task.OutputDirectory = new TaskItem(Path.GetTempPath());
392task.OutputDirectory = new TaskItem(Path.GetTempPath());
397Assert.Equal(Path.GetTempPath(), task.OutputFile.ItemSpec.Substring(0, Path.GetTempPath().Length));
434string relativeFolder = Path.GetFileName(absoluteFolder);
440Directory.SetCurrentDirectory(Path.GetDirectoryName(absoluteFolder));
455Path.IsPathRooted(task.OutputFile.ItemSpec).ShouldBeFalse("OutputFile should be relative when OutputDirectory is relative");
461string absoluteOutputFile = Path.Combine(Path.GetDirectoryName(absoluteFolder), task.OutputFile.ItemSpec);
479string file = Path.Combine(Path.GetTempPath(), "OneAttribute.tmp");
524task.OutputDirectory = new TaskItem(Path.GetTempPath());
547task.OutputDirectory = new TaskItem(Path.GetTempPath());
572task.OutputDirectory = new TaskItem(Path.GetTempPath());
597task.OutputDirectory = new TaskItem(Path.GetTempPath());
630task.OutputDirectory = new TaskItem(Path.GetTempPath());
667task.OutputDirectory = new TaskItem(Path.GetTempPath());
700task.OutputDirectory = new TaskItem(Path.GetTempPath());
724task.OutputDirectory = new TaskItem(Path.GetTempPath());
748task.OutputDirectory = new TaskItem(Path.GetTempPath());
774task.OutputDirectory = new TaskItem(Path.GetTempPath());
808task.OutputDirectory = new TaskItem(Path.GetTempPath());
1148task.OutputDirectory = new TaskItem(Path.GetTempPath());
1174return CreateTask(language, new TaskItem(Path.GetTempPath()), null, attributes);
1306task.OutputDirectory = new TaskItem(Path.GetTempPath());
XslTransformation_Tests.cs (22)
864var testingDocsDir = Path.Combine("TestDocuments", "Fdl2Proto");
866xmlPaths = new TaskItem[] { new TaskItem(Path.Combine(testingDocsDir, "sila.xml")) };
867xslPath = new TaskItem(Path.Combine(testingDocsDir, "fdl2proto.xsl"));
884using (StreamReader sr = new StreamReader(Path.Combine(testingDocsDir, "expected.proto")))
951var otherXmlPath = new TaskItem(Path.Combine(dir, Guid.NewGuid().ToString()));
1052var otherXslPath = new TaskItem(Path.Combine(dir, Guid.NewGuid().ToString() + ".xslt"));
1059var myXmlPath1 = new TaskItem(Path.Combine(dir, "a.xml"));
1066var myXmlPath2 = new TaskItem(Path.Combine(dir, "b.xml"));
1109dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString());
1113xmlPaths = new TaskItem[] { new TaskItem(Path.Combine(dir, "doc.xml")) };
1114xslPath = new TaskItem(Path.Combine(dir, "doc.xslt"));
1115xslCompiledPath = new TaskItem(Path.Combine(dir, "doc.dll"));
1116outputPaths = new TaskItem[] { new TaskItem(Path.Combine(dir, "testout.xml")) };
1268string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString());
1275string xmlPath1 = Path.Combine(dir, "doc1.xml");
1282string xmlPath3 = Path.Combine(dir, "doc3.xml");
1290string xslPath = Path.Combine(dir, "doc.xslt");
1298string outputPath1 = Path.Combine(dir, "testout1.xml");
1299string outputPath2 = Path.Combine(dir, "testout2.xml");
1300string outputPath3 = Path.Combine(dir, "testout3.xml");
Microsoft.Build.UnitTests.Shared (49)
ObjectModelHelpers.cs (24)
146expectedInclude = expectedInclude.Select(i => Path.Combine(testProject.TestRoot, i)).ToArray();
196return path.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar);
578Assert.True(FileSystems.Default.FileExists(Path.Combine(TempProjectDir, fileRelativePath)), message);
742project.FullPath = Path.Combine(TempProjectDir, "Temporary" + guid.ToString("N") + ".csproj");
846s_tempProjectDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
908string fullFilePath = Path.Combine(TempProjectDir, fileRelativePath);
909Directory.CreateDirectory(Path.GetDirectoryName(fullFilePath));
985string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath);
1018if (string.Equals(Path.GetExtension(projectFileRelativePath), ".sln"))
1020string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath);
1632var projectDir = Path.Combine(root, relativePathFromRootToProject);
1635createdProjectFile = Path.Combine(projectDir, "build.proj");
1645return Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
1683var fullPath = Path.Combine(pathFragments.ToArray());
1685var directoryName = Path.GetDirectoryName(fullPath);
1856if (Path.IsPathRooted(path))
1858splits[0] = Path.GetPathRoot(path);
1872var pathsSortedByDepth = paths.OrderByDescending(x => Path.GetDirectoryName(Path.GetFullPath(x)).Length);
1881string directory = Path.GetDirectoryName(path);
2044Path.IsPathRooted(path)
Microsoft.Build.Utilities.Core (69)
ToolLocationHelper.cs (48)
664string legacyWindowsMetadataLocation = Path.Combine(sdkRoot, "Windows Metadata");
845propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName);
849propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName, targetPlatformIdentifier, targetPlatformVersion);
1039winmdLocation = Path.Combine(sdkRoot, referencesFolderName, commonConfigurationFolderName, neutralArchitectureName);
1132string referencesRoot = Path.Combine(targetPlatformSdkRoot, referencesFolderName, targetPlatformSdkVersion);
1137string contractPath = Path.Combine(referencesRoot, contract.Name, contract.Version);
1224return Path.Combine(sdkLocation, folderName);
1237? Path.Combine(matchingSdk.Path, folderName, targetPlatformVersion)
1238: Path.Combine(matchingSdk.Path, folderName);
1436var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder));
1501string fullPath = Path.Combine(root, file);
1766if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll")))
1840if (legacyMsCorlib20Path != null && FileSystems.Default.FileExists(Path.Combine(legacyMsCorlib20Path, "mscorlib.dll")))
1857if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll")))
2258Path.DirectorySeparatorChar.ToString(),
2261dotNetFrameworkReferenceAssemblies[i] += Path.DirectorySeparatorChar;
2426string referenceAssemblyPath = Path.Combine(sdkRoot, contentFolderName, targetConfiguration, targetArchitecture);
2553string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml");
2628string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version);
2629string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml");
2652string sdkFolderPath = Path.Combine(platformSDKDirectory, "ExtensionSDKs");
2747string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml");
2825string sdkManifestFileLocation = Path.Combine(directoryName, "SDKManifest.xml");
2903string localAppdataFolder = Path.Combine(userLocalAppData, "Microsoft SDKs");
2910string defaultProgramFilesLocation = Path.Combine(
3028string platformsRoot = Path.Combine(sdk.Path, platformsFolderName);
3056string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml");
3094string path = Path.GetFullPath(targetFrameworkDirectory);
3115string redistListFolder = Path.Combine(path, "RedistList");
3116string redistFilePath = Path.Combine(redistListFolder, "FrameworkList.xml");
3200pathToReturn = Path.Combine(pathToReturn, includeFramework);
3201pathToReturn = Path.GetFullPath(pathToReturn);
3349pathToSdk = Path.Combine(pathToSdk, "x64");
3352pathToSdk = Path.Combine(pathToSdk, "ia64");
3360string filePath = Path.Combine(pathToSdk, fileName);
3476pathToSdk = Path.Combine(pathToSdk, "bin");
3517pathToSdk = Path.Combine(pathToSdk, "x86");
3520pathToSdk = Path.Combine(pathToSdk, "x64");
3528string filePath = Path.Combine(pathToSdk, fileName);
3591toolPath = Path.Combine(toolPath, fileName);
3621return pathToFx == null ? null : Path.Combine(pathToFx, fileName);
3629public static string GetPathToSystemFile(string fileName) => Path.Combine(PathToSystem, fileName);
3861string frameworkIdentifierPath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier);
3919string frameworkProfilePath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier);
3920frameworkProfilePath = Path.Combine(frameworkProfilePath, frameworkVersion);
3921frameworkProfilePath = Path.Combine(frameworkProfilePath, "Profiles");
3966string dotNextFx30RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV30);
3973string dotNextFx35RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV35);
Microsoft.Build.Utilities.UnitTests (371)
ToolLocationHelper_Tests.cs (334)
63string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
71string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
72string referenceDirectory = Path.Combine(tempDirectory, Path.Combine("References", "Foo", "Bar"));
77File.WriteAllText(Path.Combine(referenceDirectory, "One.winmd"), "First");
78File.WriteAllText(Path.Combine(referenceDirectory, "Two.winmd"), "Second");
79File.WriteAllText(Path.Combine(referenceDirectory, "Three.winmd"), "Third");
95string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
97string referenceDirectory = Path.Combine(tempDirectory, @"References", tempVersion, @"Foo\Bar");
102File.WriteAllText(Path.Combine(referenceDirectory, "One.winmd"), "First");
130returnValue.ShouldBe(Path.Combine(sdkRootPath, @"DesignTime\CommonConfiguration\Neutral"));
156returnValue.ShouldBe(Path.Combine(sdkRootPath, "UnionMetadata"));
163string platformRootFolder = Path.Combine(Path.GetTempPath(), @"MockSDK");
164string sdkRootFolder = Path.Combine(platformRootFolder, @"Windows Kits\10");
165string platformFolder = Path.Combine(sdkRootFolder, @"Platforms\UAP\10.0.14944.0");
166string platformFilePath = Path.Combine(platformFolder, "Platform.xml");
167string sdkManifestFilePath = Path.Combine(sdkRootFolder, "SDKManifest.xml");
208returnValue.ShouldBe(Path.Combine(sdkRootFolder, "UnionMetadata", "10.0.14944.0"));
224string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
225string sdkDirectory = Path.Combine(tempDirectory, "Foo", "Bar");
249string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
250string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0");
274string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
275string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0");
280File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "");
300string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
301string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0");
306File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "Garbaggggge");
328string tempDirectory = Path.Combine(Path.GetTempPath(), "VGPTDNFSFN40");
329string temp35Directory = Path.Combine(tempDirectory, "bin");
330string temp40Directory = Path.Combine(temp35Directory, "NETFX 4.0 Tools");
331string toolPath = Path.Combine(temp35Directory, "MyTool.exe");
332string toolPath40 = Path.Combine(temp40Directory, "MyTool.exe");
395string tempPath = Path.GetTempPath();
396string testPath = Path.Combine(tempPath, "HighestVersionOfTargetFrameworkIdentifierRootNoVersions");
397string nonVersionFolder = Path.Combine(testPath, ".UnknownFramework", "NotAVersion");
414string tempPath = Path.GetTempPath();
415string testPath = Path.Combine(tempPath, "HighestVersionOfTargetFrameworkIdentifierRootMultipleVersions");
416string folder10 = Path.Combine(testPath, ".UnknownFramework", "v1.0");
417string folder20 = Path.Combine(testPath, ".UnknownFramework", "v2.0");
418string folder40 = Path.Combine(testPath, ".UnknownFramework", "v4.0");
447string tempDirectory = Path.Combine(Path.GetTempPath(), "VGPTDNFSF40");
448string temp35Directory = Path.Combine(tempDirectory, "bin");
449string temp40Directory = Path.Combine(temp35Directory, "NETFX 4.0 Tools");
450string toolPath = Path.Combine(temp35Directory, "MyTool.exe");
451string toolPath40 = Path.Combine(temp40Directory, "MyTool.exe");
508Path.GetDirectoryName(typeof(object).GetTypeInfo().Module.FullyQualifiedName),
535path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86dbg"));
547Path.Combine("{runtime-base}", "v1.3.x86dbg"), // Simulate "Orcas" as the current runtime.}
552path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86fre"));
564Path.Combine("{runtime-base}", "v1.1.x86dbg"), // Simulate "Everett" as the current runtime.
570path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86fre"));
582Path.Combine(@"{runtime-base}", "v1.1"), // Simulate "everett" as the current runtime
599string tempPath = Path.GetTempPath();
600string fakeWhidbeyPath = Path.Combine(tempPath, "v2.0.50224");
601string fakeEverettPath = Path.Combine(tempPath, "v1.1.43225");
688string tv12path = Path.Combine(ProjectCollection.GlobalProjectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion).ToolsPath, Constants.MSBuildExecutableName);
711string tv12path = Path.Combine(Path.GetFullPath(toolsPath32.EvaluatedValue), Constants.MSBuildExecutableName);
912string pathToSdk35InstallRoot = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\");
913string pathToSdkV4InstallRootOnVS10 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\");
914string pathToSdkV4InstallRootOnVS11 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v8.0A\");
918if (!Directory.Exists(Path.Combine(pathToSdkV4InstallRootOnVS11, "bin")))
924string pathToSdkV4InstallRootOnVS12 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v8.1A\");
932string pathToSdkV4InstallRootOnVS14 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v10.0A\");
1269string expectedPath = Path.Combine(targetFrameworkRootPath, targetFrameworkIdentifier);
1270expectedPath = Path.Combine(expectedPath, "v" + targetFrameworkVersion);
1271expectedPath = Path.Combine(expectedPath, "Profile");
1272expectedPath = Path.Combine(expectedPath, targetFrameworkProfile);
1287string expectedPath = Path.Combine(targetFrameworkRootPath, targetFrameworkIdentifier);
1288expectedPath = Path.Combine(expectedPath, "v" + targetFrameworkVersion);
1308string targetFrameworkProfile = "PocketPC" + new string(Path.GetInvalidFileNameChars());
1327string targetFrameworkIdentifier = "Compact Framework" + new string(Path.GetInvalidFileNameChars());
1389string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsChain");
1391string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1392string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1393string redist40Directory = Path.Combine(tempDirectory, "v4.0", "RedistList") + Path.DirectorySeparatorChar;
1394string redist40 = Path.Combine(redist40Directory, "FrameworkList.xml");
1402string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1"));
1404string expectedChainedPath = Path.Combine(tempDirectory, "v4.0");
1431string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoInclude");
1433string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1434string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1439string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1"));
1461string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoInclude");
1463string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1464string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1469string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1"));
1491string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoFileList");
1493string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1494string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1499string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1"));
1520string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsBadFile");
1522string redist40Directory = Path.Combine(tempDirectory, "v4.0", "RedistList") + Path.DirectorySeparatorChar;
1523string redist40 = Path.Combine(redist40Directory, "FrameworkList.xml");
1529string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.0"));
1551string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistPointsToInvalidInclude");
1553string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1554string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1555string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1");
1581char[] invalidFileNameChars = Path.GetInvalidFileNameChars();
1587string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistInvalidPathChars");
1589string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1590string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1591string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1");
1621string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistPathTooLong");
1623string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar;
1624string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml");
1625string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1");
1664string tempDirectory = Path.Combine(Path.GetTempPath(), "GetPathToReferenceAssembliesWithRootGoodWithChain");
1666string framework41Directory = Path.Combine(tempDirectory, "MyFramework", "v4.1") + Path.DirectorySeparatorChar;
1667string framework41redistDirectory = Path.Combine(framework41Directory, "RedistList");
1668string framework41RedistList = Path.Combine(framework41redistDirectory, "FrameworkList.xml");
1670string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") + Path.DirectorySeparatorChar;
1671string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList");
1672string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml");
1674string framework39Directory = Path.Combine(tempDirectory, "MyFramework", "v3.9") + Path.DirectorySeparatorChar;
1675string framework39redistDirectory = Path.Combine(framework39Directory, "RedistList");
1676string framework39RedistList = Path.Combine(framework39redistDirectory, "FrameworkList.xml");
1729string tempDirectory = Path.Combine(Path.GetTempPath(), "DisplayNameGeneration");
1731string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0")
1732+ Path.DirectorySeparatorChar;
1733string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList");
1734string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml");
1737Path.Combine(tempDirectory, "MyFramework", "v3.9", "Profile", "Client");
1738string framework39redistDirectory = Path.Combine(framework39Directory, "RedistList");
1739string framework39RedistList = Path.Combine(framework39redistDirectory, "FrameworkList.xml");
1786string tempDirectory = Path.Combine(Path.GetTempPath(), "GetPathToReferenceAssembliesWithRootCircularReference");
1788string framework41Directory = Path.Combine(tempDirectory, "MyFramework", "v4.1")
1789+ Path.DirectorySeparatorChar;
1790string framework41redistDirectory = Path.Combine(framework41Directory, "RedistList");
1791string framework41RedistList = Path.Combine(framework41redistDirectory, "FrameworkList.xml");
1793string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0")
1794+ Path.DirectorySeparatorChar;
1795string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList");
1796string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml");
1968string combinedPath = Path.Combine(programFiles32, pathToCombineWith);
1969string fullPath = Path.GetFullPath(combinedPath);
2500string rootDir = Path.Combine(env.DefaultTestDirectory.Path, "framework-root");
2529string customFrameworkRootPath = Path.Combine(env.DefaultTestDirectory.Path, "framework-root");
2552string rootDir = Path.Combine(env.CreateFolder().Path, "framework-root");
2553string fallbackPath = Path.Combine(env.CreateFolder().Path, "framework-root");
2583string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root");
2596string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root");
2613string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root");
2630string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root");
2645string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root");
2662string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root");
2683stdLibPaths[0].ShouldBe(Path.Combine(customFrameworkDir, frameworkName, frameworkVersionWithV) + Path.DirectorySeparatorChar, stdLibPaths[0]);
2719string redistPath = Path.Combine(rootDir, frameworkName, frameworkVersion, "RedistList");
2720string asmPath = Path.Combine(rootDir, frameworkName, frameworkVersion);
2725File.WriteAllText(Path.Combine(redistPath, "FrameworkList.xml"), string.Format(frameworkListXml, frameworkName));
2726File.WriteAllText(Path.Combine(asmPath, "mscorlib.dll"), string.Empty);
2997sdks["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
2999sdks["AnotherAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3027Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0")
3028+ Path.DirectorySeparatorChar;
3123string tmpRootDirectory = Path.GetTempPath();
3127string frameworkPath = Path.Combine(tmpRootDirectory, frameworkPathPattern);
3128string manifestFile = Path.Combine(frameworkPath, "SDKManifest.xml");
3130string frameworkPath2 = Path.Combine(tmpRootDirectory, frameworkPathPattern2);
3131string manifestFile2 = Path.Combine(frameworkPath, "SDKManifest.xml");
3274string manifestPath = Path.Combine(Path.GetTempPath(), "ManifestTmp");
3280string manifestFile = Path.Combine(manifestPath, "SDKManifest.xml");
3409string manifestPath = Path.Combine(Path.GetTempPath(), "ManifestTmp");
3415string manifestFile = Path.Combine(manifestPath, "SDKManifest.xml");
3539string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyGetInstalledSDKLocations");
3540string platformDirectory = Path.Combine(testDirectoryRoot, "MyPlatform", "8.0")
3541+ Path.DirectorySeparatorChar;
3542string sdkDirectory = Path.Combine(platformDirectory, "ExtensionSDKs", "SDkWithManifest", "2.0")
3543+ Path.DirectorySeparatorChar;
3571File.WriteAllText(Path.Combine(platformDirectory, "SDKManifest.xml"), "HI");
3572File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "HI");
3573string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
3608string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyGetInstalledSDKLocations2");
3609string platformDirectory = Path.Combine(testDirectoryRoot, "MyPlatform", "8.0")
3610+ Path.DirectorySeparatorChar;
3611string sdkDirectory = Path.Combine(platformDirectory, "ExtensionSDKs", "SDkWithManifest", "2.0")
3612+ Path.DirectorySeparatorChar;
3643File.WriteAllText(Path.Combine(platformDirectory, "SDKManifest.xml"), platformSDKManifestContents);
3644File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "HI");
3645string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj");
3788targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3789targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3791targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=2.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3795targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3797targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=3.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3799targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=4.0"].ShouldBe(Path.Combine(_fakeStructureRoot2, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3809targetPlatforms[key].ExtensionSDKs["AnotherAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3813targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3815targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3819targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3821targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3824targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3828targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "8.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3832targetPlatforms[key].Platforms["PlatformAssembly, Version=0.1.2.3"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3837targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "9.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
3841targetPlatforms[key].Platforms["PlatformAssembly, Version=0.1.2.3"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
4057targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
4060targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
4063targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
4066targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
4069targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase);
4103string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyFindRootFolderWhereAllFilesExist");
4104string[] rootDirectories = new string[] { Path.Combine(testDirectoryRoot, "Root1"), Path.Combine(testDirectoryRoot, "Root2") };
4109string subdir = Path.Combine(rootDirectories[i], "Subdir");
4112File.Create(Path.Combine(rootDirectories[i], "file1.txt")).Close();
4113File.Create(Path.Combine(subdir, fileInSubDir)).Close();
4415string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory");
4420Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0"));
4422Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0"));
4424Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0"));
4426Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "ExtensionSDKs", "MyAssembly", "1.0"));
4427Directory.CreateDirectory(Path.Combine(tempPath, "WindowsKits", "6.0"));
4428Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "5.0"));
4430Path.Combine(tempPath, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0"));
4432Path.Combine(tempPath, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0"));
4434Path.Combine(tempPath, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0"));
4435Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "1.0"));
4436Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "8.0"));
4438Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3"));
4440Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "1.2.3.0"));
4442Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "Sparkle", "3.3.3.3"));
4443Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "9.0"));
4445Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3"));
4446Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "9.0", "PlatformAssembly", "Sparkle"));
4448Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "Sparkle"));
4451Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"),
4454Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0", "SDKManifest.xml"),
4457Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0", "SDKManifest.xml"),
4461Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "SDKManifest.xml"),
4464Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"),
4466File.WriteAllText(Path.Combine(tempPath, "Windows", "1.0", "SDKManifest.xml"), manifestPlatformSDK1);
4467File.WriteAllText(Path.Combine(tempPath, "Windows", "2.0", "SDKManifest.xml"), manifestPlatformSDK2);
4469Path.Combine(tempPath, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0", "SDKManifest.xml"),
4471File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "3.0", "SDKManifest.xml"), manifestPlatformSDK3);
4472File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "2.0", "SDKManifest.xml"), manifestPlatformSDK4);
4474Path.Combine(tempPath, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"),
4477Path.Combine(tempPath, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"),
4479File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "1.0", "SDKManifest.xml"), manifestPlatformSDK5);
4483Path.Combine(tempPath, "MyPlatform", "8.0", "SDKManifest.xml"),
4486Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3", "Platform.xml"),
4489Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "1.2.3.0", "Platform.xml"),
4492Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "Sparkle", "3.3.3.3", "Platform.xml"),
4496File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "9.0", "SDKManifest.xml"), manifestPlatformSDK7);
4498Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3", "Platform.xml"),
4501Path.Combine(tempPath, "MyPlatform", "9.0", "PlatformAssembly", "Sparkle", "Platform.xml"),
4504Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "Sparkle", "Platform.xml"),
4507Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "Sparkle", "3.3.3.3")); // no platform.xml
4511Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "AnotherAssembly", "v1.1"));
4514Directory.CreateDirectory(Path.Combine(tempPath, "Windows", "v3.0") + Path.DirectorySeparatorChar);
4518Path.Combine(tempPath, "Windows", "NotAVersion") + Path.DirectorySeparatorChar);
4522Path.Combine(tempPath, "Windows", "NotAVersion", "ExtensionSDKs", "Assembly", "1.0"));
4538string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory2");
4543Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0"));
4545Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0"));
4547Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0"));
4550Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"),
4553Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0", "SDKManifest.xml"),
4556Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0", "SDKManifest.xml"),
ToolTask_Tests.cs (17)
42_fullToolName = Path.Combine(
80protected override string ToolName => Path.GetFileName(_fullToolName);
169t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.IsWindows ? "attrib.exe" : "ps");
428t.PathToToolUsed.ShouldBe(Path.Combine(systemPath, shellName));
434t.PathToToolUsed.ShouldBe(Path.Combine(systemPath, copyName));
479Path.Combine(systemPath, toolName));
729env.SetEnvironmentVariable("PATH", $"{tempDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
732string directoryNamedSameAsTool = Directory.CreateDirectory(Path.Combine(tempDirectory, toolName)).FullName;
764expectedCmdPath = new[] { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe").ToUpperInvariant() };
1132: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "ping.exe");
1160protected override string ToolName => Path.GetFileName(_pathToTool);
1259protected override string ToolName => Path.GetFileName(_fullToolName);
1349string expected = Path.Combine(projectDir, "subdir");
1455File.WriteAllText(Path.Combine(tempDir, toolName), "dummy");
1475result.ShouldBe(Path.Combine(tempDir, toolName));
1485string fullPath = Path.Combine(projectDir, fileName);
1558string toolFullPath = Path.Combine(toolDir, toolName);
Microsoft.Cci.Extensions (9)
Microsoft.CodeAnalysis (78)
Microsoft.CodeAnalysis.Analyzers (38)
Microsoft.CodeAnalysis.AnalyzerUtilities (26)
Microsoft.CodeAnalysis.BannedApiAnalyzers (29)
Microsoft.CodeAnalysis.CodeStyle (21)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.Collections.Package (1)
Microsoft.CodeAnalysis.Contracts.Package (1)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (28)
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")));
2013Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2026Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2033Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2100Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.PdbPath);
2101Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2105Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.PdbPath);
2106Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2113Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2117Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll"));
2152Assert.Equal(Path.Combine(Path.GetPathRoot(WorkingDirectory), @"MyFolder\MyPdb.pdb"), parsedArgs.PdbPath);
2216Assert.Equal(Path.Combine(WorkingDirectory, "sl.json"), parsedArgs.SourceLink);
2220Assert.Equal(Path.Combine(WorkingDirectory, "sl.json"), parsedArgs.SourceLink);
2224Assert.Equal(Path.Combine(WorkingDirectory, "s l.json"), parsedArgs.SourceLink);
2258var peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe"));
2290var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"));
2319var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"));
2338new[] { "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2344new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2350new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2356new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2362new[] { "a,b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2368new[] { "a.txt", "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)),
2482using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe"))))
2489MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))))
2517symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")));
2547var name = Path.GetFileName(file);
2888Diagnostic(ErrorCode.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah"), "File not found."));
2889Assert.Equal(expected: Path.Combine(TempRoot.Root, "blah"), actual: parsedArgs.RuleSetPath);
2893Diagnostic(ErrorCode.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah;blah.ruleset"), "File not found."));
2894Assert.Equal(expected: Path.Combine(TempRoot.Root, "blah;blah.ruleset"), actual: parsedArgs.RuleSetPath);
3596" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3597" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3619" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context
3623" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3624" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3631" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context
3799Assert.Equal(Path.Combine(baseDirectory, "MyBinary.dll"), parsedArgs.GetOutputFilePath(parsedArgs.OutputFileName));
4110Assert.Equal(Path.Combine(baseDirectory, "MyBinary.xml"), parsedArgs.DocumentationPath);
4214Assert.Equal(Path.Combine(baseDirectory, "MyBinary.xml"), parsedArgs.ErrorLogOptions.Path);
4335var srcDirectory = Path.GetDirectoryName(srcFile.Path);
4368var srcDirectory = Path.GetDirectoryName(srcFile.Path);
4369string root = Path.GetPathRoot(srcDirectory); // Make sure we pick a drive that exists and is plugged in to avoid 'Drive not ready'
4505using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe"))))
5661Assert.Equal(Path.Combine(WorkingDirectory, "test.snk"), parsedArgs.CompilationOptions.CryptoKeyFile);
5925var baseDir = Path.GetDirectoryName(source);
5962var baseDir = Path.GetDirectoryName(source2);
5982var baseDir = Path.GetDirectoryName(source2);
5993Assert.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());
6075var assemblyName = AssemblyName.GetAssemblyName(Path.Combine(tempDir, name));
6511baseDirectory: Path.DirectorySeparatorChar == '\\' ? @"c:\" : "/");
7095using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName))))
7814Path.GetFileName(sourceFile.Path),
7824string.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)),
7825Path.GetFileName(sourceFile.Path),
7834IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002);
8022outWriter.ToString().Replace(Path.GetFileName(src.Path), "{FILE}").Trim());
8270Assert.True(File.Exists(Path.Combine(dir.ToString(), "a.xml")));
8403var baseDir = Path.GetDirectoryName(source);
8404var fileName = Path.GetFileName(source);
8462CleanupAllGeneratedFiles(Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(source)), Path.GetFileName(source)));
8540var baseDir = Path.GetDirectoryName(source);
8541var fileName = Path.GetFileName(source);
8546Assert.Equal(Path.GetFileName(source) + "(7,17): warning CS1634: Expected 'disable' or 'restore'", outWriter.ToString().Trim());
8554exitCode = CreateCSharpCompiler(null, baseDir, new[] { "/nologo", "/preferreduilang:en", Path.Combine(baseDir, "nonexistent.cs"), source.ToString() }).Run(outWriter);
8556Assert.Equal("error CS2001: Source file '" + Path.Combine(baseDir, "nonexistent.cs") + "' could not be found.", outWriter.ToString().Trim());
8579var baseDir = Path.GetDirectoryName(source);
8580var fileName = Path.GetFileName(source);
8603var baseDir = Path.GetDirectoryName(source);
8604var fileName = Path.GetFileName(source);
8637var baseDir = Path.GetDirectoryName(source);
8638var fileName = Path.GetFileName(source);
8657var baseDir = Path.GetDirectoryName(source);
8658var fileName = Path.GetFileName(source);
8683var baseDir = Path.GetDirectoryName(source);
8684var fileName = Path.GetFileName(source);
8710var baseDir = Path.GetDirectoryName(source);
8711var fileName = Path.GetFileName(source);
8718System.IO.File.Delete(System.IO.Path.Combine(baseDir, "goo.dll"));
8865AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
8922AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
8963AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order());
8997var exePath = Path.Combine(Path.GetDirectoryName(srcPath), "test.exe");
9019var exePath = Path.Combine(Path.GetDirectoryName(srcPath), "test.exe");
9020var pdbPath = Path.ChangeExtension(exePath, "pdb");
9042var xmlPath = Path.Combine(Path.GetDirectoryName(srcPath), "test.xml");
9066var sourceLinkPath = Path.Combine(Path.GetDirectoryName(srcPath), "test.json");
9094string exePath = Path.Combine(Path.GetDirectoryName(sourcePath), "test.exe");
9119string exePath = Path.Combine(Path.GetDirectoryName(sourcePath), "test.exe");
9120string pdbPath = Path.ChangeExtension(exePath, ".pdb");
9145string xmlPath = Path.Combine(WorkingDirectory, "Test.xml");
9248string xmlPath = Path.Combine(WorkingDirectory, "Test.xml");
9444var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9476var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9503var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9563var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9596var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9636workingDirectory: Path.GetDirectoryName(srcFile.Path),
9656var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9681var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9703var srcDirectory = Path.GetDirectoryName(srcFile.Path);
9731var expectedPath = Path.GetDirectoryName(WorkingDirectory);
9952Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles.Single().Path);
9957Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9958Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
9963Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9964Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[1].Path);
9968Assert.Equal(Path.Combine(WorkingDirectory, "..\\web.config"), args.AdditionalFiles.Single().Path);
9978Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path);
9979Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path);
9980Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path);
9985Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9986Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
9991Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9992Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
9997Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path);
9998Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path);
10003Assert.Equal(Path.Combine(WorkingDirectory, "web.config,app.manifest"), args.AdditionalFiles[0].Path);
10008Assert.Equal(Path.Combine(WorkingDirectory, "web.config:app.manifest"), args.AdditionalFiles[0].Path);
10024Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths.Single());
10029Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]);
10030Assert.Equal(Path.Combine(WorkingDirectory, "subdir\\.editorconfig"), args.AnalyzerConfigPaths[1]);
10035Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]);
10036Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[1]);
10040Assert.Equal(Path.Combine(WorkingDirectory, "..\\.editorconfig"), args.AnalyzerConfigPaths.Single());
10045Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]);
10046Assert.Equal(Path.Combine(WorkingDirectory, "subdir\\.editorconfig"), args.AnalyzerConfigPaths[1]);
10126string fileName = Path.GetFileName(filePath);
11446Assert.True(File.Exists(Path.Combine(dir.ToString(), "doc.xml")));
11461using (var reader = new StreamReader(Path.Combine(dir.ToString(), "doc.xml")))
11467output = ProcessUtilities.RunAndGetOutput(Path.Combine(dir.ToString(), "out.exe"), startFolder: dir.ToString());
11484Assert.Equal(Path.Combine(baseDirectory, @"a.pdb"), args.PdbPath);
11517AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11521AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "@script.csx") }, args.SourceFiles.Select(f => f.Path));
11525AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "-script.csx") }, args.SourceFiles.Select(f => f.Path));
11529AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11533AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11537AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11542AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11547AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path));
11552AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "--") }, args.SourceFiles.Select(f => f.Path));
11671var dir = Path.Combine(WorkingDirectory, "a");
11674Assert.Equal(Path.Combine(dir, @"data.pdb"), parsedArgs.PdbPath);
11697var exePath = Path.Combine(dir.Path, "a.exe");
11709var pdbPath = Path.Combine(dir.Path, "a.pdb");
11716var pdbPath = Path.Combine(dir.Path, "a.pdb");
11723var pdbPath = Path.Combine(dir.Path, "a.pdb");
11731var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb");
11739var pdbPath = Path.Combine(dir.Path, "a.pdb");
11746var pdbPath = Path.Combine(dir.Path, "a.pdb");
11753var pdbPath = Path.Combine(dir.Path, "a.pdb");
11816dir.CopyFile(Path.ChangeExtension(s_CSharpCompilerExecutable, ".exe.config"), "csc32.exe.config");
11817dir.CopyFile(Path.Combine(Path.GetDirectoryName(s_CSharpCompilerExecutable), "csc.rsp"));
11878var exe = Path.Combine(dir.Path, "a.exe");
11887var doc = Path.Combine(dir.Path, "doc.xml");
11911var refDll = Path.Combine(refDir.Path, "a.dll");
11942var dll = Path.Combine(dir.Path, "a.dll");
11945var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll"));
11994var refDll = Path.Combine(dir.Path, "a.dll");
12005var pdb = Path.Combine(dir.Path, "a.pdb");
12008var doc = Path.Combine(dir.Path, "doc.xml");
12309var cscDir = Path.GetDirectoryName(s_CSharpCompilerExecutable);
12314var fileName = Path.GetFileName(filePath);
12326var cscCopy = Path.Combine(dir.Path, "csc.exe");
12370var exePath = Path.Combine(dir.Path, "a.exe");
13558string binaryPath = Path.Combine(dir.Path, "temp.dll");
13561string pdbPath = Path.Combine(dir.Path, pdbName);
13564string xmlDocFilePath = Path.Combine(dir.Path, docName);
13604string binaryPath = Path.Combine(dir.Path, "temp.dll");
13607string pdbPath = Path.Combine(dir.Path, pdbName);
13610string xmlDocFilePath = Path.Combine(dir.Path, docName);
13654string binaryPath = Path.Combine(dir.Path, "temp.dll");
13657string pdbPath = Path.Combine(dir.Path, pdbName);
13660string xmlDocFilePath = Path.Combine(dir.Path, docName);
13685string binaryPath = Path.Combine(dir.Path, "temp.dll");
14003ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
14044ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14087{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1},
14088{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2},
14105var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14106var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14125using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb")))
14147var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14148var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14167using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb")))
14214{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14238ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14245ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14308var generatedPath = Path.Combine(subdir, generatedFileName);
14316{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14347var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll");
14351options: TestOptions.DebugDll.WithCryptoKeyFile(Path.GetFileName(snk.Path)).WithStrongNameProvider(virtualSnProvider),
14369{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14403var generatedDirPath = Path.Combine(dir.Path, "noexist");
14431ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14442string baseDirectory = Path.Combine(root, "abc", "def");
14458Assert.Equal(Path.Combine(baseDirectory, "outdir"), parsedArgs.GeneratedFilesOutputDirectory);
14462Assert.Equal(Path.Combine(baseDirectory, "outdir"), parsedArgs.GeneratedFilesOutputDirectory);
14466Assert.Equal(Path.Combine(baseDirectory, "out dir"), parsedArgs.GeneratedFilesOutputDirectory);
14470Assert.Equal(Path.Combine(baseDirectory, "out dir"), parsedArgs.GeneratedFilesOutputDirectory);
14472var absPath = Path.Combine(root, "outdir");
14481absPath = Path.Combine(root, "generated files");
14525string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write"));
15520var generatorPath = Path.Combine(directory.Path, "generator.dll");
15556Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1)));
15557Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2)));
15563string 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 (85)
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 (36)
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 (25)
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"))
680var newRefOutPath = Path.Combine(TempRoot.Root, "newRef");
982var designTimeOnlyFilePath = Path.Combine(dir.Path, designTimeOnlyFileName);
2286var pathA = Path.Combine(TempRoot.Root, "A.cs");
2287var pathB = Path.Combine(TempRoot.Root, "B.cs");
2288var pathC = Path.Combine(TempRoot.Root, "C.cs");
2289var pathD = Path.Combine(TempRoot.Root, "D.cs");
2290var pathX = Path.Combine(TempRoot.Root, "X");
2291var pathY = Path.Combine(TempRoot.Root, "Y");
2292var pathCommon = Path.Combine(TempRoot.Root, "Common.cs");
2364var pathX = Path.Combine(TempRoot.Root, "X.cs");
2365var pathA = Path.Combine(TempRoot.Root, "A.cs");
2545var pathA = Path.Combine(TempRoot.Root, "A.txt");
2623var sourcePath = Path.Combine(TempRoot.Root, "A.cs");
3995var generatedFilePath = Path.Combine(
4367AddDocument("DocB", source1, filePath: Path.Combine(TempRoot.Root, "DocB.cs")).Project;
4874var filePath = withPath ? Path.Combine(TempRoot.Root, "test.cs") : null;
EditAndContinue\EmitSolutionUpdateResultsTests.cs (5)
69var sourcePath = Path.Combine(TempRoot.Root, "x", "a.cs");
70var razorPath1 = Path.Combine(TempRoot.Root, "x", "a.razor");
71var razorPath2 = Path.Combine(TempRoot.Root, "a.razor");
76AddDocument(sourcePath, SourceText.From("class C {}", Encoding.UTF8), filePath: Path.Combine(TempRoot.Root, sourcePath));
109DiagnosticDataLocation.TestAccessor.Create(new(sourcePath, new(0, 0), new(0, 5)), document.Id, new(Path.Combine("..", "a.razor"), new(10, 10), new(10, 15)), forceMappedPath: true),
Microsoft.CodeAnalysis.InteractiveHost (25)
Microsoft.CodeAnalysis.LanguageServer (53)
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (42)
Diagnostics\AdditionalFileDiagnosticsTests.cs (16)
38var projFilePath = Path.Combine(testRoot, "CSProj1.csproj");
39var csFilePath = Path.Combine(testRoot, "C.cs");
40var xamlFilePath = Path.Combine(testRoot, "Test.xaml");
69var projFilePath = Path.Combine(testRoot, "CSProj1.csproj");
70var csFilePath = Path.Combine(testRoot, "C.cs");
71var txtFilePath = Path.Combine(testRoot, "Test.txt");
102var projFilePath = Path.Combine(testRoot, "CSProj1.csproj");
103var csFilePath = Path.Combine(testRoot, "C.cs");
104var txtFilePath = Path.Combine(testRoot, "Test.txt");
142var projFilePath = Path.Combine(testRoot, "CSProj1.csproj");
143var csFilePathA = Path.Combine(testRoot, "A.cs");
144var csFilePathB = Path.Combine(testRoot, "B.cs");
145var txtFilePath = Path.Combine(testRoot, "Test.txt");
182var projFilePath = Path.Combine(testRoot, "CSProj1.csproj");
183var csFilePath = Path.Combine(testRoot, "C.cs");
184var additionaFilePath = Path.Combine(testRoot, "File.razor");
Diagnostics\PullDiagnosticTests.cs (7)
1488var documentPath = Path.Combine(testRoot, "file.cs");
1489var globalConfigPath = Path.Combine(testRoot, ".globalconfig");
1490var editorConfigPath = Path.Combine(testRoot, ".editorconfig");
1745Assert.Equal(ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(TestWorkspace.RootDirectory, "test1.cs")), results[0].TextDocument!.DocumentUri);
2163ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(TestWorkspace.RootDirectory, "C.cs")),
2164ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(TestWorkspace.RootDirectory, "CSProj1.csproj")),
2165ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(TestWorkspace.RootDirectory, "C2.cs"))
Microsoft.CodeAnalysis.LanguageServer.UnitTests (141)
DefaultFileChangeWatcherTests.cs (49)
50var nonExistentPath = Path.Combine(TempRoot.Root, "NonExistent", "Directory", Guid.NewGuid().ToString());
119var filePath = Path.Combine(tempDirectory.Path, "test.cs");
134var filePath = Path.Combine(otherDir.Path, "test.cs");
148var filePath = Path.Combine(tempDirectory.Path, "test.txt");
163var filePath = Path.Combine(tempDirectory.Path, "test.cs");
183using var watchedFile1 = context.EnqueueWatchingFile(Path.Combine(tempDirectory.Path, "a.cs"));
184using var watchedFile2 = context.EnqueueWatchingFile(Path.Combine(tempDirectory.Path, "b.cs"));
199var filePath = Path.Combine(tempDirectory.Path, "multi.txt");
218var filePath = Path.Combine(subDirectory.Path, "nested.cs");
232var nonExistentPath = Path.Combine(TempRoot.Root, "NonExistent", "file.cs");
243var csFilePath = Path.Combine(tempDirectory.Path, "test.cs");
244var vbFilePath = Path.Combine(tempDirectory.Path, "test.vb");
245var txtFilePath = Path.Combine(tempDirectory.Path, "test.txt");
269var filePath = Path.Combine(level3.Path, "deep.cs");
285var filePath = Path.Combine(siblingDir.Path, "test.cs");
300var filePath = Path.Combine(rootDir.Path, "test.cs");
314var filePath = Path.Combine(tempDirectory.Path, "test.txt");
341context.EnqueueWatchingFile(Path.Combine(seed.Path, "seed.cs"));
344context.EnqueueWatchingFile(Path.Combine(pairA.Path, "one.cs"));
345context.EnqueueWatchingFile(Path.Combine(pairB.Path, "two.cs"));
346context.EnqueueWatchingFile(Path.Combine(other.Path, "three.cs"));
365var file1 = context1.EnqueueWatchingFile(Path.Combine(root.Path, "extra.txt"));
366var file2 = context2.EnqueueWatchingFile(Path.Combine(root.Path, "extra2.log"));
387_ = context.EnqueueWatchingFile(Path.Combine(root.Path, "extra.txt"));
436var filePath = Path.Combine(tempDirectory.Path, "created.cs");
456var filePath = Path.Combine(tempDirectory.Path, "modified.cs");
476var filePath = Path.Combine(tempDirectory.Path, "deleted.cs");
496var filePath = Path.Combine(tempDirectory.Path, "filtered.cs");
513var txtFilePath = Path.Combine(tempDirectory.Path, "filtered.txt");
534var filePath = Path.Combine(subDirectory.Path, "nested.cs");
551var filePath = Path.Combine(tempDirectory.Path, "individual.txt");
572var filePath = Path.Combine(tempDirectory.Path, "individual_modify.txt");
596var csharpFilePath = Path.Combine(tempDirectory.Path, "created.cs");
597var visualBasicFilePath = Path.Combine(tempDirectory.Path, "created.vb");
622var filePath = Path.Combine(tempDirectory.Path, "disposed.txt");
654var file1 = Path.Combine(tempDirectory.Path, "file1.cs");
655var file2 = Path.Combine(tempDirectory.Path, "file2.cs");
656var file3 = Path.Combine(tempDirectory.Path, "file3.cs");
680var nonExistentDir = Path.Combine(root.Path, "not_yet_created");
681var filePath = Path.Combine(nonExistentDir, "new_file.cs");
710var originalPath = Path.Combine(tempDirectory.Path, "original.cs");
711var renamedPath = Path.Combine(tempDirectory.Path, "renamed.cs");
730var originalPath = Path.Combine(tempDirectory.Path, "original.cs");
731var renamedPath = Path.Combine(tempDirectory.Path, "renamed.cs");
773string pathWithExtraSeparators = tempDirectory.Path.Replace(Path.DirectorySeparatorChar.ToString(), Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar);
813var filePath = Path.Combine(tempDirectory.Path, "test.cs");
836var filePath = Path.Combine(tempDirectory.Path, "test.cs");
FileBasedProgramsEntryPointDiscoveryTests.cs (72)
420Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub1"));
421File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/File1.cs"), FbaContent);
422File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/File2.cs"), OrdinaryCsContent);
428File.Move(Path.Combine(tempDir.Path, @"sub1/File1.cs"), Path.Combine(tempDir.Path, @"sub1/File4.cs"));
429File.Move(Path.Combine(tempDir.Path, @"sub1/File2.cs"), Path.Combine(tempDir.Path, @"sub1/File1.cs"));
454Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub1"));
455File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/File1.cs"), OrdinaryCsContent);
456File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/File2.cs"), FbaContent);
462File.Move(Path.Combine(tempDir.Path, @"sub1/File1.cs"), Path.Combine(tempDir.Path, @"sub1/File4.cs"));
463File.Move(Path.Combine(tempDir.Path, @"sub1/File2.cs"), Path.Combine(tempDir.Path, @"sub1/File1.cs"));
488Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub1"));
489Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub2"));
490File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/File1.cs"), FbaContent);
491File.WriteAllText(Path.Combine(tempDir.Path, @"sub2/File1.cs"), OrdinaryCsContent);
497Directory.Move(Path.Combine(tempDir.Path, @"sub1"), Path.Combine(tempDir.Path, @"sub4"));
498Directory.Move(Path.Combine(tempDir.Path, @"sub2"), Path.Combine(tempDir.Path, @"sub1"));
523Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub1"));
524Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub2"));
525File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/File1.cs"), OrdinaryCsContent);
526File.WriteAllText(Path.Combine(tempDir.Path, @"sub2/File1.cs"), FbaContent);
532Directory.Move(Path.Combine(tempDir.Path, @"sub1"), Path.Combine(tempDir.Path, @"sub4"));
533Directory.Move(Path.Combine(tempDir.Path, @"sub2"), Path.Combine(tempDir.Path, @"sub1"));
557File.WriteAllText(Path.Combine(tempDir.Path, @"Fba0.cs"), FbaContent);
558File.WriteAllText(Path.Combine(tempDir.Path, @"Fba1.cs"), FbaContent);
559File.WriteAllText(Path.Combine(tempDir.Path, @"Ordinary2.cs"), OrdinaryCsContent);
565File.WriteAllText(Path.Combine(tempDir.Path, @"New102.csproj"), CsprojContent);
566File.Delete(Path.Combine(tempDir.Path, @"Fba0.cs"));
567File.WriteAllText(Path.Combine(tempDir.Path, @"NewOrd22.cs"), OrdinaryCsContent);
568File.WriteAllText(Path.Combine(tempDir.Path, @"Ordinary2.cs"), OrdinaryCsContent);
569File.WriteAllText(Path.Combine(tempDir.Path, @"Ordinary2.cs"), FbaContent);
570File.WriteAllText(Path.Combine(tempDir.Path, @"NewOrd5.cs"), OrdinaryCsContent);
571File.WriteAllText(Path.Combine(tempDir.Path, @"New79.csproj"), CsprojContent);
595File.WriteAllText(Path.Combine(tempDir.Path, @"Fba0.cs"), FbaContent);
596Directory.CreateDirectory(Path.Combine(tempDir.Path, @"deep/nested"));
597File.WriteAllText(Path.Combine(tempDir.Path, @"deep/nested/Fba1.cs"), FbaContent);
598Directory.CreateDirectory(Path.Combine(tempDir.Path, @"deep/nested"));
599File.WriteAllText(Path.Combine(tempDir.Path, @"deep/nested/Project2.csproj"), CsprojContent);
600File.WriteAllText(Path.Combine(tempDir.Path, @"Project3.csproj"), CsprojContent);
601Directory.CreateDirectory(Path.Combine(tempDir.Path, @"deep/nested/sub3"));
607File.WriteAllText(Path.Combine(tempDir.Path, @"NewOrd40.cs"), OrdinaryCsContent);
608File.WriteAllText(Path.Combine(tempDir.Path, @"deep/nested/sub3/New52.csproj"), CsprojContent);
609File.WriteAllText(Path.Combine(tempDir.Path, @"deep/nested/NewOrd20.cs"), OrdinaryCsContent);
610File.WriteAllText(Path.Combine(tempDir.Path, @"deep/nested/Fba1.cs"), OrdinaryCsContent);
634Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub1"));
635Directory.CreateDirectory(Path.Combine(tempDir.Path, @"sub1/sub3"));
636File.WriteAllText(Path.Combine(tempDir.Path, @"Project0.csproj"), CsprojContent);
637File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/sub3/Fba1.cs"), FbaContent);
638File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/Fba2.cs"), FbaContent);
639File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/Fba3.cs"), FbaContent);
640File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/Ordinary4.cs"), OrdinaryCsContent);
646File.Delete(Path.Combine(tempDir.Path, @"Project0.csproj"));
647File.WriteAllText(Path.Combine(tempDir.Path, @"sub1/sub3/NewFba64.cs"), FbaContent);
740public string FullPath(string relativePath) => Path.Combine(_rootPath, relativePath);
775private static readonly string[] s_dirNames = ["sub1", "sub2", "sub3", "deep" + Path.DirectorySeparatorChar + "nested"];
789var relativePath = parentDir.Length == 0 ? name : Path.Combine(parentDir, name);
7980 => new FuzzOp.WriteFbaFile(Path.Combine(dir, $"Fba{fileIndex}.cs")),
7991 => new FuzzOp.WriteOrdinaryCs(Path.Combine(dir, $"Ordinary{fileIndex}.cs")),
8002 => new FuzzOp.WriteCsproj(Path.Combine(dir, $"Project{fileIndex}.csproj")),
801_ => new FuzzOp.WriteFbaFile(Path.Combine(dir, $"Fba{fileIndex}.cs")),
824var newPath = Path.Combine(dir, "moved_" + Path.GetFileName(oldPath));
831return new FuzzOp.WriteFbaFile(Path.Combine(dirList[random.Next(dirList.Length)], $"NewFba{workspace.Files.Count + random.Next(100)}.cs"));
834return new FuzzOp.WriteOrdinaryCs(Path.Combine(dirList[random.Next(dirList.Length)], $"NewOrd{workspace.Files.Count + random.Next(100)}.cs"));
837return new FuzzOp.WriteCsproj(Path.Combine(dirList[random.Next(dirList.Length)], $"New{workspace.Files.Count + random.Next(100)}.csproj"));
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (28)
Microsoft.CodeAnalysis.PooledObjects.Package (1)
Microsoft.CodeAnalysis.PublicApiAnalyzers (27)
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (3)
Microsoft.CodeAnalysis.Razor.Compiler (11)
Microsoft.CodeAnalysis.Razor.Workspaces (33)
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.Razor (13)
Microsoft.CodeAnalysis.Remote.Razor.UnitTests (9)
Microsoft.CodeAnalysis.Remote.ServiceHub (9)
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (3)
Microsoft.CodeAnalysis.Remote.Workspaces (4)
Microsoft.CodeAnalysis.ResxSourceGenerator (32)
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 (68)
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 (35)
FileSystem\PathUtilitiesTests.cs (5)
22var dotnetName = Path.GetDirectoryName(fullPath);
123: Path.Combine(expectedParentPath, directoryName);
392Assert.Equal(Path.Combine(path1, path2), PathUtilities.CombinePaths(path1, path2));
409Assert.Equal(Path.Combine(path1, path2), PathUtilities.CombinePaths(path1, path2));
421Assert.Equal(Path.Combine(path1, path2), PathUtilities.CombinePaths(path1, path2));
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 (20)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (10)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (70)
NetCoreTests.cs (19)
44var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe");
57RunDotNet($@"msbuild ""{normalizedPath}"" /t:restore /bl:{Path.Combine(SolutionDirectory.Path, "restore.binlog")}");
63var arguments = $@"msbuild ""{normalizedPath}"" /bl:{Path.Combine(SolutionDirectory.Path, "build.binlog")}";
81var projectDir = Path.GetDirectoryName(projectFilePath);
88Assert.Equal(Path.Combine(projectDir, "bin", "Debug", "netcoreapp3.1", "Project.dll"), project.OutputFilePath);
89Assert.Equal(Path.Combine(projectDir, "obj", "Debug", "netcoreapp3.1", "Project.dll"), project.CompilationOutputInfo.AssemblyPath);
110var projectDir = Path.GetDirectoryName(projectFilePath);
111var binLogPath = Path.Combine(projectDir, "build.binlog");
135var projectDir = Path.GetDirectoryName(projectFilePath);
143Assert.Equal(Path.Combine(projectDir, "bin", "Debug", "netcoreapp3.1", "Project.dll"), projectFileInfo.OutputFilePath);
452Assert.Contains(fsharpLib.MetadataReferences, r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "FSharp.Core.dll");
455Assert.EndsWith(Path.Combine("obj", "Debug", "netstandard2.0", "fsharplib.dll"), fsharpLib.CompilationOutputInfo.AssemblyPath);
458var libraryFs = fsharpLib.Documents.Single(d => Path.GetFileName(d.FilePath) == "Library.fs");
476var reference = compilation.References.Single(r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "fsharplib.dll");
521Assert.Contains(fsharpProj.MetadataReferences, r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "FSharp.Core.dll");
522Assert.Contains(fsharpProj.Documents, d => Path.GetFileName(d.FilePath) == "Library.fs");
527Assert.Contains(csharpProj.MetadataReferences, r => r is PortableExecutableReference per && Path.GetFileName(per.FilePath) == "FSharp.Core.dll");
528Assert.Contains(csharpProj.Documents, d => Path.GetFileName(d.FilePath) == "Class1.cs");
664var 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 (75)
CommandLineProject\CommandLineProjectTests.cs (12)
24var commandLine = Path.Combine("..", "goo.cs");
65var commandLine = Path.Combine("subdir", "goo.cs");
78var commandLine = Path.Combine(baseDir, "goo.cs");
90var commandLine = Path.Combine(baseDir, "subdir", "goo.cs");
113var commandLine = Path.Combine("..", "goo.cs");
142Assert.Equal(Path.Combine(baseDir, ".editorconfig"), document.FilePath);
149var assemblyBaseDir = Path.GetDirectoryName(pathToAssembly);
150var relativePath = Path.Combine(".", Path.GetFileName(pathToAssembly));
164var assemblyBaseDir = Path.GetDirectoryName(pathToAssembly);
165var relativePath = Path.Combine(".", Path.GetFileName(pathToAssembly));
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));
UtilityTest\FilePathUtilitiesTests.cs (6)
33Assert.Equal(expected: Path.Combine("Delta", "Doc.txt"), actual: result);
44Assert.Equal(expected: Path.Combine("Delta", "Epsilon", "Doc.txt"), actual: result);
55Assert.Equal(expected: Path.Combine("..", "Doc.txt"), actual: result);
66Assert.Equal(expected: Path.Combine("..", "..", "Doc.txt"), actual: result);
77Assert.Equal(expected: Path.Combine("..", "..", "Phi", "Omega", "Doc.txt"), actual: result);
99Assert.Equal(expected: Path.Combine("..", "Beta2", "Gamma"), actual: result);
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
Microsoft.Data.Analysis.Tests (7)
Microsoft.DotNet.Arcade.Sdk (20)
src\InstallDotNetCore.cs (5)
260dotnetRoot = Path.Combine(dotnetRoot, architecture.ToLowerInvariant());
265"dotnet" => Path.Combine(dotnetRoot, "shared", "Microsoft.NETCore.App", version),
266"aspnetcore" => Path.Combine(dotnetRoot, "shared", "Microsoft.AspNetCore.App", version),
267"windowsdesktop" => Path.Combine(dotnetRoot, "shared", "Microsoft.WindowsDesktop.App", version),
268_ => Path.Combine(dotnetRoot, "shared", version)
Microsoft.DotNet.Arcade.Sdk.Tests (35)
CentralPackageManagementTests.cs (12)
35var directoryPackagesPropsPath = Path.Combine(s_repoRoot, "Directory.Packages.props");
43var sdkToolsDir = Path.Combine(s_repoRoot, "src", "Microsoft.DotNet.Arcade.Sdk", "tools");
64$" - '{c.packageId}' (implicit in {Path.GetRelativePath(s_repoRoot, c.file)})")));
90string? directory = Path.GetDirectoryName(xmlFile);
107string importPath = Path.GetFullPath(Path.Combine(directory, project));
149if (File.Exists(Path.Combine(dir, "Directory.Packages.props")) &&
150Directory.Exists(Path.Combine(dir, "src", "Microsoft.DotNet.Arcade.Sdk")))
154dir = Path.GetDirectoryName(dir);
160if (File.Exists(Path.Combine(dir, "Directory.Packages.props")) &&
161Directory.Exists(Path.Combine(dir, "src", "Microsoft.DotNet.Arcade.Sdk")))
165dir = Path.GetDirectoryName(dir);
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 (61)
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 (75)
Verification\ArchiveVerifier.cs (11)
84Path.GetDirectoryName(svr.FullPath) ?? SignCheckResources.NA,
108Path.Combine(svr.VirtualPath, archiveEntry.RelativePath));
122CreateDirectory(Path.GetDirectoryName(aliasFullName));
136Path.Combine(svr.VirtualPath, fullName), fullName);
141archiveMap[fullName], svr.VirtualPath, Path.Combine(svr.VirtualPath, fullName), e);
153string parent = Path.GetDirectoryName(svr.FullPath) ?? SignCheckResources.NA;
187string directoryName = Path.GetDirectoryName(archiveEntry.RelativePath);
190string extension = Path.GetExtension(archiveEntry.RelativePath);
193string aliasFileName = String.Equals(extension.ToLowerInvariant(), ".cab") ? Path.GetFileName(archiveEntry.RelativePath) :
194Utils.GetHash(archiveEntry.RelativePath, HashAlgorithmName.SHA256.Name) + Path.GetExtension(archiveEntry.RelativePath); // lgtm [cs/zipslip] Archive from trusted source
196return Path.Combine(tempPath, hashedPath, aliasFileName);
Verification\MsiVerifier.cs (5)
42string name = key + Path.GetExtension(installPackage.Files[key].TargetName);
43string targetPath = Path.Combine(svr.TempPath, name);
57SignatureVerificationResult packageFileResult = VerifyFile(installPackage.Files[key].TargetPath, svr.Filename, Path.Combine(svr.VirtualPath, originalFiles[key]), containerPath: null);
84string binaryFilePath = Path.Combine(svr.TempPath, binaryFile);
86SignatureVerificationResult binaryStreamResult = VerifyFile(binaryFilePath, svr.Filename, Path.Combine(svr.VirtualPath, binaryFile), containerPath: null);
Microsoft.DotNet.SignCheckTask (15)
Microsoft.DotNet.SignTool (101)
Microsoft.DotNet.SignTool.Tests (186)
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.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)
18private static string _assemblyLocation = Path.GetDirectoryName(_assembly.Location);
37var directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "build"));
40file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true);
42directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "build"));
45file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true);
49directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "files"));
52file.CopyTo(Path.Combine(files.Root, file.Name), overwrite: true);
59file.CopyTo(Path.Combine(tasks.Root, file.Name), overwrite: true);
79Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "azureMonitorClient.cs")}", process.Output);
80Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output);
102Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output);
103Assert.Contains($"TypeScriptCompile: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output);
122Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "azureMonitorClient.cs")}", process.Output);
123Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "NSwagClient.cs")}", process.Output);
124Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "swashbuckleClient.cs")}", process.Output);
125Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output);
126Assert.Contains($"FileWrites: {Path.Combine("obj", "NSwagClient.cs")}", process.Output);
127Assert.Contains($"FileWrites: {Path.Combine("obj", "swashbuckleClient.cs")}", process.Output);
148Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}", process.Output);
149Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}", process.Output);
151$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}",
154$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}",
177$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
179$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
202$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
204$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
227$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
229$"Options: '' OutputPath: '{Path.Combine("generated", "azureMonitorClient.cs")}'",
254$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
256$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
279$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
281$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'",
304$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
306$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
329$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
331$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
356$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
358$"Options: '' OutputPath: '{Path.Combine("obj", "Custom.cs")}'",
380$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
382$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
386$"{Path.Combine(_temporaryDirectory.Root, "files", "NSwag.json")} " +
388$"Options: '' OutputPath: '{Path.Combine("obj", "NSwagClient.cs")}'",
392$"{Path.Combine(_temporaryDirectory.Root, "files", "swashbuckle.json")} " +
394$"Options: '' OutputPath: '{Path.Combine("obj", "swashbuckleClient.cs")}'",
421$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
423$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'",
427$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " +
429$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'",
Microsoft.Extensions.ApiDescription.Tool.Tests (59)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
Microsoft.Extensions.Configuration.FileExtensions (4)
Microsoft.Extensions.Configuration.UserSecrets (4)
Microsoft.Extensions.DataIngestion.Abstractions (1)
Microsoft.Extensions.DataIngestion.MarkItDown (3)
Microsoft.Extensions.DataIngestion.Tests (13)
Microsoft.Extensions.DependencyModel (21)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.FileProviders.Embedded (9)
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
Microsoft.Extensions.FileProviders.Physical (26)
Microsoft.Extensions.FileSystemGlobbing (29)
InMemoryDirectoryInfo.cs (24)
18private static readonly char[] DirectorySeparators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
54Name = isParentPath ? ".." : Path.GetFileName(rootDir);
63string normalizedRoot = Path.GetFullPath(rootDir.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
68string fileWithNormalSeparators = file.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
69if (Path.IsPathRooted(file))
71fileList.Add(Path.GetFullPath(fileWithNormalSeparators));
75fileList.Add(Path.GetFullPath(Path.Combine(normalizedRoot, fileWithNormalSeparators)));
93new InMemoryDirectoryInfo(Path.GetDirectoryName(FullName)!, _files, true, _comparisonType);
139(rootDir[rootDirLength - 1] == Path.DirectorySeparatorChar ||
140filePath.IndexOf(Path.DirectorySeparatorChar, rootDirLength) == rootDirLength);
152normPath = Path.GetDirectoryName(FullName) ?? FullName;
156string combinedPath = Path.Combine(FullName, path);
157normPath = Path.GetFullPath(combinedPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
170string combinedPath = Path.Combine(FullName, path);
171string normPath = Path.GetFullPath(combinedPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Microsoft.Extensions.Hosting (5)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.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 (39)
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 (35)
BpeTests.cs (9)
366using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json"));
367using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt"));
380string vocabFile = Path.Combine(@"Gpt-2", "vocab.json");
381string mergesFile = Path.Combine(@"Gpt-2", "merges.txt");
546using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json"));
547using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt"));
894BpeOptions options = new BpeOptions(Path.Combine(@"Gpt-2", "vocab.json"), Path.Combine(@"Gpt-2", "merges.txt"))
951using Stream jsonModelStream = File.OpenRead(Path.Combine(@"DeepSeek", "tokenizer-DeepSeek-R1.json"));
Microsoft.ML.TorchSharp (12)
Microsoft.ML.TorchSharp.Tests (1)
Microsoft.ML.Transforms (5)
Microsoft.ML.Vision (25)
DnnRetrainTransform.cs (16)
118var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(DnnRetrainTransformer) + "_" + Guid.NewGuid()));
130string fullFilePath = Path.Combine(tempDirPath, relativeFile);
131string fullFileDir = Path.GetDirectoryName(fullFilePath);
409var path = Path.Combine(modelDir, DefaultModelFileNames.TmpMlnetModel);
416var variablesPath = Path.Combine(modelDir, DefaultModelFileNames.VariablesFolder);
417var archivePath = Path.Combine(variablesPath + "-" + Guid.NewGuid().ToString());
420File.Copy(f, Path.Combine(archivePath, Path.GetFileName(f)));
439var destination = Path.Combine(variablesPath, DefaultModelFileNames.Data);
446var destination = Path.Combine(variablesPath, DefaultModelFileNames.Index);
533_modelLocation = Path.IsPathRooted(modelLocation) ? modelLocation : Path.Combine(Directory.GetCurrentDirectory(), modelLocation);
705Path.Combine(_modelLocation, DefaultModelFileNames.Graph),
706Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Data),
707Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index),
ImageClassificationTrainer.cs (9)
537_resourcePath = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, "MLNET");
570_checkpointPath = Path.Combine(_options.WorkspacePath, _options.FinalModelPrefix +
572_sizeFile = Path.Combine(_options.WorkspacePath, "TrainingSetSize.txt");
668string trainSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath,
671string validationSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath,
856Path.Combine(_options.WorkspacePath, _options.ValidationSetBottleneckCachedValuesFileName),
954trainWriter = tf.summary.FileWriter(Path.Combine(_options.WorkspacePath, "train"),
1149var evalGraph = LoadMetaGraph(Path.Combine(_resourcePath, ModelFileName[_options.Arch]));
1313var modelFilePath = Path.Combine(_resourcePath, modelFileName);
Microsoft.NET.Sdk.Razor.SourceGenerators.UnitTests (11)
Microsoft.Private.Windows.Core (1)
src\Microsoft.Private.Windows.Polyfills\System\IO\PathExtensions.cs (1)
8extension(Path)
Microsoft.Private.Windows.Polyfills.Tests (14)
System\IO\PathExtensionsTests.cs (14)
11string result = Path.Join("dir", "file.txt");
18string result = Path.Join("", "file.txt");
25string result = Path.Join("dir", "");
32string result = Path.Join(null!, "file.txt");
39string result = Path.Join(@"dir\", "file.txt");
46string result = Path.Join("dir", @"\file.txt");
53string result = Path.Join("dir/", "file.txt");
60string result = Path.Join("dir".AsSpan(), "file.txt".AsSpan());
67string result = Path.Join(ReadOnlySpan<char>.Empty, "file.txt".AsSpan());
74string result = Path.Join("dir".AsSpan(), ReadOnlySpan<char>.Empty);
81string result = Path.Join(ReadOnlySpan<char>.Empty, ReadOnlySpan<char>.Empty);
88string result = Path.Join(@"dir\".AsSpan(), "file.txt".AsSpan());
95string result = Path.Join("root", "sub");
96result = Path.Join(result, "file.txt");
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.LanguageServer.ContainedLanguage (1)
Microsoft.VisualStudio.LanguageServices (65)
Microsoft.VisualStudio.LanguageServices.CSharp (5)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (34)
Microsoft.VisualStudio.LanguageServices.DevKit (1)
Microsoft.VisualStudio.LanguageServices.Implementation (20)
Microsoft.VisualStudio.LanguageServices.LiveShare (7)
Microsoft.VisualStudio.LanguageServices.Razor (22)
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (29)
Cohost\CohostInlineCompletionEndpointTest.cs (6)
153var outputLocalPath = Path.Combine(baseDirectory, "Cohost", "TestSnippets.snippet");
162var razorRepoRoot = Directory.Exists(Path.Combine(repoRoot, "src", "Razor", "src"))
163? Path.Combine(repoRoot, "src", "Razor")
167Path.Combine(razorRepoRoot, "src", "Razor", "test", "Microsoft.VisualStudio.LanguageServices.Razor.UnitTests", "Cohost", "TestSnippets.snippet"),
168Path.Combine(razorRepoRoot, "src", "Razor", "test", "Microsoft.VisualStudio.LanguageServices.Razor.Test", "Cohost", "TestSnippets.snippet"),
190if (File.Exists(Path.Combine(current.FullName, fileName)))
LanguageConfigurationTest.cs (5)
157var outputLocalPath = Path.Combine(baseDirectory, "language-configuration.json");
166var razorRepoRoot = Directory.Exists(Path.Combine(repoRoot, "src", "Razor", "src"))
167? Path.Combine(repoRoot, "src", "Razor")
169var repoPath = Path.Combine(razorRepoRoot, "src", "Microsoft.VisualStudio.RazorExtension", "language-configuration.json");
188if (File.Exists(Path.Combine(current.FullName, fileName)))
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\PromoteUsingDirectiveTests.cs (12)
34(FileUri(Path.Combine("..", "_Imports.razor")), """
62(FileUri(Path.Combine("..", "_Imports.razor")), """
87(FileUri(Path.Combine("..", "_ViewImports.cshtml")), """
103documentFilePath: FilePath(Path.Combine("My", "Deeply", "Nested", "File.razor")),
105(FilePath(Path.Combine("My", "Deeply", "_Imports.razor")), """
117(FileUri(Path.Combine("My", "Deeply", "_Imports.razor")), """
135documentFilePath: FilePath(Path.Combine("My", "Deeply", "Nested", "File.razor")),
137(FilePath(Path.Combine("My", "Deeply", "_Imports.razor")), """
150(FileUri(Path.Combine("My", "Deeply", "_Imports.razor")), """
168documentFilePath: FilePath(Path.Combine("My", "Deeply", "Nested", "File.razor")),
170(FilePath(Path.Combine("My", "Deeply", "_Imports.razor")), """
183(FileUri(Path.Combine("My", "Deeply", "_Imports.razor")), """
Microsoft.VisualStudio.Razor.IntegrationTests (52)
Microsoft.VisualStudio.RazorExtension (9)
Microsoft.VisualStudioCode.Razor.IntegrationTests (43)
Services\VSCodeService.cs (16)
84testServices.Logger.Log($"Workspace contents: {string.Join(", ", Directory.GetFileSystemEntries(workspacePath).Select(Path.GetFileName))}");
238var sanitizedName = string.Join("_", testName.Split(Path.GetInvalidFileNameChars()));
240var testLogsDir = Path.Combine(failureLogsDir, $"FAILED_{timestamp}_{sanitizedName}");
255testServices.Logger.Log($" C# Extension log: {Path.GetRelativePath(testLogsDir, file)}");
275return Path.Combine(testServices.Settings.UserDataDir, "logs");
287var destFile = Path.Combine(destDir, Path.GetFileName(file));
293var destSubDir = Path.Combine(destDir, Path.GetFileName(dir));
308var vscodeDir = Path.Combine(workspacePath, ".vscode");
311var settingsPath = Path.Combine(vscodeDir, "settings.json");
341var userSettingsDir = Path.Combine(testServices.Settings.UserDataDir, "User");
344var settingsPath = Path.Combine(userSettingsDir, "settings.json");
388var storagePath = Path.Combine(testServices.Settings.UserDataDir, "User", "globalStorage");
403var workspaceStoragePath = Path.Combine(testServices.Settings.UserDataDir, "User", "workspaceStorage");
418var backupPath = Path.Combine(testServices.Settings.UserDataDir, "Backups");
Services\VSCodeService.Installer.cs (10)
23var vscodeDir = Path.Combine(installDir, "vscode");
52var archivePath = Path.Combine(installDir, GetArchiveFileName());
410return Path.Combine(vscodeDir, "Code.exe");
415return Path.Combine(vscodeDir, "Visual Studio Code.app", "Contents", "MacOS", "Electron");
419return Path.Combine(vscodeDir, "code");
428var dir = Path.GetDirectoryName(vscodePath)!;
429return Path.Combine(dir, "bin", "code.cmd");
437return Path.Combine(appPath, "Contents", "Resources", "app", "bin", "code");
443var dir = Path.GetDirectoryName(vscodePath)!;
444return Path.Combine(dir, "bin", "code");
Microsoft.VisualStudioCode.RazorExtension (10)
Microsoft.VisualStudioCode.RazorExtension.UnitTests (15)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\PromoteUsingDirectiveTests.cs (12)
34(FileUri(Path.Combine("..", "_Imports.razor")), """
62(FileUri(Path.Combine("..", "_Imports.razor")), """
87(FileUri(Path.Combine("..", "_ViewImports.cshtml")), """
103documentFilePath: FilePath(Path.Combine("My", "Deeply", "Nested", "File.razor")),
105(FilePath(Path.Combine("My", "Deeply", "_Imports.razor")), """
117(FileUri(Path.Combine("My", "Deeply", "_Imports.razor")), """
135documentFilePath: FilePath(Path.Combine("My", "Deeply", "Nested", "File.razor")),
137(FilePath(Path.Combine("My", "Deeply", "_Imports.razor")), """
150(FileUri(Path.Combine("My", "Deeply", "_Imports.razor")), """
168documentFilePath: FilePath(Path.Combine("My", "Deeply", "Nested", "File.razor")),
170(FilePath(Path.Combine("My", "Deeply", "_Imports.razor")), """
183(FileUri(Path.Combine("My", "Deeply", "_Imports.razor")), """
Microsoft.Web.Xdt.Extensions.Tests (4)
MSBuild (37)
XMake.cs (12)
163s_exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath());
2336Console.WriteLine($"{Path.Combine(s_exePath, s_exeName)} {equivalentCommandLine} {projectFile}");
3141if (!extensionsToIgnore.Contains(Path.GetExtension(s)) && !s.EndsWith("~", StringComparison.CurrentCultureIgnoreCase))
3156if (!extensionsToIgnore.Contains(Path.GetExtension(s)))
3174string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]);
3175string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]);
3194string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]);
3195string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]);
3250InitializationException.VerifyThrow(string.Equals(extension, Path.GetExtension(extension), StringComparison.OrdinalIgnoreCase), "InvalidExtensionToIgnore", extension, null, false);
3706if (!string.IsNullOrEmpty(logFileName) && !Path.IsPathRooted(logFileName))
3709$"logFile={Path.Combine(Directory.GetCurrentDirectory(), logFileName)}");
3726fileParameters += $"logFile={Path.Combine(Directory.GetCurrentDirectory(), msbuildLogFileName)}";
MSBuild.Benchmarks (20)
DefiningProjectModifiersBenchmark.cs (10)
34_tempDir = Path.Combine(Path.GetTempPath(), "MSBuildBenchmarks", Guid.NewGuid().ToString("N"));
35string srcDir = Path.Combine(_tempDir, "src");
41File.WriteAllText(Path.Combine(srcDir, $"File{i}.cs"), string.Empty);
50root.FullPath = Path.Combine(_tempDir, "SingleProject.csproj");
55itemGroup.AddItem("Compile", Path.Combine(srcDir, $"File{i}.cs"));
69importRoot.FullPath = Path.Combine(_tempDir, "Imported.props");
73importItemGroup.AddItem("Compile", Path.Combine(srcDir, $"File{i}.cs"));
80mainRoot.FullPath = Path.Combine(_tempDir, "MainProject.csproj");
85mainItemGroup.AddItem("Compile", Path.Combine(srcDir, $"File{i}.cs"));
MSBuildTaskHost (21)
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");
116var dirName = Path.GetFileName(Path.GetDirectoryName(path));
PresentationBuildTasks (71)
PresentationCore (21)
PresentationCore.Tests (2)
PresentationFramework (20)
PresentationUI (11)
ReachFramework (4)
Replay (25)
RepoTasks (34)
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 (28)
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 (13)
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 (87)
BlazorWasmTemplateTest.cs (8)
31var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
32Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
107var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
111Assert.False(File.Exists(Path.Combine(publishDir, "service-worker.published.js")), "service-worker.published.js should not be published");
112Assert.True(File.Exists(Path.Combine(publishDir, "service-worker.js")), "service-worker.js should be published");
113Assert.True(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "service-worker-assets.js should be published");
129var fullPath = Path.Combine(basePath, path);
133return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\Project.cs (11)
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");
241var publishDir = Path.Combine(TemplatePublishDir, "wwwroot");
330var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
359var fullPath = Path.Combine(TemplateOutputDir, path);
415var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
507return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
629var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
631var 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 (16)
23private static readonly string TestAssetsPath = Path.Combine(
24Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
104var parentDir = Path.GetDirectoryName(hostProject.TemplateOutputDir);
105var workerLibDir = Path.Combine(parentDir, "WorkerLib");
124var parentDir = Path.GetDirectoryName(hostProject.TemplateOutputDir);
125var workerLibDir = Path.Combine(parentDir, "WorkerLib");
179var csprojPath = Path.Combine(hostProject.TemplateOutputDir, $"{hostProject.ProjectName}.csproj");
204var testComponentSource = Path.Combine(TestAssetsPath, "WebWorkerTest.razor");
207var pagesDir = Path.Combine(hostProject.TemplateOutputDir, "Components", "Pages");
210pagesDir = Path.Combine(hostProject.TemplateOutputDir, "Pages");
213Path.Combine(pagesDir, "WebWorkerTest.razor"),
219var workerMethodsSource = Path.Combine(TestAssetsPath, "TestWorkerMethods.cs");
220File.Copy(workerMethodsSource, Path.Combine(workerLibDir, "TestWorkerMethods.cs"), overwrite: true);
229var objDirectory = Path.Combine(hostProject.TemplateOutputDir, "obj");
260var endpointsManifest = Path.Combine(outputDir,
290var sourceHtml = Path.Combine(hostProject.TemplateOutputDir, "wwwroot", "index.html");
Templates.Blazor.WebAssembly.Auth.Tests (68)
src\ProjectTemplates\Shared\Project.cs (11)
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");
241var publishDir = Path.Combine(TemplatePublishDir, "wwwroot");
330var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
359var fullPath = Path.Combine(TemplateOutputDir, path);
415var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
507return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
629var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
631var 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 (76)
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 (11)
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");
241var publishDir = Path.Combine(TemplatePublishDir, "wwwroot");
330var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
359var fullPath = Path.Combine(TemplateOutputDir, path);
415var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
507return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
629var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
631var 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 (74)
src\ProjectTemplates\Shared\Project.cs (11)
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");
241var publishDir = Path.Combine(TemplatePublishDir, "wwwroot");
330var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
359var fullPath = Path.Combine(TemplateOutputDir, path);
415var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
507return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
629var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
631var 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 (88)
src\ProjectTemplates\Shared\Project.cs (11)
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");
241var publishDir = Path.Combine(TemplatePublishDir, "wwwroot");
330var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");
359var fullPath = Path.Combine(TemplateOutputDir, path);
415var launchSettingsPath = Path.Combine(TemplateOutputDir, "Properties", "launchSettings.json");
507return File.ReadAllText(Path.Combine(TemplateOutputDir, path));
629var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog");
631var 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 (26)
TestDiscoveryWorker (3)
TestPassApp (2)
TestProject.AppHost (1)
TestTasks (3)
Text.Analyzers (28)
ThreadSafeTaskAnalyzer.Tests (2)
UIAutomationClient (1)
vbc (14)
VBCSCompiler (40)
src\Compilers\Server\VBCSCompiler\CompilationCache.cs (22)
132=> Path.Combine(_cachePath, dllName, hashKey);
150var cachedAssemblyPath = Path.Combine(entryDir, AssemblyFileName);
202return !File.Exists(Path.Combine(entryDir, cachedFileName));
212File.Copy(Path.Combine(entryDir, cachedFileName), targetPath, overwrite: true);
233var dllCacheDir = Path.Combine(_cachePath, dllName);
244.Select(d => (Path: d, Name: Path.GetFileName(d)))
259var keyPath = Path.Combine(entryPath, dllName + ".key");
293var dllCacheDir = Path.Combine(_cachePath, dllName);
313stagingDir = Path.Combine(dllCacheDir, hashKey + "." + Guid.NewGuid().ToString("N") + ".tmp");
316File.Copy(outputFiles.AssemblyPath, Path.Combine(stagingDir, AssemblyFileName), overwrite: false);
318tryCopyOptional(outputFiles.PdbPath, Path.Combine(stagingDir, PdbFileName));
319tryCopyOptional(outputFiles.RefAssemblyPath, Path.Combine(stagingDir, RefAssemblyFileName));
320tryCopyOptional(outputFiles.XmlDocPath, Path.Combine(stagingDir, XmlDocFileName));
322File.WriteAllText(Path.Combine(stagingDir, dllName + ".key"), deterministicKey, Encoding.UTF8);
323File.WriteAllText(Path.Combine(stagingDir, CreatedFileName), DateTimeOffset.UtcNow.ToString("O", CultureInfo.InvariantCulture));
448var path = Path.Combine(entryDir, LastUsedFileName);
479var dllName = Path.GetFileName(dllDir);
483var dirName = Path.GetFileName(entryDir);
544var lastUsedPath = Path.Combine(entryDir, LastUsedFileName);
572var createdPath = Path.Combine(entryDir, CreatedFileName);
612var dllName = Path.GetFileName(dllDir);
616var dirName = Path.GetFileName(entryDir);
VBCSCompiler.UnitTests (165)
CompilationCacheBehaviorTests.cs (20)
59File.Delete(Path.Combine(workingDirectory.Path, outputFileName));
65Assert.True(File.Exists(Path.Combine(workingDirectory.Path, outputFileName)));
77var touchedFilesBase = Path.Combine(workingDirectory.Path, "touched");
97File.Delete(Path.Combine(workingDirectory.Path, outputFileName));
139File.Delete(Path.Combine(workingDirectory.Path, outputFileName));
208File.Delete(Path.Combine(workingDirectory.Path, consumerOutputFileName));
223var generatedFilesDirectory = Path.Combine(workingDirectory.Path, "generated");
246File.Delete(Path.Combine(workingDirectory.Path, outputFileName));
288Assert.True(File.Exists(Path.Combine(workingDirectory.Path, keyFileName)));
290File.Delete(Path.Combine(workingDirectory.Path, outputFileName));
291File.Delete(Path.Combine(workingDirectory.Path, pdbFileName));
292File.Delete(Path.Combine(workingDirectory.Path, keyFileName));
297Assert.True(File.Exists(Path.Combine(workingDirectory.Path, outputFileName)));
298Assert.True(File.Exists(Path.Combine(workingDirectory.Path, pdbFileName)));
299Assert.False(File.Exists(Path.Combine(workingDirectory.Path, keyFileName)));
413var path = Path.Combine(directory.Path, assemblyName + ".dll");
428.Split(Path.PathSeparator)
443var filePath = Path.Combine(currentDirectory.Path, "netstandard.dll");
506clientDir: Path.GetDirectoryName(typeof(CommonCompiler).Assembly.Location),
509tempDir: Path.GetTempPath());
CompilationCacheTests.cs (106)
102AssemblyPath = Path.Combine(outputDir, "Util.dll"),
121var entryDir = Path.Combine(cacheDir, dllName, hashKey);
123File.WriteAllBytes(Path.Combine(entryDir, "assembly"), [1, 2, 3]);
127AssemblyPath = Path.Combine(outputDir, dllName),
147var entryDir = Path.Combine(cacheDir, dllName, hashKey);
149File.WriteAllBytes(Path.Combine(entryDir, "assembly"), [1]);
150File.WriteAllBytes(Path.Combine(entryDir, "pdb"), [2]);
151File.WriteAllBytes(Path.Combine(entryDir, "refassembly"), [3]);
152File.WriteAllBytes(Path.Combine(entryDir, "xmldoc"), [4]);
156AssemblyPath = Path.Combine(outputDir, dllName),
157PdbPath = Path.Combine(outputDir, "MyLib.pdb"),
158RefAssemblyPath = Path.Combine(outputDir, "ref", dllName),
159XmlDocPath = Path.Combine(outputDir, "MyLib.xml"),
162Directory.CreateDirectory(Path.Combine(outputDir, "ref"));
183var entryDir = Path.Combine(cacheDir, dllName, hashKey);
185File.WriteAllBytes(Path.Combine(entryDir, "assembly"), [10]);
189AssemblyPath = Path.Combine(outputDir, dllName),
190PdbPath = Path.Combine(outputDir, "MyLib.pdb"),
213var entryDir = Path.Combine(cacheDir, dllName, hashKey);
215File.WriteAllBytes(Path.Combine(entryDir, "assembly"), [1, 2, 3]);
219AssemblyPath = Path.Combine(outputDir, dllName),
241Directory.CreateDirectory(Path.Combine(cacheDir, dllName));
245AssemblyPath = Path.Combine(outputDir, dllName),
267var assemblyPath = Path.Combine(outputDir, dllName);
268var pdbPath = Path.Combine(outputDir, "MyLib.pdb");
269var refPath = Path.Combine(outputDir, "ref", dllName);
270var xmlPath = Path.Combine(outputDir, "MyLib.xml");
271Directory.CreateDirectory(Path.Combine(outputDir, "ref"));
287var entryDir = Path.Combine(cacheDir, dllName, hashKey);
288Assert.Equal([10, 20, 30], File.ReadAllBytes(Path.Combine(entryDir, "assembly")));
289Assert.Equal([40, 50], File.ReadAllBytes(Path.Combine(entryDir, "pdb")));
290Assert.Equal([60], File.ReadAllBytes(Path.Combine(entryDir, "refassembly")));
291Assert.Equal([70, 80, 90], File.ReadAllBytes(Path.Combine(entryDir, "xmldoc")));
292Assert.Equal(deterministicKey, File.ReadAllText(Path.Combine(entryDir, dllName + ".key"), Encoding.UTF8));
305var assemblyPath = Path.Combine(outputDir, dllName);
318var entryDir = Path.Combine(cacheDir, dllName, hashKey);
319Assert.True(File.Exists(Path.Combine(entryDir, "assembly")));
320Assert.False(File.Exists(Path.Combine(entryDir, "pdb")));
321Assert.False(File.Exists(Path.Combine(entryDir, "refassembly")));
322Assert.False(File.Exists(Path.Combine(entryDir, "xmldoc")));
350var assemblyPath = Path.Combine(outputDir, dllName);
367var entryDir = Path.Combine(cacheDir, dllName, hashKey);
368Assert.Equal([10, 20, 30], File.ReadAllBytes(Path.Combine(entryDir, "assembly")));
387var assemblyPath = Path.Combine(outputDir, dllName);
393AssemblyPath = Path.Combine(restoreDir, dllName),
434var oldEntryDir = Path.Combine(cacheDir, dllName, oldHashKey);
436File.WriteAllText(Path.Combine(oldEntryDir, dllName + ".key"), oldKeyContent, Encoding.UTF8);
438File.WriteAllBytes(Path.Combine(oldEntryDir, "assembly"), [1]);
461var entryDir = Path.Combine(cacheDir, dllName, hashKey);
463File.WriteAllBytes(Path.Combine(entryDir, "assembly"), [1, 2, 3]);
467AssemblyPath = Path.Combine(outputDir, dllName),
474var lastUsedPath = Path.Combine(entryDir, "last-used");
487var assemblyPath = Path.Combine(outputDir, dllName);
494var entryDir = Path.Combine(cacheDir, dllName, hashKey);
495var lastUsedPath = Path.Combine(entryDir, "last-used");
508var assemblyPath = Path.Combine(outputDir, dllName);
514var entryDir = Path.Combine(cacheDir, dllName, hashKey);
515var createdPath = Path.Combine(entryDir, "created");
530var entry1 = Path.Combine(cacheDir, "A.dll", "hash1");
532File.WriteAllBytes(Path.Combine(entry1, "assembly"), [1]);
533File.WriteAllText(Path.Combine(entry1, "created"), now.AddHours(-1).ToString("O"));
534File.WriteAllText(Path.Combine(entry1, "last-used"), now.AddSeconds(1).ToString("O"));
536var entry2 = Path.Combine(cacheDir, "B.dll", "hash2");
538File.WriteAllBytes(Path.Combine(entry2, "assembly"), [2]);
539File.WriteAllText(Path.Combine(entry2, "created"), now.AddSeconds(1).ToString("O"));
540File.WriteAllText(Path.Combine(entry2, "last-used"), now.AddSeconds(1).ToString("O"));
542var entry3 = Path.Combine(cacheDir, "C.dll", "hash3");
544File.WriteAllBytes(Path.Combine(entry3, "assembly"), [3]);
545File.WriteAllText(Path.Combine(entry3, "created"), now.AddHours(-2).ToString("O"));
546File.WriteAllText(Path.Combine(entry3, "last-used"), now.AddHours(-1).ToString("O"));
563var entry = Path.Combine(cacheDir, "MyLib.dll", "hash_abc");
565File.WriteAllBytes(Path.Combine(entry, "assembly"), [1]);
566File.WriteAllText(Path.Combine(entry, "created"), now.AddHours(-2).ToString("O"));
567File.WriteAllText(Path.Combine(entry, "last-used"), now.ToString("O"));
585var entry = Path.Combine(cacheDir, "MyLib.dll", "hash_abc");
587File.WriteAllBytes(Path.Combine(entry, "assembly"), [1]);
588File.WriteAllText(Path.Combine(entry, "created"), now.AddHours(-2).ToString("O"));
589File.WriteAllText(Path.Combine(entry, "last-used"), now.ToString("O"));
605var oldEntry = Path.Combine(cacheDir, "Old.dll", "hash_old");
607File.WriteAllBytes(Path.Combine(oldEntry, "assembly"), [1, 2, 3]);
608File.WriteAllText(Path.Combine(oldEntry, "last-used"), DateTimeOffset.UtcNow.AddHours(-2).ToString("O"));
610var newEntry = Path.Combine(cacheDir, "New.dll", "hash_new");
612File.WriteAllBytes(Path.Combine(newEntry, "assembly"), [4, 5, 6]);
613File.WriteAllText(Path.Combine(newEntry, "last-used"), DateTimeOffset.UtcNow.ToString("O"));
628var entry1 = Path.Combine(cacheDir, "A.dll", "hash1");
629var entry2 = Path.Combine(cacheDir, "B.dll", "hash2");
631File.WriteAllBytes(Path.Combine(entry1, "assembly"), [1]);
632File.WriteAllText(Path.Combine(entry1, "last-used"), DateTimeOffset.UtcNow.ToString("O"));
634File.WriteAllBytes(Path.Combine(entry2, "assembly"), [2]);
635File.WriteAllText(Path.Combine(entry2, "last-used"), DateTimeOffset.UtcNow.ToString("O"));
650var dllDir = Path.Combine(cacheDir, "Orphan.dll");
651var entryDir = Path.Combine(dllDir, "hash_orphan");
653File.WriteAllBytes(Path.Combine(entryDir, "assembly"), [1]);
654File.WriteAllText(Path.Combine(entryDir, "last-used"), DateTimeOffset.UtcNow.AddHours(-2).ToString("O"));
667var dllDir = Path.Combine(cacheDir, "Lib.dll");
668var stagingDir = Path.Combine(dllDir, "somehash.abc123.tmp");
671var usedDir = Path.Combine(dllDir, "hash_used");
673File.WriteAllBytes(Path.Combine(usedDir, "assembly"), [1]);
674File.WriteAllText(Path.Combine(usedDir, "last-used"), DateTimeOffset.UtcNow.ToString("O"));
687var dllDir = Path.Combine(cacheDir, "Lib.dll");
688var oldEntry = Path.Combine(dllDir, "hash_old");
690File.WriteAllBytes(Path.Combine(oldEntry, "assembly"), [1]);
691File.WriteAllText(Path.Combine(oldEntry, "last-used"), DateTimeOffset.UtcNow.AddHours(-2).ToString("O"));
693var newEntry = Path.Combine(dllDir, "hash_current");
695File.WriteAllBytes(Path.Combine(newEntry, "assembly"), [2]);
696File.WriteAllText(Path.Combine(newEntry, "last-used"), DateTimeOffset.UtcNow.ToString("O"));
CompilerServerTests.cs (19)
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");
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)