16060 references to Path
AnalyzerRunner (8)
CodeRefactoringRunner.cs (1)
217WriteLine($"Skipped assembly '{Path.GetFileNameWithoutExtension(file)}' during code refactoring discovery.", ConsoleColor.Yellow);
DiagnosticAnalyzerRunner.cs (5)
223string directoryName = Path.GetDirectoryName(fileName); 224string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 225string extension = Path.GetExtension(fileName); 226string uniqueFileName = Path.Combine(directoryName, $"{fileNameWithoutExtension}-Unique{extension}"); 306var analyzerReference = new AnalyzerFileReference(Path.GetFullPath(path), AssemblyLoader.Instance);
PersistentStorageConfiguration.cs (2)
28var location = Path.Combine(Path.GetTempPath(), "RoslynTests", "AnalyzerRunner", "temp-db");
aspire (397)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (5)
20private static readonly string s_skillFilePath = Path.Combine(".claude", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md"); 21private static readonly string s_skillBaseDirectory = Path.Combine(".claude", "skills"); 141var claudeCodePath = Path.Combine(currentDirectory.FullName, ClaudeCodeFolderName); 167var configFilePath = Path.Combine(repoRoot.FullName, McpConfigFileName); 215var configFilePath = Path.Combine(repoRoot.FullName, McpConfigFileName);
Agents\CommonAgentApplicators.cs (2)
38var skillFilePath = Path.Combine(workspaceRoot.FullName, skillRelativePath); 113var directory = Path.GetDirectoryName(skillFilePath);
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (4)
20private static readonly string s_skillFilePath = Path.Combine(".github", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md"); 21private static readonly string s_skillBaseDirectory = Path.Combine(".github", "skills"); 131return Path.Combine(homeDirectory.FullName, CopilotFolderName); 140return Path.Combine(GetCopilotConfigDirectory(homeDirectory), McpConfigFileName);
Agents\DeprecatedMcpCommandScanner.cs (3)
45var debugPath = Path.Combine(Path.GetTempPath(), "aspire-deprecated-scan.log"); 50var configPath = Path.Combine(context.RepositoryRoot.FullName, location.RelativePath);
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (4)
19private static readonly string s_skillFilePath = Path.Combine(".opencode", "skill", CommonAgentApplicators.AspireSkillName, "SKILL.md"); 20private static readonly string s_skillBaseDirectory = Path.Combine(".opencode", "skill"); 51var configFilePath = Path.Combine(configDirectory.FullName, OpenCodeConfigFileName); 199var configFilePath = Path.Combine(configDirectory.FullName, OpenCodeConfigFileName);
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);
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (6)
20private static readonly string s_skillFilePath = Path.Combine(".github", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md"); 21private static readonly string s_skillBaseDirectory = Path.Combine(".github", "skills"); 88var targetVsCodeFolder = new DirectoryInfo(Path.Combine(context.RepositoryRoot.FullName, VsCodeFolderName)); 163var vsCodePath = Path.Combine(currentDirectory.FullName, VsCodeFolderName); 201var mcpConfigPath = Path.Combine(vsCodeFolder.FullName, McpConfigFileName); 255var mcpConfigPath = Path.Combine(vsCodeFolder.FullName, McpConfigFileName);
Backchannel\AppHostConnectionResolver.cs (1)
146path => Path.GetRelativePath(workingDirectory, path),
Backchannel\AuxiliaryBackchannelMonitor.cs (11)
75string.Equals(Path.GetFullPath(c.AppHostInfo.AppHostPath), Path.GetFullPath(SelectedAppHostPath), StringComparison.OrdinalIgnoreCase)); 117var normalizedWorkingDirectory = Path.GetFullPath(workingDirectory); 118var normalizedAppHostPath = Path.GetFullPath(appHostPath); 121var relativePath = Path.GetRelativePath(normalizedWorkingDirectory, normalizedAppHostPath); 122return !relativePath.StartsWith("..", StringComparison.Ordinal) && !Path.IsPathRooted(relativePath); 477var workingDirectory = Path.GetFullPath(executionContext.WorkingDirectory.FullName); 478var normalizedAppHostPath = Path.GetFullPath(appHostPath); 481var relativePath = Path.GetRelativePath(workingDirectory, normalizedAppHostPath); 483return !relativePath.StartsWith("..", StringComparison.Ordinal) && !Path.IsPathRooted(relativePath); 503return Path.Combine(homeDirectory, ".aspire", "cli", "backchannels");
Bundles\BundleService.cs (17)
98var lockPath = Path.Combine(destinationPath, ".aspire-bundle-lock"); 164var cliDir = Path.GetDirectoryName(processPath); 170return Path.GetDirectoryName(cliDir) ?? cliDir; 181var fullPath = Path.Combine(layoutPath, dir); 189var markerPath = Path.Combine(layoutPath, VersionMarkerFileName); 210var markerPath = Path.Combine(extractDir, VersionMarkerFileName); 220var markerPath = Path.Combine(extractDir, VersionMarkerFileName); 257var fullPath = Path.GetFullPath(Path.Combine(destinationPath, relativePath)); 258var normalizedDestination = Path.GetFullPath(destinationPath); 261if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 274var dir = Path.GetDirectoryName(fullPath); 294var linkTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, entry.LinkName)); 295if (!linkTarget.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 300var linkDir = Path.GetDirectoryName(fullPath);
Caching\DiskCache.cs (4)
24_cacheDirectory = new DirectoryInfo(Path.Combine(executionContext.CacheDirectory.FullName, "nuget-search")); 106var fullPath = Path.Combine(_cacheDirectory.FullName, fileName); 192var nameNoExt = Path.GetFileNameWithoutExtension(file.Name); 240var nameNoExt = Path.GetFileNameWithoutExtension(file.Name);
Certificates\CertificateGeneration\CertificateManager.cs (5)
440var exportDir = Path.GetDirectoryName(path); 658var targetDirectoryPath = Path.GetDirectoryName(path); 744var tempFilename = Path.GetTempFileName(); 766var keyPath = Path.ChangeExtension(path, ".key"); 772var tempFilename = Path.GetTempFileName();
Certificates\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string s_macOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(s_macOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
Certificates\CertificateHelpers.cs (2)
21private static readonly string s_defaultDevCertsTrustPath = Path.Combine( 46var openSslCertsDir = Path.Combine(openSslDir, "certs");
Certificates\CertificateService.cs (5)
113var paths = currentSslCertDir.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); 114if (paths.Any(p => string.Equals(p.TrimEnd(Path.DirectorySeparatorChar), devCertsTrustPath.TrimEnd(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase))) 121environmentVariables[SslCertDirEnvVar] = $"{currentSslCertDir}{Path.PathSeparator}{devCertsTrustPath}"; 129environmentVariables[SslCertDirEnvVar] = string.Join(Path.PathSeparator, systemCertDirs);
Commands\AppHostLauncher.cs (2)
346var appHostRelativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, effectiveAppHostFile.FullName); 381return Path.Combine(logsDirectory, fileName);
Commands\ConfigCommand.cs (1)
232if (Path.Exists(settingsFilePath))
Commands\ExportCommand.cs (3)
114var directory = Path.GetDirectoryName(Path.GetFullPath(outputPath)); 191var fullPath = Path.GetFullPath(outputPath);
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");
Commands\PipelineCommandBase.cs (1)
194var fullyQualifiedOutputPath = outputPath != null ? Path.GetFullPath(outputPath) : null;
Commands\PsCommand.cs (3)
231var fileName = Path.GetFileName(path); 245var directory = Path.GetDirectoryName(path); 247? Path.GetFileName(directory)
Commands\RunCommand.cs (1)
274var appHostRelativePath = Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, effectiveAppHostFile.FullName);
Commands\Sdk\SdkDumpCommand.cs (3)
90Path.GetFileNameWithoutExtension(projectFile.FullName), 140var tempDir = Path.Combine(Path.GetTempPath(), "aspire-sdk-dump", Guid.NewGuid().ToString("N")[..8]);
Commands\Sdk\SdkGenerateCommand.cs (7)
118var tempDir = Path.Combine(Path.GetTempPath(), "aspire-sdk-gen", Guid.NewGuid().ToString("N")[..8]); 138Path.GetFileNameWithoutExtension(integrationProject.FullName), 174var outputDirFullPath = Path.GetFullPath(outputDir.FullName); 177var filePath = Path.GetFullPath(Path.Combine(outputDir.FullName, fileName)); 186var fileDirectory = Path.GetDirectoryName(filePath);
Commands\StopCommand.cs (1)
187? Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, appHostPath)
Commands\UpdateCommand.cs (10)
106var fileName = Path.GetFileNameWithoutExtension(processPath); 346var installDir = Path.GetDirectoryName(currentExePath); 353var targetExePath = Path.Combine(installDir, exeName); 371var newExePath = Path.Combine(tempExtractDir, exeName); 449CleanupDirectory(Path.GetDirectoryName(archivePath)!); 461var pathSeparator = Path.PathSeparator; 465string.Equals(Path.GetFullPath(p.Trim()), Path.GetFullPath(directory), 529var directory = Path.GetDirectoryName(targetExePath); 535var exeName = Path.GetFileName(targetExePath);
Configuration\AspireConfigFile.cs (6)
118var filePath = Path.Combine(directory, FileName); 145var filePath = Path.Combine(directory, FileName); 174var profiles = ReadApphostRunProfiles(Path.Combine(directory, "apphost.run.json")); 349var absolutePath = Path.GetFullPath(Path.Combine(configDirectory, trimmedValue)); 365return File.Exists(Path.Combine(directory, FileName));
Configuration\AspireJsonConfiguration.cs (5)
89return Path.Combine(directory, SettingsFolder, FileName); 135var folderPath = Path.Combine(directory, SettingsFolder); 138var filePath = Path.Combine(folderPath, FileName); 216var absolutePath = Path.GetFullPath(Path.Combine(settingsDirectory, trimmedValue));
Configuration\ConfigurationService.cs (2)
101var newSettingsPath = Path.Combine(searchDirectory.FullName, AspireConfigFile.FileName); 122var defaultPath = Path.Combine(executionContext.WorkingDirectory.FullName, AspireConfigFile.FileName);
Diagnostics\FileLoggerProvider.cs (2)
46return Path.Combine(logsDirectory, name); 71var directory = Path.GetDirectoryName(logFilePath);
DotNet\DotNetCliExecutionFactory.cs (3)
105var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", sdkVersion); 106var dotnetExecutablePath = Path.Combine( 125startInfo.EnvironmentVariables["PATH"] = $"{sdkInstallPath}{Path.PathSeparator}{currentPath}";
DotNet\DotNetCliRunner.cs (6)
87var aspireCliPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 95var socketPath = Path.Combine(aspireCliPath, $"cli.sock.{uniqueSocketPathSegment}"); 801var filePath = Path.IsPathRooted(configPath) 803: Path.Combine(workingDirectory.FullName, configPath); 1094var projectPath = Path.IsPathRooted(line) 1096: Path.Combine(solutionFile.Directory!.FullName, line);
Layout\LayoutConfiguration.cs (2)
70return relativePath is not null ? Path.Combine(LayoutPath, relativePath) : null; 90return Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName));
Layout\LayoutDiscovery.cs (6)
127var entries = Directory.GetFileSystemEntries(layoutPath).Select(Path.GetFileName).ToArray(); 149var cliDir = Path.GetDirectoryName(cliPath); 169var parentDir = Path.GetDirectoryName(cliDir); 186var managedPath = Path.Combine(layoutPath, BundleDiscovery.ManagedDirectoryName); 187var dcpPath = Path.Combine(layoutPath, BundleDiscovery.DcpDirectoryName); 201var managedExePath = Path.Combine(managedPath, managedExeName);
Mcp\Docs\DocsCache.cs (5)
29_diskCacheDirectory = new DirectoryInfo(Path.Combine(executionContext.CacheDirectory.FullName, DocsCacheSubdirectory)); 192return Path.Combine(_diskCacheDirectory.FullName, $"{safeKey}.txt"); 195private string GetETagFilePath() => Path.Combine(_diskCacheDirectory.FullName, ETagFileName); 197private static readonly char[] s_invalidFileNameChars = Path.GetInvalidFileNameChars(); 318private string GetIndexFilePath() => Path.Combine(_diskCacheDirectory.FullName, IndexFileName);
Mcp\Tools\ListIntegrationsTool.cs (1)
160var appHostDirectory = Path.GetDirectoryName(appHostPath);
Mcp\Tools\SelectAppHostTool.cs (5)
60if (Path.IsPathRooted(appHostPath)) 62resolvedPath = Path.GetFullPath(appHostPath); 66resolvedPath = Path.GetFullPath(Path.Combine(executionContext.WorkingDirectory.FullName, appHostPath)); 77var candidatePath = Path.GetFullPath(c.AppHostInfo.AppHostPath);
Npm\NpmRunner.cs (4)
102var tarballPath = Path.Combine(outputDirectory, filename); 130var packageJson = Path.Combine(tempDir, "package.json"); 206var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-npm-{Guid.NewGuid():N}");
NuGet\BundleNuGetService.cs (5)
77var restoreDir = Path.Combine(_cacheDirectory, "restore", packageHash); 78var objDir = Path.Combine(restoreDir, "obj"); 79var libsDir = Path.Combine(restoreDir, "libs"); 80var assetsPath = Path.Combine(objDir, "project.assets.json"); 208return Path.Combine(home, ".aspire", "packages");
Packaging\NuGetConfigMerger.cs (1)
68var targetPath = Path.Combine(targetDirectory.FullName, "nuget.config");
Packaging\PackagingService.cs (1)
46var packagesPath = Path.Combine(prHive.FullName, "packages").Replace('\\', '/');
Packaging\TemporaryNuGetConfig.cs (4)
22var tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 24var tempFilePath = Path.Combine(tempDirectory, "nuget.config");
Program.cs (7)
57var aspirePath = Path.Combine(homeDirectory, ".aspire"); 123var logsDirectory = Path.Combine(GetUsersAspirePath(), "logs"); 159var newPath = Path.Combine(usersAspirePath, Configuration.AspireConfigFile.FileName); 164var legacyPath = Path.Combine(usersAspirePath, "globalsettings.json"); 503var hivesDirectory = Path.Combine(homeDirectory, "hives"); 510var sdksPath = Path.Combine(homeDirectory, "sdks"); 526var cacheDirectoryPath = Path.Combine(homeDirectory, "cache");
Projects\AppHostServerProject.cs (4)
40var normalizedPath = Path.GetFullPath(appPath); 57var socketDir = Path.Combine(Path.GetTempPath(), ".aspire", "sockets"); 59socketPath = Path.Combine(socketDir, socketName);
Projects\DefaultLanguageDiscovery.cs (1)
98var filePath = Path.Combine(directory.FullName, pattern);
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\FallbackProjectParser.cs (3)
266var fullPath = Path.IsPathRooted(include) 268: Path.GetFullPath(Path.Combine(projectFile.DirectoryName!, include));
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);
Projects\ProjectUpdater.cs (3)
87var configPathDirectories = configPaths.Select(Path.GetDirectoryName).ToArray(); 150var globalNuGetFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget"); 699var directoryPackagesPropsPath = Path.Combine(current.FullName, "Directory.Packages.props");
Projects\SolutionLocator.cs (2)
43solutionFile => $"{solutionFile.Name.EscapeMarkup()} ({Path.GetRelativePath(startDirectory.FullName, solutionFile.FullName).EscapeMarkup()})", 87.OrderBy(f => f.Directory?.FullName.Count(c => c == Path.DirectorySeparatorChar) ?? 0)
Scaffolding\ScaffoldingService.cs (6)
99var filePath = Path.Combine(directory.FullName, fileName); 100var fileDirectory = Path.GetDirectoryName(filePath); 129var appHostRunPath = Path.Combine(directory.FullName, "apphost.run.json"); 210var outputPath = Path.Combine(directoryPath, GeneratedFolderName); 215var filePath = Path.Combine(outputPath, fileName); 216var fileDirectory = Path.GetDirectoryName(filePath);
src\Shared\BackchannelConstants.cs (8)
91=> Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 125return Path.Combine(dir, $"{SocketPrefix}.{hash}.{processId}"); 142return Path.Combine(dir, $"{SocketPrefix}.{hash}"); 158var dir = Path.GetDirectoryName(prefix); 159var prefixFileName = Path.GetFileName(prefix); 175var fileName = Path.GetFileName(f); 199var fileName = Path.GetFileName(socketPath); 229var fileName = Path.GetFileName(socketPath);
src\Shared\BundleDiscovery.cs (10)
105var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 111dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 112dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 136var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 137var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 235return Path.Combine(dcpDirectory, exeName); 271var fileName = Path.GetFileNameWithoutExtension(path); 327return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 345return Path.GetDirectoryName(processPath);
src\Shared\Export\ExportArchive.cs (1)
131var invalidChars = Path.GetInvalidFileNameChars();
src\Shared\Model\ResourceSourceViewModel.cs (2)
17return new ResourceSource(Path.GetFileName(projectPath), projectPath); 30return new ResourceSource(Path.GetFileName(executablePath), executablePath);
src\Shared\PathLookupHelper.cs (3)
23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions); 58var fullPathWithExt = Path.Combine(directory, command + extension); 67var fullPath = Path.Combine(directory, command);
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
src\Shared\UserSecrets\IsolatedUserSecretsHelper.cs (2)
36var isolatedSecretsDir = Path.GetDirectoryName(isolatedSecretsPath); 62var secretsDir = Path.GetDirectoryName(secretsPath);
src\Shared\UserSecrets\SecretsStore.cs (2)
81var directory = Path.GetDirectoryName(_secretsFilePath); 98var tempFilename = Path.GetTempFileName();
src\Shared\UserSecrets\UserSecretsPathHelper.cs (2)
52? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 53: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
Telemetry\LinuxMachineInformationProvider.cs (1)
38userDir = Path.Combine(rootPath, SecondaryPathSubDirectory);
Telemetry\MacOSXMachineInformationProvider.cs (1)
43var subdirectoryPath = Path.Combine(userDir, "Library", "Application Support");
Telemetry\TelemetryManager.cs (1)
142return Path.Combine(homeDirectory, ".aspire", "cli", "telemetrystorage");
Telemetry\UnixMachineInformationProvider.cs (3)
28cachePath = Path.Combine(GetStoragePath(), MicrosoftDirectory, DeveloperToolsDirectory); 80var fullPath = Path.Combine(directoryPath, fileName); 104var path = Path.Combine(directoryPath, fileName);
Templating\CliTemplateFactory.cs (7)
188var relativePath = resourceName[resourcePrefix.Length..].Replace('/', Path.DirectorySeparatorChar); 189var filePath = Path.Combine(outputPath, relativePath); 190var fileDirectory = Path.GetDirectoryName(filePath); 200if (s_binaryTemplateExtensions.Contains(Path.GetExtension(filePath))) 221var relativePath = Path.GetRelativePath(currentDir, outputPath); 227if (!string.Equals(Path.GetFullPath(currentDir), Path.GetFullPath(outputPath), pathComparison))
Templating\CliTemplateFactory.EmptyTemplate.cs (2)
44outputPath = Path.GetFullPath(outputPath, _executionContext.WorkingDirectory.FullName); 145var aspireConfigPath = Path.Combine(outputPath, Configuration.AspireConfigFile.FileName);
Templating\CliTemplateFactory.TypeScriptStarterTemplate.cs (2)
37outputPath = Path.GetFullPath(outputPath, _executionContext.WorkingDirectory.FullName); 75var appHostProject = _projectFactory.TryGetProject(new FileInfo(Path.Combine(outputPath, "apphost.ts")));
Templating\DotNetTemplateFactory.cs (4)
109var sdkInstallPath = Path.Combine(executionContext.SdksDirectory.FullName, "dotnet", DotNetSdkInstaller.MinimumSdkVersion); 119foreach (var directory in pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 123if (File.Exists(Path.Combine(directory, dotnetFileName))) 640return Path.GetFullPath(outputPath);
Templating\TemplateNuGetConfigService.cs (1)
41var normalizedOutputPath = Path.GetFullPath(outputPath);
Utils\AppHostHelper.cs (2)
57var relativePath = Path.GetRelativePath(workingDirectory.FullName, projectFile.FullName); 71var relativePath = Path.GetRelativePath(workingDirectory.FullName, projectFile.FullName);
Utils\ArchiveHelper.cs (15)
38var normalizedDestination = Path.GetFullPath(destinationPath); 48var fullPath = Path.GetFullPath(Path.Combine(destinationPath, entry.FullName)); 49if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 61var dir = Path.GetDirectoryName(fullPath); 73var normalizedDestination = Path.GetFullPath(destinationPath); 86var fullPath = Path.GetFullPath(Path.Combine(destinationPath, entry.Name)); 89if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 102var dir = Path.GetDirectoryName(fullPath); 122var linkTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, entry.LinkName)); 123if (!linkTarget.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 128var linkDir = Path.GetDirectoryName(fullPath);
Utils\AspireRepositoryDetector.cs (6)
59return Path.GetFullPath(envRoot); 65repoRoot = FindRepositoryRoot(Path.GetDirectoryName(processPath)); 85if (File.Exists(Path.Combine(currentDirectory, AspireSolutionFileName))) 98var fullPath = Path.GetFullPath(path); 107return Path.GetDirectoryName(fullPath)!; 110var parentDirectory = Path.GetDirectoryName(fullPath);
Utils\CliDownloader.cs (2)
62var archivePath = Path.Combine(tempDir, archiveFilename); 63var checksumPath = Path.Combine(tempDir, checksumFilename);
Utils\CliUpdateNotifier.cs (1)
105var fileName = Path.GetFileNameWithoutExtension(processPath);
Utils\CommandPathResolver.cs (1)
55var normalizedCommand = Path.GetFileNameWithoutExtension(command);
Utils\ConfigurationHelper.cs (3)
34var newSettingsPath = Path.Combine(currentDirectory.FullName, AspireConfigFile.FileName); 69return Path.Combine(workingDirectory, ".aspire", "settings.json"); 96var directory = Path.GetDirectoryName(filePath);
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (1)
44var configPath = Path.Combine(workingDirectory.FullName, location.RelativePath);
Utils\FileLock.cs (1)
60var directory = Path.GetDirectoryName(lockPath);
Utils\FileSystemHelper.cs (2)
42var targetFilePath = Path.Combine(currentDestination, file.Name); 49var targetSubDir = Path.Combine(currentDestination, subDir.Name);
Utils\FirstTimeUseNoticeSentinel.cs (2)
21_sentinelFilePath = Path.Combine(aspireUserDirectory, "cli", SentinelFileName); 38var directory = Path.GetDirectoryName(_sentinelFilePath);
Aspire.Cli.EndToEnd.Tests (79)
AgentCommandTests.cs (4)
100var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 175var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 216var vscodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode"); 242var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".github", "skills", "aspire", "SKILL.md");
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"), """
ConfigHealingTests.cs (1)
49var configFilePath = Path.Combine(
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");
DescribeCommandTests.cs (3)
120var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "AspireReplicaTestApp"); 121var appHostDir = Path.Combine(projectDir, "AspireReplicaTestApp.AppHost"); 122var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
DockerDeploymentTests.cs (6)
72var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 73var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 74var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 194var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 195var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 196var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
Helpers\CliE2ETestHelpers.cs (5)
153var cliBaseDir = Path.Combine(repoRoot, "artifacts", "bin", "Aspire.Cli"); 164return matches.Length > 0 ? Path.GetDirectoryName(matches[0]) : null; 200var dockerfilePath = Path.Combine(repoRoot, "tests", "Shared", "Docker", dockerfileName); 285if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx"))) 309var relativePath = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, hostPath);
KubernetesPublishTests.cs (4)
144var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 145var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 146var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 315cleanupProcess.StartInfo.FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "bin", "kind");
McpDocsE2ETests.cs (1)
30var cliProjectPath = Path.Combine(repoRoot, "src", "Aspire.Cli", "Aspire.Cli.csproj");
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"), """
PsCommandTests.cs (1)
107var outputFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "ps-output.json");
tests\Aspire.Hosting.Tests\Utils\MSBuildUtils.cs (2)
13while (directory != null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
tests\Shared\Hex1bTestHelpers.cs (4)
114recordingsDir = Path.Combine(githubWorkspace, "testresults", "recordings"); 119recordingsDir = Path.Combine(Path.GetTempPath(), localSubDir, "recordings"); 123return Path.Combine(recordingsDir, $"{testName}.cast");
tests\Shared\TemporaryRepo.cs (4)
60var tempPath = Path.GetTempPath(); 61var path = Path.Combine(tempPath, "Aspire.Cli.Tests", "TemporaryWorkspaces", Guid.NewGuid().ToString()); 68var aspireDir = Directory.CreateDirectory(Path.Combine(path, ".aspire")); 69File.WriteAllText(Path.Combine(aspireDir.FullName, "settings.json"), "{}");
TypeScriptCodegenValidationTests.cs (4)
60var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".modules"); 69var filePath = Path.Combine(modulesDir, file); 83var aspireTs = File.ReadAllText(Path.Combine(modulesDir, "aspire.ts")); 139var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
TypeScriptPolyglotTests.cs (1)
69var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
TypeScriptPublishTests.cs (1)
61var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts");
TypeScriptStarterTemplateTests.cs (3)
39var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "TsStarterApp"); 40var modulesDir = Path.Combine(projectRoot, ".modules"); 47var aspireModulePath = Path.Combine(modulesDir, "aspire.ts");
Aspire.Cli.Tests (951)
Agents\ClaudeCodeAgentEnvironmentScannerTests.cs (3)
25var mcpJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 53var mcpJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 78var mcpJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json");
Agents\CommonAgentApplicatorsTests.cs (9)
63var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, TestSkillRelativePath); 64var skillDirectory = Path.GetDirectoryName(skillFilePath)!; 89var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, TestSkillRelativePath); 90var skillDirectory = Path.GetDirectoryName(skillFilePath)!; 116var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, TestSkillRelativePath); 117var skillDirectory = Path.GetDirectoryName(skillFilePath)!; 144var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, TestSkillRelativePath); 145var skillDirectory = Path.GetDirectoryName(skillFilePath)!; 179var skillFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, TestSkillRelativePath);
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\OpenCodeAgentEnvironmentScannerTests.cs (3)
24var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc"); 50var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc"); 73var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc");
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")));
Agents\VsCodeAgentEnvironmentScannerTests.cs (10)
107var vsCodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode"); 126var mcpJsonPath = Path.Combine(parentVsCode.FullName, "mcp.json"); 143var mcpJsonPath = Path.Combine(vsCodeFolder.FullName, "mcp.json"); 188var mcpJsonPath = Path.Combine(vsCodeFolder.FullName, "mcp.json"); 229var mcpJsonPath = Path.Combine(vsCodeFolder.FullName, "mcp.json"); 281var mcpJsonPath = Path.Combine(vsCodeFolder.FullName, "mcp.json"); 309var mcpJsonPath = Path.Combine(vsCodeFolder.FullName, "mcp.json"); 334var mcpJsonPath = Path.Combine(vsCodeFolder.FullName, "mcp.json"); 395homeDirectory ??= new DirectoryInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()));
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\AddCommandTests.cs (1)
755var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
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\DeployCommandTests.cs (2)
276var testOutputPath = Path.Combine(Path.GetTempPath(), "test");
Commands\DescribeCommandTests.cs (1)
346AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\DotNetSdkCheckTests.cs (4)
104var filePath = Path.Combine(workspace.WorkspaceRoot.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 105Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 145? new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, appHostFileName))
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\ExtensionInternalCommandTests.cs (3)
60var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp.AppHost.csproj")); 101var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App1.AppHost.csproj")); 102var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App2.AppHost.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\LogsCommandTests.cs (1)
583AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
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\RestoreCommandTests.cs (2)
18var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 52var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "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\SdkDumpCommandTests.cs (5)
199var projectPath = Path.Combine(repoRoot, "src", "Aspire.Hosting", "Aspire.Hosting.csproj"); 202var tempDirectory = Path.Combine(Path.GetTempPath(), "aspire-sdk-dump-tests", $"{Guid.NewGuid():N}"); 204var outputPath = Path.Combine(tempDirectory, "capabilities.txt"); 252if (File.Exists(Path.Combine(currentDirectory.FullName, "Aspire.slnx")))
Commands\SdkInstallerTests.cs (3)
29await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent); 116await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent); 154await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent);
Commands\SecretCommandTests.cs (2)
21var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 45var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"));
Commands\TelemetryTestHelper.cs (1)
76AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
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\ConfigurationHelperTests.cs (2)
16var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 20var globalSettingsFile = new FileInfo(Path.Combine(globalDir.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");
Configuration\IntegrationReferenceTests.cs (1)
75Assert.True(Path.IsPathRooted(projectRef.ProjectPath!));
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\E2E\McpDocsE2ETests.cs (2)
289while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "Aspire.slnx"))) 300var cliProjectPath = Path.Combine(dir.FullName, "src", "Aspire.Cli", "Aspire.Cli.csproj");
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");
Mcp\MockPackagingService.cs (9)
55new DirectoryInfo(Path.GetTempPath()), 56new DirectoryInfo(Path.Combine(Path.GetTempPath(), "hives")), 57new DirectoryInfo(Path.Combine(Path.GetTempPath(), "cache")), 58new DirectoryInfo(Path.Combine(Path.GetTempPath(), "sdks")), 59new DirectoryInfo(Path.Combine(Path.GetTempPath(), "logs")),
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\AppHostServerProjectTests.cs (7)
63var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json"); 84var programCsPath = Path.Combine(project.ProjectModelPath, "Program.cs"); 106var programCs = Path.Combine(project.ProjectModelPath, "Program.cs"); 129var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json"); 230var settingsJson = Path.Combine(aspireDir.FullName, "settings.json"); 261var projectModelPath = Path.Combine(appPath, ".aspire_server"); 292var projectFilePath = Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName);
Projects\DefaultLanguageDiscoveryTests.cs (8)
109var file = new FileInfo(Path.Combine(Path.GetTempPath(), fileName)); 124var file = new FileInfo(Path.Combine(Path.GetTempPath(), fileName)); 135var file = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.go")); 148var file = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.go"));
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\GuestAppHostProjectTests.cs (7)
42var settingsPath = Path.Combine(settingsDir.FullName, "settings.json"); 62var settingsPath = Path.Combine(settingsDir.FullName, "settings.json"); 248var settingsPath = Path.Combine(settingsDir.FullName, "settings.json"); 308var launchSettingsPath = Path.Combine(propertiesDir.FullName, "launchSettings.json"); 349SettingsFilePath = Path.Combine(workspaceRoot.FullName, "nonexistent", "settings.json") 354var logFilePath = Path.Combine(Path.GetTempPath(), $"test-guest-{Guid.NewGuid()}.log");
Projects\GuestRuntimeTests.cs (6)
317var (exitCode, output) = await runtime.InstallDependenciesAsync(new DirectoryInfo(Path.GetTempPath()), CancellationToken.None); 344var appHostFile = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.ts")); 367var logFilePath = Path.Combine(Path.GetTempPath(), $"guest-output-test-{Guid.NewGuid()}.log"); 382new DirectoryInfo(Path.GetTempPath()),
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");
Secrets\SecretsStoreTests.cs (7)
14_tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}"); 26private string GetSecretsPath() => Path.Combine(_tempDir, "secrets.json"); 114var dir = Path.GetDirectoryName(path)!; 136var dir = Path.GetDirectoryName(path)!; 166var dir = Path.GetDirectoryName(path)!; 200var path = Path.Combine(_tempDir, "nested", "dir", "secrets.json");
Telemetry\AspireCliTelemetryTests.cs (1)
133var otherSourceName = $"Test.{Path.GetRandomFileName()}";
Telemetry\TelemetryFixture.cs (2)
32ReportedSourceName = $"Test.{Path.GetRandomFileName()}"; 33DiagnosticsSourceName = $"Test.{Path.GetRandomFileName()}";
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");
tests\Shared\TemporaryRepo.cs (4)
60var tempPath = Path.GetTempPath(); 61var path = Path.Combine(tempPath, "Aspire.Cli.Tests", "TemporaryWorkspaces", Guid.NewGuid().ToString()); 68var aspireDir = Directory.CreateDirectory(Path.Combine(path, ".aspire")); 69File.WriteAllText(Path.Combine(aspireDir.FullName, "settings.json"), "{}");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
TestServices\TestAuxiliaryBackchannelMonitor.cs (6)
52string.Equals(Path.GetFullPath(c.AppHostInfo.AppHostPath), Path.GetFullPath(SelectedAppHostPath), StringComparison.OrdinalIgnoreCase)); 91var normalizedWorkingDirectory = Path.GetFullPath(workingDirectory); 92var normalizedAppHostPath = Path.GetFullPath(appHostPath); 95var relativePath = Path.GetRelativePath(normalizedWorkingDirectory, normalizedAppHostPath); 96return !relativePath.StartsWith("..", StringComparison.Ordinal) && !Path.IsPathRooted(relativePath);
TestServices\TestCliDownloader.cs (1)
37var path = Path.Combine(_tempDirectory.FullName, filename);
TestServices\TestDotNetCliRunner.cs (2)
76PlatformID.Win32NT => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet", "NuGet.Config")], 77_ => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet.Config")],
TestServices\TestLanguageDiscovery.cs (1)
58var filePath = Path.Combine(directory.FullName, pattern);
TestServices\TestProjectLocator.cs (2)
30var fakeProjectFilePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString(), "AppHost.csproj");
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\AspireRepositoryDetectorTests.cs (4)
39File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty); 41var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "src", "Project")).FullName; 65File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty); 70var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "playground", "polyglot")).FullName;
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\CommandPathResolverTests.cs (1)
23Assert.Equal($"{Path.GetFileNameWithoutExtension(command)} is not installed or not found in PATH. Please install Node.js and try again.", errorMessage);
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");
Utils\FirstTimeUseNoticeSentinelTests.cs (8)
29var cliDir = Path.Combine(workspace.WorkspaceRoot.FullName, "cli"); 31var sentinelFilePath = Path.Combine(cliDir, "cli.firstUseSentinel"); 53var sentinelFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli", "cli.firstUseSentinel"); 62var cliDir = Path.Combine(workspace.WorkspaceRoot.FullName, "cli"); 64var sentinelFilePath = Path.Combine(cliDir, "cli.firstUseSentinel"); 81var nonExistentDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "non-existent-dir"); 88var cliDir = Path.Combine(nonExistentDirectory, "cli"); 89var sentinelFilePath = Path.Combine(cliDir, "cli.firstUseSentinel");
Utils\IsolatedUserSecretsHelperTests.cs (2)
61var sourceDir = Path.GetDirectoryName(sourcePath)!; 114var secretsDir = Path.GetDirectoryName(secretsPath)!;
Aspire.Components.Common.TestUtilities (1)
ConformanceTests.cs (1)
49protected string JsonSchemaPath => Path.Combine(AppContext.BaseDirectory, "ConfigurationSchema.json");
Aspire.Dashboard (7)
Components\Dialogs\GenAIVisualizerDialog.razor.cs (1)
322FileName: CalculateFileName(Path.GetFileName(result.LocalPath), uriPart.MimeType!));
Components\Pages\ConsoleLogs.razor.cs (1)
903: string.Join("_", PageViewModel.SelectedResource.Id!.InstanceId!.Split(Path.GetInvalidFileNameChars()));
Model\ResourceIconHelpers.cs (1)
51var extension = Path.GetExtension(projectPath);
Model\TelemetryImportService.cs (1)
62var extension = Path.GetExtension(fileName).ToLowerInvariant();
src\Shared\Export\ExportArchive.cs (1)
131var invalidChars = Path.GetInvalidFileNameChars();
src\Shared\Model\ResourceSourceViewModel.cs (2)
17return new ResourceSource(Path.GetFileName(projectPath), projectPath); 30return new ResourceSource(Path.GetFileName(executablePath), executablePath);
Aspire.Dashboard.Tests (19)
Integration\OtlpGrpcServiceTests.cs (1)
163var configPath = Path.GetTempFileName();
Integration\Playwright\Infrastructure\DashboardServerFixture.cs (2)
43var currentAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 54WebRootPath = Path.Combine(aspireAssemblyDirectory, "wwwroot"),
Integration\StartupTests.cs (10)
141var configFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 240var fileConfigDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 634var configFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 1147var browserTokenConfigFile = Path.Combine(fileConfigDirectory.FullName, DashboardConfigNames.DashboardFrontendBrowserTokenName.EnvVarName);
tests\Shared\Playwright\PlaywrightProvider.cs (1)
55var probePath = Path.Combine(repoRoot.FullName, "artifacts", "bin", "playwright-deps");
tests\Shared\Playwright\TestUtils.cs (2)
14if (Directory.Exists(Path.Combine(repoRoot.FullName, ".git")) || File.Exists(Path.Combine(repoRoot.FullName, ".git")))
tests\Shared\TestCertificateLoader.cs (3)
10private static readonly string s_baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 17public static string TestCertificatePath { get; } = Path.Combine(s_baseDir, "testCert.pfx"); 18public static string GetCertPath(string name) => Path.Combine(s_baseDir, name);
Aspire.Deployment.EndToEnd.Tests (71)
AcaCompactNamingDeploymentTests.cs (1)
102var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AcaCompactNamingUpgradeDeploymentTests.cs (1)
118var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AcaCustomRegistryDeploymentTests.cs (3)
121var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 122var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 123var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AcaDeploymentErrorOutputTests.cs (2)
60var deployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "deploy-output.txt"); 104var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AcaExistingRegistryDeploymentTests.cs (3)
143var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 144var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 145var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AcaManagedRedisDeploymentTests.cs (6)
185var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 186var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 187var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 217var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 218var serverDir = Path.Combine(projectDir, $"{projectName}.Server"); 219var programFilePath = Path.Combine(serverDir, "Program.cs");
AcaStarterDeploymentTests.cs (3)
113var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 114var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 115var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AcrPurgeTaskDeploymentTests.cs (4)
108var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 109var appHostFilePath = Path.Combine(projectDir, "apphost.cs"); 174var projectDir2 = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 175var mainPyPath = Path.Combine(projectDir2, "app", "main.py");
AksStarterDeploymentTests.cs (3)
190var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 191var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 192var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AksStarterWithRedisDeploymentTests.cs (3)
189var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 190var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 191var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AppServicePythonDeploymentTests.cs (2)
111var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 113var appHostFilePath = Path.Combine(projectDir, "apphost.cs");
AppServiceReactDeploymentTests.cs (3)
113var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 114var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 115var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AzureAppConfigDeploymentTests.cs (1)
120var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureContainerRegistryDeploymentTests.cs (1)
98var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureEventHubsDeploymentTests.cs (1)
120var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureKeyVaultDeploymentTests.cs (1)
120var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureLogAnalyticsDeploymentTests.cs (1)
98var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureServiceBusDeploymentTests.cs (1)
121var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureStorageDeploymentTests.cs (1)
121var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
PythonFastApiDeploymentTests.cs (2)
112var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 114var appHostFilePath = Path.Combine(projectDir, "apphost.cs");
tests\Shared\Hex1bTestHelpers.cs (4)
114recordingsDir = Path.Combine(githubWorkspace, "testresults", "recordings"); 119recordingsDir = Path.Combine(Path.GetTempPath(), localSubDir, "recordings"); 123return Path.Combine(recordingsDir, $"{testName}.cast");
tests\Shared\TemporaryRepo.cs (4)
60var tempPath = Path.GetTempPath(); 61var path = Path.Combine(tempPath, "Aspire.Cli.Tests", "TemporaryWorkspaces", Guid.NewGuid().ToString()); 68var aspireDir = Directory.CreateDirectory(Path.Combine(path, ".aspire")); 69File.WriteAllText(Path.Combine(aspireDir.FullName, "settings.json"), "{}");
TypeScriptExpressDeploymentTests.cs (2)
115var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 116var appHostFilePath = Path.Combine(projectDir, "apphost.ts");
VnetKeyVaultConnectivityDeploymentTests.cs (5)
136var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 137var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 138var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 178var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 179var webProgramPath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
VnetKeyVaultInfraDeploymentTests.cs (1)
122var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
VnetSqlServerConnectivityDeploymentTests.cs (5)
136var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 137var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 138var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 179var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 180var webProgramPath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
VnetSqlServerInfraDeploymentTests.cs (1)
122var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
VnetStorageBlobConnectivityDeploymentTests.cs (5)
138var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 139var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 140var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 183var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 184var webProgramPath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
VnetStorageBlobInfraDeploymentTests.cs (1)
123var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
Aspire.EndToEnd.Tests (61)
IntegrationServicesFixture.cs (2)
47_testProjectPath = Path.Combine(BuildEnvironment.TestAssetsPath, "testproject"); 56_testProjectPath = Path.Combine(BuildEnvironment.RepoRoot.FullName, "tests", "testproject");
tests\Shared\Playwright\PlaywrightProvider.cs (1)
55var probePath = Path.Combine(repoRoot.FullName, "artifacts", "bin", "playwright-deps");
tests\Shared\Playwright\TestUtils.cs (2)
14if (Directory.Exists(Path.Combine(repoRoot.FullName, ".git")) || File.Exists(Path.Combine(repoRoot.FullName, ".git")))
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\RunCommand.cs (2)
13WithEnvironmentVariable("DOTNET_ROOT", Path.GetDirectoryName(_buildEnvironment.DotNet)!); 14WithEnvironmentVariable("DOTNET_INSTALL_DIR", Path.GetDirectoryName(_buildEnvironment.DotNet)!);
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)
ApplicationModel\AspireStore.cs (5)
29if (!Path.IsPathRooted(basePath)) 49filenameTemplate = Path.GetFileName(filenameTemplate); 64var name = Path.GetFileNameWithoutExtension(filenameTemplate); 65var ext = Path.GetExtension(filenameTemplate); 66var finalFilePath = Path.Combine(_basePath, $"{name}.{Convert.ToHexString(hash.GetCurrentHash())[..12].ToLowerInvariant()}{ext}");
ApplicationModel\CertificateTrustConfigurationCallbackAnnotation.cs (1)
132var bundleFilename = IsContainer ? $"{RootCertificatesPath}/bundles/{bundleId}" : Path.Join(RootCertificatesPath, "bundles", bundleId);
ApplicationModel\ContainerFileSystemCallbackAnnotation.cs (6)
26if (Path.GetDirectoryName(value) != string.Empty) 135var fullPath = Path.GetFullPath(path); 151var fileName = Path.GetFileName(relativePath); 152var parts = relativePath.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries); 210Name = Path.GetFileName(fullPath),
ApplicationModel\ContainerMountAnnotation.cs (1)
31if (!Path.IsPathRooted(source))
ApplicationModel\ProjectRebuilderResource.cs (1)
23: base(name, "dotnet", Path.GetDirectoryName(projectPath)!)
ApplicationModel\ProjectResource.cs (1)
166var projectDir = Path.GetDirectoryName(projectMetadata.ProjectPath)!;
ApplicationModel\RequiredCommandValidator.cs (3)
190if (command.IndexOfAny([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]) >= 0) 192var candidate = Path.GetFullPath(command);
ApplicationModel\ResourceExtensions.cs (1)
1239return Path.Combine(outputPath, fileName);
Backchannel\AuxiliaryBackchannelService.cs (2)
50var directory = Path.GetDirectoryName(SocketPath); 209return Path.Combine(backchannelsDir, $"{BackchannelConstants.SocketPrefix}.{fallbackHash}.{Environment.ProcessId}");
ContainerResourceBuilderExtensions.cs (13)
261var sourcePath = Path.IsPathRooted(source) ? source : Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory); 591var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 592.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 596var fullyQualifiedDockerfilePath = Path.GetFullPath(dockerfilePath, fullyQualifiedContextPath); 733var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 734.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 1342var sourceFullPath = Path.GetFullPath(sourcePath, builder.ApplicationBuilder.AppHostDirectory); 1442var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 1443.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
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");
Dcp\DcpHost.cs (1)
310var directoryName = Path.GetDirectoryName(socketPath);
Dcp\DcpOptions.cs (3)
159options.ExtensionsPath = Path.Combine(configDcpPath, "ext"); 165if (Path.GetDirectoryName(options.CliPath) is string dcpDir && !string.IsNullOrEmpty(dcpDir)) 167options.ExtensionsPath = Path.Combine(dcpDir, "ext");
Dcp\Locations.cs (2)
20public string DcpKubeconfigPath => Path.Combine(DcpSessionDir, "kubeconfig"); 22public string DcpLogSocket => Path.Combine(DcpSessionDir, "output.sock");
Devcontainers\DevcontainerSettingsWriter.cs (6)
220yield return Path.Combine(userHomeDir, VscodeRemotePathSegment); 224var vscodeServerPath = Path.Combine(userHomeDir, VscodeServerPathSegment); 225var vscodeInsidersServerPath = Path.Combine(userHomeDir, VscodeInsidersServerPathSegment); 229yield return Path.Combine(vscodeServerPath, LocalDevcontainerSettingsPath); 234yield return Path.Combine(vscodeInsidersServerPath, LocalDevcontainerSettingsPath); 250Directory.CreateDirectory(Path.GetDirectoryName(path)!);
DistributedApplicationBuilder.cs (7)
222var appHostPath = Path.Join(AppHostDirectory, appHostName); 225AppHostPath = Path.GetFullPath(appHostPath); 374return new AspireStore(Path.Combine(aspireDir, ".aspire"), directoryService); 817var userSecretsFilePath = Path.GetFullPath(UserSecretsPathHelper.GetSecretsPathFromSecretsId(userSecretsId)); 841string.Equals(Path.GetFullPath(left), Path.GetFullPath(right), OperatingSystem.IsWindows() ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal); 906var deploymentStatePath = Path.Combine(
DistributedApplicationOptions.cs (11)
143if (string.IsNullOrEmpty(appHostFilePath) || string.Equals(Path.GetExtension(appHostFilePath), ".csproj", StringComparison.OrdinalIgnoreCase)) 151return Path.GetFileName(Path.TrimEndingDirectorySeparator(projectDirectory)); 154var appHostDirectory = Path.GetDirectoryName(appHostFilePath); 157: Path.GetFileName(Path.TrimEndingDirectorySeparator(appHostDirectory)); 166return Path.GetFullPath(entryPointFilePath); 177var fullPath = Path.GetFullPath(projectPath); 183var csprojPath = Path.Combine(fullPath, $"{name}.csproj"); 204var csprojPath = Path.Combine(projectDirectory, $"{projectName}.csproj"); 207return Path.GetFullPath(csprojPath);
Exec\ExecResourceManager.cs (1)
199var projectDir = Path.GetDirectoryName(projectMetadata.ProjectPath) ?? throw new InvalidOperationException("Project path is invalid.");
ExecutableResourceBuilderExtensions.cs (2)
58workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 213workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.ApplicationBuilder.AppHostDirectory, workingDirectory));
IDistributedApplicationBuilder.cs (1)
152/// <see cref="Path.GetTempPath"/> or <see cref="Directory.CreateTempSubdirectory(string?)"/> to ensure
IProjectMetadata.cs (2)
36public bool IsFileBasedApp => string.Equals(Path.GetExtension(ProjectPath), ".cs", StringComparison.OrdinalIgnoreCase); 65return Path.GetFullPath(projectFiles[0]);
Pipelines\Internal\FileDeploymentStateManager.cs (3)
69var aspireDir = Path.Combine( 76return Path.Combine(aspireDir, $"{environment}.json"); 98var deploymentStateDirectory = Path.GetDirectoryName(deploymentStatePath)!;
Pipelines\PipelineOutputService.cs (4)
32_outputPath = options.Value.OutputPath is not null ? Path.GetFullPath(options.Value.OutputPath) : null; 39return _outputPath ?? Path.Combine(Environment.CurrentDirectory, "aspire-output"); 48return Path.Combine(baseOutputDir, resource.Name); 63return Path.Combine(baseTempDir, resource.Name);
ProjectResourceBuilderExtensions.cs (11)
298projectPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, projectPath)); 380path = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, path)); 404&& await DotnetSdkUtils.TryGetVersionAsync(Path.GetDirectoryName(projectPath)).ConfigureAwait(false) is { } version 411throw new DistributedApplicationException($"File-based apps are only supported on .NET 10 or later. The version active in '{Path.GetDirectoryName(projectPath)}' {versionValue}."); 862var projectDirectoryPath = Path.GetDirectoryName(projectFilePath) ?? throw new InvalidOperationException($"Unable to get directory name for {projectFilePath}"); 893var projectDirectoryPath = Path.GetDirectoryName(projectMetadata.ProjectPath)!; 895var appSettingsPath = Path.Combine(projectDirectoryPath, "appsettings.json"); 896var appSettingsEnvironmentPath = Path.Combine(projectDirectoryPath, $"appsettings.{env}.json"); 898var appFileName = Path.GetFileName(projectDirectoryPath); 899var appNameSettingsPath = Path.Combine(projectDirectoryPath, $"{appFileName}.settings.json"); 900var appNameSettingsEnvironmentPath = Path.Combine(projectDirectoryPath, $"{appFileName}.settings.{env}.json");
Publishing\DockerContainerRuntime.cs (3)
152var normalizedContextPath = Path.GetFullPath(contextPath).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Publishing\ManifestPublisher.cs (2)
45_options.Value.OutputPath = Path.Combine(_options.Value.OutputPath, "aspire-manifest.json"); 60var fullyQualifiedPath = Path.GetFullPath(_options.Value.OutputPath);
Publishing\ManifestPublishingContext.cs (8)
70var fullyQualifiedManifestPath = Path.GetFullPath(ManifestPath); 71var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 73var normalizedPath = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 74var relativePath = Path.GetRelativePath(manifestDirectory, normalizedPath); 381var manifestDirectory = Path.GetDirectoryName(Path.GetFullPath(ManifestPath))!; 382var resourceDockerfilePath = Path.Combine(manifestDirectory, $"{container.Name}.Dockerfile");
Publishing\ManifestPublishingExtensions.cs (2)
53outputPath = Path.Combine(outputPath, "aspire-manifest.json"); 71var fullyQualifiedPath = Path.GetFullPath(outputPath);
Publishing\PodmanContainerRuntime.cs (1)
50arguments += $" --output \"{Path.Combine(options.OutputPath, resourceName)}.tar\"";
src\Shared\BackchannelConstants.cs (8)
91=> Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 125return Path.Combine(dir, $"{SocketPrefix}.{hash}.{processId}"); 142return Path.Combine(dir, $"{SocketPrefix}.{hash}"); 158var dir = Path.GetDirectoryName(prefix); 159var prefixFileName = Path.GetFileName(prefix); 175var fileName = Path.GetFileName(f); 199var fileName = Path.GetFileName(socketPath); 229var fileName = Path.GetFileName(socketPath);
src\Shared\BundleDiscovery.cs (10)
105var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 111dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 112dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 136var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 137var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 235return Path.Combine(dcpDirectory, exeName); 271var fileName = Path.GetFileNameWithoutExtension(path); 327return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 345return Path.GetDirectoryName(processPath);
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
86null => Path.Combine("Properties", "launchSettings.json"), 87_ => Path.Combine(projectFileInfo.DirectoryName, "Properties", "launchSettings.json") 100var runSettingsFilePath = Path.ChangeExtension(projectMetadata.ProjectPath, ".run.json");
src\Shared\PathLookupHelper.cs (3)
23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions); 58var fullPathWithExt = Path.Combine(directory, command + extension); 67var fullPath = Path.Combine(directory, command);
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
src\Shared\UserSecrets\UserSecretsPathHelper.cs (2)
52? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 53: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
UserSecrets\UserSecretsManagerFactory.cs (2)
44var normalizedPath = Path.GetFullPath(filePath); 203var directoryName = Path.GetDirectoryName(FilePath);
Utils\FileSystemService.cs (3)
153var tempFile = Path.GetTempFileName(); 161var filePath = Path.Combine(tempDir, fileName); 270var parentDir = System.IO.Path.GetDirectoryName(_path);
Utils\IFileSystemService.cs (2)
60/// and places the file with that name inside it. If no file name is specified, it uses <see cref="Path.GetTempFileName"/>. 64/// Use this instead of calling <see cref="Path.GetTempFileName"/> directly.
Aspire.Hosting.Analyzers.Tests (1)
AnalyzerTest.cs (1)
57Path.Combine("ref", $"net{s_targetFrameworkVersion}"));
Aspire.Hosting.Azure (15)
AzureBicepResource.cs (4)
160? Path.Combine(directory ?? Directory.CreateTempSubdirectory("aspire").FullName, $"{Name.ToLowerInvariant()}.module.bicep") 161: Path.Combine(TempDirectory, $"{Name.ToLowerInvariant()}.module.bicep"); 172: Path.Combine(directory, $"{TemplateResourceName.ToLowerInvariant()}"); 224using var template = GetBicepTemplateFile(Path.GetDirectoryName(context.ManifestPath), deleteTemporaryFileOnDispose: false);
AzureBicepResourceExtensions.cs (2)
28var path = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, bicepFile));
AzureProvisioningResource.cs (2)
88var moduleSourcePath = Path.Combine(generationPath, "main.bicep"); 96var moduleDestinationPath = Path.Combine(directory ?? generationPath, $"{Name}.module.bicep");
AzurePublishingContext.cs (4)
158var modulePath = Path.Combine(moduleDirectory.FullName, $"{resource.Name}.bicep"); 353var resourceDockerfilePath = Path.Combine(outputPath, $"{resource.Name}.Dockerfile"); 366var modulePath = Path.Combine(moduleDirectory.FullName, $"{resource.Name}.bicep"); 492var bicepPath = Path.Combine(outputDirectoryPath, $"{MainInfrastructure.BicepName}.bicep");
src\Shared\PathLookupHelper.cs (3)
23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions); 58var fullPathWithExt = Path.Combine(directory, command + extension); 67var fullPath = Path.Combine(directory, command);
Aspire.Hosting.Azure.Functions (8)
AzureFunctionsProjectResourceExtensions.cs (5)
126projectPath = NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, projectPath)); 400path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 402return Path.GetFullPath(path); 431return Path.GetFullPath(projectFiles[0]);
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
86null => Path.Combine("Properties", "launchSettings.json"), 87_ => Path.Combine(projectFileInfo.DirectoryName, "Properties", "launchSettings.json") 100var runSettingsFilePath = Path.ChangeExtension(projectMetadata.ProjectPath, ".run.json");
Aspire.Hosting.Azure.Kusto.Tests (3)
AddAzureKustoTests.cs (1)
240Assert.Equal(Path.Combine(builder.AppHostDirectory, "custom-data"), mountAnnotation.Source);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Azure.Tests (48)
AzureAppServiceTests.cs (2)
269File.WriteAllText(Path.Combine(directory.FullName, "Dockerfile"), ""); 440Path.Combine(tempDir.Path, "aspire-manifest.json"),
AzureBicepResourceTests.cs (4)
261var bicepFilePath = Path.Combine(tempDir.Path, bicepFileName); 268var outputDir = Path.Combine(tempDir.Path, "output"); 286var bicepFilePath = Path.Combine(tempDir.Path, bicepFileName); 310var outputDir = Path.Combine(tempDir.Path, "output");
AzureContainerAppsTests.cs (3)
67File.WriteAllText(Path.Combine(directory.FullName, "Dockerfile"), ""); 1765await VerifyFile(Path.Combine(tempDir.Path, "aspire-manifest.json")); 2139File.WriteAllText(Path.Combine(tempDirectory.Path, "Dockerfile"), "FROM alpine");
AzureDeployerTests.cs (2)
1440var deploymentStatePath = Path.Combine( 1447Directory.CreateDirectory(Path.GetDirectoryName(deploymentStatePath)!);
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");
AzureEventHubsExtensionsTests.cs (3)
167Assert.Equal(Path.Combine(builder.AppHostDirectory, ".eventhubs", "eh"), volumeAnnotation.Source); 186Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source); 451var configJsonPath = Path.GetTempFileName();
AzureFunctionsTests.cs (9)
650var projectPath = Path.Combine(tempDir.Path, "TestFunctions.csproj"); 675var projectPath = Path.Combine(tempDir.Path, "MyFunctions.csproj"); 679var relativePath = Path.GetRelativePath(builder.AppHostDirectory, projectPath); 687Assert.True(Path.IsPathRooted(projectMetadata.ProjectPath)); 697var projectPath = Path.Combine(tempDir.Path, "TestFunctions.csproj"); 727var projectPath1 = Path.Combine(tempDir.Path, "Functions1.csproj"); 728var projectPath2 = Path.Combine(tempDir.Path, "Functions2.csproj"); 750var projectPath = Path.Combine(tempDir.Path, "Functions.csproj"); 782var projectPath = Path.Combine(tempDir.Path, "Functions.csproj");
AzureManifestUtils.cs (2)
40if (pathNode?.ToString() is not { } path || !File.Exists(Path.Combine(manifestDir, path))) 45var bicepText = await File.ReadAllTextAsync(Path.Combine(manifestDir, path));
AzureResourceOptionsTests.cs (3)
24var outputPath = Path.Combine(tempDir.FullName, "aspire-manifest.json"); 44var sbBicep = await File.ReadAllTextAsync(Path.Combine(tempDir.FullName, "sb.module.bicep")); 46var sqlBicep = await File.ReadAllTextAsync(Path.Combine(tempDir.FullName, "sql-server.module.bicep"));
AzureServiceBusExtensionsTests.cs (2)
556var configJsonPath = Path.GetTempFileName(); 781var configJsonPath = Path.GetTempFileName();
AzureStorageExtensionsTests.cs (2)
37Assert.Equal(Path.Combine(builder.AppHostDirectory, ".azurite", "storage"), volumeAnnotation.Source); 63Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Go (2)
GoLanguageSupport.cs (2)
109var appHostPath = Path.Combine(directoryPath, "apphost.go"); 115var goModPath = Path.Combine(directoryPath, "go.mod");
Aspire.Hosting.CodeGeneration.Go.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Java (1)
JavaLanguageSupport.cs (1)
93var appHostPath = Path.Combine(directoryPath, "AppHost.java");
Aspire.Hosting.CodeGeneration.Java.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Python (3)
PythonLanguageSupport.cs (3)
121var appHostPath = Path.Combine(directoryPath, "apphost.py"); 127var requirementsPath = Path.Combine(directoryPath, "requirements.txt"); 209var fullPath = Path.Combine(path, command + ext);
Aspire.Hosting.CodeGeneration.Python.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Rust (2)
RustLanguageSupport.cs (2)
108var appHostPath = Path.Combine(directoryPath, "apphost.rs"); 114var cargoPath = Path.Combine(directoryPath, "Cargo.toml");
Aspire.Hosting.CodeGeneration.Rust.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.TypeScript (2)
TypeScriptLanguageSupport.cs (2)
158var appHostPath = Path.Combine(directoryPath, "apphost.ts"); 165var packageJsonPath = Path.Combine(directoryPath, "package.json");
Aspire.Hosting.CodeGeneration.TypeScript.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Containers.Tests (12)
ContainerResourceTests.cs (1)
240Assert.Equal(Path.Combine(basePath, "source"), mountAnnotation.Source);
DockerSocketBindMountTests.cs (2)
23var dockerFilePath = Path.Combine(dir.Path, "Dockerfile"); 47var infoFile = Path.Combine(outDir.Path, "docker-info.txt");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
WithDockerfileTests.cs (7)
255var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 303var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 350var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 396var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 840var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 884var manifestPath = Path.Combine(tempDir.FullName, "manifest.json"); 899var dockerfilePath = Path.Combine(tempDir.FullName, "testcontainer.Dockerfile");
Aspire.Hosting.Docker (11)
DockerComposeEnvironmentResource.cs (4)
220var dockerComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml"); 287var dockerComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml"); 395var envFilePath = Path.Combine(outputPath, $".env.{environmentName}"); 402var dockerComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml");
DockerComposePublishingContext.cs (7)
98var resourceDockerfilePath = Path.Combine(OutputPath, $"{serviceResource.TargetResource.Name}.Dockerfile"); 149var outputFile = Path.Combine(OutputPath, "docker-compose.yaml"); 155var envFilePath = Path.Combine(OutputPath, ".env"); 197sourcePath = Path.Combine(OutputPath, composeService.Name, Path.GetFileName(file.SourcePath)); 199Directory.CreateDirectory(Path.Combine(OutputPath, composeService.Name)); 203sourcePath = Path.GetRelativePath(OutputPath, sourcePath).Replace('\\', '/');
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");
DockerComposeTests.cs (5)
62var composeFile = Path.Combine(tempDir.FullName, "docker-compose.yaml"); 87var composeFile = Path.Combine(tempDir.FullName, "docker-compose.yaml"); 170var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml"); 204var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml"); 293var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
EnvFileTests.cs (6)
12var envFilePath = Path.Combine(tempDir.Path, ".env"); 38var envFilePath = Path.Combine(tempDir.Path, ".env"); 64var envFilePath = Path.Combine(tempDir.Path, ".env"); 104var envFilePath = Path.Combine(tempDir.Path, ".env"); 129var envFilePath = Path.Combine(tempDir.Path, ".env"); 146var envFilePath = Path.Combine(tempDir.Path, ".env");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Foundry.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Garnet.Tests (4)
AddGarnetTests.cs (1)
241Assert.Equal(Path.Combine(builder.AppHostDirectory, "mygarnetdata"), volumeAnnotation.Source);
GarnetFunctionalTests.cs (3)
127bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
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);
NodeAppFixture.cs (2)
75File.WriteAllText(Path.Combine(tempDir, "app.js"), 95File.WriteAllText(Path.Combine(tempDir, "package.json"),
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");
ResourceCreationTests.cs (1)
44Assert.Equal(Path.Combine(builder.AppHostDirectory, "test"), resource.WorkingDirectory);
Aspire.Hosting.Kafka.Tests (4)
AddKafkaTests.cs (1)
144Assert.Equal(Path.Combine(appBuilder.AppHostDirectory, "kafka-data"), volumeAnnotation.Source);
KafkaFunctionalTests.cs (3)
141bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Keycloak (2)
KeycloakResourceBuilderExtensions.cs (2)
208var importFullPath = Path.GetFullPath(import, builder.ApplicationBuilder.AppHostDirectory); 237var importFullPath = Path.GetFullPath(import, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.Keycloak.Tests (8)
KeycloakPublicApiTests.cs (7)
154var tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 177var tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 181var filePath = Path.Combine(tempDirectory, file);
KeycloakResourceBuilderTests.cs (1)
82Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
Aspire.Hosting.Kubernetes (5)
KubernetesPublishingContext.cs (5)
86var resourceDockerfilePath = Path.Combine(OutputPath, $"{serviceResource.TargetResource.Name}.Dockerfile"); 166var templatesFolder = Path.Combine(OutputPath, "templates", resource.Name); 172var outputFile = Path.Combine(templatesFolder, fileName); 200var outputFile = Path.Combine(OutputPath!, "values.yaml"); 220var outputFile = Path.Combine(OutputPath, "Chart.yaml");
Aspire.Hosting.Kubernetes.Tests (25)
KubernetesEnvironmentResourceTests.cs (3)
29var chartYaml = Path.Combine(tempDir.FullName, "Chart.yaml"); 30var valuesYaml = Path.Combine(tempDir.FullName, "values.yaml"); 31var deploymentYaml = Path.Combine(tempDir.FullName, "templates", "service", "deployment.yaml");
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..];
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Maui (9)
MauiPlatformHelper.cs (3)
26if (!Path.IsPathRooted(projectPath)) 29Path.Combine(builder.ApplicationBuilder.AppHostDirectory, projectPath)); 32var workingDirectory = Path.GetDirectoryName(projectPath)
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
Utilities\MauiEnvironmentHelper.cs (3)
76var targetsFilePath = Path.Combine(tempDirectory, $"{sanitizedName}-{uniqueId}.targets"); 183var invalidCharacters = Path.GetInvalidFileNameChars(); 247var targetsFilePath = Path.Combine(tempDirectory, $"{sanitizedName}-{uniqueId}.targets");
Aspire.Hosting.Maui.Tests (3)
MauiPlatformExtensionsTests.cs (1)
699var tempFile = Path.Combine(tempFolder.FullName, "TempMauiProject.csproj");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Milvus.Tests (3)
MilvusFunctionalTests.cs (3)
98bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
254var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.MongoDB.Tests (11)
MongoDbFunctionalTests.cs (11)
138bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 262var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 267var initFilePath = Path.Combine(bindMountPath, "mongo-init.js"); 360var initFilesPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 365var initFilePath = Path.Combine(initFilesPath, "mongo-init.js");
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
384var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.MySql.Tests (8)
MySqlFunctionalTests.cs (8)
309var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 315File.WriteAllText(Path.Combine(bindMountPath, "init.sql"), """ 396var initFilesPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 402File.WriteAllText(Path.Combine(initFilesPath, "init.sql"), """
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
152var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.Oracle.Tests (2)
OracleFunctionalTests.cs (2)
278File.WriteAllText(Path.Combine(bindMountPath, "01_init.sql"), $""" 370File.WriteAllText(Path.Combine(initFilesPath, "01_init.sql"), $"""
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
517var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.PostgreSQL.Tests (15)
AddPostgresTests.cs (4)
579Assert.Equal(".toml", Path.GetExtension(file.Name)); 586Assert.Equal(".toml", Path.GetExtension(file.Name)); 886Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source); 913Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
PostgresFunctionalTests.cs (11)
224bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 369var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 375File.WriteAllText(Path.Combine(bindMountPath, "init.sql"), """ 457var initFilesPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 463File.WriteAllText(Path.Combine(initFilesPath, "init.sql"), """
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);
PythonVersionDetector.cs (2)
20var pythonVersionFile = Path.Combine(appDirectory, ".python-version"); 31var pyprojectFile = Path.Combine(appDirectory, "pyproject.toml");
VirtualEnvironment.cs (2)
26return Path.Join(virtualEnvironmentPath, "Scripts", name + ".exe"); 29return Path.Join(virtualEnvironmentPath, "bin", name);
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");
AddUvicornAppTests.cs (7)
18var appDirectory = Path.Combine(Path.GetTempPath(), "test-app"); 57File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 58File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent); 59File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 61var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 87var appDockerfilePath = Path.Combine(outputDir.Path, "main.Dockerfile");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Qdrant.Tests (3)
QdrantFunctionalTests.cs (3)
116bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Redis.Tests (4)
AddRedisTests.cs (1)
592Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
RedisFunctionalTests.cs (3)
286var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.RemoteHost (8)
AssemblyLoader.cs (3)
79var assemblyName = Path.GetFileNameWithoutExtension(file); 147probeDirs.Add(Path.GetFullPath(integrationLibsPath)); 151probeDirs.Add(Path.GetFullPath(applicationBasePath));
AtsCapabilityScanner.cs (1)
2689var xmlPath = Path.ChangeExtension(location, ".xml");
IntegrationLoadContext.cs (1)
46var path = Path.Combine(dir, $"{assemblyName.Name}.dll");
JsonRpcServer.cs (3)
45var tempDir = Path.GetTempPath(); 46socketPath = Path.Combine(tempDir, "aspire", "remote-app-host.sock"); 135var directory = Path.GetDirectoryName(_socketPath);
Aspire.Hosting.RemoteHost.Tests (4)
AssemblyLoaderTests.cs (4)
26[integrationLibs.Path, applicationBase.Path, Path.Combine(applicationBase.Path, "missing")]); 92Path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"aspire-remotehost-{Guid.NewGuid():N}"); 100File.WriteAllText(System.IO.Path.Combine(Path, fileName), string.Empty);
Aspire.Hosting.Seq.Tests (4)
AddSeqTests.cs (1)
160Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
SeqFunctionalTests.cs (3)
96bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
188var path = Path.Combine(source, dir);
Aspire.Hosting.SqlServer.Tests (3)
SqlServerFunctionalTests.cs (3)
157bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Testing (2)
DistributedApplicationFactory.cs (2)
348null => Path.Combine("Properties", "launchSettings.json"), 349_ => Path.Combine(projectFileInfo.FullName, "Properties", "launchSettings.json")
Aspire.Hosting.Testing.Tests (6)
TestingBuilderTests.cs (2)
51Path.Combine(MSBuildUtils.GetRepoRoot(), "artifacts", "bin", "TestProject.AppHost"), 57var appHostAssembly = Assembly.LoadFrom(Path.Combine(AppContext.BaseDirectory, testProjectAssemblyPath));
tests\Aspire.Hosting.Tests\Utils\MSBuildUtils.cs (2)
13while (directory != null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
tests\Shared\DistributedApplicationTestingBuilderExtensions.cs (2)
72var uniqueFolder = Path.Combine(baseDcpLogFolder, folderName); 128_testOutputHelper.WriteLine($"=== DCP Log: {Path.GetFileName(logFile)} ===");
Aspire.Hosting.Tests (192)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (8)
73var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 103var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 139var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 179var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}");
AspireStoreTests.cs (9)
19Assert.True(Directory.Exists(Path.GetDirectoryName(store.BasePath))); 29Assert.True(Path.IsPathRooted(path)); 36builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath(); 42Assert.DoesNotContain($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}", path); 43Assert.Contains(Path.GetTempPath(), path); 60builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath(); 78var tempFilename = Path.GetTempFileName(); 137builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath();
Backchannel\AuxiliaryBackchannelTests.cs (2)
264Assert.True(Path.IsPathRooted(appHostInfo.AppHostPath), $"Expected absolute path but got: {appHostInfo.AppHostPath}"); 291var fileName = Path.GetFileName(service.SocketPath);
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");
Dashboard\DashboardResourceTests.cs (3)
37var dashboardPath = Path.GetFullPath("dashboard"); 249var dashboardPath = Path.GetFullPath("dashboard.dll"); 572var dashboardPath = Path.GetFullPath("dashboard");
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");
DistributedApplicationBuilderTests.cs (1)
227var directory = Path.GetDirectoryName(userSecretsPath);
DistributedApplicationOptionsTests.cs (4)
84var expectedPath = Path.GetFullPath(Path.Join(projectDirectory, "CustomName")); 128var expectedPath = Path.GetFullPath(Path.Join(projectDirectory, "ExplicitlySetName"));
DistributedApplicationTests.cs (2)
1327var sourcePath = Path.GetFullPath("/etc/path-here"); 1373Assert.True(Path.IsPathRooted(redisContainer.Spec.VolumeMounts[0].Source));
ExecutableResourceBuilderExtensionTests.cs (2)
23var expectedPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 49var expectedPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory));
FileSystemServiceTests.cs (2)
106var parentDir = Path.GetDirectoryName(filePath); 372var parentDir = Path.GetDirectoryName(filePath)!;
ManifestGenerationTests.cs (4)
703var manifestPath = Path.Combine(Path.GetTempPath(), "tempmanifests", Guid.NewGuid().ToString(), "manifest.json"); 709var manifestPath = Path.Combine(Path.GetTempPath(), "tempmanifests", Guid.NewGuid().ToString(), "manifest.json");
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");
ProjectResourceTests.cs (12)
61var projectDirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 62var projectFilePath = Path.Combine(projectDirectoryPath, "Project.csproj"); 63var propertiesDirectoryPath = Path.Combine(projectDirectoryPath, "Properties"); 64var launchSettingsFilePath = Path.Combine(propertiesDirectoryPath, "launchSettings.json"); 102var projectDirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 103var projectFilePath = Path.Combine(projectDirectoryPath, "Project.csproj"); 104var propertiesDirectoryPath = Path.Combine(projectDirectoryPath, "Properties"); 105var launchSettingsFilePath = Path.Combine(propertiesDirectoryPath, "launchSettings.json");
PublishAsDockerfileTests.cs (8)
220var projectPath = Path.Combine(path, "project.csproj"); 275var projectPath = Path.Combine(path, "project.csproj"); 292var projectPath = Path.Combine(path, "project.csproj"); 312var projectPath = Path.Combine(path, "project.csproj"); 335var projectPath = Path.Combine(path, "project.csproj"); 411var projectPath = Path.Combine(path, "project.csproj"); 429var projectPath = Path.Combine(path, "project.csproj"); 454File.WriteAllText(Path.Join(tempDir.Path, "Dockerfile"), "this does not matter");
Publishing\DeploymentStateManagerTests.cs (1)
367var stateDirectory = Path.GetDirectoryName(stateFilePath);
Publishing\ResourceContainerImageManagerTests.cs (13)
227var tempOutputPath = Path.GetTempPath(); 270ctx.OutputPath = Path.Combine(tempDir.Path, "NewFolder"); // tests that the folder is created if it doesn't exist 417var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar; 568var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar; 584Assert.False(buildCall.contextPath.EndsWith(Path.DirectorySeparatorChar.ToString())); 585Assert.False(buildCall.contextPath.EndsWith(Path.AltDirectorySeparatorChar.ToString())); 588Assert.Equal(Path.GetFullPath(tempContextPath), Path.GetFullPath(buildCall.contextPath)); 710var tempFile = Path.GetTempFileName(); 860var tempSecretFile = System.IO.Path.Combine(tempDir.Path, ".npmrc"); 1210ctx.OutputPath = Path.Combine(tempDir.Path, "archives"); 1332ctx.OutputPath = Path.Combine(tempDir.Path, "archives");
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");
tests\Shared\DistributedApplicationTestingBuilderExtensions.cs (2)
72var uniqueFolder = Path.Combine(baseDcpLogFolder, folderName); 128_testOutputHelper.WriteLine($"=== DCP Log: {Path.GetFileName(logFile)} ===");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
UserSecretsParameterDefaultTests.cs (1)
326var directoryName = Path.GetDirectoryName(secretsFilePath);
Utils\DockerfileUtils.cs (4)
40var tempContextPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 43var tempDockerfilePath = Path.Combine(tempContextPath, dockerfileName);
Utils\ManifestUtils.cs (3)
34var context = new ManifestPublishingContext(executionContext, Path.Combine(manifestDirectory, "manifest.json"), writer); 56var context = new ManifestPublishingContext(executionContext, Path.Combine(manifestDirectory, "manifest.json"), writer); 75var context = new ManifestPublishingContext(executionContext, Path.Combine(Environment.CurrentDirectory, "manifest.json"), writer);
Utils\MSBuildUtils.cs (2)
13while (directory != null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
Utils\UnixSocketHelper.cs (2)
11var aspireCliPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 19var socketPath = Path.Combine(aspireCliPath, $"cli.sock.{uniqueSocketPathSegment}");
Aspire.Hosting.Valkey.Tests (4)
AddValkeyTests.cs (1)
237Assert.Equal(Path.Combine(builder.AppHostDirectory, "myValkeydata"), volumeAnnotation.Source);
ValkeyFunctionalTests.cs (3)
85bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Yarp.Tests (3)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
YarpConfigGeneratorTests.cs (1)
292var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml");
Aspire.Playground.Tests (6)
Infrastructure\DistributedApplicationExtensions.cs (2)
232var projectDirectory = Path.GetDirectoryName(project.GetProjectMetadata().ProjectPath) ?? throw new UnreachableException(); 238var projectAssemblyPath = Path.Combine(projectDirectory, "bin", configuration, "net8.0", $"{projectName}.dll");
Infrastructure\ResourceExtensions.cs (1)
16return Path.GetFileNameWithoutExtension(metadata.ProjectPath);
src\Shared\PathLookupHelper.cs (3)
23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions); 58var fullPathWithExt = Path.Combine(directory, command + extension); 67var fullPath = Path.Combine(directory, command);
Aspire.Templates.Tests (74)
AppHostTemplateTests.cs (1)
27var projectPath = Path.Combine(project.RootDir, $"{projectId}.csproj");
BuildAndRunTemplateTests.cs (1)
93var cpmFilePath = Path.Combine(project.RootDir, "Directory.Packages.props");
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"),
NewUpAndBuildSupportProjectTemplatesTests.cs (2)
14var topLevelDir = Path.Combine(BuildEnvironment.TestRootPath, id + "_root"); 42project.AppHostProjectDirectory = Path.Combine(topLevelDir, id + ".AppHost");
StarterTemplateRunTestsBase.cs (1)
120string screenshotPath = Path.Combine(logPath, "webfrontend-fail.png");
TemplateTestsBase.cs (6)
71var testProjectDir = Path.Combine(rootDirToUse, testProjectName); 74var testProjectPath = Path.Combine(testProjectDir, testProjectName + ".csproj"); 77var appHostProjectName = Path.GetFileName(project.AppHostProjectDirectory)!; 111var testCsPath = Path.Combine(projectDir, "IntegrationTest1.cs"); 166string screenshotPath = Path.Combine(logPath, $"dashboard-fail-{Guid.NewGuid().ToString()[..8]}.png"); 265=> (prefix is null ? "" : $"{prefix}_") + FixupSymbolName(Path.GetRandomFileName());
tests\Shared\Playwright\PlaywrightProvider.cs (1)
55var probePath = Path.Combine(repoRoot.FullName, "artifacts", "bin", "playwright-deps");
tests\Shared\Playwright\TestUtils.cs (2)
14if (Directory.Exists(Path.Combine(repoRoot.FullName, ".git")) || File.Exists(Path.Combine(repoRoot.FullName, ".git")))
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\RunCommand.cs (2)
13WithEnvironmentVariable("DOTNET_ROOT", Path.GetDirectoryName(_buildEnvironment.DotNet)!); 14WithEnvironmentVariable("DOTNET_INSTALL_DIR", Path.GetDirectoryName(_buildEnvironment.DotNet)!);
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)
src\Shared\PathLookupHelper.cs (3)
23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions); 58var fullPathWithExt = Path.Combine(directory, command + extension); 67var fullPath = Path.Combine(directory, command);
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);
NuGet\Commands\RestoreCommand.cs (6)
144var outputPath = Path.GetFullPath(output); 147packagesDir ??= Path.Combine( 224var assetsPath = Path.Combine(outputPath, "project.assets.json"); 254var configDir = Path.GetDirectoryName(nugetConfigPath)!; 255var configFile = Path.GetFileName(nugetConfigPath); 339var projectPath = Path.Combine(outputPath, "project.json");
NuGet\Commands\SearchCommand.cs (2)
183var configDir = Path.GetDirectoryName(configPath)!; 184var configFile = Path.GetFileName(configPath);
AutobahnTestApp (1)
Program.cs (1)
63var certPath = Path.Combine(AppContext.BaseDirectory, "TestResources", "testCert.pfx");
Binding.UDS.IntegrationTests (4)
UDSBindingTests.cs (4)
210return Path.Combine(Path.GetTempPath(), "unix1.txt"); 215return Path.Combine(Path.GetTempPath(), "invalid.txt");
blazor-devserver (6)
Server\Program.cs (5)
28var applicationDirectory = Path.GetDirectoryName(applicationPath)!; 29var name = Path.ChangeExtension(applicationPath, ".staticwebassets.runtime.json"); 30name = !File.Exists(name) ? Path.ChangeExtension(applicationPath, ".StaticWebAssets.xml") : name; 32var endpointsManifest = Path.ChangeExtension(applicationPath, ".staticwebassets.endpoints.json"); 45config.AddJsonFile(Path.Combine(applicationDirectory, "blazor-devserversettings.json"), optional: true, reloadOnChange: true);
Server\Startup.cs (1)
45var fileExtension = Path.GetExtension(ctx.Request.Path);
BoundTreeGenerator (1)
Program.cs (1)
23Console.Error.WriteLine("Usage: \"{0} <language> <input> <output>\", where <language> is \"VB\" or \"CSharp\"", Path.GetFileNameWithoutExtension(args[0]));
BuildActionTelemetryTable (6)
Program.cs (5)
24private static readonly string s_executingPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 65var filepath = Path.GetFullPath("ActionTable.txt"); 78var filepath = Path.GetFullPath("CodeActionDescriptions.Review.cs"); 103var rootedPath = Path.IsPathRooted(path) 105: Path.GetFullPath(path);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
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);
Extensions.cs (1)
25internal static string GetName(this PackagePart part) => Path.GetFileName(GetRelativeName(part));
OptProfCheckerUtil.cs (3)
29OptProfFile = Path.Combine(RepositoryDirectory, "eng", "config", "OptProf.json"); 62string vsixRoot = Path.Combine(ArtifactsDirectory, "VSSetup", Configuration, "Insertion"); 63string vsixFullPath = Path.Combine(vsixRoot, vsixName);
Program.cs (7)
68(solutionFiles.Count > 0) ? Path.GetDirectoryName(solutionFiles[0]) : AppContext.BaseDirectory); 88while (dir != null && !File.Exists(Path.Combine(dir, "global.json"))) 90dir = Path.GetDirectoryName(dir); 101allGood &= ProcessSolution(Path.Combine(repositoryDirectory, solutionFileName), isPrimarySolution: solutionFileName == primarySolution); 104var artifactsDirectory = Path.Combine(repositoryDirectory, "artifacts"); 144var targetsDirectory = Path.Combine(repositoryDirectory, @"eng\targets"); 151var logFilePath = Path.Combine(artifactsDirectory, $@"log\{configuration}\Build.binlog");
ProjectCheckerUtil.cs (1)
164?? Path.GetFileNameWithoutExtension(projectData.FileName);
ProjectData.cs (4)
19internal string FileName => Path.GetFileName(FilePath); 20internal string Directory => Path.GetDirectoryName(FilePath); 24internal bool IsUnitTestProject => Path.GetFileNameWithoutExtension(FilePath).EndsWith(".UnitTests"); 25internal bool IsIntegrationTestProject => Path.GetFileNameWithoutExtension(FilePath).EndsWith(".IntegrationTests");
ProjectEntry.cs (1)
51switch (Path.GetExtension(path))
ProjectKey.cs (2)
16internal string FileName => FilePath != null ? Path.GetFileName(FilePath) : ""; 20FilePath = Path.GetFullPath(filePath);
ProjectUtil.cs (4)
26internal bool IsUnitTestProject => Path.GetFileNameWithoutExtension(Key.FilePath).EndsWith(".UnitTests"); 27internal bool IsIntegrationTestProject => Path.GetFileNameWithoutExtension(Key.FilePath).EndsWith(".IntegrationTests"); 113var directory = Path.GetDirectoryName(Key.FilePath); 135var path = Path.Combine(directory, relativePath);
SharedUtil.cs (4)
21internal static bool IsSolutionFile(string path) => Path.GetExtension(path) == ".sln"; 22internal static bool IsPropsFile(string path) => Path.GetExtension(path) == ".props"; 23internal static bool IsTargetsFile(string path) => Path.GetExtension(path) == ".targets"; 24internal static bool IsXslt(string path) => Path.GetExtension(path) == ".xslt";
SolutionCheckerUtil.cs (4)
36SolutionPath = Path.GetDirectoryName(SolutionFilePath); 90var projectFilePath = Path.Combine(SolutionPath, projectEntry.RelativeFilePath); 150if (Path.GetExtension(projectKey.FileName) == ".shproj") 155var directory = Path.GetDirectoryName(projectKey.FilePath);
StructuredLoggerCheckerUtil.cs (1)
37if (doubleWrites.Any(doubleWrite => Path.GetFileName(doubleWrite.Key) != "Microsoft.VisualStudio.Text.Internal.dll"))
TargetsCheckerUtil.cs (1)
28var fileName = Path.GetFileName(filePath);
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}");
IldasmUtilities.cs (2)
27var directory = Path.GetDirectoryName(typeof(IldasmUtilities).GetTypeInfo().Assembly.Location) ?? throw new DirectoryNotFoundException(); 46return Path.Combine(directory, "runtimes", ridName, "native", ildasmExeName);
LocalReferenceResolver.cs (4)
91nugetPackageDirectory ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget"); 124if (Path.GetFileName(filePath) != metadataReferenceInfo.FileName) 126filePath = Path.Combine(Path.GetDirectoryName(filePath)!, metadataReferenceInfo.FileName);
LocalSourceResolver.cs (2)
36onDiskPath = Path.GetFullPath(Path.Combine(Options.SourcePath, originalFilePath.Substring(link.Prefix.Length)));
Program.cs (8)
105debugPath ??= Path.Combine(Path.GetTempPath(), $"BuildValidator"); 109excludes.Add(Path.DirectorySeparatorChar + "runtimes" + Path.DirectorySeparatorChar); 129var fullDebugPath = Path.GetFullPath(debugPath); 249var debugPath = Path.Combine( 252Path.GetFileNameWithoutExtension(assemblyInfo.FileName)); 253logger.LogInformation($@"Writing diffs to ""{Path.GetFullPath(debugPath)}""");
Records.cs (3)
12internal string FileName => Path.GetFileName(FilePath); 13internal string TargetFramework => Path.GetFileName(Path.GetDirectoryName(FilePath))!;
CatalogService (1)
CatalogApi.cs (1)
40var path = Path.Combine(environment.ContentRootPath, "Images", item.PictureFileName);
ClientSample (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
CodeStyleConfigFileGenerator (4)
Program.cs (3)
68var configDir = Path.Combine(outputDir, "config"); 91var configFilePath = Path.Combine(directory.FullName, configFileName); 205var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
ConfigurationSchemaGenerator (1)
ConfigSchemaGenerator.cs (1)
47var docPath = Path.ChangeExtension(path, "xml");
ConfigurationSchemaGenerator.Tests (2)
GeneratorTests.cs (2)
1595var outputPath = Path.Combine(Directory.GetCurrentDirectory(), "IntegrationTest.json"); 1603var baseline = File.ReadAllText(Path.Combine("Baselines", "IntegrationTest.baseline.json")).ReplaceLineEndings();
Crossgen2Tasks (53)
CommonFilePulledFromSdkRepo\RuntimeGraphCache.cs (1)
28if (!Path.IsPathRooted(runtimeJsonPath))
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);
RunReadyToRunCompiler.cs (5)
231if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 323result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 328result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 403Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
csc (14)
src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 111var tempDir = Path.GetTempPath();
src\Compilers\Shared\BuildServerConnection.cs (7)
443var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 449commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 686clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 774var tempPath = Path.GetTempPath(); 775var result = Path.Combine(tempPath, ".roslyn"); 783FilePath = Path.Combine(mutexDirectory, name); 784GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\Csc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
62var directoryName = Path.GetDirectoryName(dotNetPath); 97var filePath = Path.Combine(item, fileName);
CSharpSyntaxGenerator (5)
Program.cs (5)
104var outputMainFile = Path.Combine(outputLocation.Trim('"'), $"CSharp.Generated.g4"); 143var prefix = Path.GetFileName(inputFile); 144var outputMainFile = Path.Combine(outputPath, $"{prefix}.Main.Generated.cs"); 145var outputInternalFile = Path.Combine(outputPath, $"{prefix}.Internal.Generated.cs"); 146var outputSyntaxFile = Path.Combine(outputPath, $"{prefix}.Syntax.Generated.cs");
csi (3)
Csi.cs (3)
24string csiDirectory = Path.GetDirectoryName(typeof(Csi).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 30tempDir: Path.GetTempPath()); 33responseFile: Path.Combine(csiDirectory, InteractiveResponseFileName),
CustomEncryptorSample (1)
Program.cs (1)
14var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
dotnet-dev-certs (37)
Program.cs (2)
448reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}"); 455reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}");
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-getdocument (14)
Commands\InvokeCommand.cs (11)
43var thisPath = Path.GetFullPath(Path.GetDirectoryName(typeof(InvokeCommand).Assembly.Location)); 47var targetDirectory = Path.GetDirectoryName(assemblyPath); 60toolsDirectory = Path.Combine( 64var executableSource = Path.Combine(toolsDirectory, InsideManName + ".exe"); 65executable = Path.Combine(targetDirectory, InsideManName + ".exe"); 84toolsDirectory = Path.Combine(thisPath, $"net{targetFramework.Version}"); 91args.Add(Path.ChangeExtension(assemblyPath, ".deps.json")); 105args.Add(packageFolder.TrimEnd(Path.DirectorySeparatorChar)); 109var runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json"); 125args.Add(Path.Combine(toolsDirectory, InsideManName + ".dll"));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-openapi (15)
Commands\BaseCommand.cs (12)
137return File.Exists(Path.GetFullPath(file)) && file.EndsWith(".csproj", StringComparison.Ordinal); 277var directory = Path.GetDirectoryName(fullPath); 278destinationPath = GetUniqueFileName(directory, Path.GetFileNameWithoutExtension(fileName), Path.GetExtension(fileName)); 344var filePath = Path.Combine(directory, fileName + extension); 358filePath = Path.Combine(directory, uniqueName + extension); 372var fileName = Path.GetFileName(contentDisposition.FileName); 373if (!Path.HasExtension(fileName)) 386if (!Path.HasExtension(lastSegment)) 439return Path.IsPathFullyQualified(path) 441: Path.GetFullPath(path, WorkingDirectory); 551var destinationDirectory = Path.GetDirectoryName(destinationPath);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-razorpagegenerator (4)
Program.cs (4)
63@class.ClassName = Path.GetFileNameWithoutExtension(document.Source.FilePath); 134var generatedCodeFilePath = Path.ChangeExtension(projectItem.PhysicalPath, ".Designer.cs"); 194var basePath = System.IO.Path.GetDirectoryName(_source.PhysicalPath); 214var includeFileContent = File.ReadAllText(System.IO.Path.Combine(basePath, includeFileName));
dotnet-razorsyntaxgenerator (4)
Program.cs (4)
62var prefix = Path.GetFileName(inputFile); 63var outputMainFile = Path.Combine(outputPath, $"{prefix}.Main.Generated.cs"); 64var outputInternalFile = Path.Combine(outputPath, $"{prefix}.Internal.Generated.cs"); 65var outputSyntaxFile = Path.Combine(outputPath, $"{prefix}.Syntax.Generated.cs");
dotnet-sql-cache (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-svcutil.xmlserializer (18)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (4)
156char[] invalidPathChars = Path.GetInvalidPathChars(); 164string dirPath = Path.GetDirectoryName(path); 166dirPath = "." + Path.DirectorySeparatorChar; 174string filename = Path.GetFileName(path);
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (4)
193if (!directoryArgValue.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 194directoryArgValue += Path.DirectorySeparatorChar; 196_parent._directoryArg = Path.GetFullPath(directoryArgValue); 227int invalidCharacterIndex = value.IndexOfAny(Path.GetInvalidPathChars());
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (9)
41string combinedPath = Path.Combine(directoryPath, outputFileWithExtension); 49if (extension != null && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 63return "." + Path.DirectorySeparatorChar; 66if (!directory.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 67return TryGetFullPath(directory + Path.DirectorySeparatorChar, null); 77return Path.GetFullPath(path); 105string directoryPath = Path.GetDirectoryName(path); 215if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
Microsoft\Tools\ServiceModel\SvcUtil\XmlSerializerGenerator.cs (1)
66string codePath = Path.GetTempFileName();
dotnet-svcutil.xmlserializer.IntegrationTests (1)
SvcutilTests.cs (1)
21string outputFile = Path.GetTempFileName() + ".cs";
dotnet-svcutil-lib (165)
Bootstrapper\SvcutilBootstrapper.cs (6)
99var projectFullPath = Path.Combine(this.Options.BootstrapPath.FullName, nameof(SvcutilBootstrapper), SvcutilBootstrapper.ProjectName); 104Directory.CreateDirectory(Path.GetDirectoryName(projectFullPath)); 117var svcutilPkgRef = ProjectDependency.FromAssembly(Path.Combine(Path.GetDirectoryName(Tool.FullPath), Tool.AssemblyName + ".dll")); 171string programFilePath = Path.Combine(this.MSBuildProj.DirectoryPath, "Program.cs"); 178var paramsFilePath = Path.Combine(this.MSBuildProj.DirectoryPath, s_bootstrapperParamsFileName);
CodeDomFixup\CodeDomHelpers.cs (1)
248name.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 &&
CodeSerializer.cs (3)
144if (!string.IsNullOrWhiteSpace(fileName) && fileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1) 158if (!string.IsNullOrWhiteSpace(fileName) && fileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1) 174if (!string.IsNullOrWhiteSpace(fileName) && fileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1)
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));
FrameworkFork\Microsoft.CodeDom\Compiler\CodeValidator.cs (1)
1024if (e.FileName.IndexOfAny(Path.GetInvalidPathChars()) != -1)
FrameworkFork\Microsoft.CodeDom\Compiler\RedistVersionInfo.cs (1)
52dir = Path.Combine(comPlus_InstallRoot, comPlus_Version);
FrameworkFork\Microsoft.CodeDom\Compiler\TempFiles.cs (4)
216string full = Path.GetFullPath(_basePath); 305if (String.IsNullOrEmpty(tempDir)) tempDir = Path.GetTempPath(); 307string randomFileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (3)
600string asmblFileDir = Path.GetDirectoryName(asmblFilePath); 610string fileName = Path.GetFileName(s); 3223if (!Path.GetExtension(outputAssemblyFile).Equals(extensionWithDot, StringComparison.OrdinalIgnoreCase))
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (1)
1894dumpFileName = Path.GetFullPath(string.Concat(dumpFileNameBase, i.ToString(), ".bmx"));
FrameworkFork\Microsoft.Xml\Xml\XmlResolver.cs (1)
49uri = new Uri(Path.GetFullPath(relativeUri));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (1)
127string assemblyName = System.IO.Path.GetFileName(assembly.Location);
Metadata\MetadataDocumentLoader.cs (7)
271!isUrl && Uri.TryCreate(Path.Combine(basePath, uri), UriKind.Absolute, out serviceUri)) 490if (Uri.TryCreate(Path.Combine(basePath, schemaLocation), UriKind.Absolute, out Uri schemaFile)) 532fullFileName = Path.Combine(basePath, schemaUri.Segments[schemaUri.Segments.Length - 1]); 544if (!File.Exists(fullFileName) && !Path.IsPathRooted(schemaLocation)) 546fullFileName = Path.Combine(basePath, schemaLocation); 550fullFileName = Path.Combine(basePath, Path.GetFileName(schemaLocation));
Metadata\MetadataDocumentSaver.cs (7)
146var updatedLocation = Path.Combine(this.DirectoryPath, Path.GetFileName(location)); 223wsdl.RetrievalUrl = Path.GetFileName(filePath); 245schema.SourceUri = Path.GetFileName(filePath); 285var filePath = Path.Combine(this.DirectoryPath, import.Location); 306this.FileNameMgr.AddFileName(this.DirectoryPath, Path.GetFileName(uri.LocalPath), extension); 313var dirPath = Path.GetDirectoryName(filePath);
Metadata\MetadataFileNameManager.cs (10)
53filePath = Path.IsPathRooted(uniqueFileNameWithExtension) ? uniqueFileNameWithExtension : Path.Combine(basePath, uniqueFileNameWithExtension); 83var filePath = Path.IsPathRooted(fileNameWithExtension) ? fileNameWithExtension : Path.Combine(basePath, fileNameWithExtension); 158if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1) 169if (!string.IsNullOrEmpty(extension) && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 188var dirPath = Path.GetDirectoryName(filePath); 237string dirPath = Path.GetDirectoryName(path); 252string filename = Path.GetFileName(path);
Metadata\ServiceDescriptor.cs (1)
105string toolPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
OutputPathHelper.cs (8)
28string combinedPath = Path.Combine(directoryPath, outputFileWithExtension); 36if (extension != null && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 55if (!directory.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 57return TryGetFullPath(directory + Path.DirectorySeparatorChar, null); 68string directoryPath = Path.GetDirectoryName(path); 88return Path.GetFullPath(path); 164if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
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\Options\UpdateOptions.cs (2)
110if (this.OutputFile != null && !Path.IsPathRooted(this.OutputFile.OriginalPath())) 112this.OutputFile = new FileInfo(Path.Combine(optionsFileDirectory.FullName, this.OutputFile.OriginalPath()));
Shared\Options\WCFCSUpdateOptions.cs (1)
127_deserializedCollectionAssemblies.Add(System.IO.Path.GetFileNameWithoutExtension(item2.Trim()));
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\ProjectPropertyResolver.cs (11)
32var workingDirectory = Path.GetDirectoryName(projectPath); 146var dotnetDir = Path.GetDirectoryName(typeof(int).Assembly.Location); 149while (dotnetDir != null && !(File.Exists(Path.Combine(dotnetDir, "dotnet")) || File.Exists(Path.Combine(dotnetDir, "dotnet.exe")))) 151dotnetDir = Path.GetDirectoryName(dotnetDir); 159s_sdkPath = Path.Combine(dotnetDir, "sdk", sdkVersion); 183if (Path.GetFileNameWithoutExtension(assemblyPath) == "Microsoft.Build") 202var projectDir = Path.GetDirectoryName(projectPath); 205var depsFiles = Directory.GetFiles(projectDir, $"{Path.GetFileNameWithoutExtension(projectPath)}.deps.json", SearchOption.AllDirectories) 217var projName = Path.GetFileNameWithoutExtension(projectPath); 242var chars = Path.GetInvalidFileNameChars();
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);
Shared\Utilities\ProcessRunner.cs (5)
70proc.StartInfo.WorkingDirectory = Path.GetFullPath(currentDir); 114Console.WriteLine($"Starting process in the background: {Path.GetFileName(proc.ProcessName)}, ID: {proc.Id}."); 115Console.WriteLine($"{Path.GetFileName(currentDir)}>{processName} {processArgs}{Environment.NewLine}"); 150var exitCode = Path.GetFileName(processName) == Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) ? proc.ExitCode : -1;
Shared\Utilities\RuntimeEnvironmentHelper.cs (3)
47if (!File.Exists(Path.Combine(destinationDirectory, "global.json"))) 53if (!File.Exists(Path.Combine(destinationDirectory, "nuget.config"))) 87.Select(e => e.Attribute("value").Value.TrimEnd(Path.DirectorySeparatorChar))
Tool.cs (1)
314var paramsFile = Path.Combine(options.OutputDir.FullName, CommandProcessorOptions.SvcutilParamsFileName);
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");
FileUtil.cs (2)
28string temppath = Path.Combine(destinationDirectory, file.Name); 34string temppath = Path.Combine(destinationDirectory, subdir.Name);
FixupUtil.cs (4)
41new ReplaceInfo(Path.GetTempPath(), "$TEMP$"), 42new ReplaceInfo(Path.GetTempPath().Replace("\\", "\\\\"), "$TEMP$"), 43new ReplaceInfo(Path.GetTempPath().Replace("\\", "/"), "$TEMP$"), 102if (Path.GetExtension(fileName) != ".cs")
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");
ProjectUtils.cs (10)
23var projectDir = Path.GetDirectoryName(filePath); 24var srcProgramFile = Path.Combine(projectDir, "Program.cs"); 25var dstProgramFile = Path.Combine(projectDir, $"{Path.GetFileNameWithoutExtension(filePath)}.cs"); 27Directory.CreateDirectory(Path.GetDirectoryName(filePath)); 33FileUtil.TryDeleteDirectory(Path.Combine(Path.GetDirectoryName(filePath), "obj")); 177var outputDir = Path.Combine(project.DirectoryPath, referenceFolderName); 180var dstParamsFile = Path.Combine(outputDir, Path.GetFileName(srcParamsFile));
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)
AppHost.cs (4)
55var fakeSourcesPath = Path.Combine(Path.GetTempPath(), "does-not-exist", Guid.NewGuid().ToString()); 84.WithWorkingDirectory(Path.Combine(Projects.DotnetTool_AppHost.ProjectPath, "IncompatibleSdk")); 90var nugetPackagesPath = Path.Join(evt.Services.GetRequiredService<IAspireStore>().BasePath, "nuget");
dotnet-user-jwts (30)
Commands\ClearCommand.cs (2)
68var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\CreateCommand.cs (2)
264var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\RemoveCommand.cs (2)
59var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Helpers\DevJwtCliHelpers.cs (6)
58else if (!File.Exists(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))) 60reporter.Error(Resources.FormatRemoveCommand_AppsettingsFileNotFound_Error(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))); 75var launchSettingsFilePath = Path.Combine(Path.GetDirectoryName(project)!, "Properties", "launchSettings.json");
Helpers\JwtStore.cs (3)
17_filePath = Path.Combine(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(userSecretsId)), FileName); 45var tempFilename = Path.GetTempFileName();
Helpers\SigningKeysHandler.cs (1)
63Directory.CreateDirectory(Path.GetDirectoryName(secretsFilePath));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (7)
51var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 135var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); 138Path.Combine(AppContext.BaseDirectory, "assets"), 139Path.Combine(assemblyDir, "assets"), 144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-user-secrets (17)
Internal\SecretsStore.cs (3)
38var secretDir = Path.GetDirectoryName(_secretsFilePath); 76Directory.CreateDirectory(Path.GetDirectoryName(_secretsFilePath)); 83var tempFilename = Path.GetTempFileName();
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (7)
51var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 135var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); 138Path.Combine(AppContext.BaseDirectory, "assets"), 139Path.Combine(assemblyDir, "assets"), 144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
FilesWebSite (10)
Controllers\DownloadFilesController.cs (10)
18_testFilesPath = Path.Combine(Path.GetTempPath(), "test-files"); 23var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 29var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 37var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 43var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 51var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 52var symlink = Path.Combine(_testFilesPath, Path.GetRandomFileName()); 120Directory.Delete(Path.Combine(_testFilesPath), recursive: true);
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);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
GenerateRulesMissingDocumentation (3)
Program.cs (3)
41var fileWithPath = Path.Combine(directory.FullName, rulesMissingDocumentationFileName); 146var assemblyName = Path.GetFileNameWithoutExtension(assembly); 147string path = Path.Combine(binDirectory, assemblyName, configuration, "netstandard2.0", assembly);
GetDocument.Insider (8)
Commands\GetDocumentCommand.cs (3)
67.Except([Path.GetFullPath(thisAssembly.Location)]) 68.ToDictionary(Path.GetFileNameWithoutExtension, path => new AssemblyInfo(path)); 140AssemblyName = Path.GetFileNameWithoutExtension(assemblyPath),
Commands\GetDocumentCommandWorker.cs (2)
32private static readonly char[] _invalidFilenameCharacters = Path.GetInvalidFileNameChars(); 423path = Path.Combine(outputDirectory, path);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
HelixTestRunner (24)
ProcessUtil.cs (6)
33var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{process.ProcessName}-{process.Id}.dmp"); 48var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{process.ProcessName}.{process.Id}.dmp"); 108process.StartInfo.EnvironmentVariables["COMPlus_DbgMiniDumpName"] = Path.Combine(dumpDirectoryPath, $"{Path.GetFileName(filename)}.%d.dmp"); 181var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{Path.GetFileName(filename)}.{process.Id}.dmp");
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)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
HttpStress (4)
Program.cs (4)
374Console.WriteLine(" .NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(object).Assembly.Location))); 375Console.WriteLine(" ASP.NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(IWebHostBuilder).Assembly.Location)));
IdeBenchmarks (10)
FormatterBenchmarks.cs (4)
40var path = Path.Combine(Path.GetFullPath(@"..\..\..\..\..\src\Compilers\CSharp\Portable\Generated"), Document + ".cs"); 53var path = Path.Combine(Path.GetFullPath(@"..\..\..\..\..\src\Compilers\VisualBasic\Portable\Generated"), Document + ".vb");
InheritanceMargin\InheritanceMarginServiceBenchmarks.cs (1)
36var solutionPath = Path.Combine(roslynRoot, @"src\Tools\IdeCoreBenchmarks\Assets\Microsoft.CodeAnalysis.sln");
Program.cs (2)
23return Path.Combine(Path.GetDirectoryName(sourceFilePath), @"..\..\..");
SQLitePersistentStorageBenchmark.cs (3)
133var tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
IdeCoreBenchmarks (19)
ClassificationBenchmarks.cs (2)
45_solutionPath = Path.Combine(roslynRoot, @"Roslyn.slnx"); 55var solutionPath = Path.Combine(roslynRoot, "Roslyn.slnx");
CSharpIdeAnalyzerBenchmarks.cs (3)
37_solutionPath = Path.Combine(roslynRoot, @"src\Tools\IdeCoreBenchmarks\Assets\Microsoft.CodeAnalysis.sln"); 48var analyzerAssemblyPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Microsoft.CodeAnalysis.CSharp.Features.dll");
FindReferencesBenchmarks.cs (2)
44var solutionPath = Path.Combine(roslynRoot, "Compilers.slnf"); 54var solutionPath = Path.Combine(roslynRoot, "Compilers.slnf");
FormatterBenchmarks.cs (1)
30var csFilePath = Path.Combine(roslynRoot, @"src\Compilers\CSharp\Portable\Generated\Syntax.xml.Syntax.Generated.cs");
IncrementalAnalyzerBenchmarks.cs (3)
36_solutionPath = Path.Combine(roslynRoot, @"src\Tools\IdeCoreBenchmarks\Assets\Microsoft.CodeAnalysis.sln"); 47var analyzerAssemblyPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Microsoft.CodeAnalysis.Features.dll");
IncrementalSourceGeneratorBenchmarks.cs (2)
47_solutionPath = Path.Combine(roslynRoot, @"Compilers.slnf"); 57_solutionPath = Path.Combine(roslynRoot, @"Roslyn.slnx");
NavigateToBenchmarks.cs (2)
48_solutionPath = Path.Combine(roslynRoot, @"Roslyn.slnx"); 58_solutionPath = Path.Combine(roslynRoot, @"Roslyn.slnx");
Program.cs (2)
37return Path.Combine(Path.GetDirectoryName(sourceFilePath), @"..\..\..");
RenameBenchmarks.cs (1)
28_csFilePath = Path.Combine(roslynRoot, @"src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs");
SyntacticChangeRangeBenchmark.cs (1)
33var csFilePath = Path.Combine(roslynRoot, @"src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs");
IIS.FunctionalTests (38)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
61var temporaryFile = Path.GetTempFileName(); 70var requestHandlerPath = Path.Combine(GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20), "aspnetcorev2_outofprocess.dll"); 215file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); 221return Path.Combine(deploymentResult.ContentRoot, 244var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); 245var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); 265var destFileName = Path.Combine(target.FullName, fileInfo.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\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
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.FunctionalTests\LoggingTests.cs (6)
92WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); 119AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); 133AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 149AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 157var firstTempFile = Path.GetTempFileName(); 158var secondTempFile = Path.GetTempFileName();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
145return Path.Combine(siteRoot, "web.config");
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (3)
51(args, contentRoot) => $"{args} CreateFile \"{Path.Combine(contentRoot, "Started.txt")}\""); 57await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue); 101await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue);
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\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
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)
StartupTimeBenchmark.cs (1)
26var deploymentParameters = new DeploymentParameters(Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS/test/testassets/InProcessWebSite"),
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\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
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\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
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)
Utilities\TestServer.cs (5)
33internal static string BasePath => Path.Combine(Path.GetDirectoryName(typeof(TestServer).Assembly.Location), 37internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll); 115_appHostConfigPath = Path.GetTempFileName(); 141var webHostConfig = XDocument.Load(Path.GetFullPath("HostableWebCore.config"));
IISExpress.FunctionalTests (57)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
61var temporaryFile = Path.GetTempFileName(); 70var requestHandlerPath = Path.Combine(GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20), "aspnetcorev2_outofprocess.dll"); 215file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); 221return Path.Combine(deploymentResult.ContentRoot, 244var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); 245var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); 265var destFileName = Path.Combine(target.FullName, fileInfo.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\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
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\LoggingTests.cs (6)
92WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); 119AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); 133AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 149AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 157var firstTempFile = Path.GetTempFileName(); 158var secondTempFile = Path.GetTempFileName();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
145return Path.Combine(siteRoot, "web.config");
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)
ILLink.Tasks (6)
LinkTask.cs (6)
259protected override string ToolName => Path.GetFileName(DotNetPath); 273var taskDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 277_illinkPath = Path.Combine(Path.GetDirectoryName(taskDirectory), "net", "illink.dll"); 364var assemblyName = Path.GetFileNameWithoutExtension(assemblyPath); 426var assemblyName = Path.GetFileNameWithoutExtension(assemblyPath);
Infrastructure.Common (1)
CertificateManager.cs (1)
73return Path.Combine(Environment.CurrentDirectory, "wcfLocal.keychain");
Infrastructure.Tests (166)
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (2)
55var projectPath = Path.Combine(repoRoot, "tools", "ExtractTestPartitions", "ExtractTestPartitions.csproj"); 71if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx")))
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");
ExtractTestPartitions\MockAssemblyBuilder.cs (6)
241var netstandardPath = Path.Combine( 242Path.GetDirectoryName(typeof(object).Assembly.Location)!, 250var runtimePath = Path.Combine( 251Path.GetDirectoryName(typeof(object).Assembly.Location)!, 259Path.GetFileNameWithoutExtension(outputPath), 264var outputDir = Path.GetDirectoryName(outputPath);
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\SplitTestMatrixByDepsTests.cs (6)
23_scriptPath = Path.Combine(FindRepoRoot(), "eng", "scripts", "split-test-matrix-by-deps.ps1"); 24_githubOutputFile = Path.Combine(_tempDir.Path, "github_output.txt"); 205var matrixFile = Path.Combine(_tempDir.Path, "matrix.json"); 234var nonExistentFile = Path.Combine(_tempDir.Path, "nonexistent.json"); 261var tempMatrixFile = Path.Combine(_tempDir.Path, $"matrix_input_{Guid.NewGuid():N}.json"); 356if (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")))
Shared\TestDataBuilder.cs (5)
54var outputDir = Path.GetDirectoryName(outputPath); 97var outputDir = Path.GetDirectoryName(outputPath); 122var outputDir = Path.GetDirectoryName(outputPath); 141var outputDir = Path.GetDirectoryName(outputPath); 163var outputDir = Path.GetDirectoryName(outputPath);
WorkflowScripts\AutoRerunTransientCiFailuresTests.cs (5)
27_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "auto-rerun-transient-ci-failures.harness.js"); 1084string inputPath = Path.Combine(_tempDir.Path, $"{Guid.NewGuid():N}.json"); 1124if (File.Exists(Path.Combine(current, "Aspire.slnx"))) 1136=> File.ReadAllTextAsync(Path.Combine(_repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)));
InMemory.FunctionalTests (5)
HttpsConnectionMiddlewareTests.cs (2)
75["Certificates:Default:Path"] = Path.Combine("shared", "TestCertificates", "https-aspnet.crt"), 76["Certificates:Default:KeyPath"] = Path.Combine("shared", "TestCertificates", "https-aspnet.key"),
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
InProcessWebSite (2)
Startup.cs (2)
188File.WriteAllText(System.IO.Path.Combine(hostingEnv.ContentRootPath, "Started.txt"), ""); 957var tempFile = System.IO.Path.GetTempFileName();
installer.tasks (10)
FileUtilities.cs (1)
32if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
GenerateFileVersionProps.cs (3)
59var fileName = Path.GetFileName(file.ItemSpec); 131var manifestFileName = Path.GetFileName(PlatformManifestFile); 135Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestFile));
GenerateRunScript.cs (3)
41Directory.CreateDirectory(Path.GetDirectoryName(OutputPath)); 45string extension = Path.GetExtension(Path.GetFileName(OutputPath)).ToLowerInvariant();
GenerateTestSharedFrameworkDepsFile.cs (3)
58if (ignoredExtensions.Contains(Path.GetExtension(filePath))) 61string fileName = Path.GetFileName(filePath); 101using (var depsFileStream = File.Create(Path.Combine(SharedFrameworkDirectory, $"{sharedFxName}.deps.json")))
InteractiveHost.UnitTests (15)
AbstractInteractiveHostTests.cs (2)
50while (dir != null && !File.Exists(Path.Combine(dir, "dotnet.exe"))) 52dir = Path.GetDirectoryName(dir);
InteractiveHostCoreInitTests.cs (3)
33var dir = Path.GetDirectoryName(typeof(InteractiveHostCoreInitTests).Assembly.Location); 58var dllDir = Path.GetDirectoryName(dll.Path)!; 86await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopInitTests.cs (2)
31var dllDir = Path.GetDirectoryName(dll.Path)!; 59await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopTests.cs (6)
305Assert.True(await LoadReference(Path.Combine(fxDir, "System.Data.dll"))); 723{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 803$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 831{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 853$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 1038{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))}
TestUtils.cs (2)
11public static readonly string HostRootPath = Path.Combine(Path.GetDirectoryName(typeof(TestUtils).Assembly.Location)!, "Host");
Interop.FunctionalTests (13)
H2SpecCommands.cs (5)
29var root = Path.Combine(Environment.CurrentDirectory, "h2spec"); 34toolPath = Path.Combine(root, "windows", "h2spec.exe"); 38toolPath = Path.Combine(root, "linux", "h2spec"); 42toolPath = Path.Combine(root, "darwin", "h2spec"); 202var tempFile = Path.GetTempPath() + Guid.NewGuid() + ".xml";
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");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
InteropTests (2)
InteropTests.cs (2)
16private readonly string _clientPath = Path.Combine(Directory.GetCurrentDirectory(), "InteropClient", "InteropClient.dll"); 17private readonly string _serverPath = Path.Combine(Directory.GetCurrentDirectory(), "InteropWebsite", "InteropWebsite.dll");
InteropWebsite (2)
Program.cs (2)
57var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); 58var certPath = Path.Combine(basePath!, "Certs", "server1.pfx");
IOperationGenerator (3)
IOperationClassWriter.cs (2)
106var outFileName = Path.Combine(_location, $"{@namespace}.Generated.cs"); 161using (_writer = new StreamWriter(File.Open(Path.Combine(_location, "OperationKind.Generated.cs"), FileMode.Create), Encoding.UTF8))
Program.cs (1)
18Console.Error.WriteLine("Usage: \"{0} <input> <output>\"", Path.GetFileNameWithoutExtension(args[0]));
KeyManagementSample (1)
Program.cs (1)
15var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
Metrics (32)
MetricsOutputWriter.cs (1)
43writer.WriteAttributeString("Name", Path.GetFileName(filePath));
Program.cs (5)
303Console.WriteLine($"Loading {Path.GetFileName(projectFile)}..."); 310Console.WriteLine($"Computing code metrics for {Path.GetFileName(projectFile)}..."); 329Console.WriteLine($"Loading {Path.GetFileName(solutionFile)}..."); 336Console.WriteLine($"Computing code metrics for {Path.GetFileName(solutionFile)}..."); 343Console.WriteLine($" Computing code metrics for {Path.GetFileName(project.FilePath)}...");
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Metrics.Legacy (32)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Tools\Metrics\MetricsOutputWriter.cs (1)
43writer.WriteAttributeString("Name", Path.GetFileName(filePath));
src\RoslynAnalyzers\Tools\Metrics\Program.cs (5)
303Console.WriteLine($"Loading {Path.GetFileName(projectFile)}..."); 310Console.WriteLine($"Computing code metrics for {Path.GetFileName(projectFile)}..."); 329Console.WriteLine($"Loading {Path.GetFileName(solutionFile)}..."); 336Console.WriteLine($"Computing code metrics for {Path.GetFileName(solutionFile)}..."); 343Console.WriteLine($" Computing code metrics for {Path.GetFileName(project.FilePath)}...");
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.Agents.AI.ProjectTemplates.Tests (21)
test\ProjectTemplates\Infrastructure\Project.cs (1)
28StartupProjectFullPath = Path.Combine(rootPath, field);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestClassFixtureBase.cs (5)
42_sandboxInstallPath = Path.Combine(_sandboxOutput, "install"); 43_sandboxProjectsPath = Path.Combine(_sandboxOutput, "projects"); 84file.CopyTo(Path.Combine(testSandbox, file.Name)); 89CopySandboxDirectory(subDir.FullName, Path.Combine(testSandbox, subDir.Name)); 95var outputFolderPath = Path.Combine(_sandboxProjectsPath, projectName);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestConfiguration.cs (3)
13private string TemplateSandboxRoot => Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, TemplatePackageName, "Sandbox"); 14public string TemplateSandboxPackages => Path.Combine(TemplateSandboxRoot, "packages"); 15public string TemplateSandboxOutput => Path.Combine(TemplateSandboxRoot, TemplateName);
test\ProjectTemplates\Infrastructure\TemplateSnapshotTestBase.cs (5)
26string workingDir = Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, templatePackageName, "Snapshots", templateName, $"{templateName}.{scenarioName}"); 35string templateLocation = Path.Combine(WellKnownPaths.LocalShippingPackagesPath, $"{templatePackageName}.*.nupkg"); 37string[]? excludePatterns = Path.DirectorySeparatorChar is '/' 39: verificationExcludePatterns?.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray(); 45SnapshotsDirectory = Path.Combine("Snapshots", templateName),
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
50if (Path.GetFileName(path).Equals("launchSettings.json", StringComparison.OrdinalIgnoreCase))
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)
Resources\FileVisibleToAnalyzer.cs (1)
24public override string Path => System.IO.Path.Combine(Directory.GetCurrentDirectory(), _fileName);
Resources\RoslynTestUtils.cs (3)
36var runtimeDir = Path.GetDirectoryName(corelib)!; 42refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 43refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Analyzers.Local (2)
ApiLifecycle\ModelLoader.cs (2)
29var fileName = Path.GetFileNameWithoutExtension(filePath); 30var fileExtension = Path.GetExtension(filePath);
Microsoft.Analyzers.Local.Tests (4)
Resources\FileVisibleToAnalyzer.cs (1)
24public override string Path => System.IO.Path.Combine(Directory.GetCurrentDirectory(), _fileName);
Resources\RoslynTestUtils.cs (3)
36var runtimeDir = Path.GetDirectoryName(corelib)!; 42refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 43refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Arcade.Common (13)
CommandFactory.cs (4)
56var extension = Path.GetExtension(executable); 61else if (executable.Contains(Path.DirectorySeparatorChar)) 73foreach (var path in System.Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 75var candidate = Path.Combine(path, executable + ".exe");
FileSystem.cs (8)
21public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 23public string? GetFileName(string? path) => Path.GetFileName(path); 25public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 27public string? GetExtension(string? path) => Path.GetExtension(path); 29public string GetFullPath(string path) => Path.GetFullPath(path); 31public string PathCombine(string path1, string path2) => Path.Combine(path1, path2); 33public string PathCombine(string path1, string path2, string path3) => Path.Combine(path1, path2, path3); 37string? dirPath = Path.GetDirectoryName(path);
ZipArchiveManager.cs (1)
30string entryName = Path.GetFileName(filePath);
Microsoft.Arcade.Test.Common (4)
MockFileSystem.cs (4)
50public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 52public string? GetFileName(string? path) => Path.GetFileName(path); 54public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 56public string? GetExtension(string? path) => Path.GetExtension(path);
Microsoft.AspNetCore (8)
HostingPathResolver.cs (8)
15Path.EndsInDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 21return Path.GetFullPath(basePath); 23if (Path.IsPathRooted(contentRootPath)) 25return Path.GetFullPath(contentRootPath); 27return Path.GetFullPath(Path.Combine(Path.GetFullPath(basePath), contentRootPath));
Microsoft.AspNetCore.Analyzer.Testing (4)
DiagnosticVerifier.cs (4)
194var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 201dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
44var name = Path.GetFileNameWithoutExtension(assemblyPath);
Microsoft.AspNetCore.App.Analyzers.Test (5)
TestDiagnosticAnalyzer.cs (2)
157if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Verifiers\CSharpAnalyzerVerifier.cs (3)
52Path.Combine( 55Path.Combine(TestData.GetRepoRoot(), "NuGet.config"); 61Path.Combine("ref", "net11.0"))
Microsoft.AspNetCore.App.UnitTests (36)
PackageTests.cs (6)
35Path.Combine( 53var outputPath = Path.Combine(_packageLayoutRoot, Path.GetFileNameWithoutExtension(package)); 88var packageAssembliesDir = Path.Combine(packageDir, "lib"); 119var packageToolsDir = Path.Combine(packageDir, "tools"); 123.Where(f => !toolAssembliesToSkip.Any(s => Path.GetFileNameWithoutExtension(f).Contains(s, StringComparison.OrdinalIgnoreCase)));
SharedFxTests.cs (9)
27_sharedFxRoot = Path.Combine( 38.Select(Path.GetFileNameWithoutExtension) 62.Select(Path.GetFileNameWithoutExtension) 88var runtimeConfigFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.json"); 91AssertEx.FileDoesNotExists(Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.dev.json")); 105var depsFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.deps.json"); 178var name = Path.GetFileNameWithoutExtension(path); 229if (!repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path))) 250var versionFile = Path.Combine(_sharedFxRoot, ".version");
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)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
UserJwtsTestFixture.cs (9)
64var projectPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest", Guid.NewGuid().ToString())); 65Directory.CreateDirectory(Path.Combine(projectPath.FullName, "Properties")); 70Directory.CreateDirectory(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId))); 74Path.Combine(projectPath.FullName, "TestProject.csproj"), 77File.WriteAllText(Path.Combine(projectPath.FullName, "Properties", "launchSettings.json"), 81Path.Combine(projectPath.FullName, "appsettings.Development.json"), 85Path.Combine(projectPath.FullName, "appsettings.Local.json"), 94var secretsDir = Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId));
UserJwtsTests.cs (76)
27var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 37var project = Path.Combine(fixture.CreateProject(false), "TestProject.csproj"); 48var project = Path.Combine(fixture.CreateProject(false), "TestProject.csproj"); 61var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 62var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 73var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 74var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 105var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 106var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 122var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 123var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Local.json"); 139var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 149var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 163var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 184var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 196var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 197var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 214var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 215var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Local.json"); 232var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 233var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 250var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 251var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Local.json"); 268var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 282var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 310var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 322var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 336var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 351var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 365var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 378var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 397var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 417var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 438var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 460var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 475var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 489var project = Path.Combine(projectPath, "TestProject.csproj"); 491var launchSettingsPath = Path.Combine(projectPath, "Properties", "launchSettings.json"); 505var project = Path.Combine(projectPath, "TestProject.csproj"); 532var project = Path.Combine(projectPath, "TestProject.csproj"); 560var project = Path.Combine(projectPath, "TestProject.csproj"); 577var project = Path.Combine(projectPath, "TestProject.csproj"); 598var project = Path.Combine(projectPath, "TestProject.csproj"); 620var project = Path.Combine(projectPath, "TestProject.csproj"); 645var project = Path.Combine(projectPath, "TestProject.csproj"); 671var project = Path.Combine(projectPath, "TestProject.csproj"); 708var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 723var expectedAppsettingsPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.DoesNotExist.json"); 734var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 748var expectedAppsettingsPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.DoesNotExist.json"); 759var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 773var expectedAppsettingsPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.DoesNotExist.json"); 784var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 797var project = Path.Combine(projectPath, "TestProject.csproj"); 802Assert.Contains(Path.Combine(projectPath, project), _console.GetOutput()); 809var tempPath = Path.GetTempPath(); 810var targetPath = Path.GetRelativePath(tempPath, projectPath); 811var project = Path.Combine(projectPath, "TestProject.csproj"); 818Assert.Contains(Path.Combine(projectPath, project), _console.GetOutput()); 825var tempPath = Path.GetTempPath(); 826var targetPath = Path.GetRelativePath(tempPath, projectPath); 840var tempPath = Path.GetTempPath(); 841var targetPath = Path.GetRelativePath(tempPath, projectPath); 855var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj");
Microsoft.AspNetCore.BrowserTesting (12)
BrowserManagerConfiguration.cs (4)
76BaseArtifactsFolder = Path.GetFullPath(configuration.GetValue(nameof(BaseArtifactsFolder), Path.Combine(Directory.GetCurrentDirectory(), "playwright"))); 182if (Path.IsPathRooted(folderPath)) 189folderPath = Path.Combine(BaseArtifactsFolder, folderPath);
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);
ContextInformation.cs (1)
58browserContextOptions.RecordHarPath = Path.Combine(
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
AnalyzerTestBase.cs (1)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source);
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Builder\TestFileProvider\TestFileProvider.cs (5)
44PhysicalPath = Path.Combine(Root, NormalizeAndEnsureValidPhysicalPath(path)), 45Name = Path.GetFileName(path), 56var directoryContent = new TestDirectoryContent(Path.GetFileName(path), files); 114filePath = filePath.Replace('/', Path.DirectorySeparatorChar); 116if (filePath[0] == Path.DirectorySeparatorChar)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
AnalyzerTestBase.cs (1)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source);
Microsoft.AspNetCore.Components.Testing (9)
Infrastructure\E2EManifest.cs (1)
22var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{assemblyName}.e2e-manifest.json");
Infrastructure\PlaywrightExtensions.cs (2)
37?? Path.Combine(AppContext.BaseDirectory, "test-artifacts"); 107var artifactDir = Path.Combine(s_artifactsRoot, sanitized);
Infrastructure\ServerInstance.cs (2)
204workingDir = Path.Combine(AppContext.BaseDirectory, appEntry.WorkingDirectory); 209executable = Path.Combine(workingDir, executable);
Infrastructure\TracingSession.cs (2)
73var tracePath = Path.Combine(_artifactDir, "trace.zip"); 111Console.WriteLine($"[E2E] {Path.GetFileName(file)}");
StartupHook.g.cs (2)
12var testBinDirectory = Path.GetDirectoryName(startupHookAssembly.Location); 16var candidatePath = Path.Combine(testBinDirectory, assemblyName.Name + ".dll");
Microsoft.AspNetCore.Components.Testing.Tasks (8)
GenerateE2EManifest.cs (8)
84entry.WorkingDirectory = Path.Combine(E2EAppsRelativeDir, name); 89entry.WorkingDirectory = Path.GetDirectoryName(projectPath) ?? ""; 99? Path.Combine("publish", name) 101var relativeDir = Path.Combine(E2EAppsRelativeDir, subPath); 102var absoluteDir = Path.Combine(E2EAppsOutputDir, subPath); 105var appHostPath = Path.Combine(absoluteDir, name + exeSuffix); 106var appDllPath = Path.Combine(absoluteDir, name + ".dll"); 139var manifestDir = Path.GetDirectoryName(ManifestPath);
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)
Services\LazyAssemblyLoader.cs (2)
56loadedAssemblies.Add(Assembly.Load(Path.GetFileNameWithoutExtension(assemblyName))); 88var assemblyName = Path.GetFileNameWithoutExtension(newAssembliesToLoad[i]);
Microsoft.AspNetCore.Components.WebAssembly.Server (11)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
110var fileExtension = Path.GetExtension(requestPath.Value); 120var originalPath = Path.GetFileNameWithoutExtension(requestPath.Value);
DebugProxyLauncher.cs (2)
125var debugProxyPath = Path.Combine( 126Path.GetDirectoryName(assembly.Location)!,
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
TargetPickerUi.cs (4)
399var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug"); 425var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
Microsoft.AspNetCore.Components.WebView (3)
WebViewManager.cs (3)
304var name = Path.GetFileNameWithoutExtension(assembly.Location); 306return Path.Combine(Path.GetDirectoryName(assembly.Location)!, $"{name}.staticwebassets.runtime.json");
Microsoft.AspNetCore.Components.WebView.Maui (4)
Extensions\UriExtensions.cs (1)
10 if (Path.HasExtension(uriString))
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
Microsoft.AspNetCore.Components.WebView.Photino (3)
BlazorWindow.cs (3)
47var contentRootDir = Path.GetDirectoryName(Path.GetFullPath(hostPage))!; 48var hostPageRelativePath = Path.GetRelativePath(contentRootDir, hostPage);
Microsoft.AspNetCore.Components.WebView.Test (1)
StaticContentProviderTests.cs (1)
119public string Name => Path.GetFileName(_filePath);
Microsoft.AspNetCore.Components.WebView.WindowsForms (10)
BlazorWebView.cs (6)
180 appRootDir = Path.GetDirectoryName(entryAssemblyLocation)!; 186 var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage!)); // HostPage is nonnull because RequiredStartupPropertiesSet is checked above 187 var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!; 188 var contentRootRelativePath = Path.GetRelativePath(appRootDir, contentRootDirFullPath); 189 var hostPageRelativePath = Path.GetRelativePath(contentRootDirFullPath, hostPageFullPath);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
415 var result = Path.Combine(
Microsoft.AspNetCore.Components.WebView.Wpf (10)
BlazorWebView.cs (6)
263 appRootDir = Path.GetDirectoryName(entryAssemblyLocation)!; 269 var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage)); 270 var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!; 271 var hostPageRelativePath = Path.GetRelativePath(contentRootDirFullPath, hostPageFullPath); 272 var contentRootDirRelativePath = Path.GetRelativePath(appRootDir, contentRootDirFullPath);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
415 var result = Path.Combine(
Microsoft.AspNetCore.Components.WebViewE2E.Test (3)
BasicBlazorHybridTest.cs (2)
23var thisProgramDir = Path.GetDirectoryName(typeof(Program).Assembly.Location); 26var newNativePath = Path.Combine(thisProgramDir, "runtimes", RuntimeInformation.RuntimeIdentifier, "native");
WebViewManagerE2ETests.cs (1)
32WorkingDirectory = Path.GetDirectoryName(photinoTestProgramExePath),
Microsoft.AspNetCore.DataProtection (10)
Internal\ContainerUtils.cs (2)
65var fs_file = new DirectoryInfo(fields[1].TrimEnd(Path.DirectorySeparatorChar)).FullName; 70if (fs_file.Equals(dir.FullName.TrimEnd(Path.DirectorySeparatorChar), StringComparison.Ordinal))
Internal\HostingApplicationDiscriminator.cs (2)
14private readonly string DirectorySeparator = Path.DirectorySeparatorChar.ToString(); 15private readonly string AltDirectorySeparator = Path.AltDirectorySeparatorChar.ToString();
Repositories\DefaultKeyStorageDirectories.cs (3)
55retVal = GetKeyStorageDirectoryFromBaseAppDataPath(Path.Combine(homePath, "AppData", "Local")); 60retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName)); 110return new DirectoryInfo(Path.Combine(basePath, "ASP.NET", DataProtectionKeysFolderName));
Repositories\FileSystemXmlRepository.cs (3)
140var tempFilename = Path.Combine(Directory.FullName, Guid.NewGuid().ToString() + ".tmp"); 141var finalFilename = Path.Combine(Directory.FullName, filename + ".xml"); 146var tempTempFilename = Path.GetTempFileName();
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)
Internal\KeyManagementOptionsPostSetupTest.cs (2)
89var xmlDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()));
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\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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)
CertificateManagerTests.cs (3)
185var exportedCertificate = X509Certificate2.CreateFromEncryptedPemFile(CertificateName, certificatePassword, Path.ChangeExtension(CertificateName, "key")); 347var exportedCertificate = X509Certificate2.CreateFromPemFile(CertificateName, Path.ChangeExtension(CertificateName, "key")); 373.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), Path.Combine("NoSuchDirectory", CertificateName));
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (2)
402Write(System.IO.Path.GetFileName(firstFrame.File)); 650Write(System.IO.Path.GetFileName(frame.File));
Microsoft.AspNetCore.Diagnostics.Tests (2)
ExceptionDetailsProviderTest.cs (2)
41Path.Combine(rootPath, "TestFiles/SourceFile.txt") 46Path.Combine(rootPath, @"TestFiles\SourceFile.txt");
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)
Infrastructure\OpenApiTestHelpers.cs (1)
24var filePath = Path.Combine(System.AppContext.BaseDirectory, "Microsoft.AspNetCore.Grpc.Swagger.Tests.xml");
Microsoft.AspNetCore.Hosting (13)
Internal\HostingEnvironmentExtensions.cs (6)
30var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 38hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 43hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath); 81var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 89hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 94hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath);
src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StaticWebAssets\StaticWebAssetsLoader.cs (2)
77var basePath = string.IsNullOrEmpty(assemblyLocation) ? AppContext.BaseDirectory : Path.GetDirectoryName(assemblyLocation); 78return Path.Combine(basePath!, $"{environment.ApplicationName}.staticwebassets.runtime.json");
WebHostBuilder.cs (3)
370if (Path.IsPathRooted(contentRootPath)) 374return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
Microsoft.AspNetCore.Hosting.FunctionalTests (3)
LinkedApplicationTests.cs (1)
21var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets",
ShutdownTests.cs (1)
46var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets",
WebHostBuilderTests.cs (1)
28var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets", "IStartupInjectionAssemblyName");
Microsoft.AspNetCore.Hosting.Tests (39)
HostingApplicationDiagnosticsTests.cs (14)
181var testSource = new ActivitySource(Path.GetRandomFileName()); 1020var testSource = new ActivitySource(Path.GetRandomFileName()); 1092var testSource = new ActivitySource(Path.GetRandomFileName()); 1134var testSource = new ActivitySource(Path.GetRandomFileName()); 1193var testSource = new ActivitySource(Path.GetRandomFileName()); 1228var testSource = new ActivitySource(Path.GetRandomFileName()); 1278var testSource = new ActivitySource(Path.GetRandomFileName()); 1318var testSource = new ActivitySource(Path.GetRandomFileName()); 1353var testSource = new ActivitySource(Path.GetRandomFileName()); 1394var testSource = new ActivitySource(Path.GetRandomFileName()); 1426var testSource = new ActivitySource(Path.GetRandomFileName()); 1469var testSource = new ActivitySource(Path.GetRandomFileName()); 1513var testSource = new ActivitySource(Path.GetRandomFileName()); 1562var testSource = new ActivitySource(Path.GetRandomFileName());
HostingApplicationTests.cs (4)
95var testSource = new ActivitySource(Path.GetRandomFileName()); 96var dummySource = new ActivitySource(Path.GetRandomFileName()); 138var testSource = new ActivitySource(Path.GetRandomFileName()); 139var dummySource = new ActivitySource(Path.GetRandomFileName());
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);
StaticWebAssets\ManifestStaticWebAssetsFileProviderTests.cs (3)
20manifest.ContentRoots = new[] { Path.GetDirectoryName(typeof(ManifestStaticWebAssetsFileProviderTest).Assembly.Location) }; 368manifest.ContentRoots = new[] { Path.Combine(AppContext.BaseDirectory, "testroot", "wwwroot") }; 616manifest.ContentRoots = new[] { Path.GetDirectoryName(typeof(ManifestStaticWebAssetsFileProviderTest).Assembly.Location) };
WebHostBuilderTests.cs (4)
687Assert.True(Path.IsPathRooted(basePath)); 688Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath); 690Assert.True(Path.IsPathRooted(basePath2)); 691Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath2);
WebHostTests.cs (2)
850Assert.Equal(Path.GetFullPath("testroot"), env.WebRootPath); 856Assert.Equal(Path.GetFullPath("testroot"), env1.WebRootPath);
Microsoft.AspNetCore.Http (2)
BindingAddress.cs (1)
246if (isUnixPipe && !Path.IsPathRooted(GetUnixPipePath(host)))
src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
EndpointFilterInvocationContextOfTTests.cs (2)
87var currentContentPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "EndpointFilterInvocationContextOfT.Generated.cs"); 88var templatePath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "EndpointFilterInvocationContextOfT.Generated.tt");
Microsoft.AspNetCore.Http.Microbenchmarks (7)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (7)
120var symbolsName = Path.ChangeExtension(assemblyName, "pdb"); 357? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "RequestDelegateGenerator", "Baselines") 359var baselineFilePath = Path.Combine(baselineFilePathRoot!, $"{callerName}.generated.txt"); 422var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 430dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Http.Results (2)
PhysicalFileHttpResult.cs (1)
143if (!Path.IsPathRooted(fileName))
Results.cs (1)
481=> Path.IsPathRooted(path)
Microsoft.AspNetCore.Http.Results.Tests (59)
ResultsCacheTests.cs (2)
13var currentContentPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsCache.StatusCodes.cs"); 14var templatePath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsCache.StatusCodes.tt");
ResultsOfTTests.cs (4)
27var resultsOfTGeneratedPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsOfT.Generated.cs"); 28var testsGeneratedPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsOfTTests.Generated.cs"); 30var testResultsOfTGeneratedPath = Path.GetTempFileName(); 31var testTestsGeneratedPath = Path.GetTempFileName();
ResultsTests.cs (2)
1754(() => Results.File(Path.Join(Path.DirectorySeparatorChar.ToString(), "rooted", "path"), null, null, null, null, false), typeof(PhysicalFileHttpResult)),
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);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (11)
44var path = Path.GetFullPath("helllo.txt"); 81var path = Path.GetFullPath("helllo.txt"); 118var path = Path.GetFullPath("helllo.txt"); 151var path = Path.GetFullPath("helllo.txt"); 187var path = Path.GetFullPath("helllo.txt"); 221var path = Path.GetFullPath("helllo.txt"); 257var path = Path.GetFullPath("helllo.txt"); 288var path = Path.GetFullPath("helllo.txt"); 324var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt"); 345Assert.Equal(Path.Combine("TestFiles", "FilePathResultTestFile.txt"), sendFile.Name); 379var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt");
Microsoft.AspNetCore.HttpLogging (4)
FileLoggerProcessor.cs (4)
53_path = Path.Join(environment.ContentRootPath, "logs"); 55else if (!Path.IsPathRooted(_path)) 57_path = Path.Join(environment.ContentRootPath, _path); 329return Path.Combine(_path, FormattableString.Invariant($"{_fileName}{date.Year:0000}{date.Month:00}{date.Day:00}.{_fileNumber:0000}.txt"));
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));
W3CLoggerTests.cs (2)
16var path = Path.GetTempFileName() + "_"; 59var path = Path.GetTempFileName() + "_";
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)
Areas\Identity\Pages\V4\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Areas\Identity\Pages\V5\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Microsoft.AspNetCore.InternalTesting (16)
AssemblyTestLog.cs (5)
120logOutputDirectory = Path.Combine(_baseDirectory, className); 140var testOutputFile = Path.Combine(logOutputDirectory, $"{testName}{LogFileExtension}"); 148testOutputFile = Path.Combine(logOutputDirectory, $"{testName}.{i}{LogFileExtension}"); 191var globalLogFileName = Path.Combine(baseDirectory, "global.log"); 274var dir = Path.GetDirectoryName(fileName);
CollectDumpAttribute.cs (1)
30var path = Path.Combine(context.FileOutput.TestClassOutputDirectory, context.FileOutput.GetUniqueFileName(context.FileOutput.TestName, ".dmp"));
HelixHelper.cs (3)
20? Path.Combine(Path.GetTempPath(), uploadFileName) 21: Path.Combine(uploadRoot, uploadFileName);
TestFileOutputContext.cs (4)
43TestClassOutputDirectory = Path.Combine(AssemblyOutputDirectory, TestClassName); 64var path = Path.Combine(TestClassOutputDirectory, $"{prefix}{extension}"); 69path = Path.Combine(TestClassOutputDirectory, $"{prefix}{i++}{extension}"); 91return Path.Combine(baseDirectory, assembly.GetName().Name, attribute.TargetFramework);
TestPathUtilities.cs (3)
19var projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, $"{solution}.slnf")); 25projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "AspNetCore.slnx")); 29directoryInfo = new DirectoryInfo(Path.Combine(directoryInfo.FullName, "src"));
Microsoft.AspNetCore.InternalTesting.Tests (16)
AssemblyTestLogTests.cs (15)
47var tfmPath = Path.Combine(tempDir, assemblyName, TestableAssembly.TFM); 48var globalLogPath = Path.Combine(tfmPath, "global.log"); 49var testLog = Path.Combine(tfmPath, TestableAssembly.TestClassName, $"{testName}.log"); 148var globalLogPath = Path.Combine( 153var testLog = Path.Combine( 184var globalLogPath = Path.Combine( 189var testLog = Path.Combine( 230var globalLogPath = Path.Combine( 235var testLog = Path.Combine( 298Path.Combine(tempDir, TestableAssembly.ThisAssemblyName, TestableAssembly.TFM, "FakeTestClass")) 301var testFileName = Path.GetFileNameWithoutExtension(testLog.Name); 343Assert.True(File.Exists(Path.Combine( 353Assert.True(File.Exists(Path.Combine( 368var tempDir = Path.Combine(Path.GetTempPath(), $"TestLogging_{Guid.NewGuid():N}");
TestableAspNetTestAssemblyRunner.cs (1)
54.Returns(Path.Combine(Directory.GetCurrentDirectory(), $"{testAssemblyName}.dll"));
Microsoft.AspNetCore.Mvc.Core (3)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
72Path.GetDirectoryName(assembly.Location); 90var relatedAssemblyLocation = Path.Combine(assemblyDirectory, attribute.AssemblyFileName + ".dll");
Infrastructure\PhysicalFileResultExecutor.cs (1)
79if (!Path.IsPathRooted(result.FileName))
Microsoft.AspNetCore.Mvc.Core.Test (62)
ApplicationParts\RelatedAssemblyPartTest.cs (5)
12private static readonly string AssemblyDirectory = Path.GetTempPath().TrimEnd(Path.DirectorySeparatorChar); 44var assemblyPath = Path.Combine(AssemblyDirectory, "MyAssembly.dll"); 59var assemblyPath = Path.Combine(AssemblyDirectory, "MyAssembly.dll"); 89public string LocationSettable { get; set; } = Path.Combine(AssemblyDirectory, "MyAssembly.dll");
ControllerBaseTest.cs (4)
1773var path = Path.GetFullPath("somepath"); 1795var path = Path.GetFullPath("somepath"); 1817var path = Path.GetFullPath("somepath"); 1839var path = Path.GetFullPath("somepath");
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);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (11)
44var path = Path.GetFullPath("helllo.txt"); 81var path = Path.GetFullPath("helllo.txt"); 118var path = Path.GetFullPath("helllo.txt"); 151var path = Path.GetFullPath("helllo.txt"); 187var path = Path.GetFullPath("helllo.txt"); 221var path = Path.GetFullPath("helllo.txt"); 257var path = Path.GetFullPath("helllo.txt"); 288var path = Path.GetFullPath("helllo.txt"); 324var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt"); 345Assert.Equal(Path.Combine("TestFiles", "FilePathResultTestFile.txt"), sendFile.Name); 379var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt");
VirtualFileResultTest.cs (2)
23var path = Path.GetFullPath("helllo.txt"); 36var path = Path.GetFullPath("helllo.txt");
Microsoft.AspNetCore.Mvc.FunctionalTests (9)
Infrastructure\ResourceFile.cs (2)
228var projectPath = Path.Combine(solutionPath, "test", assembly.GetName().Name); 229var fullPath = Path.Combine(projectPath, resourceName);
SimpleWithWebApplicationBuilderTests.cs (2)
205expectedWebRoot = Path.GetFullPath(Path.Combine(builder.GetSetting(WebHostDefaults.ContentRootKey), webRoot));
WebApplicationFactorySlnxTests.cs (5)
20_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")[..8]); 21_contentDirectory = Path.Combine(_tempDirectory, "BasicWebSite"); 27var wwwrootDir = Path.Combine(_contentDirectory, "wwwroot"); 37var slnxFile = Path.Combine(_tempDirectory, "TestSolution.slnx");
Microsoft.AspNetCore.Mvc.Localization (1)
ViewLocalizer.cs (1)
97var extension = Path.GetExtension(path);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
FileProviderRazorProjectFileSystem.cs (1)
64else if (string.Equals(RazorFileExtension, Path.GetExtension(fileInfo.Name), StringComparison.OrdinalIgnoreCase))
FileProviderRazorProjectItem.cs (2)
83(PhysicalPath[_root.Length] == Path.DirectorySeparatorChar || PhysicalPath[_root.Length] == Path.AltDirectorySeparatorChar))
RuntimeViewCompiler.cs (1)
339var assemblyName = Path.GetRandomFileName();
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (18)
AssemblyPartExtensionTest.cs (1)
25references.Select(Path.GetFileNameWithoutExtension));
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)
ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
PageModelTest.cs (2)
1410var path = Path.GetFullPath("somepath"); 1427var path = Path.GetFullPath("somepath");
PageTest.cs (2)
1400var path = Path.GetFullPath("somepath"); 1417var path = Path.GetFullPath("somepath");
Microsoft.AspNetCore.Mvc.Testing (5)
WebApplicationFactory.cs (5)
418var contentRootCandidate = Path.Combine( 422var contentRootMarker = Path.Combine( 424Path.GetFileName(contentRootAttribute.ContentRootTest)); 527var depsFile = new FileInfo(Path.Combine(AppContext.BaseDirectory, depsFileName)); 532Path.GetFileName(depsFile.FullName)));
Microsoft.AspNetCore.Mvc.Views.TestCommon (5)
TestFileProvider.cs (5)
44PhysicalPath = Path.Combine(Root, NormalizeAndEnsureValidPhysicalPath(path)), 45Name = Path.GetFileName(path), 56var directoryContent = new TestDirectoryContent(Path.GetFileName(path), files); 114filePath = filePath.Replace('/', Path.DirectorySeparatorChar); 116if (filePath[0] == Path.DirectorySeparatorChar)
Microsoft.AspNetCore.OpenApi.Build.Tests (16)
GenerateAdditionalXmlFilesForOpenApiTests.cs (13)
22WorkingDirectory = Path.GetDirectoryName(projectFile), 46var classLibTempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 50var classLibProjectPath = Path.Combine(classLibTempPath, "ClassLibrary.csproj"); 63var classLibSourcePath = Path.Combine(classLibTempPath, "Class1.cs"); 74var tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 78var sourceTargetsPath = Path.Combine(AppContext.BaseDirectory, "Microsoft.AspNetCore.OpenApi.targets"); 79var targetTargetsPath = Path.Combine(tempPath, "Microsoft.AspNetCore.OpenApi.targets"); 82var projectPath = Path.Combine(tempPath, "TestProject.csproj"); 101var sourcePath = Path.Combine(tempPath, "Program.cs");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
Microsoft.AspNetCore.OpenApi.Tests (3)
Integration\OpenApiDocumentIntegrationTests.cs (2)
44? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots") 46var outputDirectory = Path.Combine(baseSnapshotsDirectory, version.ToString());
Integration\OpenApiDocumentLocalizationTests.cs (1)
15? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots")
Microsoft.AspNetCore.OutputCaching.Tests (1)
TestUtils.cs (1)
57var path = Path.Combine(AppContext.BaseDirectory, "TestDocument.txt");
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"));
IntegrationTests\ComponentFilePathIntegrationTest.cs (1)
36relativePath = relativePath.Replace('\\', Path.DirectorySeparatorChar);
Legacy\BaselineWriter.cs (3)
18var root = RecursiveFind("Razor.slnf", Path.GetFullPath(".")); 19var baselinePath = Path.Combine(root, "src", "Razor", baselineFile); 37var test = Path.Combine(start, path);
RazorCodeDocumentExtensionsTest.cs (2)
487filePath: Path.Combine(basePath, relativePath), 499filePath: Path.Combine(basePath, importRelativePath),
Microsoft.AspNetCore.Razor.Microbenchmarks (3)
Formatting\DocumentFormattingBenchmark.cs (1)
156solution = solution.AddAdditionalDocument(documentId, Path.GetFileName(DocumentFilePath), sourceText, filePath: DocumentFilePath);
Helpers.cs (2)
21while (current is not null && !File.Exists(Path.Combine(current.FullName, "Razor.slnx"))) 32return s_testAppsPath ??= Path.Combine(GetRepoRootPath(), "src", "Razor", "benchmarks", "testapps");
Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler (4)
CodeGenerationBenchmark.cs (2)
19while (current != null && !File.Exists(Path.Combine(current.FullName, "MSN.cshtml"))) 29MSN = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"), RazorFileKind.Legacy);
SyntaxTreeGenerationBenckmark.cs (2)
21while (current != null && !File.Exists(Path.Combine(current.FullName, "MSN.cshtml"))) 31var projectItem = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"), RazorFileKind.Legacy);
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\IntegrationTests\RazorBaselineIntegrationTestBase.cs (10)
51var baselineFullPath = Path.Combine(TestProjectRoot, baselineFilePath); 52Directory.CreateDirectory(Path.GetDirectoryName(baselineFullPath)); 86var baselineFullPath = Path.Combine(TestProjectRoot, baselineFilePath); 87Directory.CreateDirectory(Path.GetDirectoryName(baselineFullPath)); 90var baselineDiagnosticsFullPath = Path.Combine(TestProjectRoot, baselineDiagnosticsFilePath); 101var baselineMappingsFullPath = Path.Combine(TestProjectRoot, baselineMappingsFilePath); 220var baselineFullPath = Path.Combine(TestProjectRoot, baselineFilePath); 221Directory.CreateDirectory(Path.GetDirectoryName(baselineFullPath)); 257return Path.Combine(GetDirectoryPath(testName), Path.ChangeExtension(fileName, extension));
Language\IntegrationTests\RazorIntegrationTestBase.cs (3)
76PathSeparator = Path.DirectorySeparatorChar.ToString(); 402var componentFullTypeName = $"{DefaultRootNamespace}.{Path.GetFileNameWithoutExtension(DefaultFileName)}"; 443var windowsPath = Path.Combine(ArbitraryWindowsPath, generated.CodeDocument.Source.RelativePath ?? "").Replace('/', '\\');
Language\Legacy\ParserTestBase.cs (9)
81var baselineFileName = Path.ChangeExtension(fileName, ".stree.txt"); 82var baselineDiagnosticsFileName = Path.ChangeExtension(fileName, ".diag.txt"); 83var baselineClassifiedSpansFileName = Path.ChangeExtension(fileName, ".cspans.txt"); 84var baselineTagHelperSpansFileName = Path.ChangeExtension(fileName, ".tspans.txt"); 90var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName); 91Directory.CreateDirectory(Path.GetDirectoryName(baselineFullPath)); 95var baselineDiagnosticsFullPath = Path.Combine(TestProjectRoot, baselineDiagnosticsFileName); 107var classifiedSpansBaselineFullPath = Path.Combine(TestProjectRoot, baselineClassifiedSpansFileName); 111var tagHelperSpansBaselineFullPath = Path.Combine(TestProjectRoot, baselineTagHelperSpansFileName);
Language\TestFile.cs (1)
102var directory = Path.GetDirectoryName(filePath);
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)
CohostTestBase.cs (4)
102await RemoteWorkspaceProvider.TestAccessor.InitializeRemoteExportProviderBuilderAsync(Path.GetTempPath(), traceSource, DisposalToken); 265if (Path.GetExtension(file.fileName) == ".cs") 284=> Path.GetFullPath(Path.Combine(TestProjectData.SomeProjectPath, projectRelativeFileName));
RazorProjectBuilder.cs (8)
31ProjectName ??= Path.GetFileNameWithoutExtension(value); 58var name = Path.GetFileName(filePath); 66var name = Path.GetFileName(filePath); 74var name = Path.GetFileName(filePath); 80var name = Path.GetFileName(filePath); 136build_property.MSBuildProjectDirectory = {Path.GetDirectoryName(ProjectFilePath).AssumeNotNull()} 140var projectBasePath = Path.GetDirectoryName(ProjectFilePath).AssumeNotNull(); 163filePath: Path.Combine(projectBasePath, ".globalconfig"));
Microsoft.AspNetCore.Razor.Test.Common.Tooling (43)
AssertExtensions.cs (2)
57var documentInfo = DocumentInfo.Create(documentId, Path.GetFileName(filePath), filePath: filePath); 76.AddAdditionalDocument(Path.GetFileName(filePath), text, filePath: filePath).Project.Solution;
Language\IntegrationTests\RazorToolingIntegrationTestBase.cs (2)
59PathSeparator = Path.DirectorySeparatorChar.ToString(); 328var windowsPath = Path.Combine(ArbitraryWindowsPath, generated.CodeDocument.Source.RelativePath).Replace('/', '\\');
Language\Legacy\ToolingParserTestBase.cs (8)
66var baselineFileName = Path.ChangeExtension(fileName, ".stree.txt"); 67var baselineDiagnosticsFileName = Path.ChangeExtension(fileName, ".diag.txt"); 68var baselineClassifiedSpansFileName = Path.ChangeExtension(fileName, ".cspans.txt"); 69var baselineTagHelperSpansFileName = Path.ChangeExtension(fileName, ".tspans.txt"); 75var baselineFullPath = Path.Combine(TestProjectRoot, baselineFileName); 79var baselineDiagnosticsFullPath = Path.Combine(TestProjectRoot, baselineDiagnosticsFileName); 91var classifiedSpansBaselineFullPath = Path.Combine(TestProjectRoot, baselineClassifiedSpansFileName); 95var tagHelperSpansBaselineFullPath = Path.Combine(TestProjectRoot, baselineTagHelperSpansFileName);
TestPathUtilities.cs (3)
16var result = Path.Combine(parts); 18if (!Path.IsPathRooted(result)) 30return new($"{Uri.UriSchemeFile}{Uri.SchemeDelimiter}{Path.Combine(parts)}");
TestProjectData.cs (28)
22SomeProjectPath = Path.Combine(baseDirectory, "SomeProject"); 23var someProjectObjPath = Path.Combine(SomeProjectPath, "obj"); 25SomeProject = new HostProject(Path.Combine(SomeProjectPath, "SomeProject.csproj"), someProjectObjPath, RazorConfiguration.Default, "SomeProject"); 26SomeProjectFile1 = new HostDocument(Path.Combine(SomeProjectPath, "File1.cshtml")); 27SomeProjectFile2 = new HostDocument(Path.Combine(SomeProjectPath, "File2.cshtml")); 28SomeProjectImportFile = new HostDocument(Path.Combine(SomeProjectPath, "_ViewImports.cshtml")); 29SomeProjectNestedFile3 = new HostDocument(Path.Combine(SomeProjectPath, "Nested", "File3.cshtml")); 30SomeProjectNestedFile4 = new HostDocument(Path.Combine(SomeProjectPath, "Nested", "File4.cshtml")); 31SomeProjectNestedImportFile = new HostDocument(Path.Combine(SomeProjectPath, "Nested", "_ViewImports.cshtml")); 32SomeProjectComponentFile1 = new HostDocument(Path.Combine(SomeProjectPath, "File1.razor")); 33SomeProjectComponentFile2 = new HostDocument(Path.Combine(SomeProjectPath, "File2.razor")); 34SomeProjectComponentImportFile1 = new HostDocument(Path.Combine(SomeProjectPath, "_Imports.razor")); 35SomeProjectNestedComponentFile3 = new HostDocument(Path.Combine(SomeProjectPath, "Nested", "File3.razor")); 36SomeProjectNestedComponentFile4 = new HostDocument(Path.Combine(SomeProjectPath, "Nested", "File4.razor")); 37SomeProjectCshtmlComponentFile5 = new HostDocument(Path.Combine(SomeProjectPath, "File5.cshtml")); 39var anotherProjectPath = Path.Combine(baseDirectory, "AnotherProject"); 40var anotherProjectObjPath = Path.Combine(anotherProjectPath, "obj"); 42AnotherProject = new HostProject(Path.Combine(anotherProjectPath, "AnotherProject.csproj"), anotherProjectObjPath, RazorConfiguration.Default, "AnotherProject"); 43AnotherProjectFile1 = new HostDocument(Path.Combine(anotherProjectPath, "File1.cshtml")); 44AnotherProjectFile2 = new HostDocument(Path.Combine(anotherProjectPath, "File2.cshtml")); 45AnotherProjectImportFile = new HostDocument(Path.Combine(anotherProjectPath, "_ViewImports.cshtml")); 46AnotherProjectNestedFile3 = new HostDocument(Path.Combine(anotherProjectPath, "Nested", "File3.cshtml")); 47AnotherProjectNestedFile4 = new HostDocument(Path.Combine(anotherProjectPath, "Nested", "File4.cshtml")); 48AnotherProjectNestedImportFile = new HostDocument(Path.Combine(anotherProjectPath, "Nested", "_ViewImports.cshtml")); 49AnotherProjectComponentFile1 = new HostDocument(Path.Combine(anotherProjectPath, "File1.razor")); 50AnotherProjectComponentFile2 = new HostDocument(Path.Combine(anotherProjectPath, "File2.razor")); 51AnotherProjectNestedComponentFile3 = new HostDocument(Path.Combine(anotherProjectPath, "Nested", "File3.razor")); 52AnotherProjectNestedComponentFile4 = new HostDocument(Path.Combine(anotherProjectPath, "Nested", "File4.razor"));
Microsoft.AspNetCore.Razor.Utilities.Shared (12)
FileUtilities.cs (3)
63var directoryName = Path.GetDirectoryName(path).AssumeNotNull(); 64var baseFileName = Path.GetFileNameWithoutExtension(path); 72uniquePath = Path.Combine(directoryName, $"{baseFileName}{identifier}{extension}");
PathUtilities.cs (9)
43return Path.GetDirectoryName(path); 58return Path.GetDirectoryName(path); 323=> Path.GetExtension(path); 328return Path.GetExtension(path); 357=> Path.HasExtension(path); 362return Path.HasExtension(path); 393return Path.IsPathFullyQualified(path); 438return Path.IsPathRooted(path); 447return Path.IsPathRooted(path);
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)
TestUtils.cs (1)
82var path = Path.Combine(AppContext.BaseDirectory, "TestDocument.txt");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
ResponseCachingTests.cs (2)
25_absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName());
ResponseSendFileTests.cs (2)
31RelativeFilePath = Path.GetFileName(AbsoluteFilePath); 308var emptyFilePath = Path.Combine(Directory.GetCurrentDirectory(), "zz_" + Guid.NewGuid().ToString() + "EmptyTestFile.txt");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
DelegateOutOfProcTests.cs (1)
25var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("HttpSysServer"), "test", "testassets",
Microsoft.AspNetCore.Server.IIS (4)
src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StartupHook.cs (1)
50var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
WebHostBuilderIISExtensions.cs (1)
34var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
Microsoft.AspNetCore.Server.IntegrationTesting (22)
ApplicationPublisher.cs (1)
122var tempPath = Path.GetTempPath() + Guid.NewGuid().ToString("N");
CachingApplicationPublisher.cs (1)
70var destFileName = Path.Combine(target.FullName, fileInfo.Name);
Common\DotNetCommands.cs (4)
27var result = Path.Combine(Directory.GetCurrentDirectory(), _dotnetFolderName); 50result = Path.Combine(userProfile, _dotnetFolderName); 63var archSpecificDir = Path.Combine(dotnetDir, arch.ToString()); 83return Path.Combine(dotnetDir, dotnetFile);
Deployers\NginxDeployer.cs (4)
32_configFile = Path.GetTempFileName(); 138var pidFile = Path.Combine(DeploymentParameters.ApplicationPath, $"{Guid.NewGuid()}.nginx.pid"); 139var errorLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.error.log"); 140var accessLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.access.log");
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (9)
91_deployedFolderPathInFileShare = Path.Combine(_deploymentParameters.RemoteServerFileSharePath, folderId); 153var webConfigFilePath = Path.Combine(_deploymentParameters.PublishedApplicationRootPath, "web.config"); 163Path.Combine(_deploymentParameters.DotnetRuntimePath, "dotnet.exe")); 204executableParameters = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".dll"); 208executablePath = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".exe"); 289var temppath = Path.Combine(destDirName, file.Name); 297var temppath = Path.Combine(destDirName, subdir.Name); 318var physicalFilePath = Path.Combine(Path.GetTempPath(), embeddedFileName);
Deployers\SelfHostDeployer.cs (2)
98workingDirectory = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework); 103var executable = Path.Combine(workingDirectory, DeploymentParameters.ApplicationName + executableExtension);
xunit\IISExpressAncmSchema.cs (1)
21var ancmConfigPath = Path.Combine(
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();
IISDeployerBase.cs (4)
43var path = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, "web.config"); 94var basePath = File.Exists(Path.Combine(AppContext.BaseDirectory, "x64", "aspnetcorev2.dll")) ? "" : @"ANCM\"; 96var ancmFile = Path.Combine(AppContext.BaseDirectory, arch); 99ancmFile = Path.Combine(AppContext.BaseDirectory, ancmDllName);
IISDeploymentParameterExtensions.cs (1)
136WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine(path, "std")));
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)
Internal\CertificatePathWatcher.cs (7)
115var path = Path.Combine(_contentRootDir, certificateConfig.Path); 116var dir = Path.GetDirectoryName(path)!; 141() => dirMetadata.FileProvider.Watch(Path.GetFileName(path)), 176var dirMetadata = _metadataForDirectory[Path.GetDirectoryName(path)!]; 185var fileInfo = dirMetadata.FileProvider.GetFileInfo(Path.GetFileName(path)); 218var path = Path.Combine(_contentRootDir, certificateConfig.Path); 219var dir = Path.GetDirectoryName(path)!;
Internal\Certificates\CertificateConfigLoader.cs (3)
40var certificatePath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!); 46var certificateKeyPath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.KeyPath); 75return (new X509Certificate2(Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!), certInfo.Password), fullChain);
KestrelServerOptions.cs (1)
587if (!Path.IsPathRooted(socketPath))
ListenOptionsHttpsExtensions.cs (3)
43return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName))); 57return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password)); 72return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password), configureOptions);
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
TlsConfigurationLoader.cs (3)
192var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 193basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 194path = basePath != null ? Path.Combine(basePath, $"{applicationName}.pfx") : null;
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);
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
NamedPipesTransportBenchmark.cs (1)
41_pipeName = "MicrobenchmarksTestPipe-" + Path.GetRandomFileName();
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");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Shared.Tests (39)
DotNetMuxerTests.cs (2)
20Assert.True(Path.IsPathRooted(muxerPath), "The path should be rooted"); 21Assert.Equal("dotnet", Path.GetFileNameWithoutExtension(muxerPath), ignoreCase: true);
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
TestCertificateManager.cs (2)
140var targetDirectoryPath = Path.GetDirectoryName(path); 240var keyPath = Path.ChangeExtension(path, ".key");
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
src\SignalR\common\Shared\TestCertificates.cs (4)
35var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCert.pfx"); 41var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCertECC.pfx");
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Docker.cs (2)
63foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 65var candidate = Path.Combine(dir, "docker" + _exeSuffix);
Microsoft.AspNetCore.SpaProxy (6)
SpaHostingStartup.cs (1)
20var spaProxyConfigFile = Path.Combine(AppContext.BaseDirectory, "spa.proxy.json");
SpaProxyLaunchManager.cs (5)
178if (OperatingSystem.IsWindows() && !Path.HasExtension(command)) 197WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 243WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 268var scriptPath = Path.Combine(AppContext.BaseDirectory, fileName); 305WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory)
Microsoft.AspNetCore.SpaServices.Extensions (1)
StaticFiles\DefaultSpaStaticFileProvider.cs (1)
31var absoluteRootPath = Path.Combine(
Microsoft.AspNetCore.StaticAssets (5)
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (3)
60return Path.Combine(AppContext.BaseDirectory, $"{environment.ApplicationName}.staticwebassets.endpoints.json"); 63return Path.IsPathRooted(staticAssetsManifestPath) ? staticAssetsManifestPath : Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath);
StaticAssetsEndpointRouteBuilderExtensions.cs (2)
33staticAssetsManifestPath = !Path.IsPathRooted(staticAssetsManifestPath) ? 34Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath) :
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)
StaticFileMiddleware.cs (2)
49_logger.WebRootPathNotFound(Path.GetFullPath(Path.Combine(hostingEnv.ContentRootPath, hostingEnv.WebRootPath ?? "wwwroot")));
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
FallbackStaticFileTest.cs (1)
48FileProvider = new PhysicalFileProvider(Path.Combine(environment.WebRootPath, "SubFolder")),
StaticFileMiddlewareTests.cs (6)
108var last = File.GetLastWriteTimeUtc(Path.Combine(AppContext.BaseDirectory, "TestDocument.txt")); 145.UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) 158var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 187.UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) 200var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 247.UseWebRoot(Path.Combine(AppContext.BaseDirectory))
Microsoft.AspNetCore.StaticFiles.Tests (33)
DefaultContentTypeProviderTests.cs (1)
65Assert.True(provider.TryGetContentType($"{new string(System.IO.Path.GetInvalidPathChars())}.txt", out contentType));
DefaultFilesMiddlewareTests.cs (6)
60using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 83using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 126using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 208using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 255using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 310using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
DirectoryBrowserMiddlewareTests.cs (7)
81using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 100using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 141using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 214using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 258using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 308using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 356using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
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)
WebHostBuilderExtensions.cs (2)
199builder.UseContentRoot(Path.GetFullPath(Path.Combine(directoryInfo.FullName, solutionRelativePath)));
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)
Autobahn\AutobahnTester.cs (3)
33var specFile = Path.GetTempFileName(); 64var outputFile = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", Spec.OutputDirectory, "index.json"); 133var configPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "Http.config");
Autobahn\Executable.cs (2)
22foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 24var candidate = Path.Combine(dir, name + _exeSuffix);
AutobahnTests.cs (2)
38Path.Combine(AppContext.BaseDirectory, "autobahnreports"); 86var iisExpressExe = Path.Combine(pf, "IIS Express", "iisexpress.exe");
Helpers.cs (2)
10return Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, projectName));
Microsoft.AspNetCore.WebUtilities (6)
AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
FileBufferingReadStream.cs (2)
243_tempFileName = Path.Combine(_tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid().ToString() + ".tmp"); 248var tempTempFileName = Path.GetTempFileName();
FileBufferingWriteStream.cs (3)
37/// uses the value returned by <see cref="Path.GetTempPath"/>. 270var tempFileName = Path.Combine(tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid() + ".tmp"); 275var tempTempFileName = Path.GetTempFileName();
Microsoft.AspNetCore.WebUtilities.Tests (3)
FileBufferingWriteStreamTests.cs (3)
12private readonly string TempDirectory = Path.Combine(Path.GetTempPath(), "FileBufferingWriteTests", Path.GetRandomFileName());
Microsoft.Build (273)
BackEnd\BuildManager\BuildManager.cs (2)
1328string projectName = projectFile is not null ? Path.GetFileName(projectFile) : "?"; 1547submission.BuildRequestData.ProjectFullPath = Path.Combine(
BackEnd\BuildManager\CacheSerialization.cs (1)
34Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (2)
412string projectDirectoryFullPath = Path.GetDirectoryName(config.ProjectFullPath); 1593using (StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, @"EngineTrace_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true))
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (1)
154(_projectRootDirectory = Path.GetDirectoryName(RequestConfiguration.ProjectFullPath));
BackEnd\Components\Communications\CurrentHost.cs (3)
31string dotnetExe = Path.Combine( 41&& Path.GetFileName(processPath) == Constants.DotnetProcessName) 51dotnetExe = Path.Combine(
BackEnd\Components\Communications\NodeLauncher.cs (1)
96string fileName = Path.GetFileName(msbuildLocation);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (8)
172nodeProcesses.AddRange(Process.GetProcessesByName(Path.GetFileNameWithoutExtension(msbuildtaskhostExeName))); 244&& Path.GetFileName(msbuildLocation).Equals(Constants.MSBuildExecutableName, StringComparison.OrdinalIgnoreCase)) 246string currentProcessName = Path.GetFileName(EnvironmentUtilities.ProcessPath); 249string dllPath = Path.Combine(Path.GetDirectoryName(msbuildLocation), Constants.MSBuildAssemblyName); 265msbuildLocation = Path.Combine(msbuildExeName, ".exe"); 472bool isNativeHost = msbuildLocation != null && Path.GetFileName(msbuildLocation).Equals(Constants.MSBuildExecutableName, StringComparison.OrdinalIgnoreCase); 473string expectedProcessName = Path.GetFileNameWithoutExtension(isNativeHost ? msbuildLocation : (CurrentHost.GetCurrentHost() ?? msbuildLocation));
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\Communications\RarNodeLauncher.cs (1)
64return pipeNames.Contains(Path.Combine(NamedPipeRoot, _pipeName));
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
183string pluginPath = FileUtilities.NormalizePath(Path.Combine(item.Project.Directory, item.EvaluatedInclude));
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (2)
562projectDirectory[i] = Path.GetDirectoryName(projectPath); 699outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
350if (!Path.IsPathRooted(projectFiles[i])) 352projectFiles[i] = Path.Combine(_requestEntry.ProjectRootDirectory, projectFiles[i]);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (5)
987string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); 1012string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); 1047string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); 1202path1 = Path.Combine(_project.Directory, path1); 1205path2 = Path.Combine(_project.Directory, path2);
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);
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
31string sdkPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath, sdk.Name, "Sdk");
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (4)
54Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, "SdkResolvers"), location); 81Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot, "SdkResolvers"), location); 117var manifest = Path.Combine(subfolder.FullName, $"{subfolder.Name}.xml"); 118var assembly = Path.Combine(subfolder.FullName, $"{subfolder.Name}.dll");
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (3)
84if (!System.IO.Path.IsPathRooted(manifest.Path)) 86manifest.Path = System.IO.Path.Combine(manifestFolder, manifest.Path); 87manifest.Path = System.IO.Path.GetFullPath(manifest.Path);
BackEnd\Shared\BuildRequestConfiguration.cs (4)
324if (MemoryExtensions.Equals(Path.GetFileName(ProjectFullPath.AsSpan()), "dirs.proj", StringComparison.OrdinalIgnoreCase)) 734Directory.CreateDirectory(Path.GetDirectoryName(cacheFile)); 842ErrorUtilities.VerifyThrow(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases"); 1013string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, "Configuration{0}.cache", _configId));
BackEnd\Shared\TargetResult.cs (4)
283string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, Path.Combine("Results{0}", "{1}.cache"), configId, targetToCache)); 293string directoryName = Path.GetDirectoryName(filename); 317Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (1)
75checkContext.DispatchFailedAcquisitionTelemetry(System.IO.Path.GetFileName(checkAcquisitionData.AssemblyPath), ex);
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
84Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\DoubleWritesCheck.cs (5)
92CheckWrite(context, Path.Combine(destinationFolderPath, Path.GetFileName(sourceFilePath))); 110fileBeingWritten = Path.GetFullPath(fileBeingWritten, context.Data.ProjectFileDirectory); 119Path.GetFileName(context.Data.ProjectFilePath), 120Path.GetFileName(existingEntry.projectFilePath),
BuildCheck\Checks\EmbeddedResourceCheck.cs (3)
79Path.GetFileName(context.Data.ProjectFilePath), 108string extension = Path.GetExtension(Path.GetFileNameWithoutExtension(s));
BuildCheck\Checks\ExecCliBuildCheck.cs (2)
84Path.GetFileName(context.Data.ProjectFilePath), 100Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\PreferProjectReferenceCheck.cs (4)
75Path.GetFileName(context.Data.ProjectFilePath), 76Path.GetFileName(projectProducingOutput.Item1), 103Path.GetFileName(projectReferencedViaOutput), 104Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\SharedOutputPathCheck.cs (2)
81Path.GetFileName(projectPath), 82Path.GetFileName(conflictingProject),
BuildCheck\Checks\TargetFrameworkConfusionCheck.cs (1)
59Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\TargetFrameworkUnexpectedCheck.cs (1)
98Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\UntrustedLocationCheck.cs (1)
90return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (2)
195else if (Path.DirectorySeparatorChar == '/') 201else if (!sawStartChar && Path.DirectorySeparatorChar == '\\')
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (5)
48var directoryOfTheProject = Path.GetDirectoryName(filePath)!; 67editorConfigFilePath = FileUtilities.GetPathOfFileAbove(EditorconfigFile, Path.GetDirectoryName(Path.GetDirectoryName(editorConfigFilePath))!); 104internal static string NormalizeWithForwardSlash(string p) => Path.DirectorySeparatorChar == '/' ? p : p.Replace(Path.DirectorySeparatorChar, '/');
BuildCheck\OM\BuildCheckDataContext.cs (1)
49_projectFileDirectory ??= Path.GetDirectoryName(ProjectFilePath)!;
BuildCheck\Utilities\BuildCheckUtilities.cs (3)
13if (!Path.IsPathRooted(path)) 15path = Path.Combine(Path.GetDirectoryName(projectFilePath)!, path);
Construction\ProjectRootElement.cs (2)
438_directory = Path.GetDirectoryName(newFullPath); 2109_directory = Path.GetDirectoryName(fullPath);
Construction\Solution\ProjectInSolution.cs (2)
189_absolutePath = Path.Combine(ParentSolution.SolutionFileDirectory, _relativePath); 244internal string Extension => Path.GetExtension(_relativePath);
Construction\Solution\SolutionFile.cs (7)
251SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 645SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 674return FileUtilities.GetFullPath(solution.GetProperty("path").GetString(), Path.GetDirectoryName(solutionFilterFile), escape: false); 919new BuildEventFileInfo(FileUtilities.GetFullPath(project, Path.GetDirectoryName(_solutionFile))), 1143string fullPathToEtpProj = Path.Combine(SolutionFileDirectory, etpProj.RelativePath); 1144string etpProjectRelativeDir = Path.GetDirectoryName(etpProj.RelativePath); 1197RelativePath = Path.Combine(etpProjectRelativeDir, fileElementValue)
Construction\Solution\SolutionProjectGenerator.cs (11)
1069string escapedSolutionFileName = EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath)); 1077string localFile = Path.Combine(escapedSolutionDirectory, $"before.{escapedSolutionFileName}.targets"); 1081localFile = Path.Combine(escapedSolutionDirectory, $"after.{escapedSolutionFileName}.targets"); 1356baseName = Path.Combine(_solutionFile.SolutionFileDirectory, MakeIntoSafeItemName(project.GetUniqueProjectName())); 2345if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 2347directoryName += Path.DirectorySeparatorChar; 2351globalProperties.AddProperty("SolutionExt", EscapingUtilities.Escape(Path.GetExtension(_solutionFile.FullPath))); 2352globalProperties.AddProperty("SolutionFileName", EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath))); 2353globalProperties.AddProperty("SolutionName", EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_solutionFile.FullPath))); 2355globalProperties.AddProperty(SolutionPathPropertyName, EscapingUtilities.Escape(Path.Combine(_solutionFile.SolutionFileDirectory, Path.GetFileName(_solutionFile.FullPath))));
DebugUtils.cs (5)
74var extension = Path.GetExtension(fileName); 75var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 77var fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 83fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 138s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
Definition\Toolset.cs (4)
372string rootPath = Path.GetPathRoot(Path.GetFullPath(toolsPathToUse)); 892if (Path.IsPathRooted(_overrideTasksPath)) 994yield return (usingTask, Path.GetDirectoryName(defaultTasksFile));
Definition\ToolsetLocalReader.cs (1)
40System.IO.Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "Roslyn"),
Definition\ToolsetReader.cs (8)
164var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar); 190var xbuildToolsetsDir = Path.Combine(libraryPath, $"xbuild{Path.DirectorySeparatorChar}"); 196var version = Path.GetFileName(d); 197var binPath = Path.Combine(d, "bin"); 620if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) 622path = Path.GetFullPath( 623Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
ElementLocation\XmlDocumentWithLocation.cs (3)
358if (Path.GetFileName(fullPath).StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase)) 361ErrorUtilities.VerifyThrow(Path.IsPathRooted(fullPath), "should be full path"); 362string directory = Path.GetDirectoryName(fullPath);
ErrorUtilities.cs (1)
176if (!Path.IsPathRooted(value))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (5)
86return lastCharacter == Path.DirectorySeparatorChar || lastCharacter == Path.AltDirectorySeparatorChar || lastCharacter == '\\'; 172if (state.EvaluationDirectory != null && !Path.IsPathRooted(item.ItemSpec)) 174list.Add(Path.GetFullPath(Path.Combine(state.EvaluationDirectory, item.ItemSpec)));
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.cs (19)
1705value = Path.GetFileName(elementLocation.File); 1709value = Path.GetFileNameWithoutExtension(elementLocation.File); 1717value = Path.GetExtension(elementLocation.File); 1721value = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(elementLocation.File)); 1725string directory = Path.GetDirectoryName(elementLocation.File); 1726int rootLength = Path.GetPathRoot(directory).Length; 1796return NativeMethodsShared.FrameworkBasePath + Path.DirectorySeparatorChar; 2607if (Path.IsPathRooted(unescapedPath)) 2619rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 2652string combinedPath = Path.Combine(unescapedPath, relativePath); 2687if (Path.IsPathRooted(unescapedPath)) 2699rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 2706directoryName = Path.GetDirectoryName(rootedPath); 2722directoryName = Path.GetDirectoryName(directoryName); 2766if (Path.IsPathRooted(unescapedPath)) 2778rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 2781directoryName = Path.GetDirectoryName(rootedPath); 4049|| _receiverType == typeof(System.IO.Path)) 4109string startingDirectory = String.IsNullOrWhiteSpace(elementLocation.File) ? String.Empty : Path.GetDirectoryName(elementLocation.File);
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))
Evaluation\IntrinsicFunctions.cs (2)
297return Path.Combine(NativeMethodsShared.FrameworkBasePath, m.Groups[0].Value) + Path.DirectorySeparatorChar;
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (1)
101evaluationLocation.File == null ? string.Empty : System.IO.Path.GetFileName(evaluationLocation.File),
FileSystem\DirectoryCacheFileSystemWrapper.cs (1)
92FindTransform<string> transform = (ref ReadOnlySpan<char> fileName) => Path.Join(path.AsSpan(), fileName);
Globbing\MSBuildGlob.cs (3)
144var rootedInput = Path.Combine(_state.Value.GlobRoot, stringToMatch); 151normalizedInput += Path.DirectorySeparatorChar; 240var parentedFixedPart = Path.Combine(globRoot, fixedDirPart);
Graph\GraphBuilder.cs (7)
305if (!solutionDirectoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 307solutionDirectoryName += Path.DirectorySeparatorChar; 311solutionGlobalPropertiesBuilder["SolutionExt"] = EscapingUtilities.Escape(Path.GetExtension(Solution.FullPath)); 312solutionGlobalPropertiesBuilder["SolutionFileName"] = EscapingUtilities.Escape(Path.GetFileName(Solution.FullPath)); 313solutionGlobalPropertiesBuilder["SolutionName"] = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(Solution.FullPath)); 314solutionGlobalPropertiesBuilder[SolutionProjectGenerator.SolutionPathPropertyName] = EscapingUtilities.Escape(Path.Combine(Solution.SolutionFileDirectory, Path.GetFileName(Solution.FullPath)));
Graph\ProjectGraph.cs (1)
517var nodeName = Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
Instance\ProjectInstance.cs (3)
381_directory = Path.GetDirectoryName(projectPath); 434_directory = Path.GetDirectoryName(projectPath); 3118DirectoryPath = Path.GetDirectoryName(projectFile)
Instance\ProjectItemInstance.cs (1)
2453if (Path.DirectorySeparatorChar != '\\' && includeEscaped?.IndexOf('\\') > -1)
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
268string assemblyName = loadInfo.AssemblyName ?? Path.GetFileName(loadInfo.AssemblyFile); 651netCoreSdkRoot = Path.GetDirectoryName(ridGraphPath);
Instance\TaskFactories\TaskHostTask.cs (1)
801? Path.Combine(msbuildPath, Constants.MSBuildExecutableName)
Instance\TaskRegistry.cs (8)
79private static readonly string s_potentialTasksV4Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV4Filename); 98private static readonly string s_potentialTasksV12Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV12Filename); 117private static readonly string s_potentialTasksCoreLocation = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksCoreFilename); 358if (assemblyFile != null && !Path.IsPathRooted(assemblyFile)) 360assemblyFile = Strings.WeakIntern(Path.Combine(directoryOfImportingFile, assemblyFile)); 375string replacedAssemblyFile = Path.Combine(Path.GetDirectoryName(assemblyFile), s_tasksCoreFilename); 1210!FileClassifier.IsMicrosoftAssembly(Path.GetFileName(_taskFactoryAssemblyLoadInfo.AssemblyFile)) &&
Logging\BinaryLogger\BinaryLogger.cs (6)
357logDirectory = Path.GetDirectoryName(FilePath); 546string directory = Path.GetDirectoryName(additionalPath); 628string fullPath = Path.GetFullPath(generatedFileUsedEventArgs.FilePath); 678FilePath = Path.GetFullPath(FilePath); 712return Path.GetFullPath(DefaultBinlogFileName); 734return Path.GetFullPath(filePath);
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
401new ProjectImportsCollector(Path.GetRandomFileName(), false, runOnBackground: false); 1833filePath = Path.GetTempFileName();
Logging\BinaryLogger\ProjectImportsCollector.cs (4)
52=> Path.ChangeExtension(logFilePath, sourcesArchiveExtension); 70_archiveFilePath = Path.Combine( 73Path.GetFileName(logFilePath), 232filePath = Path.GetFullPath(filePath);
Logging\DistributedLoggers\DistributedFileLogger.cs (1)
105string extension = Path.GetExtension(_logFile);
Logging\FileLogger.cs (2)
104logDirectory = Path.GetDirectoryName(Path.GetFullPath(_logFileName));
Logging\LoggerDescription.cs (2)
59if (loggerAssemblyFile != null && !Path.IsPathRooted(loggerAssemblyFile)) 284AssemblyLoadInfo.Create(_loggerAssembly.AssemblyName, Path.GetFullPath(_loggerAssembly.AssemblyFile));
Logging\ProfilerLogger.cs (1)
292var content = System.IO.Path.GetExtension(FileToLog) == ".md"
Logging\TerminalLogger\TerminalLogger.cs (14)
918Uri.TryCreate(new(Path.GetDirectoryName(outputPathSpan)), UriKind.Absolute, out Uri? uri); 936&& (outputPathSpan[workingDirectorySpan.Length] == Path.DirectorySeparatorChar 937|| outputPathSpan[workingDirectorySpan.Length] == Path.AltDirectorySeparatorChar)) 945var relativePathFromWorkingDirToSourceRoot = Path.GetRelativePath(workingDirectorySpan.ToString(), sourceRootSpan.ToString()).AsSpan(); 950&& (outputPathSpan[sourceRootSpan.Length - 1] == Path.DirectorySeparatorChar 951|| outputPathSpan[sourceRootSpan.Length - 1] == Path.AltDirectorySeparatorChar)) 954projectDisplayPathSpan = Path.Combine(relativePathFromWorkingDirToSourceRoot.ToString(), outputPathSpan.Slice(sourceRootSpan.Length).ToString()).AsSpan(); 976Path.GetFileNameWithoutExtension(project.ProjectFile) : 1042string projectFile = Path.GetFileNameWithoutExtension(e.ProjectFile); 1165string projectFile = Path.GetFileNameWithoutExtension(e.ProjectFile); 1195var projectFileName = Path.GetFileName(e.ProjectFile.AsSpan()); 1197message.AsSpan().StartsWith(Path.GetFileNameWithoutExtension(projectFileName)) && hasProject) 1604int index = path.AsSpan().LastIndexOfAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
Resources\Constants.cs (1)
300availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(Path)));
TypeLoader.cs (5)
75string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 76microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 235string baseDir = Path.GetDirectoryName(assemblyLoadInfo.AssemblyFile); 258string assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 296assembliesDictionary[Path.GetFileName(path)] = path;
Utilities\FileSpecMatchTester.cs (3)
69fileToMatch = FileUtilities.GetFullPathNoThrow(Path.Combine(_currentDirectory, fileToMatch)); 90string filename = Path.GetFileName(normalizedFileToMatch); 129var absoluteFixedDirPart = Path.Combine(currentDirectory, fixedDirPart);
Utilities\NuGetFrameworkWrapper.cs (2)
205Path.Combine(BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory, "Common7", "IDE", "CommonExtensions", "Microsoft", "NuGet") : 208string assemblyPath = Path.Combine(assemblyDirectory, NuGetFrameworksFileName);
Utilities\Utilities.cs (1)
577string userExtensionsPath = Path.Combine(localAppData, ReservedPropertyNames.userExtensionsPathSuffix);
Xml\ProjectXmlUtilities.cs (1)
100if (Path.GetExtension(element.Location.File).Equals(".dwproj", StringComparison.OrdinalIgnoreCase))
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");
DoubleWritesAnalyzer_Tests.cs (1)
49{ "DestinationFiles", new TaskInvocationCheckData.TaskParameter(Path.Combine("outdir", "source1"), IsOutput: false) },
EditorConfigParser_Tests.cs (4)
66TransientTestFolder workFolder2 = testEnvironment.CreateFolder(Path.Combine(workFolder1.Path, "subfolder"), createFolder: true); 84var listOfEditorConfigFile = parser.DiscoverEditorConfigFiles(Path.Combine(workFolder1.Path, "subfolder", "projectfile.proj")).ToList(); 98TransientTestFolder workFolder2 = testEnvironment.CreateFolder(Path.Combine(workFolder1.Path, "subfolder"), createFolder: true); 113var listOfEditorConfigFile = parser.DiscoverEditorConfigFiles(Path.Combine(workFolder1.Path, "subfolder", "projectfile.proj")).ToList();
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"));
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
Microsoft.Build.CommandLine.UnitTests (82)
MSBuildServer_Tests.cs (6)
23using Path = System.IO.Path; 110string? dir = Path.GetDirectoryName(markerFile.Path); 119watcher.Filter = Path.GetFileName(markerFile.Path); 191string? dir = Path.GetDirectoryName(markerFile.Path); 202watcher.Filter = Path.GetFileName(markerFile.Path); 340_env.SetCurrentDirectory(Path.GetDirectoryName(project.Path));
PerfLog_Tests.cs (3)
41string projectPath = Path.Combine(projectFolder.Path, "ClassLibrary.csproj"); 64string perfLogPath = Path.Combine(perfLogFolder.Path, "logs"); 77string projectPath = Path.Combine(projectFolder.Path, "ClassLibrary.csproj");
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
XMake_BinlogSwitch_Tests.cs (7)
42string binlogPath = Path.Combine(directory.Path, "test.binlog"); 61string binlogPath1 = Path.Combine(directory.Path, "test1.binlog"); 62string binlogPath2 = Path.Combine(directory.Path, "test2.binlog"); 84string binlogPattern = Path.Combine(directory.Path, "build-{}.binlog"); 110string binlogPattern = Path.Combine(directory.Path, "build-{}-test-{}.binlog"); 135string binlogPath = Path.Combine(directory.Path, "test.binlog"); 159string binlogPath = Path.Combine(directory.Path, "test.binlog");
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)
MultithreadedExecution_Tests.cs (2)
52string sourceAssetDir = Path.Combine(_testAssetDir, testAsset.SolutionFolder); 128string binlogPath = Path.Combine(isolatedAsset.SolutionFolder, "build.binlog");
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
TestAssetsFixture.cs (3)
36TestAssetDir = Path.Combine(Path.GetDirectoryName(typeof(TestSolutionAssetsFixture).Assembly.Location) ?? AppContext.BaseDirectory, "TestAssets"); 44string projectPath = Path.Combine(TestAssetDir, asset.ProjectPath);
TestSolutionAsset.cs (1)
29internal string ProjectPath => Path.Combine(SolutionFolder, ProjectRelativePath);
Microsoft.Build.Engine.OM.UnitTests (151)
Construction\ConstructionEditing_Tests.cs (4)
3211var testSdkDirectory = Path.Combine(testSdkRoot, "MSBuildUnitTestSdk", "Sdk"); 3214string sdkPropsPath = Path.Combine(testSdkDirectory, "Sdk.props"); 3215string sdkTargetsPath = Path.Combine(testSdkDirectory, "Sdk.targets"); 3235var updated = Path.Combine(testProject.TestRoot, "updated.proj");
Construction\ProjectFormatting_Tests.cs (7)
409directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 412string file = Path.Combine(directory, "test.proj"); 464directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 467string file = Path.Combine(directory, "test.proj"); 712FileUtilities.DeleteDirectoryNoThrow(Path.GetDirectoryName(file), false);
Construction\ProjectImportElement_Tests.cs (4)
241string tempPath = Path.GetTempPath(); 242string testTempPath = Path.Combine(tempPath, "UnitTestsPublicOm"); 243string projectfile = Path.Combine(testTempPath, "a.proj"); 244string targetsFile = Path.Combine(tempPath, "x.targets");
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\ProjectCollection_Tests.cs (2)
1239collection.AddToolset(new Toolset("testTools", Path.GetTempPath(), collection, Path.GetTempPath()));
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");
NugetRestoreTests.cs (3)
36string currentAssemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 37string bootstrapMsBuildBinaryDir = Path.Combine(RunnerUtilities.BootstrapMsBuildBinaryLocation, msbuildSubFolder); 61RunnerUtilities.RunProcessAndGetOutput(Path.Combine(currentAssemblyDir, "nuget", "NuGet.exe"), "restore " + sln.Path + " -MSBuildPath \"" + bootstrapMsBuildBinaryDir + "\"", out bool success, outputHelper: _output);
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
TransientIO.cs (7)
34private static bool IsDirSlash(char c) => c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 54path = Path.GetFullPath(path); 66var parent = Path.GetDirectoryName(absolute); 83var absolute = Path.GetFullPath(Path.IsPathRooted(relative) ? relative : Path.Combine(tempRoot, relative));
Microsoft.Build.Engine.UnitTests (944)
BackEnd\AppHostSupport_Tests.cs (7)
44string expectedDotnetRoot = Path.GetDirectoryName(_dotnetHostPath); 210string externalPath = Path.Combine(Path.GetTempPath(), $"different_path_{Guid.NewGuid():N}"); 231string realDir = Path.Combine(Path.GetTempPath(), $"msbuild_test_real_{Guid.NewGuid():N}"); 232string symlinkDir = Path.Combine(Path.GetTempPath(), $"msbuild_test_link_{Guid.NewGuid():N}");
BackEnd\AssemblyTaskFactory_E2E_Tests.cs (5)
16private static string AssemblyLocation { get; } = Path.Combine(Path.GetDirectoryName(typeof(NetTaskHost_E2E_Tests).Assembly.Location) ?? AppContext.BaseDirectory); 18private static string TestAssetsRootPath { get; } = Path.Combine(AssemblyLocation, "TestAssets"); 32string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleFrameworkTask", "TestTask", "TestTask.csproj"); 53string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleFrameworkTask", "TestTask", "TestTask.csproj");
BackEnd\BinaryTranslator_Tests.cs (2)
551Assert.Equal(Path.Combine(directory, fileName), deserializedFullPath); 584Assert.Equal(fullPath, Path.Combine(deserializedDirectory, deserializedFileName));
BackEnd\BuildManager_Tests.cs (7)
350string shutdownProjectDirectory = Path.Combine(Path.GetTempPath(), String.Format(CultureInfo.InvariantCulture, "VSNodeShutdown_{0}_UnitTest", Process.GetCurrentProcess().Id)); 3493_env.SetEnvironmentVariable(Constants.DotnetHostPathEnvVarName, Path.GetTempPath()); 3547string fileName = Path.GetTempFileName(); 3571var resultsFiles = Directory.EnumerateFiles(directory).Select(Path.GetFileName); 3683string rootProjectPath = Path.Combine(shutdownProjectDirectory, String.Format(CultureInfo.InvariantCulture, "RootProj_{0}.proj", Guid.NewGuid().ToString("N"))); 3895root.FullPath = Path.GetTempFileName();
BackEnd\BuildRequestConfiguration_Tests.cs (3)
158Assert.Equal(config1.ProjectFullPath, Path.GetFullPath("file")); 473string problematicTmpPath = Path.Combine(originalTmp, "}", "blabla", "temp"); 499configWithoutEvaluation.ShouldSkipIsolationConstraintsForReference(Path.GetFullPath("foo"));
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\CustomTaskHelper.cs (3)
29string[] referenceAssemblies = new string[] { "System.dll", Path.Combine(referenceAssembliesPath, "Microsoft.Build.Framework.dll"), Path.Combine(referenceAssembliesPath, "Microsoft.Build.Utilities.Core.dll"), Path.Combine(referenceAssembliesPath, "Microsoft.Build.Tasks.Core.dll") };
BackEnd\DebugUtils_tests.cs (8)
55string testCurrentDir = Path.GetDirectoryName(dummyProject.ProjectFile); 66resultPath.ShouldBe(Path.Combine(relativePath, ".MSBuild_Logs")); 89string testCurrentDir = Path.GetDirectoryName(dummyProject.ProjectFile); 92string inSolutionPath = Path.Combine(testCurrentDir, "AbsoluteLogs"); 93string fullInSolutionPath = Path.GetFullPath(inSolutionPath); 101resultPath.ShouldBe(Path.Combine(fullInSolutionPath, ".MSBuild_Logs")); 123string testCurrentDir = Path.GetDirectoryName(dummyProject.ProjectFile); 132resultPath.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), ".MSBuild_Logs"));
BackEnd\IntrinsicTask_Tests.cs (7)
2535<i1 Remove='" + projectDirectory.Path + Path.DirectorySeparatorChar + @"*.tmp'/> 3332string tempPath = Path.GetTempPath(); 3333string directoryForTest = Path.Combine(tempPath, "IncludeCheckOnMetadata_3\\Test"); 3334string fileForTest = Path.Combine(directoryForTest, "a.dll"); 3354<Content Include='" + Path.Combine(directoryForTest, "..", "**") + @"' Condition=""'%(Content.Extension)' == '.dll'""/> 3364"[" + Path.Combine(directoryForTest, "..", "Test", "a.dll") + @"]->[.dll]->[Test" 3365+ Path.DirectorySeparatorChar + "]");
BackEnd\LoggingServicesLogMethod_Tests.cs (8)
442string tempPath = Path.GetTempPath(); 443string testTempPath = Path.Combine(tempPath, "VerifyErrorPostfixForInvalidProjectFileException"); 444string projectFile = Path.Combine(testTempPath, "a.proj"); 445string targetsFile = Path.Combine(testTempPath, "x.targets"); 829message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectStartedPrefixForTopLevelProjectWithTargetNames", Path.GetFileName(projectFile), targetNames); 833message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", Path.GetFileName(projectFile)); 1401string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(success ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(projectFile)); 1491string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
BackEnd\MSBuild_Tests.cs (9)
46Directory.SetCurrentDirectory(Path.GetTempPath()); 61string fileName = Path.GetFileName(tempProject); 69int rootLength = Path.GetPathRoot(tempProject).Length; 758logger.AssertLogContains($"iout6=[a{Path.DirectorySeparatorChar}b.foo]"); 764logger.AssertLogContains($"iin6=[a{Path.DirectorySeparatorChar}b.foo]"); 2020string referencedProjectPath = Path.Combine(projectDir, "referenced.csproj"); 2034string mainProjectPath = Path.Combine(projectDir, "main.csproj"); 2093string referencedProjectPath = Path.Combine(projectDir, "referenced.csproj"); 2108string mainProjectPath = Path.Combine(projectDir, "main.csproj");
BackEnd\RequestBuilder_Tests.cs (1)
294return Path.GetTempPath() + "testProject" + configId + ".proj";
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")
BackEnd\TargetUpToDateChecker_Tests.cs (1)
601string projectFile = Path.Combine(ObjectModelHelpers.TempProjectDir, "temp.proj");
BackEnd\TaskBuilder_Tests.cs (8)
428<CreateItem Include='{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\**\*.dll'> 442string slashAndBracket = Path.DirectorySeparatorChar.ToString() + "]"; 641string fileName = Path.GetFileName(realTaskPath); 642string directoryName = Path.GetDirectoryName(realTaskPath); 646string customTaskFolder = Path.Combine(directoryName, "buildCrossTargeting"); 650<UsingTask TaskName=`RegisterObject` AssemblyFile=`" + Path.Combine(customTaskFolder, "..", fileName) + @"` /> 899string projectAPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 900string projectBPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj");
BackEnd\TaskEnvironment_Tests.cs (9)
56string tempPath = Path.GetFullPath(Path.GetTempPath()); 182string testDirectory = GetResolvedTempPath().TrimEnd(Path.DirectorySeparatorChar); 183string alternateDirectory = Path.GetDirectoryName(testDirectory)!; 224string relativePath = Path.Combine("subdir", "file.txt"); 233Path.IsPathRooted(absolutePath.Value).ShouldBeTrue(); 234string expectedPath = Path.Combine(baseDirectory, relativePath); 249string absoluteInputPath = Path.Combine(GetResolvedTempPath(), "already", "absolute", "path.txt"); 472char invalidChar = Path.GetInvalidPathChars().FirstOrDefault();
BackEnd\TaskHost_MultiThreadableTask_Tests.cs (1)
75string projectFile = Path.Combine(_testProjectsDir, "TaskEnvTest.proj");
BackEnd\TaskHostCallback_Tests.cs (6)
85string projectFile = Path.Combine(testDir, "Test.proj"); 192string projectFile = Path.Combine(testDir, "Test.proj"); 239string projectFile = Path.Combine(testDir, "Test.proj"); 293string projectFile = Path.Combine(testDir, "Test.proj"); 494string childProject = Path.Combine(testDir, "Child.proj"); 513string projectFile = Path.Combine(testDir, "Test.proj");
BackEnd\TaskHostFactory_Tests.cs (1)
29?? Path.Combine(AppContext.BaseDirectory, "Microsoft.Build.Engine.UnitTests.dll");
BackEnd\TaskRegistry_Tests.cs (4)
165Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(assemblyName, assemblyFile == null ? null : Path.GetFullPath(assemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 270Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(assemblyName, assemblyFile == null ? null : Path.GetFullPath(assemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 1040Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(expandedAssemblyName, expandedAssemblyFile == null ? null : Path.GetFullPath(expandedAssemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 1093Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(expandedAssemblyName, Path.GetFullPath(expandedAssemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!"
BackEnd\TaskRouter_IntegrationTests.cs (7)
59string projectFile = Path.Combine(_testProjectsDir, "NonEnlightenedTaskProject.proj"); 104string projectFile = Path.Combine(_testProjectsDir, "InterfaceTaskProject.proj"); 149string projectFile = Path.Combine(_testProjectsDir, "AttributeTaskProject.proj"); 194string projectFile = Path.Combine(_testProjectsDir, "NonEnlightenedTaskSingleThreaded.proj"); 238string projectFile = Path.Combine(_testProjectsDir, "InterfaceTaskSingleThreaded.proj"); 292string projectFile = Path.Combine(_testProjectsDir, "MixedTasksProject.proj"); 350string projectFile = Path.Combine(_testProjectsDir, "ExplicitTaskHostFactory.proj");
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);
BuildEventArgsSerialization_Tests.cs (1)
158projectFile: Path.Combine("a", "test.proj"),
CLR2TaskHost_E2E_Tests.cs (1)
58string projectPath = Path.Combine(testFolder.Path, "CLR2ExplicitTest.proj");
ConsoleLogger_Tests.cs (3)
380string tempProjectDir = Path.Combine(Path.GetTempPath(), "EmptyTargetsOnDetailedButNotNotmal"); 381string tempProjectPath = Path.Combine(tempProjectDir, "test.proj");
Construction\ElementLocation_Tests.cs (7)
32Path.Combine(AppContext.BaseDirectory, "Microsoft.Common.targets"); 105file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 140file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
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));
Definition\ToolsetConfigurationReaderTestHelper.cs (3)
33s_testFolderFullPath = Path.Combine(Path.GetTempPath(), "configFileTests"); 35string configFilePath = Path.Combine(s_testFolderFullPath, "test.exe.config");
Definition\ToolsVersion_Tests.cs (6)
261if (Path.GetDirectoryName(file.Path).Equals(dir, StringComparison.OrdinalIgnoreCase) 267if (Path.GetDirectoryName(file.Path).Equals(overrideDir, StringComparison.OrdinalIgnoreCase) 961Path.GetFileName(path); 963string pathWithoutTrailingSlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 974bool sameFolder = (String.Equals(Path.GetDirectoryName(candidate), 977return !sameFolder || !Regex.IsMatch(Path.GetFileName(candidate), finalPattern);
EscapingInProjects_Tests.cs (6)
636string path = Path.Combine(Path.GetTempPath(), projectRelativePath); 637string projectAbsolutePath = Path.Combine(path, projectName); 1803File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "a.weirdo"), String.Empty); 1804File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "b.weirdo"), String.Empty); 1805File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "c.weirdo"), String.Empty);
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\IntrinsicFunctionOverload_Tests.cs (3)
133string testFilePath = Path.Combine(env.DefaultTestDirectory.Path, "TestFile.txt"); 173string testDirPath = Path.Combine(env.DefaultTestDirectory.Path, "TestDir"); 214string testDirPath = Path.Combine(env.DefaultTestDirectory.Path, "TestDir");
Evaluation\ItemSpec_Tests.cs (3)
48var projectFile = Path.Combine(absoluteRootPath, "build.proj"); 49var absoluteSpec = Path.Combine(absoluteRootPath, "s.cs"); 85return new ProjectInstanceItemSpec(itemSpec, expander, location, Path.GetDirectoryName(location.File));
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"));
FixPathOnUnix_Tests.cs (2)
41ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("projectDirectory", "lib", "foo.dll"), "just a text file"); 52logger.AssertLogContains($"ItemMetadata: Md0 = {Path.Combine("lib", "foo.dll")}");
Globbing\MSBuildGlob_Tests.cs (8)
34Assert.Equal(glob.TestOnlyGlobRoot.LastOrDefault(), Path.DirectorySeparatorChar); 43var expectedRoot = Path.Combine(Directory.GetCurrentDirectory(), globRoot).WithTrailingSlash(); 120var expectedFixedDirectory = Path.Combine(globRoot, "b").WithTrailingSlash(); 171Assert.EndsWith("%42" + Path.DirectorySeparatorChar, glob.FixedDirectoryPart); 319return Path.Combine(Directory.GetCurrentDirectory(), expectedFixedDirectoryPart).Replace("/", "\\").WithTrailingSlash(); 359string normalizedPath = path.Replace(Path.DirectorySeparatorChar == '/' ? '\\' : '/', Path.DirectorySeparatorChar); 363var rootedFixedDirectoryPart = Path.Combine(FileUtilities.NormalizePath(globRoot), fixedDirectoryPart);
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);
Graph\GraphTestingUtilities.cs (2)
170return Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath); 176return Path.GetFileNameWithoutExtension(config.ProjectFullPath);
Graph\IsolateProjects_Tests.cs (4)
141_env.SetTempPath(Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid().ToString("N")), deleteTempDirectory: true); 451var directory = Path.GetDirectoryName(path); 452var file = Path.GetFileName(path); 454return Path.Combine("..", directory, file);
Graph\ProjectGraph_Tests.cs (10)
843string project1Path = Path.Combine(env.DefaultTestDirectory.Path, "Project1.csproj"); 844string project2Path = Path.Combine(env.DefaultTestDirectory.Path, "Project2.vcxproj"); 845string project3Path = Path.Combine(env.DefaultTestDirectory.Path, "Project3.vcxproj"); 846string project4Path = Path.Combine(env.DefaultTestDirectory.Path, "Project4.vcxproj"); 847string project5Path = Path.Combine(env.DefaultTestDirectory.Path, "Project5.vcxproj"); 848string project6Path = Path.Combine(env.DefaultTestDirectory.Path, "Project6.wapproj"); 849string project7Path = Path.Combine(env.DefaultTestDirectory.Path, "Project7.csproj"); 850string project8Path = Path.Combine(env.DefaultTestDirectory.Path, "Project8.csproj"); 2108var referenceNumbersSet = innerBuildWithCommonReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet(); 2114referenceNumbersSet = innerBuildWithAdditionalReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
Graph\ResultCacheBasedBuilds_Tests.cs (2)
348var rootNode = topoSortedNodes.First(n => Path.GetFileNameWithoutExtension(n.ProjectInstance.FullPath) == "1"); 508private static string ProjectNumber(ProjectGraphNode node) => Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
Instance\ProjectInstance_Internal_Tests.cs (2)
72project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t0", TaskHostParameters.Empty)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af0")); 73project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t1", TaskHostParameters.Empty)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af1a"));
InvalidProjectFileException_Tests.cs (2)
29string file = Path.GetTempPath() + Guid.NewGuid().ToString("N"); 61string file = Path.GetTempPath() + Guid.NewGuid().ToString("N");
MSBuildTaskHostTests.cs (5)
18=> field ??= Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? AppContext.BaseDirectory); 21=> field ??= Path.Combine(AssemblyLocation, "TestAssets"); 33CopyFilesRecursively(Path.Combine(TestAssetsRootPath, "Net35WinFormsApp"), testFolder.Path); 34string projectFilePath = Path.Combine(testFolder.Path, "TestNet35WinForms.csproj");
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"),
NodeStatus_Transition_Tests.cs (2)
163Get-Content {{Path.Combine(directory, received)}} {{pipeline}} 166Get-Content {{Path.Combine(directory, verified)}} {{pipeline}}
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
ProjectCache\ProjectCacheTests.cs (9)
65private static readonly string s_samplePluginPath = Path.Combine( 75() => Path.Combine( 76Path.GetFullPath(s_samplePluginPath), 624var projectName = Path.GetFileNameWithoutExtension(projectPath); 654var projectName = Path.GetFileNameWithoutExtension(projectPath); 851private static int GetProjectNumber(string projectPath) => int.Parse(Path.GetFileNameWithoutExtension(projectPath)); 882itemResult.GetMetadata("File").ShouldBe(Path.GetFileName(projectPath)); 1733string bootstrapCorePath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", Constants.DotnetProcessName); 1736string appDllPath = Path.Combine(directory.Path, $"bin/{s_currentTargetNETFramework}/app.dll");
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")))
TaskHostFactoryLifecycle_E2E_Tests.cs (4)
24private static string AssemblyLocation { get; } = Path.Combine(Path.GetDirectoryName(typeof(TaskHostFactoryLifecycle_E2E_Tests).Assembly.Location) ?? AppContext.BaseDirectory); 26private static string TestAssetsRootPath { get; } = Path.Combine(AssemblyLocation, "TestAssets", "TaskHostLifecycle"); 94string testProjectPath = Path.Combine(TestAssetsRootPath, "TaskHostLifecycleTestApp.csproj");
TaskParameter_Tests.cs (1)
488string sep = Path.DirectorySeparatorChar.ToString();
TerminalLogger_Tests.cs (4)
344var projectName = Path.GetFileNameWithoutExtension(projectFilePath); 345var outputPath = Path.ChangeExtension(projectFilePath, "dll"); 917RunnerUtilities.ExecMSBuild($"{projectFile.Path} /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success, outputHelper: _outputHelper); 921RunnerUtilities.ExecMSBuild($"{projectFile.Path} /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithoutTL.log")};verbosity=diagnostic", out success, outputHelper: _outputHelper);
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
TypeLoader_Dependencies_Tests.cs (9)
18private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "TaskWithDependency"); 28string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 34string dllPath = Path.Combine(dir.Path, TaskDllFileName); 46string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 49var newTaskDllPath = Path.Combine(tempDir, TaskDllFileName); 66var originalTaskDllPath = Path.Combine(originalDirectory, TaskDllFileName); 67var originalDependencyDllPath = Path.Combine(originalDirectory, DependencyDllFileName); 71var newTaskDllPath = Path.Combine(temporaryDirectory, TaskDllFileName); 72var newDependencyDllPath = Path.Combine(temporaryDirectory, DependencyDllFileName);
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);
WarningsAsMessagesAndErrors_Tests.cs (1)
24?? Path.Combine(AppContext.BaseDirectory, $"Microsoft.Build.Engine.UnitTests.dll");
Microsoft.Build.Framework (144)
BackEnd\CommunicationsUtilities.cs (1)
779string filePath = Path.Combine(s_debugDumpPath, fileName);
BuildEnvironmentHelper.cs (11)
202var msBuildExecutableCandidate = Path.Combine(Path.GetDirectoryName(buildAssembly), Constants.MSBuildExecutableName); 330return TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildExecutableName)) 332?? TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildAssemblyName)); 354string directory = Path.GetDirectoryName(msBuildAssembly); 411var processFileName = Path.GetFileNameWithoutExtension(processName); 573CurrentMSBuildConfigurationFile = Path.ChangeExtension(currentMSBuildExePath, configFileExtension); 622MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 626MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 633? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 691defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
DebugUtils.cs (3)
75debugDirectory = System.IO.Path.Combine(debugDirectory, ".MSBuild_Logs"); 79debugDirectory = System.IO.Path.Combine(Directory.GetCurrentDirectory(), ".MSBuild_Logs"); 83debugDirectory = System.IO.Path.Combine(FileUtilities.TempFileDirectory, ".MSBuild_Logs");
DotnetHostEnvironmentHelper.cs (1)
143return Path.GetDirectoryName(dotnetHostPath);
FileClassifier.cs (5)
127RegisterImmutableDirectory(Path.Combine(programFiles, "Reference Assemblies", "Microsoft"), false); 333return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 353return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 360fileSpec += Path.DirectorySeparatorChar;
FileSystem\WindowsFileSystem.cs (3)
130var searchDirectoryPath = Path.Combine(directoryPath, "*"); 167result.Add(Path.Combine(directoryPath, findResult.CFileName)); 175Path.Combine(directoryPath, findResult.CFileName),
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)))
FileUtilities_TempFiles.cs (7)
74path = Path.Combine(Path.GetTempPath(), $"{msbuildTempFolderPrefix}{Guid.NewGuid():N}"); 89string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 193string file = Path.Combine(directory, $"{fileName}{extension}"); 217string destFile = Path.Combine(dest, fileInfo.Name); 222string destDir = Path.Combine(dest, subdirInfo.Name); 235: System.IO.Path.Combine(TempFileDirectory, name);
IMultiThreadableTask.cs (1)
17/// <item>Use <see cref="TaskEnvironment.GetAbsolutePath(string)"/> instead of <see cref="System.IO.Path.GetFullPath(string)"/> for path resolution</item>
InterningWriteTranslator.cs (2)
28private static readonly char[] DirectorySeparatorChars = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
ItemSpecModifiers.cs (9)
86Directory = Path.Combine(rootDir, directory); 493string? root = Path.GetPathRoot(fullPath)!; 503root += Path.DirectorySeparatorChar; 521return Path.GetFileNameWithoutExtension(FileUtilities.FixFilePath(itemSpec)); 536return Path.GetExtension(itemSpec); 615if (!Path.IsPathRooted(path)) 648return Path.GetDirectoryName(path) == null; 661_ = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
MSBuildConstants.cs (3)
129internal static readonly char[] DirectorySeparatorChar = [Path.DirectorySeparatorChar]; 133internal static readonly char[] PathSeparatorChar = [Path.PathSeparator]; 138internal static readonly char[] InvalidPathChars = Path.GetInvalidPathChars();
NativeMethods.cs (4)
570string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"INTCASESENSITIVETEST{Guid.NewGuid():N}"); 606Path.GetDirectoryName(baseTypeLocation) 626dir = Path.GetDirectoryName(dir);
PathHelpers\AbsolutePath.cs (4)
112Value = Path.Combine(basePath.Value, path); 123/// Returns the canonical form of this path, equivalent to calling <see cref="System.IO.Path.GetFullPath(string)"/>. 130/// The canonical form of a path is exactly what <see cref="System.IO.Path.GetFullPath(string)"/> would produce, 144return new AbsolutePath(System.IO.Path.GetFullPath(Value), OriginalValue, ignoreRootedCheck: true);
ProjectFinishedEventArgs.cs (1)
114RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(ProjectFile));
ProjectStartedEventArgs.cs (1)
542string? projectFilePath = Path.GetFileName(ProjectFile);
TargetFinishedEventArgs.cs (1)
181RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
Telemetry\BuildTelemetry.cs (1)
201AddIfNotNull(ProjectPath != null ? Path.GetFileName(ProjectPath) : null, nameof(ProjectPath));
Utilities\AssemblyLoadInfo.cs (1)
197FrameworkErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
Utilities\FileMatcher.cs (10)
33private static readonly string s_directorySeparatorString = Path.DirectorySeparatorChar.ToString(); 305Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) && 509longPath = Path.Combine(longPath, parts[i]); 536longParts[i - startingElement] = Path.GetFileName(longPath); 702return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 1668return IsMatch(Path.GetFileName(path), pattern); 1983Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 2007var filespecUnescapedFullyQualified = Path.Combine(projectDirectoryUnescaped, filespecUnescaped); 2098fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart);
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());
Utilities\TaskFactoryUtilities.cs (4)
142string? directory = Path.GetDirectoryName(assemblyPath); 257path = Path.Combine(directory, assemblyName.CultureName, assemblyName.Name + ".dll"); 265path = Path.Combine(directory, assemblyName.Name + ".dll"); 299return Path.Combine(projectDirectory, path);
Utilities\TypeExtensions.cs (1)
12=> Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(type.Assembly));
Microsoft.Build.Framework.UnitTests (127)
AbsolutePath_Tests.cs (17)
17string baseDirectory = Path.Combine(Path.GetTempPath(), "abspath_test_base"); 40string absolutePathString = Path.GetTempPath(); 44Path.IsPathRooted(absolutePath.Value).ShouldBeTrue(); 92string baseDirectory = Path.Combine(Path.GetTempPath(), "testfolder"); 96Path.IsPathRooted(absolutePath.Value).ShouldBeTrue(); 98string expectedPath = Path.Combine(baseDirectory, relativePath); 105string testPath = Path.GetTempPath(); 108var differentPath = new AbsolutePath(Path.Combine(testPath, "different")); 119string testPath = Path.GetTempPath(); 121var differentPath = new AbsolutePath(Path.Combine(testPath, "different")); 132string testPath = Path.GetTempPath(); 144string testPath = Path.GetTempPath(); 275var systemResult = Path.GetFullPath(inputPath); 290string invalidPath = Path.GetTempPath() + "foo\0bar"; 294Exception? getFullPathException = Record.Exception(() => Path.GetFullPath(invalidPath));
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);
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
Microsoft.Build.Tasks.CodeAnalysis (33)
src\Compilers\Core\MSBuildTask\Csc.cs (2)
211var rspFile = Path.Combine(Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!, "csc.rsp");
src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (3)
531string? tempDirectory = Path.GetTempPath(); 545var clientDirectory = Path.GetDirectoryName(PathToBuiltInTool); 853OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(Sources[0].ItemSpec));
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (5)
65internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); 76_useAppHost = useAppHost = File.Exists(Path.Combine(GetToolDirectory(), AppHostToolName)); 164return Path.Combine(ToolPath ?? "", ToolExe); 231return Path.Combine(buildTaskDirectory, "bincore"); 242var buildTaskDirectory = Path.GetDirectoryName(buildTask.Location);
src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (3)
82=> EndsWithDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 92return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
src\Compilers\Core\MSBuildTask\Utilities.cs (3)
26=> string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 117path = Path.GetFullPath(path); 127combined = Path.Combine(path1, path2);
src\Compilers\Core\MSBuildTask\Vbc.cs (3)
304string actualPdb = Path.ChangeExtension(outputAssembly, ".pdb"); // This is the pdb that the compiler generated 395var rspFile = Path.Combine(Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!, "vbc.rsp");
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\BuildServerConnection.cs (7)
443var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 449commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 686clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 774var tempPath = Path.GetTempPath(); 775var result = Path.Combine(tempPath, ".roslyn"); 783FilePath = Path.Combine(mutexDirectory, name); 784GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
62var directoryName = Path.GetDirectoryName(dotNetPath); 97var filePath = Path.Combine(item, fileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (33)
src\Compilers\Core\MSBuildTask\Csc.cs (2)
211var rspFile = Path.Combine(Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!, "csc.rsp");
src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (3)
531string? tempDirectory = Path.GetTempPath(); 545var clientDirectory = Path.GetDirectoryName(PathToBuiltInTool); 853OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(Sources[0].ItemSpec));
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (5)
65internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); 76_useAppHost = useAppHost = File.Exists(Path.Combine(GetToolDirectory(), AppHostToolName)); 164return Path.Combine(ToolPath ?? "", ToolExe); 234? Path.Combine(buildTaskDirectory, "..", "bincore") 242var buildTaskDirectory = Path.GetDirectoryName(buildTask.Location);
src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (3)
82=> EndsWithDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 92return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
src\Compilers\Core\MSBuildTask\Utilities.cs (3)
26=> string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 117path = Path.GetFullPath(path); 127combined = Path.Combine(path1, path2);
src\Compilers\Core\MSBuildTask\Vbc.cs (3)
304string actualPdb = Path.ChangeExtension(outputAssembly, ".pdb"); // This is the pdb that the compiler generated 395var rspFile = Path.Combine(Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!, "vbc.rsp");
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\BuildServerConnection.cs (7)
443var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 449commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 686clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 774var tempPath = Path.GetTempPath(); 775var result = Path.Combine(tempPath, ".roslyn"); 783FilePath = Path.Combine(mutexDirectory, name); 784GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
62var directoryName = Path.GetDirectoryName(dotNetPath); 97var filePath = Path.Combine(item, fileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests (10)
CscTests.cs (2)
15private static string RspFilePath => Path.Combine(Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location), "csc.rsp");
SdkManagedToolTests.cs (3)
23var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; 28Path.Combine(taskPath, "..", "bincore", "csc.dll"), 29Path.Combine(taskPath, "..", "bincore", "csc.exe"),
src\Compilers\Core\MSBuildTaskTests\TestUtilities\IntegrationTestBase.cs (3)
45_msbuildExecutable = s_msbuildDirectory == null ? null : Path.Combine(s_msbuildDirectory, "MSBuild.exe"); 158var originalAppHost = Path.Combine(ManagedToolTask.GetToolDirectory(), $"csc{PlatformInformation.ExeExtension}"); 237var originalAppHost = Path.Combine(ManagedToolTask.GetToolDirectory(), $"vbc{PlatformInformation.ExeExtension}");
VbcTests.cs (2)
15private static string RspFilePath => Path.Combine(Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location), "vbc.rsp");
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (106)
CopyRefAssemblyTests.cs (2)
35SourcePath = Path.Combine(dir.Path, "does_not_exist.dll") 66var dest = Path.Combine(dir.Path, "dest.dll");
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"),
GenerateMSBuildEditorConfigTests.cs (3)
246string executingLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)?.Replace('\\', '/') ?? string.Empty; 280string executingLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)?.Replace('\\', '/') ?? string.Empty; 362var fileName = Path.Combine(TempRoot.Root, "ConfigFileCanBeWrittenToDisk.GenerateMSBuildEditorConfig.editorconfig");
IntegrationTests.cs (3)
18return new DisposableFile(Path.Combine(directory.Path, resultFileName)); 23return ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path)); 520{ { "MyMSBuildToolsPath", Path.GetDirectoryName(typeof(IntegrationTests).Assembly.Location)! } });
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");
MSBuildManagedToolTests.cs (3)
16var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; 18? Path.Combine("bincore", $"csc{PlatformInformation.ExeExtension}") 21Assert.Equal(Path.Combine(taskPath, relativePath), task.PathToBuiltInTool);
RuntimeHostInfoTests.cs (1)
81var symlinkPath = Path.Combine(binDir.Path, $"dotnet{PlatformInformation.ExeExtension}");
SdkIntegrationTests.cs (5)
46var dir = Path.GetDirectoryName(p)!; 47var targets = Path.Combine(dir, "Microsoft.CSharp.Core.targets"); 61var workingDirectory = Path.GetDirectoryName(projectFilePath)!; 84return Path.Combine(workingDirectory, "msbuild.binlog"); 123Assert.True(compilations[0].SyntaxTrees.Any(x => Path.GetFileName(x.FilePath) == "hello.cs"));
TargetTests.cs (3)
798var intermediatePath = intermediatePathDir + Path.DirectorySeparatorChar.ToString(); 903var path = Path.Combine(Path.GetDirectoryName(assembly.Location)!, "Microsoft.Managed.Core.targets");
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);
TestUtilities\IntegrationTestBase.cs (3)
45_msbuildExecutable = s_msbuildDirectory == null ? null : Path.Combine(s_msbuildDirectory, "MSBuild.exe"); 158var originalAppHost = Path.Combine(ManagedToolTask.GetToolDirectory(), $"csc{PlatformInformation.ExeExtension}"); 237var originalAppHost = Path.Combine(ManagedToolTask.GetToolDirectory(), $"vbc{PlatformInformation.ExeExtension}");
VbcTests.cs (1)
473Assert.Equal(@$"/optionstrict:custom /out:test.exe /analyzerconfig:.editorconfig /analyzerconfig:subdir\.editorconfig test.vb subdir{Path.DirectorySeparatorChar}test.vb", vbc.GenerateResponseFileContents());
Microsoft.Build.Tasks.Core (323)
AddToWin32Manifest.cs (2)
151SaveManifest(document, Path.GetFileName(ApplicationManifest?.ItemSpec) ?? DefaultManifestName); 183string originalPath = Path.Combine(OutputDirectory, manifestName);
AssemblyDependency\AssemblyInformation.cs (2)
96var newLocation = Path.Combine(Path.GetDirectoryName(location), nameParts[0].Trim() + ".dll");
AssemblyDependency\Node\RarNodeExecuteRequest.cs (2)
30rar.AppConfigFile = Path.GetFullPath(rar.AppConfigFile); 35rar.StateFile = Path.GetFullPath(rar.StateFile);
AssemblyDependency\Reference.cs (5)
445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference."); 538_directoryName = Path.GetDirectoryName(_fullPath); 558_fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_fullPath); 573_fullPathWithoutExtension = Path.Combine(DirectoryName, FileNameWithoutExtension);
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));
AssemblyDependency\ResolveAssemblyReference.cs (1)
2892string fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName);
AssemblyDependency\Resolver.cs (5)
162string candidateBaseName = Path.GetFileNameWithoutExtension(pathToCandidateAssembly); 326fullPath = Path.Combine(directory, baseName); 373string weakNameBaseExtension = Path.GetExtension(weakNameBase); 374string weakNameBaseFileName = Path.GetFileNameWithoutExtension(weakNameBase); 382string fullPath = Path.Combine(directory, weakNameBase);
AssignTargetPath.cs (6)
86Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FileUtilities.EnsureTrailingSlash(RootFolder))); 115!Path.IsPathRooted(Files[i].ItemSpec) && 117!Files[i].ItemSpec.Contains("." + Path.DirectorySeparatorChar) && 142targetPath = Path.GetFileName(Files[i].ItemSpec); 149Path.GetFullPath(TaskEnvironment.GetAbsolutePath(Files[i].ItemSpec)); 160targetPath = Path.GetFileName(Files[i].ItemSpec);
AxReference.cs (1)
92axImp.OutputAssembly = Path.Combine(OutputDirectory, GetWrapperFileName());
AxTlbBaseReference.cs (1)
193return Path.Combine(OutputDirectory, GetWrapperFileName());
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(
BootstrapperUtil\ResourceUpdater.cs (1)
38string filePath = Path.Combine(Directory.GetCurrentDirectory(), filename);
BootstrapperUtil\Util.cs (1)
200string msbuildExtensionPackagesPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildExtensionsPath, BOOTSTRAPPER_MSBUILD_ADDITIONAL_PACKAGES_PATH);
CodeTaskFactory.cs (3)
787string projectDirectory = !string.IsNullOrEmpty(projectFilePath) ? Path.GetDirectoryName(projectFilePath) : null; 881Directory.CreateDirectory(Path.GetTempPath()); 895outputPath = Path.Combine(tempDirectory, fileName);
CombinePath.cs (1)
71combinedPath.ItemSpec = Path.Combine(BasePath, path.ItemSpec);
ConvertToAbsolutePath.cs (1)
57if (!Path.IsPathRooted(path.ItemSpec))
Copy.cs (7)
284string destinationFolder = Path.GetDirectoryName(destinationFileState.Path); 285string originalDestinationFolder = Path.GetDirectoryName(destinationFileState.Path.OriginalValue); 829() => Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)), 857string srcName = Path.GetFileName(src); 868() => Path.Combine(src, file), 878() => Path.Combine(DestinationFolder.ItemSpec, srcName, file),
CreateCSharpManifestResourceName.cs (10)
165string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 166string directoryName = Path.GetDirectoryName(info.cultureNeutralFilename); 183manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 186manifestName.Replace(Path.DirectorySeparatorChar, '.'); 187manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 208manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 211manifestName.Replace(Path.DirectorySeparatorChar, '.'); 212manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 219manifestName.Insert(0, Path.DirectorySeparatorChar); 236string extension = Path.GetExtension(fileName);
CreateManifestResourceName.cs (8)
162string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 174isResxFile = Path.GetExtension(fileName) == resxFileExtension; 181string conventionDependentUpon = Path.ChangeExtension(Path.GetFileName(fileName), SourceFileExtension); 196AbsolutePath dependentPath = TaskEnvironment.GetAbsolutePath(Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon)); 221AbsolutePath pathToDependent = TaskEnvironment.GetAbsolutePath(Path.Combine(Path.GetDirectoryName(fileName), dependentUpon));
CreateVisualBasicManifestResourceName.cs (5)
170string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 178manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 194manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 201manifestName.Insert(0, Path.DirectorySeparatorChar); 218string extension = Path.GetExtension(fileName);
Culture.cs (8)
40if (treatAsCultureNeutral || string.Equals(Path.GetFileNameWithoutExtension(parentName), 41Path.GetFileNameWithoutExtension(name), 55string baseFileNameWithCulture = Path.GetFileNameWithoutExtension(name); 58string cultureName = Path.GetExtension(baseFileNameWithCulture); 75string extension = Path.GetExtension(name); 76string baseFileName = Path.GetFileNameWithoutExtension(baseFileNameWithCulture); 77string baseFolder = Path.GetDirectoryName(name); 79info.cultureNeutralFilename = Path.Combine(baseFolder, fileName);
DebugUtils.cs (5)
74var extension = Path.GetExtension(fileName); 75var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 77var fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 83fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 138s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
DownloadFile.cs (2)
185var destinationFile = new FileInfo(Path.Combine(destinationDirectory.FullName, filename)); 331: Path.GetFileName(requestUri.LocalPath); // Otherwise attempt to get a file name from the URI
ErrorUtilities.cs (1)
176if (!Path.IsPathRooted(value))
FileIO\WriteLinesToFile.cs (4)
123string directoryPath = Path.GetDirectoryName(filePath); 213string directoryPath = Path.GetDirectoryName(filePath); 216temporaryFilePath = Path.Combine(directoryPath, Path.GetRandomFileName() + "~");
FindAppConfigFile.cs (1)
125string filename = (matchWholeItemSpec ? item.ItemSpec : Path.GetFileName(item.ItemSpec));
FindInList.cs (1)
109string filename = (MatchFileNameOnly ? Path.GetFileName(path) : path);
GenerateApplicationManifest.cs (2)
239name = Path.GetFileName(item.ItemSpec); 400manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateDeploymentManifest.cs (1)
139manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateLauncher.cs (4)
55LauncherPath = Path.Combine( 68string entryPointFileName = Path.GetFileName(EntryPoint.ItemSpec); 102OutputEntryPoint = new TaskItem(Path.Combine(Path.GetDirectoryName(EntryPoint.ItemSpec), results.KeyFile));
GenerateManifestBase.cs (5)
186name = Path.GetFileNameWithoutExtension(entryPointIdentity.Name) + ".application"; 546file.TargetPath = Path.IsPathRooted(file.SourcePath) || file.SourcePath.StartsWith("..", StringComparison.Ordinal) ? Path.GetFileName(file.SourcePath) : file.SourcePath; 597string manifestFileName = Path.GetFileName(OutputManifest.ItemSpec); 634Util.WriteLog($"Total time to generate manifest '{Path.GetFileName(OutputManifest.ItemSpec)}': t={Environment.TickCount - _startTime}");
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");
LC.cs (1)
170outputPath = Path.Combine(OutputDirectory, outputPath);
ListOperators\FindUnderPath.cs (2)
77System.IO.Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FileUtilities.FixFilePath(Path.ItemSpec)))); 110System.IO.Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FileUtilities.FixFilePath(item.ItemSpec))));
ManifestUtil\ApplicationManifest.cs (7)
432string outputFileName = Path.GetFileName(SourcePath); 630Path.GetFileNameWithoutExtension(assembly.TargetPath), 633OutputMessages.AddErrorMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath)); 738OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 749OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 759OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 766OutputMessages.AddWarningMessage("GenerateManifest.UnmanagedCodePermission", Path.GetFileNameWithoutExtension(path));
ManifestUtil\AssemblyIdentity.cs (2)
534string path = Path.Combine(searchPath, file); 541path = Path.Combine(searchPath, file);
ManifestUtil\AssemblyReferenceCollection.cs (1)
134String.Equals(identity.Name, System.IO.Path.GetFileNameWithoutExtension(a.SourcePath), StringComparison.OrdinalIgnoreCase))
ManifestUtil\BaseReference.cs (2)
54if (!Path.IsPathRooted(path)) 59return Path.GetFileName(path);
ManifestUtil\DeployManifest.cs (4)
181string redistListPath = Path.Combine(referenceAssemblyPath, _redistListFolder); 182return Path.Combine(redistListPath, _redistListFile); 581manifestPath = Path.Combine(Path.GetDirectoryName(SourcePath), _entryPoint.TargetPath);
ManifestUtil\LauncherBuilder.cs (3)
37string launcherFilename = Path.GetFileName(LauncherPath); 56string strOutputExe = System.IO.Path.Combine(outputPath, launcherFilename); 91EnsureFolderExists(Path.GetDirectoryName(strOutputExe));
ManifestUtil\Manifest.cs (14)
220defaultDir = Path.GetDirectoryName(_sourcePath); 223if (!Path.IsPathRooted(defaultDir)) 225defaultDir = Path.Combine(Directory.GetCurrentDirectory(), defaultDir); 317if (Path.IsPathRooted(path)) 334string resolvedPath = Path.Combine(searchPath, path); 335resolvedPath = Path.GetFullPath(resolvedPath); 517string fileName = Path.GetFileName(f.ResolvedPath); 523f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), f.TargetPath); 527f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), AssemblyName); 545f.TargetPath = BaseReference.GetDefaultTargetPath(Path.GetFileName(f.ResolvedPath)); 655Path.GetFileNameWithoutExtension(assembly.TargetPath), 658OutputMessages.AddWarningMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath));
ManifestUtil\ManifestReader.cs (2)
27string manifestFileName = Path.GetFileName(path); 97Util.WriteLogFile(Path.GetFileNameWithoutExtension(path) + ".embedded.xml", m);
ManifestUtil\ManifestWriter.cs (1)
133File.Copy(temp, Path.Combine(Util.logPath, n + ".trust-file.xml"), true);
ManifestUtil\PathUtil.cs (10)
23path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 24path = path.TrimEnd(Path.DirectorySeparatorChar); 38path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 39path = path.TrimEnd(Path.DirectorySeparatorChar); 81if (String.Equals(Path.GetExtension(path), ".application", StringComparison.Ordinal)) 86if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 156if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 239return Path.GetFullPath(path); // make sure it's a full path
ManifestUtil\SecurityUtil.cs (5)
190string path = Path.Combine(paths[0], PermissionSetsFolder); 205string fileInfoNoExt = Path.GetFileNameWithoutExtension(files[i]); 861toolPath = Path.Combine(pathToDotNetFrameworkSdk, "bin", ToolName); 870toolPath = Path.Combine(Directory.GetCurrentDirectory(), ToolName); 935return versionIndependentToolPath != null ? Path.Combine(versionIndependentToolPath, toolName) : null;
ManifestUtil\Util.cs (5)
111return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 267string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\VisualStudio\8.0\VSPLOG"); 476s_logFileWriter = new StreamWriter(Path.Combine(logPath, "Microsoft.Build.Tasks.log"), false); 507string path = Path.Combine(logPath, filename); 537string path = Path.Combine(logPath, filename);
ManifestUtil\XmlUtil.cs (1)
154if (!uri.LocalPath.StartsWith(Path.GetTempPath(), StringComparison.Ordinal))
Move.cs (3)
136destinationFile = Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)); 243string destinationFolder = Path.GetDirectoryName(destinationFile);
MSBuild.cs (2)
513projectDirectory[i] = Path.GetDirectoryName(projectPath); 642outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
NativeMethods.cs (5)
1216private static readonly string s_gacPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, "gac"); 1360var assemblyName = Path.GetFileName(dir); 1365var versionString = Path.GetFileName(version); 1430var path = Path.Combine(s_gacPath, assemblyNameVersion.Name); 1436path = Path.Combine(
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
RedistList.cs (3)
306string redistDirectory = Path.Combine(frameworkDirectory, RedistListFolder); 1084string subsetDirectory = Path.Combine(frameworkDirectory, subsetListFolder); 1091string subsetFilePath = Path.Combine(subsetDirectory, subsetName + ".xml");
RegisterAssembly.cs (1)
105tlbPath = Path.ChangeExtension(Assemblies[i].ItemSpec, ".tlb");
ResGen.cs (4)
286StronglyTypedClassName = Path.GetFileNameWithoutExtension(outputFile.ItemSpec); 484outputFiles[i] = new TaskItem(Path.ChangeExtension(inputFileAsITaskItem2.EvaluatedIncludeEscaped, ".resources")); 488outputFiles[i] = new TaskItem(Path.ChangeExtension(EscapingUtilities.Escape(inputFiles[i].ItemSpec), ".resources")); 508pathToTool = Path.Combine(ToolPath, ToolExe);
ResGenDependencies.cs (1)
293resxReader.BasePath = baseLinkedFileDirectory ?? Path.GetDirectoryName(filename);
ResolveCodeAnalysisRuleSet.cs (5)
80if (CodeAnalysisRuleSet == Path.GetFileName(CodeAnalysisRuleSet)) 86string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet); 98string fullName = Path.Combine(directory, CodeAnalysisRuleSet); 106else if (!Path.IsPathRooted(CodeAnalysisRuleSet)) 111string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet);
ResolveComReference.cs (5)
514_tlbimpPath = Path.GetDirectoryName(_tlbimpPath); 556_aximpPath = Path.GetDirectoryName(_aximpPath); 740if (!Path.IsPathRooted(refPath)) 742refPath = Path.Combine(Directory.GetCurrentDirectory(), refPath); 1168if (String.Equals(Path.GetFileName(ResolvedAssemblyReferences[i].ItemSpec), assemblyName, StringComparison.OrdinalIgnoreCase))
ResolveKeySource.cs (1)
100keyFileExtension = Path.GetExtension(KeyFile);
ResolveManifestFiles.cs (7)
304targetPath = Path.GetFileName(item.ItemSpec); 382targetPath = Path.GetFileName(item.ItemSpec); 390targetPath = Path.Combine(itemCulture.ToString(), targetPath); 600string fileExtension = Path.GetExtension(entry.item.ItemSpec); 878fusionName = Path.Combine(destSubDir, Path.GetFileNameWithoutExtension(item.ItemSpec)); 882fusionName = Path.GetFileNameWithoutExtension(item.ItemSpec);
ResolveNativeReference.cs (1)
296itemLooseEtcFile.SetMetadata(ItemMetadataNames.parentFile, Path.GetFileName(path));
ResolveSDKReference.cs (1)
1015_sdkManifestPath = Path.Combine(ResolvedPath, "SDKManifest.xml");
ResourceHandling\MSBuildResXReader.cs (1)
237fileName = Path.Combine(
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (6)
92private static readonly Lazy<string> ThisAssemblyDirectoryLazy = new Lazy<string>(() => Path.GetDirectoryName(typeof(RoslynCodeTaskFactory).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName)); 473string projectDirectory = !string.IsNullOrEmpty(projectFilePath) ? Path.GetDirectoryName(projectFilePath) : null; 585string fullPath = Path.GetFullPath(reference); 597Path.Combine(ThisAssemblyDirectoryLazy.Value, ReferenceAssemblyDirectoryName), 600.FirstOrDefault(p => FileSystems.Default.FileExists(Path.Combine(p, assemblyFileName))); 604resolvedAssemblyReferences.Add(Path.Combine(resolvedDir, assemblyFileName));
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (2)
37() => Path.Combine(pathToBuildTools, "Roslyn", ToolName), 124if (!String.IsNullOrWhiteSpace(ToolExe) && Path.IsPathRooted(ToolExe))
SdkToolsPathUtility.cs (5)
63ProcessorArchitecture.ARM => Path.Combine(sdkToolsPath, "arm"), 64ProcessorArchitecture.AMD64 => Path.Combine(sdkToolsPath, "x64"), 65ProcessorArchitecture.IA64 => Path.Combine(sdkToolsPath, "ia64"), 68pathToTool = Path.Combine(processorSpecificToolDirectory, toolName); 75pathToTool = Path.Combine(sdkToolsPath, toolName);
SGen.cs (3)
248prunedAssemblyName = Path.GetFileNameWithoutExtension(BuildAssemblyName); 260private AbsolutePath SerializationAssemblyPath => new AbsolutePath(Path.Combine(BuildAssemblyPath, SerializationAssemblyName)); 262private AbsolutePath AssemblyFullPath => new AbsolutePath(Path.Combine(BuildAssemblyPath, BuildAssemblyName));
SystemState.cs (7)
459string filename = Path.GetFileName(path); 461foreach (AssemblyEntry a in redistList.FindAssemblyNameFromSimpleName(Path.GetFileNameWithoutExtension(path))) 463string pathFromRedistList = Path.Combine(a.FrameworkDirectory, filename); 583string fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(stateFile.ToString()), relativePath)); 607instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
TlbReference.cs (1)
179var fullPathToOutput = Path.GetFullPath(wrapperPath); // Current directory is the directory of the project file.
UnregisterAssembly.cs (1)
95cacheFile.AddEntry(Assemblies[i].ItemSpec, Path.ChangeExtension(Assemblies[i].ItemSpec, ".tlb"));
Unzip.cs (2)
189AbsolutePath fullDestinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destinationDirectory.FullName, zipArchiveEntry.FullName)).GetCanonicalForm(); 196if (Path.GetFileName(destinationPath.FullName).Length == 0)
WinMDExp.cs (1)
217OutputWindowsMetadataFile = Path.ChangeExtension(WinMDModule, ".winmd");
WriteCodeFragment.cs (5)
113if (OutputFile != null && OutputDirectory != null && !Path.IsPathRooted(OutputFile.ItemSpec)) 115OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, OutputFile.ItemSpec)); 126OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, Path.GetFileName(outputFilePath.Value))); 129FileUtilities.EnsureDirectoryExists(Path.GetDirectoryName(outputFilePath));
XamlTaskFactory\TaskParser.cs (2)
128isRootedPath = Path.IsPathRooted(contentOrFile); 131maybeFullPath = Path.GetFullPath(contentOrFile);
XamlTaskFactory\XamlTaskFactory.cs (3)
146Path.Combine(pathToMSBuildBinaries, "Microsoft.Build.Framework.dll"), 147Path.Combine(pathToMSBuildBinaries, "Microsoft.Build.Utilities.Core.dll"), 148Path.Combine(pathToMSBuildBinaries, "Microsoft.Build.Tasks.Core.dll")
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\Node\OutOfProcRarNode_Tests.cs (3)
38SearchPaths = [Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)], 77SearchPaths = [Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)], 103SearchPaths = [Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)],
AssemblyDependency\Node\RarNodeExecuteRequest_Tests.cs (2)
76Assert.Equal(Path.GetFullPath(AppConfigFileName), nodeRar.AppConfigFile); 77Assert.Equal(Path.GetFullPath(StateFileName), nodeRar.StateFile);
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (2)
28var tempPath = Path.GetTempPath(); 29_rarCacheFile = Path.Combine(tempPath, Guid.NewGuid() + ".UnitTest.RarCache");
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")
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
65string projectImportsZipPath = Path.ChangeExtension(binlog.Path, ".ProjectImports.zip"); 117string projectImportsZipPath = Path.ChangeExtension(binlog.Path, ".ProjectImports.zip");
CombinePath_Tests.cs (9)
26t.BasePath = Path.Combine("abc", "def"); 28string fullPath1 = Path.Combine(t.BasePath, path1); 29string path2 = Path.Combine("jkl", "mno.txt"); 30string fullPath2 = Path.Combine(t.BasePath, path2); 46t.BasePath = Path.Combine("abc", "def"); 77string path1 = Path.DirectorySeparatorChar + Path.Combine("ghi", "jkl.txt"); 78string path2 = Path.Combine("mno", "qrs.txt"); 79string fullPath2 = Path.Combine(t.BasePath, path2);
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");
CreateCSharpManifestResourceName_Tests.cs (7)
423env.SetCurrentDirectory(Path.GetDirectoryName(resourceFile.Path)); 491ITaskItem i = new TaskItem(Path.GetFileName(resXFile.Path)); 497env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 556ITaskItem i = new TaskItem(Path.GetFileName(resXFile.Path)); 562env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 598env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 778if (String.Equals(Path.GetFileName(path.Value), "SR1.strings", StringComparison.OrdinalIgnoreCase))
CreateItem_Tests.cs (5)
172ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 177ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Foo.txt")); 178ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Subdir", "Bar.txt")); 202ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 213result.ResultsByTarget["Repro"].Items[0].GetMetadata("RecursiveDir").ShouldBe("Subdir" + Path.DirectorySeparatorChar);
DirectoryBuildProjectImportTestBase.cs (2)
25private readonly string _projectRelativePath = Path.Combine("src", "foo", "foo.csproj"); 177Assert.Equal(Path.Combine(ObjectModelHelpers.TempProjectDir, DirectoryBuildProjectFile), project.GetPropertyValue(DirectoryBuildProjectPathPropertyName));
DownloadFile_Tests.cs (3)
79FileInfo file = new FileInfo(Path.Combine(folder.Path, "foo.txt")); 125FileInfo file = new FileInfo(Path.Combine(folder.Path, filename)); 160FileInfo file = new FileInfo(Path.Combine(folder.Path, filename));
Exec_Tests.cs (13)
62string tempPath = Path.GetTempPath(); 120string tempPath = Path.GetTempPath(); 345string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 382string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 420string newTmp = Path.Combine(FileUtilities.TempFileDirectory, directoryWithAmpersand); 457string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 589string folder = Path.Combine(Path.GetTempPath(), includeNonAnsiInCommand ? nonAnsiCharacters : ansiCharacters); 590string command = Path.Combine(folder, "test.cmd"); 1016string tempPath = Path.GetTempPath();
FileStateTests.cs (12)
101var state = new FileState(TestPath(Path.GetTempPath())); 339Assert.Equal(new FileInfo(Path.GetTempPath()).Exists, new FileState(TestPath(Path.GetTempPath())).FileExists); 340Assert.True(new FileState(TestPath(Path.GetTempPath())).IsDirectory); 346Assert.Equal(new FileInfo(Path.GetTempPath()).IsReadOnly, new FileState(TestPath(Path.GetTempPath())).IsReadOnly); 352Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTime, new FileState(TestPath(Path.GetTempPath())).LastWriteTime); 358Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTimeUtc, new FileState(TestPath(Path.GetTempPath())).LastWriteTimeUtcFast); 364Helpers.VerifyAssertThrowsSameWay(delegate () { var x = new FileInfo(Path.GetTempPath()).Length; }, delegate () { var x = new FileState(TestPath(Path.GetTempPath())).Length; });
FormatUrl_Tests.cs (1)
76t.OutputUrl.ShouldBe(new Uri(Path.Combine(Environment.CurrentDirectory, t.InputUrl)).AbsoluteUri);
GenerateBindingRedirects_Tests.cs (1)
267TransientTestFolder testFolder = env.CreateFolder(Path.Combine(rootTestFolder.Path, "\uD873\uDD02\u9FA8\u82D8\u722B\u9EA4\u03C5\u33D1\uE038\u486B\u0033"));
GetAssemblyIdentity_Tests.cs (1)
141File.Copy(sourceAssembly, Path.Combine(projectDir.Path, relativeFileName));
GetFileHash_Tests.cs (1)
58Files = new[] { new TaskItem(Path.Combine(AppContext.BaseDirectory, "this_does_not_exist.txt")) },
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))
MakeDir_Tests.cs (12)
24string temp = Path.GetTempPath(); 25string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A391"); 66string temp = Path.GetTempPath(); 67string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38e"); 68string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38f"); 70string dir2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A390"); 130string temp = Path.GetTempPath(); 131string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38C"); 177string temp = Path.GetTempPath(); 178string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38C"); 238string temp = Path.GetTempPath(); 239string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38d");
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"));
MSBuildInternalMessage_Tests.cs (1)
156var targetPathParameter = expectedResourceName == "CommonSdk.DeploymentUnpublishable" ? "" : Path.Combine(project.DirectoryPath, "bin", "test.txt");
NativeMethodsShared_Tests.cs (2)
121string nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz"); 128nonexistentDirectory = $"{Path.Combine(currentDirectory, "foo", "bar", "baz")}{Guid.NewGuid()}";
NuGetPropsImportTests.cs (4)
39var projectRelativePath = Path.Combine("src", "foo1", "foo1.csproj"); 65var projectRelativePath = Path.Combine("src", "foo1", "foo1.csproj"); 66var nugetPropsRelativePath = Path.Combine(Path.GetDirectoryName(projectRelativePath), NuGetPropsProjectFile);
OutputPathTests.cs (5)
23private readonly string _projectRelativePath = Path.Combine("src", "test", "test.csproj"); 80var baseOutputPath = Path.Combine("build", "bin"); 118var baseOutputPath = Path.Combine("build", "bin"); 119var outputPath = Path.Combine("bin", "Debug"); 120var outputPathAlt = Path.Combine("bin", "Release");
PortableTasks_Tests.cs (5)
20private static readonly string PortableTaskFolderPath = Path.GetFullPath( 21Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, 50var projFile = Path.Combine(folder, ProjectFileName); 58File.Copy(file.FullName, Path.Combine(folder, file.Name)); 59_outputHelper.WriteLine($"Copied {file.FullName} to {Path.Combine(folder, file.Name)}");
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
ProjectExtensionsImportTestBase.cs (5)
18protected readonly string _projectRelativePath = Path.Combine("src", "foo", "foo.csproj"); 151string projectExtensionsDirectory = Path.Combine(ObjectModelHelpers.TempProjectDir, Path.GetDirectoryName(ImportProjectPath)); 156project.GetPropertyValue("MSBuildProjectExtensionsPath").ShouldBe($@"{projectExtensionsDirectory}{Path.DirectorySeparatorChar}"); 174<MSBuildProjectExtensionsPath>{Path.GetDirectoryName(CustomImportProjectPath)}</MSBuildProjectExtensionsPath>
ProjectExtensionsPropsImportTest.cs (5)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props"); 17protected override string ImportProjectPath => Path.Combine(Path.GetDirectoryName(_projectRelativePath), "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props");
ProjectExtensionsTargetsImportTest.cs (5)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets"); 17protected override string ImportProjectPath => Path.Combine(Path.GetDirectoryName(_projectRelativePath), "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets");
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") } },
RegressionTests.cs (1)
56var expectedCompileItems = "a.cs;" + Path.Combine("obj", "Debug", ".NETFramework,Version=v4.8.AssemblyAttributes.cs");
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));
ResolveCodeAnalysisRuleSet_Tests.cs (20)
79string codeAnalysisRuleSet = Path.Combine(Path.GetTempPath(), @"CodeAnalysis.ruleset"); 123string projectDirectory = Path.GetTempPath(); 129string ruleSetFullPath = Path.Combine(projectDirectory, codeAnalysisRuleSet); 151string projectDirectory = Path.GetTempPath(); 152string codeAnalysisRuleSet = Path.GetRandomFileName() + ".ruleset"; 174var directory = Path.GetTempPath(); 180string ruleSetFullPath = Path.Combine(directory, codeAnalysisRuleSet); 202string directory = Path.GetTempPath(); 204task.CodeAnalysisRuleSet = Path.GetRandomFileName() + ".ruleset"; 225string subdirectoryName = Path.GetRandomFileName(); 226string projectDirectory = Path.GetTempPath(); 228task.CodeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset"); 249string subdirectoryName = Path.GetRandomFileName(); 250string codeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset"); 251string projectDirectory = Path.GetTempPath(); 257string ruleSetFullPath = Path.Combine(projectDirectory, codeAnalysisRuleSet); 259using (new TemporaryDirectory(Path.GetDirectoryName(ruleSetFullPath))) 280string subdirectoryName = Path.GetRandomFileName(); 281task.CodeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset");
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());
ResourceHandling\MSBuildResXReader_Tests.cs (3)
138File.Exists(Path.Combine("ResourceHandling", "TextFile1.txt")).ShouldBeTrue("Test deployment is missing None files"); 178Path.Combine(baseDir.Path, nameof(LoadsStringFromFileRefAsStringWithShiftJISEncoding) + ".resx"), 361File.Exists(Path.Combine("ResourceHandling", "TextFile1.txt")).ShouldBeTrue("Test deployment is missing None files");
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");
SecurityUtil_Tests.cs (3)
16private static string TestAssembliesPaths { get; } = Path.Combine(AppContext.BaseDirectory, "TestResources"); 25string clickOnceManifest = Path.Combine(TestAssembliesPaths, "ClickOnceProfile.pubxml"); 31string pathToCertificate = Path.Combine(TestAssembliesPaths, "mycert.pfx");
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
TestResources\TestBinary.cs (1)
16Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin");
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());
WriteLinesToFile_Tests.cs (3)
319var file = Path.Combine(directory.Path, $"{Guid.NewGuid().ToString("N")}.tmp"); 398var outputFile = Path.Combine(testEnv.DefaultTestDirectory.Path, "output.txt"); 459var outputFile = Path.Combine(testEnv.DefaultTestDirectory.Path, "output.txt");
XmlPeek_Tests.cs (3)
364string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 366xmlInputPath = dir + Path.DirectorySeparatorChar + "doc.xml";
XmlPoke_Tests.cs (3)
340string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 342xmlInputPath = dir + Path.DirectorySeparatorChar + "doc.xml";
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");
ZipDirectory_Tests.cs (3)
47string zipFilePath = Path.Combine(testEnvironment.CreateFolder(createFolder: true).Path, "test.zip"); 167SourceDirectory = new TaskItem(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"))),
Microsoft.Build.UnitTests.Shared (49)
DummyMappedDrive.cs (4)
22_mappedPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 30File.Create(Path.Combine(_mappedPath, "x")).Dispose();
EngineTestEnvironment.cs (6)
127var projectDir = Path.GetFullPath(Path.Combine(TestRoot, relativePathFromRootToProject)); 130ProjectFile = Path.GetFullPath(Path.Combine(projectDir, projectFileName)); 189string binaryLoggerFilePath = Path.GetFullPath(Path.Combine(TestRoot, Guid.NewGuid().ToString() + ".binlog"));
EnvironmentProvider.cs (5)
51.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 65.Where(p => !Path.GetInvalidPathChars().Any(p.Contains)) 66.Select(p => Path.Combine(p, commandNameWithExtension)) 82if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileNameWithoutExtension(dotnetExe) 108public static string? GetDotnetExePathFromFolder(string? netRootFolder) => Path.Combine(netRootFolder ?? string.Empty, Constants.DotNet + Constants.ExeSuffix);
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)
RunnerUtilities.cs (1)
74string pathToExecutable = Path.Combine(BootstrapMsBuildBinaryLocation, "sdk", BootstrapLocationAttribute.BootstrapSdkVersion, Constants.MSBuildExecutableName);
TestEnvironment.cs (9)
161WithInvariant(new StringInvariant("Path.GetTempPath()", Path.GetTempPath)); 534files.AddRange(Directory.GetFiles(Path.GetTempPath(), MSBuildLogFiles)); 749Path = System.IO.Path.Combine(rootPath, fileName); 791return new TransientTestFolder(System.IO.Path.Combine(Path, directoryName)); 808System.IO.Path.GetFullPath(Path).ShouldNotBe(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath())); 809System.IO.Path.IsPathRooted(Path).ShouldBeTrue($"{Path} is not rooted"); 863string path = System.IO.Path.Combine(destination.Path, filename);
Microsoft.Build.Utilities.Core (69)
CommandLineBuilder.cs (1)
342AppendTextWithQuoting("." + Path.DirectorySeparatorChar + fileName);
DebugUtils.cs (5)
74var extension = Path.GetExtension(fileName); 75var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 77var fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 83fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 138s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
ErrorUtilities.cs (1)
176if (!Path.IsPathRooted(value))
PlatformManifest.cs (1)
95string platformManifestPath = Path.Combine(_pathToManifest, "Platform.xml");
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
SDKManifest.cs (1)
312string sdkManifestPath = Path.Combine(_pathToSdk, "SDKManifest.xml");
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);
ToolTask.cs (6)
531pathToTool = Path.Combine(ToolPath, ToolExe); 543string directory = Path.GetDirectoryName(pathToTool); 544pathToTool = Path.Combine(directory, ToolExe); 552bool isOnlyFileName = Path.GetFileName(pathToTool).Length == pathToTool.Length; 1438.Select(folderPath => Path.Combine(folderPath, filename)) 1762sb[i] = Path.DirectorySeparatorChar;
TrackedDependencies\TrackedDependencies.cs (2)
39string? directoryName = Path.GetDirectoryName(item.ItemSpec); 40string searchPattern = Path.GetFileName(item.ItemSpec);
Microsoft.Build.Utilities.UnitTests (371)
CommandLineBuilder_Tests.cs (7)
145c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs .{Path.DirectorySeparatorChar}-Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs"); 158c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs"); 260c.ShouldBe($"/something .{Path.DirectorySeparatorChar}-Mercury.cs Mercury.cs \"Mer cury.cs\""); 276c.ShouldBe($"/something .{Path.DirectorySeparatorChar}-Mercury.cs Mercury.cs \"Mer cury.cs\"");
NativeMethodsShared_Tests.cs (2)
121string nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz"); 128nonexistentDirectory = $"{Path.Combine(currentDirectory, "foo", "bar", "baz")}{Guid.NewGuid()}";
PlatformManifest_Tests.cs (2)
70File.WriteAllText(Path.Combine(manifestDirectory, "SomeOtherFile.xml"), "hello"); 327File.WriteAllText(Path.Combine(_manifestDirectory, "Platform.xml"), ObjectModelHelpers.CleanupFileContents(contents));
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
TaskItem_Tests.cs (2)
185Path.Combine( 195from.GetMetadata(ItemSpecModifiers.RootDir).ShouldBe(Path.GetPathRoot(from.GetMetadata(ItemSpecModifiers.FullPath)));
TestAssemblyInfo.cs (5)
212var bootstrapCorePath = Path.Combine(Path.Combine(RunnerUtilities.BootstrapRootPath, "core"), Constants.DotnetProcessName); 226var subdirectory = Path.GetRandomFileName(); 228string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory);
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)
HostEnvironment.cs (9)
99string fileName = Path.GetFileName(location); 152string combinedPath = Path.Combine(libPath, assemblyPath); 199path = Path.Combine(probeDir, referencedAssembly.Name.Value + extension); 395: Path.GetDirectoryName(Path.GetFullPath(referringUnit.Location)); 482var coreAssemblyFile = contractSet.FirstOrDefault(c => Path.GetFileNameWithoutExtension(c).EndsWith(coreAssemblySimpleName, StringComparison.OrdinalIgnoreCase) == true); 749else if (Path.GetFileName(resolvedPath).Contains('*')) 756files = Directory.EnumerateFiles(Path.GetDirectoryName(resolvedPath), Path.GetFileName(resolvedPath));
Microsoft.CodeAnalysis (78)
AssemblyUtilities.cs (4)
30string? directory = Path.GetDirectoryName(filePath); 32string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); 38string satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithExtension); 44satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithoutExtension, resourcesNameWithExtension);
CommandLine\AnalyzerConfig.cs (4)
167_hasGlobalFileName = Path.GetFileName(pathToFile).Equals(UserGlobalConfigName, StringComparison.OrdinalIgnoreCase); 170string directory = Path.GetDirectoryName(pathToFile) ?? pathToFile; 189if (pathToFile is null || !Path.IsPathRooted(pathToFile) || string.IsNullOrEmpty(Path.GetFileName(pathToFile)))
CommandLine\AnalyzerConfig.SectionNameMatching.cs (2)
192else if (Path.DirectorySeparatorChar == '/') 198else if (!sawStartChar && Path.DirectorySeparatorChar == '\\')
CommandLine\CommandLineArguments.cs (3)
345return Path.Combine(OutputDirectory, outputFileName); 365return PdbPath ?? Path.Combine(OutputDirectory, Path.ChangeExtension(outputFileName, ".pdb"));
CommandLine\CommandLineParser.cs (6)
297resolvedPath = Path.GetFullPath(resolvedPath); 301outputFileName = Path.GetFileName(resolvedPath); 302outputDirectory = Path.GetDirectoryName(resolvedPath); 469pdbPath = Path.ChangeExtension(Path.Combine(outputDirectory, outputFileName), ".pdb"); 494genericPath = Path.Combine(outputDirectory!, outputFileName);
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (3)
81var newFilePath = Path.Combine(Path.GetDirectoryName(_filePath)!, Guid.NewGuid().ToString() + "_" + Path.GetFileName(_filePath));
CommandLine\CommonCompiler.cs (4)
306var directory = Path.GetDirectoryName(normalizedPath) ?? normalizedPath; 1181Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1263emitOptions = emitOptions.WithPdbFilePath(Path.GetFileName(emitOptions.PdbFilePath)); 1806var filePath = Path.Combine(Arguments.OutputDirectory, Arguments.OutputFileName + ".key");
CommandLine\SarifErrorLogger.cs (2)
133if (Path.IsPathRooted(path)) 137var fullPath = Path.GetFullPath(path);
Compilation.EmitStream.cs (1)
147tempFilePath = Path.Combine(tempDir, Guid.NewGuid().ToString("N"));
Compilation\DeterministicKeyBuilder.cs (1)
52filePath = Path.GetFileName(filePath);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (5)
85var fullDirectoryPath = Path.GetDirectoryName(resolvedPath) ?? throw new ArgumentException(message: null, paramName: nameof(resolvedPath)); 118var assemblyPath = Path.Combine(directory, simpleName + ".dll"); 134var analyzerFileName = Path.ChangeExtension(simpleName, ".dll"); 135var analyzerFilePath = Path.Combine(directory, analyzerFileName); 204var assemblyPath = Path.Combine(Directory, unmanagedDllName + ".dll");
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (4)
307var assemblyFileName = Path.GetFileName(assemblyFilePath); 308var satelliteAssemblyName = Path.ChangeExtension(assemblyFileName, ".resources.dll"); 309var path = Path.GetDirectoryName(assemblyFilePath); 317var filePath = Path.Combine(path, cultureInfo.Name, satelliteAssemblyName);
DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (12)
81if (!Path.IsPathRooted(baseDirectory)) 92ShadowDirectory = Path.Combine(BaseDirectory, shadowDirectoryName); 124string name = Path.GetFileName(subDirectory).ToLowerInvariant(); 189var analyzerShadowPath = Path.Combine(analyzerShadowDir, Path.GetFileName(originalAnalyzerPath)); 203var satelliteFileName = Path.GetFileName(satelliteFilePath); 204var satelliteDirectoryName = Path.GetFileName(Path.GetDirectoryName(satelliteFilePath)); 205var shadowSatellitePath = Path.Combine(analyzerShadowDir, satelliteDirectoryName!, satelliteFileName); 215var originalDirName = Path.GetDirectoryName(analyzerFilePath)!; 217return Path.Combine(ShadowDirectory, shadowDirName); 258var directory = Path.GetDirectoryName(shadowCopyPath);
DiaSymReader\SymUnmanagedFactory.cs (1)
120var moduleHandle = LoadLibrary(Path.Combine(dir, DiaSymReaderModuleName));
FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
MetadataReference\AssemblyMetadata.cs (2)
169return new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.CreateFromFile(Path.Combine(Path.GetDirectoryName(path) ?? "", moduleName)));
RuleSet\RuleSetInclude.cs (4)
90return Path.GetFullPath(resolvedIncludePath); 98includePath = includePath.Replace('\\', Path.DirectorySeparatorChar); 110if (Path.IsPathRooted(includePath)) 120includePath = PathUtilities.CombinePathsUnchecked(Path.GetDirectoryName(parentRulesetPath) ?? "", includePath);
SourceGeneration\GeneratorDriver.cs (2)
375var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 452return Path.Combine(baseDirectory ?? "", type.Assembly.GetName().Name ?? string.Empty, type.FullName!);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
60var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Analyzers (38)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (4)
130string arg4 = Path.GetFileName(additionalText.Path); 184string arg2 = Path.GetFileName(additionalText.Path); 218string fileName = Path.GetFileName(textFile.Path); 336string arg2 = Path.GetFileName(additionalText.Path);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (4)
203string arg3 = Path.GetFileName(path); 234string arg1 = Path.GetFileName(path); 257string fileName = Path.GetFileName(text.Path); 466string arg1 = Path.GetFileName(releaseTrackingLine.Path);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (2)
27if (string.Equals(".resx", Path.GetExtension(file.Path), StringComparison.OrdinalIgnoreCase)) 59var fileName = Path.GetFileName(file.Path);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.AnalyzerUtilities (26)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.BannedApiAnalyzers (29)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
SymbolIsBannedAnalyzer.cs (1)
60let fileName = Path.GetFileName(additionalFile.Path)
Microsoft.CodeAnalysis.CodeStyle (21)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
151var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.Collections.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Contracts.Package (1)
Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.CSharp (3)
CommandLine\CSharpCommandLineParser.cs (1)
1439metadataReferences.Insert(0, new CommandLineReference(Path.Combine(sdkDirectory, "mscorlib.dll"), MetadataReferenceProperties.Assembly));
CommandLine\CSharpCompiler.cs (1)
263return Path.ChangeExtension(entryPointFileName, ".exe");
Utilities\InterceptableLocation.cs (1)
106var displayFileName = Path.GetFileName(_path);
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) },
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (1)
201var generatedFilePath = Path.Combine("Microsoft.CodeAnalysis.Test.Utilities", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Component.razor.g.cs");
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (283)
CommandLineIVTTests.cs (12)
44var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 121var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 200var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 285var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
CommandLineTestBase.cs (2)
32MscorlibFullPath = Path.Combine(SdkDirectory, "mscorlib.dll"); 41File.WriteAllBytes(Path.Combine(dir.Path, "mscorlib.dll"), Net461.ReferenceInfos.mscorlib.ImageBytes);
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");
SarifV2ErrorLoggerTests.cs (5)
447var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 529var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 599var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 669Assert.False(File.Exists(Path.Combine(mappedDir.Path, "otherfile.cs"))); 679var 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)
Completion\CompletionProviders\AppDirectiveCompletionProviderTests.cs (6)
59var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 90var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 142var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 170var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 241var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 255<AnalyzerConfigDocument FilePath="{Path.Combine(tempDirectory.Path, ".globalconfig")}"><![CDATA[{globalAnalyzerConfig}]]></AnalyzerConfigDocument>
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (2)
85var systemDir = Path.GetFullPath(Environment.SystemDirectory); 91var windowsFolderName = Path.GetFileName(normalizedWindowsPath);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (5)
58var path = Path.Combine(Path.GetTempPath(), nameof(PdbSourceDocumentTests)); 324return Path.Combine(path, "reference.dll"); 329return Path.Combine(path, "source.cs"); 334return Path.Combine(path, "reference.pdb");
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\PdbFileLocatorServiceTests.cs (3)
32var pdbFilePath = Path.Combine(path, "SourceLink.pdb"); 59var pdbFilePath = Path.Combine(path, "SourceLink.pdb"); 84var pdbFilePath = Path.Combine(path, "SourceLink.pdb");
PdbSourceDocument\PdbSourceDocumentLoaderServiceTests.cs (2)
35var sourceFilePath = Path.Combine(path, "SourceLink.cs"); 66var sourceFilePath = Path.Combine(path, "SourceLink.cs");
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);
Rename\CSharpInlineRenameServiceTests.cs (1)
81var escapedPath = Path.Combine(TestWorkspace.RootDirectory, "test1.cs").Replace("\\", "\\\\");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
Emit\CompilationEmitTests.cs (2)
4716var dllPath = Path.Combine(tmpDir.Path, "assemblyname.dll"); 4717var pdbPath = Path.Combine(tmpDir.Path, "assemblyname.pdb");
Emit\EmitMetadataTests.cs (2)
237var netModule1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(filePath: Path.GetFullPath("netModule1.netmodule")); 238var netModule2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule2).GetReference(filePath: Path.GetFullPath("netModule2.netmodule"));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (6)
Emit\EditAndContinue\EditAndContinueTestBase.cs (4)
259File.WriteAllBytes(Path.Combine(outputDirectory, baseName + ".dll" + extSuffix), baseline.EmittedAssemblyData.ToArray()); 260File.WriteAllBytes(Path.Combine(outputDirectory, baseName + ".pdb" + extSuffix), baseline.EmittedAssemblyPdb.ToArray()); 264File.WriteAllBytes(Path.Combine(outputDirectory, $"{baseName}.{i + 1}.metadata{extSuffix}"), diffs[i].MetadataDelta.ToArray()); 265File.WriteAllBytes(Path.Combine(outputDirectory, $"{baseName}.{i + 1}.pdb{extSuffix}"), diffs[i].PdbDelta.ToArray());
PDB\PDBTests.cs (2)
117var path1 = Path.Combine("Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 118var path2 = Path.Combine("Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
Attributes\AttributeTests_Security.cs (1)
1606string filePath = Path.Combine(tempDir.Path, "pset_01.xml");
Attributes\InternalsVisibleToAndStrongNameTests.cs (10)
134string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 135string keyFileName = Path.GetFileName(s_keyPairFile); 163string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 164string keyFileName = Path.GetFileName(s_keyPairFile); 223string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 224string keyFileName = Path.GetFileName(s_keyPairFile); 291string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 292string keyFileName = Path.GetFileName(s_keyPairFile); 333string publicKeyFileDir = Path.GetDirectoryName(s_publicKeyFile); 334string publicKeyFileName = Path.GetFileName(s_publicKeyFile);
Microsoft.CodeAnalysis.CSharp.Features (4)
SyncedSource\FileBasedPrograms\ExternalHelpers.cs (2)
25=> Path.GetRelativePath(relativeTo, path); 28=> Path.IsPathFullyQualified(path);
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
536var sourceDirectory = Path.GetDirectoryName(sourcePath) 539var resolvedProjectPath = Path.Combine(sourceDirectory, resolvedName.Replace('\\', '/'));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (36)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (2)
3957DiagnosticResult.CompilerError("CS7036").WithSpan($"Microsoft.CodeAnalysis.CSharp.Features.UnitTests{Path.DirectorySeparatorChar}Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ConvertToRecord.ConvertToRecordCodeRefactoringTests+ConvertToRecordTestGenerator{Path.DirectorySeparatorChar}file.cs", 7, 24, 7, 25).WithArguments("P", "N.C.C(int, bool)"),
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");
EditAndContinue\Helpers\EditingTestBase.cs (1)
140=> Path.Combine(TempRoot.Root, documentIndex.ToString() + ".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) },
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (1)
201var generatedFilePath = Path.Combine("Microsoft.CodeAnalysis.Test.Utilities", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Component.razor.g.cs");
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
CsiTests.cs (1)
158+ <Initialize>.MoveNext(){string.Format(ScriptingResources.AtFileLine, $"{cwd}{Path.DirectorySeparatorChar}a.csx", "2")}
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (11)
CommandLineRunnerTests.cs (2)
249var error = $@"error CS2001: {string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "@arg1"))}"; 396var error = $@"error CS2001: {string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "a + b"))}";
InteractiveSessionReferencesTests.cs (1)
143File.Move(libBFile.Path, Path.Combine(dir.Path, "libB.dll"));
InteractiveSessionTests.cs (8)
1239string dir = Path.Combine(Path.GetDirectoryName(file.Path), "subdir"); 1240string libFileName = Path.GetFileName(file.Path); 1241string scriptPath = Path.Combine(dir, "a.csx"); 1244$@"#r ""{Path.Combine("..", libFileName)}""", 1257string root = Path.GetPathRoot(file.Path); 1260string dir = Path.Combine(root, "goo", "bar", "baz"); 1261string scriptPath = Path.Combine(dir, "a.csx");
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)
Compilation\ReferenceManagerTests.cs (2)
839string[] parts = path.Split(Path.DirectorySeparatorChar); 846return newParts.Join(Path.DirectorySeparatorChar.ToString());
DocumentationComments\DocumentationCommentCompilerTests.cs (9)
8359string fileName = Path.GetFileName(fullPath); 8360string dirPath = Path.GetDirectoryName(fullPath); 8365/// <include file='" + Path.Combine(dirPath, "a/..", fileName) + @"' path='hello'/> 8366/// <include file='" + Path.Combine(dirPath, @"a\b/../..", fileName) + @"' path='hello'/> 8400string xmlFilePath = Path.GetFileName(xmlFile.Path); 8401string dirPath = Path.GetDirectoryName(xmlFile.Path); 8402string sourcePath = Path.Combine(dirPath, "test.cs"); 8658$@"/// <include file='{Path.Combine(path, "---.xml")}' path='//summary'/> 8672<!-- Badly formed XML file ""{Path.Combine(TestHelpers.AsXmlCommentText(path), "- - -.xml")}"" cannot be included -->
Symbols\Source\FileModifierTests.cs (2)
832var testSource1 = CSharpTestSource.Parse(source, Path.Combine(root1, "code.cs")); 833var testSource2 = CSharpTestSource.Parse(source, Path.Combine(root2, "code.cs"));
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Metadata\WinMdDumpTest.cs (4)
457string fileExpected = Path.Combine(Path.GetTempPath(), "roslyn_winmd_dump.expected.txt"); 458string fileActual = Path.Combine(Path.GetTempPath(), "roslyn_winmd_dump.actual.txt");
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CSharpCommandLineParserServiceTests.cs (1)
14private static readonly string s_directory = Path.GetTempPath();
Microsoft.CodeAnalysis.Debugging.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.EditorFeatures (11)
EditorConfigSettings\Extensions\SolutionExtensions.cs (1)
16var directoryPathToCheck = Path.GetDirectoryName(pathToEditorConfigFile);
Interactive\InteractiveEvaluator.cs (2)
74Debug.Assert(languageInfo.InteractiveResponseFileName.IndexOfAny([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]) == -1);
Interactive\InteractiveSession.cs (5)
99_hostDirectory = Path.Combine(Path.GetDirectoryName(typeof(InteractiveSession).Assembly.Location), "InteractiveHost"); 228var hostPathDirectory = Path.GetDirectoryName(_hostOptions.HostPath); 232var newSubmissionFilePath = Path.Combine(hostPathDirectory, $"Submission{SubmissionCount}{_languageInfo.Extension}"); 248Path.GetFileName(initializationScriptPath),
Peek\PeekHelpers.cs (1)
19var fileName = Path.GetFileName(filePath);
Preview\AbstractPreviewFactoryService.cs (2)
623buffer, Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString(), document.Name));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\EditorTestWorkspace.cs (1)
536ChangedSourceGeneratedDocumentFileNames.Add(Path.GetFileName(document.FilePath));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (11)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (2)
121Assert.True(Path.IsPathRooted(portableExecutable.FilePath), $"'{portableExecutable.FilePath}' is not a fully-qualified file name"); 126Assert.True(Path.IsPathRooted(reference.Display), $"'{reference.Display}' is not a fully-qualified file name");
UnusedReferences\ProjectAssets\ProjectAssetsReaderTests.cs (2)
69=> new(ReferenceType.Project, projectPath, treatAsUsed, [Path.ChangeExtension(projectPath, "dll")], [.. dependencies]); 73=> new(ReferenceType.Package, Path.GetFileNameWithoutExtension(assemblyPath), treatAsUsed, [assemblyPath], [.. dependencies]);
UnusedReferences\ProjectAssets\TestProjectAssetsFile.cs (4)
53libraries.Add(Path.GetFileNameWithoutExtension(library.Path), library); 68Compile = new Dictionary<string, ProjectAssetsTargetLibraryCompile>() { { Path.ChangeExtension(reference.ItemSpecification, "dll"), new ProjectAssetsTargetLibraryCompile() } }, 71libraries[Path.GetFileNameWithoutExtension(reference.ItemSpecification)] = library; 89return references.ToDictionary(reference => Path.GetFileNameWithoutExtension(reference.ItemSpecification), reference => string.Empty);
UnusedReferences\UnusedReferencesRemoverTests.cs (3)
183itemSpecification: Path.GetFileName(assemblyPath), 192itemSpecification: Path.GetFileName(assemblyPath), 201itemSpecification: Path.GetFileName(assemblyPath),
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Extensions.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadMSBuildWorkspace.cs (1)
58Contract.ThrowIfFalse(projectPaths.All(Path.IsPathFullyQualified));
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);
HotReloadServiceTests.cs (1)
174.AddAdditionalDocument("A.txt", "text", filePath: Path.Combine(TempRoot.Root, "A.txt"))
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Analyzers\OmnisharpAnalyzerLoaderFactory.cs (2)
13baseDirectory ??= Path.Combine(Path.GetTempPath(), "CodeAnalysis", "OmnisharpAnalyzerShadowCopies");
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (5)
RazorAnalyzerAssemblyResolver.cs (5)
65var onDiskName = Path.Combine(directory, $"{fileName}.dll"); 87if (!Path.GetFileName(directory.AsSpan().TrimEnd(Path.DirectorySeparatorChar)).Equals(ServiceHubCoreFolderName, StringComparison.OrdinalIgnoreCase)) 89var serviceHubCoreDirectory = Path.Combine(directory, ServiceHubCoreFolderName); 98var assemblyPath = Path.Combine(directory, assemblyFileName);
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (9)
RazorAnalyzerAssemblyResolverTests.cs (9)
84var result = compilation.Emit(Path.Combine(directory, $"{simpleName}.dll")); 120File.Move(Path.Combine(dir1, fileName), Path.Combine(dir2, fileName)); 129expectedAssembly = context.LoadFromAssemblyPath(Path.Combine(dir2, fileName)); 176var serviceHubFolder = Path.Combine(dir, RazorAnalyzerAssemblyResolver.ServiceHubCoreFolderName); 180coreTest(dir + Path.DirectorySeparatorChar, serviceHubFolder); 182coreTest(serviceHubFolder + Path.DirectorySeparatorChar, serviceHubFolder); 186var name = Path.GetFileName(loadDir.AsSpan()); 201Assert.Equal(serviceHubFolder, Path.GetDirectoryName(assembly1.Location));
Microsoft.CodeAnalysis.Features (62)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (2)
102var fileName = IOUtilities.PerformIO(() => Path.GetFileName(document.FilePath)); 111var fileName = IOUtilities.PerformIO(() => Path.GetFileName(document.FilePath));
AddFileBanner\AddFileBannerHelpers.cs (2)
54var sourceName = IOUtilities.PerformIO(() => Path.GetFileName(sourceDocument.FilePath)); 55var destinationName = IOUtilities.PerformIO(() => Path.GetFileName(destinationFilePath));
AddImport\References\MetadataSymbolReference.cs (1)
46return (string.Format(FeaturesResources.Add_reference_to_0, Path.GetFileName(_reference.FilePath)),
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (2)
51var fullPath = Path.GetFullPath(_project.FilePath); 79var fullPath = !string.IsNullOrEmpty(filePath) ? Path.GetFullPath(filePath) : filePath;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
165=> Path.GetFileNameWithoutExtension(document.Document.Name); 220var fileExtension = Path.GetExtension(documentNameWithExtension);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
65Debug.Assert(parts.IsEmpty || parts.Any(static s => s.IndexOfAny(Path.GetInvalidPathChars()) < 0));
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
161var folderPath = Path.Combine([.. document.Folders]);
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);
Emit\CompilationOutputFilesWithImplicitPdbPath.cs (3)
35public override string PdbDisplayPath => Path.GetFileNameWithoutExtension(AssemblyFilePath) + ".pdb"; 75TryOpenFileStream(Path.Combine(Path.GetDirectoryName(AssemblyFilePath)!, PathUtilities.GetFileName(pdbPath)));
Extensions\ExtensionMessageHandlerService.cs (1)
62return Path.GetDirectoryName(assemblyFilePath)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
277var fileName = filePath == null ? null : IOUtilities.PerformIO(() => Path.GetFileName(filePath)) ?? filePath;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
160var directoryToCreate = Path.GetDirectoryName(fileInfo.TemporaryFilePath)!; 367Path.GetFileName(fileInfo.TemporaryFilePath),
MetadataAsSource\MetadataAsSourceFileService.cs (4)
54private readonly string _rootTemporaryPath = Path.Combine(Path.GetTempPath(), MetadataAsSource); 64_rootTemporaryPathWithGuid = Path.Combine(_rootTemporaryPath, guidString); 109var providerTempPath = Path.Combine(_rootTemporaryPathWithGuid, provider.GetType().Name);
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
34this.TemporaryFilePath = Path.Combine(rootPath, directoryName, topLevelNamedType.Name + Extension);
NavigateTo\RoslynNavigateToItem.cs (1)
227var fileName = Path.GetFileNameWithoutExtension(_itemDocument.FilePath ?? "");
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);
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (3)
46var filePath = Path.Combine(tempFilePath, Path.GetFileName(sourceDocument.FilePath)); 127var relativePath = Path.GetFileName(sourceDocument.FilePath);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
105telemetryMessage.SetDll(Path.GetFileName(dllPath)); 230var tempFilePath = Path.Combine(tempPath, projectId.Id.ToString()); 351name: Path.GetFileName(info.FilePath),
SemanticSearch\SemanticSearchWorkspace.cs (2)
21public static readonly string ReferenceAssembliesDirectory = Path.Combine(Path.GetDirectoryName(typeof(SemanticSearchWorkspace).Assembly.Location)!, "SemanticSearchRefs");
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
151var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
StackTraceExplorer\StackTraceExplorerService.cs (2)
96var documentName = Path.GetFileName(fileName); 108var name = Path.GetFileName(document.Name);
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (5)
101private readonly DirectoryInfo _cacheDirectoryInfo = new(Path.Combine( 141var invalidChars = new HashSet<char>(Path.GetInvalidFileNameChars()); 183Path.Combine(_cacheDirectoryInfo.FullName, ConvertToFileName(_source) + ".txt")); 345var tempFilePath = Path.Combine(_cacheDirectoryInfo.FullName, guidString + ".tmp"); 387=> new(Path.ChangeExtension(databaseFileInfo.FullName, ".bin"));
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (3)
78? Path.GetFileNameWithoutExtension(referenceInfo.ItemSpecification) 150compilationAssemblies.Add(Path.GetFullPath(Path.Combine(packagesPath, library.Path ?? "", assemblyPath)));
UnusedReferences\UnusedReferencesRemover.cs (1)
149.SelectAsArray(assemblyPath => Path.GetFileName(assemblyPath));
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
EditAndContinue\ActiveStatementsDescription.cs (1)
145var documentName = filePaths?[sourceIndex] ?? Path.Combine(TempRoot.Root, TestWorkspace.GetDefaultTestSourceDocumentName(sourceIndex, extension ?? ""));
EditAndContinue\EditAndContinueTestVerifier.cs (1)
511var name = Path.GetFileNameWithoutExtension(oldPath);
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
155=> projectDirectory?.CreateFile(fileName).WriteAllText(content, Encoding.UTF8).Path ?? Path.Combine(TempRoot.Root, fileName); 320[(source, sourceFilePath ?? Path.Combine(TempRoot.Root, "test1.cs"))],
EditAndContinue\Extensions.cs (4)
116path = Path.Combine(Path.GetDirectoryName(solution.GetRequiredProject(projectId).FilePath!)!, path); 160filePath: Path.Combine(TempRoot.Root, projectName, projectName + language switch 168assemblyPath: Path.Combine(TempRoot.Root, projectName + ".dll"),
Snippets\AbstractSnippetProviderTests.cs (2)
47filePath: Path.Combine(TempRoot.Root, "TestDocument")); 54filePath: Path.Combine(TempRoot.Root, ".editorconfig"));
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\EditSessionActiveStatementsTests.cs (1)
82solution = solution.AddDocument(id, name, text, filePath: Path.Combine(TempRoot.Root, name));
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)
Interactive\Core\InteractiveHost.Service.cs (5)
167Path.Combine(Path.GetTempPath(), "InteractiveHostShadow"), 522Console.Out.WriteLine(string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(initializationFilePath))); 529var rspDirectory = Path.GetDirectoryName(initializationFilePath)!; 733var directories = attemptedFilePaths.Select(path => Path.GetDirectoryName(path)!).ToArray();
Interactive\Core\InteractiveHostOptions.cs (2)
66var hostPath = Path.Combine(hostDirectory, hostSubdirectory, hostExecutableFileName); 67var initializationFilePath = (initializationFileName != null) ? Path.Combine(hostDirectory, hostSubdirectory, initializationFileName) : null;
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.LanguageServer (53)
DotnetCliHelper.cs (2)
118var vstestConsole = Path.Combine(dotnetSdkFolder, "vstest.console.dll"); 140var filePath = Path.Combine(item, fileName);
FileBasedPrograms\CanonicalMiscellaneousFilesProjectProvider.cs (4)
33logicalPath: Path.GetFileName(miscDocumentPath), 63_tempDirectory = Path.Combine(Path.GetTempPath(), "roslyn-canonical-misc", Guid.NewGuid().ToString()); 66var virtualProjectPath = Path.Combine(_tempDirectory, "Canonical.csproj");
FileBasedPrograms\FileBasedProgramsEntryPointDiscovery.cs (5)
144var cacheFilePath = Path.Join(cacheDirectory, "cache.json"); 179var sentinelPath = Path.Join(cacheDirectory, $".walk-timestamp-{Guid.NewGuid()}"); 201var cacheStagingFilePath = Path.Join(cacheDirectory, "cache.staging.json"); 250var extension = Path.GetExtension(entry.FileName); 286var directoryName = Path.GetFileName(directory.AsSpan());
FileBasedPrograms\VirtualProjectXmlProvider.cs (6)
32var workingDirectory = Path.GetDirectoryName(documentFilePath); 100=> Path.ChangeExtension(documentFilePath, ".csproj"); 137? Path.GetTempPath() 139return Path.Join(tempDirectory, "dotnet", dotnetSubdirectory); 145string fileName = Path.GetFileNameWithoutExtension(originalFilePath); 149return Path.Join(GetTempDotnetSubdirectory(dotnetSubdirectory), directoryName);
HostWorkspace\AutoLoadProjectsInitializer.cs (4)
147&& VSCodeSettings.TryRead(Path.Combine(folderPath, ".vscode", "settings.json"), logger, out var settings) 159var solutionPath = Path.IsPathRooted(defaultSolution) 161: Path.GetFullPath(Path.Combine(folderPath, defaultSolution));
HostWorkspace\BinLogPathProvider.cs (1)
43var binaryLogPath = Path.Combine(binaryLogDirectory, $"LanguageServerDesignTimeBuild-{_binaryLogGuidSuffix}-{numericSuffix}.binlog");
HostWorkspace\FileWatching\DefaultFileChangeWatcher.cs (3)
57var root = Path.GetPathRoot(watchedDirectoryPath); 69foreach (var pathComponentRange in pathRelativeToRoot.SplitAny([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]))
HostWorkspace\FileWatching\DefaultFileChangeWatcher.FileChangeContext.cs (2)
57var parentDirectory = Path.GetDirectoryName(filePath); 70var extension = Path.GetExtension(filePath);
HostWorkspace\FileWatching\LspFileChangeWatcher.cs (2)
156BaseUri = ProtocolConversions.CreateAbsoluteDocumentUri(Path.GetDirectoryName(filePath)!), 157Pattern = Path.GetFileName(filePath)
HostWorkspace\LanguageServerProjectLoader.cs (2)
395var projectName = Path.GetFileName(projectPath); 408message = string.Format(LanguageServerResources.There_were_problems_loading_project_0_See_log_for_details, Path.GetFileName(projectPath));
HostWorkspace\LoadedProject.cs (3)
56_projectDirectory = Path.GetDirectoryName(_projectFilePath); 159: Path.GetFileNameWithoutExtension(newProjectInfo.FilePath) + targetFrameworkSuffix; 331var extension = Path.GetExtension(info.FilePath);
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (3)
116var fileExtension = Path.GetExtension(file); 129var lowerCaseName = Path.GetFileNameWithoutExtension(reference.Reference).ToLower(); 165return VsReferenceHashingAlgorithm.HashInput($"Filename: {Path.GetFileName(projectToLoad.Path)}\n{content}");
HostWorkspace\WorkspaceProject.cs (2)
183fileDirectory ??= Path.GetDirectoryName(_project.FilePath); 187return Path.Combine(fileDirectory, propertyValue);
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (1)
64var projectFileName = Path.GetFileName(projectPath);
LanguageServer\Handler\Restore\RestoreHandler.cs (2)
100var workingDirectory = Path.GetDirectoryName(path); 101var stageName = string.Format(LanguageServerResources.Restoring_0, Path.GetFileName(path));
Program.cs (2)
98var cacheDirectory = Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location)!, "cache");
Services\ExtensionAssemblyManager.cs (5)
80var directory = Path.GetDirectoryName(assemblyFilePath); 128var devKitDependencyDirectory = Path.GetDirectoryName(devKitDependencyPath); 135var assemblyPath = Path.Combine(devKitDependencyDirectory, simpleName + ".dll"); 152var directory = Path.GetDirectoryName(assemblyFilePath); 200var assemblyPath = Path.Combine(_extensionDirectory, simpleName + ".dll");
Testing\RunTestsHandler.cs (4)
46var projectOutputDirectory = Path.GetDirectoryName(projectOutputPath); 54var testLogPath = serverConfiguration.ExtensionLogDirectory is not null ? Path.Combine(serverConfiguration.ExtensionLogDirectory, "testLogs", "vsTestLogs.txt") : null; 125var workingDirectory = Path.GetDirectoryName(document.Project.FilePath); 128var projectFileName = Path.GetFileName(document.Project.FilePath);
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Extensions\Extensions.cs (4)
44var directoryName = Path.GetDirectoryName(document.FilePath); 47var path = Path.Combine(directoryName, document.Name); 56var projectDirectoryName = Path.GetDirectoryName(document.Project.FilePath); 58var path = Path.Combine([projectDirectoryName, .. document.Folders, document.Name]);
Extensions\ProtocolConversions.cs (2)
247if (path[^1] == System.IO.Path.DirectorySeparatorChar) 252Debug.Assert(!path.Split(System.IO.Path.DirectorySeparatorChar).Any(p => p == "." || p == ".."));
Features\DecompiledSource\AssemblyResolver.cs (2)
156var baseDirectory = Path.GetDirectoryName(mainModule.FileName); 157var moduleFileName = Path.Combine(baseDirectory, moduleName);
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
107var extension = Path.GetExtension(filePath);
LanguageInfoProvider.cs (1)
54var extension = Path.GetExtension(localPath);
Protocol\Extensions\VSLocation.cs (1)
24/// This doesn't have to correspond to a real file path, but must be parsable by the <see cref="System.IO.Path.GetFileName(string)" /> method.
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (42)
CodeActions\CodeActionResolveTests.cs (6)
353var newDocumentUri = ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(Path.GetDirectoryName(project.FilePath)!, "ABC.cs")); 461DocumentFileContainingFolders = [Path.Combine("dir1", "dir2", "dir3")], 483Assert.Contains(Path.Combine("dir1", "dir2", "dir3"), existingDocument.FilePath); 485Path.Combine(Path.GetDirectoryName(existingDocument.FilePath)!, "BCD.cs"));
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"))
InlineCompletions\TestSnippetInfoService.cs (1)
28var snippetsFile = Path.Combine(Directory.GetCurrentDirectory(), "InlineCompletions", "TestSnippets.snippet");
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (3)
125filePath: Path.Combine(TempRoot.Root, "proj_without_config", "test.cs"))); 141filePath: Path.Combine(TempRoot.Root, "proj_with_config", ".editorconfig"))); 146filePath: Path.Combine(TempRoot.Root, "proj_with_config", "test.cs")));
ProtocolConversionsTests.cs (3)
29var invalidFileNameChars = Path.GetInvalidFileNameChars(); 95Assert.Equal(Path.GetFullPath(filePath).Replace('/', '\\'), uri.LocalPath); 190Assert.Equal(Path.GetFullPath(filePath), uri.LocalPath);
Rename\RenameTests.cs (6)
271var razorFilePath = Path.Combine(Path.GetDirectoryName(project.FilePath), "file.razor"); 440var razorFilePath = Path.Combine(Path.GetDirectoryName(project.FilePath), "file.razor"); 493var razorFilePath = Path.Combine(Path.GetDirectoryName(project.FilePath), "file.razor");
Microsoft.CodeAnalysis.LanguageServer.UnitTests (141)
AutoLoadProjectsInitializerTests.cs (6)
52Assert.Equal(Path.Combine(ProtocolConversions.GetDocumentFilePathFromUri(secondFolder.DocumentUri.GetRequiredParsedUri()), "eng", "App.slnx"), solutionPath); 59var settingsPath = Path.Combine(settingsDirectory.Path, "settings.json"); 67var folder = Path.GetDirectoryName(Path.GetDirectoryName(settingsPath))!; 79var solutionPath = Path.Combine(folderPath, relativePath); 80Directory.CreateDirectory(Path.GetDirectoryName(solutionPath)!);
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"));
FileBasedProgramsWorkspaceTests.cs (1)
840using var fileChangeContext = fileChangeWatcher.CreateContext([new WatchedDirectory(Path.GetDirectoryName(appCsFile.Path)!, extensionFilters: [])]);
LspFileChangeWatcherTests.cs (1)
91var filePath = Path.Combine(tempDirectory.Path, "SingleFile.txt");
TelemetryReporterTests.cs (1)
24Environment.SetEnvironmentVariable("CommonPropertyBagPath", Path.GetTempFileName());
Utilities\AbstractLanguageServerClientTests.cs (2)
46var projectPath = Path.Combine(projectDirectory.Path, "Project.csproj"); 60var codePath = Path.Combine(projectDirectory.Path, "Code.cs");
Utilities\AbstractLanguageServerClientTests.TestLspClient.cs (2)
89: Path.Combine(Path.GetTempPath(), pipeName + ".sock");
Utilities\TestPaths.cs (3)
16=> Path.Combine(AppContext.BaseDirectory, DevKitExtensionSubdirectory, DevKitAssemblyFileName); 25=> Path.Combine(AppContext.BaseDirectory, LanguageServerSubdirectory); 27=> Path.Combine(GetLanguageServerDirectory(), LanguageServerAssemblyFileName);
VirtualProjectXmlProviderTests.cs (1)
155var content = await projectProvider.GetVirtualProjectContentAsync(Path.Combine(tempDir.Path, "BAD"), LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
VSCodeSettingsTests.cs (1)
60var settingsPath = Path.Combine(settingsDirectory.Path, "settings.json");
WorkspaceProjectFactoryServiceTests.cs (2)
65return Path.Combine("Z:\\", relativePath); 67return Path.Combine("//", relativePath);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (28)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.PooledObjects.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.PublicApiAnalyzers (27)
PublicApiFile.cs (1)
16var fileName = Path.GetFileName(path);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (3)
DeclarePublicAPIAnalyzerTestsBase.cs (3)
920var tempPath = Path.GetTempPath(); 921var shippedFilePath = Path.Combine(tempPath, ShippedFileName); 922var unshippedFilePath = Path.Combine(tempPath, UnshippedFileName);
Microsoft.CodeAnalysis.Razor.Compiler (11)
Language\Components\ComponentDiagnosticFactory.cs (1)
110var fileName = Path.GetFileName(source.FilePath);
Language\Components\ComponentDocumentClassifierPass.cs (1)
146className = CSharpIdentifier.SanitizeIdentifier(Path.GetFileNameWithoutExtension(relativePath).AsSpanOrDefault());
Language\DefaultRazorProjectFileSystem.cs (2)
76var physicalPath = Path.GetFullPath(path); 79var filePath = "/" + relativePhysicalPath.Replace(Path.DirectorySeparatorChar, '/');
Language\FileKinds.cs (2)
41var fileName = Path.GetFileName(filePath); 49var extension = Path.GetExtension(filePath);
Language\RazorCodeDocumentExtensions.cs (1)
44(codeDocument.FileKind.IsLegacy() && string.Equals(Path.GetFileName(codeDocument.Source.FilePath), MvcImportProjectFeature.ImportsFileName, StringComparison.OrdinalIgnoreCase));
Mvc\RazorExtensionsDiagnosticFactory.cs (1)
85var fileName = Path.GetFileName(source.FilePath);
SourceGenerators\RazorSourceGenerator.cs (2)
65var fileName = Path.GetFileNameWithoutExtension(path); 70var fileName = Path.GetFileNameWithoutExtension(path);
SourceGenerators\RazorSourceGenerator.RazorProviders.cs (1)
151.Replace(Path.DirectorySeparatorChar, '/')
Microsoft.CodeAnalysis.Razor.Workspaces (33)
CodeActions\Razor\ComponentAccessibilityCodeActionProvider.cs (2)
103var directoryName = Path.GetDirectoryName(path); 106var newComponentPath = Path.Combine(directoryName, $"{startTag.Name.Content}.razor");
CodeActions\Razor\ExtractToCodeBehindCodeActionResolver.cs (2)
43var codeBehindPath = FileUtilities.GenerateUniquePath(path, $"{Path.GetExtension(path)}.cs"); 48var className = Path.GetFileNameWithoutExtension(path);
CodeActions\Razor\ExtractToComponentCodeActionResolver.cs (3)
46var directoryName = Path.GetDirectoryName(path).AssumeNotNull(); 47var templatePath = Path.Combine(directoryName, "Component.razor"); 49var componentName = Path.GetFileNameWithoutExtension(componentPath);
CodeActions\Razor\ExtractToCssCodeActionProvider.cs (1)
97var razorFileName = Path.GetFileName(context.Request.TextDocument.DocumentUri.GetAbsoluteOrUNCPath());
CodeActions\Razor\GenerateEventHandlerCodeActionResolver.cs (1)
42var razorClassName = Path.GetFileNameWithoutExtension(razorFilePath);
CodeActions\Razor\PromoteUsingCodeActionResolver.cs (3)
40var folder = Path.GetDirectoryName(file).AssumeNotNull(); 41var importsFile = Path.GetFullPath(Path.Combine(folder, "..", importsFileName));
DocumentPresentation\UriPresentationHelper.cs (3)
23x => Path.GetFileName(x.GetAbsoluteOrUNCPath()).EndsWith(".razor", PathUtilities.OSSpecificPathComparison)).FirstOrDefault(); 34var fileName = Path.GetFileName(razorFileUri.GetAbsoluteOrUNCPath()); 35if (uris.Any(uri => !Path.GetFileName(uri.GetAbsoluteOrUNCPath()).StartsWith(fileName, PathUtilities.OSSpecificPathComparison)))
Formatting\FormattingLogger.cs (1)
33var filePath = Path.Combine(_logFolder, fileName);
Formatting\FormattingLoggerFactory.cs (2)
23var fileName = Path.GetFileName(documentFilePath).Replace(".", "_"); 25var logFolder = Path.Combine(BaseLogDir, folder);
GoToDefinition\AbstractDefinitionService.cs (10)
161var projectDirectory = Path.GetDirectoryName(project.FilePath); 168var relativePath = filePath.Substring(2).Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); 169var candidatePath = Path.GetFullPath(Path.Combine(projectDirectory, relativePath)); 179var currentDocumentDirectory = Path.GetDirectoryName(documentSnapshot.FilePath); 182var normalizedPath = filePath.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); 183var candidatePath = Path.GetFullPath(Path.Combine(currentDocumentDirectory, normalizedPath));
ProjectSystem\HostProject.cs (1)
43DisplayName = displayName ?? Path.GetFileNameWithoutExtension(filePath);
ProjectSystem\IDocumentSnapshotExtensions.cs (1)
55var fileName = Path.GetFileNameWithoutExtension(documentSnapshot.FilePath);
Rename\RenameService.cs (3)
145var newFileName = $"{newName}{Path.GetExtension(originalPath)}"; 146var directoryName = Path.GetDirectoryName(originalPath).AssumeNotNull(); 147return Path.Combine(directoryName, newFileName);
Microsoft.CodeAnalysis.Rebuild (2)
CSharpCompilationFactory.cs (1)
52Path.GetFileNameWithoutExtension(AssemblyFileName),
VisualBasicCompilationFactory.cs (1)
52Path.GetFileNameWithoutExtension(AssemblyFileName),
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)
NestedFiles\RemoteAddNestedFileService.cs (3)
113var componentName = Path.GetFileNameWithoutExtension(razorFilePath); 120var componentName = Path.GetFileNameWithoutExtension(razorFilePath); 132var className = Path.GetFileNameWithoutExtension(razorFilePath);
RazorAssemblyLoadContext.cs (2)
25_baseDirectory = Path.GetDirectoryName(thisAssembly.Location) ?? throw new InvalidOperationException("Could not determine base directory"); 31var fileName = Path.Combine(_baseDirectory, assemblyName.Name + ".dll");
RemoteMefComposition.cs (5)
120var cacheDirectory = Path.GetDirectoryName(compositionCacheFile).AssumeNotNull(); 125var tempFilePath = Path.Combine(cacheDirectory, Path.GetRandomFileName()); 170checksum.Append(Path.GetFileName(assemblyPath)); 180return Path.Combine(cacheDirectory, $"razor.mef.{hashAsBase64String}.cache");
Rename\RemoteRenameService.cs (2)
191var newFileName = Path.GetFileNameWithoutExtension(newFilePath); 200if (newFileName == Path.GetFileNameWithoutExtension(oldDoc.FilePath))
src\Razor\src\Razor\src\Microsoft.VisualStudio.LanguageServices.Razor\Telemetry\TelemetryReporter.cs (1)
357var moduleName = Path.GetFileNameWithoutExtension(method.Module.Name);
Microsoft.CodeAnalysis.Remote.Razor.UnitTests (9)
RazorServicesTest.cs (1)
103document.Load(Path.Combine(TestProject.GetRepoRoot(), "eng", "targets", "RazorServices.props"));
RemoteMefCompositionTest.cs (8)
73File.WriteAllText(Path.Combine(cacheDirectory, Path.GetRandomFileName()), ""); 74File.WriteAllText(Path.Combine(cacheDirectory, Path.GetRandomFileName()), ""); 75File.WriteAllText(Path.Combine(cacheDirectory, Path.GetRandomFileName()), ""); 76File.WriteAllText(Path.Combine(cacheDirectory, Path.GetRandomFileName()), "");
Microsoft.CodeAnalysis.Remote.ServiceHub (9)
Host\RemoteAnalyzerPathResolver.cs (3)
20=> Path.GetFullPath(Path.Combine(_baseDirectory, Path.GetFileName(analyzerPath)));
Host\RemoteExportProviderBuilder.cs (1)
73cacheDirectory: Path.Combine(localSettingsDirectory, "Roslyn", "RemoteHost", "Cache"),
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (5)
284var logPath = Path.Combine(Path.GetTempPath(), "VSLogs"); 300var logPath = Path.Combine(Path.GetTempPath(), "servicehub", "logs"); 335var name = Path.GetFileNameWithoutExtension(path);
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (3)
RemoteAnalyzerAssemblyLoaderTests.cs (3)
31var loader = Create(Path.GetDirectoryName(remoteAssemblyLocation)!); 53var loader = Create(Path.GetDirectoryName(featuresAssemblyLocation)!); 69var loader = Create(Path.GetDirectoryName(compilerAssemblyLocation)!);
Microsoft.CodeAnalysis.Remote.Workspaces (4)
ExportProviderBuilder.cs (4)
112return Path.Combine(CacheDirectory, $"{CatalogPrefix}.{ComputeAssemblyHash(AssemblyPaths)}{CatalogSuffix}"); 155var directory = Path.GetDirectoryName(compositionCacheFile)!; 160var tempFilePath = Path.Combine(directory, Path.GetRandomFileName());
Microsoft.CodeAnalysis.ResxSourceGenerator (32)
AbstractResxGenerator.cs (6)
82var resourceHintName = Path.GetFileNameWithoutExtension(resourceFile.Path); 86resourceHintName = Path.GetFileNameWithoutExtension(link); 87string linkRelativeDir = Path.GetDirectoryName(link); 95else if (options.TryGetValue("build_metadata.AdditionalFiles.RelativeDir", out var relativeDir) && !relativeDir.StartsWith("..", StringComparison.Ordinal) && !Path.IsPathRooted(relativeDir)) 108string candidate = relativeDir.Replace(Path.DirectorySeparatorChar, '.').Replace(Path.AltDirectorySeparatorChar, '.') + hintName;
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (10)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (5)
84var resourceDirectory = Path.Combine(Path.GetDirectoryName(_testFile)!, "Resources", ResourceName); 91expectedNames.Add(Path.GetFileName(tree.FilePath)); 138var name = Path.GetFileName(tree.FilePath); 139var filePath = Path.Combine(resourceDirectory, name);
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (5)
69var resourceDirectory = Path.Combine(Path.GetDirectoryName(_testFile)!, "Resources", ResourceName); 76expectedNames.Add(Path.GetFileName(tree.FilePath)); 123var name = Path.GetFileName(tree.FilePath); 124var filePath = Path.Combine(resourceDirectory, name);
Microsoft.CodeAnalysis.Scripting (30)
Hosting\AssemblyLoader\CoreAssemblyLoaderImpl.cs (1)
33var assembly = new LoadContext(Loader, Path.GetDirectoryName(path)).LoadFromAssemblyPath(path);
Hosting\AssemblyLoader\InteractiveAssemblyLoader.cs (3)
235loadDirectory = Path.GetDirectoryName(loadedAssembly.OriginalPath); 329string pathWithoutExtension = Path.Combine(directory, simpleName); 344string pathWithoutExtension = Path.Combine(directory, identity.Name);
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)))
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (1)
201=> ((AppContext.GetData("TRUSTED_PLATFORM_ASSEMBLIES") as string)?.Split(Path.PathSeparator)).ToImmutableArrayOrEmpty();
src\Compilers\Shared\GlobalAssemblyCacheHelpers\MonoGlobalAssemblyCache.cs (7)
31s_corlibDirectory = Path.GetDirectoryName(corlibAssemblyFile); 34s_gacDirectory = Directory.GetParent(Path.GetDirectoryName(systemAssemblyFile)).Parent.FullName; 45var corlibFriendPath = Path.Combine(s_corlibDirectory, fileName); 49corlibFriendPath = Path.Combine(s_corlibDirectory, "Facades", fileName); 65yield return Path.Combine(gacPath, name, version + "__" + publicKeyToken, fileName); 70var gacAssemblyRootDir = new DirectoryInfo(Path.Combine(gacPath, name)); 88var assemblyPath = Path.Combine(assemblyDir.ToString(), fileName);
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (8)
GlobalAssemblyCacheTests.cs (1)
116Assert.Equal(Path.GetFullPath(location), location);
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)
CSharpScriptTestBase.cs (2)
32var clientDir = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(CSharpScriptTestBase)))!; 37tempDir: Path.GetTempPath());
TestRuntimeMetadataReferenceResolver.cs (4)
30string testDir = Path.GetDirectoryName(GetType().GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 31string testDependencyAssemblyPath = Path.Combine(testDir, name + ".dll"); 37string fxDir = Path.GetDirectoryName(typeof(object).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 38string fxAssemblyPath = Path.Combine(fxDir, name + ".dll");
VisualBasicScriptTestBase.cs (1)
30tempDir: Path.GetTempPath());
Microsoft.CodeAnalysis.SemanticSearch.Extensions (1)
ProjectModel.cs (1)
48var projectDirectory = Path.GetDirectoryName(FilePath)!;
Microsoft.CodeAnalysis.Test.Utilities (68)
Assert\ArtifactUploadUtil.cs (8)
78uploadDir = Path.Combine(uploadDir, _baseDirectoryName); 84var fileName = Path.GetFileName(filePath); 85File.Copy(filePath, Path.Combine(uploadDir, fileName)); 91var destDirectory = Path.Combine(uploadDir, Path.GetFileName(directory)); 98if (destFilePath.Length > 0 && destFilePath[0] == Path.DirectorySeparatorChar) 103destFilePath = Path.Combine(destDirectory, destFilePath); 104Directory.CreateDirectory(Path.GetDirectoryName(destFilePath)!);
Assert\AssertEx.cs (4)
581string file1 = Path.GetTempFileName(); 584string file2 = Path.GetTempFileName(); 834var actualFile = Path.GetTempFileName(); 854var compareCmd = Path.GetTempFileName() + ".cmd";
Assert\ConditionalFactAttribute.cs (4)
154public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 173var tempDir = Path.GetTempPath(); 174var path = Path.GetFullPath(Path.Combine(tempDir, "aux.txt"));
Compilation\CompilationTestDataExtensions.cs (1)
36var moduleName = Path.GetFileNameWithoutExtension(module.Name);
Compilation\RuntimeUtilities.cs (1)
47tempDirectory ??= Path.GetTempPath();
CompilationVerifier.cs (5)
111string modulePath = Path.Combine(dumpDir, emitData.EmittedModule.SimpleName + extension); 186var dumpDirectory = Path.Combine(dumpBasePath is "" ? TempRoot.Root : dumpBasePath, "dumps", dumpCount.ToString()); 213string pePath = Path.Combine(dumpDirectory, fileName + module.Kind.GetDefaultExtension()); 230pdbPath = Path.Combine(dumpDirectory, fileName + ".pdb"); 262File.WriteAllText(Path.Combine(dumpDirectory, "log.txt"), sb.ToString());
DotNetCoreSdk.cs (4)
25var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe"); 29&& File.Exists(Path.Combine(directory, dotNetExeName)); 35.Split(Path.PathSeparator) 41ExePath = Path.Combine(dotNetInstallDir, dotNetExeName);
Metadata\IlasmUtilities.cs (9)
43return Path.Combine( 44Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(object))), 49var directory = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(RuntimeUtilities))); 68return Path.Combine(directory, "runtimes", ridName, "native", ilasmExeName); 80string sourceFileName = Path.GetFileNameWithoutExtension(sourceFile.Path); 82assemblyPath = Path.Combine( 84Path.ChangeExtension(Path.GetFileName(sourceFile.Path), "dll")); 115pdbPath = Path.ChangeExtension(assemblyPath, "pdb");
Mocks\VirtualizedRelativePathResolver.cs (1)
28return _existingFullPaths.Contains(Path.GetFullPath(fullPath));
Platform\CoreClr\AssemblyLoadContextUtils.cs (2)
27_probingPath = probingPath ?? Path.GetDirectoryName(typeof(SimpleAssemblyLoadContext).Assembly.Location)!; 32var assemblyPath = Path.Combine(_probingPath, $"{assemblyName.Name}.dll");
Platform\Custom\SigningTestHelpers.cs (1)
21new DesktopStrongNameProvider(ImmutableArray<string>.Empty, new VirtualizedStrongNameFileSystem(Path.GetTempPath()));
SharedResourceHelpers.cs (4)
18string directory = System.IO.Path.GetDirectoryName(filename); 19string filenamewithoutextension = System.IO.Path.GetFileNameWithoutExtension(filename); 23if (System.IO.Path.GetFileName(f) != System.IO.Path.GetFileName(filename))
TempFiles\TempDirectory.cs (6)
36string dir = System.IO.Path.Combine(basePath, Guid.NewGuid().ToString()); 60string filePath = System.IO.Path.Combine(_path, name); 70string filePath = System.IO.Path.Combine(_path, name); 80string filePath = System.IO.Path.Combine(_path, name ?? System.IO.Path.GetFileName(originalPath)); 91string dirPath = System.IO.Path.Combine(_path, name);
TempFiles\TempFile.cs (2)
35prefix = System.IO.Path.GetFileName(callerSourcePath) + "_" + callerLineNumber.ToString() + "_"; 38_path = System.IO.Path.Combine(directory ?? TempRoot.Root, prefix + Guid.NewGuid() + (extension ?? ".tmp"));
TempFiles\TempRoot.cs (5)
22var tempDirectory = new DirectoryInfo(Path.GetTempPath()); 43var relativePath = Path.GetRelativePath(parentDirectory.FullName, tempDirectory.FullName); 45tempDirectory = new DirectoryInfo(Path.GetFullPath(Path.Combine(realPath, relativePath))); 50Root = Path.Combine(tempDirectory.FullName, "RoslynTests");
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);
TestHelpers.cs (3)
205=> Path.Combine(Path.GetTempPath(), suffix); 211public static string GetRootedPath(params string[] relativePath) => Path.Combine([Root, .. relativePath]);
Microsoft.CodeAnalysis.Threading.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.UnitTests (35)
AnalyzerAssemblyLoaderTests.cs (13)
276var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".dll"); 341var analyzerPath = Path.Combine(tempDir.CreateDirectory("a").Path, "analyzer.dll"); 454var assemblyFileName = Path.ChangeExtension(Path.GetFileNameWithoutExtension(originalSatelliteFullPath), ".dll"); 456var assemblyDir = Path.GetDirectoryName(originalSatelliteFullPath)!; 457var cultureInfo = CultureInfo.GetCultureInfo(Path.GetFileName(assemblyDir)); 458assemblyDir = Path.GetDirectoryName(assemblyDir)!; 461var assemblyPath = Path.Combine(assemblyDir, assemblyFileName); 1786var name = Path.GetFileNameWithoutExtension(TestFixture.Delta1); 1809var name = Path.GetFileNameWithoutExtension(TestFixture.Delta1); 1822Assert.Equal([Path.GetFileNameWithoutExtension(TestFixture.Delta1)], resolver.CalledFor.Select(x => x.Name));
Analyzers\AnalyzerFileReferenceTests.cs (4)
66var path1 = Path.Combine(TempRoot.Root, "dir"); 67var path2 = Path.Combine(TempRoot.Root, "dir", "..", "dir"); 164AnalyzerFileReference reference = CreateAnalyzerFileReference(Path.Combine(TempRoot.Root, "random.dll")); 482var generatorPath = Path.Combine(directory.Path, $"generator_{targetFramework}.dll");
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));
FileUtilitiesTests.cs (3)
209Assert.Equal(expected, Path.GetExtension(path)); 215Assert.Equal(expected, Path.GetFileNameWithoutExtension(path)); 221Assert.Equal(expected, Path.ChangeExtension(path, extension));
ShadowCopyAnalyzerPathResolverTests.cs (9)
55var analyzerPath = Path.Combine(TempRoot.CreateDirectory().Path, "analyzer.dll"); 63var analyzerPath = Path.Combine(TempRoot.CreateDirectory().Path, "analyzer.dll"); 78var analyzer1Path = Path.Combine(dir, "analyzer1.dll"); 80var analyzer2Path = Path.Combine(dir, "analyzer2.dll"); 84Assert.Equal(Path.GetDirectoryName(shadow1Path), Path.GetDirectoryName(shadow2Path)); 101var groupDir = Path.Combine(dir, groupName, "analyzers"); 103var filePath = Path.Combine(groupDir, name); 104File.WriteAllText(filePath, $"{Path.GetFileName(groupName)}-{name}");
SourceFileResolverTest.cs (1)
23if (Path.DirectorySeparatorChar == '/')
Microsoft.CodeAnalysis.Workspaces (89)
Diagnostics\DiagnosticDataLocation.cs (1)
90return Path.GetFullPath(combined);
Rename\ConflictEngine\MutableConflictResolution.cs (5)
95var extension = Path.GetExtension(document.Name); 96var newName = Path.ChangeExtension(ReplacementText, extension); 106var newDocumentFilePath = Path.Combine(directory, newName); 120newName = Path.ChangeExtension(nameWithoutExtension, extension); 121newDocumentFilePath = Path.Combine(directory, newName);
Serialization\AbstractOptionsSerializationService.cs (1)
162var strongNameProvider = new DesktopStrongNameProvider([], Path.GetTempPath());
Serialization\SerializationExtensions.cs (1)
39.WithStrongNameProvider(new DesktopStrongNameProvider(GetStrongNameKeyPaths(info), Path.GetTempPath()));
Shared\TestHooks\AsynchronousOperationListener+DiagnosticAsyncToken.cs (1)
32public override string ToString() => $"{Name} {Path.GetFileName(FilePath)} {LineNumber}";
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (5)
85var fullDirectoryPath = Path.GetDirectoryName(resolvedPath) ?? throw new ArgumentException(message: null, paramName: nameof(resolvedPath)); 118var assemblyPath = Path.Combine(directory, simpleName + ".dll"); 134var analyzerFileName = Path.ChangeExtension(simpleName, ".dll"); 135var analyzerFilePath = Path.Combine(directory, analyzerFileName); 204var assemblyPath = Path.Combine(Directory, unmanagedDllName + ".dll");
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (4)
307var assemblyFileName = Path.GetFileName(assemblyFilePath); 308var satelliteAssemblyName = Path.ChangeExtension(assemblyFileName, ".resources.dll"); 309var path = Path.GetDirectoryName(assemblyFilePath); 317var filePath = Path.Combine(path, cultureInfo.Name, satelliteAssemblyName);
src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (12)
81if (!Path.IsPathRooted(baseDirectory)) 92ShadowDirectory = Path.Combine(BaseDirectory, shadowDirectoryName); 124string name = Path.GetFileName(subDirectory).ToLowerInvariant(); 189var analyzerShadowPath = Path.Combine(analyzerShadowDir, Path.GetFileName(originalAnalyzerPath)); 203var satelliteFileName = Path.GetFileName(satelliteFilePath); 204var satelliteDirectoryName = Path.GetFileName(Path.GetDirectoryName(satelliteFilePath)); 205var shadowSatellitePath = Path.Combine(analyzerShadowDir, satelliteDirectoryName!, satelliteFileName); 215var originalDirName = Path.GetDirectoryName(analyzerFilePath)!; 217return Path.Combine(ShadowDirectory, shadowDirName); 258var directory = Path.GetDirectoryName(shadowCopyPath);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Storage\AbstractPersistentStorageService.cs (1)
109IOUtilities.PerformIO(() => Directory.Delete(Path.GetDirectoryName(databaseFilePath)!, recursive: true));
Storage\SQLite\v2\SQLitePersistentStorage.cs (3)
148var directoryName = Path.GetDirectoryName(databaseFilePath); 152Path.Combine(directoryName, LockFile), 158var directory = Path.GetDirectoryName(databaseFilePath);
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
64return Path.Combine(workingFolderPath, StorageExtension, nameof(v2), PersistentStorageFileName);
Utilities\WorkspacePathUtilities.cs (2)
35/// such that <see cref="Path.GetFileNameWithoutExtension(string?)"/> would throw. 44return IOUtilities.PerformIO(() => Path.GetFileNameWithoutExtension(document.Name));
Workspace\CommandLineProject.cs (10)
47var strongNameProvider = new DesktopStrongNameProvider(commandLineArguments.KeyFileSearchPaths, Path.GetTempPath()); 111Path.GetFileNameWithoutExtension(commandLineArguments.OutputFileName) : "<anonymous>"; 151var absolutePath = Path.IsPathRooted(fileArg.Path) || string.IsNullOrEmpty(projectDirectory) 152? Path.GetFullPath(fileArg.Path) 153: Path.GetFullPath(Path.Combine(projectDirectory, fileArg.Path)); 158var folderRoot = isWithinProject ? Path.GetDirectoryName(relativePath) : ""; 160var name = Path.GetFileName(relativePath); 189private static readonly char[] s_folderSplitters = [Path.DirectorySeparatorChar]; 193var directory = Path.GetDirectoryName(path);
Workspace\Host\Documentation\DocumentationProviderServiceFactory.cs (1)
36assemblyPath = Path.ChangeExtension(assemblyPath, "xml");
Workspace\Host\Metadata\IAnalyzerAssemblyLoaderProvider.cs (2)
55Path.Combine(Path.GetTempPath(), nameof(Roslyn), "AnalyzerAssemblyLoader"),
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (1)
21public string DatabaseDirectory => Path.GetDirectoryName(DatabaseFile) ?? throw ExceptionUtilities.UnexpectedValue(DatabaseFile);
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (4)
39private static readonly ImmutableArray<char> s_invalidPathChars = [.. Path.GetInvalidPathChars(), '/']; 51s_cacheDirectory = Path.Combine(appDataFolder, "Microsoft", "VisualStudio", "Roslyn", "Cache"); 73return Path.Combine( 81var fileName = Path.GetFileName(fullPath);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (3)
87referenceDirectories.Add(Path.Combine(dotnetRoot, "packs")); 92referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies", "Microsoft", "Framework")); 93referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "dotnet", "packs"));
Workspace\ProjectSystem\IFileChangeWatcher.cs (2)
34if (!path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) 36path += System.IO.Path.DirectorySeparatorChar;
Workspace\ProjectSystem\ProjectSystemProject.cs (4)
207var rootPath = Path.GetDirectoryName(filePath); 1136fullPath = Path.GetFullPath(fullPath); 1193private static string CreateDirectoryPathFragment(params string[] paths) => Path.Combine([" ", .. paths, " "]).Trim(); 1196fullPath.LastIndexOf(Path.DirectorySeparatorChar);
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (3)
133_commandLineArgumentsForCommandLine = _commandLineParserService.Parse(arguments, Path.GetDirectoryName(_project.FilePath), isInteractive: false, sdkDirectory: null); 174.WithStrongNameProvider(new DesktopStrongNameProvider([.. _commandLineArgumentsForCommandLine.KeyFileSearchPaths.WhereNotNull()], Path.GetTempPath())); 192? Path.Combine(_commandLineArgumentsForCommandLine.OutputDirectory, _commandLineArgumentsForCommandLine.OutputFileName)
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);
MSBuild\MSBuildProjectLoader.cs (7)
174var solutionDir = Path.GetDirectoryName(absoluteSolutionPath)!; 348_directory = Path.GetDirectoryName(logFilePath) ?? "."; 349_filename = Path.GetFileNameWithoutExtension(logFilePath) is { Length: > 0 } fileName 352_extension = Path.GetExtension(logFilePath) is { Length: > 0 } extension 362? Path.Combine(_directory, _filename + _extension) 363: Path.Combine(_directory, $"{_filename}-{suffix}{_extension}"); 365return Path.GetFullPath(newPath);
MSBuild\MSBuildProjectLoader.Worker.cs (6)
192var projectName = Path.GetFileNameWithoutExtension(projectPath) ?? string.Empty; 202var projectDirectory = Path.GetDirectoryName(projectPath); 237.WithStrongNameProvider(new DesktopStrongNameProvider(commandLineArgs.KeyFileSearchPaths, Path.GetTempPath())) 306var assemblyName = Path.GetFileNameWithoutExtension(projectFilePath); 369private static readonly char[] s_directorySplitChars = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
MSBuild\MSBuildWorkspace.cs (10)
171return Path.GetFullPath(FileUtilities.ResolveRelativePath(path, baseDirectoryPath) ?? path); 471var fileName = Path.ChangeExtension(info.Name, extension); 474? Path.Combine(Path.Combine([.. info.Folders]), fileName) 477var fullPath = GetAbsolutePath(relativePath, Path.GetDirectoryName(project.FilePath)!); 500var dir = Path.GetDirectoryName(fullPath); 567s_frameworkRoot = Path.GetDirectoryName(runtimeDir); // back out one directory level to be root path of all framework versions 601var fileName = identity != null ? identity.Name : Path.GetFileNameWithoutExtension(peRef.FilePath); 606var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(CurrentSolution.GetRequiredProject(projectId).FilePath)!, peRef.FilePath); 607var fileName = Path.GetFileNameWithoutExtension(peRef.FilePath);
MSBuild\ProjectFileExtensionRegistry.cs (2)
50var extension = Path.GetExtension(projectFilePath); 64_diagnosticReporter.Report(mode, string.Format(WorkspacesResources.Cannot_open_project_0_because_the_file_extension_1_is_not_associated_with_a_language, projectFilePath, Path.GetExtension(projectFilePath)));
MSBuild\SolutionFileReader.cs (1)
52var baseDirectory = Path.GetDirectoryName(solutionFilePath);
MSBuild\SolutionFileReader.SolutionFilterReader.cs (5)
20return Path.GetExtension(filename).Equals(".slnf", StringComparison.OrdinalIgnoreCase); 30var solutionPath = solution.GetProperty("path").GetString()?.Replace('\\', Path.DirectorySeparatorChar); 31if (solutionPath is null || Path.GetDirectoryName(filterFilename) is not string baseDirectory) 47baseDirectory = Path.GetDirectoryName(solutionFilename)!; 54var projectPath = project.GetString()?.Replace('\\', Path.DirectorySeparatorChar);
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (20)
MSBuild\ProjectFile\ProjectFile.cs (1)
131var fileName = Path.GetFileNameWithoutExtension(filePath);
MSBuild\ProjectFile\ProjectInstanceReader.cs (1)
186=> !Path.GetFileName(item.ItemSpec).StartsWith("TemporaryGeneratedFile_", StringComparison.Ordinal);
NetCoreBuildHost.cs (1)
29WorkingDirectory = Path.GetDirectoryName(projectOrSolutionFilePath),
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (10)
MonoMSBuildDiscovery.cs (9)
23=> Contract.ThrowIfTrue(Path.DirectorySeparatorChar == '\\'); 36.Split(Path.PathSeparator) 77.Select(p => Path.Combine(p, "mono")) 115var monoDirPath = Path.GetDirectoryName(monoRuntimePath)!; 117var monoLibDirPath = Path.Combine(monoDirPath, "..", "lib", "mono"); 118monoLibDirPath = Path.GetFullPath(monoLibDirPath); 141var monoMSBuildDirPath = Path.Combine(monoLibDirPath, "msbuild"); 142var monoMSBuildDir = new DirectoryInfo(Path.GetFullPath(monoMSBuildDirPath)); 178var monoMSBuildPath = Path.Combine(monoMSBuildDirectory, "Microsoft.Build.dll");
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (70)
DefaultBinLogPathProviderTests.cs (8)
19private static string RelativeLogDirectory => $".{Path.DirectorySeparatorChar}logs"; 20private static string LogDirectory => Path.GetFullPath(RelativeLogDirectory); 27var logPath = Path.Combine(RelativeLogDirectory, LogFileName + LogExtension); 35var logPath = Path.Combine(LogDirectory, LogFileName); 43var provider = new BinLogPathProvider(LogDirectory + Path.DirectorySeparatorChar); 56var newLogDirectory = Path.GetDirectoryName(newLogPath); 57var newLogFileName = Path.GetFileNameWithoutExtension(newLogPath); 58var newLogExtension = Path.GetExtension(newLogPath);
MSBuildWorkspaceTestBase.cs (1)
150Assert.Equal("EmittedCSharpProject.dll", Path.GetFileName(p1.OutputFilePath));
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");
NewlyCreatedProjectsFromDotNetNew.cs (8)
39var globalJsonPath = Path.Combine(GetSolutionFolder(), "global.json"); 184return Path.Combine(projectDirectory, $"{projectName}.{projectExtension}"); 229var tempGlobalJsonPath = Path.Combine(outputDirectory, "global.json"); 239binlogPath = Path.Combine(helixDumpFolder, Path.ChangeExtension(Path.GetFileName(projectFilePath), ".binlog")); 241binlogPath = Path.ChangeExtension(projectFilePath, ".binlog"); 281var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe");
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"),
SolutionGeneration.cs (1)
299AddXElement(xmlElement, "Name", Path.GetFileNameWithoutExtension(projectReference.ProjectName));
Utilities\DotNetSdkMSBuildInstalled.cs (1)
18var solution = Path.Combine(GetSolutionFolder(), "Roslyn.slnx");
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));
WorkspaceTestBase.cs (4)
31=> Path.DirectorySeparatorChar == '/' ? path.Replace('\\', '/') : path; 38return Path.Combine(this.SolutionDirectory.Path, NormalizePath(relativeFileName)); 48var subdirectory = Path.GetDirectoryName(normalizedPath); 49var fileName = Path.GetFileName(normalizedPath);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (8)
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
38private static string GetGeneratedFileName(string path) => $"{Path.GetFileNameWithoutExtension(path)}.generated";
Options\OptionsTestInfo.cs (1)
29var fileName = Path.GetFileNameWithoutExtension(file);
SolutionUtilities.cs (1)
116assemblyPath: Path.Combine(TempRoot.Root, name),
Workspaces\AbstractTestHostProject.cs (1)
25outputFilePath = Path.GetDirectoryName(projectFilePath);
Workspaces\TestHostProject`1.cs (1)
312return CompilationOptions == null ? "" : Path.Combine(GetTestOutputDirectory(projectFilePath), subdir, AssemblyName + GetDefaultExtension(CompilationOptions.OutputKind));
Workspaces\TestWorkspace_XmlConsumption.cs (2)
197var documentFilePath = Path.Combine(projectOutputDir, "obj", typeof(SingleFileTestGenerator).Assembly.GetName().Name, typeof(SingleFileTestGenerator).FullName, name); 676var filePath = resolveFilePath is null or true ? Path.Combine(TestWorkspace.RootDirectory, fileName) : fileName;
Workspaces\TestWorkspace_XmlCreation.cs (1)
43file, Path.Combine(folders, GetDefaultTestSourceDocumentName(index++, extension)), folders: folders, parseOptions: parseOptions, isMarkup: isMarkup));
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));
CommandLineProject\CommandLineProjectWorkspaceTests.cs (3)
56var commandLine = $"goo.cs {Path.Combine("subdir", "bar.cs")} /out:goo.dll /target:library"; 71Assert.Equal(Path.Combine(baseDir, "goo.cs"), gooDoc.FilePath); 76Assert.Equal(Path.Combine(baseDir, "subdir", "bar.cs"), barDoc.FilePath);
GeneratedCodeRecognitionTests.cs (1)
83var document = project.AddDocument(fileName, "", filePath: Path.Combine(TestHelpers.GetRootedPath(), fileName));
SolutionTests\MetadataServiceTests.cs (1)
54var nonExistentPath = Path.Combine(TempRoot.Root, Guid.NewGuid().ToString() + ".dll");
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));
SolutionTests\SolutionWithSourceGeneratorTests.cs (4)
43var generatedFilesOutputDir = Path.Combine(TempRoot.Root, "gendir"); 44var assemblyPath = Path.Combine(TempRoot.Root, "assemblyDir", "assembly.dll"); 69Assert.Equal(Path.Combine(generatedFilesOutputDir, generatorType.Assembly.GetName().Name!, generatorType.FullName!, "Test.generated.cs"), generatedTree.FilePath); 1467var analyzerPath = Path.Combine(tempDirectory.Path, "Microsoft.CodeAnalysis.TestAnalyzerReference.dll");
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);
UtilityTest\XmlDocumentationProviderTests.cs (1)
20var roslynCompilersXmlFilePath = Path.ChangeExtension(roslynCompilersLocation, ".xml");
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Data.Analysis.Tests (7)
DataFrame.IOTests.cs (1)
1338Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "/";
test\Microsoft.ML.TestFramework\BaseTestClass.cs (6)
39DataDir = Path.Combine(RootDir, "test", "data"); 57OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput"); 108return Path.GetFullPath(Path.Combine(DataDir, name)); 115return Path.GetFullPath(Path.Combine(DataDir, subDir, name));
Microsoft.DotNet.Arcade.Sdk (20)
src\CheckRequiredDotNetVersion.cs (1)
44var globalJsonPath = Path.Combine(RepositoryRoot, "global.json");
src\DownloadFile.cs (1)
72Directory.CreateDirectory(Path.GetDirectoryName(DestinationPath));
src\ExtractNgenMethodList.cs (2)
82var outputFileName = $"{Path.GetFileNameWithoutExtension(AssemblyFilePath)}-{outputFileNameSuffix}.ngen.txt"; 83var outputFilePath = Path.Combine(OutputDirectory, outputFileName);
src\GenerateSourcePackageSourceLinkTargetsFile.cs (4)
37Directory.CreateDirectory(Path.GetDirectoryName(OutputPath)); 99return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 103=> EndsWithSeparator(path) ? path : path + Path.DirectorySeparatorChar;
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)
src\LocateDotNet.cs (6)
45var globalJsonPath = Path.Combine(RepositoryRoot, "global.json"); 70var fileName = (Path.DirectorySeparatorChar == '\\') ? "dotnet.exe" : "dotnet"; 71var dotNetDir = paths.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(p => File.Exists(Path.Combine(p, fileName))); 73if (dotNetDir == null || !Directory.Exists(Path.Combine(dotNetDir, "sdk", sdkVersion))) 79DotNetPath = Path.GetFullPath(Path.Combine(dotNetDir, fileName));
src\SaveItems.cs (1)
45string path = Path.GetDirectoryName(File);
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);
GenerateResxSourceTests.cs (4)
28var resx = Path.Combine(AppContext.BaseDirectory, "testassets", "Resources", "TestStrings.resx"); 29var actualFile = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 45var expectedFile = Path.Combine(AppContext.BaseDirectory, "testassets", "Resources", expectedFileName);
GenerateSourcePackageSourceLinkTargetsFileTests.cs (1)
19path.Replace('\\', Path.DirectorySeparatorChar);
GetLicenseFilePathTests.cs (3)
18var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 20var licensePath = Path.Combine(dir, licenseFileName);
RepoWithConditionalProjectsToBuildTests.cs (1)
44var nupkgFiles = Directory.GetFiles(Path.Combine(app.WorkingDirectory, "artifacts", "packages", "Debug", "Shipping"), "*.nupkg");
Utilities\TestApp.cs (7)
23_logOutputDir = Path.Combine(logOutputDir, Path.GetFileName(workDir)); 101CopyRecursive(Path.Combine(WorkingDirectory, "artifacts", "log"), _logOutputDir); 112var destFileName = Path.Combine(destDir, srcFileName.Substring(srcDir.Length).TrimStart(new[] { Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar })); 113Directory.CreateDirectory(Path.GetDirectoryName(destFileName));
Utilities\TestProjectFixture.cs (7)
35_testAssets = Path.Combine(AppContext.BaseDirectory, "testassets"); 36_boilerPlateDir = Path.Combine(_testAssets, "boilerplate"); 41var testAppFiles = Path.Combine(_testAssets, name); 42var instanceName = Path.GetRandomFileName(); 43var tempDir = Path.Combine(Path.GetTempPath(), "arcade", instanceName); 55var pkgRoot = Path.Combine(nugetRoot, package, pkgVersion);
Microsoft.DotNet.ArcadeAzureIntegration (2)
AzureCliCredentialWithAzNoUpdateWrapper.cs (1)
62fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
DefaultIdentityTokenCredential.cs (1)
132var tokenFileName = Path.GetTempFileName();
Microsoft.DotNet.ArcadeLogging (1)
PipelinesLogger.cs (1)
290projectFile = Path.GetFileName(projectFile);
Microsoft.DotNet.Baselines.Tasks (8)
CreateUpdatePR.cs (3)
90if (string.IsNullOrEmpty(TargetDirectory) || Path.IsPathRooted(TargetDirectory)) 107TargetDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar),
PRCreator.cs (5)
108string path = Path.Combine(relativePath, item.Path); 123Path = Path.GetRelativePath(targetDirectory, path), 249string originalFileName = Path.GetFileName(ParseUpdatedFileName(filePath)); 320var groups = items.GroupBy(item => Path.GetDirectoryName(item.Path)); 332Path = path == string.Empty ? item.Path : Path.GetRelativePath(path, item.Path),
Microsoft.DotNet.Build.Manifest.Tests (14)
BuildModelFactoryTests.cs (12)
99var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 102string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}"; 104string bopSnupkgExpectedId = $"assets/symbols/{Path.GetFileName(bopSnupkg)}"; 228var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 350var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.zip")); 387var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 433var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 436string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}"; 438string bopSnupkgExpectedId = $"assets/symbols/{Path.GetFileName(bopSnupkg)}"; 483string tempXmlFile = Path.GetTempFileName(); 582var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 585string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}";
TestInputs\TestInputs.cs (2)
12return Path.Combine( 13Path.GetDirectoryName(typeof(TestInputs).Assembly.Location),
Microsoft.DotNet.Build.Tasks.Feed (28)
src\BlobFeedAction.cs (1)
82string fileName = Path.GetFileName(item.ItemSpec);
src\common\AzureStorageUtils.cs (1)
173var fileExtension = Path.GetExtension(filePath).ToLowerInvariant();
src\common\GeneralUtils.cs (1)
195var extension = Path.GetExtension(assetId).ToUpper();
src\common\LatestLinksManager.cs (2)
139blobIdWithoutVersions = Path.GetFileName(blobIdWithoutVersions); 142return Path.Combine(latestLinkShortUrlPrefix, blobIdWithoutVersions).Replace("\\", "/");
src\ConfigureInputFeed.cs (1)
30string nugetConfigLocation = Path.Combine(RepoRoot, "NuGet.config");
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);
src\PublishBuildToMaestro.cs (3)
142string mergedManifestPath = Path.Combine(GetAzDevStagingDirectory(), MergedManifestFileName); 683string id = $"assets/manifests/{repoName}/{buildNumber}/{Path.GetFileName(manifestFileName)}"; 698mergedManifestAsset.PipelineArtifactPath = Path.GetFileName(manifestFileName);
src\PublishSignedAssets.cs (2)
81string packagesFolder = Path.Combine(assetsFolder, "packages"); 97string localPackagePath = Path.Combine(packagesFolder, $"{package.Id}.{package.Version}.nupkg");
Microsoft.DotNet.Build.Tasks.Feed.Tests (16)
DownloadFileTests.cs (8)
55var testFile = Path.Combine("Symbols", _testTextFile); 124var testFile = Path.Combine("Symbols", _testTextFile); 193var testFile = Path.Combine("Symbols", _testTextFile); 196Content = new ByteArrayContent(TestInputs.ReadAllBytes(Path.Combine("Symbols", _testTextFile))) 201Content = new ByteArrayContent(TestInputs.ReadAllBytes(Path.Combine("Symbols", _testSymbolPackage))) 272var testFile = Path.Combine("Symbols", _testTextFile); 328var testFile = Path.Combine("Symbols", _testTextFile); 402var testFile = Path.Combine("Symbols", _testTextFile);
GeneralTests.cs (3)
130var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.zip")); 138var content = TestInputs.ReadAllBytes(Path.Combine("Nupkgs", $"{feedResponseContentName}.zip")); 163var testPackageName = Path.Combine("Nupkgs", "test-package-a.zip");
PublishArtifactsInManifestTests.cs (3)
121var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV3.xml")); 147var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV4.xml")); 282var testPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg"));
src\Microsoft.DotNet.Build.Manifest.Tests\TestInputs\TestInputs.cs (2)
12return Path.Combine( 13Path.GetDirectoryName(typeof(TestInputs).Assembly.Location),
Microsoft.DotNet.Build.Tasks.Installers (78)
src\CreateLightCommandPackageDrop.cs (8)
32string packageDropOutputFolder = Path.Combine(LightCommandWorkingDir, Path.GetFileName(InstallerFile)); 54var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(WixProjectFile)); 56commandString.Append($" -wixprojectfile {Path.GetFileName(WixProjectFile)}"); 60commandString.Append($" -contentsfile {Path.GetFileName(ContentsFile)}"); 64commandString.Append($" -outputsfile {Path.GetFileName(OutputsFile)}"); 68commandString.Append($" -builtoutputsfile {Path.GetFileName(BuiltOutputsFile)}");
src\CreateMD5SumsFile.cs (1)
41string relativePath = file.ItemSpec.Substring(RootDirectory.Length).TrimStart(Path.DirectorySeparatorChar).Replace('\\', '/');
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);
src\RpmBuilder.cs (3)
276baseNames.Add(Path.GetFileName(file.Name)); 277string dirName = Path.GetDirectoryName(file.Name)!; 336if (file.Name.StartsWith("usr/share/doc") && Path.GetFileName(file.Name) == "copyright")
Microsoft.DotNet.Build.Tasks.Packaging (63)
CreateTrimDependencyGroups.cs (2)
163string fileName = Path.GetFileName(compileAsset); 165if (!runtimeAssets.Any(r => Path.GetFileName(r).Equals(fileName, StringComparison.OrdinalIgnoreCase)))
GenerateNuSpec.cs (3)
119var directory = Path.GetDirectoryName(OutputFileName); 262Target = f.GetMetadata(Metadata.FileTarget).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar),
GenerateRuntimeDependencies.cs (1)
138string destRuntimeFileDir = Path.GetDirectoryName(destRuntimeFilePath);
GetApplicableAssetsFromPackages.cs (3)
207string pdbPath = Path.ChangeExtension(packageItem.SourcePath, ".pdb"); 210var pdbItem = new TaskItem(Path.ChangeExtension(packageItem.OriginalItem.ItemSpec, ".pdb")); 216pdbItem.SetMetadata("TargetPath", Path.ChangeExtension(packageItem.TargetPath, ".pdb"));
GetLayoutFiles.cs (5)
128var destination = Path.Combine(DestinationDirectory, subfolder, Path.GetFileName(source)); 137var symbolSource = Path.ChangeExtension(source, symbolExtension); 142var symbolDestination = Path.Combine(DestinationDirectory, subfolder, Path.GetFileName(symbolSource));
HarvestPackage.cs (11)
252version = VersionUtility.GetAssemblyVersion(Path.Combine(packagePath, refAssm))?.ToString() ?? version; 327harvestPackagePath = remappedTargetPath + '/' + Path.GetFileName(packageFile); 339targetPaths.Add(additionalTargetPath + '/' + Path.GetFileName(packageFile)); 406if (livePackageFiles.TryGetValue(Path.ChangeExtension(livePackagePath, ".pdb"), out livePdbFile)) 429var targetPath = Path.GetDirectoryName(livePackagePath).Replace('\\', '/'); 472var candidateFolder = Path.Combine(packageFolder, packageId, packageVersion); 480candidateFolder = Path.Combine(packageFolder, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant()); 544probePath = NormalizePath(Path.GetDirectoryName(probePath))) 561probePath = NormalizePath(Path.GetDirectoryName(probePath))) 580var parts = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
NuGetAssetResolver.cs (2)
105int dirLength = contentItem.Path.LastIndexOf(Path.AltDirectorySeparatorChar); 151return Path.GetFileName(path) == PlaceHolderFile;
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)));
PackageIndex.cs (4)
71result.IndexSources.Add(Path.GetFullPath(packageIndexFile)); 78string directory = Path.GetDirectoryName(path); 194var assemblyName = Path.GetFileNameWithoutExtension(file); 205string targetFrameworkMoniker = Path.GetFileName(frameworkDir);
PackageItem.cs (5)
31IsDll = Path.GetExtension(SourcePath).Equals(".dll", StringComparison.OrdinalIgnoreCase); 48string sourceFile = Path.GetFileName(SourcePath); 49if (!Path.GetExtension(TargetPath).Equals(Path.GetExtension(sourceFile), StringComparison.OrdinalIgnoreCase) || 52TargetPath = Path.Combine(TargetPath, sourceFile);
PackageReport.cs (1)
34string directory = Path.GetDirectoryName(path);
UpdatePackageIndex.cs (7)
121.Select(nuspec => Path.GetDirectoryName(nuspec)); 210var version = NuGetVersion.Parse(Path.GetFileName(path)); 211var id = Path.GetFileName(Path.GetDirectoryName(path)); 221var dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct(); 244var dlls = reader.GetFiles().Where(f => Path.GetExtension(f).Equals(".dll", StringComparison.OrdinalIgnoreCase)); 257dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct().ToArray();
ValidateFrameworkPackage.cs (2)
41var testAssetsByName = testAssets.Where(a => Path.GetExtension(a.PackagePath) == ".dll") 42.ToDictionary(a => Path.GetFileNameWithoutExtension(a.PackagePath), a => a);
ValidatePackage.cs (4)
328string fileName = Path.GetFileName(implementationAssembly.PackagePath); 344Path.GetFileName(i.PackagePath).Equals(fileName, StringComparison.OrdinalIgnoreCase) && 437var moduleNames = allDlls.Select(d => Path.GetFileNameWithoutExtension(d.LocalPath)); 450return !String.IsNullOrWhiteSpace(path) && Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase);
Microsoft.DotNet.Build.Tasks.Packaging.Tests (5)
HarvestPackageTests.cs (5)
65candidate != Path.GetPathRoot(candidate); 66candidate = Path.GetDirectoryName(candidate)) 68string packagesCandidate = Path.Combine(candidate, "packages"); 70string packageFolder = Path.Combine(packagesCandidate, packageId, packageVersion); 71string packageFolderLower = Path.Combine(packagesCandidate, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant());
Microsoft.DotNet.Build.Tasks.Templating (2)
GenerateFileFromTemplate.cs (2)
59ResolvedOutputPath = Path.GetFullPath(OutputPath.Replace('\\', '/')); 71Directory.CreateDirectory(Path.GetDirectoryName(ResolvedOutputPath));
Microsoft.DotNet.Build.Tasks.Templating.Tests (11)
GenerateFileFromTemplateTests.cs (11)
16string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 17string filePath = Path.Combine(tempDir, "Directory.Build.props"); 43string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 44string filePath = Path.Combine(tempDir, "Directory.Build.props"); 68string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 69string filePath = Path.Combine(tempDir, "Directory.Build.props"); 90return Path.Combine( 91Path.GetDirectoryName(typeof(GenerateFileFromTemplateTests).Assembly.Location),
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
OptProf\GenerateTrainingInputFiles.cs (6)
81string vsixFilePath = Path.Combine(InsertionDirectory, product.Name); 118var configurationsDir = Path.Combine(OutputDirectory, test.Container, "Configurations"); 123WriteEntries(ibcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 133WriteEntries(filteredIbcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 147string basePath = Path.Combine(outDir, entry.RelativeDirectoryPath.Replace("\\", "") + Path.GetFileNameWithoutExtension(entry.RelativeInstallationPath));
OptProf\GenerateTrainingPropsFile.cs (1)
52var outputFilePath = Path.Combine(OutputDirectory, outputFileNameNoExt + ".props");
OptProf\IbcEntry.cs (4)
48ngenApplicationPath: Path.Combine(VSInstallationRootVar, args.InstrumentationExecutable.Replace("/", "\\"))); 59string ext = Path.GetExtension(filePath); 65=> Path.GetFileNameWithoutExtension(filePath).EndsWith(".resources"); 80select new IbcEntry(fileName, filePath, relativeDirectoryPath: Path.GetDirectoryName(fileName), DefaultNgenApplication);
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"));
OptProf\GenerateTrainingPropsFileTests.cs (6)
15var temp = Path.GetTempPath(); 16var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 27var actual = File.ReadAllText(Path.Combine(dir, "dotnet.roslyn.props")); 43var temp = Path.GetTempPath(); 44var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 55var actual = File.ReadAllText(Path.Combine(dir, "ProfilingInputs.props"));
OptProf\GetRunSettingsSessionConfigurationTests.cs (4)
415var temp = Path.GetTempPath(); 416var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 419var configPath = Path.Combine(dir, "OptProf.json"); 422var bootstrapperPath = Path.Combine(dir, "BootstrapperInfo.json");
Microsoft.DotNet.Build.Tasks.Workloads (61)
CreateVisualStudioWorkload.wix.cs (1)
156Log.LogMessage(MessageImportance.Low, $"Setting {nameof(_supportsMachineArch)} to {manifestPackage.SupportsMachineArch} for {Path.GetFileName(manifestPackage.PackageFileName)}");
EmbeddedTemplates.cs (1)
41string destinationPath = Path.Combine(destinationFolder, destinationFilename);
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";
Msi\MsiPayloadPackageProject.wix.cs (1)
37ProjectSourceDirectory = Path.Combine(SourceDirectory, "msiPackage", platform, package.Id);
Msi\MsiProperties.wix.cs (2)
107Payload = Path.GetFileName(path), 115string msiJsonPath = Path.ChangeExtension(path, ".json");
Msi\WorkloadManifestMsi.wix.cs (11)
26protected override string BaseOutputName => Path.GetFileNameWithoutExtension(Package.PackagePath); 50string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 51string packageDataDirectory = Path.Combine(Package.DestinationDirectory, "data"); 66foreach (var file in Directory.GetFiles(packageDataDirectory).Select(f => Path.GetFullPath(f))) 68NuGetPackageFiles[file] = @"\data\extractedManifest\" + Path.GetFileName(file); 77jsonContentWxs = Path.Combine(WixSourceDirectory, "JsonContent.wxs"); 80jsonDirectory = Path.Combine(WixSourceDirectory, "json"); 83string jsonFullPath = Path.GetFullPath(Path.Combine(jsonDirectory, "WorkloadPackGroups.json")); 101NuGetPackageFiles[jsonFullPath] = @"\data\extractedManifest\" + Path.GetFileName(jsonFullPath); 157ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
Msi\WorkloadPackGroupMsi.wix.cs (2)
40string packageContentWxs = Path.Combine(WixSourceDirectory, $"PackageContent.{pack.Id}.wxs"); 143string msiFileName = Path.Combine(outputPath, OutputName);
Msi\WorkloadPackMsi.wix.cs (2)
31string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 77ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
Msi\WorkloadSetMsi.wix.cs (4)
20protected override string BaseOutputName => Path.GetFileNameWithoutExtension(_package.PackagePath); 32string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 33string packageDataDirectory = Path.Combine(_package.DestinationDirectory, "data"); 74ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
ProjectTemplateBase.cs (1)
62public string SourceDirectory => Path.Combine(BaseIntermediateOutputPath, "src");
Swix\ComponentSwixProject.cs (3)
39ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{component.SdkFeatureBand}", 40$"{Path.GetRandomFileName()}"); 79Path.Combine(base.GetRelativePackagePath(), "_package.json");
Swix\MsiSwixProject.wix.cs (4)
83ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{sdkFeatureBand}", Id, Platform); 104return Path.Combine(relativePath, Path.GetFileName(_msi.ItemSpec)); 115using StreamWriter msiWriter = File.CreateText(Path.Combine(ProjectSourceDirectory, "msi.swr"));
Swix\PackageGroupSwixProject.wix.cs (2)
41ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{packageGroup.SdkFeatureBand}", 42$"{Path.GetRandomFileName()}");
Swix\SwixProjectBase.cs (1)
52protected string SwixDirectory => Path.Combine(SourceDirectory, "swix");
Utils.cs (2)
47return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
VisualStudioWorkloadTaskBase.wix.cs (2)
67protected string MsiOutputPath => Path.Combine(BaseOutputPath, "msi"); 72protected string PackageRootDirectory => Path.Combine(BaseIntermediateOutputPath, "pkg");
WorkloadManifestPackage.wix.cs (3)
110string primaryManifest = Path.Combine(DestinationDirectory, "data", ManifestFileName); 111string secondaryManifest = Path.Combine(DestinationDirectory, ManifestFileName); 128return WorkloadManifestReader.ReadWorkloadManifest(Path.GetFileNameWithoutExtension(workloadManifestFile), File.OpenRead(workloadManifestFile), workloadManifestFile);
WorkloadPackageBase.cs (10)
203DestinationDirectory = Path.Combine(destinationBaseDirectory, Path.GetRandomFileName()); 206PackageFileName = Path.GetFileNameWithoutExtension(packagePath); 239File.Copy(PackagePath, Path.Combine(DestinationDirectory, Path.GetFileName(PackagePath)), overwrite: true); 247Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "_rels")); 248Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "package")); 250Utils.DeleteFile(Path.Combine(DestinationDirectory, ".signature.p7s")); 251Utils.DeleteFile(Path.Combine(DestinationDirectory, "[Content_Types].xml")); 252Utils.DeleteFile(Path.Combine(DestinationDirectory, $"{Id}.nuspec"));
WorkloadPackPackage.wix.cs (2)
71string sourcePackage = Path.Combine(packageSource, $"{pack.AliasTo[rid]}.{pack.Version}.nupkg"); 99yield return (Path.Combine(packageSource, $"{pack.Id}.{pack.Version}.nupkg"), CreateVisualStudioWorkload.SupportedPlatforms);
WorkloadSetPackage.wix.cs (3)
100string dataDirectory = Path.Combine(DestinationDirectory, "data"); 118if (!Path.GetFileName(file).EndsWith("workloadset.json")) 120Log?.LogWarning(string.Format(Strings.WarnNonWorkloadSetFileFound, Path.GetFileName(file)));
Microsoft.DotNet.Build.Tasks.Workloads.Tests (83)
CreateVisualStudioWorkloadSetTests.cs (7)
22string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WLS"); 31new TaskItem(Path.Combine(TestAssetsPath, "microsoft.net.workloads.9.0.100.9.0.100-baseline.1.23464.1.nupkg")) 71string msiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(workloadSetSwixItem.ItemSpec), "msi.swr")); 82string packageGroupSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(workloadSetPackageGroupSwixItem.ItemSpec), "packageGroup.swr"));
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");
PackageTests.cs (4)
20string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 22TaskItem manifestPackageItem = new(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.300.6.0.22.nupkg")); 46string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "wls-pkg"); 48ITaskItem workloadSetPackageItem = new TaskItem(Path.Combine(TestAssetsPath, "microsoft.net.workloads.9.0.100.9.0.100-baseline.1.23464.1.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);
SwixPackageGroupTests.cs (4)
25string destinationBaseDirectory = Path.Combine(BaseIntermediateOutputPath, destinationDirectory); 26TaskItem manifestPackageItem = new(Path.Combine(TestAssetsPath, manifestPackageFilename)); 37string packageGroupSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(packageGroupItem.ItemSpec), "packageGroup.swr"));
SwixPackageTests.cs (5)
44string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, Path.GetRandomFileName()); 45string packagePath = Path.Combine(TestAssetsPath, $"microsoft.ios.templates.{packageVersion}.nupkg"); 62string msiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "msi.swr"));
TestBase.cs (10)
11public static readonly string BaseIntermediateOutputPath = Path.Combine(AppContext.BaseDirectory, "obj", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 12public static readonly string BaseOutputPath = Path.Combine(AppContext.BaseDirectory, "bin", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 14public static readonly string MsiOutputPath = Path.Combine(BaseOutputPath, "msi"); 15public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets"); 17public static readonly string WixToolsetPath = Path.Combine(TestAssetsPath, "wix"); 19public static readonly string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg");
Microsoft.DotNet.CMake.Sdk (11)
src\CreateCMakeFileApiQuery.cs (2)
28string queryDir = Path.Combine(CMakeOutputDir, ".cmake", "api", "v1", "query", "client-Microsoft.DotNet.CMake.Sdk"); 31string queryFile = Path.Combine(queryDir, "codemodel-v2");
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)
Analyzers\PinvokeAnalyzer.cs (2)
30_allowedPinvokeFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzer_", StringComparison.OrdinalIgnoreCase) >= 0); 31_exceptionFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzerExceptionList.analyzerdata", StringComparison.OrdinalIgnoreCase) >= 0);
Microsoft.DotNet.GenAPI (1)
GenAPITask.cs (1)
290return File.CreateText(Path.Combine(outFilePath, filename));
Microsoft.DotNet.GenFacades (6)
GenPartialFacadeSourceGenerator.cs (3)
37string[] distinctSeeds = seeds.Select(seed => Path.GetFullPath(seed)).Distinct().ToArray(); 38string[] seedNames = distinctSeeds.Select(seed => Path.GetFileName(seed)).ToArray(); 151AddTypeToTable(typeTable, type, Path.GetFileName(assembly));
RoslynBuildTask.cs (3)
45Assembly asm = loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{name.Name}.dll")); 55loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisCsharpName}.dll")) : 56loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisName}.dll"));
Microsoft.DotNet.Helix.JobSender (3)
Payloads\AdhocPayload.cs (3)
21$"Names of files to upload have to be distinct. The following name repeats at least once: {Path.GetFileName(duplicateName)}", 38string name = Path.GetFileName(file); 55duplicateName = files.FirstOrDefault(file => !filesSeen.Add(Path.GetFileName(file).ToLowerInvariant()));
Microsoft.DotNet.Helix.JobSender.Tests (1)
Payloads\ArchivePayloadTests.cs (1)
19var archiveFile = Path.GetTempFileName();
Microsoft.DotNet.Helix.Sdk (16)
CommandPayload.cs (3)
23var dir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"))); 56var scriptFile = new FileInfo(Path.Combine(Directory.FullName, name));
CreateXHarnessAndroidWorkItems.cs (1)
107string apkName = Path.GetFileName(apkPath);
CreateXHarnessAppleWorkItems.cs (1)
102appFolderPath = appFolderPath.TrimEnd(Path.DirectorySeparatorChar);
CreateXUnitV3WorkItems.cs (1)
104string assemblyName = Path.GetFileName(targetPath);
CreateXUnitWorkItems.cs (1)
108string assemblyName = Path.GetFileName(targetPath);
DownloadFromResultsContainer.cs (6)
52DirectoryInfo directory = Directory.CreateDirectory(Path.Combine(OutputDirectory, JobId)); 53using (FileStream stream = File.Open(Path.Combine(directory.FullName, MetadataFile), FileMode.Create, FileAccess.Write)) 77DirectoryInfo destinationDir = Directory.CreateDirectory(Path.Combine(directoryPath, workItemName)); 82string destinationFile = Path.Combine(destinationDir.FullName, file); 86Directory.CreateDirectory(Path.Combine(destinationDir.FullName, Path.GetDirectoryName(file)));
InstallDotNetTool.cs (2)
99ToolPath = Path.Combine(DestinationPath, Name, Version); 106string versionInstallPath = Path.Combine(ToolPath, ".store", Name.ToLowerInvariant(), version);
ProvisioningProfileProvider.cs (1)
44private static readonly Regex s_topLevelAppPattern = new("^[^" + Regex.Escape(new string(Path.GetInvalidFileNameChars())) + "]+\\.app/.+");
Microsoft.DotNet.Helix.Sdk.Tests (4)
HelpersTests.cs (2)
48string target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") ?? Environment.GetEnvironmentVariable("TEMP") ?? Environment.GetEnvironmentVariable("TMPDIR"), "my-test-file-123456.snt"); 54target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_PAYLOAD"), "my-test-file-123456.snt");
InstallDotNetToolTests.cs (2)
25private static readonly string s_installedPath = Path.Combine(InstallPath, ToolName, ToolVersion); 172Path.Combine(InstallPath, ToolName, ToolVersion),
Microsoft.DotNet.Internal.SymbolHelper (21)
SymbolUploadHelper.cs (16)
83_workingDir = workingDir ?? Path.GetTempPath(); 186string packageName = Path.GetFileName(packagePath); 207string packageName = Path.GetFileName(package); 292string entryPath = Path.Combine(packageExtractDir, entry.FullName); 293_ = Directory.CreateDirectory(Path.GetDirectoryName(entryPath)!); 307manifest = Path.Combine(packageExtractDir, "correlatedSymKeysManifest.json"); 348string extension = Path.GetExtension(relativeFilePath); 368string pePath = Path.ChangeExtension(file, ".dll"); 372pePath = Path.ChangeExtension(file, ".exe"); 381string convertedPdbPath = Path.Combine(convertedPdbFolder, Path.GetFileName(file)); 399private static string GetConvertedPdbFolder(string filesDir) => Path.Combine(filesDir, ConversionFolderName); 403string tempDir = Path.Combine(_workingDir, Path.GetRandomFileName()); 406tempDir = Path.Combine(_workingDir, Path.GetRandomFileName());
SymbolUploadHelperFactory.cs (5)
46installDirectory ??= Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 158string zipFilePath = Path.Combine(installDirectory, "symbol.zip"); 170private static string GetSymbolToolPathFromInstallDir(string installDirectory) => Path.Combine(installDirectory, "symbol.exe");
Microsoft.DotNet.MacOsPkg.Core (16)
AppBundle.cs (4)
26if (Path.GetExtension(path) == ".app") 28bool containsAppBundleContents = Directory.Exists(Path.Combine(path, "Contents")) && 29File.Exists(Path.Combine(path, "Contents", "Info.plist")); 41return Path.GetExtension(path) == ".app";
Package.cs (9)
63string packageName = Path.Combine(dstPath, package.Value.Substring(1)); 64string tempDest = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 183string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 195Path.GetFullPath(Utilities.FindInPath("Payload", searchPath, isDirectory, searchOption: SearchOption.TopDirectoryOnly) 207string full_path = Path.GetFullPath(inputPath);
Utilities.cs (3)
12Path.GetExtension(path).Equals(".pkg"); 15Path.GetExtension(path).Equals(".app"); 37string? parent = Path.GetDirectoryName(path);
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)
src\NuGetVersionUpdater.cs (4)
66tempDirectoryOpt = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 116tempPathOpt = Path.Combine(tempDirectoryOpt, Guid.NewGuid().ToString()); 370string finalPath = Path.Combine(outDirectory, package.Id + "." + package.NewVersion + ".nupkg");
src\ReplacePackageParts.cs (3)
110string tempPackagePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 224NewPackage = Path.Combine(DestinationFolder, packageId + "." + packageVersion + ".nupkg");
src\UpdatePackageVersionTask.cs (1)
78File.WriteAllLines(Path.Combine(OutputDirectory, "PreReleaseDependencies.txt"), preReleaseDependencies.Distinct());
Microsoft.DotNet.NuGetRepack.Tests (41)
ReplacePackagePartsTests.cs (4)
18var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 22File.WriteAllBytes(originalNupkgPath = Path.Combine(dir, TestResources.MiscPackages.NameSigned), TestResources.MiscPackages.Signed); 25File.WriteAllText(replacementFilePath = Path.Combine(dir, "Replacement.txt"), "<replacement>");
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)
OpenApiAddFileTests.cs (2)
46Assert.Contains($"The project '{Path.Combine(_tempDir.Root, csproj)}' does not exist.", _error.ToString()); 113var absolute = Path.GetFullPath(nswagJsonFile, project.Project.Dir().Root);
OpenApiAddProjectTests.cs (2)
71run = app.Execute(new[] { "add", "project", Path.Combine(csproj.Path, "..", "refProj.csproj") }); 96var refProjFile = Path.Join(refProj.Root, $"{refProjName}.csproj");
OpenApiAddURLTests.cs (16)
37var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 70var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 103var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 136var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 168var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 200var firstJsonFile = Path.Combine(_tempDir.Root, firstExpectedJsonName); 228var secondJsonFile = Path.Combine(_tempDir.Root, secondExpectedJsonName); 260var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 292var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 308var run = app.Execute(new[] { "add", "url", FakeOpenApiUrl, "--output-file", Path.Combine("outputdir", "file.yaml") }); 312var expectedJsonName = Path.Combine("outputdir", "file.yaml"); 324var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 340var outputFile = Path.Combine("outputdir", "file.yaml"); 345var expectedJsonName = Path.Combine("outputdir", "file.yaml"); 357var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 442var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName);
OpenApiRefreshTests.cs (3)
25var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json"); 55var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json"); 83var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json");
OpenApiRemoveTests.cs (10)
32var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 47csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 56Assert.False(File.Exists(Path.Combine(_tempDir.Root, nswagJsonFile))); 75var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 90csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 118var refProjFile = Path.Join(refProj.Root, $"{refProjName}.csproj"); 124using (var csprojStream = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")).OpenRead()) 138using (var csprojStream = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")).OpenRead()) 177var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 186Assert.False(File.Exists(Path.Combine(_tempDir.Root, nswagJsonFile)));
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
Microsoft.DotNet.PackageTesting (5)
VerifyClosure.cs (3)
100otherFiles.Add(Path.GetFileName(file)); 107var fileName = Path.GetFileName(assemblyInfo.Path); 108var existingFileName = Path.GetFileName(existingInfo.Path);
VerifyTypes.cs (2)
105var fileName = Path.GetFileName(assemblyInfo.Path); 106var existingFileName = Path.GetFileName(existingInfo.Path);
Microsoft.DotNet.RemoteExecutor (16)
Program.cs (1)
104Directory.SetCurrentDirectory(Path.GetTempPath());
RemoteExecutor.cs (10)
12using IOPath = System.IO.Path; 65if (!IOPath.GetFileName(HostRunner).Equals(hostName, StringComparison.OrdinalIgnoreCase)) 67string runtimePath = IOPath.GetDirectoryName(typeof(object).Assembly.Location); 76string dotnetExe = IOPath.Combine(directory, hostName); 89HostRunnerName = IOPath.GetFileName(HostRunner); 91static string GetDirectoryName(string path) => string.IsNullOrEmpty(path) ? string.Empty : IOPath.GetDirectoryName(path); 531string tempFile = System.IO.Path.GetTempFileName(); 533string devConfigFile = System.IO.Path.ChangeExtension(configFile, "dev.json"); 650.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".runtimeconfig.json")) 655.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".deps.json"))
RemoteInvokeHandle.cs (2)
157string miniDmpPath = Path.Combine(uploadPath, $"{Process.Id}.{Path.GetRandomFileName()}.dmp");
RemoteInvokeOptions.cs (3)
37public string ExceptionFile { get; } = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Microsoft.DotNet.SetupNugetSources.Tests (41)
BoundaryConditionTests.cs (8)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 44var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 72var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 101var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 119var nonExistentPath = Path.Combine(_testOutputDirectory, "nonexistent.config"); 141var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 170var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
CredentialHandlingTests.cs (7)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 48var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 86var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 128var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 160var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 198var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
FeedEnablingTests.cs (7)
19_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 53var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 93var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 127var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 160var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 193var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
InternalFeedAdditionTests.cs (5)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 54var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 87var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 124var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
NoChangeScenarioTests.cs (4)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 49var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 73var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
ScriptRunner.cs (2)
30var scriptPath = Path.Combine(_repoRoot, "eng", "common", "SetupNugetSources.ps1"); 43var scriptPath = Path.Combine(_repoRoot, "eng", "common", "SetupNugetSources.sh");
SetupNugetSourcesFixture.cs (8)
21var scaffoldRoot = Path.Combine(AppContext.BaseDirectory, "RepoScaffold"); 27RepoRoot = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTestRepo", Guid.NewGuid().ToString()); 37var relative = Path.GetRelativePath(sourceDir, dir); 38Directory.CreateDirectory(Path.Combine(destinationDir, relative)); 43var relative = Path.GetRelativePath(sourceDir, file); 44var destPath = Path.Combine(destinationDir, relative); 45Directory.CreateDirectory(Path.GetDirectoryName(destPath)!);
Microsoft.DotNet.SharedFramework.Sdk (17)
src\CreateFrameworkListFile.cs (5)
84Filename = Path.GetFileName(item.ItemSpec), 119string path = Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/'); 171new XAttribute("Culture", Path.GetFileName(Path.GetDirectoryName(path)))); 260Directory.CreateDirectory(Path.GetDirectoryName(TargetFile));
src\FileUtilities.cs (1)
34if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
src\GeneratePlatformManifestEntriesFromTemplate.cs (2)
32var files = Files.ToLookup(file => Path.GetFileName(file.ItemSpec)).ToDictionary(l => l.Key, l=> l.First()); 50var entryTemplateExtension = Path.GetExtension(entryTemplate.ItemSpec);
src\GenerateSharedFrameworkDepsFile.cs (3)
62string fileName = Path.GetFileName(filePath); 68resourceAssemblies.Add(new ResourceAssembly(Path.Combine(cultureMaybe, fileName), cultureMaybe)); 115var depsFilePath = Path.Combine(IntermediateOutputPath, depsFileName);
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (3)
100otherFiles.Add(Path.GetFileName(file)); 107var fileName = Path.GetFileName(assemblyInfo.Path); 108var existingFileName = Path.GetFileName(existingInfo.Path);
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
105var fileName = Path.GetFileName(assemblyInfo.Path); 106var existingFileName = Path.GetFileName(existingInfo.Path);
src\ValidateFileVersions.cs (1)
30var fileName = Path.GetFileName(file.ItemSpec);
Microsoft.DotNet.SignCheckLibrary (75)
Interop\StructuredStorage.cs (3)
118string storageFullName = Path.Combine(storageDir, storageName + storageExtension); 146string path = Path.Combine(dir, (string)record["Name"]); 148if (path.IndexOfAny(Path.GetInvalidPathChars()) == -1)
Logging\FileLogger.cs (6)
43Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(messageFile))); 52Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(errorFile))); 62Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(resultsFile)));
Utils.cs (2)
206string keyPath = Path.Combine(tempDir, Path.GetFileName(keyUrl));
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\DebVerifier.cs (2)
30signableContent = Path.Combine(tempDir, "signableContent"); 85string entryPath = Path.Combine(workingDir, archiveEntry.RelativePath);
Verification\Exclusions.cs (3)
160var values = new[] { path, containerPath, virtualPath, Path.GetFileName(path), Path.GetFileName(containerPath), Path.GetFileName(virtualPath) };
Verification\ExeVerifier.cs (4)
44var payloadPath = Path.Combine(svr.VirtualPath, Path.GetFileName(file)); 45SignatureVerificationResult bundleEntryResult = VerifyFile(Path.GetFullPath(file), svr.Filename, payloadPath, Path.GetFileName(file));
Verification\FileVerifier.cs (2)
124string extension = Path.GetExtension(path); 165Log.WriteMessage(LogVerbosity.Detailed, String.Format(SignCheckResources.ProcessingFile, Path.GetFileName(path), String.IsNullOrEmpty(parent) ? SignCheckResources.NA : parent));
Verification\Jar\JarFile.cs (3)
100a => String.Equals(Path.GetExtension(a.FullName), ".SF", StringComparison.OrdinalIgnoreCase) && 181where (String.Equals(Path.GetExtension(entry.FullName), ".SF", StringComparison.OrdinalIgnoreCase) && 188string baseFilename = Path.GetFileNameWithoutExtension(file.FullName);
Verification\Jar\JarSignatureFile.cs (3)
93BaseFilename = Path.GetFileNameWithoutExtension(signatureFilename); 183if (String.Equals(Path.GetExtension(SignatureBlockFilePath), ".RSA", StringComparison.OrdinalIgnoreCase)) 188if (String.Equals(Path.GetExtension(SignatureBlockFilePath), ".DSA", StringComparison.OrdinalIgnoreCase))
Verification\LZMAUtils.cs (1)
19string destinationDir = Path.GetDirectoryName(destinationFile);
Verification\LzmaVerifier.cs (3)
30string destinationFile = Path.Combine(tempPath, Path.GetFileNameWithoutExtension(path)); 35svr.NestedResults.Add(VerifyFile(destinationFile, parent, Path.Combine(svr.VirtualPath, destinationFile), containerPath: null));
Verification\MachOVerifier.cs (3)
149string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
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);
Verification\MspVerifier.cs (1)
31svr.NestedResults.Add(VerifyFile(file, svr.Filename, Path.Combine(svr.VirtualPath, file), containerPath: null));
Verification\MsuVerifier.cs (2)
35string cabFileFullName = Path.GetFullPath(cabFile); 36SignatureVerificationResult cabEntryResult = VerifyFile(cabFile, svr.Filename, Path.Combine(svr.VirtualPath, cabFile), cabFileFullName);
Verification\PgpVerifier.cs (5)
49string signatureDocument = Path.Combine(tempDir, Path.GetFileName(signature)); 62string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Verification\PkgVerifier.cs (4)
37string extractionPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 47var relativePath = path.Substring(extractionPath.Length + 1).Replace(Path.DirectorySeparatorChar, '/');
Verification\PortableExecutableVerifier.cs (1)
46svr.IsIgnoreStrongName = Exclusions.IsIgnoreStrongName(Path.GetFileName(svr.VirtualPath), parent, svr.VirtualPath, null);
Verification\RpmVerifier.cs (2)
50string signatureDocument = Path.Combine(tempDir, "signableContent"); 51string signableContent = Path.Combine(tempDir, "pgpSignableContent");
Verification\SignatureVerificationManager.cs (4)
138result = fileVerifier.VerifySignature(file, parent: null, virtualPath: Path.GetFileName(file)); 142result = SignatureVerificationResult.ErrorResult(file, parent: null, virtualPath: Path.GetFileName(file), e); 198string extension = Path.GetExtension(path); 258if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "nuspec", StringComparison.OrdinalIgnoreCase)))
Verification\SignatureVerificationResult.cs (5)
198_tempPath = Path.Combine(Path.GetTempPath(), "SignCheck", Path.GetRandomFileName()); 212Filename = Path.GetFileName(path); 213FullPath = Path.GetFullPath(path);
Microsoft.DotNet.SignCheckTask (15)
src\SignCheck.cs (12)
21private static readonly string _appData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SignCheck"); 211string downloadPath = Path.Combine(_appData, Path.GetFileName(uriResult.LocalPath)); 218string fileSearchPath = Path.GetDirectoryName(inputFile); 219string fileSearchPattern = Path.GetFileName(inputFile); 277else if (File.Exists(Path.GetFullPath(inputFile))) 296inputFiles.Remove(Path.GetFullPath(Options.ErrorLogFile)); 301inputFiles.Remove(Path.GetFullPath(Options.LogFile)); 432Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(Options.ExclusionsOutput))); 488string downloadPath = Path.Combine(_appData, Path.GetFileName(uri.LocalPath));
src\SignCheckTask.cs (1)
130if (Path.IsPathRooted(checkFile))
src\Utils.cs (2)
17var directoryPath = Path.GetDirectoryName(path); 18var directory = Path.GetFileName(path);
Microsoft.DotNet.SignTool (101)
src\BatchSignUtil.cs (3)
158Path.GetExtension(fileInfo.FullPath) == ".exe").ToArray(); 168var workingDirectory = Path.Combine(_signTool.TempDir, "engines"); 173string engineFileName = $"{Path.Combine(workingDirectory, $"{engineContainer}", file.FileName)}{SignToolConstants.MsiEngineExtension}";
src\Configuration.cs (10)
127_pathToContainerUnpackingDirectory = Path.Combine(tempDir, "ContainerSigning"); 156var fileUniqueKey = new SignedFileContentKey(contentHash, Path.GetFileName(itemToSign.FullPath)); 312var extension = Path.GetExtension(file.FileName); 817Debug.Assert(Path.GetExtension(archivePath) == ".zip"); 838var fileUniqueKey = new SignedFileContentKey(entry.ContentHash, Path.GetFileName(entry.RelativePath)); 845packages.Add(Path.GetFileName(archivePath)); 850var fileName = Path.GetFileName(entry.RelativePath); 855string tempPath = Path.Combine(_pathToContainerUnpackingDirectory, extractPathRoot, entry.RelativePath); 858Directory.CreateDirectory(Path.GetDirectoryName(tempPath)); 904return _itemsToSkip3rdPartyCheck != null && _itemsToSkip3rdPartyCheck.Contains(Path.GetFileName(fileName));
src\FileSignInfo.cs (22)
29=> Path.GetExtension(path) == ".deb"; 32=> Path.GetExtension(path) == ".rpm"; 35=> Path.GetExtension(path) == ".exe" || Path.GetExtension(path) == ".dll"; 38=> Path.GetExtension(path).Equals(".vsix", StringComparison.OrdinalIgnoreCase); 41=> Path.GetExtension(path).Equals(".mpack", StringComparison.OrdinalIgnoreCase); 44=> Path.GetExtension(path).Equals(".nupkg", StringComparison.OrdinalIgnoreCase); 48=> Path.GetExtension(path).Equals(".pkg", StringComparison.OrdinalIgnoreCase); 52=> Path.GetExtension(path).Equals(".app", StringComparison.OrdinalIgnoreCase); 58=> Path.GetExtension(path).Equals(".zip", StringComparison.OrdinalIgnoreCase); 61=> Path.GetExtension(path).Equals(".tgz", StringComparison.OrdinalIgnoreCase) 62|| (Path.GetExtension(path).Equals(".gz", StringComparison.OrdinalIgnoreCase) 63&& Path.GetExtension(Path.GetFileNameWithoutExtension(path)).Equals(".tar", StringComparison.OrdinalIgnoreCase)); 66=> (Path.GetExtension(path).Equals(".msi", StringComparison.OrdinalIgnoreCase) 67|| Path.GetExtension(path).Equals(".wixlib", StringComparison.OrdinalIgnoreCase)); 70=> Path.GetExtension(path).Equals(".ps1", StringComparison.OrdinalIgnoreCase) 71|| Path.GetExtension(path).Equals(".psd1", StringComparison.OrdinalIgnoreCase) 72|| Path.GetExtension(path).Equals(".psm1", StringComparison.OrdinalIgnoreCase); 107|| Path.GetExtension(FileName).Equals(".exe", StringComparison.OrdinalIgnoreCase)); 111(Path.GetExtension(FileName).Equals(".exe", StringComparison.OrdinalIgnoreCase) || 112Path.GetExtension(FileName).Equals(".msi", StringComparison.OrdinalIgnoreCase));
src\PathWithHash.cs (1)
38FileName = Path.GetFileName(fullPath);
src\SignTool.cs (17)
97archive.CreateEntryFromFile(file.FullPath, Path.GetFileName(file.FullPath)); 114Arguments = $"-V -xk \"{item.Value}\" \"{Path.GetDirectoryName(item.Key)}\"", 128ZipFile.ExtractToDirectory(item.Value, Path.GetDirectoryName(item.Key), true); 137var dir = Path.Combine(_args.TempDir, "Signing"); 152var signProjectPath = Path.Combine(dir, $"Round{round}-Sign.proj"); 155status = RunMSBuild(buildEngine, signProjectPath, Path.Combine(_args.LogDir, $"{signingLogName}.binlog"), Path.Combine(_args.LogDir, $"{signingLogName}.log"), Path.Combine(_args.LogDir, $"{signingLogName}.error.log")); 184var notarizeProjectPath = Path.Combine(dir, $"Round{round}-Notarize.proj"); 201Path.Combine(_args.LogDir, $"{notarizeLogName}.binlog"), 202Path.Combine(_args.LogDir, $"{notarizeLogName}.log"), 203Path.Combine(_args.LogDir, $"{notarizeLogName}.error.log"), 278AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "Microsoft.VisualStudioEng.MicroBuild.Core.props")}"" />"); 307AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "Microsoft.VisualStudioEng.MicroBuild.Core.targets")}"" />"); 315var zipFilePath = Path.Combine(Path.GetDirectoryName(fullPath), Path.GetFileName(fullPath) + ".zip");
src\SignToolTask.cs (6)
202if (!Path.IsPathRooted(TempDir)) 371if (!Path.IsPathRooted(itemToSign.ItemSpec)) 377var directoryParts = Path.GetFullPath(Path.GetDirectoryName(itemToSign.ItemSpec)).Split(separators); 393return string.Join(Path.DirectorySeparatorChar.ToString(), result); 431if (!extension.Equals(Path.GetExtension(extension)) && !specialExtensions.Contains(extension))
src\VerifySignatures.cs (11)
37string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 72string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 79string signableContent = Path.Combine(tempDir, "signableContent"); 80string pgpSignableContent = Path.Combine(tempDir, "pgpSignableContent"); 231string keyPath = Path.Combine(tempDir, Path.GetFileName(keyUrl)); 258string entryPath = Path.Combine(workingDir, entry.RelativePath);
src\WixPackInfo.cs (2)
33string filename = Path.GetFileName(path); 42return Path.GetFileName(path).EndsWith(WixPackExtension, StringComparison.OrdinalIgnoreCase);
src\ZipData.cs (29)
228string workingDir = Path.Combine(tempDir, "extract", workingDirGuidSegment); 229string outputDir = Path.Combine(tempDir, "output", outputDirGuidSegment); 230string createFileName = Path.Combine(workingDir, "create.cmd"); 231string outputFileName = Path.Combine(outputDir, FileSignInfo.FileName); 307string extractDir = Path.Combine(tempDir, Guid.NewGuid().ToString()); 322var relativePath = path.Substring(extractDir.Length + 1).Replace(Path.DirectorySeparatorChar, '/'); 347string extractDir = Path.Combine(tempDir, Guid.NewGuid().ToString()); 364var relativePath = path.Substring(extractDir.Length + 1).Replace(Path.DirectorySeparatorChar, '/'); 447string extractDir = Path.Combine(tempDir, Guid.NewGuid().ToString()); 468string relativePath = path.Substring(extractDir.Length + 1).Replace(Path.DirectorySeparatorChar, '/'); 488string extractDir = Path.Combine(tempDir, Guid.NewGuid().ToString()); 511string relativePath = path.Substring(extractDir.Length + 1).Replace(Path.DirectorySeparatorChar, '/'); 593string workingDir = Path.Combine(tempDir, "work", workingDirGuidSegment); 594string controlLayout = Path.Combine(workingDir, "control"); 595string dataLayout = Path.Combine(workingDir, "data"); 602string controlArchive = Path.Combine(workingDir, controlEntry.RelativePath); 608string sumsFile = Path.Combine(workingDir, "md5sums"); 622File.Copy(sumsFile, Path.Combine(controlLayout, "md5sums"), overwrite: true); 625string controlFile = Path.Combine(controlLayout, "control"); 647using FileStream fileStream = File.OpenRead(Path.Combine(controlLayout, relativeName)); 678string outputPath = Path.Join(destination, tar.Name); 679Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!); 769string workingDir = Path.Combine(tempDir, Guid.NewGuid().ToString().Split('-')[0]); 771string layout = Path.Combine(workingDir, "layout"); 778File.Copy(signedPart.FileSignInfo.FullPath, Path.Combine(layout, signedPart.RelativeName), overwrite: true); 782string payload = Path.Combine(workingDir, "payload.cpio"); 806string file = Path.Combine(workingDir, kind); 852string outputPath = Path.Combine(layout, entry.RelativePath); 853Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!);
Microsoft.DotNet.SignTool.Tests (186)
SignToolTests.cs (186)
264_tmpDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 271return Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "wix3"); 276return Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "wix", "net472", "x64"); 279private static string s_snPath = Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "sn", "sn.exe"); 280private static string s_pkgToolPath = Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "pkg", "Microsoft.Dotnet.MacOsPkg.Cli.dll"); 284var srcPath = Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "Resources", name); 290dstDir = Path.Combine(dstDir, relativePath); 294var dstPath = Path.Combine(dstDir, name); 306var dstPath = Path.Combine(_tmpDir, name); 408string tempDir = Path.Combine(_tmpDir, "verification"); 414string controlLayout = Path.Combine(tempDir, "control"); 415string dataLayout = Path.Combine(tempDir, "data"); 426string md5sumsContents = File.ReadAllText(Path.Combine(controlLayout, "md5sums")); 435string layoutFilePath = Path.Combine(dataLayout, targetSystemFilePath); 460string layoutPath = Path.Combine(dataLayout, symlinkPath); 466string resolvedTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(layoutPath)!, expectedTarget)); 473string controlFileContents = File.ReadAllText(Path.Combine(controlLayout, "control")); 480string archive = Path.Combine(destinationFolder, entry.RelativePath); 492string tempDir = Path.Combine(_tmpDir, "verification"); 495string layout = Path.Combine(tempDir, "layout"); 507string layoutFilePath = Path.Combine(layout, targetSystemFilePath); 529string layoutPath = Path.Combine(layout, symlinkPath); 535string resolvedTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(layoutPath)!, expectedTarget)); 563string tempDir = Path.Combine(_tmpDir, "verification"); 566string layout = Path.Combine(tempDir, "tgz"); 575string layoutPath = Path.Combine(layout, symlinkPath); 581string resolvedTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(layoutPath)!, expectedTarget)); 836<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, fileToTest))}""> 878$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 879$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 880$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 881$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''." 921$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerOne.dll")}' with Microsoft certificate 'ArcadeCertTest'. The library is considered 3rd party library due to its copyright: ''." 983$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "CoreLibCrossARM.dll"))}""> 986<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "AspNetCoreCrossLib.dll"))}""> 1057$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "EmptyPKT.dll")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''." 1115$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "ABCDEFG/MsiSetup.msi"))}""> 1118$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines\\0\\MsiBootstrapper.exe-engine.exe"))}""> 1121$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "MsiBootstrapper.exe"))}""> 1124$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithWix.nupkg"))}""> 1171$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/native/NativeLibrary.dll"))}""> 1174<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll"))}""> 1178<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerTwo.dll"))}""> 1182<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll"))}""> 1186<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll"))}""> 1190<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll"))}""> 1194<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netcoreapp2.0/ContainerOne.dll"))}""> 1200<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "ContainerOne.1.0.0.nupkg"))}""> 1254<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/native/NativeLibrary.dll"))}""> 1257<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll"))}""> 1261<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerTwo.dll"))}""> 1265<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll"))}""> 1269<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll"))}""> 1273<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll"))}""> 1277<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netcoreapp2.0/ContainerOne.dll"))}""> 1283<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "ContainerOne.1.0.0.nupkg"))}""> 1330<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1333<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1336<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1339<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1393$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "InnerZipFile.zip")} -> {Path.Combine(_tmpDir, "InnerZipFile.zip")}", 1394$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "InnerZipFile.zip.sig")} -> {Path.Combine(_tmpDir, "InnerZipFile.zip.sig")}" 1400<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1403<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1406<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1409<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1412<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "Mid.SOS.NETCore.dll"))}""> 1415<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "MidNativeLibrary.dll"))}""> 1420<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.zip"))}""> 1423<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.tgz"))}""> 1426<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "InnerZipFile.zip"))}""> 1465<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1504<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "Payload/SOS.NETCore.dll"))}""> 1507<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Payload/NativeLibrary.dll"))}""> 1510<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1513<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1518<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "NestedPkg.pkg.zip"))}""> 1522<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1574<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "Payload/SOS.NETCore.dll"))}""> 1577<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Payload/NativeLibrary.dll"))}""> 1580<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1583<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1589<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "NestedPkg.pkg.zip"))}""> 1593<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1600<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg"))}""> 1639<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Payload/SOS.NETCore.dll"))}""> 1642<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "Payload/NativeLibrary.dll"))}""> 1645<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1648<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1653<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "NestedPkg.pkg.zip"))}""> 1689<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Contents/Resources/libexample.dylib"))}""> 1694<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Payload", "test.app.zip"))}""> 1699<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "WithApp.pkg.zip"))}""> 1741<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "test/NativeLibrary.dll"))}""> 1744<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "test/SOS.NETCore.dll"))}""> 1747<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "test/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1750<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "test/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1791ValidateProducedTarGZipContent(Path.Combine(_tmpDir, "testSymlinks.tgz"), new[] 1826$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "0", "hardlink1.dll")}' with Microsoft certificate 'ArcadeCertTest'. The library is considered 3rd party library due to its copyright: ''.", 1827$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "1", "hardlink2.dll")}' with Microsoft certificate 'ArcadeCertTest'. The library is considered 3rd party library due to its copyright: ''.", 1828$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "2", "original.dll")}' with Microsoft certificate 'ArcadeCertTest'. The library is considered 3rd party library due to its copyright: ''.", 1834<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "hardlink1.dll"))}""> 1838<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "hardlink2.dll"))}""> 1842<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "original.dll"))}""> 1886<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1889<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1892<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1895<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1939<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1942<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1945<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1948<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1979$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "./usr/local/bin/mscorlib.dll"))}""> 1982$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.deb"))}""> 2000ValidateProducedDebContent(Path.Combine(_tmpDir, "test.deb"), expectedFilesOriginalHashes, signableFiles, expectedControlFileContent, expectedSymlinks); 2025$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.rpm"))}""> 2054$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "./usr/local/bin/mscorlib.dll"))}""> 2057$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.rpm"))}""> 2074ValidateProducedRpmContent(Path.Combine(_tmpDir, "test.rpm"), expectedFilesOriginalHashes, signableFiles, originalUncompressedPayloadChecksum, expectedSymlinks); 2242$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiSetup.msi"))}""> 2245$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines", "0", "MsiBootstrapper.exe-engine.exe"))}""> 2248$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiBootstrapper.exe"))}""> 2292$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiApplication.exe"))}""> 2295$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiSetup5.msi"))}""> 2298$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines", "0", "MsiBootstrapper5.exe-engine.exe"))}""> 2301$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiBootstrapper5.exe"))}""> 2338$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiApplication.exe"))}""> 2341$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiSetup.msi"))}""> 2355var badPath = Path.Combine(GetWixToolPath(), "badpath"); 2406<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "VisualStudio.Mac.Banana.dll"))}""> 2442$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "PackageWithRelationships.vsix")}" 2448<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "lib/net461/ProjectOne.dll"))}""> 2452<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/netstandard2.0/ProjectOne.dll"))}""> 2456<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2462<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "PackageWithRelationships.vsix"))}""> 2467<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 2503$"{Path.Combine(_tmpDir, "ContainerSigning", "4", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "PackageWithRelationships.vsix")}" 2509<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2513<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "10", "Team%20Tools/Dynamic Code Coverage/net461/ProjectOne.dll"))}""> 2517<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "11", "Team%20Tools/Dynamic Code Coverage/netstandard2.0/ProjectOne.dll"))}""> 2523<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "PackageWithRelationships.vsix"))}""> 2528<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "TestSpaces.vsix"))}""> 2566<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2570<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/net461/ProjectOne.dll"))}""> 2574<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/netstandard2.0/ProjectOne.dll"))}""> 2580<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithRelationships.vsix"))}""> 2585<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 2622$"{Path.Combine(_tmpDir, "A", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "B", "PackageWithRelationships.vsix")}" 2628<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2632<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/net461/ProjectOne.dll"))}""> 2636<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/netstandard2.0/ProjectOne.dll"))}""> 2642<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "A", "PackageWithRelationships.vsix"))}""> 2647<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 2681<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2687<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithRelationships.vsix"))}""> 2824$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "0", "Simple1.exe")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''.", 2825$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "1", "Simple2.exe")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''." 3180$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "EmptyPKT.dll")}' with Microsoft certificate 'DLLCertificate'. The library is considered 3rd party library due to its copyright: ''.", 3181$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/net461/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate3'. The library is considered 3rd party library due to its copyright: ''.", 3182$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netstandard2.0/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate4'. The library is considered 3rd party library due to its copyright: ''.", 3183$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "15", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate5'. The library is considered 3rd party library due to its copyright: ''.", 3184$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "22", "Simple.dll")}' with Microsoft certificate 'DLLCertificate2'. The library is considered 3rd party library due to its copyright: ''.", 3185$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "Simple.exe")}' with Microsoft certificate 'MacDeveloperHarden'. The library is considered 3rd party library due to its copyright: ''." 3399var tempDir = Path.GetTempPath(); 3400string workingDir = Path.Combine(tempDir, "extract", Guid.NewGuid().ToString()); 3401string outputDir = Path.Combine(tempDir, "output", Guid.NewGuid().ToString()); 3402string createFileName = Path.Combine(workingDir, "create.cmd"); 3403string outputFileName = Path.Combine(outputDir, expectedExe); 3413File.Delete(Path.Combine(workingDir, "bundle.wxs"));
Microsoft.DotNet.SourceBuild.Tasks (9)
src\UsageReport\WritePackageUsageData.cs (5)
150Directory.CreateDirectory(Path.GetDirectoryName(ProjectAssetsJsonArchiveFile)); 163using (var stream = File.OpenRead(Path.Combine(RootDir, relativePath))) 184using (var file = File.OpenRead(Path.Combine(RootDir, assetFile))) 254Directory.CreateDirectory(Path.GetDirectoryName(DataFile)); 268return path.Substring(RootDir.Length).Replace(Path.DirectorySeparatorChar, '/');
src\UsageReport\WriteUsageReports.cs (3)
102poisonNupkgFilenames.Add(Path.GetFileNameWithoutExtension(segments[1])); 162Path.Combine(OutputDirectory, "annotated-usage.xml"), 204string filename = Path.GetFileName(snapshot.Path);
src\WriteBuildOutputProps.cs (1)
75Directory.CreateDirectory(Path.GetDirectoryName(OutputPath));
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
107string fullPath = Path.Combine(outputDirectory.FullName, path);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (4)
Languages\Language.cs (4)
19public static string BasePath { get; set; } = Path.GetDirectoryName(typeof(Templates).Assembly.Location); 23string templateDirectory = Path.GetFullPath(Path.Combine( 30var relative = Path.GetFullPath(file);
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
85string fullPath = Path.Combine(outputDirectory.FullName, path);
Microsoft.DotNet.VersionTools.Cli (1)
VersionTrimmingOperation.cs (1)
45if (assets.Any(a => Path.GetExtension(a) != ".nupkg"))
Microsoft.DotNet.XliffTasks (48)
Model\Document.cs (3)
70string tempPath = Path.Combine(Path.GetDirectoryName(path), Path.GetRandomFileName());
Model\ResxDocument.cs (3)
65string resourceRelativePath = splitRelativePathAndSerializedType[0].Replace('\\', Path.DirectorySeparatorChar); 67string absolutePath = Path.Combine(Path.GetDirectoryName(sourceFullPath), resourceRelativePath);
Model\VsctDocument.cs (3)
85string resourceRelativePath = hrefAttribute.Value.Replace('\\', Path.DirectorySeparatorChar); 87string absolutePath = Path.Combine(Path.GetDirectoryName(sourceFullPath), resourceRelativePath);
Tasks\GatherTranslatedSource.cs (11)
52Path.DirectorySeparatorChar, 53Path.AltDirectorySeparatorChar 66string relativePath = Path.GetFileName(translatedFullPath); 69relativePath = Path.Combine(language, relativePath); 78string linkDirectory = Path.GetDirectoryName(link); 79link = Path.Combine(linkDirectory, relativePath); 100string logicalExtension = Path.GetExtension(logicalName); 101logicalName = Path.ChangeExtension(logicalName, $".{language}{logicalExtension}"); 111string sourceDirectory = Path.GetDirectoryName(xlf.GetMetadataOrThrow(MetadataKey.XlfSource)); 112dependentUpon = Path.GetFullPath(Path.Combine(sourceDirectory, dependentUpon));
Tasks\GatherXlf.cs (5)
58translatedFileName = Path.GetFileNameWithoutExtension(source.ItemSpec); 63string extension = Path.GetExtension(source.ItemSpec); 66Path.Combine(TranslatedOutputDirectory, language, $"{translatedFileName}{extension}") : 67Path.Combine(TranslatedOutputDirectory, $"{translatedFileName}.{language}{extension}"); 72$"Two or more source files to be translated in the same project are named {Path.GetFileName(sourceDocumentPath)}. " +
Tasks\SortXlf.cs (1)
45Directory.CreateDirectory(Path.GetDirectoryName(xlfPath));
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);
Tasks\TranslateSource.cs (2)
39Directory.CreateDirectory(Path.GetDirectoryName(translatedFullPath)); 41sourceDocument.RewriteRelativePathsToAbsolute(Path.GetFullPath(sourcePath));
Tasks\UpdateXlf.cs (1)
71Directory.CreateDirectory(Path.GetDirectoryName(xlfPath));
Tasks\XlfTask.cs (5)
92string directory = Path.GetDirectoryName(sourcePath); 93string filename = Path.GetFileNameWithoutExtension(sourcePath); 94string extension = Path.GetExtension(sourcePath); 106return Path.Combine(directory, "xlf", filename + xlfExtension); 111return $"../{Path.GetFileName(sourcePath)}";
Microsoft.DotNet.XliffTasks.Tests (7)
ResxDocumentTests.cs (3)
55string expectedAbsoluteLocation = Path.Combine( 57@"Resources\Package.ico".Replace('\\', Path.DirectorySeparatorChar)); 76Path.Combine(sourceFolder, "Resources.resx"));
VsctDocumentTests.cs (4)
77string expectedAbsoluteLocation = Path.Combine( 79@"Resources\Images.png".Replace('\\', Path.DirectorySeparatorChar)); 99Path.Combine(sourceFolder, "Resources.resx")); 119Path.Combine(Directory.GetCurrentDirectory(), "Resources.resx"));
Microsoft.Extensions.AI.Abstractions (4)
Contents\DataContent.cs (3)
175string? fileName = Path.GetFileName(filePath); 225name = Path.GetFileName(Name); 233path = path.Length == 0 ? name! : Path.Combine(path, name);
src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
739string extension = IO.Path.GetExtension(pathOrExtension);
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)
Commands\ReportCommand.cs (1)
120string? outputPath = Path.GetDirectoryName(outputFilePath);
Telemetry\DeviceIdHelper.cs (5)
91string cacheFilePath = Path.Combine(cacheFileDirectoryPath, CacheFileName); 123string cacheFilePath = Path.Combine(cacheFileDirectoryPath, CacheFileName); 141cacheFileDirectoryPath = Path.Combine(userProfilePath, ".cache"); 145cacheFileDirectoryPath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools"); 161Path.Combine(userProfilePath, "Library", "Application Support", "Microsoft", "DeveloperTools");
Telemetry\TelemetryConstants.cs (1)
135: Path.Combine(homeDirectoryPath, ".dotnet", $"{Constants.Version}.aieval.dotnetFirstUseSentinel");
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
ResultsTests.cs (3)
31Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()),
Microsoft.Extensions.AI.Evaluation.Reporting (18)
Storage\DiskBasedReportingConfiguration.cs (1)
80storageRootPath = Path.GetFullPath(storageRootPath);
Storage\DiskBasedResponseCache.cs (6)
43storageRootPath = Path.GetFullPath(storageRootPath); 46_iterationPath = Path.Combine(cacheRootPath, scenarioName, iterationName); 282=> Path.Combine(storageRootPath, "cache"); 285=> Path.Combine(keyPath, "entry.json"); 288=> Path.Combine(keyPath, "contents.data"); 292string keyPath = Path.Combine(_iterationPath, key);
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)
AzureStorage\AzureResponseCacheTests.cs (1)
35_dirClient = _fsClient?.GetDirectoryClient(Path.GetRandomFileName());
AzureStorage\AzureResultStoreTests.cs (1)
35_dirClient = _fsClient?.GetDirectoryClient(Path.GetRandomFileName());
CacheEntryTests.cs (2)
66string tempFilePath = Path.GetTempFileName(); 87string tempFilePath = Path.GetTempFileName();
DiskBased\DiskBasedResponseCacheTests.cs (3)
19string path = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.ResponseCacheTests", Path.GetRandomFileName());
DiskBased\DiskBasedResultStoreTests.cs (3)
18string path = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.ResultStoreTests", Path.GetRandomFileName());
ResultStoreTester.cs (9)
76string newExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 115string firstExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 125string secondExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 135string thirdExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 159string executionName = $"Test Execution {Path.GetRandomFileName()}"; 183string executionName0 = $"Test Execution {Path.GetRandomFileName()}"; 184string executionName1 = $"Test Execution {Path.GetRandomFileName()}"; 218string executionName = $"Test Execution {Path.GetRandomFileName()}"; 253string executionName = $"Test Execution {Path.GetRandomFileName()}";
Microsoft.Extensions.AI.OpenAI (3)
OpenAISpeechToTextClient.cs (2)
66Path.GetFileName(fileStream.Name) : // Use the file name if we can get one from the stream. 117Path.GetFileName(fileStream.Name) : // Use the file name if we can get one from the stream.
src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
739string extension = IO.Path.GetExtension(pathOrExtension);
Microsoft.Extensions.AI.Templates.Tests (21)
test\ProjectTemplates\Infrastructure\Project.cs (1)
28StartupProjectFullPath = Path.Combine(rootPath, field);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestClassFixtureBase.cs (5)
42_sandboxInstallPath = Path.Combine(_sandboxOutput, "install"); 43_sandboxProjectsPath = Path.Combine(_sandboxOutput, "projects"); 84file.CopyTo(Path.Combine(testSandbox, file.Name)); 89CopySandboxDirectory(subDir.FullName, Path.Combine(testSandbox, subDir.Name)); 95var outputFolderPath = Path.Combine(_sandboxProjectsPath, projectName);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestConfiguration.cs (3)
13private string TemplateSandboxRoot => Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, TemplatePackageName, "Sandbox"); 14public string TemplateSandboxPackages => Path.Combine(TemplateSandboxRoot, "packages"); 15public string TemplateSandboxOutput => Path.Combine(TemplateSandboxRoot, TemplateName);
test\ProjectTemplates\Infrastructure\TemplateSnapshotTestBase.cs (5)
26string workingDir = Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, templatePackageName, "Snapshots", templateName, $"{templateName}.{scenarioName}"); 35string templateLocation = Path.Combine(WellKnownPaths.LocalShippingPackagesPath, $"{templatePackageName}.*.nupkg"); 37string[]? excludePatterns = Path.DirectorySeparatorChar is '/' 39: verificationExcludePatterns?.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray(); 45SnapshotsDirectory = Path.Combine("Snapshots", templateName),
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
50if (Path.GetFileName(path).Equals("launchSettings.json", StringComparison.OrdinalIgnoreCase))
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)
GetOpenApiReferenceMetadata.cs (3)
95if (!Path.IsPathRooted(outputPath) && !string.IsNullOrEmpty(OutputDirectory)) 97outputPath = Path.Combine(OutputDirectory, outputPath); 113var outputFilename = Path.GetFileNameWithoutExtension(outputPath);
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");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
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)
GetDocumentTests.cs (52)
19private readonly string _toolsDirectory = Path.GetDirectoryName(typeof(Program).Assembly.Location); 25var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 35"--file-list", Path.Combine(outputPath.FullName, "file-list.cache") 39using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample.json"))); 51var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 61"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 66using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample.json"))); 77var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 87"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 93using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample.json"))); 104var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 114"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 119var expectedDocumentPath = Path.Combine(outputPath.FullName, "Sample_internal.json"); 126using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 138var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 148"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 154Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 155Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 156Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_invalid.json"))); 167var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 177"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 182Assert.True(File.Exists(Path.Combine(outputPath.FullName, $"{fileName}.json"))); 183Assert.True(File.Exists(Path.Combine(outputPath.FullName, $"{fileName}_internal.json"))); 184Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 185Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 194var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 204"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 211Assert.False(File.Exists(Path.Combine(outputPath.FullName, $"{fileName}.json"))); 212Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 213Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 220var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 230"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 235Assert.False(File.Exists(Path.Combine(outputPath.FullName, ".json"))); 236Assert.False(File.Exists(Path.Combine(outputPath.FullName, "_internal.json"))); 237Assert.True(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 238Assert.True(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json")));
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
Infrastructure\RedisTestConfig.cs (4)
137return Path.Combine(configFilePath, UserProfileRedisNugetPackageServerPath, RedisServerExeName); 143return Path.Combine(configFilePath, CIMachineRedisNugetPackageServerPath, RedisServerExeName); 155var tempPath = Path.GetTempPath(); 157Path.Combine(tempPath, FunctionalTestsRedisServerExeName + ".exe");
Microsoft.Extensions.Configuration.FileExtensions (4)
FileConfigurationProvider.cs (1)
116/// Loads the contents of the file at <see cref="Path"/>.
FileConfigurationSource.cs (3)
77System.IO.Path.IsPathRooted(Path) && 78System.IO.Path.GetDirectoryName(Path) is string directory) 81Path = System.IO.Path.GetFileName(Path);
Microsoft.Extensions.Configuration.UserSecrets (4)
PathHelper.cs (3)
48int badCharIndex = userSecretsId.IndexOfAny(Path.GetInvalidFileNameChars()); 79? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 80: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
UserSecretsConfigurationExtensions.cs (1)
182string? directoryPath = Path.GetDirectoryName(secretPath);
Microsoft.Extensions.DataIngestion.Abstractions (1)
src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
739string extension = IO.Path.GetExtension(pathOrExtension);
Microsoft.Extensions.DataIngestion.MarkItDown (3)
MarkItDownReader.cs (3)
106string inputFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Microsoft.Extensions.DataIngestion.Tests (13)
IngestionPipelineTests.cs (3)
32_sampleDirectory = Directory.CreateDirectory(Path.Combine("TestFiles")); 34_withTable = new(Path.Combine("TestFiles", "withTable.md")); 55_withImage = new(Path.Combine("TestFiles", "withImage.md"));
Readers\DocumentReaderConformanceTests.cs (6)
49string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName() + ".txt"); 192FileInfo file = new(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + extension));
Readers\MarkItDownMcpReaderTests.cs (3)
45var nonExistentFile = new FileInfo(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
Writers\SqliteVectorStoreWriterTests.cs (1)
13private readonly string _tempFile = Path.GetTempFileName();
Microsoft.Extensions.DependencyModel (21)
ApplicationEnvironment.cs (1)
16return Path.GetFullPath(basePath);
DependencyContextExtensions.cs (1)
112string name = Path.GetFileNameWithoutExtension(assetPath);
DependencyContextJsonReader.cs (2)
808groupRuntimeAssemblies.Where(a => Path.GetFileName(a.Path) != "_._"))); 820groupNativeLibraries.Where(a => Path.GetFileName(a.Path) != "_._")));
DependencyContextLoader.cs (2)
136string depsJsonFile = Path.ChangeExtension(assemblyLocation, DepsJsonExtension); 147depsJsonFile = Path.ChangeExtension(assemblyCodeBase, DepsJsonExtension);
Resolution\AppBaseCompilationAssemblyResolver.cs (4)
61string refsPath = Path.Combine(_basePath, RefsDirectoryName); 84string? sharedDirectory = Path.GetDirectoryName(sharedPath); 87string sharedRefs = Path.Combine(sharedDirectory, RefsDirectoryName); 100string assemblyFile = Path.GetFileName(assembly);
Resolution\PackageCompilationAssemblyResolver.cs (2)
49return listOfDirectories.Split([Path.PathSeparator], StringSplitOptions.RemoveEmptyEntries); 66return [Path.Combine(basePath, ".nuget", "packages")];
Resolution\ReferenceAssemblyPathResolver.cs (5)
69string relativeToReferenceAssemblies = Path.Combine(_defaultReferenceAssembliesPath, path); 77string name = Path.GetFileName(path); 81string fallbackFile = Path.Combine(fallbackPath, name); 105string net20Dir = Path.Combine(windir, "Microsoft.NET", "Framework", "v2.0.50727"); 146return Path.Combine(
Resolution\ResolverUtils.cs (3)
15path = Path.Combine(library.Name, library.Version); 18packagePath = Path.Combine(basePath, path); 29fullName = Path.Combine(basePath, assemblyPath);
RuntimeAssembly.cs (1)
34string assemblyName = System.IO.Path.GetFileNameWithoutExtension(path);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Linux\LinuxUtilizationParserCgroupV2.cs (1)
319FileInfo memoryUsageInBytesFile = new(Path.Combine(path, "memory.current"));
Microsoft.Extensions.FileProviders.Embedded (9)
EmbeddedFileProvider.cs (4)
24private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars() 100var everettId = MakeValidEverettIdentifier(Path.GetDirectoryName(subpath)); 110builder.Append(Path.GetFileName(subpath)); 118var name = Path.GetFileName(subpath);
Manifest\EmbeddedFilesManifest.cs (5)
15private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars() 16.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 18private static readonly char[] _separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
ManifestEmbeddedFileProviderTests.cs (6)
65var jqueryValidate = provider.GetFileInfo(Path.Combine("wwwroot", "jquery.validate.js")); 72var jqueryMin = provider.GetFileInfo(Path.Combine("wwwroot", "jquery.min.js")); 79var siteCss = provider.GetFileInfo(Path.Combine("wwwroot", "site.css")); 164var jqueryValidate = provider.GetFileInfo(Path.Combine(folder, file)); 187var jqueryValidate = provider.GetFileInfo(Path.Combine(".", "wwwroot", "jquery.validate.js")); 210var jqueryValidate = provider.GetFileInfo(Path.Combine("..", "wwwroot", "jquery.validate.js"));
Microsoft.Extensions.FileProviders.Physical (26)
Internal\PathUtils.cs (8)
14private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 15.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 30[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 35path[path.Length - 1] != Path.DirectorySeparatorChar && 36path[path.Length - 1] != Path.AltDirectorySeparatorChar) 38return path + Path.DirectorySeparatorChar;
PhysicalFileProvider.cs (7)
54if (!Path.IsPathRooted(root)) 59string fullRoot = Path.GetFullPath(root); 156string root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(Root)); 232fullPath = Path.GetFullPath(Path.Combine(Root, path)); 268if (Path.IsPathRooted(subpath)) 313if (Path.IsPathRooted(subpath))
PhysicalFilesWatcher.cs (10)
93_root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(root)); 107string watcherFullPath = PathUtils.EnsureTrailingSlash(Path.GetFullPath(fswPath)); 157if (Path.IsPathRooted(filter) || PathUtils.PathNavigatesAboveRoot(filter)) 202var pollingChangeToken = new PollingFileChangeToken(new FileInfo(Path.Combine(_root, filePath))); 320string oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1)); 663(path[path.Length - 1] == Path.DirectorySeparatorChar || 664path[path.Length - 1] == Path.AltDirectorySeparatorChar); 774current = Path.GetDirectoryName(current) ?? throw new DirectoryNotFoundException(SR.Format(SR.RootDirectoryMissing, current)); 821while (Path.Combine(watchDir, _expectedName) is var childPath && Directory.Exists(childPath)) 857string nextDir = Path.Combine(watchDir, _expectedName);
PollingWildCardChangeToken.cs (1)
171string filePath = Path.Combine(_directoryInfo.FullName, path);
Microsoft.Extensions.FileSystemGlobbing (29)
Abstractions\DirectoryInfoWrapper.cs (2)
79new DirectoryInfo(Path.Combine(_directoryInfo.FullName, name)), 89=> new FileInfoWrapper(new FileInfo(Path.Combine(_directoryInfo.FullName, name)));
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));
Internal\InMemoryFileInfo.cs (1)
16Name = Path.GetFileName(file);
MatcherExtensions.cs (2)
67result.Add(Path.GetFullPath(Path.Combine(directoryPath, match.Path)));
Microsoft.Extensions.Hosting (5)
HostBuilder.cs (3)
259if (Path.IsPathRooted(contentRootPath)) 263return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
HostingHostBuilderExtensions.cs (2)
247string sanitizedApplicationName = env.ApplicationName.Replace(Path.DirectorySeparatorChar, '_') 248.Replace(Path.AltDirectorySeparatorChar, '_');
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
NoRemoteCallHandler.cs (2)
23var assemblyFileLocation = Path.GetDirectoryName(typeof(NoRemoteCallHandler).Assembly.Location)!; 26var responseFilePath = Path.Combine(Directory.GetFiles(
NoRemoteCallNotSeekableHandler.cs (2)
26var assemblyFileLocation = Path.GetDirectoryName(typeof(NoRemoteCallHandler).Assembly.Location)!; 29var responseFilePath = Path.Combine(Directory.GetFiles(
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\Internal\NoRemoteCallHandler.cs (2)
19var assemblyFileLocation = Path.GetDirectoryName(typeof(NoRemoteCallHandler).Assembly.Location)!; 22var responseFilePath = Path.Combine(Directory.GetFiles(
Microsoft.Extensions.Localization (4)
ResourceManagerStringLocalizerFactory.cs (4)
48_resourcesRelativePath = _resourcesRelativePath.Replace(Path.AltDirectorySeparatorChar, '.') 49.Replace(Path.DirectorySeparatorChar, '.') + "."; 231.Replace(Path.DirectorySeparatorChar, '.') 232.Replace(Path.AltDirectorySeparatorChar, '.');
Microsoft.Extensions.Localization.Tests (5)
ResourceManagerStringLocalizerFactoryTest.cs (5)
67var resourceLocationAttribute = new ResourceLocationAttribute(Path.Combine("My", "Resources")); 136var resourcePath = Path.Combine("My", "Resources"); 164var resourcePath = Path.Combine("My", "Resources"); 189locOptions.ResourcesPath = Path.Combine("My", "Resources"); 269locOptions.ResourcesPath = Path.Combine("My", "Resources");
Microsoft.Extensions.Logging.AzureAppServices (4)
FileLoggerConfigureOptions.cs (1)
23options.LogDirectory = Path.Combine(_context.HomeFolder, "LogFiles", "Application");
FileLoggerProvider.cs (1)
66return Path.Combine(_path, $"{_fileName}{group.Year:0000}{group.Month:00}{group.Day:00}.txt");
SiteConfigurationProvider.cs (2)
13var settingsFolder = Path.Combine(context.HomeFolder, "site", "diagnostics"); 14var settingsFile = Path.Combine(settingsFolder, "settings.json");
Microsoft.Extensions.ML (2)
ModelLoaders\FileModelLoader.cs (2)
45var directory = Path.GetDirectoryName(filePath); 52var file = Path.GetFileName(filePath);
Microsoft.Extensions.ML.Tests (2)
FileLoaderTests.cs (1)
48loaderUnderTest.Start(Path.Combine("TestModels", "SentimentModel.zip"), false);
PredictionEnginePoolTests.cs (1)
34.FromFile(modelName: "model1", filePath: Path.Combine("TestModels", "SentimentModel.zip"), watchForChanges: false);
Microsoft.Extensions.SecretManager.Tools.Tests (39)
InitCommandTest.cs (3)
92var projectFile = Path.Combine(projectDir, "TestProject.csproj"); 104var projectFile = Path.Combine(projectDir, "TestProject.csproj"); 134string secretId = $"invalid{Path.GetInvalidPathChars()[0]}secret-id";
MsBuildProjectFinderTest.cs (1)
25Assert.Equal(Path.Combine(files.Root, filename), finder.FindMsBuildProject(null));
SecretManagerTests.cs (17)
44var project = Path.Combine(_fixture.CreateProject(id), "TestProject.csproj"); 54var project = Path.Combine(_fixture.CreateProject("<"), "TestProject.csproj"); 64var projectPath = Path.Combine(_fixture.GetTempSecretProject(), "does_not_exist", "TestProject.csproj"); 74var projectPath = Path.Combine(_fixture.GetTempSecretProject(), "does_not_exist", "TestProject.csproj"); 87secretManager.RunInternal("init", "--file", Path.Combine(dir, "app.cs")); 95var cwd = Path.Combine(projectPath, "nested1"); 99secretManager.RunInternal("list", "-p", ".." + Path.DirectorySeparatorChar, "--verbose"); 101Assert.Contains(Resources.FormatMessage_Project_File_Path(Path.Combine(cwd, "..", "TestProject.csproj")), _console.GetOutput()); 125: Path.GetTempPath(); 129? ["-f", Path.Join(projectPath, "app.cs")] 201Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput()); 208Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput()); 261Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 276Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 302: Path.GetTempPath(); 307? ["-f", Path.Join(projectPath, "app.cs")] 354var project = Path.Combine(projectPath, "TestProject.csproj");
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
TemporaryFileProvider.cs (3)
14Root = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "tmpfiles", Guid.NewGuid().ToString())).FullName; 21File.WriteAllText(Path.Combine(Root, filename), contents, Encoding.UTF8);
UserSecretsTestFixture.cs (8)
19_disposables.Push(() => TryDelete(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId)))); 63var projectPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "usersecretstest", Guid.NewGuid().ToString())); 69Path.Combine(projectPath.FullName, "TestProject.csproj"), 79var directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "usersecretstest", Guid.NewGuid().ToString())); 81File.WriteAllText(Path.Join(directory.FullName, "app.cs"), $""" 98var secretsDir = Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(userSecretsId));
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)
ValidationsGeneratorTestBase.cs (2)
87? Path.Combine(workItemRoot, "snapshots") 129var symbolsName = Path.ChangeExtension(assemblyName, "pdb");
Microsoft.Gen.BuildMetadata (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.ComplianceReports (5)
ComplianceReportsGenerator.cs (3)
36_directory = Path.GetDirectoryName(filePath); 37_fileName = Path.GetFileName(filePath); 112File.WriteAllText(Path.Combine(_directory, _fileName), report, Encoding.UTF8);
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.ComplianceReports.Unit.Tests (8)
GeneratorTests.cs (5)
62var stem = Path.GetFileNameWithoutExtension(inputFile); 67var tmp = Path.GetTempFileName(); 140var projectDir = Path.GetTempPath(); 142var fullReportPath = Path.Combine(projectDir, outputPath); 156Assert.True(File.Exists(Path.Combine(fullReportPath, "ComplianceReport.json")));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.ContextualOptions (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.Logging (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.Logging.Unit.Tests (8)
CompilationHelper.cs (3)
26string runtimeDir = Path.GetDirectoryName(corelib)!; 30refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 31refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
ParserTests.cs (1)
684.UseDirectory(Path.Combine("..", "Verified"));
ParserTests.LogProperties.cs (1)
490.UseDirectory(Path.Combine("..", "Verified"));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.MetadataExtractor (7)
MetadataReportsGenerator.cs (1)
110File.WriteAllText(Path.Combine(path, _fileName), reportStringBuilder.ToString(), Encoding.UTF8);
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (3)
36_directory = Path.GetDirectoryName(filePath); 37_fileName = Path.GetFileName(filePath); 112File.WriteAllText(Path.Combine(_directory, _fileName), report, Encoding.UTF8);
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
86File.WriteAllText(Path.Combine(path, _fileName), report, Encoding.UTF8);
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.MetadataExtractor.Unit.Tests (13)
GeneratorTests.cs (10)
79var stem = Path.GetFileNameWithoutExtension(inputFile); 80var goldenFileName = Path.ChangeExtension(stem, ".json"); 81var goldenReportPath = Path.Combine("GoldenReports", goldenFileName); 83var generatedReportPath = Path.Combine(Directory.GetCurrentDirectory(), ReportFilename); 128["build_property.MetadataReportOutputPath"] = Path.GetTempPath(), 134Assert.False(File.Exists(Path.Combine(Path.GetTempPath(), ReportFilename))); 168var projectDir = Path.GetTempPath(); 170var fullReportPath = Path.Combine(projectDir, outputPath); 184Assert.True(File.Exists(Path.Combine(fullReportPath, ReportFilename)));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.Metrics (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.Metrics.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.MetricsReports (3)
MetricsReportsGenerator.cs (1)
86File.WriteAllText(Path.Combine(path, _fileName), report, Encoding.UTF8);
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.MetricsReports.Unit.Tests (13)
GeneratorTests.cs (10)
44var stem = Path.GetFileNameWithoutExtension(inputFile); 45var goldenFileName = Path.ChangeExtension(stem, ".json"); 46var goldenReportPath = Path.Combine("GoldenReports", goldenFileName); 48var generatedReportPath = Path.Combine(Directory.GetCurrentDirectory(), ReportFilename); 89["build_property.MetricsReportOutputPath"] = Path.GetTempPath() 94Assert.False(File.Exists(Path.Combine(Path.GetTempPath(), ReportFilename))); 121var projectDir = Path.GetTempPath(); 123var fullReportPath = Path.Combine(projectDir, outputPath); 137Assert.True(File.Exists(Path.Combine(fullReportPath, ReportFilename)));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Maui (1)
Fonts\FileSystemEmbeddedFontLoader.cs (1)
56 var filePath = Path.Combine(rootPath, font.FontName!);
Microsoft.Maui.Controls (1)
Shell\ShellUriHandler.cs (1)
8using IOPath = System.IO.Path;
Microsoft.Maui.Controls.Build.Tasks (6)
DebugXamlCTask.cs (2)
8using IOPath = System.IO.Path; 24 var paths = ReferencePath.Select(p => IOPath.GetDirectoryName(p.Replace("//", "/"))).Distinct();
XamlCTask.cs (4)
13using IOPath = System.IO.Path; 116 xamlFilePath = IOPath.Combine(prefix, xamlFilePath); 182 var paths = ReferencePath.Select(p => IOPath.GetDirectoryName(p.Replace("//", "/"))).Distinct(); 202 using (var assemblyDefinition = AssemblyDefinition.ReadAssembly(IOPath.GetFullPath(Assembly), readerParameters))
Microsoft.Maui.Controls.SourceGen (10)
CodeBehindGenerator.cs (10)
286 var hintName = $"{(string.IsNullOrEmpty(Path.GetDirectoryName(projItem.TargetPath)) ? "" : Path.GetDirectoryName(projItem.TargetPath) + Path.DirectorySeparatorChar)}{Path.GetFileNameWithoutExtension(projItem.TargetPath)}.{projItem.Kind.ToLowerInvariant()}.sg.cs".Replace(Path.DirectorySeparatorChar, '_'); 633 var hintName = $"{(string.IsNullOrEmpty(Path.GetDirectoryName(projItem.TargetPath)) ? "" : Path.GetDirectoryName(projItem.TargetPath) + Path.DirectorySeparatorChar)}{Path.GetFileNameWithoutExtension(projItem.TargetPath)}.{projItem.Kind.ToLowerInvariant()}.sg.cs".Replace(Path.DirectorySeparatorChar, '_');
Microsoft.Maui.Essentials (6)
FileSystem\FileSystem.shared.cs (3)
195 if (string.IsNullOrWhiteSpace(Path.GetFileName(fullPath))) 241 var ext = Path.GetExtension(FullPath); 271 return Path.GetFileName(FullPath);
FileSystem\FileSystemUtils.shared.cs (3)
14 /// Forward and backward slashes will be replaced by <see cref="Path.DirectorySeparatorChar"/> 19 .Replace('\\', Path.DirectorySeparatorChar) 20 .Replace('/', Path.DirectorySeparatorChar);
Microsoft.Maui.Resizetizer (56)
AndroidAdaptiveIconGenerator.cs (7)
66 var dir = Path.Combine(fullIntermediateOutputPath.FullName, dpi.Path); 67 var destination = Path.Combine(dir, backgroundDestFilename); 110 var dir = Path.Combine(fullIntermediateOutputPath.FullName, dpi.Path); 111 var destination = Path.Combine(dir, foregroundDestFilename); 143 var dir = Path.Combine(fullIntermediateOutputPath.FullName, "mipmap-anydpi-v26"); 144 var adaptiveIconDestination = Path.Combine(dir, AppIconName + ".xml"); 145 var adaptiveIconRoundDestination = Path.Combine(dir, AppIconName + "_round.xml");
AppleIconAssetsGenerator.cs (4)
29 var outputAppIconSetDir = Path.Combine(IntermediateOutputPath, DpiPath.Ios.AppIconPath.Replace("{name}", AppIconName)); 30 var outputAssetsDir = Path.Combine(outputAppIconSetDir, ".."); 36 var assetContentsFile = Path.Combine(outputAssetsDir, "Contents.json"); 37 var appIconSetContentsFile = Path.Combine(outputAppIconSetDir, "Contents.json");
CreatePartialInfoPlistTask.cs (2)
34 var plistFilename = Path.Combine(IntermediateOutputPath, PlistName ?? "PartialInfo.plist"); 58 f.WriteLine($" <string>{Path.GetFileNameWithoutExtension(Storyboard)}</string>");
GeneratePackageAppxManifest.cs (1)
51 var filename = Path.Combine(IntermediateOutputPath, GeneratedFilename ?? "Package.appxmanifest");
GenerateSplashAndroidResources.cs (6)
86 var dir = Path.Combine(IntermediateOutputPath, "values"); 89 var colorsFile = Path.Combine(dir, "maui_colors.xml"); 110 var dir = Path.Combine(IntermediateOutputPath, "drawable"); 113 var drawableFile = Path.Combine(dir, "maui_splash_image.xml"); 136 var dir = Path.Combine(IntermediateOutputPath, "drawable-v31"); 139 var drawableFile = Path.Combine(dir, "maui_splash_image.xml");
GenerateSplashStoryboard.cs (2)
78 var storyboardFile = Path.Combine(IntermediateOutputPath, "MauiSplash.storyboard"); 99 var storyboardFile = Path.Combine(IntermediateOutputPath, "MauiSplash.storyboard");
GenerateTizenManifest.cs (2)
61 _tizenManifestFilePath = Path.Combine(Environment.CurrentDirectory, TizenManifestFile); 63 var targetFilename = Path.Combine(IntermediateOutputPath, GeneratedFilename);
GetMauiAssetPath.cs (9)
50 if (Path.IsPathRooted(path)) 52 path = Path.GetFullPath(path); 57 path = Path.GetFileName(path); 63 path = Path.Combine(FolderName, path); 74 path?.Replace('\\', Path.DirectorySeparatorChar)?.Replace('/', Path.DirectorySeparatorChar); 81 projectDirectory = Path.GetFullPath(projectDirectory); 82 if (!projectDirectory.EndsWith(Path.DirectorySeparatorChar.ToString())) 84 projectDirectory += Path.DirectorySeparatorChar;
ResizeImageInfo.cs (9)
22 ? Path.GetFileNameWithoutExtension(ForegroundFilename) 23 : Path.GetFileNameWithoutExtension(Filename) 24 : Path.GetFileNameWithoutExtension(Alias); 27 string.IsNullOrWhiteSpace(Alias) || !Path.HasExtension(Alias) 28 ? string.IsNullOrWhiteSpace(Filename) || !Path.HasExtension(Filename) 29 ? Path.GetExtension(ForegroundFilename) 30 : Path.GetExtension(Filename) 31 : Path.GetExtension(Alias); 54 => IsVectorExtension(Path.GetExtension(filename));
Resizer.cs (4)
41 destination = Path.ChangeExtension(destination, RasterFileExtension); 48 var destination = Path.Combine(dpi.Path, info.OutputName + (includeScale ? dpi.FileSuffix : dpi.NameSuffix) + info.OutputExtension); 53 destination = Path.Combine(fullIntermediateOutputPath.FullName, destination); 100 destination = Path.ChangeExtension(destination, RasterFileExtension);
ResizetizeImages.cs (1)
108 string itemSpec = Path.GetFullPath(img.Filename);
SkiaSharpAppIconTools.cs (1)
72 var dir = Path.GetDirectoryName(destination);
TizenResourceXmlGenerator.cs (3)
56 string outputResourceDir = Path.Combine(IntermediateOutputPath, "res"); 57 string outputContentsDir = Path.Combine(outputResourceDir, "contents"); 58 string destination = Path.Combine(outputResourceDir, "res.xml");
TizenSplashUpdater.cs (2)
30 var splashFullPath = Path.Combine(IntermediateOutputPath, splashDirectoryName); 55 UpdateColorAndMoveFile(splashInfo, GetScreenSize(resolution, orientation), destination, Path.Combine(splashFullPath, newImage));
Utils.cs (1)
16 => rxResourceFilenameValidation.IsMatch(Path.GetFileNameWithoutExtension(filename));
WindowsIconGenerator.cs (2)
27 string fileName = Path.GetFileNameWithoutExtension(Info.OutputName); 28 string destination = Path.Combine(destinationFolder, $"{fileName}.ico");
Microsoft.McpServer.ProjectTemplates.Tests (21)
test\ProjectTemplates\Infrastructure\Project.cs (1)
28StartupProjectFullPath = Path.Combine(rootPath, field);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestClassFixtureBase.cs (5)
42_sandboxInstallPath = Path.Combine(_sandboxOutput, "install"); 43_sandboxProjectsPath = Path.Combine(_sandboxOutput, "projects"); 84file.CopyTo(Path.Combine(testSandbox, file.Name)); 89CopySandboxDirectory(subDir.FullName, Path.Combine(testSandbox, subDir.Name)); 95var outputFolderPath = Path.Combine(_sandboxProjectsPath, projectName);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestConfiguration.cs (3)
13private string TemplateSandboxRoot => Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, TemplatePackageName, "Sandbox"); 14public string TemplateSandboxPackages => Path.Combine(TemplateSandboxRoot, "packages"); 15public string TemplateSandboxOutput => Path.Combine(TemplateSandboxRoot, TemplateName);
test\ProjectTemplates\Infrastructure\TemplateSnapshotTestBase.cs (5)
26string workingDir = Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, templatePackageName, "Snapshots", templateName, $"{templateName}.{scenarioName}"); 35string templateLocation = Path.Combine(WellKnownPaths.LocalShippingPackagesPath, $"{templatePackageName}.*.nupkg"); 37string[]? excludePatterns = Path.DirectorySeparatorChar is '/' 39: verificationExcludePatterns?.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray(); 45SnapshotsDirectory = Path.Combine("Snapshots", templateName),
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
50if (Path.GetFileName(path).Equals("launchSettings.json", StringComparison.OrdinalIgnoreCase))
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)
API\AutoMLExperimentExtension.cs (1)
328var csvFilePath = Path.Combine(folder, csvFileName);
Experiment\Experiment.cs (2)
230var experimentDirFullPath = Path.Combine(tempDirectory, cacheDirectoryName, $"experiment_{Path.GetRandomFileName()}");
Experiment\Runners\RunnerUtil.cs (1)
58new FileInfo(Path.Combine(modelDirectory.FullName, $"Model{iterationNum}_{foldNum}.zip"));
Experiment\Runners\TrainValidateRunner.cs (1)
66new FileInfo(Path.Combine(modelDirectory.FullName, $"Model{iterationNum}.zip"));
Microsoft.ML.AutoML.Samples (5)
Cifar10.cs (5)
11public static string cifar10FolderPath = Path.Combine(Path.GetTempPath(), "cifar10"); 12public static string cifar10ZipPath = Path.Combine(Path.GetTempPath(), "cifar10.zip"); 19.Where(p => Path.GetExtension(p) == ".jpg")
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(
TrialResultManagerTest.cs (2)
53var tempFilePath = Path.Combine(OutDir, Path.GetRandomFileName() + ".txt");
Microsoft.ML.CodeAnalyzer.Tests (1)
Helpers\AdditionalMetadataReferences.cs (1)
32var documentationProvider = XmlDocumentationProvider.CreateFromFile(Path.ChangeExtension(location, ".pdb"));
Microsoft.ML.CodeGenerator (12)
CodeGenerator\CSharp\AzureCodeGenerator\AzureAttachCodeGenenrator.cs (1)
50var folder = Path.Combine(_settings.OutputBaseDir, _settings.OutputName);
CodeGenerator\CSharp\CodeGenerator.cs (3)
69var modelprojectDir = Path.Combine(_settings.OutputBaseDir, $"{_settings.OutputName}.Model"); 84var consoleAppProjectDir = Path.Combine(_settings.OutputBaseDir, $"{_settings.OutputName}.ConsoleApp"); 95var solutionPath = Path.Combine(_settings.OutputBaseDir, $"{_settings.OutputName}.sln");
CodeGenerator\CSharp\CSharpCodeFile.cs (1)
34var extension = Path.GetExtension(Name);
CodeGenerator\CSharp\CSharpProjectFile.cs (1)
34var extension = Path.GetExtension(Name);
CodeGenerator\CSharp\CSharpSolution.cs (2)
23project.WriteToDisk(Path.Combine(folder, project.Name)); 28var solutionPath = Path.Combine(folder, $"{Name}.sln");
Utils.cs (4)
196var projectPaths = projects.Select((name) => $"\"{Path.Combine(Path.GetDirectoryName(solutionPath), name).ToString()}\""); 225proc.StartInfo.Arguments = $"sln \"{solutionPath}\" add \"{Path.Combine(consoleAppProjectDir, consoleAppProjectName)}\" \"{Path.Combine(modelprojectDir, modelProjectName)}\"";
Microsoft.ML.Core (45)
ComponentModel\AssemblyLoadingUtils.cs (5)
113return Path.GetFullPath(Path.Combine(Path.GetTempPath(), "MLNET_" + guid.ToString())); 147string name = Path.GetFileName(path).ToLowerInvariant(); 275path = Path.Combine(path, "AutoLoad");
Data\IFileHandle.cs (1)
73_fullPath = Path.GetFullPath(path);
Data\ModelLoading.cs (3)
60var dir = Path.Combine(Directory ?? "", name); 136return LoadModelOrNull<TRes, TSig>(env, out result, Repository, Path.Combine(Directory ?? "", name), extra); 308string path = Path.Combine(Directory, dir);
Data\ModelSaving.cs (2)
22SaveModel(Repository, value, Path.Combine(Directory ?? "", name)); 84using (var ctx = new ModelSaveContext(Repository, Path.Combine(Directory ?? "", dir), ModelLoadContext.ModelStreamName))
Data\Repository.cs (18)
125Path.GetTempPath(); 131path = Path.Combine(Path.GetFullPath(tempPath), $"ml_dotnet_{Path.GetFileNameWithoutExtension(Path.GetRandomFileName())}"); 224protected static string NormalizeForArchiveEntry(string path) => path?.Replace('/', Path.DirectorySeparatorChar); 232path?.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); 248string root = Path.GetFullPath(DirTemp ?? @"x:\dummy"); 249string entityPath = Path.Combine(root, dir ?? "", name); 250entityPath = Path.GetFullPath(entityPath); 251string tempPath = Path.Combine(root, Path.GetRandomFileName()); 252tempPath = Path.GetFullPath(tempPath); 254string parent = Path.GetDirectoryName(entityPath); 259_ectx.Check(entityPath.Length > ichSplit && entityPath[ichSplit] == Path.DirectorySeparatorChar); 267_ectx.Check(entityPath == Path.Combine(root, pathEnt)); 534Directory.CreateDirectory(Path.GetDirectoryName(pathTemp));
Environment\HostEnvironmentBase.cs (1)
330public string TempFilePath { get; set; } = System.IO.Path.GetTempPath();
Utilities\HybridMemoryStream.cs (1)
165string overflowPath = Path.GetTempFileName();
Utilities\PathUtils.cs (5)
29string directory = Path.GetDirectoryName(path); 90var assemblyDir = Path.GetDirectoryName(assemblyForBasePath.Assembly.Location); 92assemblyDir = Path.Combine(assemblyDir, customSearchDir); 105var candidate = Path.Combine(dir, fileName); 114candidate = Path.Combine(dir, folderPrefix, fileName);
Utilities\ResourceManagerUtils.cs (7)
114if (!Uri.TryCreate(Path.Combine(MlNetResourcesUrl, relativeUrl), UriKind.Absolute, out var absoluteUrl)) 206var appDataDir = Path.Combine(appDataBaseDir, "mlnet-resources"); 207var absDir = Path.Combine(string.IsNullOrEmpty(envDir) ? appDataDir : envDir, dir); 208var filePath = Path.Combine(absDir, fileName); 263string tempPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path), "temp-resource-" + guid.ToString()));
Utilities\Stream.cs (2)
851dir = Path.GetDirectoryName(Path.GetFullPath(file));
Microsoft.ML.Core.Tests (19)
UnitTests\FileSource.cs (7)
32var file1 = Path.Combine(dirName, "a.txt"); 33var file2 = Path.Combine(dirName, "b.txt"); 41fileSource = new MultiFileSource(Path.Combine(dirName, "...")); 57var fileDataA = Path.Combine(dataDir, "a.txt"); 58var fileDataB = Path.Combine(dataDir, "b.txt"); 67var fileDataSA = Path.Combine(subFolder1Dir, "a.txt"); 68var fileDataSB = Path.Combine(subFolder2Dir, "b.txt");
UnitTests\TestCustomTypeRegister.cs (1)
225var modelPath = Path.Combine(DataDir, "backcompat", "customTransform.zip");
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=+",
UnitTests\TestModelLoad.cs (2)
27using (var modelStream = File.OpenRead(Path.Combine("TestModels", "BinaryLoader-v3.11.0.0.zip"))) 45using (var modelStream = File.OpenRead(Path.Combine("TestModels", "ConcatTransform.zip")))
UnitTests\TestResourceDownload.cs (4)
67if (File.Exists(Path.Combine(saveToDir, fileName))) 68Fail($"File '{Path.Combine(saveToDir, fileName)}' should have been deleted."); 96if (File.Exists(Path.Combine(saveToDir, fileName))) 97Fail($"File '{Path.Combine(saveToDir, fileName)}' should have been deleted.");
Microsoft.ML.CpuMath.UnitTests (1)
UnitTests.cs (1)
997options.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Microsoft.ML.Data (16)
Commands\CrossValidationCommand.cs (4)
579var fileName = Path.GetFileNameWithoutExtension(outputModelFile); 581return Path.Combine(Path.GetDirectoryName(outputModelFile), 582string.Format("{0}.fold{1:000}{2}", fileName, fold, Path.GetExtension(outputModelFile)));
Commands\DataCommand.cs (1)
354var ext = Path.GetExtension(dataFile);
Commands\SaveDataCommand.cs (1)
64var ext = Path.GetExtension(ImplOptions.OutputDataFile);
Commands\ScoreCommand.cs (1)
142var ext = Path.GetExtension(ImplOptions.OutputDataFile);
Commands\TrainTestCommand.cs (2)
191var tempFilePath = hasOutfile ? null : Path.Combine(((IHostEnvironmentInternal)Host).TempFilePath, Path.GetRandomFileName());
DataLoadSave\LegacyCompositeDataLoader.cs (1)
554using (var loaderCtx = new ModelSaveContext(ctx.Repository, Path.Combine(ctx.Directory ?? "", "Loader"), ModelLoadContext.ModelStreamName))
Model\Pfa\SavePfaCommand.cs (1)
72_name = Path.GetFileNameWithoutExtension(_outputModelPath);
Transforms\ValueMapping.cs (1)
621var extension = Path.GetExtension(options.DataFile);
Transforms\ValueToKeyMappingTransformer.cs (1)
412var ext = Path.GetExtension(file);
Utilities\ModelFileUtils.cs (1)
188ent = rep.OpenEntryOrNull(dir = Path.Combine(DirDataLoaderModel, "Loader"), ModelLoadContext.ModelStreamName);
Utilities\StreamUtils.cs (2)
126var path = Path.GetDirectoryName(currentPattern); 133var files = Directory.GetFiles(path, Path.GetFileName(currentPattern)).OrderBy(f => f).ToArray();
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)
PipelineEnsemble.cs (2)
472: Path.Combine(ctx.Directory, "PredictorModels"); 504var dir = Path.Combine(ctx.Directory, "PredictorModels");
Microsoft.ML.EntryPoints (1)
JsonUtils\ExecuteGraphCommand.cs (1)
139string extension = Path.GetExtension(path);
Microsoft.ML.GenAI.Core.Tests (1)
CausalLMDatasetTest.cs (1)
25using Stream remoteStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model"));
Microsoft.ML.GenAI.LLaMA (3)
LlamaForCausalLM.cs (2)
102var config = Path.Join(modelFolder, configName); 135var config = Path.Join(modelFolder, configName);
LlamaTokenizerHelper.cs (1)
51var modelFilePath = Path.Join(modelWeightFolder, modelFile);
Microsoft.ML.GenAI.LLaMA.Tests (1)
LLaMA3_1Tests.cs (1)
67var modelWeightFolder = Path.Join("Llama-3.1");
Microsoft.ML.GenAI.Mistral (3)
MistralForCausalLM.cs (2)
57var config = Path.Join(modelFolder, configName); 85var config = Path.Join(modelFolder, configName);
MistralTokenizerHelper.cs (1)
97var modelPath = Path.Combine(modelWeightFolder, modelName);
Microsoft.ML.GenAI.Phi (5)
Phi2\Phi2ForCausalLM.cs (1)
58var config = Path.Join(modelFolder, configName);
Phi2\Phi2TokenizerHelper.cs (2)
23var vocabPath = Path.Combine(folder, vocabFile); 24var mergesPath = Path.Combine(folder, mergesFile);
Phi3\Phi3ForCausalLM.cs (2)
59var config = Path.Join(modelFolder, configName); 87var config = Path.Join(modelFolder, configName);
Microsoft.ML.GenAI.Phi.Tests (3)
Phi2Tests.cs (1)
43var modelWeightFolder = Path.Join("Phi-2");
Phi3Tests.cs (2)
118var modelWeightFolder = Path.Join("Llama"); 119var modelPath = Path.Join(modelWeightFolder, "tokenizer.model");
Microsoft.ML.GenAI.Samples (11)
Llama\LlamaSample.cs (1)
31var originalWeightFolder = Path.Combine(weightFolder, "original");
Llama\SFT_Llama_3_2_1B.cs (1)
88var originalWeightFolder = Path.Combine(weightFolder, "original");
MEAI\Llama3_1.cs (1)
32var originalWeightFolder = Path.Combine(weightFolder, "original");
MEAI\Phi3.cs (1)
28var tokenizerPath = Path.Combine(weightFolder, "tokenizer.model");
Mistral\Mistral_7B_Instruct.cs (4)
40var originalWeightFolder = Path.Combine(weightFolder); 71var originalWeightFolder = Path.Combine(weightFolder); 76var mistralConfig = JsonSerializer.Deserialize<MistralConfig>(File.ReadAllText(Path.Combine(weightFolder, configName))) ?? throw new ArgumentNullException(nameof(configName)); 125var originalWeightFolder = Path.Combine(weightFolder);
Phi3Mini\AutoGenSample.cs (1)
30var tokenizerPath = Path.Combine(weightFolder, "tokenizer.model");
Phi3Mini\SemanticKernelSample.cs (2)
26var tokenizerPath = Path.Combine(weightFolder, "tokenizer.model"); 57var tokenizerPath = Path.Combine(weightFolder, "tokenizer.model");
Microsoft.ML.ImageAnalytics (4)
ImageLoader.cs (3)
112ImageFolder = Path.GetFullPath(imageFolder); 248path = Path.Combine(_parent.ImageFolder, path); 279path = Path.Combine(_parent.ImageFolder, path);
MLImage.cs (1)
236string ext = Path.GetExtension(imagePath);
Microsoft.ML.IntegrationTests (5)
DataIO.cs (2)
121var filePath = TestCommon.GetOutputPath(OutDir, Path.GetRandomFileName()); 130var filePath = TestCommon.GetOutputPath(OutDir, Path.GetRandomFileName());
IntegrationTestBaseClass.cs (2)
22DataDir = Path.Combine(RootDir, "test", "data"); 49OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput");
ModelFiles.cs (1)
60var versionFileName = @"TrainingInfo" + Path.DirectorySeparatorChar + "Version.txt";
Microsoft.ML.Maml (4)
MAML.cs (4)
57string currentDirectory = Path.GetDirectoryName(typeof(Maml).Module.FullyQualifiedName); 136var dumpFileDir = Path.Combine( 137Path.GetTempPath(), 139var dumpFilePath = Path.Combine(dumpFileDir,
Microsoft.ML.OneDal (1)
OneDalUtils.cs (1)
33var nativeLibs = Path.Combine(currentDir, "runtimes", "win-x64", "native");
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
103_name = Path.GetFileNameWithoutExtension(_outputModelPath);
Microsoft.ML.OnnxTransformer (4)
OnnxUtils.cs (4)
408var tempModelFile = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName()); 433var tempModelFile = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName());
Microsoft.ML.OnnxTransformerTest (21)
DnnImageFeaturizerTest.cs (2)
102var imageFolder = Path.GetDirectoryName(dataFile); 212var imageFolder = Path.GetDirectoryName(dataFile);
OnnxTransformTests.cs (19)
239var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 247var imageFolder = Path.GetDirectoryName(dataFile); 265var tempPath = Path.GetTempFileName(); 292var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 298var imageFolder = Path.GetDirectoryName(dataFile); 316var tempPath = Path.GetTempFileName(); 425var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 465var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 553var modelFile = Path.Combine(@"unknowndimensions/linear_regression.onnx"); 686var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 739var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx"); 790var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 809var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 882var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "unknowndimensions", "test_unknowndimensions_float.onnx"); 960var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 1052var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "unknowndimensions", "test_unknowndimensions_float.onnx"); 1079var tempPath = Path.GetTempFileName(); 1122var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 1127var imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.Parquet (6)
PartitionedFileLoader.cs (1)
712truncPath = String.Join(Path.DirectorySeparatorChar.ToString(), segments);
PartitionedPathUtils.cs (5)
55relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 68char[] separators = { Path.DirectorySeparatorChar }; 70var cleanPath = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
Microsoft.ML.PerformanceTests (35)
BenchmarkBase.cs (8)
19DataDir = Path.Combine(RootDir, "test", "data"); 38Path.GetFullPath(Path.Combine(DataDir, name)) : 39Path.GetFullPath(Path.Combine(DataDir, path, name)); 48Path.GetFullPath(DataDir) : 49Path.GetFullPath(Path.Combine(DataDir, path));
FeaturizeTextBench.cs (1)
29var path = Path.GetTempFileName();
Harness\ProjectGenerator.cs (2)
54<Compile Include=""{Path.GetFileName(artifactsPaths.ProgramCodePath)}"" Exclude=""bin\**;obj\**;**\*.xproj;packages\**"" /> 64=> Path.Combine(buildArtifactsDirectoryPath, "bin", configuration, TargetFrameworkMoniker, _runtimeIdentifier);
ImageClassificationBench.cs (16)
40var outputMlNetModelFilePath = Path.Combine(assetsPath, "outputs", 44string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 50string fullImagesetFolderPath = Path.Combine( 107if (Path.GetExtension(file) != ".jpg" && 108Path.GetExtension(file) != ".JPEG" && 109Path.GetExtension(file) != ".png") 112var label = Path.GetFileName(file); 145UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 147return Path.GetFileNameWithoutExtension(fileName); 154destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 156string relativeFilePath = Path.Combine(destDir, destFileName); 192var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 197if (File.Exists(Path.Combine(destFolder, flag))) return; 201File.Create(Path.Combine(destFolder, flag)); 213string fullPath = Path.Combine(assemblyFolderPath, relativePath); 232string pathname = Path.GetFullPath(filename);
Numeric\Ranking.cs (2)
88_modelPathMslr = Path.Combine(Path.GetDirectoryName(typeof(RankingTest).Assembly.Location), "FastTreeRankingModel.zip");
Text\MultiClassClassification.cs (4)
105_modelPathWiki = Path.Combine(Path.GetDirectoryName(typeof(MulticlassClassificationTest).Assembly.Location), @"WikiModel.zip"); 123string modelpath = Path.Combine(Path.GetDirectoryName(typeof(MulticlassClassificationTest).Assembly.Location), @"WikiModel.fold000.zip");
TextLoaderBench.cs (1)
32var path = Path.GetTempFileName();
TextPredictionEngineCreation.cs (1)
43_trainedModelOldFormat = _context.Model.Load(Path.Combine("TestModels", "SentimentModel.zip"), out inputSchema);
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)
ResultProcessor.cs (1)
1005string currentDirectory = Path.GetDirectoryName(typeof(ResultProcessor).Module.FullyQualifiedName);
Microsoft.ML.Samples (71)
Dynamic\DataOperations\LoadingSvmLight.cs (1)
18var fileName = Path.Combine(dataDirectoryName, $"SVM_Data.csv");
Dynamic\DataOperations\LoadingText.cs (3)
22var fileName = Path.Combine(dataDirectoryName, $"Data_{i}.csv"); 69loader.Load(Path.Combine(dataDirectoryName, "Data_*.csv")); 120var sparseDataFileName = Path.Combine(dataDirectoryName, "saved_data.tsv");
Dynamic\TensorFlow\ImageClassification.cs (1)
31Unzip(Path.Join(Directory.GetCurrentDirectory(), modelLocation),
Dynamic\TensorFlow\TextClassification.cs (1)
45var lookupMap = mlContext.Data.LoadFromTextFile(Path.Combine(
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (14)
25string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 176if (Path.GetExtension(file) != ".jpg") 179var label = Path.GetFileName(file); 212if (Path.GetExtension(file) != ".jpg") 215var label = Path.GetFileName(file); 249UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 251return Path.GetFileNameWithoutExtension(fileName); 258destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 262string relativeFilePath = Path.Combine(destDir, destFileName); 291var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 296if (File.Exists(Path.Combine(destFolder, flag))) return; 301File.Create(Path.Combine(destFolder, flag)); 314string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (19)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 34string fullImagesetFolderPathTrain = Path.Combine( 38string fullImagesetFolderPathTest = Path.Combine( 202if (Path.GetExtension(file) != ".jpg" && 203Path.GetExtension(file) != ".JPEG" && 204Path.GetExtension(file) != ".png") 207var label = Path.GetFileName(file); 240if (Path.GetExtension(file) != ".jpg" && 241Path.GetExtension(file) != ".JPEG" && 242Path.GetExtension(file) != ".png") 245var label = Path.GetFileName(file); 280UnZip(Path.Combine(imagesDownloadFolder, fileName), 283return Path.GetFileNameWithoutExtension(fileName); 290destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 294string relativeFilePath = Path.Combine(destDir, destFileName); 323var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 328if (File.Exists(Path.Combine(destFolder, flag))) return; 342File.Create(Path.Combine(destFolder, flag)); 355string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (13)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 170$"[{Path.GetFileName(imageToPredict.ImagePath)}], " + 200if (Path.GetExtension(file) != ".jpg") 203var label = Path.GetFileName(file); 237UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 239return Path.GetFileNameWithoutExtension(fileName); 246destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 250string relativeFilePath = Path.Combine(destDir, destFileName); 279var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 284if (File.Exists(Path.Combine(destFolder, flag))) return; 298File.Create(Path.Combine(destFolder, flag)); 311string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (14)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 185if (Path.GetExtension(file) != ".jpg") 188var label = Path.GetFileName(file); 221if (Path.GetExtension(file) != ".jpg") 224var label = Path.GetFileName(file); 258UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 260return Path.GetFileNameWithoutExtension(fileName); 267destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 271string relativeFilePath = Path.Combine(destDir, destFileName); 300var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 305if (File.Exists(Path.Combine(destFolder, flag))) return; 319File.Create(Path.Combine(destFolder, flag)); 332string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScale.cs (1)
43var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\DnnFeaturizeImage.cs (1)
42var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (1)
45var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\LoadImages.cs (1)
42var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\ResizeImages.cs (1)
42var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Microsoft.ML.Samples.GPU (62)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
31Unzip(Path.Join(Directory.GetCurrentDirectory(), modelLocation),
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
45var lookupMap = mlContext.Data.LoadFromTextFile(Path.Combine(
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (14)
25string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 176if (Path.GetExtension(file) != ".jpg") 179var label = Path.GetFileName(file); 212if (Path.GetExtension(file) != ".jpg") 215var label = Path.GetFileName(file); 249UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 251return Path.GetFileNameWithoutExtension(fileName); 258destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 262string relativeFilePath = Path.Combine(destDir, destFileName); 291var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 296if (File.Exists(Path.Combine(destFolder, flag))) return; 301File.Create(Path.Combine(destFolder, flag)); 314string fullPath = Path.Combine(assemblyFolderPath, relativePath);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (19)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 34string fullImagesetFolderPathTrain = Path.Combine( 38string fullImagesetFolderPathTest = Path.Combine( 202if (Path.GetExtension(file) != ".jpg" && 203Path.GetExtension(file) != ".JPEG" && 204Path.GetExtension(file) != ".png") 207var label = Path.GetFileName(file); 240if (Path.GetExtension(file) != ".jpg" && 241Path.GetExtension(file) != ".JPEG" && 242Path.GetExtension(file) != ".png") 245var label = Path.GetFileName(file); 280UnZip(Path.Combine(imagesDownloadFolder, fileName), 283return Path.GetFileNameWithoutExtension(fileName); 290destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 294string relativeFilePath = Path.Combine(destDir, destFileName); 323var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 328if (File.Exists(Path.Combine(destFolder, flag))) return; 342File.Create(Path.Combine(destFolder, flag)); 355string fullPath = Path.Combine(assemblyFolderPath, relativePath);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (13)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 170$"[{Path.GetFileName(imageToPredict.ImagePath)}], " + 200if (Path.GetExtension(file) != ".jpg") 203var label = Path.GetFileName(file); 237UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 239return Path.GetFileNameWithoutExtension(fileName); 246destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 250string relativeFilePath = Path.Combine(destDir, destFileName); 279var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 284if (File.Exists(Path.Combine(destFolder, flag))) return; 298File.Create(Path.Combine(destFolder, flag)); 311string fullPath = Path.Combine(assemblyFolderPath, relativePath);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (14)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 185if (Path.GetExtension(file) != ".jpg") 188var label = Path.GetFileName(file); 221if (Path.GetExtension(file) != ".jpg") 224var label = Path.GetFileName(file); 258UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 260return Path.GetFileNameWithoutExtension(fileName); 267destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 271string relativeFilePath = Path.Combine(destDir, destFileName); 300var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 305if (File.Exists(Path.Combine(destFolder, flag))) return; 319File.Create(Path.Combine(destFolder, flag)); 332string fullPath = Path.Combine(assemblyFolderPath, relativePath);
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)
TestBase.cs (2)
41return Path.Combine(testDataDir.FullName, fileName).Replace(cwd, "."); 53return Path.Combine(testDataDir.FullName, folderName).Replace(cwd, ".");
Microsoft.ML.Sweeper (5)
ConfigRunner.cs (4)
94return Path.Combine(SweepCommand.LocalExePath, "../Win/maml.exe"); 96return Path.Combine(SweepCommand.LocalExePath, "../Linux/maml"); 107string currentDirectory = Path.GetDirectoryName(typeof(ExeConfigRunnerBase).Module.FullyQualifiedName); 134var folderPath = Path.GetFullPath(folderName);
SweepCommand.cs (1)
49public static readonly string LocalExePath = Path.GetDirectoryName(typeof(SweepCommand).Module.FullyQualifiedName);
Microsoft.ML.TensorFlow (11)
TensorflowTransform.cs (7)
154var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(TensorFlowTransformer) + "_" + Guid.NewGuid())); 166string fullFilePath = Path.Combine(tempDirPath, relativeFile); 167string fullFileDir = Path.GetDirectoryName(fullFilePath); 472Path.Combine(_savedModelPath, DefaultModelFileNames.Graph), 473Path.Combine(_savedModelPath, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index) 475modelFilePaths.AddRange(Directory.GetFiles(Path.Combine(_savedModelPath, DefaultModelFileNames.VariablesFolder), DefaultModelFileNames.Data, SearchOption.TopDirectoryOnly));
TensorflowUtils.cs (4)
220var directory = Path.GetDirectoryName(errorResult.FileName); 221var name = Path.GetFileName(errorResult.FileName); 642string tempDirectory = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName());
Microsoft.ML.TensorFlow.Tests (53)
TensorFlowEstimatorTests.cs (3)
154var imageFolder = Path.GetDirectoryName(dataFile); 196var imageFolder = Path.GetDirectoryName(dataFile); 249var imageFolder = Path.GetDirectoryName(dataFile);
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);
BaseTestClass.cs (6)
39DataDir = Path.Combine(RootDir, "test", "data"); 57OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput"); 108return Path.GetFullPath(Path.Combine(DataDir, name)); 115return Path.GetFullPath(Path.Combine(DataDir, subDir, name));
CopyAction.cs (3)
50if (Path.PathSeparator == '/') copyfolder = "Linux"; 52var dir = new DirectoryInfo(Path.Combine(deploymentDirectory, copyfolder)); 54CopyAll(Path.Combine(deploymentDirectory, "AutoLoad"), testDirectory.FullName);
DataPipe\PartitionedFileLoaderTests.cs (2)
30string pathData = Path.Combine(basePath, "...", "*.csv"); 44string pathData = Path.Combine(basePath, "...", "*.csv");
Microsoft.ML.TestFrameworkCommon (18)
TestCommon.cs (8)
18return Path.Combine(outDir, name); 27return Path.Combine(outDir, subDir, name); // REVIEW: put the path in in braces in case the path has spaces 34return Path.GetFullPath(Path.Combine(dataDir, name)); 40return Path.GetFullPath(Path.Combine(dataDir, subDir, name)); 76while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null) 293Directory.CreateDirectory(Path.Combine(outDir, subDir));
Utility\LibraryLoader.cs (2)
91if (Path.IsPathRooted(name)) 99if (!Path.IsPathRooted(loadTarget) || File.Exists(loadTarget))
Utility\PathResolver.cs (8)
46yield return Path.Combine(AppContext.BaseDirectory, name); 95if (Path.GetFileName(nativeAsset) == name || Path.GetFileNameWithoutExtension(nativeAsset) == name) 97appLocalNativePath = Path.Combine( 100appLocalNativePath = Path.GetFullPath(appLocalNativePath); 102depsResolvedPath = Path.Combine( 107depsResolvedPath = Path.GetFullPath(depsResolvedPath); 151return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
Microsoft.ML.Tests (49)
DatabaseLoaderTests.cs (4)
295var databaseFile = Path.GetFullPath(Path.Combine("TestDatabases", $"{databaseName}.mdf")); 301var databaseFile = Path.GetFullPath(Path.Combine("TestDatabases", $"{databaseName}.sqlite"));
ImagesTests.cs (22)
33var imageFolder = Path.GetDirectoryName(dataFile); 64var imageFolder = Path.GetDirectoryName(dataFile); 82var tempPath = Path.GetTempFileName(); 108var correctImageFolder = Path.GetDirectoryName(dataFile); 140var imageFolder = Path.GetDirectoryName(dataFile); 163var fileToSave = GetOutputPath(Path.GetFileNameWithoutExtension(path.ToString()) + ".cropped.jpg"); 177var imageFolder = Path.GetDirectoryName(dataFile); 336var imageFolder = Path.GetDirectoryName(dataFile); 411var imageFolder = Path.GetDirectoryName(dataFile); 487var imageFolder = Path.GetDirectoryName(dataFile); 562var imageFolder = Path.GetDirectoryName(dataFile); 637var imageFolder = Path.GetDirectoryName(dataFile); 712var imageFolder = Path.GetDirectoryName(dataFile); 788var imageFolder = Path.GetDirectoryName(dataFile); 863var imageFolder = Path.GetDirectoryName(dataFile); 939var imageFolder = Path.GetDirectoryName(dataFile); 1011var imageFolder = Path.GetDirectoryName(dataFile); 1149var imagePath = Path.Combine(imageFolder, fileName); 1179var imageFolder = Path.GetDirectoryName(dataFile); 1281string extension = Path.GetExtension(imageName); 1282string imageTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + extension);
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");
OnnxSequenceTypeWithAttributesTest.cs (2)
59var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx"); 98var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx");
TextLoaderTests.cs (1)
595var combinedPath = Path.Combine(directoryName, "*");
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (2)
618var tempPath = Path.GetTempFileName(); 675var tempPath = Path.GetTempFileName();
Transformers\ConcatTests.cs (2)
85var subdir = Path.Combine("Transform", "Concat"); 149var subdir = Path.Combine("Transform", "Concat");
Transformers\NormalizerTests.cs (1)
1005var modelPath = Path.Combine("TestModels", "normalizer_verwrit-00010001.zip");
Transformers\TextFeaturizerTests.cs (1)
750var modelPath = Path.Combine("TestModels", "SentimentModel.zip");
Microsoft.ML.TimeSeries.Tests (4)
TimeSeries.cs (3)
31TestCore(GetDataPath(Path.Combine("Timeseries", "real_1.csv")), 47TestCore(GetDataPath(Path.Combine("Timeseries", "real_11.csv")), 63TestCore(GetDataPath(Path.Combine("Timeseries", "A4Benchmark-TS2.csv")),
TimeSeriesDirectApi.cs (1)
536var dataPath = GetDataPath(Path.Combine("Timeseries", "anomaly_detection.csv"));
Microsoft.ML.Tokenizers.Data.Tests (3)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (3)
53Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Guid.NewGuid().ToString(), extension));
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"));
CodeGenTests.cs (4)
28using Stream vocabStream = File.OpenRead(Path.Combine(@"Codegen-350M-mono", "vocab.json")); 29using Stream mergesStream = File.OpenRead(Path.Combine(@"Codegen-350M-mono", "merges.txt")); 39using Stream vocabStream = File.OpenRead(Path.Combine(@"Phi-2", "vocab.json")); 40using Stream mergesStream = File.OpenRead(Path.Combine(@"Phi-2", "merges.txt"));
EnglishRobertaTests.cs (6)
91Path.Combine(@"Gpt-2", "vocab.json"), 92Path.Combine(@"Gpt-2", "merges.txt"), 93Path.Combine(@"Gpt-2", "dict.txt"), 109string vocabFile = Path.Combine(@"Gpt-2", "vocab.json"); 110string mergeFile = Path.Combine(@"Gpt-2", "merges.txt"); 111string translationFile = Path.Combine(@"Gpt-2", "dict.txt");
LlamaTests.cs (3)
32using Stream remoteStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 39using Stream remoteStream = File.OpenRead(Path.Combine(@"Mistral", "tokenizer.model")); 46using Stream remoteStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model"));
SentencePieceTests.cs (7)
44using Stream stream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 57byte[] modelBytes = File.ReadAllBytes(Path.Combine(@"Llama", "tokenizer.model")); 71using Stream stream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 92using Stream stream = File.OpenRead(Path.Combine( 108using Stream stream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 142using Stream bpeStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 146using Stream unigramStream = File.OpenRead(Path.Combine(
UnigramTests.cs (2)
26using Stream remoteStream = File.OpenRead(Path.Combine(@"Paraphrase-multilingual-MiniLM-L12-v2", "sentencepiece.bpe.model")); 58using Stream remoteStream = File.OpenRead(Path.Combine(@"Paraphrase-multilingual-MiniLM-L12-v2", "sentencepiece.bpe.model"));
Utils.cs (3)
53Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Guid.NewGuid().ToString(), extension));
WordPieceTests.cs (1)
20string vocabFile = Path.GetTempFileName();
Microsoft.ML.TorchSharp (12)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
261var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 266string relativeFilePath = Path.Combine(destDir, destFileName); 276var directory = Path.GetDirectoryName(errorResult.FileName); 277var name = Path.GetFileName(errorResult.FileName);
Roberta\QATrainer.cs (4)
245var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 250string relativeFilePath = Path.Combine(destDir, destFileName); 260var directory = Path.GetDirectoryName(errorResult.FileName); 261var name = Path.GetFileName(errorResult.FileName);
TorchSharpBaseTrainer.cs (4)
171var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 176string relativeFilePath = Path.Combine(destDir, destFileName); 186var directory = Path.GetDirectoryName(errorResult.FileName); 187var name = Path.GetFileName(errorResult.FileName);
Microsoft.ML.TorchSharp.Tests (1)
ObjectDetectionTests.cs (1)
31var imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.Transforms (5)
Text\StopWordsRemovingTransformer.cs (1)
790var ext = Path.GetExtension(dataFile);
Text\TextFeaturizingEstimator.cs (1)
754var mapperDirName = Path.Combine(dirName, "Mapper");
Text\WordEmbeddingsExtractor.cs (3)
632string dir = kind == WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding ? Path.Combine("Text", "Sswe") : "WordVectors"; 639var directory = Path.GetDirectoryName(errorResult.FileName); 640var name = Path.GetFileName(errorResult.FileName);
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)
RazorSourceGeneratorTestsBase.cs (11)
302var dll = Path.Combine(_baseDirectory, "refs", Path.GetFileName(assembly)); 309dll = Path.Combine(_baseDirectory, Path.GetFileName(assembly)); 337var name = Path.GetFileNameWithoutExtension(resolveReferencePath); 349var name = Path.GetFileNameWithoutExtension(assembly); 466var baselineDirectory = Path.Join( 469Path.GetFileNameWithoutExtension(testPath)!, 484var baselinePath = Path.Join(baselineDirectory, source.HintName); 504var baselinePath = Path.Join(baselineDirectory, $"{fileName}.{extension}"); 515var directory = Path.GetDirectoryName(baselinePath)!;
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\CompilerServices\IOUtils.vb (10)
26If PathName.Length > 0 AndAlso PathName.Chars(PathName.Length - 1) = Path.DirectorySeparatorChar Then 27DirName = Path.GetFullPath(PathName) 33FileName = Path.GetFileName(PathName) 34DirName = Path.GetDirectoryName(PathName) 42If Path.IsPathRooted(PathName) Then 43DirName = Path.GetPathRoot(PathName) 46If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 47DirName = DirName & Path.DirectorySeparatorChar 51If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 52DirName = DirName & Path.DirectorySeparatorChar
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\FileIO\SpecialDirectories.vb (1)
100Return GetDirectoryPath(IO.Path.GetTempPath(), SR.IO_SpecialDirectory_Temp)
Microsoft\VisualBasic\FileSystem.vb (7)
90IO.Directory.SetCurrentDirectory(Drive & Path.VolumeSeparatorChar) 123Dim CurrentPath As String = Path.GetFullPath(Drive & Path.VolumeSeparatorChar & ".") 366If Path.GetFileName(PathName).Length = 0 Then 386DirName = Path.GetDirectoryName(PathName) 392FileName = Path.GetFileName(PathName) 397DirName = DirName & Path.PathSeparator
Microsoft.VisualBasic.Forms.Tests (20)
System\Windows\Forms\FileLogTraceListenerTests.vb (5)
27Dim expectedBaseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) 48listener.FullLogFileName.Should.BeEquivalentTo(Path.Join(testDirectory, $"{expectedBaseFileName}.log")) 218fullLogFileName.Should.StartWith(Path.GetDirectoryName(Application.ExecutablePath)) 225If DirectoryIsAccessible(Path.GetDirectoryName(Application.ExecutablePath)) Then 260fullLogFileName.Should.StartWith(Path.GetTempPath)
System\Windows\Forms\FileSystemProxyTests.vb (5)
181Dim expected As String = Path.GetTempPath.TrimEnd(Path.DirectorySeparatorChar) 182FileSystemUtils.NormalizePath(Path.GetTempPath).Should.Be(expected) 410temp &= Path.DirectorySeparatorChar 411temp.Should.Be(Path.GetTempPath)
System\Windows\Forms\VbFileCleanupTestBaseTests.vb (4)
15CreateTempDirectory().Should.StartWith(Path.GetTempPath) 28CreateTempFile(tempDirectory).Should.StartWith(Path.GetTempPath) 35Dim directoryPath As String = Path.Join(CreateTempDirectory(), GetUniqueFileName) 50testDirectory.Should.Be(Path.GetDirectoryName(testFile1))
System\Windows\TestUtilities\VbFileCleanupTestBase.vb (6)
12Private Shared ReadOnly s_baseTempPath As String = Path.Join(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") 49Dim filenameWithPath As String = Path.Join(sourceDirectoryName, filename) 85Return Path.Join(testDirectory, GetUniqueFileName()) 99folder = Path.Join(BaseTempPath, $"{memberName}{lineNumber}") 101folder = Path.Join(BaseTempPath, memberName)
Microsoft.VisualBasic.IntegrationTests (2)
InteractionTests.cs (2)
107string path = Path.Join(Path.GetTempPath(), GetUniqueName());
Microsoft.VisualBasic.Tests (51)
Microsoft\VisualBasic\ApplicationServices\AssemblyInfoTests.cs (1)
24assemblyInfo.DirectoryPath.Should().Be(Path.GetDirectoryName(assembly.Location));
Microsoft\VisualBasic\Devices\AudioTests.cs (2)
52string location = Path.Join(Path.GetTempPath(), GetUniqueName());
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\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\VisualStudio\IntegrationTest\Harness\XUnitShared\Harness\DataCollectionService.cs (6)
247return Path.Combine(Path.GetFullPath(logDirectory), $"{timestamp:HH.mm.ss}-{testName}-{errorId}{logId}.{extension}"); 255return Path.GetFullPath(Path.Combine(Environment.GetEnvironmentVariable("XUNIT_LOGS"), "Screenshots")); 259return Path.Combine(assemblyDirectory, "xUnitResults", "Screenshots"); 265return Path.GetDirectoryName(assemblyPath);
src\VisualStudio\IntegrationTest\Harness\XUnitShared\Harness\ScreenshotService.cs (1)
38var directory = Path.GetDirectoryName(fullPath);
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"));
src\VisualStudio\IntegrationTest\Harness\XUnitShared\InProcess\VisualStudio_InProc.cs (2)
22using Path = System.IO.Path; 53var path = Path.Combine(directory, new AssemblyName(e.Name).Name + ".dll");
Microsoft.VisualStudio.LanguageServer.ContainedLanguage (1)
DefaultFileUriProvider.cs (1)
65filePath = Path.GetTempFileName();
Microsoft.VisualStudio.LanguageServices (65)
CommonControls\NewTypeDestinationSelectionViewModel.cs (2)
132if (!Path.GetExtension(trimmedFileName).Equals(_fileExtension, StringComparison.OrdinalIgnoreCase)) 138if (trimmedFileName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
EditAndContinue\EditAndContinueFeedbackDiagnosticFileProvider.cs (7)
59_tempDir = Path.GetTempPath(); 60var vsFeedbackTempDir = Path.Combine(_tempDir, VSFeedbackSemaphoreDir); 61_vsFeedbackSemaphoreFullPath = Path.Combine(vsFeedbackTempDir, VSFeedbackSemaphoreFileName); 91=> Path.Combine(Path.Combine(_tempDir, $"EnC_{_vsProcessId}", "Log")); 94=> Path.Combine(Path.Combine(_tempDir, $"EnC_{_vsProcessId}", ZipFileName));
GenerateType\GenerateTypeDialogViewModel.cs (2)
240if (trimmedFileName.IndexOfAny(Path.GetInvalidPathChars()) >= 0) 273this.FullFilePath = Path.GetFullPath(this.FullFilePath);
Implementation\AbstractEditorFactory.cs (3)
313projectToAddTo = AddEditorConfigFiles(projectToAddTo, Path.GetDirectoryName(filePath)); 395projectFolder = Path.GetDirectoryName(projectFolder); 407var editorConfigFile = Path.Combine(folder, EditorConfigFileName);
Interactive\VsResetInteractive.cs (2)
128var scriptsDir = Path.Combine(projectDir, "Scripts"); 129var outputDir = Path.Combine(projectDir, relativeOutputPath);
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (1)
65var newFileName = Path.ChangeExtension(typeName, language == LanguageNames.CSharp ? ".cs" : ".vb");
PdbSourceDocument\AbstractSourceLinkService.cs (1)
43Path.GetFileName(codeViewEntry.Path),
ProjectSystem\Legacy\AbstractLegacyProject.cs (6)
55private static readonly char[] PathSeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 85_projectDirectory = Path.GetDirectoryName(projectFilePath); 212var linkFolderPath = Path.GetDirectoryName(linkMetadata); 274outputDirectory = FileUtilities.ResolveRelativePath(outputDirectory, Path.GetDirectoryName(ProjectSystemProject.FilePath)); 282ProjectSystemProject.OutputFilePath = FileUtilities.NormalizeAbsolutePath(Path.Combine(outputDirectory, targetFileName));
ProjectSystem\Legacy\AbstractLegacyProject_IAnalyzerHost.cs (1)
27ruleSetFileFullPath = Path.GetFullPath(ruleSetFileFullPath);
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (3)
139yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5"); 140yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"); 351assemblyDir ??= Path.GetDirectoryName(fullPath);
ProjectSystem\RuleSets\RuleSetEventHandler.cs (4)
92if (Path.GetExtension(oldFileFullPath).Equals(".ruleset", StringComparison.OrdinalIgnoreCase)) 171Path.GetExtension(fileFullPath).Equals(".ruleset", StringComparison.OrdinalIgnoreCase)) 191Path.GetExtension(fileFullPath).Equals(".ruleset", StringComparison.OrdinalIgnoreCase)) 226var projectDirectoryFullPath = Path.GetDirectoryName(project.FullName);
ProjectSystem\SdkAnalyzerAssemblyRedirector.cs (10)
39return Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"CommonExtensions\Microsoft\DotNet")); 72var metadataFilePath = Path.Combine(insertedAnalyzersDirectory, "metadata.json"); 108var analyzerFullPath = Path.Combine(insertedAnalyzersDirectory, subsetName, file); 114PathSuffix = Path.GetDirectoryName(file), 117var analyzerName = Path.GetFileNameWithoutExtension(file); 137if (_analyzerMap.Value.TryGetValue(Path.GetFileNameWithoutExtension(fullPath), out var analyzers)) 141var directoryPath = Path.GetDirectoryName(fullPath); 170var directoryPathVersion = Path.GetFileName(Path.GetDirectoryName(directoryPath.Substring(0, index)));
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
59Path.GetFileName(_filePath));
ProjectSystem\VisualStudioWorkspaceImpl.cs (5)
962var baseName = Path.GetFileNameWithoutExtension(documentName); 963var extension = documentKind == TextDocumentKind.Document ? GetPreferredExtension(documentId) : Path.GetExtension(documentName); 965filePath = Path.Combine(folderPath, uniqueName); 1283Path.GetFileNameWithoutExtension(updatedInfo.Name), 1284Path.GetExtension(updatedInfo.Name));
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
48Path.GetFileName(_filePath));
Snippets\SnippetExpansionClient.cs (1)
1084var existingReferenceNames = originalProject.MetadataReferences.Select(r => Path.GetFileNameWithoutExtension(r.Display));
Telemetry\FileLogger.cs (2)
39_logFilePath = Path.Combine(Path.GetTempPath(), "Roslyn", "Telemetry", GetLogFileName());
UnusedReferences\Dialog\UnusedReferencesTableProvider.DataSource.cs (2)
35var solutionName = Path.GetFileName(solution.FilePath); 127? Path.GetFileName(ReferenceUpdate.ReferenceInfo.ItemSpecification)
Watson\FaultReporter.cs (5)
284var logPath = Path.Combine(Path.GetTempPath(), "VSLogs"); 300var logPath = Path.Combine(Path.GetTempPath(), "servicehub", "logs"); 335var name = Path.GetFileNameWithoutExtension(path);
Workspace\SourceGeneratedFileManager.cs (6)
99_temporaryDirectory = PathUtilities.EnsureTrailingSeparator(Path.Combine(Path.GetTempPath(), "VSGeneratedDocuments")); 134var temporaryFilePath = Path.Combine( 138document.HintName.Replace('/', Path.DirectorySeparatorChar)); 142Directory.CreateDirectory(Path.GetDirectoryName(temporaryFilePath)); 200var separatorIndex = slice.IndexOf(Path.DirectorySeparatorChar);
Microsoft.VisualStudio.LanguageServices.CSharp (5)
LanguageService\CSharpLanguageService_ICSharpProjectHost.cs (1)
19var projectName = Path.GetFileName(projectRoot.GetFullProjectName()); // GetFullProjectName returns the path to the project file w/o the extension?
ProjectSystemShim\CSharpProjectShim.ICSInputSet.cs (1)
53ProjectSystemProject.AssemblyName = Path.GetFileNameWithoutExtension(filename);
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
191var directory = Path.GetDirectoryName(_projectSystemProject.FilePath);
ProjectSystemShim\TempPECompilerService.cs (2)
34var baseDirectory = Path.GetDirectoryName(pszOutputFileName); 55Path.GetFileName(pszOutputFileName),
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (34)
PersistentStorage\AbstractPersistentStorageTests.cs (2)
873solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs")); 893solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs"));
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (3)
166Path.Combine(Path.GetDirectoryName(project.ProjectFilePath), "generated"), 169var path = Path.Combine(TempRoot.Root, "generated");
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (8)
94var expectedNewBinPath = Path.Combine(Path.GetTempPath(), newBinPath); 101var absoluteObjPath = Path.GetFullPath(Path.Combine(Path.GetTempPath(), relativeObjPath)); 198var path = Path.Combine(TempRoot.Root, "generated"); 206Path.Combine(Path.GetDirectoryName(cpsProject.ProjectFilePath), "gen2"),
ProjectSystemShim\CSharpHelpers.cs (4)
43var projectFilePath = Path.GetTempPath(); 44var binOutputPath = GetOutputPathFromArguments(commandLineArguments) ?? Path.Combine(projectFilePath, projectName + ".dll"); 51var projectFilePath = Path.GetTempPath(); 123baseDirectory = Path.GetTempPath();
ProjectSystemShim\LegacyProject\SourceFileHandlingTests.cs (4)
66var projectFolder = Path.GetDirectoryName(environment.Workspace.CurrentSolution.Projects.Single().FilePath); 68project.AddFileEx(Path.Combine(projectFolder, "Cat.cs"), null); 80var projectFolder = Path.GetDirectoryName(environment.Workspace.CurrentSolution.Projects.Single().FilePath); 82project.AddFileEx(Path.Combine(projectFolder, "RelativeFolder", "Cat.cs"), null);
ProjectSystemShim\SdkAnalyzerAssemblyRedirectorTests.cs (9)
26var vsDir = Path.Combine(testDir.Path, "vs"); 41var vsDir = Path.Combine(testDir.Path, "vs"); 56var vsDir = Path.Combine(testDir.Path, "vs"); 73var vsDir = Path.Combine(testDir.Path, "vs"); 102var vsDir = Path.Combine(testDir.Path, "vs"); 114var dllPath = Path.Combine(root, subdir, $"{name}.dll"); 115Directory.CreateDirectory(Path.GetDirectoryName(dllPath)); 122var metadataFilePath = Path.Combine(root, "metadata.json"); 123Directory.CreateDirectory(Path.GetDirectoryName(metadataFilePath));
ProjectSystemShim\TempPECompilerServiceTests.cs (2)
31pszOutputFileName: Path.Combine(directory.Path, "Output.dll"), 37optionValues: [Path.Combine(directory.Path, "MissingReference.dll")]);
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (2)
72var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.Path, "nonexistent.dll")); 87var debugDirPdbPath = Path.Combine(dir.Path, "nonexistent.pdb");
Microsoft.VisualStudio.LanguageServices.DevKit (1)
src\VisualStudio\Core\Def\PdbSourceDocument\AbstractSourceLinkService.cs (1)
43Path.GetFileName(codeViewEntry.Path),
Microsoft.VisualStudio.LanguageServices.Implementation (20)
CodeModel\RootCodeModel.cs (3)
58var projectDirectory = Path.GetDirectoryName(project.FilePath); 59var absoluteFilePath = Path.GetFullPath(Path.Combine(projectDirectory, locationString));
Options\GridOptionPreviewControl.xaml.cs (1)
133return Path.GetDirectoryName(solutionFilePath);
ProjectSystem\CPS\CPSProject_IWorkspaceProjectContext.cs (6)
121? Path.GetDirectoryName(_projectSystemProject.FilePath) 122: Path.GetTempPath(); 124_projectSystemProject.OutputFilePath = Path.Combine(rootDirectory, value); 198? Path.GetDirectoryName(_projectSystemProject.FilePath) 199: Path.GetTempPath(); 201return Path.Combine(rootDirectory, value);
ProjectSystem\CPS\CPSProjectFactory.cs (1)
169path = Path.Combine(PathUtilities.GetDirectoryName(projectFilePath), path);
ProjectSystem\CPS\TempPECompiler.cs (2)
82compilation = compilation.WithAssemblyName(Path.GetFileName(outputFileName)); 86var outputPath = Path.GetDirectoryName(outputFileName);
SolutionExplorer\AnalyzersCommandHandler.cs (5)
229Path.GetExtension(itemName).Equals(".ruleset", StringComparison.OrdinalIgnoreCase); 484string.Format(SolutionExplorerShim.Checking_out_0_for_editing, Path.GetFileName(pathToRuleSet))); 517var projectDirectoryFullPath = Path.GetDirectoryName(project.FullName); 527var projectDirectory = Path.GetDirectoryName(envDteProject.FullName); 528var fullFilePath = Path.Combine(projectDirectory, fileName);
SolutionExplorer\DiagnosticItem\CpsDiagnosticItemSource.cs (1)
39_projectDirectoryPath = Path.GetDirectoryName(projectPath);
SolutionExplorer\SymbolTree\RootSymbolTreeItemCollectionSource.cs (1)
45=> Path.GetExtension(hierarchyItem.CanonicalName).ToLowerInvariant() is ".cs" or ".vb"
Microsoft.VisualStudio.LanguageServices.LiveShare (7)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
95name: Path.GetFileNameWithoutExtension(path),
Client\RemoteLanguageServiceWorkspace.cs (6)
265return AddDocumentToProject(filePath, language, Path.GetFileName(Path.GetDirectoryName(remoteWorkspaceRoot))); 269return AddDocumentToProject(filePath, language, Path.GetFileName(Path.GetDirectoryName(remoteExternalRoot))); 336name: Path.GetFileName(filePath), 346var fileExtension = Path.GetExtension(filePath).ToLower();
Microsoft.VisualStudio.LanguageServices.Razor (22)
LanguageClient\Cohost\CohostApplyRenameEditEndpoint.cs (3)
69var oldFileNamePart = Path.GetFileName(request.OldFilePath); 70var newFileNamePart = Path.GetFileName(request.NewFilePath); 80var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(uriString);
LanguageClient\Cohost\IncompatibleProjectNotifier.cs (2)
50? WorkspacesSR.FormatIncompatibleProject_NotAnAdditionalFile(Path.GetFileName(filePath), project.Name) 51: WorkspacesSR.FormatIncompatibleProject_NoAdditionalFiles(Path.GetFileName(filePath), project.Name))}");
LanguageClient\ViewCodeCommandHandler.cs (1)
71&& Path.GetFileName(filePath) is string fileName
ProjectSystem\RenameProjectTreeHandler.cs (4)
48var newFilePath = Path.Combine(Path.GetDirectoryName(oldFilePath), value); 112var fromComponentName = Path.GetFileNameWithoutExtension(request.OldFilePath); 113var toComponentName = Path.GetFileNameWithoutExtension(request.NewFilePath);
Remote\RemoteServiceInvoker.cs (2)
93var approximateCallingClassName = Path.GetFileNameWithoutExtension(callerFilePath); 180var cacheDirectory = Path.Combine(localSettingsDirectory, "Razor", "RemoteMEFCache");
Rename\RazorRefactorNotifyService.cs (3)
106Debug.Assert(Path.GetExtension(razorFileName) == ".razor"); 107var newFileName = Path.Combine(Path.GetDirectoryName(razorFileName), newName + ".razor");
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\RazorAnalyzerAssemblyRedirector.cs (6)
44var name = Path.GetFileNameWithoutExtension(fullPath); 91objectPoolRedirect.path = Path.Combine(Path.GetDirectoryName(compilerAssemblyLocation)!, $"{objectPoolRedirect.name}.dll"); 106var name = Path.GetFileName(location); 107var directory = Path.GetDirectoryName(location) ?? ""; 113var serviceHubCoreVersion = Path.Combine(directory, "ServiceHubCore", name);
Telemetry\TelemetryReporter.cs (1)
357var moduleName = Path.GetFileNameWithoutExtension(method.Module.Name);
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)))
Cohost\CohostRoslynRenameTest.cs (1)
265var razorDocument = CreateProjectAndRazorDocument(razorFile.Text, additionalFiles: [(Path.Combine(TestProjectData.SomeProjectPath, "File.cs"), csharpFile.Text)]);
LanguageClient\ViewCodeCommandHandlerTests.cs (1)
129razorFilePath = Path.Combine(files.TempDir, razorFileName);
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")), """
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSemanticTokensRangeEndpointTest.cs (2)
435var baselineFileName = Path.Combine("TestFiles", "SemanticTokens", $"{testName}.txt"); 461var baselineFileFullPath = Path.Combine(projectPath, baselineFileName);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\CSharpSyntaxFormattingOptionsTest_Generator.cs (1)
99var testFileName = Path.Combine(projectPath, """Endpoints\Shared\Formatting\Formatting\CSharpSyntaxFormattingOptionsTest.cs""");
Telemetry\TelemetryReporterTests.cs (1)
502var expectedModuleName = Path.GetFileNameWithoutExtension(currentModule.Name);
Microsoft.VisualStudio.Razor.IntegrationTests (52)
AbstractRazorEditorTest.cs (3)
127return Path.Combine(Path.GetTempPath(), "razor-test", Path.GetRandomFileName());
FindAllReferencesTests.cs (6)
44Assert.Equal(expected: "Counter.razor", Path.GetFileName(reference.DocumentName)); 49Assert.Equal(expected: "Counter.razor", Path.GetFileName(reference.DocumentName)); 274Assert.Equal(expected: "MyComponent.razor", Path.GetFileName(reference.DocumentName)); 279Assert.Equal(expected: "MyComponent.razor.cs", Path.GetFileName(reference.DocumentName)); 284Assert.Equal(expected: "MyPage.razor", Path.GetFileName(reference.DocumentName)); 297return new TableEntry(code, Path.GetFileName(documentName));
Formatting\FormatDocumentTests.cs (3)
68var path = Path.Combine(s_projectPath, "Formatting", "TestFiles", "Expected"); 71File.WriteAllText(Path.Combine(path, fileName), actual); 113data.Add(Path.GetFileName(name)[baseName.Length..]);
InProcess\EditorInProcess_Commands.cs (2)
140var projectPath = Path.GetDirectoryName(project.FullName); 141return Path.Combine(projectPath, relativeFilePath);
InProcess\ErrorListInProcess.cs (2)
109if (!string.Equals(Path.GetFileName(item.GetDocumentName()), documentName)) 123var document = Path.GetFileName(item.GetPath() ?? item.GetDocumentName()) ?? "<unknown>";
InProcess\ShellInProcess.cs (1)
38return Path.GetFileName(documentPath);
InProcess\SolutionExplorerInProcess.cs (9)
31var projectPath = Path.Combine(await GetDirectoryNameAsync(cancellationToken), projectName); 82var fileExtension = Path.GetExtension(filePath); 102var projectDirectory = Path.GetDirectoryName(project.FullName); 103var filePath = Path.Combine(projectDirectory, fileName); 104var directoryPath = Path.GetDirectoryName(filePath); 201var solutionFileName = Path.ChangeExtension(solutionName, ".sln"); 251var projectPath = Path.GetDirectoryName(projectFileName); 252return Path.Combine(projectPath, relativeFilePath); 285return Path.GetDirectoryName(solutionFileFullPath);
MEFComponentTests.cs (2)
18var cmcPath = Path.Combine(hiveDirectory, "ComponentModelCache"); 22var mefErrorFile = Path.Combine(cmcPath, "Microsoft.VisualStudio.Default.err");
MultiTargetProjectTests.cs (2)
25var solutionFileName = Path.Combine(solutionPath, RazorProjectConstants.BlazorSolutionName + ".sln"); 56var solutionFileName = Path.Combine(solutionPath, RazorProjectConstants.BlazorSolutionName + ".sln");
ProjectTests.cs (2)
71var solutionFileName = Path.Combine(solutionPath, RazorProjectConstants.BlazorSolutionName + ".sln"); 102var solutionFileName = Path.Combine(solutionPath, RazorProjectConstants.BlazorSolutionName + ".sln");
RazorProjectConstants.cs (10)
13private static readonly string s_pagesDir = Path.Combine("Pages"); 14private static readonly string s_sharedDir = Path.Combine("Shared"); 15internal static readonly string FetchDataRazorFile = Path.Combine(s_pagesDir, "FetchData.razor"); 16internal static readonly string CounterRazorFile = Path.Combine(s_pagesDir, "Counter.razor"); 17internal static readonly string IndexRazorFile = Path.Combine(s_pagesDir, "Index.razor"); 20internal static readonly string SemanticTokensFile = Path.Combine(s_pagesDir, "SemanticTokens.razor"); 21internal static readonly string MainLayoutFile = Path.Combine(s_sharedDir, "MainLayout.razor"); 22internal static readonly string NavMenuFile = Path.Combine(s_sharedDir, "NavMenu.razor"); 23internal static readonly string SurveyPromptFile = Path.Combine(s_sharedDir, "SurveyPrompt.razor"); 24internal static readonly string ErrorCshtmlFile = Path.Combine(s_pagesDir, "Error.cshtml");
Semantic\RazorSemanticTokensTests.cs (1)
199var semanticBaselinePath = Path.Combine(s_projectPath, "Semantic", "TestFiles", nameof(RazorSemanticTokensTests), testName + ".txt");
VisualStudioLogging.cs (9)
55var errorFile = Path.Combine(hiveDirectory, "ComponentModelCache", "Microsoft.VisualStudio.Default.err"); 111var extensionsDir = Path.Combine(hiveDirectory, "Extensions"); 112var compatListFile = Path.Combine(extensionsDir, "CompatibilityList.xml"); 124var microsoftDir = Path.Combine(extensionsDir, "Microsoft"); 141var devenvPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName); 142var isolationIni = Path.Combine(devenvPath, "devenv.isolation.ini"); 156var vsLocalDir = Path.Combine(localAppData, "Microsoft", "VisualStudio"); 204var name = Path.GetFileName(file); 206if (!Path.GetExtension(file).Equals(".zip", StringComparison.OrdinalIgnoreCase))
Microsoft.VisualStudio.RazorExtension (9)
NestedFiles\NestedFileCommandHandler.cs (2)
98var nestedFileName = Path.GetFileName(nestedFilePath); 185&& Path.GetFileName(filePath) is string fileName
NestedFiles\ViewPageCommandHandler.cs (2)
70var extension = Path.GetExtension(filePath).ToLowerInvariant(); 80var parentExtension = Path.GetExtension(parentPath).ToLowerInvariant();
SyntaxVisualizer\SyntaxVisualizerControl.xaml.cs (5)
29private static readonly string s_baseTempPath = Path.Combine(Path.GetTempPath(), "RazorDevTools"); 271var fileName = Path.GetFileName(originalFilePath); 272var tempPath = Path.Combine(s_baseTempPath, Guid.NewGuid().ToString("N")); 274var tempFileName = Path.Combine(tempPath, fileName);
Microsoft.VisualStudioCode.Razor.IntegrationTests (43)
DiagnosticsTests.cs (3)
72var fileName = Path.Combine(TestServices.Workspace.WorkspacePath, "Components/Pages/Home.razor"); 92var fileName = Path.Combine(TestServices.Workspace.WorkspacePath, "Components/Pages/Home.razor"); 110var fileName = Path.Combine(TestServices.Workspace.WorkspacePath, "UnusedDirective.cshtml");
Services\EditorService.cs (2)
30var filePath = Path.Combine(TestServices.Workspace.WorkspacePath, _currentOpenFile); 420var expectedFileName = Path.GetFileName(relativePath);
Services\PlaywrightService.cs (2)
51var sanitizedName = string.Join("_", name.Split(Path.GetInvalidFileNameChars())); 54var filepath = Path.Combine(screenshotsDir, filename);
Services\TestSettings.cs (7)
83settings.RazorExtensionPath = Path.Combine( 92var vscodeTestDir = Path.Combine(repoRoot, ".vscode-test"); 94settings.ExtensionsDir = Path.Combine(vscodeTestDir, "extensions"); 95settings.UserDataDir = Path.Combine(vscodeTestDir, "user-data"); 96settings.ScreenshotsDir = Path.Combine(vscodeTestDir, "screenshots"); 97settings.FailureLogsDir = Path.Combine(vscodeTestDir, "failure-logs"); 108if (File.Exists(Path.Combine(dir.FullName, "Razor.slnx")))
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");
Services\WorkspaceService.cs (3)
23public string Name => Path.GetFileName(_workspacePath) ?? throw new InvalidOperationException("Workspace not created."); 30_workspacePath = Path.Combine(Path.GetTempPath(), $"vscode-razor-test-{Guid.NewGuid():N}");
Microsoft.VisualStudioCode.RazorExtension (10)
Services\IncompatibleProjectNotifier.cs (2)
31? WorkspacesSR.FormatIncompatibleProject_NotAnAdditionalFile(Path.GetFileName(filePath), project.Name) 32: WorkspacesSR.FormatIncompatibleProject_NoAdditionalFiles(Path.GetFileName(filePath), project.Name))}");
Services\VSCodeRemoteServicesInitializer.cs (2)
48RemoteMefComposition.CacheDirectory = Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location)!, "cache");
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\RazorAnalyzerAssemblyRedirector.cs (6)
44var name = Path.GetFileNameWithoutExtension(fullPath); 91objectPoolRedirect.path = Path.Combine(Path.GetDirectoryName(compilerAssemblyLocation)!, $"{objectPoolRedirect.name}.dll"); 106var name = Path.GetFileName(location); 107var directory = Path.GetDirectoryName(location) ?? ""; 113var serviceHubCoreVersion = Path.Combine(directory, "ServiceHubCore", name);
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")), """
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSemanticTokensRangeEndpointTest.cs (2)
435var baselineFileName = Path.Combine("TestFiles", "SemanticTokens", $"{testName}.txt"); 461var baselineFileFullPath = Path.Combine(projectPath, baselineFileName);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Formatting\CSharpSyntaxFormattingOptionsTest_Generator.cs (1)
99var testFileName = Path.Combine(projectPath, """Endpoints\Shared\Formatting\Formatting\CSharpSyntaxFormattingOptionsTest.cs""");
Microsoft.Web.Xdt.Extensions.Tests (4)
InsertOrAppendAttributeTests.cs (4)
16var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 40var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 64var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 88var transform = new XmlTransformation(Path.GetFullPath("transform.xdt"));
MSBuild (37)
CommandLine\CommandLineParser.cs (7)
120string exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath()); // Copied from XMake 344responseFile = Path.GetFullPath(responseFile); 361var responseFileDirectory = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(responseFile)); 535string exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath()); // Copied from XMake 563projectDirectory = Path.GetDirectoryName(Path.GetFullPath(projectFile)); 656string autoResponseFile = Path.Combine(path, autoResponseFileName);
DebugUtils.cs (5)
74var extension = Path.GetExtension(fileName); 75var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 77var fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 83fullPath = Path.Combine(FrameworkDebugUtils.DebugPath, fileName); 138s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
ErrorUtilities.cs (1)
176if (!Path.IsPathRooted(value))
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
OutOfProcTaskHostNode.cs (1)
1296? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(FileUtilities.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), EnvironmentUtilities.CurrentProcessId))
PerformanceLogEventListener.cs (1)
84string logFilePath = Path.Combine(logDirectory, $"perf-{_processIDStr}-{Guid.NewGuid():N}.log");
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
TypeLoader.cs (5)
75string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 76microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 235string baseDir = Path.GetDirectoryName(assemblyLoadInfo.AssemblyFile); 258string assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 296assembliesDictionary[Path.GetFileName(path)] = path;
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"));
ItemSpecModifiersBenchmark.cs (4)
20_currentDirectory = Path.GetTempPath(); 21_itemSpec = Path.Combine(_currentDirectory, "src", "Framework", "ItemSpecModifiers.cs"); 22_definingProjectEscaped = Path.Combine(_currentDirectory, "src", "Framework", "Microsoft.Build.Framework.csproj"); 25Directory.CreateDirectory(Path.GetDirectoryName(_itemSpec)!);
ItemSpecModifiersCachingBenchmark.cs (6)
33_tempDir = Path.Combine(Path.GetTempPath(), "MSBuildBenchmarks", Guid.NewGuid().ToString("N")); 34string srcDir = Path.Combine(_tempDir, "src", "Framework"); 41string filePath = Path.Combine(srcDir, $"File{i}.cs"); 49root.FullPath = Path.Combine(_tempDir, "Test.csproj"); 54itemGroup.AddItem("Compile", Path.Combine(srcDir, $"File{i}.cs"));
MSBuildTaskHost (21)
CommunicationsUtilities.cs (1)
664string filePath = Path.Combine(s_debugDumpPath, fileName);
OutOfProcTaskHostNode.cs (1)
528? File.CreateText(Path.Combine(FileUtilities.TempFileDirectory, $"MSBuild_NodeShutdown_{EnvironmentUtilities.CurrentProcessId}.txt"))
Utilities\ExceptionHandling.cs (1)
109s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
Utilities\FileUtilities.cs (9)
23public static string TempFileDirectory => Path.GetTempPath(); 26=> field ??= Path.GetDirectoryName(Path.GetFullPath(typeof(FileUtilities).Assembly.Location)); 187_ = Path.HasExtension(uncheckedFullPath); 191return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 237string directory = Path.GetDirectoryName(fileSpec); 250directory += Path.DirectorySeparatorChar; 269string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 281fullPath += Path.DirectorySeparatorChar;
Utilities\FileUtilities.ItemSpecModifiers.cs (9)
273string rootDir = Path.GetPathRoot(fullPath); 283rootDir += Path.DirectorySeparatorChar; 295: Path.GetFileNameWithoutExtension(itemSpec); 303: Path.GetExtension(itemSpec); 364return Path.Combine(rootDir, directory); 385if (!Path.IsPathRooted(path)) 418return Path.GetDirectoryName(path) == null; 431_ = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
338[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
44var name = Path.GetFileNameWithoutExtension(assemblyPath);
Mvc.Api.Analyzers.Test (3)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (2)
37if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Infrastructure\MvcTestSource.cs (1)
15var filePath = Path.Combine(ProjectDirectory, "TestFiles", testClassName, testMethod + ".cs");
netstandard (1)
netstandard.cs (1)
948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
NonDISample (1)
Program.cs (1)
13var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
Pipelines.AppHost (6)
AppHost.cs (6)
265.CreateTaskAsync($"Uploading {Path.GetFileName(sourcePath)} to {fileShareName}", deployingContext.CancellationToken) 294var relativePath = Path.GetRelativePath(sourcePath, filePath); 295var directoryPath = Path.GetDirectoryName(relativePath) ?? string.Empty; 301var parts = directoryPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 309var fileName = Path.GetFileName(filePath);
Pipelines.Library (4)
DistributedApplicationPipelineExtensions.cs (4)
69var publishDir = Path.Combine(Path.GetTempPath(), $"aspire-publish-{Guid.NewGuid()}"); 113var zipPath = Path.Combine(Path.GetTempPath(), $"aspire-deploy-{Guid.NewGuid()}.zip");
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)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (6)
139string currentProjectName = Path.GetFileNameWithoutExtension(CurrentProject); 140string currentProjectExtension = Path.GetExtension(CurrentProject); 149string randomFileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); 277( "_TargetAssemblyProjectName", Path.GetFileNameWithoutExtension(CurrentProject) ), 313foreach (FileInfo temporaryProjectFile in intermediateOutputPath.EnumerateFiles($"{Path.GetFileNameWithoutExtension(TemporaryTargetAssemblyProjectName)}*"))
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (10)
63_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 264if (!_outputDir.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 266_outputDir += Path.DirectorySeparatorChar; 712string buildCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, buildExtension); 713string intelCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, intellisenseExtension); 721bamlFile = OutputPath + Path.ChangeExtension(relativeFilePath, SharedStrings.BamlExtension); 861return Path.Combine(OutputPath, fileName); 1077int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1125asmname = Path.GetFileNameWithoutExtension(refpath); 1672locFile = Path.ChangeExtension(xamlRelativeFilePath, SharedStrings.LocExtension);
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (6)
49_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 243if (!_outputPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 245_outputPath += Path.DirectorySeparatorChar; 540int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 605asmname = Path.GetFileNameWithoutExtension(refpath); 774string bamlFileName = Path.ChangeExtension(resolvedXamlfile, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
55string absoluteFilePath = Path.Combine(
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (10)
38_sourcePath = Path.GetFullPath(path); 124SourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 249_outputPath = Path.GetFullPath(value); 251if (!_outputPath.EndsWith((Path.DirectorySeparatorChar).ToString(), StringComparison.Ordinal)) 252_outputPath += Path.DirectorySeparatorChar; 354string fullFilePath = Path.GetFullPath(filePath); 373relPath = Path.GetFileName(fullFilePath); 390Path.GetExtension(sourceFilePath).Equals(SharedStrings.BamlExtension) && 391Path.GetExtension(path).Equals(SharedStrings.XamlExtension)) 394path = Path.ChangeExtension(path, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\UidManager.cs (7)
155string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 358return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidtemp")); 363return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidbackup"));
MS\Internal\MarkupCompiler\MarkupCompiler.cs (12)
472if (!TargetPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 474TargetPath += Path.DirectorySeparatorChar; 478int pathEndIndex = SourceFileInfo.RelativeSourceFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1586string pathOfRelativeSourceFilePath = System.IO.Path.GetDirectoryName(SourceFileInfo.RelativeSourceFilePath); 1593string path = Path.GetRelativePath(TargetPath + pathOfRelativeSourceFilePath, SourceFileInfo.SourcePath); 1596return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar; 1605string[] dirs = relPath.Split(Path.DirectorySeparatorChar); 2635Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, 3327string fullFilePath = Path.GetFullPath(_splashImage); 3340relPath = TaskHelper.GetRootRelativePath(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, fullFilePath); 3349resourceId = Path.GetFileName(fullFilePath);
MS\Internal\MarkupCompiler\PathInternal.cs (6)
42relativeTo = Path.GetFullPath(relativeTo); 43path = Path.GetFullPath(path); 89sb.Append(Path.DirectorySeparatorChar); 110sb.Append(Path.DirectorySeparatorChar); 125return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
MS\Internal\Tasks\CompilerWrapper.cs (4)
38_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 390if (!Path.IsPathRooted(filePath)) 396string fullFilePath = Path.GetFullPath(filePath); 419int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar);
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (5)
208string filepath = Path.GetFullPath(fileName); 463Path.GetFullPath(taskItem.ItemSpec), 486string curDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 494string fullPath = Path.GetFullPath(_mcPass1.ContentFiles[i].ItemSpec); 500relContentFilePath = Path.GetFileName(fullPath);
MS\Internal\Tasks\TaskHelper.cs (3)
68if (!Path.IsPathRooted(thePath) ) 74thePath = Path.GetFullPath(thePath); 94string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
564_cachedMetadataLoadContextAssembliesByNameNoExtension.Add(Path.GetFileNameWithoutExtension(fullPathToAssembly), assembly);
PresentationCore (21)
MS\Internal\FontCache\DWriteFactory.cs (3)
63localPath = Directory.GetParent(fontCollectionUri.LocalPath).FullName + Path.DirectorySeparatorChar; 71if (string.Equals((localPath.Length > 0 && localPath[localPath.Length - 1] != Path.DirectorySeparatorChar) ? localPath + Path.DirectorySeparatorChar : localPath, Util.WindowsFontsUriObject.LocalPath, StringComparison.OrdinalIgnoreCase))
MS\Internal\FontCache\FamilyCollection.cs (2)
45internal static string SxSFontsResourcePrefix { get; } = $"/{Path.GetFileNameWithoutExtension(ExternDll.PresentationCore)};component/fonts/"; 238FontSource fontSource = new FontSource(new Uri(Path.Combine(FamilyCollection.SxSFontsResourcePrefix, _systemCompositeFontsFileNames[index] + Util.CompositeFontExtension), UriKind.RelativeOrAbsolute),
MS\Internal\FontCache\FontCacheUtil.cs (2)
288private static readonly char[] InvalidFileNameChars = Path.GetInvalidFileNameChars(); 585return Path.GetExtension(unescapedPath);
MS\Internal\FontCache\FontResourceCache.cs (1)
126string extension = Path.GetExtension(fileName);
MS\Internal\FontCache\FontSourceCollection.cs (4)
74_isFileSystemFolder = localPath[localPath.Length - 1] == Path.DirectorySeparatorChar; 120if (Util.IsSupportedFontExtension(Path.GetExtension(file), out isComposite)) 144isComposite = Util.IsCompositeFont(Path.GetExtension(_uri.AbsoluteUri)); 149isComposite = Util.IsCompositeFont(Path.GetExtension(resourceName));
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (1)
210String guid = Path.GetFileNameWithoutExtension(
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
135string extensionWithDot = Path.GetExtension(docString);
src\Microsoft.DotNet.Wpf\src\Shared\System\IO\FileHelper.cs (5)
97string folderPath = Path.GetTempPath(); 101string subFolderPath = Path.Combine(folderPath, subFolder); 115string path = Path.Combine(folderPath, Path.GetRandomFileName()); 118path = Path.ChangeExtension(path, extension);
System\Windows\Input\Cursor.cs (1)
214string filePath = Path.GetTempFileName();
System\Windows\Media\ColorContext.cs (1)
567profilePath = new Uri(Path.Combine(buffer.ToString(), profilePathString));
PresentationCore.Tests (2)
System\Windows\Media\Imaging\BitmapImage.Tests.cs (2)
61string tempFile = Path.GetTempFileName(); 87string tempFile = Path.GetTempFileName();
PresentationFramework (20)
Microsoft\Win32\FileDialog.cs (5)
112string safeFN = Path.GetFileName(CriticalItemName); 143safeFileNames[i] = Path.GetFileName(unsafeFileNames[i]); 458string tempPath = Path.GetFullPath(fileName); 564if (AddExtension && !Path.HasExtension(fileName)) 572string currentExtension = Path.GetExtension(fileName);
Microsoft\Win32\OpenFolderDialog.cs (2)
99string safeFN = Path.GetFileName(CriticalItemName); 130safeFolderNames[i] = Path.GetFileName(unsafeFolderNames[i]);
MS\Internal\AppModel\ContentFilePart.cs (2)
68_fullPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), filePath);
MS\Internal\AppModel\ResourcePart.cs (3)
116if (string.Equals(Path.GetExtension(_name), ResourceContainer.BamlExt, StringComparison.OrdinalIgnoreCase)) 121if (string.Equals(Path.GetExtension(_name), ResourceContainer.XamlExt, StringComparison.OrdinalIgnoreCase)) 124string newName = Path.ChangeExtension(_name, ResourceContainer.BamlExt);
MS\Internal\IO\Packaging\PackageFilter.cs (1)
594string extension = Path.GetExtension(path);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (2)
100private static readonly string _currentModuleDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 123_moduleHandle = Platform.LoadLibraryExW(System.IO.Path.Combine(_currentModuleDirectory, fileName), IntPtr.Zero, /* LOAD_WITH_ALTERED_SEARCH_PATH */ 8);
MS\Win32\UxThemeWrapper.cs (1)
263themeName = Path.GetFileNameWithoutExtension(themeName);
System\Windows\Documents\Speller.cs (1)
1557tempFolder = System.IO.Path.GetTempPath();
System\Windows\Shell\JumpList.cs (2)
129itemPath = Path.GetFullPath(itemPath); 990return ShellUtil.GetShellItemForPath(Path.GetFullPath(jumpPath.Path));
System\Windows\SystemParameters.cs (1)
5533_uxThemeName = System.IO.Path.GetFileNameWithoutExtension(name);
PresentationUI (11)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
98_filename = Path.GetFileName(_uri.LocalPath);
MS\Internal\Documents\Application\DocumentStream.cs (4)
808file = Path.GetFileNameWithoutExtension(path); 819Path.GetDirectoryName(path), 820Path.DirectorySeparatorChar, 955if (!Path.GetExtension(location.LocalPath).Equals(
MS\Internal\Documents\Application\FilePresentation.cs (1)
86Path.GetExtension(filePath),
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
365Path.GetFileNameWithoutExtension(DocumentProperties.Current.Filename),
MS\Internal\Documents\RightsManagementManager.cs (1)
860string msdrmdllPath = Path.Combine(systemPath, msdrmDLLName);
MS\Internal\Documents\RightsManagementProvider.cs (2)
1353string applicationManifestFileLocation = Path.Combine( Path.GetDirectoryName(fileName),
MS\Internal\Documents\RMPublishingDialog.cs (1)
1001return Path.GetFileNameWithoutExtension(_template.LocalPath);
ReachFramework (4)
Packaging\XpsFixedPageReaderWriter.cs (3)
1852ReadOnlySpan<char> extension = Path.GetExtension(path).Slice(1); 1897String extension = Path.GetExtension(path); 1898String fileName = Path.GetFileNameWithoutExtension(path);
Serialization\XpsFontSubsetter.cs (1)
657string fileName = System.IO.Path.GetFileNameWithoutExtension(
Replay (25)
Replay.cs (11)
54outputDirectory = Path.Combine(Path.GetTempPath(), "replay"); 132using var compilerServerLogger = new CompilerServerLogger("replay", Path.Combine(options.OutputDirectory, "server.log")); 254var outputDirectory = Path.Combine(options.OutputDirectory, outputName); 299if (Path.IsPathRooted(argValue)) 301fileName = Path.GetFileName(argValue); 310fileName = Path.Combine(hashSet.Count.ToString(), fileName); 313var filePath = Path.Combine(outputDirectory, fileName); 314Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 321var generatedDir = Path.Combine(outputDirectory, "generated"); 342internal string TempDirectory { get; } = Path.Combine(outputDirectory, "temp");
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\BuildServerConnection.cs (7)
443var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 449commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 686clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 774var tempPath = Path.GetTempPath(); 775var result = Path.Combine(tempPath, ".roslyn"); 783FilePath = Path.Combine(mutexDirectory, name); 784GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
62var directoryName = Path.GetDirectoryName(dotNetPath); 97var filePath = Path.Combine(item, fileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
RepoTasks (34)
FileUtilities.cs (1)
32if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
GenerateTestDevCert.cs (1)
46var devCertJsonFile = Path.ChangeExtension(CertificatePath, ".json");
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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)
Program.cs (2)
17var classTargetFilePath = Path.Combine(pwd, "..", "..", "src", "ResultsOfT.Generated.cs"); 18var testsTargetFilePath = Path.Combine(pwd, "..", "..", "test", "ResultsOfTTests.Generated.cs");
Roslyn.Compilers.Extension (4)
CompilerPackage.cs (4)
37var packagePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 118var parentDirectory = new DirectoryInfo(Path.GetDirectoryName(fileAndContents.Key)); 176return Path.Combine(localAppData, $@"Microsoft\MSBuild\{version}"); 181return Path.Combine(await GetMSBuildPathAsync(cancellationToken).ConfigureAwait(true), relativePath);
Roslyn.Diagnostics.Analyzers (28)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Roslyn.Test.Performance.Utilities (36)
Benchview.cs (15)
18private static readonly string s_scriptDirectory = Path.Combine( 81var consumptionXml = Path.Combine(GetCPCDirectoryPath(), "consumptionTempResults.xml"); 87var consumptionXml = Path.Combine(GetCPCDirectoryPath(), "consumptionTempResults.xml"); 92var submissionJson = CreateSubmissionJson(s_submissionType, submissionName, s_branch, Path.Combine(s_outputDirectory, "measurement.json")); 95var uploadPy = Path.Combine(s_scriptDirectory, "upload.py"); 115var measurementPy = Path.Combine(s_scriptDirectory, "measurement.py"); 116var measurementJson = Path.Combine(s_outputDirectory, "measurement.json"); 127var submissionMetadataPy = Path.Combine(s_scriptDirectory, "submission-metadata.py"); 128var buildPy = Path.Combine(s_scriptDirectory, "build.py"); 129var machinedataPy = Path.Combine(s_scriptDirectory, "machinedata.py"); 130var submissionPy = Path.Combine(s_scriptDirectory, "submission.py"); 132var submissionMetadataJson = Path.Combine(s_outputDirectory, "submission-metadata.json"); 133var buildJson = Path.Combine(s_outputDirectory, "build.json"); 134var machinedataJson = Path.Combine(s_outputDirectory, "machinedata.json"); 153string submissionJson = Path.Combine(s_outputDirectory, "submission.json");
Logger.cs (1)
48_file = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "perf-log.txt");
RelativeDirectory.cs (2)
93public string TaoPath => Path.Combine(MyBinaries(), "exes", "EditorTestApp", "Tao"); 104var zipPath = Path.Combine(TempDirectory, zipFileName);
ScenarioGenerator.cs (1)
21_fullPath = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "scenarios.xml");
TestUtilities.cs (1)
54return Path.Combine(GetCPCDirectoryPath(), "ViBenchToJson.exe");
TraceManager.cs (3)
19var cpcFullPath = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "CPC.exe"); 66var scenariosXmlPath = Path.Combine(GetCPCDirectoryPath(), "scenarios.xml"); 67var consumptionTempResultsPath = Path.Combine(GetCPCDirectoryPath(), "ConsumptionTempResults.xml");
VsPerfTest.cs (13)
25Path.Combine(System.Environment.GetEnvironmentVariable("UserProfile"), ".nuget", "packages"); 26private static readonly string _installerPath = Path.Combine(_nugetPackagesPath, "roslyntools.vsixexpinstaller", "1.0.0-beta2-63222-01", "tools", "vsixexpinstaller.exe"); 50var dir = Path.Combine(Path.GetDirectoryName(MyWorkingDirectory), "csharp"); 54var logDirectory = Path.Combine(TempDirectory, _testName); 56Directory.CreateDirectory(Path.Combine(logDirectory, "PerfResults")); 59var taoTestFileTemplatePath = Path.Combine(dir, _testTemplateName); 61var finalTest = template.Replace("ReplaceWithActualSolutionPath", Path.Combine(TempDirectory, _zipFileToDownload, _solutionToTest)); 68File.WriteAllText(Path.Combine(TempDirectory, _testTemplateName), finalTest); 79var vsix = Path.Combine(MyBinaries(), "Vsix", "VisualStudioSetup", "Roslyn.VisualStudio.Setup.vsix"); 92ShellOutVital(TaoPath, $"{Path.Combine(TempDirectory, _testTemplateName)} -perf -host:vs -roslynonly -rootsuffix:{_rootSuffix}", TempDirectory); 94var logDirectory = Path.Combine(TempDirectory, _testName, "PerfResults"); 95ShellOutVital("xcopy", $"{logDirectory} {Path.Combine(MyBinaries(), "..", "..", "ToArchive")} /s /i /y");
Roslyn.VisualStudio.Next.UnitTests (28)
Options\VisualStudioOptionStorageTests.cs (11)
22return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 31return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 41return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 51return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 74var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 101var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 149var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 166var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 178var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 200var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 284var allOptionGroups = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location))
Remote\RemoteHostClientServiceFactoryTests.cs (1)
80(service, cancellationToken) => service.UpdateContinuouslyAsync("emptySource", Path.GetTempPath(), cancellationToken),
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"),
Services\SolutionServiceTests.cs (3)
247var dir = Path.GetDirectoryName(typeof(SolutionServiceTests).Assembly.Location); 349var configPath = Path.Combine(Path.GetTempPath(), ".editorconfig");
RulesetToEditorconfigConverter (4)
Program.cs (1)
18Path.Combine(Environment.CurrentDirectory, ".editorconfig");
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
RulesetToEditorconfigConverter.UnitTests (6)
RulesetToEditorconfigConverterTests.cs (6)
18var directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 22var ruleset = Path.Combine(directory.FullName, PrimaryRulesetName); 28var includedRuleset = Path.Combine(directory.FullName, IncludedRulesetName); 32var editorconfigPath = Path.Combine(directory.FullName, ".editorconfig");
RunTests (53)
AssemblyInfo.cs (1)
13public string AssemblyName => Path.GetFileName(AssemblyPath);
AssemblyScheduler.cs (3)
46ConsoleUtil.WriteLine($"\tAssembly: {Path.GetFileName(kvp.Key)}, Test Type Count: {typeCount}, Test Count: {testCount}"); 250var assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 251var testListPath = Path.Combine(assemblyDirectory!, "testlist.json");
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)!);
Options.cs (6)
217: Path.Combine(artifactsPath, "TestResults", configuration); 264while (path is object && Path.GetFileName(path) != "artifacts") 266path = Path.GetDirectoryName(path); 277while (dir != null && !File.Exists(Path.Combine(dir, programName))) 279dir = Path.GetDirectoryName(dir); 282return dir == null ? null : Path.Combine(dir, programName);
ProcessTestExecutor.cs (6)
97var dotnetDir = Path.GetDirectoryName(dotnetPath)!; 98var sdkDir = Path.Combine(dotnetDir, "sdk"); 106return Path.Combine(options.TestResultsDirectory, fileName); 116var rspFilePath = Path.Combine(getRspDirectory(), $"vstest_{workItemInfo.PartitionIndex}.rsp"); 123var resultsDir = Path.GetDirectoryName(resultsFilePath); 205var dirPath = Path.Combine(options.ArtifactsDirectory, "tmp", options.Configuration, "vstest-rsp");
Program.cs (8)
190var logFilePath = Path.Combine(options.LogFilesDirectory, "runtests.log"); 256var screenshotPath = Path.Combine(options.LogFilesDirectory, $"timeout.png"); 271var dumpFilePath = Path.Combine(dumpDir, $"{proc.ProcessName}-{counter}.dmp"); 283var binDirectory = Path.Combine(options.ArtifactsDirectory, "bin"); 286var name = Path.GetFileName(project); 295var configDirectory = Path.Combine(project, options.Configuration); 304var tfm = Path.GetFileName(targetFrameworkDirectory); 311var filePath = Path.Combine(targetFrameworkDirectory, fileName);
TestRunner.cs (2)
23var assembliesString = string.Join("_", Filters.Keys.Select(a => Path.GetFileNameWithoutExtension(a.AssemblyName))); 200var outputLogPath = Path.Combine(_options.LogFilesDirectory, $"xUnitFailure-{testResult.DisplayName}.log");
SemanticSearch.BuildTask (5)
GenerateFilteredReferenceAssembliesTask.cs (4)
113var referencesByName = References.ToDictionary(r => Path.GetFileNameWithoutExtension(r.ItemSpec), r => r.ItemSpec); 117var assemblyName = Path.GetFileNameWithoutExtension(specPath); 124var filteredReferencePath = Path.Combine(OutputDir, assemblyName + ".dll"); 155string outputFilePath = Path.Combine(ApisDir, assemblyName + ".txt");
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
ServerComparison.FunctionalTests (4)
Helpers.cs (4)
19var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "FunctionalTests.slnf")); 22return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "..", "..", "testassets", "ServerComparison.TestSites")); 35var content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig));
SignalR.Client.FunctionalTestApp (4)
src\SignalR\common\Shared\TestCertificates.cs (4)
35var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCert.pfx"); 41var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCertECC.pfx");
Sockets.BindTests (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Sockets.FunctionalTests (5)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
38var path = Path.GetTempFileName(); 136var path = Path.GetTempFileName();
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
StaticFilesAuth (8)
Startup.cs (8)
30var basePath = Path.Combine(HostingEnvironment.ContentRootPath, "PrivateFiles"); 31var usersPath = Path.Combine(basePath, "Users"); 47var userPath = Path.Combine(usersPath, userName); 55|| directory.FullName.StartsWith(userPath + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase); 86var files = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "PrivateFiles")); 128new DirectoryInfo(Path.GetDirectoryName(fileSystemPath)), 146return Path.Join(files.Root, path); 154return Path.Join(files.Root, path);
Stress.ApiService (2)
Program.cs (2)
294var xmlLarge = File.ReadAllText(Path.Combine("content", "books.xml")); 301var jsonLarge = File.ReadAllText(Path.Combine("content", "example.json"));
Swaggatherer (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
System.CodeDom (5)
src\libraries\Common\src\System\IO\TempFileCollection.cs (4)
132_basePath = Path.Combine( 134Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); 221Directory.Delete(Path.GetDirectoryName(BasePath));
System\CodeDom\Compiler\CodeValidator.cs (1)
17private static readonly SearchValues<char> s_invalidPathChars = SearchValues.Create(Path.GetInvalidPathChars());
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
50return ExtensionsParsed.Contains(Path.GetExtension(fileName).ToLowerInvariant());
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (1)
90var path = Path.Combine(location, probingPath);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
17using IOPath = System.IO.Path; 741var fullPath = IOPath.GetFullPath(path);
System.ComponentModel.TypeConverter (3)
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
98string fileName = Path.GetFileName(location);
System\ComponentModel\LicFileLicenseProvider.cs (1)
81string? moduleDir = Path.GetDirectoryName(modulePath);
System\ComponentModel\SyntaxCheck.cs (1)
61return Path.IsPathRooted(value);
System.Configuration.ConfigurationManager (41)
src\libraries\Common\src\System\IO\TempFileCollection.cs (4)
132_basePath = Path.Combine( 134Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); 221Directory.Delete(Path.GetDirectoryName(BasePath));
System\Configuration\AppSettingsSection.cs (2)
102: Path.Combine(Path.GetDirectoryName(configFile), File);
System\Configuration\BaseConfigurationRecord.cs (1)
3201if (string.IsNullOrEmpty(configSource) || Path.IsPathRooted(configSource))
System\Configuration\ClientConfigPaths.cs (11)
46ApplicationUri = Path.GetFullPath(exePath); 67ApplicationUri = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, exeAssembly.ManifestModule.Name); 100if (!Path.IsPathRooted(externalConfigPath)) 102externalConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, externalConfigPath); 105ApplicationConfigUri = Path.GetFullPath(externalConfigPath); 116Path.ChangeExtension(ApplicationUri, ".dll") : ApplicationUri + ".dll"; 156if (Path.IsPathRooted(roamingFolderPath)) 163if (Path.IsPathRooted(localFolderPath)) 226return Path.Combine(path1, path2); 263else if (Uri.TryCreate(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, assembly.ManifestModule.Name), UriKind.Absolute, out Uri codeBase)) 379foreach (char c in Path.GetInvalidFileNameChars()) validated = validated.Replace(c, '_');
System\Configuration\ClientConfigurationHost.cs (6)
49s_machineConfigFilePath = Path.Combine(Path.Combine(directory, MachineConfigSubdirectory), 154_fileMap.MachineConfigFilename = Path.GetFullPath(fileMap.MachineConfigFilename); 160_fileMap.ExeConfigFilename = Path.GetFullPath(exeFileMap.ExeConfigFilename); 163_fileMap.RoamingUserConfigFilename = Path.GetFullPath(exeFileMap.RoamingUserConfigFilename); 166_fileMap.LocalUserConfigFilename = Path.GetFullPath(exeFileMap.LocalUserConfigFilename);
System\Configuration\Configuration.cs (1)
213filename = string.IsNullOrEmpty(filename) ? null : Path.GetFullPath(filename);
System\Configuration\Internal\InternalConfigHost.cs (6)
194if (!Path.IsPathRooted(streamName)) throw ExceptionUtil.ParameterInvalid(nameof(streamName)); 197streamName = Path.GetFullPath(streamName); 201string result = Path.Combine(dirStream, configSource); 202result = Path.GetFullPath(result); 241string dir = Path.GetDirectoryName(streamName); 298return Path.IsPathRooted(streamName);
System\Configuration\LocalFileSettingsProvider.cs (1)
327file = Path.Combine(previousDirectory.FullName, ConfigurationManagerInternalFactory.Instance.UserConfigFilename);
System\Configuration\NameValueFileSectionHandler.cs (2)
40string directory = Path.GetDirectoryName(configFile); 41string sourceFileFullPath = Path.Combine(directory, filename);
System\Configuration\UrlPath.cs (2)
15return Path.GetDirectoryName(path) ?? Path.GetPathRoot(path);
System\Diagnostics\TraceUtils.cs (5)
74if ((initializeData[0] != Path.DirectorySeparatorChar) && (initializeData[0] != Path.AltDirectorySeparatorChar) && !Path.IsPathRooted(initializeData)) 80string dirPath = Path.GetDirectoryName(filePath); 83initializeData = Path.Combine(dirPath, initializeData);
System.Console (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
System.Data.Common (3)
System\Data\xmlsaver.cs (3)
1094_filePath = Path.GetDirectoryName(fs.Name); 1095_fileName = Path.GetFileNameWithoutExtension(fs.Name); 1096_fileExt = Path.GetExtension(fs.Name);
System.Data.Odbc (1)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
651return Path.GetFullPath(filename);
System.Diagnostics.FileVersionInfo (2)
System\Diagnostics\FileVersionInfo.cs (2)
296if (!Path.IsPathFullyQualified(fileName)) 298fileName = Path.GetFullPath(fileName);
System.Diagnostics.Process (13)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
138currentCGroupMemoryPath = Path.GetDirectoryName(currentCGroupMemoryPath);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
66module = new ProcessModule(parsedLine.Path, Path.GetFileName(parsedLine.Path))
System\Diagnostics\ProcessManager.Linux.cs (2)
137string dirName = Path.GetFileName(taskDir); 179string dirName = Path.GetFileName(procDir);
System\Diagnostics\ProcessUtils.cs (2)
26StringParser pathParser = new(pathEnvVar, Path.PathSeparator, skipEmpty: true); 30string path = Path.Combine(subPath, program);
System\Diagnostics\ProcessUtils.Unix.cs (7)
211if (Path.IsPathRooted(filename)) 231workingDirectory = workingDirectory != null ? Path.GetFullPath(workingDirectory) : 233string filenameInWorkingDirectory = Path.Combine(workingDirectory, filename); 340if (Path.IsPathRooted(filename)) 353path = Path.Combine(Path.GetDirectoryName(path)!, filename); 363path = Path.Combine(Directory.GetCurrentDirectory(), filename);
System.Diagnostics.TextWriterTraceListener (4)
System\Diagnostics\TextWriterTraceListener.cs (4)
227string fullPath = Path.GetFullPath(_fileName); 228string dirPath = Path.GetDirectoryName(fullPath)!; 229string fileNameOnly = Path.GetFileName(fullPath); 242fullPath = Path.Combine(dirPath, fileNameOnly);
System.Drawing.Common (14)
System\Drawing\Bitmap.cs (1)
34filename = Path.GetFullPath(filename);
System\Drawing\Icon.cs (1)
157filePath = Path.GetFullPath(filePath);
System\Drawing\Image.cs (3)
92filename = Path.GetFullPath(filename); 98filename = Path.GetFullPath(filename); 395string? directoryPart = Path.GetDirectoryName(filename);
System\Drawing\Imaging\ImageAttributes.cs (1)
290Path.GetFullPath(colorProfileFilename);
System\Drawing\Imaging\Metafile.cs (5)
62Path.GetFullPath(filename); 210Path.GetFullPath(fileName); 402Path.GetFullPath(fileName); 427Path.GetFullPath(fileName); 586Path.GetFullPath(fileName);
System\Drawing\ToolboxBitmapAttribute.cs (3)
153string? ext = Path.GetExtension(imageFile); 250if (string.Equals(Path.GetExtension(imageName), ".ico", StringComparison.CurrentCultureIgnoreCase)) 254else if (string.Equals(Path.GetExtension(imageName), ".bmp", StringComparison.CurrentCultureIgnoreCase))
System.Drawing.Common.Tests (19)
Helpers.cs (1)
69private static string GetTestPath(string directoryName, string fileName) => Path.Join(AppContext.BaseDirectory, directoryName, fileName);
mono\System.Drawing\BitmapTests.cs (2)
297sRslt = Path.GetFullPath(sSub); 780string filename = Path.GetTempFileName();
System\Drawing\IconConverterTests.cs (1)
21_icon = new Icon(Path.Join("bitmaps", "TestIcon.ico"));
System\Drawing\IconTests.cs (3)
358string bitmapPathRoot = Path.GetPathRoot(bitmapPath); 812Icon.ExtractIcon(Path.GetRandomFileName() + ".ico", 0, 16); 817Icon.ExtractIcon(Path.GetRandomFileName() + ".ico", 0);
System\Drawing\ImageAnimator.ManualTests.cs (4)
10public static string OutputFolder { get; } = Path.Join(Environment.CurrentDirectory, "ImageAnimatorManualTests", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); 47string testOutputFolder = Path.Join(OutputFolder, Path.GetFileNameWithoutExtension(imageName)); 60animation.Save(Path.Join(testOutputFolder, $"{++frameIndexes[imageName]}_{timestamp}.jpg"), ImageFormat.Jpeg);
System\Drawing\ImageConverterTests.cs (2)
19_image = Image.FromFile(Path.Join("bitmaps", "TestImage.bmp")); 49string path = Path.Join("bitmaps", "TestImageWithOleHeader.bmp");
System\Drawing\ImageTests.cs (1)
665string badTarget = Path.Join("NoSuchDirectory", "NoSuchFile");
System\Drawing\Imaging\ImageFormatTests.cs (4)
74yield return new object[] { Path.Join("bitmaps", "nature24bits.gif"), "Gif" }; 75yield return new object[] { Path.Join("bitmaps", "nature24bits.jpg"), "Jpeg" }; 76yield return new object[] { Path.Join("bitmaps", "VisualPng.ico"), "Icon" }; 77yield return new object[] { Path.Join("bitmaps", "almogaver32bits.tif"), "Tiff" };
System\Drawing\Text\PrivateFontCollectionTests.cs (1)
44string relativePath = Path.Join("fonts", "CodeNewRoman.ttf");
System.Formats.Tar (47)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\Formats\Tar\TarEntry.cs (17)
332TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 356TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 365Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 370Path.IsPathFullyQualified(name) ? name : Path.Join(destinationDirectoryPath, name)); 384Path.IsPathFullyQualified(linkName) ? linkName : Path.Join(Path.GetDirectoryName(fileDestinationPath), linkName)); 399Path.Join(destinationDirectoryPath, linkName)); 414Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 417string fullPath = Path.GetFullPath(qualifiedPath); // Removes relative segments 467Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 530string? directoryPath = Path.GetDirectoryName(filePath); 532if (!string.IsNullOrEmpty(directoryPath) && !Path.Exists(directoryPath)) 537if (!Path.Exists(filePath)) 560Debug.Assert(!Path.Exists(destinationFileName)); 576Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarFile.cs (14)
74sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 142sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 188sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 189destinationFileName = Path.GetFullPath(destinationFileName); 251sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 252destinationFileName = Path.GetFullPath(destinationFileName); 316destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 384destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 432sourceFileName = Path.GetFullPath(sourceFileName); 433destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 501sourceFileName = Path.GetFullPath(sourceFileName); 502destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 725Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 734Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath));
System\Formats\Tar\TarHeader.Write.cs (5)
1165ReadOnlySpan<char> dirName = Path.GetDirectoryName(_name.AsSpan()); 1168ReadOnlySpan<char> fileName = Path.GetFileName(_name.AsSpan()); 1172$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}{Path.DirectorySeparatorChar}" : 1187ReadOnlySpan<char> tmp = Path.TrimEndingDirectorySeparator(Path.GetTempPath());
System\Formats\Tar\TarHelpers.cs (1)
453=> c == Path.DirectorySeparatorChar;
System\Formats\Tar\TarHelpers.Unix.cs (3)
25string filename = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
System\Formats\Tar\TarWriter.cs (2)
411string fullPath = Path.GetFullPath(fileName); 412string? actualEntryName = string.IsNullOrEmpty(entryName) ? Path.GetFileName(fileName) : entryName;
System.IO.Compression (2)
System\IO\Compression\ZipArchiveEntry.cs (2)
131_externalFileAttr = entryName.EndsWith(Path.DirectorySeparatorChar) || entryName.EndsWith(Path.AltDirectorySeparatorChar)
System.IO.Compression.ZipFile (14)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\Compression\ZipFile.Create.cs (3)
489sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 490destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName); 509return Path.GetFullPath(sourceDirectoryName);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs (2)
85tempPath = Path.GetTempFileName(); 129Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.cs (7)
76tempPath = Path.GetTempFileName(); 164if (!destinationDirectoryFullPath.EndsWith(Path.DirectorySeparatorChar)) 166char sep = Path.DirectorySeparatorChar; 170fileDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectoryFullPath, ArchivingUtils.SanitizeEntryFilePath(source.FullName))); 175if (Path.GetFileName(fileDestinationPath).Length == 0) 194Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System.IO.FileSystem.DriveInfo (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.IO.FileSystem.Watcher (9)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\IO\FileSystemWatcher.cs (1)
376ReadOnlySpan<char> name = IO.Path.GetFileName(relativePath);
System\IO\FileSystemWatcher.Linux.cs (3)
301string name = System.IO.Path.GetFileName(directoryPath); 1021BasePath = System.IO.Path.TrimEndingDirectorySeparator(System.IO.Path.GetFullPath(fsw.Path));
System.IO.IsolatedStorage (18)
System\IO\IsolatedStorage\Helper.cs (2)
71if (Path.GetFileName(directory)?.Length == 12) 75if (Path.GetFileName(subdirectory)?.Length == 12)
System\IO\IsolatedStorage\Helper.NonMobile.cs (4)
26dataDirectory = Path.Combine(dataDirectory, IsolatedStorageDirectoryName); 49randomDirectory = Path.Combine(rootDirectory, Path.GetRandomFileName(), Path.GetRandomFileName());
System\IO\IsolatedStorage\IsolatedStorage.cs (1)
115get { return Path.DirectorySeparatorChar; }
System\IO\IsolatedStorage\IsolatedStorageFile.cs (8)
177return Directory.EnumerateFiles(RootDirectory, searchPattern).Select(f => Path.GetFileName(f)).ToArray(); 201return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m)!.Length + 1)).ToArray(); 548if (partialPath[i] != Path.DirectorySeparatorChar && partialPath[i] != Path.AltDirectorySeparatorChar) 556return Path.Combine(RootDirectory, partialPath); 627parentDirectory = Path.GetDirectoryName(parentDirectory); 716private static bool IsIdFile(string file) => string.Equals(Path.GetFileName(file), "identity.dat"); 718private static bool IsInfoFile(string file) => string.Equals(Path.GetFileName(file), "info.dat");
System\IO\IsolatedStorage\IsolatedStorageFile.NonMobile.cs (3)
64string directoryName = Path.GetFileName(directory); 74return Path.GetDirectoryName(RootDirectory.TrimEnd(Path.DirectorySeparatorChar));
System.IO.MemoryMappedFiles (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (2)
310string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
System.IO.Packaging (6)
System\IO\Packaging\PackUriHelper.cs (6)
206string file = Path.GetFileName(partName); 214partName = Path.Combine(partName, RelationshipPartSegmentName, file); // Adding the "_rels" segment and the last segment back 262string partNameWithoutExtension = Path.GetFileNameWithoutExtension(path); 274path = Path.Combine(path, partNameWithoutExtension); // Adding the last segment without ".rels" extension 693string partUriExtension = Path.GetExtension(_partUriString); 800Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension);
System.IO.Pipes (8)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\Pipes\PipeStream.Unix.cs (6)
27private static readonly char[] s_invalidFileNameChars = Path.GetInvalidFileNameChars(); 30private static readonly char[] s_invalidPathNameChars = Path.GetInvalidPathChars(); 33private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_"); 203if (Path.IsPathRooted(pipeName)) 205if (pipeName.AsSpan().ContainsAny(s_invalidPathNameChars) || pipeName.EndsWith(Path.DirectorySeparatorChar))
System.IO.Ports (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.Net.Mail (8)
System\Net\Mail\Attachment.cs (3)
296Name = Path.GetFileName(fileName); 303Name = Path.GetFileName(fileName); 312Name = Path.GetFileName(fileName);
System\Net\Mail\SmtpClient.cs (2)
364if (!Path.IsPathRooted(pickupDirectory)) 371pathAndFilename = Path.Combine(pickupDirectory, filename);
System\Net\Mime\MediaTypeMap.cs (3)
771/// The method extracts the extension from <paramref name="pathOrExtension"/> using the same logic as <see cref="Path.GetExtension(string)"/>. 793/// The method extracts the extension from <paramref name="pathOrExtension"/> using the same logic as <see cref="Path.GetExtension(ReadOnlySpan{char})"/>. 800scoped ReadOnlySpan<char> extension = Path.GetExtension(pathOrExtension);
System.Net.NetworkInformation (3)
System\Net\NetworkInformation\LinuxIPGlobalStatistics.cs (1)
36string forwardingConfigFile = Path.Combine(NetworkFiles.Ipv6ConfigFolder,
System\Net\NetworkInformation\LinuxIPInterfaceStatistics.cs (1)
26string transmitQueueLengthFilePath = Path.Combine(NetworkFiles.SysClassNetFolder, name, NetworkFiles.TransmitQueueLengthFileName);
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
41Path.Join(NetworkFiles.Ipv4ConfigFolder, _linuxNetworkInterface.Name, NetworkFiles.ForwardingFileName),
System.Net.Ping (2)
src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (2)
30string pathv4v6 = Path.Combine(folder, s_ipv4v6PingFile); 31string path = Path.Combine(folder, fileName);
System.Net.Quic (2)
System\Net\Quic\Internal\MsQuicApi.cs (2)
100? System.IO.Path.GetDirectoryName(assemblyLocation)! 103path = System.IO.Path.Combine(path, Interop.Libraries.MsQuic);
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (1)
277string? dirname = Path.GetDirectoryName(fnfe.FileName);
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
153return new UnixDomainSocketEndPoint(_path, Path.GetFullPath(_path));
System.Net.WebClient (4)
System\Net\WebClient.cs (4)
478fileName = Path.GetFullPath(fileName); 507"Content-Disposition: form-data; name=\"file\"; filename=\"" + Path.GetFileName(fileName) + "\"\r\n" + // TODO: Should the filename path be encoded? 787return new Uri(Path.GetFullPath(address)); 792return new Uri(Path.GetFullPath(address));
System.Private.CoreLib (161)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (2)
27string? directory = Path.GetDirectoryName(path); 32if (!Path.EndsInDirectorySeparator(directory))
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
131string fullPath = Path.GetFullPath(assemblyFile);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (6)
130data = Path.Combine(home, ".local", "share"); 142return Path.Combine(home, ".fonts"); 160config = Path.Combine(home, ".config"); 184string userDirsPath = Path.Combine(GetXdgConfig(homeDir), "user-dirs.dirs"); 236Path.Join(homeDir, line.AsSpan(pos, endPos - pos)) : 248return Path.Combine(homeDir, fallback);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (18)
20string fullPath = Path.GetFullPath(path); 22string? s = Path.GetDirectoryName(fullPath); 32string fullPath = Path.GetFullPath(path); 89string fullPath = Path.GetFullPath(path); 102string fullPath = Path.GetFullPath(path); 108string fullPath = Path.GetFullPath(path); 124string fullPath = Path.GetFullPath(path); 130string fullPath = Path.GetFullPath(path); 146string fullPath = Path.GetFullPath(path); 152string fullPath = Path.GetFullPath(path); 254string fullPath = Path.GetFullPath(path); 255string root = Path.GetPathRoot(fullPath)!; 266Environment.CurrentDirectory = Path.GetFullPath(path); 274FileSystem.MoveDirectory(Path.GetFullPath(sourceDirName), Path.GetFullPath(destDirName)); 279string fullPath = Path.GetFullPath(path); 285string fullPath = Path.GetFullPath(path); 311string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
20string fullPath = Path.GetFullPath(path); 31string tempPath = Path.GetTempPath();
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (13)
20fullPath: Path.GetFullPath(path), 34fullPath = isNormalized ? fullPath : Path.GetFullPath(fullPath); 53Path.GetFileName(Path.TrimEndingDirectorySeparator(fullPath))).ToString(); 67string? parentName = Path.GetDirectoryName(PathInternal.IsRoot(FullPath.AsSpan()) ? FullPath : Path.TrimEndingDirectorySeparator(FullPath)); 80if (Path.IsPathRooted(path)) 83string newPath = Path.GetFullPath(Path.Combine(FullPath, path)); 85ReadOnlySpan<char> trimmedNewPath = Path.TrimEndingDirectorySeparator(newPath.AsSpan()); 89ReadOnlySpan<char> trimmedCurrentPath = FullPath.TrimEnd(Path.DirectorySeparatorChar); 207public DirectoryInfo Root => new DirectoryInfo(Path.GetPathRoot(FullPath)!); 213string destination = Path.GetFullPath(destDirName);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.cs (1)
39if (Path.EndsInDirectorySeparator(OriginalRootDirectory) && PathInternal.StartsWithDirectorySeparator(relativePath))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (2)
88Path.TryJoin(Directory, FileName, _pathBuffer, out int charsWritten); 182Path.Join(originalRootDirectory, relativePath, fileName);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerableFactory.cs (4)
29if (Path.IsPathRooted(expression)) 45ReadOnlySpan<char> directoryName = Path.GetDirectoryName(expression.AsSpan()); 52directory = Path.Join(directory.AsSpan(), directoryName); 77if (Path.DirectorySeparatorChar != '\\')
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.cs (2)
37string path = isNormalized ? directory : Path.GetFullPath(directory); 38_rootDirectory = Path.TrimEndingDirectorySeparator(path);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
158_pending.Enqueue((Path.Join(_currentPath, entry.FileName), _remainingRecursionDepth - 1));
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);
src\libraries\System.Private.CoreLib\src\System\IO\File.Unix.cs (2)
13=> FileSystem.GetUnixFileMode(Path.GetFullPath(path)); 19=> FileSystem.SetUnixFileMode(Path.GetFullPath(path), mode);
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (9)
28FullPath = isNormalized ? fullPath ?? originalPath : Path.GetFullPath(fullPath); 32public override string Name => _name ??= Path.GetFileName(OriginalPath); 46public string? DirectoryName => Path.GetDirectoryName(FullPath); 104string destinationPath = Path.GetFullPath(destFileName); 178string fullDestFileName = Path.GetFullPath(destFileName); 184string? directoryPath = Path.GetDirectoryName(FullName); 195_name = Path.GetFileName(fullDestFileName); 210Path.GetFullPath(destinationFileName), 211destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null,
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (2)
191=> GetAttributes(handle, handle.Path, Path.GetFileName(handle.Path), continueOnError); 507Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.cs (4)
33ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 34ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 41Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator)))
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (1)
47fullPath = Path.TrimEndingDirectorySeparator(fullPath);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (9)
103if (!Directory.Exists(Path.GetDirectoryName(destFullPath))) 248string? directoryName = Path.GetDirectoryName(fullPath); 402ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 403ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 407if (OperatingSystem.IsBrowser() && Path.EndsInDirectorySeparator(sourceFullPath) && FileExists(sourceFullPath)) 432Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator))) // same names. 439&& Path.EndsInDirectorySeparator(sourceFullPath)) 732sb.Length = Path.GetDirectoryNameOffset(sb.AsSpan());
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
57if (PathInternal.IsDirectorySeparator(ch) || ch == Path.VolumeSeparatorChar)
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
102string tempPath = Path.GetTempPath();
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (9)
44if (name.Contains(Path.DirectorySeparatorChar)) 180string sessionDirectory = Path.Combine( 193string sharedMemoryFilePath = Path.Combine(sessionDirectory, id.Name); 360string sessionDirectoryPath = Path.Combine( 367string sharedMemoryFilePath = Path.Combine(sessionDirectoryPath, _id.Name); 400string sharedFilesPath = Path.Combine( 535string tempPath = Path.Combine(SharedFilesPath, SharedMemoryUniqueTempNameTemplate); 765string runtimeTempDirectory = Path.Combine( 771string sharedMemoryDirectory = Path.Combine(
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
42string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (5)
281string normalizedPath = Path.GetFullPath(path); 324requestorPath = Path.GetFullPath(requestorPath); 345string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath)!, requestedAssemblyName.Name + ".dll"); 379string fullPath = Path.GetFullPath(assemblyFile);
src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (1)
71string path = Path.Combine(_mediator.ModuleDir, fileName);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyDependencyResolver.cs (7)
101_assemblyPaths.TryAdd(Path.GetFileNameWithoutExtension(assemblyPath), assemblyPath); 107_assemblyDirectorySearchPaths = [Path.GetDirectoryName(componentAssemblyPath)!]; 130string assemblyPath = Path.Combine( 163if (unmanagedDllName.Contains(Path.DirectorySeparatorChar)) 175bool isRelativePath = !Path.IsPathFullyQualified(unmanagedDllName); 181string libraryPath = Path.Combine(searchPath, libraryName); 200return pathsList.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
860string? parentDirectory = Path.GetDirectoryName(parentAssembly.Location); 864string assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!, $"{assemblyName.Name}.dll"); 875assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!.ToLowerInvariant(), $"{assemblyName.Name}.dll");
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\LibraryNameVariation.Unix.cs (1)
36bool containsDelim = libName.Contains(Path.DirectorySeparatorChar);
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (6)
46startupHookParts.AddRange(diagnosticStartupHooks.Split(Path.PathSeparator)); 51startupHookParts.AddRange(startupHooksVariable.Split(Path.PathSeparator)); 107Path.DirectorySeparatorChar, 108Path.AltDirectorySeparatorChar, 118if (Path.IsPathFullyQualified(startupHookPart)) 163Debug.Assert(Path.IsPathFullyQualified(startupHook.Path));
src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (3)
404string lockFileDirectory = Path.Combine( 415string sessionDirectory = Path.Combine(lockFileDirectory, Id.GetSessionDirectoryName()); 422string lockFilePath = Path.Combine(sessionDirectory, Id.Name);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (10)
80if (Path.IsPathRooted(id) || IdContainsAnyDisallowedChars(id)) 88string timeZoneFilePath = Path.Combine(timeZoneDirectory, id); 162var fileName = Path.Combine(GetTimeZoneDirectory(), TimeZoneFileName); 251symlinkPath = Path.GetFullPath(symlinkPath, Path.GetDirectoryName(tzFilePath)!); 314string localtimeFilePath = Path.Combine(timeZoneDirectory, "localtime"); 315string posixrulesFilePath = Path.Combine(timeZoneDirectory, "posixrules"); 436TryLoadTzFile(Path.Combine(GetTimeZoneDirectory(), "localtime"), ref rawData, ref id); 453tzFilePath = Path.Combine(GetTimeZoneDirectory(), tzVariable); 513else if (!tzDirectory.EndsWith(Path.DirectorySeparatorChar))
src\System\Reflection\RuntimeModule.cs (1)
505int i = s.LastIndexOf(IO.Path.DirectorySeparatorChar);
System.Private.Windows.Core.TestUtilities (6)
FileCleanupTestBase.cs (3)
19_testDirectory = Path.Join(Path.GetTempPath(), GetUniqueName()); 46public string GetTestFilePath() => Path.Join(TestDirectory, GetTestFileName());
TempFile.cs (3)
85string file = $"{IO.Path.GetRandomFileName()}_{memberName}_{lineNumber}"; 86return IO.Path.Join(IO.Path.GetTempPath(), file);
System.Private.Xml (7)
System\Xml\Serialization\Compilation.cs (6)
236path = Path.Combine(Path.GetDirectoryName(type.Assembly.Location)!, $"{assemblyName}.dll"); 241path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, $"{assemblyName}.dll"); 246path = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory)!, $"{assemblyName}.dll");
System\Xml\XmlResolver.cs (1)
48uri = new Uri(Path.GetFullPath(relativeUri!));
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\PathUtilities.cs (2)
20(Array.IndexOf(Path.GetInvalidFileNameChars(), '*') >= 0 ? DirectorySeparatorChar : AltDirectorySeparatorChar).ToString(); 48/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> this method doesn't check for invalid path characters.</remarks>
System\Reflection\PortableExecutable\PEReader.cs (1)
727peImageDirectory = Path.GetDirectoryName(peImagePath);
System.Reflection.MetadataLoadContext (4)
System\Reflection\PathAssemblyResolver.cs (1)
41string file = Path.GetFileNameWithoutExtension(path);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.Modules.cs (2)
44string? directoryPath = Path.GetDirectoryName(location); 45string modulePath = Path.Combine(directoryPath!, moduleName);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
53int i = s.LastIndexOf(Path.DirectorySeparatorChar);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
321[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.Caching (2)
System\Runtime\Caching\FileChangeNotificationSystem.cs (2)
98string dir = Path.GetDirectoryName(filePath); 147string dir = Path.GetDirectoryName(filePath);
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
44[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\RuntimeEnvironment.cs (3)
22if (!Path.IsPathRooted(runtimeDirectory)) 27char sep = Path.DirectorySeparatorChar; 28return string.Concat(Path.GetDirectoryName(runtimeDirectory), new ReadOnlySpan<char>(in sep));
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
123string assemblyName = System.IO.Path.GetFileName(assembly.Location);
System.Security.Cryptography (11)
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (3)
330return Path.GetFullPath(rootFile); 340string[] directories = rootDirectory.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); 344directories[i] = Path.GetFullPath(directories[i]);
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
407return Path.Combine(s_crlDir, localFileName);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (4)
207destinationFilename = Path.Combine(_storePath, thumbprint + PfxExtension); 308string builtPath = Path.Combine(_storePath, pathBuilder.ToString()); 330return Path.Combine(s_userStoreRoot, directoryName); 339string fileName = Path.GetFileName(storeName);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
425_ = Path.GetFullPath(fileName);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
27using StreamWriter sw = new StreamWriter($"{Path.Combine(path, classname)}.cs");
System.Windows.Forms (24)
System\Resources\AssemblyNamesTypeResolutionService.cs (1)
16private static readonly string s_dotNetPath = Path.Join(
System\Resources\ResXDataNode.cs (2)
133_fileRefFullPath = !Path.IsPathRooted(fileRefDetails[0]) && basePath is not null 134? Path.Join(basePath, fileRefDetails[0])
System\Resources\ResXFileRef.cs (3)
67if (path1[i] == Path.DirectorySeparatorChar) 87if (path1[i] == Path.DirectorySeparatorChar) 89relPath.Append($"..{Path.DirectorySeparatorChar}");
System\Resources\ResXResourceWriter.cs (2)
311string modifiedBasePath = Path.EndsInDirectorySeparator(BasePath) 313: $"{BasePath}{Path.DirectorySeparatorChar}";
System\Windows\Forms\Application.cs (1)
1184string path = Path.Join(basePath, CompanyName, ProductName, ProductVersion);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
407string themeFilename = Path.GetFileName(VisualStyles.VisualStyleInformation.ThemeFilename);
System\Windows\Forms\Controls\ListView\ListView.cs (1)
5170_backgroundImageFileName = Path.GetTempFileName();
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
161path = Path.GetFullPath(path);
System\Windows\Forms\Controls\ToolStrips\ProfessionalColorTable.cs (1)
1373string themeFileName = Path.GetFileName(VisualStyleInformation.ThemeFilename);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
612string mshtmlPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.System), "mshtml.dll");
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (4)
472names.Add(Path.IsPathFullyQualified(fileName) 474: Path.Join(directory, fileName)); 624if (AddExtension && !Path.HasExtension(fileName)) 630var currentExtension = Path.GetExtension(fileName.AsSpan());
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (2)
370string? parent = Path.GetDirectoryName(selectedPath); 377string folder = Path.GetFileName(selectedPath);
System\Windows\Forms\Dialogs\CommonDialogs\OpenFileDialog.cs (2)
180public string SafeFileName => Path.GetFileName(FileName) ?? string.Empty; 197safePaths[i] = Path.GetFileName(fullPaths[i]);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (1)
902caption = Path.GetFileName(PInvoke.GetModuleFileNameLongPath(HINSTANCE.Null));
System\Windows\Forms\Help\Help.cs (1)
301string ext = Path.GetExtension(file is null ? url : file.LocalPath + file.Fragment).ToLower(CultureInfo.InvariantCulture);
System.Windows.Forms.Analyzers.Tests (27)
CurrentReferences.cs (13)
59WinFormsRefPath = Path.Join(RepoRootPath, "artifacts", "obj", "System.Windows.Forms", configuration, tfm, "ref", "System.Windows.Forms.dll"); 62string netCoreAppRefPath = Path.Join(RepoRootPath, ".dotnet", "packs", RefPackageName); 63if (!Directory.Exists(Path.Join(netCoreAppRefPath, netCoreRefsVersion))) 74Path.Join("ref", tfm)) 75.WithNuGetConfigFilePath(Path.Join(RepoRootPath, "NuGet.Config")); 82Path.GetFileName(v).StartsWith(major, StringComparison.InvariantCultureIgnoreCase)); 101string sdkFolderPath = Path.Join(rootFolderPath, ".dotnet", "sdk", version); 116string? testPath = Path.GetDirectoryName(typeof(CurrentReferences).Assembly.Location); 119string? currentFolderPath = Path.GetDirectoryName(testPath); 123string globalJsonPath = Path.Join(currentFolderPath, "global.json"); 131currentFolderPath = Path.GetDirectoryName(currentFolderPath); 140string globalJsonPath = Path.Join(rootFolderPath, "global.json"); 153string configJsonPath = Path.Join(sdkFolderPath, "dotnet.runtimeconfig.json");
TestFileLoader.cs (14)
25builder.Append(Path.DirectorySeparatorChar); 27builder.Append(Path.DirectorySeparatorChar); 56string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 57return await LoadTestFileAsync(Path.Join("Analyzers", toolName), testName, SourceLanguage.None).ConfigureAwait(false); 64string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 65return await LoadTestFileAsync(Path.Join("Generators", toolName), testName, SourceLanguage.None).ConfigureAwait(false); 72string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 73return await LoadTestFileAsync(Path.Join("Analyzers", toolName), testName).ConfigureAwait(false); 80string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 81return await LoadTestFileAsync(Path.Join("Analyzers", toolName), testName, SourceLanguage.VisualBasic).ConfigureAwait(false);
System.Windows.Forms.Design (3)
System\Drawing\BitmapSelector.cs (2)
37=> string.IsNullOrEmpty(Suffix) ? filePath : Path.ChangeExtension(filePath, Suffix + Path.GetExtension(filePath));
System\Windows\Forms\Design\ImageListImageEditor.cs (1)
76image.Name = Path.GetFileName(name);
System.Windows.Forms.Design.Tests (4)
System\Resources\Tools\CodeDomCompileHelper.cs (2)
29MetadataReference.CreateFromFile(Path.Join(Path.GetDirectoryName(corelibPath), "System.Runtime.dll")),
System\Resources\Tools\StronglyTypedResourceBuilderTests.cs (2)
619string expectedUrl = $"{Path.GetTempPath()}testurl1"; 643string changedUrl = $"{Path.GetTempPath()}testurl2";
System.Windows.Forms.IntegrationTests.Common (6)
TestHelpers.cs (6)
58string exePath = Path.Join( 91startInfo.WorkingDirectory = Path.GetDirectoryName(path); 185string jsonFile = Path.Join(repoRoot, "global.json"); 208string sdkPath = Path.Join(defaultSdkRoot, dotnetVersion); 244string currentDirectory = Path.GetDirectoryName(codeBasePath); 250string ret = Path.Join(currentDirectory, seek);
System.Windows.Forms.Primitives (6)
System\Windows\Forms\Internals\ThemingScope.cs (3)
84string tempFilePath = Path.Join(Path.GetTempPath(), Path.GetRandomFileName());
Windows\Win32\PInvoke.LoadLibrary.cs (3)
17string customPath = Path.Join(startupPath, Libraries.Comctl32); 18Debug.Assert(Path.IsPathFullyQualified(customPath)); 20if (Path.IsPathFullyQualified(customPath))
System.Windows.Forms.Primitives.Tests (1)
Interop\Shell32\ShellItemTests.cs (1)
14string path = Path.GetTempPath();
System.Windows.Forms.Primitives.TestUtilities (1)
PlatformDetection.Windows.cs (1)
55File.Exists(Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "System32", "httpapi.dll"));
System.Windows.Forms.Primitives.TestUtilities.Tests (1)
PathLengthTests.cs (1)
15currentPath = Path.GetFullPath(@"..\..\..\..\..\..\src", currentPath);
System.Windows.Forms.Tests (60)
System\Resources\ResXResourceReaderTests.cs (2)
19string resxPath = Path.GetFullPath(@".\Resources\AxHosts.resx"); 48string resxPath = Path.GetFullPath(@".\Resources\AxHosts.resx");
System\Windows\Forms\CursorConverterTests.cs (3)
39byte[] data = File.ReadAllBytes(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 129byte[] data = File.ReadAllBytes(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 139string fileName = Path.Join("bitmaps", "10x16_one_entry_32bit.ico");
System\Windows\Forms\CursorTests.cs (15)
60yield return new object[] { Path.Join("bitmaps", "cursor.cur"), Point.Empty }; 61yield return new object[] { Path.Join("bitmaps", "10x16_one_entry_32bit.ico"), new Point(5, 8) }; 79using MemoryStream stream = new(File.ReadAllBytes(Path.Join("bitmaps", "cursor.cur"))); 99yield return new object[] { Path.Join("bitmaps", "nature24bits.jpg") }; 100yield return new object[] { Path.Join("bitmaps", "nature24bits.gif") }; 101yield return new object[] { Path.Join("bitmaps", "1bit.png") }; 102yield return new object[] { Path.Join("bitmaps", "almogaver24bits.bmp") }; 103yield return new object[] { Path.Join("bitmaps", "telescope_01.wmf") }; 104yield return new object[] { Path.Join("bitmaps", "milkmateya01.emf") }; 105yield return new object[] { Path.Join("bitmaps", "EmptyFile") }; 329using Cursor sourceCursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 344Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 380using Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 417using Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 502using Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
System\Windows\Forms\InputLanguageTests.cs (4)
228string file = Path.Join(Path.GetTempPath(), $"install-language-{languageTag}.ps1"); 241string file = Path.Join(Path.GetTempPath(), $"uninstall-language-{languageTag}.ps1");
System\Windows\Forms\RichTextBoxTests.cs (3)
10681string projectDirectory = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", ".."); 10711string projectDirectory = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", ".."); 10712string filePath = Path.Join(projectDirectory, "/src/test/unit/System.Windows.Forms/TestResources/Files/Test");
System\Windows\Forms\ToolStripControlHostTests.cs (6)
402yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 403yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 1213yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 1214yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 1339yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), color }; 1340yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), color };
System\Windows\Forms\ToolStripItemTests.cs (20)
1771yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 1772yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 1867yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), 1 }; 1868yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), 1 }; 3787yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 3788yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 3817yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), -1 }; 3818yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), -1 }; 3891yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), 1 }; 3892yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), 1 }; 5605yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), color }; 5606yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), color }; 5672yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Empty, 0 }; 5673yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Red, 1 }; 5674yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Empty, 0 }; 5675yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Red, 1 }; 5739yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Empty, 0 }; 5740yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Red, 1 }; 5741yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Empty, 0 }; 5742yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Red, 1 };
System\Windows\Forms\ToolStripSeparatorTests.cs (6)
116yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 117yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 423yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 424yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 533yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), color }; 534yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), color };
TestResources\ComClasses.cs (1)
15Path.GetFullPath(@"TestResources\VB6\SimpleControl.vb6"),
System.Windows.Forms.UI.IntegrationTests (20)
DragDropTests.cs (7)
130string dragDropDirectory = Path.Join(Directory.GetCurrentDirectory(), DragDrop); 140string dragAcceptRtfSourcePath = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 147dragAcceptRtfDestPath = Path.Join(dragDropDirectory, DragAcceptRtf); 425string dragAcceptRtfPath = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 455string dragAcceptRtfPath = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 1084string dragAcceptRtf = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 1144string dragAcceptRtf = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf);
Infra\DataCollectionService.cs (9)
230return Path.Join(Path.GetFullPath(logDirectory), $"{timestamp:HH.mm.ss}-{testName}-{errorId}{logId}.{extension}"); 236return Path.Join(GetBaseLogDirectory(), "Screenshots"); 243return Path.GetFullPath(baseLogDirectory); 253string configuration = Path.GetFileName(Path.GetDirectoryName(assemblyDirectory))!; 254return Path.Join(assemblyDirectory[..binPathSeparator], "log", configuration); 257return Path.Join(assemblyDirectory, "xUnitResults"); 263return Path.GetDirectoryName(assemblyPath)!;
Infra\ScreenshotService.cs (1)
33string directory = Path.GetDirectoryName(fullPath)!;
OpenFileDialogTests.cs (3)
28dialog.InitialDirectory = Path.GetTempPath(); 40dialog.InitialDirectory = Path.GetDirectoryName(tempFile.Path); 53dialog.InitialDirectory = Path.GetDirectoryName(tempFile.Path);
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
443Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
TaskUsageLogger (2)
TaskUsageLogger.cs (2)
256evaluatedTaskAssemblyPath = Path.GetFullPath(evaluatedTaskAssemblyPath); 405string projectExtension = Path.GetExtension(projectPath);
Templates.Blazor.Tests (87)
BlazorTemplateTest.cs (1)
62var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory);
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\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
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\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
65ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 80project.TemplateOutputDir = Path.Combine(basePath, $"AspNet.{project.ProjectGuid}"); 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 49: Path.Combine("Hives", ".templateEngine")); 94.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 133var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
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\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
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\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
65ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 80project.TemplateOutputDir = Path.Combine(basePath, $"AspNet.{project.ProjectGuid}"); 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 49: Path.Combine("Hives", ".templateEngine")); 94.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 133var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
196opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 264return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
152var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
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\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
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\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
65ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 80project.TemplateOutputDir = Path.Combine(basePath, $"AspNet.{project.ProjectGuid}"); 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 49: Path.Combine("Hives", ".templateEngine")); 94.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 133var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
196opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 264return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
152var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Mvc.Tests (74)
BlazorTemplateTest.cs (4)
184var singleProjectPath = Path.Combine(project.TemplateOutputDir, $"{project.ProjectName}.csproj"); 190var multiProjectPath = Path.Combine(project.TemplateOutputDir, project.ProjectName, $"{project.ProjectName}.csproj"); 194project.TemplateOutputDir = Path.GetDirectoryName(multiProjectPath); 203var appRazorPath = Path.Combine(project.TemplateOutputDir, "Components", "App.razor");
RazorPagesTemplateTest.cs (2)
310var fullPath = Path.Combine(basePath, path); 314return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
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\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
65ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 80project.TemplateOutputDir = Path.Combine(basePath, $"AspNet.{project.ProjectGuid}"); 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 49: Path.Combine("Hives", ".templateEngine")); 94.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 133var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
196opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 264return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
152var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Tests (88)
BaselineTest.cs (1)
124var fullPath = Path.Combine(basePath, path);
ByteOrderMarkTest.cs (5)
48var filePath = Path.GetFullPath(file); 86var filePath = Path.GetFullPath(file); 107var AssetsDir = Path.Combine(currentDirectory, "Assets"); 108var path = Path.Combine(projectName, "content"); 109var templateDirectoryPath = Path.Combine(AssetsDir, path);
IdentityUIPackageTest.cs (2)
161var fullPath = Path.Combine(basePath, path); 165return File.ReadAllText(Path.Combine(basePath, path));
NewlineEndingTest.cs (12)
53.Where(f => !f.Contains($"{Path.DirectorySeparatorChar}wwwroot{Path.DirectorySeparatorChar}lib{Path.DirectorySeparatorChar}")) // Exclude third-party libraries 54.Where(f => !f.Contains($"{Path.DirectorySeparatorChar}.template.config{Path.DirectorySeparatorChar}localize{Path.DirectorySeparatorChar}")) // Exclude auto-generated localization files in localize directory 55.Where(f => !(f.Contains($"{Path.DirectorySeparatorChar}.template.config{Path.DirectorySeparatorChar}") 60var filePath = Path.GetFullPath(file); 87var AssetsDir = Path.Combine(currentDirectory, "Assets"); 88var path = Path.Combine(projectName, "content"); 89var templateDirectoryPath = Path.Combine(AssetsDir, path);
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
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\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
65ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 80project.TemplateOutputDir = Path.Combine(basePath, $"AspNet.{project.ProjectGuid}"); 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 49: Path.Combine("Hives", ".templateEngine")); 94.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 133var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
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}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
196opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 264return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
152var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Test.Utilities (26)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
TestDiscoveryWorker (3)
Program.cs (3)
47outputFilePath = Path.Combine(Path.GetDirectoryName(assemblyFilePath)!, "testlist.json"); 64string assemblyFileName = Path.GetFileName(assemblyFilePath);
TestPassApp (2)
CommonControl2.cs (2)
15string executablePath = Path.GetDirectoryName(executable); 16string page = Path.Join(executablePath, "HTMLPage1.html");
TestProject.AppHost (1)
TestProgram.cs (1)
73var serviceAPath = Path.Combine(Projects.TestProject_AppHost.ProjectPath, @"..\TestProject.ServiceA\TestProject.ServiceA.csproj");
TestTasks (3)
InjectRequestHandler.cs (3)
59var outputFolder = Path.GetDirectoryName(depsFile); 61File.Copy(Path.Combine(outputFolder, bitnessString, aspnetcoreV2Name), Path.Combine(outputFolder, aspnetcoreV2Name), overwrite: true);
Text.Analyzers (28)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
ThreadSafeTaskAnalyzer.Tests (2)
TestHelpers.cs (2)
201var runtimeDir = System.IO.Path.GetDirectoryName(typeof(object).Assembly.Location); 204var systemRuntime = System.IO.Path.Combine(runtimeDir, "System.Runtime.dll");
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
317return System.IO.Path.GetFileName(sb.ToString().ToLower(CultureInfo.InvariantCulture));
vbc (14)
src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 111var tempDir = Path.GetTempPath();
src\Compilers\Shared\BuildServerConnection.cs (7)
443var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 449commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 686clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 774var tempPath = Path.GetTempPath(); 775var result = Path.Combine(tempPath, ".roslyn"); 783FilePath = Path.Combine(mutexDirectory, name); 784GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
62var directoryName = Path.GetDirectoryName(dotNetPath); 97var filePath = Path.Combine(item, fileName);
src\Compilers\Shared\Vbc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, VisualBasicCompiler.ResponseFileName);
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);
src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (2)
75AnalyzerAssemblyLoader = Microsoft.CodeAnalysis.AnalyzerAssemblyLoader.CreateNonLockingLoader(Path.Combine(Path.GetTempPath(), "VBCSCompiler", "AnalyzerAssemblyLoader"));
src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (1)
22: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache, logger)
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
79var allModules = GetAllModules(primaryModule, Path.GetDirectoryName(fullPath)!);
src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (1)
22: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache, logger)
src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 111var tempDir = Path.GetTempPath();
src\Compilers\Shared\BuildServerConnection.cs (7)
443var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 449commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 686clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 774var tempPath = Path.GetTempPath(); 775var result = Path.Combine(tempPath, ".roslyn"); 783FilePath = Path.Combine(mutexDirectory, name); 784GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
62var directoryName = Path.GetDirectoryName(dotNetPath); 97var filePath = Path.Combine(item, fileName);
VBCSCompiler.UnitTests (165)
AnalyzerConsistencyCheckerTests.cs (1)
105var result = AnalyzerConsistencyChecker.Check(Path.GetDirectoryName(TestFixture.Alpha)!, analyzerReferences, assemblyLoader, Logger);
BuildClientTests.cs (7)
332var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); 335Assert.Equal(name, BuildServerConnection.GetPipeName(path + Path.DirectorySeparatorChar)); 336Assert.Equal(name, BuildServerConnection.GetPipeName(path + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar)); 342var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); 351var path1 = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); 352var path2 = string.Format(@"Q:{0}The{0}Path", Path.DirectorySeparatorChar);
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"));
CompilerServerApiTest.cs (1)
145var vbcsFilePath = Path.Combine(toolDir, "VBCSCompiler.dll");
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");
ServerUtil.cs (3)
45tempDirectory ?? Path.GetTempPath(), 52tempDirectory ?? Path.GetTempPath(), 159internal static string DefaultClientDirectory { get; } = Path.GetDirectoryName(typeof(BuildClientTests).Assembly.Location);
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"),
VBCSCompilerServerTests.cs (2)
39var baseDirectory = Path.Combine(Path.GetTempPath(), TestBase.GetUniqueName());
Wasm.Performance.ConsoleHost (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
WindowsBase.Tests (2)
Helpers.cs (2)
14public static string GetResourcePath(string name) => Path.GetFullPath(Path.Combine("Resources", name));
WinFormsControlsTest (11)
DragDrop.cs (9)
134e.Message = $"{Path.GetFileNameWithoutExtension(files[0])}%1"; 135e.MessageReplacementToken = Path.GetExtension(files[0]); 260e.Message = $"{Path.GetFileNameWithoutExtension(files[0])}%1"; 261e.MessageReplacementToken = Path.GetExtension(files[0]); 302e.Message = $"{Path.GetFileNameWithoutExtension(files[0])}%1"; 303e.MessageReplacementToken = Path.GetExtension(files[0]); 385string dragDropDataDirectory = Path.Join( 403string nyanCatAsciiPath = Path.Join( 540Path.Join(Directory.GetCurrentDirectory(),
ListViewTest.cs (1)
254Text = Path.GetFileName(file),
MediaPlayer.cs (1)
12axWindowsMediaPlayer1.URL = Path.GetFullPath(@".\resources\media.mpg");
xunit.console (39)
CommandLine.cs (2)
83return Path.GetFullPath(fileName); 511var directory = Path.GetDirectoryName(path);
common\AssemblyResolution\AssemblyHelper.cs (1)
54var assemblyFolder = Path.GetDirectoryName(assemblyFileName);
common\AssemblyResolution\DependencyContextAssemblyCache.cs (8)
72.Select(path => Tuple.Create(Path.GetFileNameWithoutExtension(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 86.Select(path => Tuple.Create(Path.GetFileName(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 211var assemblyPath = Path.Combine(Path.GetFullPath(assemblyFolder), assemblyName); 238var resolvedAssemblyPath = assemblies.FirstOrDefault(a => string.Equals(assemblyName, Path.GetFileNameWithoutExtension(a), StringComparison.OrdinalIgnoreCase)); 241resolvedAssemblyPath = Path.GetFullPath(resolvedAssemblyPath); 281var resolvedAssemblyPath = assemblies.FirstOrDefault(a => string.Equals(formattedUnmanagedDllName, Path.GetFileName(a), StringComparison.OrdinalIgnoreCase)); 283return Path.GetFullPath(resolvedAssemblyPath);
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\ApplicationEnvironment.cs (1)
16return Path.GetFullPath(basePath);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (2)
402groupRuntimeAssemblies.Where(a => Path.GetFileName(a) != "_._"))); 414groupNativeLibraries.Where(a => Path.GetFileName(a) != "_._")));
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
116var depsJsonFile = Path.ChangeExtension(assembly.Location, DepsJsonExtension);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\AppBaseCompilationAssemblyResolver.cs (4)
50var refsPath = Path.Combine(_basePath, RefsDirectoryName); 73var sharedDirectory = Path.GetDirectoryName(sharedPath); 74var sharedRefs = Path.Combine(sharedDirectory, RefsDirectoryName); 87var assemblyFile = Path.GetFileName(assembly);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\PackageCompilationAssemblyResolver.cs (2)
49return listOfDirectories.Split(new char [] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries ); 65return new string[] { Path.Combine(basePath, ".nuget", "packages") };
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\ReferenceAssemblyPathResolver.cs (5)
65var relativeToReferenceAssemblies = Path.Combine(_defaultReferenceAssembliesPath, path); 73var name = Path.GetFileName(path); 76var fallbackFile = Path.Combine(fallbackPath, name); 94var net20Dir = Path.Combine(environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v2.0.50727"); 135return Path.Combine(
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\ResolverUtils.cs (4)
15path = Path.Combine(library.Name.ToLowerInvariant(), library.Version.ToLowerInvariant()); 18packagePath = Path.Combine(basePath, path); 29fullName = Path.GetFullPath(Path.Combine(basePath, assemblyPath));
common\AssemblyResolution\XunitPackageCompilationAssemblyResolver.cs (2)
36results = probeDirectories.Split(new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries).ToList(); 49results.Add(Path.Combine(basePath, ".nuget", "packages"));
ConsoleRunner.cs (7)
61if (!defaultDirectory.EndsWith(new string(new[] { Path.DirectorySeparatorChar }), StringComparison.Ordinal)) 62defaultDirectory += Path.DirectorySeparatorChar; 131var runnerPath = Path.GetDirectoryName(typeof(Program).GetTypeInfo().Assembly.Location); 138foreach (var dllFile in Directory.GetFiles(runnerPath, "*.dll").Select(f => Path.Combine(runnerPath, f))) 144var assembly = Assembly.Load(new AssemblyName(Path.GetFileNameWithoutExtension(dllFile))); 359var assemblyDisplayName = Path.GetFileNameWithoutExtension(assembly.AssemblyFilename); 384completionMessages.TryAdd(Path.GetFileName(assembly.AssemblyFilename), new ExecutionSummary());
Yarp.AppHost (1)
Program.cs (1)
21.WithStaticFiles(Path.Combine("..", "static-content"))