10420 references to Path
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-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);
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);
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)
50var fileExtension = Path.GetExtension(ctx.Request.Path);
CatalogService (1)
CatalogApi.cs (1)
40var path = Path.Combine(environment.ContentRootPath, "Images", item.PictureFileName);
cdac-build-tool (4)
ComposeCommand.cs (3)
48baselinesDir = System.IO.Path.GetFullPath(baselinesDir); 60templateFilePath = System.IO.Path.GetFullPath(templateFilePath); 97var directory = System.IO.Path.GetDirectoryName(outputPath);
DirectoryBaselines.cs (1)
28var name = Path.GetFileNameWithoutExtension(file);
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\roslyn\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();
crossgen2 (18)
Program.cs (6)
190compositeRootPath = Path.GetDirectoryName(inputFile.Value); 211compositeRootPath = Path.GetDirectoryName(unrootedInputFile.Value); 335string inputFileExtension = Path.GetExtension(inFilePath); 338".dll" => Path.ChangeExtension(inFilePath, 342".exe" => Path.ChangeExtension(inFilePath, 480nonLocalGenericsModule = Path.GetFileNameWithoutExtension(nonLocalGenericsModule);
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (12)
217zipFileName = zipFileName + "_" + Path.GetFileName(outputFilePath); 219zipFileName = Path.Combine(makeReproPath, Path.ChangeExtension(zipFileName, ".zip")); 337string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar; 338reproPackagePath = Path.Combine(reproFileDir, Path.GetFileName(originalPath)); 349string originalPdbPath = Path.ChangeExtension(originalPath, "pdb"); 353archive.CreateEntryFromFile(originalPdbPath, Path.ChangeExtension(reproPackagePath, "pdb")); 372string directoryName = Path.GetDirectoryName(pattern); 373string searchPattern = Path.GetFileName(pattern); 382string fullFileName = Path.GetFullPath(fileName); 384string simpleName = Path.GetFileNameWithoutExtension(fileName);
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)
300_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 301_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 302_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 307_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 308_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 309_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 316_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 317_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 318_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 328_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 329_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 330_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 335_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 336_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 339_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 343_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 353_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 354_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 359_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 360_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 369_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 370_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 381_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 382_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 417_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 424_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\roslyn\src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 111var tempDir = Path.GetTempPath();
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (7)
452var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 458commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 695clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 783var tempPath = Path.GetTempPath(); 784var result = Path.Combine(tempPath, ".roslyn"); 792FilePath = Path.Combine(mutexDirectory, name); 793GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\Csc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
66var directoryName = Path.GetDirectoryName(dotNetPath); 101var 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),
datacollector (4)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
datacollector.arm64 (4)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
dotnet (495)
BuildServer\BuildServerProvider.cs (2)
57Path.GetFileName(path).StartsWith(RazorPidFile.FilePrefix)) 77Path.Combine(
BuildServer\VBCSCompilerServer.cs (3)
19internal static readonly string VBCSCompilerPath = Path.Combine( 41var toolsetPackageDirectory = Path.Join(nuGetPackageRoot, s_toolsetPackageName); 47var vbcsCompilerPath = Path.Join(versionDirectory, s_vbcsCompilerExeFileName);
CommandFactory\CommandResolution\AppBaseDllCommandResolver.cs (1)
21var localPath = Path.Combine(SdkPaths.SdkDirectory,
CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (4)
21return new DotnetToolsCommandResolver(Path.Combine(sdkRoot, "DotnetTools")); 32_dotnetToolPath = dotnetToolPath ?? Path.Combine(SdkPaths.SdkDirectory, "DotnetTools"); 44var packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, arguments.CommandName)); 48packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, aggregatePackageId));
CommandFactory\CommandResolution\MSBuildProject.cs (3)
110{ "MSBuildExtensionsPath", Path.GetDirectoryName(msBuildExePath) } 183.FirstOrDefault(p => Path.IsPathRooted(p) && File.Exists(p)); 192return Path.Combine(intermediateOutputPath, "project.assets.json");
CommandFactory\CommandResolution\NuGetUtils.cs (1)
15return string.Equals(Path.GetFileName(path), PackagingCoreConstants.EmptyFolder, StringComparison.Ordinal);
CommandFactory\CommandResolution\PackagedCommandSpecFactory.cs (3)
39.FirstOrDefault(r => Path.GetFileNameWithoutExtension(r.Path) == commandName); 85var filePath = Path.Combine( 99var commandExtension = Path.GetExtension(commandPath);
CommandFactory\CommandResolution\PackagedCommandSpecFactoryWithCliRuntime.cs (5)
20var runtimeConfigFile = Path.ChangeExtension(commandPath, FileNameSuffixes.RuntimeConfigJson); 26Path.GetFileName(commandPath))); 67var libTFMPackageDirectory = Path.GetDirectoryName(commandPath); 68var packageDirectory = Path.Combine(libTFMPackageDirectory, "..", ".."); 69var preferCliRuntimePath = Path.Combine(packageDirectory, "prefercliruntime");
CommandFactory\CommandResolution\ProjectDependenciesCommandResolver.cs (1)
141l.RuntimeAssemblies.Any(r => Path.GetFileNameWithoutExtension(r.Path) == commandName)).ToList();
CommandFactory\CommandResolution\ProjectFactory.cs (1)
34Path.Combine(AppContext.BaseDirectory, "MSBuild.dll") :
CommandFactory\CommandResolution\ProjectToolsCommandResolver.cs (7)
170var depsFileRoot = Path.GetDirectoryName(toolLockFile.Path)!; 287var depsJsonPath = Path.Combine( 331var tempDepsFile = Path.Combine(TemporaryDirectory.CreateSubdirectory(), Path.GetRandomFileName()); 360buildRelativePath = Path.GetDirectoryName(buildRelativePath)!; 362string platformLibraryBuildFolderPath = Path.Combine(platformLibraryPath, buildRelativePath); 379Path.Combine(AppContext.BaseDirectory, "MSBuild.dll") :
CommandFactory\CommandResolution\PublishedPathCommandResolver.cs (2)
38var depsFilePath = Path.Combine(publishDirectory, $"{applicationName}.deps.json"); 48var runtimeConfigPath = Path.Combine(publishDirectory, $"{applicationName}.runtimeconfig.json");
CommandFactory\CommandResolution\PublishPathCommandSpecFactory.cs (1)
31var commandExtension = Path.GetExtension(commandPath);
CommandFactory\CommandResolution\RootedCommandResolver.cs (1)
20if (Path.IsPathRooted(commandResolverArguments.CommandName))
CommandFactory\CommandResolution\ToolPathCalculator.cs (3)
53return Path.Combine( 62return Path.Combine( 82var version = Path.GetFileName(versionDirectory);
CommandFactory\CommandResolution\WindowsExePreferredCommandSpecFactory.cs (2)
20if (Path.GetExtension(commandPath).Equals(".cmd", StringComparison.OrdinalIgnoreCase)) 51var comSpec = Environment.GetEnvironmentVariable("ComSpec") ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
Commands\Build\BuildCommand.cs (1)
36entryPointFileFullPath: Path.GetFullPath(appFilePath),
Commands\DotNetCommandFactory.cs (1)
78return createVirtualCommand(msbuildArgs, Path.GetFullPath(arg));
Commands\Format\FormatForwardingApp.cs (3)
14=> Path.Combine(AppContext.BaseDirectory, "DotnetTools/dotnet-format/dotnet-format.dll"); 17=> Path.Combine(AppContext.BaseDirectory, "DotnetTools/dotnet-format/dotnet-format.deps.json"); 20=> Path.Combine(AppContext.BaseDirectory, "DotnetTools/dotnet-format/dotnet-format.runtimeconfig.json");
Commands\Fsi\FsiForwardingApp.cs (2)
50var dllPath = Path.Combine(AppContext.BaseDirectory, FsiDllName); 57return Path.Combine(AppContext.BaseDirectory, FsiExeName);
Commands\Help\HelpCommand.cs (1)
52FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe"),
Commands\Hidden\InternalReportInstallSuccess\InternalReportInstallSuccessCommand.cs (1)
29var exeName = Path.GetFileName(result.GetValue(definition.Argument));
Commands\New\BuiltInTemplatePackageProvider.cs (4)
53string templatesRootFolder = Path.Combine(dotnetRootPath, "templates"); 60.Select(versionedFolder => Path.Combine(templatesRootFolder, versionedFolder))); 64string templatesDir = Path.Combine(sdkPath, "Templates"); 81if (SemanticVersion.TryParse(Path.GetFileName(directory), out SemanticVersion? versionInfo) && versionInfo is not null)
Commands\New\MSBuildEvaluation\MSBuildEvaluationResult.cs (1)
24string extension = Path.GetExtension(projectPath);
Commands\New\MSBuildEvaluation\MSBuildEvaluator.cs (2)
33_projectFullPath = projectPath != null ? Path.GetFullPath(projectPath) : null; 106projectPath = Path.GetFullPath(foundFiles.Single());
Commands\New\PostActions\DotnetAddPostActionProcessor.cs (2)
31return FileFindHelpers.FindFilesAtOrAbovePath(fileSystem, startPath, "*.*proj", (filename) => extensionLimiters.Contains(Path.GetExtension(filename))); 134referenceToAdd = Path.GetFullPath(relativeProjectReference, outputBasePath);
Commands\New\PostActions\DotnetRestorePostActionProcessor.cs (1)
31targetFiles = templateCreationResult.PrimaryOutputs.Select(output => Path.GetFullPath(output.Path, outputBasePath));
Commands\New\PostActions\DotnetSlnPostActionProcessor.cs (5)
25string? directory = fileSystem.DirectoryExists(outputBasePath) ? outputBasePath : Path.GetDirectoryName(outputBasePath); 44directory = Path.GetPathRoot(directory) != directory ? Directory.GetParent(directory)?.FullName : null; 67filesToAdd.Add(Path.GetFullPath(templateCreationResult.PrimaryOutputs[index].Path, outputBasePath)); 82filesToAdd.Add(Path.GetFullPath(pathString, outputBasePath)); 99IReadOnlyList<string> projectFiles = GetConfiguredFiles(action.Args, creationEffects, "projectFiles", outputBasePath, (path) => Path.GetExtension(path).EndsWith("proj", StringComparison.OrdinalIgnoreCase));
Commands\New\SdkInfoProvider.cs (3)
52sdks = NETCoreSdkResolverNativeWrapper.GetAvailableSdks(dotnetDir).Select(Path.GetFileName); 58string sdkDir = Path.Combine(dotnetDir, "sdk"); 59sdks = Directory.Exists(sdkDir) ? Directory.GetDirectories(sdkDir).Select(Path.GetFileName).Where(IsValidFxVersion) : [];
Commands\NuGet\NuGetVirtualProjectBuilder.cs (1)
27if (!Path.IsPathFullyQualified(entryPointFilePath))
Commands\Pack\PackCommand.cs (3)
44entryPointFileFullPath: Path.GetFullPath(appFilePath), 113packArgs.BasePath = Path.GetDirectoryName(packArgs.Path); 142if (args.Count > 0 && Path.GetExtension(args[0]).Equals(".nuspec", StringComparison.OrdinalIgnoreCase))
Commands\Package\Add\PackageAddCommand.cs (2)
46projectFilePath = Path.GetFullPath(projectFilePath); 56tempDgFilePath = Path.GetTempFileName();
Commands\Package\List\PackageListCommand.cs (2)
24fileOrDirectory = Path.GetFullPath(fileOrDirectory); 30string projectFile = isFileBasedApp ? Path.GetFullPath(fileOrDirectory) : GetProjectOrSolution(fileOrDirectory);
Commands\Package\Remove\PackageRemoveCommand.cs (1)
50projectFilePath = Path.GetFullPath(projectFilePath);
Commands\Project\Convert\ProjectConvertCommand.cs (52)
44string file = Path.GetFullPath(_file); 67string entryPointName = Path.GetFileNameWithoutExtension(file); 68string entryPointOutputDir = hasRefs ? Path.Combine(targetDirectory, entryPointName) : targetDirectory; 74await ValidateRefTargetDirectoriesAsync(evaluatedDirectives, Path.GetDirectoryName(file)!, 83await ConvertReferencedFilesAsync(evaluatedDirectives, Path.GetDirectoryName(file)!); 114var sourceDirectory = Path.GetDirectoryName(sourceFile)!; 145var targetFile = Path.Join(outputDirectory, Path.GetFileName(sourceFile)); 159var projectFile = Path.Join(outputDirectory, Path.GetFileNameWithoutExtension(sourceFile) + ".csproj"); 244string targetItemFullPath = Path.Combine(outputDirectory, item.RelativePath); 252string targetItemDirectory = Path.GetDirectoryName(targetItemFullPath)!; 284var refPath = refDirective.ResolvedPath ?? Path.GetFullPath(Path.Combine(sourceDirectory, refDirective.Name.Replace('\\', '/'))); 291var refName = Path.GetFileNameWithoutExtension(refPath); 292var refDir = Path.GetDirectoryName(refPath)!; 293var refTargetDirectory = Path.Combine(targetDirectory, refName); 313var refPath = refDirective.ResolvedPath ?? Path.GetFullPath(Path.Combine(sourceDirectory, refDirective.Name.Replace('\\', '/'))); 320var refName = Path.GetFileNameWithoutExtension(refPath); 321var refDir = Path.GetDirectoryName(refPath)!; 322var refTargetDirectory = Path.Combine(targetDirectory, refName); 348string sourceFileDirectory = PathUtilities.EnsureTrailingSlash(Path.GetDirectoryName(sourceFile)!); 366string itemFullPath = Path.GetFullPath(path: item.GetMetadataValue("FullPath"), basePath: sourceFileDirectory); 374string itemRelativePath = Path.GetRelativePath(relativeTo: sourceFileDirectory, path: itemFullPath); 380if (itemRelativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal)) 382itemRelativePath = Path.GetFileName(itemFullPath); 387fileNameWithoutExtension = Path.GetFileNameWithoutExtension(itemRelativePath); 388extension = Path.GetExtension(itemRelativePath); 420.Select(item => (item.ItemType, item.RelativePath, OutputFullPath: Path.GetFullPath(Path.Combine(outputDirectory, item.RelativePath)))) 439var fullPath = Path.GetFullPath(item.GetMetadataValue("FullPath"), outputDirectory); 447var entryPointOutputFullPath = Path.GetFullPath(entryPointOutputPath); 448AddExplicitProjectItem("Compile", entryPointOutputFullPath, Path.GetRelativePath(outputDirectory, entryPointOutputFullPath)); 476sourceDirectory ??= Path.GetDirectoryName(file)!; 490if (Path.IsPathFullyQualified(project.Name)) 507if (!Path.IsPathFullyQualified(project.OriginalName)) 509project = project.WithName(Path.GetRelativePath(relativeTo: outputDirectory, path: project.Name), CSharpDirective.Project.NameKind.Final); 517if (Directory.Exists(Path.Combine(sourceDirectory, project.ExpandedName))) 519var projectFileName = Path.GetFileName(project.Name); 520project = project.WithName(Path.Join(project.OriginalName, projectFileName), CSharpDirective.Project.NameKind.Final); 523project = project.WithName(Path.GetRelativePath(relativeTo: outputDirectory, path: Path.Combine(sourceDirectory, project.Name)), CSharpDirective.Project.NameKind.Final); 532var refPath = refDirective.ResolvedPath ?? Path.GetFullPath(Path.Combine(sourceDirectory, refDirective.Name.Replace('\\', '/'))); 533var refName = Path.GetFileNameWithoutExtension(refPath); 536var convertedProjectPath = Path.Combine(targetDirectory, refName, refName + ".csproj"); 537var relativePath = Path.GetRelativePath(relativeTo: outputDirectory, path: convertedProjectPath); 600string defaultValue = Path.ChangeExtension(file, null); 601string defaultValueRelative = Path.GetRelativePath(relativeTo: Environment.CurrentDirectory, defaultValue); 620string pathToValidate = string.IsNullOrWhiteSpace(path) ? defaultValue : Path.GetFullPath(path); 631targetDirectory = string.IsNullOrWhiteSpace(answer) ? defaultValue : Path.GetFullPath(answer);
Commands\Publish\PublishCommand.cs (1)
49entryPointFileFullPath: Path.GetFullPath(appFilePath),
Commands\Reference\Add\ReferenceAddCommand.cs (4)
97Path.GetRelativePath( 155(FilePath: Path.GetFullPath(argument), 167return Path.GetRelativePath(projectDirectory, Path.GetFullPath(argument)).Replace('\\', '/');
Commands\Reference\FileBasedAppReferenceEditor.cs (10)
20EntryPointFilePath = Path.GetFullPath(entryPointFilePath); 21EntryPointFileDirectory = Path.GetDirectoryName(EntryPointFilePath) 138var referencePath = Path.GetFullPath(reference); 207yield return ResolveProjectReferenceArgumentFullPath(Path.GetFullPath(reference)); 209var appRelativePath = Path.GetFullPath(Path.Combine(EntryPointFileDirectory, reference.Replace('\\', '/'))); 222=> Path.GetFullPath(Path.Combine(EntryPointFileDirectory, path.Replace('\\', '/'))); 226NormalizePath(Path.GetFullPath(left)), 227NormalizePath(Path.GetFullPath(right)),
Commands\Reference\Remove\ReferenceRemoveCommand.cs (2)
52var fullPath = Path.GetFullPath(p); 58return Path.GetRelativePath(
Commands\Restore\RestoreCommand.cs (1)
33entryPointFileFullPath: Path.GetFullPath(appFilePath),
Commands\Run\CSharpCompilerCommand.cs (24)
48private static string DotNetRootPath => field ??= Path.GetDirectoryName(Path.GetDirectoryName(SdkPath)!)!; 49private static string ClientDirectory => field ??= Path.Combine(SdkPath, "Roslyn", "bincore"); 60public string BaseDirectory => field ??= Path.GetDirectoryName(EntryPointFileFullPath)!; 61internal string BaseDirectoryWithTrailingSeparator => field ??= BaseDirectory + Path.DirectorySeparatorChar; 62internal string FileName => field ??= Path.GetFileName(EntryPointFileFullPath); 63internal string FileNameWithoutExtension => field ??= Path.GetFileNameWithoutExtension(EntryPointFileFullPath); 95tempDirectory: Path.GetTempPath(), 217private static string GetCscRspPath(string artifactsPath) => Path.Join(artifactsPath, "csc.rsp"); 231string objDir = Path.Join(ArtifactsPath, "obj", "debug"); 233string binDir = Path.Join(ArtifactsPath, "bin", "debug"); 236string assemblyAttributes = Path.Join(objDir, $".NETCoreApp,Version=v{TargetFrameworkVersion}.AssemblyAttributes.cs"); 242string globalUsings = Path.Join(objDir, $"{FileName}.GlobalUsings.g.cs"); 248string assemblyInfo = Path.Join(objDir, $"{FileName}.AssemblyInfo.cs"); 254string editorconfig = Path.Join(objDir, $"{FileName}.GeneratedMSBuildEditorConfig.editorconfig"); 260var apphostTarget = Path.Join(binDir, $"{FileNameWithoutExtension}{FileNameSuffixes.CurrentPlatform.Exe}"); 264var apphostSource = Path.Join(SdkPath, "..", "..", "packs", $"Microsoft.NETCore.App.Host.{rid}", RuntimeVersion, "runtimes", rid, "native", $"apphost{FileNameSuffixes.CurrentPlatform.Exe}"); 272var runtimeConfig = Path.Join(binDir, $"{FileNameWithoutExtension}{FileNameSuffixes.RuntimeConfigJson}"); 354string runtimeConfigPath = Path.Combine(SdkPath, "dotnet.runtimeconfig.json"); 370var executingRuntimeVersion = Path.GetFileName(Path.GetDirectoryName(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory())); 410var packRoot = Path.Join(DotNetRootPath, "packs", "Microsoft.NETCore.App.Ref", RuntimeVersion); 411var frameworkListPath = Path.Join(packRoot, "data", "FrameworkList.xml"); 436yield return $"{argPrefix}{Path.Join(packRoot, filePath)}";
Commands\Run\EnvironmentVariablesToMSBuild.cs (7)
98string projectDirectory = Path.GetDirectoryName(projectFilePath) ?? ""; 101string normalized = intermediateOutputPath?.Replace('\\', Path.DirectorySeparatorChar) ?? ""; 103? Path.Combine(projectDirectory, Constants.ObjDirectoryName) 104: Path.IsPathRooted(normalized) 106: Path.Combine(projectDirectory, normalized); 110string propsFilePath = Path.GetFullPath(Path.Combine(objDir, propsFileName));
Commands\Run\RunCommand.cs (11)
397var workingDirectory = launchSettings.WorkingDirectory ?? Path.GetDirectoryName(ProjectOrEntryPointPath); 674command.EnvironmentVariable(rootVariableName, Path.GetDirectoryName(new Muxer().MuxerPath)); 681var exePath = Path.Join(artifactsPath, "bin", "debug", Path.GetFileNameWithoutExtension(entryPointFileFullPath) + FileNameSuffixes.CurrentPlatform.Exe); 743entryPointFilePath = Path.GetFullPath(filePath); 758if (Path.DirectorySeparatorChar != '\\') 814arg = Path.GetFullPath(arg); 933string directory = VirtualProjectBuilder.GetTempSubpath(Path.GetRandomFileName()); 935entryPointFilePath = Path.Join(directory, "app.cs"); 1223? Path.GetDirectoryName(ProjectFileFullPath) 1228if (Directory.Exists(Path.Combine(currentDir, ".git")))
Commands\Run\RunTelemetry.cs (1)
104? Path.GetRelativePath(repoRoot, projectFilePath)
Commands\Run\VirtualProjectBuildingCommand.cs (9)
545var entryPointFileDirectory = Path.GetDirectoryName(Builder.EntryPointFileFullPath); 558var fullPath = Path.GetFullPath( 801string implicitBuildFilePath = Path.Join(directory.FullName, implicitBuildFile.Name); 827var successCacheFile = new FileInfo(Path.Join(artifactsDirectory, BuildSuccessCacheFileName)); 835var startCacheFile = new FileInfo(Path.Join(artifactsDirectory, BuildStartCacheFileName)); 864Path.IsPathFullyQualified(previousRunCommand) && 1031return DeserializeCacheEntry(Path.Join(Builder.ArtifactsPath, BuildSuccessCacheFileName)); 1165File.WriteAllText(Path.Join(directory, BuildStartCacheFileName), Builder.EntryPointFileFullPath); 1175string successCacheFile = Path.Join(Builder.ArtifactsPath, BuildSuccessCacheFileName);
Commands\Sdk\Check\SdkCheckCommand.cs (1)
34var configFilePath = Path.Combine(_dotnetPath, "sdk", dotnetVersion ?? Product.Version, "sdk-check-config.json");
Commands\Solution\Add\SolutionAddCommand.cs (17)
32return "/" + string.Join("/", PathUtility.GetPathWithDirectorySeparator(path).Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) + "/"; 38&& !Path.IsPathRooted(relativePath) // This means path is in a different volume 66var fullPath = Path.GetFullPath(project); 95relativeSolutionFolderPath = Path.GetDirectoryName(relativeProjectPath); 99if (relativeSolutionFolderPath.Split(Path.DirectorySeparatorChar).LastOrDefault() == Path.GetFileNameWithoutExtension(relativeProjectPath)) 101relativeSolutionFolderPath = Path.Combine([.. relativeSolutionFolderPath.Split(Path.DirectorySeparatorChar).SkipLast(1)]); 165string solutionRelativeProjectPath = Path.GetRelativePath(Path.GetDirectoryName(_solutionFileFullPath)!, fullProjectPath); 186string projectTypeGuid = solution.ProjectTypes.FirstOrDefault(t => t.Extension == Path.GetExtension(fullProjectPath))?.ProjectTypeId.ToString() 193string projectFileName = Path.GetFileName(solutionRelativeProjectPath); 203p => IsInSameFolderHierarchy(p.Parent, rootFolder) && Path.GetFileName(p.FilePath).Equals(projectFileName, StringComparison.OrdinalIgnoreCase)); 272.Select(item => Path.GetFullPath(item.EvaluatedInclude, Path.GetDirectoryName(fullProjectPath)!)); 316string parentSolutionDirectory = Path.GetDirectoryName(parentSolutionPath) ?? string.Empty; 320string parentSolutionRelativePath = Path.GetRelativePath(parentSolutionDirectory, projectPath);
Commands\Solution\List\SolutionListCommand.cs (1)
46.Select(folder => Path.GetDirectoryName(folder.Path.TrimStart('/')))];
Commands\Solution\Migrate\SolutionMigrateCommand.cs (1)
33string slnxFileFullPath = Path.ChangeExtension(slnFileFullPath, "slnx");
Commands\Solution\Remove\SolutionRemoveCommand.cs (5)
39.Select(p => Path.GetFullPath(p)) 40.Select(p => Path.GetRelativePath( 41Path.GetDirectoryName(solutionFileFullPath), 85if (project is null && !Path.HasExtension(projectPath)) 87var projectsMatchByName = solution.SolutionProjects.Where(p => Path.GetFileNameWithoutExtension(p.DisplayName).Equals(projectPath));
Commands\Test\MTP\ArtifactPostProcessingManager.cs (7)
115string tempDirectory = Path.Combine( 116Path.GetTempPath(), 124string manifestPath = Path.Combine(tempDirectory, "manifest.json"); 258return Path.GetFullPath(resultsDirectory); 278return Path.GetDirectoryName(Path.GetFullPath(preferredInput.Path))!; 329string outputExtension = Path.GetExtension(processedArtifact.Path).ToLowerInvariant();
Commands\Test\MTP\ArtifactPostProcessingPlanner.cs (2)
59.GroupBy(artifact => Path.GetExtension(artifact.Path).ToLowerInvariant(), StringComparer.Ordinal) 135Path.GetExtension(artifact.Path),
Commands\Test\MTP\IPC\NamedPipeServer.cs (2)
14private static bool IsUnix => Path.DirectorySeparatorChar == '/'; 222return Path.Combine("/tmp", name);
Commands\Test\MTP\Logger.cs (1)
60string? directoryPath = Path.GetDirectoryName(_traceFilePath);
Commands\Test\MTP\MSBuildHandler.cs (1)
54string.Join(Environment.NewLine, vsTestTestProjects.Select(module => Path.GetFileName(module.ProjectFullPath))).Red().Bold()));
Commands\Test\MTP\MSBuildUtility.cs (6)
46var solutionFile = SolutionFile.Parse(Path.GetFullPath(solutionFilePath)); 231resultsDirectory = Path.GetFullPath(resultsDirectory); 237configFile = Path.GetFullPath(configFile); 243diagnosticOutputDirectory = Path.GetFullPath(diagnosticOutputDirectory); 305else if (Path.GetExtension(token).EndsWith("proj", StringComparison.OrdinalIgnoreCase) && File.Exists(token)) 382Path.GetExtension(filePath).EndsWith("proj", StringComparison.OrdinalIgnoreCase))
Commands\Test\MTP\SolutionAndProjectUtility.cs (13)
54string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]); 55string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]); 80string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]); 81string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]); 145return (false, string.Format(CliStrings.SolutionDoesNotExist, directory + Path.DirectorySeparatorChar)); 150return (false, string.Format(CliStrings.MoreThanOneSolutionInDirectory, directory + Path.DirectorySeparatorChar)); 278visitedTraversalProjects.Add(GetTraversalVisitKey(Path.GetFullPath(projectFilePath), configuration, platform)); 298Logger.LogTrace($"Loaded project '{Path.GetFileName(projectFilePath)}' with TargetFramework '{targetFramework}', TargetFrameworks '{targetFrameworks}', IsTestProject '{projectInstance.GetPropertyValue(ProjectProperties.IsTestProject)}', and '{ProjectProperties.IsTestingPlatformApplication}' is '{projectInstance.GetPropertyValue(ProjectProperties.IsTestingPlatformApplication)}'."); 328Logger.LogTrace($"Loaded inner project '{Path.GetFileName(projectFilePath)}' has '{ProjectProperties.IsTestingPlatformApplication}' = '{projectInstance.GetPropertyValue(ProjectProperties.IsTestingPlatformApplication)}' (TFM: '{framework}')."); 342Logger.LogTrace($"Loaded inner project '{Path.GetFileName(projectFilePath)}' has '{ProjectProperties.IsTestingPlatformApplication}' = '{projectInstance.GetPropertyValue(ProjectProperties.IsTestingPlatformApplication)}' (TFM: '{framework}')."); 409Path.GetFullPath(fullPath, projectDirectory), 602var launchSettings = TryGetLaunchProfileSettings(Path.GetDirectoryName(projectFullPath)!, Path.GetFileNameWithoutExtension(projectFullPath), project.GetPropertyValue(ProjectProperties.AppDesignerFolder), buildOptions, profileName: null);
Commands\Test\MTP\Terminal\AnsiTerminal.cs (4)
177string? extension = Path.GetExtension(path); 187linkPath = Path.GetDirectoryName(linkPath) ?? linkPath; 199&& (path[_baseDirectory.Length] == Path.DirectorySeparatorChar 200|| path[_baseDirectory.Length] == Path.AltDirectorySeparatorChar))
Commands\Test\MTP\Terminal\FileUtilities.cs (2)
22string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N"));
Commands\Test\MTP\Terminal\TestProgressState.cs (1)
26public string AssemblyName { get; } = Path.GetFileName(assembly)!;
Commands\Test\MTP\TestApplication.cs (2)
312processStartInfo.Environment[Module.DotnetRootArchVariableName] = Path.GetDirectoryName(new Muxer().MuxerPath); 379Path.GetFileNameWithoutExtension(module.RunProperties.Command),
Commands\Test\MTP\ValidationUtility.cs (3)
112if (!CliConstants.SolutionExtensions.Contains(Path.GetExtension(solutionFileOrDirectory))) 129var extension = Path.GetExtension(projectOrSolutionFileOrDirectory); 148Reporter.Error.WriteLine(string.Format(CliCommandStrings.CmdNonExistentFileErrorDescription, Path.GetFullPath(filePath)));
Commands\Test\VSTest\TestCommand.cs (2)
287string expectedArtifactDirectory = Path.Combine(Path.GetTempPath(), testSessionCorrelationId);
Commands\Test\VSTest\VSTestForwardingApp.cs (2)
38return Path.Combine(AppContext.BaseDirectory, VstestAppName); 50["VSTEST_DOTNET_ROOT_PATH"] = Path.GetDirectoryName(new Muxer().MuxerPath),
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (2)
178throw new GracefulException(string.Format(CliCommandStrings.ToolInstallNuGetConfigurationFileDoesNotExist, Path.GetFullPath(_configFilePath))); 308Path.GetFullPath(_configFilePath)));
Commands\Tool\Install\ToolInstallLocalInstaller.cs (1)
33Path.GetFullPath(configFilePath)));
Commands\Workload\FileBasedWorkloadInstallationRecordRepositoryFactory.cs (2)
27=> File.Exists(Path.Combine(dotnetDir, "metadata", "workloads", sdkFeatureBand.ToString(), "userlocal")); 37return new FileBasedInstallationRecordRepository(Path.Combine(workloadRootDir, "metadata", "workloads"));
Commands\Workload\GlobalJsonWorkloadSetFile.cs (2)
14public string Path { get; } = System.IO.Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "globaljsonworkloadsets.json"); 19Directory.CreateDirectory(System.IO.Path.GetDirectoryName(Path));
Commands\Workload\Install\FileBasedInstaller.cs (47)
61_dotnetDir = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath); 73_workloadMetadataDir = Path.Combine(_workloadRootDir, "metadata", "workloads"); 108var workloadSetPath = Path.Combine(_workloadRootDir, "sdk-manifests", workloadSetFeatureBand.ToString(), "workloadsets", workloadSetVersion); 138var tempExtractionDir = Path.Combine(_tempPackagesDir.Value, $"{WorkloadManifestUpdater.WorkloadSetManifestId}-{workloadSetPackageVersion}-extracted"); 180var packagePath = Path.Combine(offlineCache.Value.Value, $"{packInfo.ResolvedPackageId}.{packInfo.Version}.nupkg"); 197if (!Directory.Exists(Path.GetDirectoryName(packInfo.Path))) 199Directory.CreateDirectory(Path.GetDirectoryName(packInfo.Path)); 208var tempExtractionDir = Path.Combine(_tempPackagesDir.Value, $"{packInfo.ResolvedPackageId}-{packInfo.Version}-extracted"); 275return Path.Combine(_workloadRootDir, "sdk-manifests", sdkFeatureBand); 280var newManifestPath = Path.Combine(GetManifestInstallDirForFeatureBand(manifestUpdate.NewFeatureBand), manifestUpdate.ManifestId.ToString(), manifestUpdate.NewVersion.ToString()); 322packagePath = Path.Combine(offlineCache.Value.Value, $"{packageId}.{packageVersion}.nupkg"); 332tempBackupDir = Path.Combine(_tempPackagesDir.Value, $"{packageId} - {packageVersion}-backup"); 368var versionDir = Path.GetDirectoryName(packagePath); 372var idDir = Path.GetDirectoryName(versionDir); 411var installedSdkFeatureBands = NETCoreSdkResolverNativeWrapper.GetAvailableSdks(_dotnetDir).Select(sdkDir => new SdkFeatureBand(Path.GetFileName(sdkDir))).ToHashSet(); 456string workloadSetDirectory = Path.Combine(GetManifestInstallDirForFeatureBand(workloadSetFeatureBand.ToString()), SdkDirectoryWorkloadManifestProvider.WorkloadSetsFolderName, workloadSetVersion); 497var manifestPath = Path.Combine(GetManifestInstallDirForFeatureBand(manifestFeatureBand.ToString()), manifestId.ToString(), manifestVersion.ToString()); 543var installationRecordDirectory = Path.GetDirectoryName(GetPackInstallRecordPath(packId, packVersion, featureBandsToRemove.First())); 554string packIdDirectory = Path.GetDirectoryName(installationRecordDirectory); 594string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, _workloadRootDir), "default.json"); 595Directory.CreateDirectory(Path.GetDirectoryName(path)); 631return Path.Combine(_workloadMetadataDir, RuntimeInformation.ProcessArchitecture.ToString(), _sdkFeatureBand.ToString(), HistoryDir); 638string logFile = Path.Combine(historyDirectory, $"{workloadHistoryRecord.TimeStarted:yyyy'-'MM'-'dd'T'HHmmss}_{workloadHistoryRecord.CommandName}.json"); 684var packIdDir = Path.GetDirectoryName(packInfo.Path); 697Path.Combine(_workloadMetadataDir, InstalledWorkloadSetsDir, "v1", workloadSetVersion, workloadSetFeatureBand.ToString(), referencingFeatureBand.ToString()); 702Directory.CreateDirectory(Path.GetDirectoryName(path)); 717var installedWorkloadSetsDir = Path.Combine(_workloadMetadataDir, InstalledWorkloadSetsDir, "v1"); 726var workloadSetVersion = Path.GetFileName(workloadSetVersionDir); 729var workloadSetFeatureBand = new SdkFeatureBand(Path.GetFileName(workloadSetFeatureBandDir)); 732var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 748Path.Combine(_workloadMetadataDir, InstalledManifestsDir, "v1", manifestId.ToString(), manifestVersion.ToString(), featureBand.ToString(), referencingFeatureBand.ToString()); 753Directory.CreateDirectory(Path.GetDirectoryName(path)); 768var installedManifestsDir = Path.Combine(_workloadMetadataDir, InstalledManifestsDir, "v1"); 777var manifestId = new ManifestId(Path.GetFileName(manifestIdDir)); 780var manifestVersion = new ManifestVersion(Path.GetFileName(manifestVersionDir)); 783var manifestFeatureBand = new SdkFeatureBand(Path.GetFileName(manifestFeatureBandDir)); 786var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 804Path.Combine(_workloadMetadataDir, InstalledPacksDir, "v1", packId, packVersion, featureBand.ToString()); 810var installedPacksDir = Path.Combine(_workloadMetadataDir, InstalledPacksDir, "v1"); 819var packId = new WorkloadPackId(Path.GetFileName(packIdDir)); 822var packVersion = Path.GetFileName(packVersionDir); 825var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(bandRecord)); 844if (!Directory.Exists(Path.GetDirectoryName(path))) 846Directory.CreateDirectory(Path.GetDirectoryName(path)); 858var packRecordVersionDir = Path.GetDirectoryName(packInstallRecord); 863var packRecordIdDir = Path.GetDirectoryName(packRecordVersionDir); 874var packInstallRecordDir = Path.Combine(_workloadMetadataDir, InstalledPacksDir, "v1", packInfo.Id, packInfo.Version);
Commands\Workload\Install\FileBasedManifestInstaller.cs (4)
41var extractionPath = Path.Combine(tempPackagesDir.Value, "dotnet-sdk-advertising-temp", $"{Path.GetFileName(nupkgPath)}-extracted"); 55Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!); 56FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(Path.Combine(extractionPath, "data"), targetPath));
Commands\Workload\Install\WorkloadAdvertisingManifestUpdater.cs (14)
102string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "default.json"); 113Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 129var workloadSetVersionFilePath = Path.Combine(advertisedPath, Constants.workloadSetVersionFileName); 173var overlayProvider = new TempDirectoryWorkloadManifestProvider(Path.Combine(_userProfileDir, "sdk-advertising", _sdkFeatureBand.ToString()), _sdkFeatureBand.ToString()); 204Path.GetFileName(path).StartsWith(manifestPackageId.ToString(), StringComparison.OrdinalIgnoreCase) && 222File.WriteAllText(Path.Combine(adManifestPath, "AdvertisedManifestFeatureBand.txt"), band.ToString()); 235File.WriteAllText(Path.Combine(adManifestPath, Constants.workloadSetVersionFileName), workloadSetVersion); 258var versionDir = Path.GetDirectoryName(packagePath); 263var idDir = Path.GetDirectoryName(versionDir); 291var manifestPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "WorkloadManifest.json"); 301var adManifestFeatureBandPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "AdvertisedManifestFeatureBand.txt"); 363private string GetAdvertisingManifestSentinelPath(SdkFeatureBand featureBand) => Path.Combine(_userProfileDir, $".workloadAdvertisingManifestSentinel{featureBand}"); 367internal static string GetAdvertisingWorkloadsFilePath(string userProfileDir, SdkFeatureBand featureBand) => Path.Combine(userProfileDir, $".workloadAdvertisingUpdates{featureBand}"); 369private string GetAdvertisingManifestPath(SdkFeatureBand featureBand, ManifestId manifestId) => Path.Combine(_userProfileDir, "sdk-advertising", featureBand.ToString(), manifestId.ToString());
Commands\Workload\Install\WorkloadGarbageCollector.cs (1)
83var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _dotnetDir), "default.json");
Commands\Workload\Install\WorkloadInstallCommand.cs (1)
240var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _workloadRootDir), "default.json");
Commands\Workload\Install\WorkloadInstallerFactory.cs (6)
31dotnetDir = string.IsNullOrWhiteSpace(dotnetDir) ? Path.GetDirectoryName(Environment.ProcessPath) : dotnetDir; 99dotnetDir ??= Path.GetDirectoryName(Environment.ProcessPath); 102var testPath = Path.Combine(dotnetDir, "metadata", Path.GetRandomFileName()); 103if (Directory.Exists(Path.GetDirectoryName(testPath))) 109Directory.CreateDirectory(Path.GetDirectoryName(testPath));
Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any()) 22.Select(path => new SdkFeatureBand(Path.GetFileName(path))); 32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir); 36.Select(file => new WorkloadId(Path.GetFileName(file))); 46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString()); 49var pathDir = Path.GetDirectoryName(path); 60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
Commands\Workload\Install\WorkloadInstallRecords\WindowsWorkloadInstallationRecordReader.cs (1)
41using RegistryKey? workloadKey = baseKey.OpenSubKey(Path.Combine(basePath, $"{sdkFeatureBand}"));
Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
35var dotnetPath = Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\Install\WorkloadResolverFactory.cs (1)
36result.DotnetPath = Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\InstallingWorkloadCommand.cs (4)
189string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _workloadRootDir), "default.json"); 384tempPath = new DirectoryPath(Path.Combine(TempDirectoryPath, "dotnet-manifest-extraction")); 385string extractedManifestsPath = Path.Combine(tempPath.Value.Value, "manifests"); 413await _workloadInstaller.ExtractManifestAsync(downloadedPackagePath, Path.Combine(extractedManifestsPath, download.Id));
Commands\Workload\Restore\WorkloadRestoreCommand.cs (7)
127.Where(s => Path.GetExtension(s).Equals(".sln", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(s).Equals(".slnx", StringComparison.OrdinalIgnoreCase)) 128.Select(Path.GetFullPath)]; 130.Where(s => Path.GetExtension(s).EndsWith("proj", StringComparison.OrdinalIgnoreCase)) 131.Select(Path.GetFullPath)]; 138p => Path.GetFullPath(p.FilePath, Path.GetDirectoryName(solutionFilePath))));
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (1)
75dotnetDir: Path.GetDirectoryName(Environment.ProcessPath),
Commands\Workload\WorkloadCommandBase.cs (1)
118TempPackagesDirectory = new DirectoryPath(Path.Combine(TempDirectoryPath, "dotnet-sdk-advertising-temp"));
Commands\Workload\WorkloadInfoHelper.cs (3)
45DotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath)!; 167var useWorkloadSets = InstallStateContents.FromPath(Path.Combine(WorkloadInstallType.GetInstallStateFolder(_currentSdkFeatureBand, UserLocalPath), "default.json")).ShouldUseWorkloadSets(); 195var dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\WorkloadInstallDetector.cs (1)
36dotnetDir = string.IsNullOrWhiteSpace(dotnetDir) ? Path.GetDirectoryName(Environment.ProcessPath) : dotnetDir;
FirstRunExperience.cs (1)
64string toolPath = Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, s_toolPathSentinelFileName);
MsbuildProject.cs (2)
277string fullPath = Path.GetFullPath(reference); 279ret.Add(Path.GetRelativePath(ProjectDirectory, fullPath));
NuGetForwardingApp.cs (1)
40return Path.Combine(
NugetPackageDownloader\NuGetPackageDownloader.cs (12)
192Directory.CreateDirectory(Path.GetDirectoryName(nupkgPath)); 291_reporter.WriteLine(CliStrings.VerifyingNuGetPackageSignature, Path.GetFileNameWithoutExtension(nupkgPath)); 297_reporter.WriteLine(CliStrings.NuGetPackageShouldNotBeSigned, Path.GetFileNameWithoutExtension(nupkgPath)); 311return Path.Combine( 346Path.GetRelativePath(targetFolder.Value, p).Equals("data/UnixFilePermissions.xml", 356Path.Combine(targetFolder.Value, fileAndPermission.Path), 416return Path.GetRelativePath(targetPath, p).StartsWith("tools" + Path.DirectorySeparatorChar) && 417(Path.GetFileName(p) == Path.GetFileNameWithoutExtension(p)); 437allowListNuspec.Contains(Path.GetFileName(f), comparer: StringComparer.OrdinalIgnoreCase))) 496string nugetConfigFileName = Path.GetFileName(packageSourceLocation.NugetConfig.Value.Value);
NugetPackageDownloader\PackageSourceLocation.cs (2)
47if (!Uri.IsWellFormedUriString(feed, UriKind.Absolute) && !Path.IsPathRooted(feed)) 49localFeedsThatIsRooted[index] = Path.GetFullPath(feed, basePath);
Parser.cs (1)
306var filePath = Path.GetFullPath(tokenToReplace);
ReleasePropertyProjectLocator.cs (10)
108return new VirtualProjectBuildingCommand(Path.GetFullPath(arg), MSBuildArgs.FromProperties(globalProps)) 143string slnFullPath = Path.GetFullPath(slnPath); 144if (!Path.Exists(slnFullPath)) 172string projectFullPath = Path.GetFullPath(project.FilePath, Path.GetDirectoryName(slnFullPath)); 216string projectFullPath = Path.GetFullPath(project.FilePath, Path.GetDirectoryName(slnPath)); 269return File.Exists(path) && Path.GetExtension(path).EndsWith("proj"); 275return File.Exists(path) && (Path.GetExtension(path).Equals(".sln") || Path.GetExtension(path).Equals(".slnx"));
SdkVulnerability\SdkReleaseMetadataCache.cs (7)
28Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, CacheDirectoryName), 52var sentinelPath = Path.Combine(_cacheDirectory, SentinelFileName); 78if (sdkVersion.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) 157var tempPath = Path.Combine(_cacheDirectory, Path.GetRandomFileName()); 174var sentinelPath = Path.Combine(_cacheDirectory, SentinelFileName); 192Path.Combine(_cacheDirectory, $"{SummaryFilePrefix}{sdkVersion}.json");
ShellShim\AppHostShimMaker.cs (6)
25appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension + ".exe"); 29appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension); 32var appHostDestinationFilePath = Path.GetFullPath(shimPath.Value); 33string entryPointFullPath = Path.GetFullPath(entryPoint.Value); 34var appBinaryFilePath = Path.GetRelativePath(Path.GetDirectoryName(appHostDestinationFilePath), entryPointFullPath);
ShellShim\ShellShimRepository.cs (5)
66string relativePathToExe = Path.GetRelativePath(_shimsDirectory.Value, toolCommand.Executable.Value); 126var tempPath = Path.Combine(_fileSystem.Directory.CreateTemporarySubdirectory(), Path.GetRandomFileName()); 206FilePath[] candidatepackagedShim = [.. packagedShims.Where(s => string.Equals(Path.GetFileName(s.Value), Path.GetFileName(GetShimPath(toolCommand).Value)))];
ShellShim\ShellShimTemplateFinder.cs (2)
58return Path.Combine(_tempDir.Value, "runtimes", rid, "native"); 63return Path.Combine(AppContext.BaseDirectory, "AppHostTemplate");
ShellShim\ZshDetector.cs (1)
24if (Path.GetFileName(environmentVariable).Equals(ZshFileName, StringComparison.OrdinalIgnoreCase))
SlnfFileHelper.cs (11)
35return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 45return path.Replace(Path.DirectorySeparatorChar, '\\'); 71var slnfDirectory = Path.GetDirectoryName(Path.GetFullPath(slnfPath)) ?? string.Empty; 72var parentSolutionFullPath = Path.GetFullPath(parentSolutionPath, slnfDirectory); 73var relativeSolutionPath = Path.GetRelativePath(slnfDirectory, parentSolutionFullPath); 99var slnfDirectory = Path.GetDirectoryName(Path.GetFullPath(slnfPath)) ?? string.Empty; 103if (Path.IsPathRooted(parentSolutionPath)) 105relativeSolutionPath = Path.GetRelativePath(slnfDirectory, parentSolutionPath);
SlnFileFactory.cs (5)
24if (string.IsNullOrWhiteSpace(slnFileOrDirectory) || slnFileOrDirectory.IndexOfAny(Path.GetInvalidPathChars()) != -1) 30return Path.GetFullPath(slnFileOrDirectory); 47return Path.GetFullPath(files.Single()); 107originalSolutionPathAbsolute = Path.GetFullPath(originalSolutionPath, Path.GetDirectoryName(filteredSolutionPath));
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26406.101\contentFiles\cs\net11.0\BuildServerConnection.cs (7)
452var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 458commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 695clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 783var tempPath = Path.GetTempPath(); 784var result = Path.Combine(tempPath, ".roslyn"); 792FilePath = Path.Combine(mutexDirectory, name); 793GuardPath = Path.Combine(mutexDirectory, ".guard");
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26406.101\contentFiles\cs\net11.0\CompilerServerLogger.cs (1)
126loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26406.101\contentFiles\cs\net11.0\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26406.101\contentFiles\cs\net11.0\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26406.101\contentFiles\cs\net11.0\RuntimeHostInfo.cs (2)
66var directoryName = Path.GetDirectoryName(dotNetPath); 101var filePath = Path.Combine(item, fileName);
src\sdk\src\Common\SdkVulnerabilityCacheReader.cs (2)
43if (sdkVersion.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) 48string summaryPath = Path.Combine(userProfileDir, CacheDirectoryName, $"{SummaryFilePrefix}{sdkVersion}.json");
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
SudoEnvironmentDirectoryOverride.cs (3)
61var userSettingsDir = Path.Combine(homeBeforeOverride, ".nuget", "NuGet"); 64.Select(fileName => Path.Combine(userSettingsDir, fileName)) 68var overriddenNugetConfig = Path.Combine(overriddenSettingsDir, Settings.DefaultSettingsFileName);
Telemetry\DevDeviceIDGetter.cs (7)
56cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceid"); 60cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 71string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 104cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceId"); 108cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 116string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 124string directory = Path.GetDirectoryName(filePath);
Telemetry\TelemetryCommonProperties.cs (1)
73{ MachineId, _userLevelCacheWriter.RunWithCacheInFilePath(Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, $"{MachineIdCacheKey}.v1.dotnetUserLevelCache"), GetMachineId) },
ToolManifest\ToolManifestFinder.cs (3)
232.Any(filename => Path.GetExtension(filename).Equals(".sln", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(filename).Equals(".slnx", StringComparison.OrdinalIgnoreCase)) 253string manifestFileLocation = Path.Combine(folderPath.Value, Constants.ToolManifestFileName);
ToolPackage\LocalToolsResolverCache.cs (1)
28cacheDirectory ?? new DirectoryPath(Path.Combine(CliFolderPathCalculator.ToolsResolverCachePath));
ToolPackage\ToolConfiguration.cs (1)
43var invalidCharacters = Path.GetInvalidFileNameChars();
ToolPackage\ToolPackageDownloader.cs (2)
74folderToDeleteOnFailure = Path.GetDirectoryName(packagePath); 87Directory.CreateDirectory(Path.GetDirectoryName(hashPath)!);
ToolPackage\ToolPackageDownloaderBase.cs (6)
60_runtimeJsonPath = runtimeJsonPathForTests ?? Path.Combine(AppContext.BaseDirectory!, "PortableRuntimeIdentifierGraph.json"); 284CreateAssetFile(packageId, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 294CreateAssetFile(ridSpecificPackage, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 311CreateAssetFile(packageId, packageVersion, _localToolDownloadDir, Path.Combine(_localToolAssetDir.Value, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 321Path.Combine(_localToolAssetDir.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 383var runtimeConfigFilePath = Path.ChangeExtension(toolPackageInstance.Command.Executable.Value, ".runtimeconfig.json");
ToolPackage\ToolPackageInstance.cs (4)
104var toolsPackagePath = Path.Combine(installPath, "tools"); 106.Select(path => NuGetFramework.ParseFolder(Path.GetFileName(path))).ToList(); 182var toolsPackagePath = Path.Combine(installPath, "tools"); 187.Select(path => NuGetFramework.ParseFolder(Path.GetFileName(path)))
ToolPackage\ToolPackageStoreAndQuery.cs (5)
15public DirectoryPath Root { get; private set; } = new DirectoryPath(Path.GetFullPath(root.Value)); 21return Root.WithSubDirectories(StagingDirectory, Path.GetRandomFileName()); 27Path.GetFileName( 66var name = Path.GetFileName(subdirectory); 93version: NuGetVersion.Parse(Path.GetFileName(subdirectory)),
dotnet-aot (122)
NativeEntryPoint.cs (2)
251string dotnetDll = Path.Join(sdkDirectory, "dotnet.dll"); 252string runtimeConfig = Path.Join(sdkDirectory, "dotnet.runtimeconfig.json");
SdkRootLocator.cs (3)
61return string.IsNullOrEmpty(modulePath) ? null : Path.GetDirectoryName(modulePath); 148static string Normalize(string path) => Path.TrimEndingDirectorySeparator(Path.GetFullPath(path));
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\AppBaseDllCommandResolver.cs (1)
21var localPath = Path.Combine(SdkPaths.SdkDirectory,
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (4)
21return new DotnetToolsCommandResolver(Path.Combine(sdkRoot, "DotnetTools")); 32_dotnetToolPath = dotnetToolPath ?? Path.Combine(SdkPaths.SdkDirectory, "DotnetTools"); 44var packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, arguments.CommandName)); 48packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, aggregatePackageId));
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\PublishedPathCommandResolver.cs (2)
38var depsFilePath = Path.Combine(publishDirectory, $"{applicationName}.deps.json"); 48var runtimeConfigPath = Path.Combine(publishDirectory, $"{applicationName}.runtimeconfig.json");
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\PublishPathCommandSpecFactory.cs (1)
31var commandExtension = Path.GetExtension(commandPath);
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\RootedCommandResolver.cs (1)
20if (Path.IsPathRooted(commandResolverArguments.CommandName))
src\sdk\src\Cli\dotnet\CommandFactory\CommandResolution\WindowsExePreferredCommandSpecFactory.cs (2)
20if (Path.GetExtension(commandPath).Equals(".cmd", StringComparison.OrdinalIgnoreCase)) 51var comSpec = Environment.GetEnvironmentVariable("ComSpec") ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
src\sdk\src\Cli\dotnet\Commands\Format\FormatForwardingApp.cs (3)
14=> Path.Combine(AppContext.BaseDirectory, "DotnetTools/dotnet-format/dotnet-format.dll"); 17=> Path.Combine(AppContext.BaseDirectory, "DotnetTools/dotnet-format/dotnet-format.deps.json"); 20=> Path.Combine(AppContext.BaseDirectory, "DotnetTools/dotnet-format/dotnet-format.runtimeconfig.json");
src\sdk\src\Cli\dotnet\Commands\Fsi\FsiForwardingApp.cs (2)
50var dllPath = Path.Combine(AppContext.BaseDirectory, FsiDllName); 57return Path.Combine(AppContext.BaseDirectory, FsiExeName);
src\sdk\src\Cli\dotnet\Commands\MSBuild\MSBuildForwardingApp.cs (1)
54string loggerTypeLocation = Path.Combine(SdkPaths.SdkDirectory, "dotnet.dll");
src\sdk\src\Cli\dotnet\Commands\Sdk\Check\SdkCheckCommand.cs (1)
34var configFilePath = Path.Combine(_dotnetPath, "sdk", dotnetVersion ?? Product.Version, "sdk-check-config.json");
src\sdk\src\Cli\dotnet\Commands\Solution\List\SolutionListCommand.cs (1)
46.Select(folder => Path.GetDirectoryName(folder.Path.TrimStart('/')))];
src\sdk\src\Cli\dotnet\Commands\Solution\Migrate\SolutionMigrateCommand.cs (1)
33string slnxFileFullPath = Path.ChangeExtension(slnFileFullPath, "slnx");
src\sdk\src\Cli\dotnet\Commands\Solution\Remove\SolutionRemoveCommand.cs (5)
39.Select(p => Path.GetFullPath(p)) 40.Select(p => Path.GetRelativePath( 41Path.GetDirectoryName(solutionFileFullPath), 85if (project is null && !Path.HasExtension(projectPath)) 87var projectsMatchByName = solution.SolutionProjects.Where(p => Path.GetFileNameWithoutExtension(p.DisplayName).Equals(projectPath));
src\sdk\src\Cli\dotnet\Commands\Test\VSTest\VSTestForwardingApp.cs (2)
38return Path.Combine(AppContext.BaseDirectory, VstestAppName); 50["VSTEST_DOTNET_ROOT_PATH"] = Path.GetDirectoryName(new Muxer().MuxerPath),
src\sdk\src\Cli\dotnet\Commands\Workload\FileBasedWorkloadInstallationRecordRepositoryFactory.cs (2)
27=> File.Exists(Path.Combine(dotnetDir, "metadata", "workloads", sdkFeatureBand.ToString(), "userlocal")); 37return new FileBasedInstallationRecordRepository(Path.Combine(workloadRootDir, "metadata", "workloads"));
src\sdk\src\Cli\dotnet\Commands\Workload\Install\FileBasedManifestInstaller.cs (4)
41var extractionPath = Path.Combine(tempPackagesDir.Value, "dotnet-sdk-advertising-temp", $"{Path.GetFileName(nupkgPath)}-extracted"); 55Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!); 56FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(Path.Combine(extractionPath, "data"), targetPath));
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadAdvertisingManifestUpdater.cs (14)
102string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "default.json"); 113Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 129var workloadSetVersionFilePath = Path.Combine(advertisedPath, Constants.workloadSetVersionFileName); 173var overlayProvider = new TempDirectoryWorkloadManifestProvider(Path.Combine(_userProfileDir, "sdk-advertising", _sdkFeatureBand.ToString()), _sdkFeatureBand.ToString()); 204Path.GetFileName(path).StartsWith(manifestPackageId.ToString(), StringComparison.OrdinalIgnoreCase) && 222File.WriteAllText(Path.Combine(adManifestPath, "AdvertisedManifestFeatureBand.txt"), band.ToString()); 235File.WriteAllText(Path.Combine(adManifestPath, Constants.workloadSetVersionFileName), workloadSetVersion); 258var versionDir = Path.GetDirectoryName(packagePath); 263var idDir = Path.GetDirectoryName(versionDir); 291var manifestPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "WorkloadManifest.json"); 301var adManifestFeatureBandPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "AdvertisedManifestFeatureBand.txt"); 363private string GetAdvertisingManifestSentinelPath(SdkFeatureBand featureBand) => Path.Combine(_userProfileDir, $".workloadAdvertisingManifestSentinel{featureBand}"); 367internal static string GetAdvertisingWorkloadsFilePath(string userProfileDir, SdkFeatureBand featureBand) => Path.Combine(userProfileDir, $".workloadAdvertisingUpdates{featureBand}"); 369private string GetAdvertisingManifestPath(SdkFeatureBand featureBand, ManifestId manifestId) => Path.Combine(_userProfileDir, "sdk-advertising", featureBand.ToString(), manifestId.ToString());
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any()) 22.Select(path => new SdkFeatureBand(Path.GetFileName(path))); 32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir); 36.Select(file => new WorkloadId(Path.GetFileName(file))); 46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString()); 49var pathDir = Path.GetDirectoryName(path); 60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\WindowsWorkloadInstallationRecordReader.cs (1)
41using RegistryKey? workloadKey = baseKey.OpenSubKey(Path.Combine(basePath, $"{sdkFeatureBand}"));
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
35var dotnetPath = Path.GetDirectoryName(Environment.ProcessPath);
src\sdk\src\Cli\dotnet\Commands\Workload\WorkloadInfoHelper.cs (3)
45DotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath)!; 167var useWorkloadSets = InstallStateContents.FromPath(Path.Combine(WorkloadInstallType.GetInstallStateFolder(_currentSdkFeatureBand, UserLocalPath), "default.json")).ShouldUseWorkloadSets(); 195var dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
src\sdk\src\Cli\dotnet\Commands\Workload\WorkloadInstallDetector.cs (1)
36dotnetDir = string.IsNullOrWhiteSpace(dotnetDir) ? Path.GetDirectoryName(Environment.ProcessPath) : dotnetDir;
src\sdk\src\Cli\dotnet\FirstRunExperience.cs (1)
64string toolPath = Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, s_toolPathSentinelFileName);
src\sdk\src\Cli\dotnet\MsbuildProject.cs (2)
277string fullPath = Path.GetFullPath(reference); 279ret.Add(Path.GetRelativePath(ProjectDirectory, fullPath));
src\sdk\src\Cli\dotnet\NuGetForwardingApp.cs (1)
40return Path.Combine(
src\sdk\src\Cli\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (12)
192Directory.CreateDirectory(Path.GetDirectoryName(nupkgPath)); 291_reporter.WriteLine(CliStrings.VerifyingNuGetPackageSignature, Path.GetFileNameWithoutExtension(nupkgPath)); 297_reporter.WriteLine(CliStrings.NuGetPackageShouldNotBeSigned, Path.GetFileNameWithoutExtension(nupkgPath)); 311return Path.Combine( 346Path.GetRelativePath(targetFolder.Value, p).Equals("data/UnixFilePermissions.xml", 356Path.Combine(targetFolder.Value, fileAndPermission.Path), 416return Path.GetRelativePath(targetPath, p).StartsWith("tools" + Path.DirectorySeparatorChar) && 417(Path.GetFileName(p) == Path.GetFileNameWithoutExtension(p)); 437allowListNuspec.Contains(Path.GetFileName(f), comparer: StringComparer.OrdinalIgnoreCase))) 496string nugetConfigFileName = Path.GetFileName(packageSourceLocation.NugetConfig.Value.Value);
src\sdk\src\Cli\dotnet\NugetPackageDownloader\PackageSourceLocation.cs (2)
47if (!Uri.IsWellFormedUriString(feed, UriKind.Absolute) && !Path.IsPathRooted(feed)) 49localFeedsThatIsRooted[index] = Path.GetFullPath(feed, basePath);
src\sdk\src\Cli\dotnet\Parser.cs (1)
306var filePath = Path.GetFullPath(tokenToReplace);
src\sdk\src\Cli\dotnet\SdkVulnerability\SdkReleaseMetadataCache.cs (7)
28Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, CacheDirectoryName), 52var sentinelPath = Path.Combine(_cacheDirectory, SentinelFileName); 78if (sdkVersion.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) 157var tempPath = Path.Combine(_cacheDirectory, Path.GetRandomFileName()); 174var sentinelPath = Path.Combine(_cacheDirectory, SentinelFileName); 192Path.Combine(_cacheDirectory, $"{SummaryFilePrefix}{sdkVersion}.json");
src\sdk\src\Cli\dotnet\ShellShim\ZshDetector.cs (1)
24if (Path.GetFileName(environmentVariable).Equals(ZshFileName, StringComparison.OrdinalIgnoreCase))
src\sdk\src\Cli\dotnet\SlnfFileHelper.cs (11)
35return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 45return path.Replace(Path.DirectorySeparatorChar, '\\'); 71var slnfDirectory = Path.GetDirectoryName(Path.GetFullPath(slnfPath)) ?? string.Empty; 72var parentSolutionFullPath = Path.GetFullPath(parentSolutionPath, slnfDirectory); 73var relativeSolutionPath = Path.GetRelativePath(slnfDirectory, parentSolutionFullPath); 99var slnfDirectory = Path.GetDirectoryName(Path.GetFullPath(slnfPath)) ?? string.Empty; 103if (Path.IsPathRooted(parentSolutionPath)) 105relativeSolutionPath = Path.GetRelativePath(slnfDirectory, parentSolutionPath);
src\sdk\src\Cli\dotnet\SlnFileFactory.cs (5)
24if (string.IsNullOrWhiteSpace(slnFileOrDirectory) || slnFileOrDirectory.IndexOfAny(Path.GetInvalidPathChars()) != -1) 30return Path.GetFullPath(slnFileOrDirectory); 47return Path.GetFullPath(files.Single()); 107originalSolutionPathAbsolute = Path.GetFullPath(originalSolutionPath, Path.GetDirectoryName(filteredSolutionPath));
src\sdk\src\Cli\dotnet\Telemetry\DevDeviceIDGetter.cs (7)
56cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceid"); 60cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 71string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 104cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceId"); 108cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 116string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 124string directory = Path.GetDirectoryName(filePath);
src\sdk\src\Cli\dotnet\Telemetry\TelemetryCommonProperties.cs (1)
73{ MachineId, _userLevelCacheWriter.RunWithCacheInFilePath(Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, $"{MachineIdCacheKey}.v1.dotnetUserLevelCache"), GetMachineId) },
src\sdk\src\Cli\dotnet\ToolManifest\ToolManifestFinder.cs (3)
232.Any(filename => Path.GetExtension(filename).Equals(".sln", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(filename).Equals(".slnx", StringComparison.OrdinalIgnoreCase)) 253string manifestFileLocation = Path.Combine(folderPath.Value, Constants.ToolManifestFileName);
src\sdk\src\Cli\dotnet\ToolPackage\LocalToolsResolverCache.cs (1)
28cacheDirectory ?? new DirectoryPath(Path.Combine(CliFolderPathCalculator.ToolsResolverCachePath));
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
dotnet-dev-certs (37)
Program.cs (2)
447reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}"); 454reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}");
src\aspnetcore\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\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 203var certificatePath = Path.GetTempFileName(); 338var certificatePath = Path.GetTempFileName(); 367Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 848var nssDb = Path.GetFullPath(path); 1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-format (25)
Analyzers\CodeStyleInformationProvider.cs (4)
14private static readonly string s_executingPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; 16private readonly string _featuresPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.Features.dll"); 17private readonly string _featuresCSharpPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.CSharp.Features.dll"); 18private readonly string _featuresVisualBasicPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.VisualBasic.Features.dll");
Commands\FormatCommandCommon.cs (5)
213formatOptions = Path.GetExtension(binaryLogPath)?.Equals(".binlog") == false 214? (formatOptions with { BinaryLogPath = Path.ChangeExtension(binaryLogPath, ".binlog") }) 330var workspaceDirectory = Path.GetDirectoryName(workspaceFilePath); 342path[^1] != Path.DirectorySeparatorChar 343? path + Path.DirectorySeparatorChar
Formatters\OrganizeImportsFormatter.cs (1)
58logger.LogWarning(Resources.Unable_to_organize_imports_for_0_The_document_is_too_complex, Path.GetFileName(document.FilePath));
ReportWriter.cs (3)
14var reportFolderPath = Path.GetDirectoryName(reportFilePath); 41return Path.Combine(Environment.CurrentDirectory, defaultReportName); 45return Path.Combine(reportPath, defaultReportName);
Utilities\EditorConfigFinder.cs (2)
17var directoryName = Path.GetDirectoryName(filePath); 30var editorConfigPath = Path.Combine(directory.FullName, ".editorconfig");
Utilities\GeneratedCodeUtilities.cs (3)
41var fileName = Path.GetFileName(filePath); 47var extension = Path.GetExtension(fileName); 50var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath);
Workspaces\FolderWorkspace_FolderSolutionLoader.cs (2)
18var absoluteFolderPath = Path.GetFullPath(folderPath, Directory.GetCurrentDirectory()); 78var filePath = Path.GetFullPath(paths[index], folderPath);
Workspaces\MSBuildWorkspaceFinder.cs (5)
25if (!Path.IsPathRooted(workspacePath)) 27workspacePath = Path.GetFullPath(workspacePath, searchDirectory); 58var workspaceExtension = Path.GetExtension(workspacePath); 68throw new FileNotFoundException(string.Format(Resources.The_file_0_does_not_appear_to_be_a_valid_project_or_solution_file, Path.GetFileName(workspacePath))); 89.Where(f => !DnxProjectExtension.Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase));
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\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-Microsoft.XmlSerializer.Generator (5)
Sgen.cs (5)
322outputDirectory ??= (gac ? Environment.CurrentDirectory : Path.GetDirectoryName(assembly.Location)); 337string codePath = Path.Combine(outputDirectory, serializerName + ".cs"); 479string path = Path.IsPathRooted(assemblyName) ? assemblyName : Path.GetFullPath(assemblyName); 592string filename = Path.GetFileNameWithoutExtension(reference);
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\aspnetcore\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-sourcelink (1)
dotnet-sql-cache (3)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-suggest (13)
DotnetMuxer.cs (1)
32var muxerCandidate = new FileInfo(System.IO.Path.Combine(muxerDir.FullName, muxerFileName));
DotnetProfileDirectory.cs (1)
30dotnetProfileDirectory = Path.Combine(home, DotnetProfileDirectoryName);
FileEnumerator.cs (1)
20.Select(p => Path.GetFileNameWithoutExtension(p.FullName));
FileSuggestionRegistration.cs (2)
28_registrationConfigurationFilePath = Path.Combine(testDirectoryOverride, RegistrationFileName); 34_registrationConfigurationFilePath = Path.Combine(userProfile, RegistrationFileName);
GlobalToolsSuggestionRegistration.cs (2)
25? Path.Combine(directory, "tools") 44new Registration(Path.Combine(_nullableToolsShimPath, p)));
Program.cs (2)
33var dotnetSuggestFolder = Path.Combine(appData, "dotnet-suggest"); 37var logFile = Path.Combine(dotnetSuggestFolder, "debug.log");
SuggestionDispatcher.cs (2)
188var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(r.ExecutablePath); 209targetExeName = Path.GetFileName(targetExeName).RemoveExeExtension();
SuggestionShellScriptHandler.cs (2)
32var directory = Path.GetDirectoryName(assemblyLocation); 33string scriptContent = File.ReadAllText(Path.Combine(directory, scriptName));
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));
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-user-jwts (38)
Commands\ClearCommand.cs (2)
73var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\CreateCommand.cs (2)
267var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\RemoveCommand.cs (2)
64var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Helpers\DevJwtCliHelpers.cs (10)
88var fullPath = Path.GetFullPath(filePath); 89if (!string.Equals(Path.GetExtension(fullPath), ".cs", StringComparison.OrdinalIgnoreCase)) 116else if (!File.Exists(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))) 118reporter.Error(Resources.FormatRemoveCommand_AppsettingsFileNotFound_Error(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))); 133var projectDirectory = Path.GetDirectoryName(project)!; 138var fileBasedAppLaunchSettingsFilePath = Path.Combine(projectDirectory, Path.GetFileNameWithoutExtension(project) + ".run.json"); 146var launchSettingsFilePath = Path.Combine(projectDirectory, "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\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\aspnetcore\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\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (11)
57var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 141var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 228string.Equals(Path.GetExtension(projectFile), ".cs", StringComparison.OrdinalIgnoreCase); 241Path.Combine(AppContext.BaseDirectory, "assets"), 248var assemblyDir = Path.GetDirectoryName(assemblyLocation); 252searchPaths.Insert(1, Path.Combine(assemblyDir, "assets")); 257var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\aspnetcore\src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-user-secrets (22)
CommandLineOptions.cs (1)
82if (options.File is not null && !string.Equals(Path.GetExtension(options.File), ".cs", StringComparison.OrdinalIgnoreCase))
Internal\SecretsStore.cs (3)
34var secretDir = Path.GetDirectoryName(_secretsFilePath); 72Directory.CreateDirectory(Path.GetDirectoryName(_secretsFilePath)); 79var tempFilename = Path.GetTempFileName();
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\aspnetcore\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\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (11)
57var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 141var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 228string.Equals(Path.GetExtension(projectFile), ".cs", StringComparison.OrdinalIgnoreCase); 241Path.Combine(AppContext.BaseDirectory, "assets"), 248var assemblyDir = Path.GetDirectoryName(assemblyLocation); 252searchPaths.Insert(1, Path.Combine(assemblyDir, "assets")); 257var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\aspnetcore\src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-watch (19)
Program.cs (10)
40sdkRootDirectory = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", ".."); 121project = new ProjectRepresentation(projectPath: null, entryPointFilePath: Path.GetFullPath(Path.Combine(workingDirectory, options.FilePath))); 169entryPointPath = Path.GetFullPath(Path.Combine(workingDirectory, firstArg)); 190projectPath = Path.GetFullPath(Path.Combine(workingDirectory, projectPath)); 204.Where(p => !PathUtilities.OSSpecificPathComparer.Equals(Path.GetExtension(p), ".shproj"))]; 377var roslynPath = Path.Combine(sdkRootDirectory, "Roslyn", "bincore"); 383var loadedAssembly = context.LoadFromAssemblyPath(Path.Combine(roslynPath, assembly.Name + ".dll"));
Watch\BuildEvaluator.cs (1)
206var extension = Path.GetExtension(fileName.AsSpan());
Watch\MsBuildFileSetFactory.cs (8)
49var watchList = Path.GetTempFileName(); 52var projectDir = Path.GetDirectoryName(rootProjectFile); 79logger.LogError("Error(s) finding watch items project file '{FileName}'.", Path.GetFileName(rootProjectFile)); 128Debug.Assert(fileItems.Values.All(f => Path.IsPathRooted(f.FilePath)), "All files should be rooted paths"); 185var assemblyDir = Path.GetDirectoryName(typeof(MSBuildFileSetFactory).Assembly.Location); 190Path.Combine(AppContext.BaseDirectory, "assets"), 191Path.Combine(assemblyDir, "assets"), 196var targetPath = searchPaths.Select(p => Path.Combine(p, WatchTargetsFileName)).FirstOrDefault(File.Exists);
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");
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 (50)
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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\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\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
GetDocument.Insider (8)
Commands\GetDocumentCommand.cs (3)
69.Except([Path.GetFullPath(thisAssembly.Location)]) 70.ToDictionary(Path.GetFileNameWithoutExtension, path => new AssemblyInfo(path)); 142AssemblyName = Path.GetFileNameWithoutExtension(assemblyPath),
Commands\GetDocumentCommandWorker.cs (2)
32private static readonly char[] _invalidFilenameCharacters = Path.GetInvalidFileNameChars(); 437path = Path.Combine(outputDirectory, path);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
HelixTestTasks (1)
GroupWorkItems.cs (1)
120string name = Path.GetFileName(itemSpec);
ilasm (6)
Program.cs (6)
61$"{Path.GetFileNameWithoutExtension(inputFiles[0])}{(isDll ? ".dll" : ".exe")}"; 172string baseDir = Path.GetDirectoryName(Path.GetFullPath(inputFiles[0])) ?? "."; 183string fullPath = Path.Combine(baseDir, path); 192fullPath = Path.Combine(includePath, path); 211string fullPath = Path.Combine(baseDir, path);
ilc (13)
Program.cs (1)
365string compilationUnitPrefix = multiFile ? Path.GetFileNameWithoutExtension(outputFilePath) : "";
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (12)
217zipFileName = zipFileName + "_" + Path.GetFileName(outputFilePath); 219zipFileName = Path.Combine(makeReproPath, Path.ChangeExtension(zipFileName, ".zip")); 337string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar; 338reproPackagePath = Path.Combine(reproFileDir, Path.GetFileName(originalPath)); 349string originalPdbPath = Path.ChangeExtension(originalPath, "pdb"); 353archive.CreateEntryFromFile(originalPdbPath, Path.ChangeExtension(reproPackagePath, "pdb")); 372string directoryName = Path.GetDirectoryName(pattern); 373string searchPattern = Path.GetFileName(pattern); 382string fullFileName = Path.GetFullPath(fileName); 384string simpleName = Path.GetFileNameWithoutExtension(fileName);
ILCompiler.Build.Tasks (3)
ComputeManagedAssembliesToCompileToNative.cs (3)
93var fileName = Path.GetFileName(taskItem.ItemSpec); 100var fileName = Path.GetFileName(taskItem.ItemSpec); 109string assemblyFileName = Path.GetFileName(itemSpec);
ILCompiler.Compiler (12)
Compiler\MstatObjectDumper.cs (1)
48var asmName = new AssemblyNameInfo(Path.GetFileName(fileName),
Compiler\ObjectWriter\Dwarf\DwarfBuilder.cs (2)
484new DwarfFileName(Path.GetFileName(sequencePoint.FileName), Path.GetDirectoryName(sequencePoint.FileName));
Compiler\UsageBasedMetadataManager.cs (1)
109string simpleName = Path.GetFileNameWithoutExtension(filePath);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (7)
138filePath = Path.GetFullPath(filePath); 194filePath = Path.GetFullPath(filePath); 345if (!Path.IsPathRooted(candidatePath) || !File.Exists(candidatePath)) 348candidatePath = Path.Combine(Path.GetDirectoryName(peFilePath), Path.GetFileName(candidatePath)); 364reader ??= UnmanagedPdbSymbolReader.TryOpenSymbolReaderForMetadataFile(peFilePath, Path.GetDirectoryName(pdbFileName));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
608Utf8String moduleName = new Utf8String(Path.GetFileName(_outputPath));
ILCompiler.Diagnostics (8)
PdbWriter.cs (8)
174string dllNameWithoutExtension = Path.GetFileNameWithoutExtension(dllPath); 175_pdbFilePath = Path.Combine(_pdbPath, dllNameWithoutExtension + ".pdb"); 187_tempSourceDllName = Path.Combine(Path.GetDirectoryName(dllPath), dllNameWithoutExtension + ".ni" + Path.GetExtension(dllPath)); 190_pdbFilePath = Path.Combine(_pdbPath, dllNameWithoutExtension + ".ni.pdb"); 215_ngenWriter.OpenModW(originalDllPath, Path.GetFileName(originalDllPath), out _pdbMod); 250WriteMethodPDBData(iCodeSection.Value, method, Path.GetFileNameWithoutExtension(originalDllPath), rvaOfTextSection, isILPDBProvided);
ILCompiler.ReadyToRun (30)
CodeGen\ReadyToRunObjectWriter.cs (6)
221string mapFileName = Path.ChangeExtension(_objectFilePath, ".map"); 227string nodeStatsCsvFileName = Path.ChangeExtension(_objectFilePath, ".nodestats.csv"); 228string mapCsvFileName = Path.ChangeExtension(_objectFilePath, ".map.csv"); 237path = Path.GetDirectoryName(_objectFilePath); 247path = Path.GetDirectoryName(_objectFilePath); 254string path = Path.ChangeExtension(_objectFilePath, ".profile");
Compiler\CallChainProfile.cs (1)
150string moduleSimpleName = Path.ChangeExtension(splitMethodName[0], null);
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryNode.cs (1)
38string pdbNameRoot = Path.GetFileNameWithoutExtension(outputFileName);
Compiler\ReadyToRunCodegenCompilation.cs (9)
399private readonly static string s_folderUpPrefix = ".." + Path.DirectorySeparatorChar; 441string outputDirectory = Path.GetDirectoryName(outputFile); 442string ownerExecutableName = Path.GetFileName(outputFile); 447ownerExecutableName = Path.ChangeExtension(ownerExecutableName, ".dylib"); 458string relativeMsilPath = Path.GetRelativePath(_compositeRootPath, inputFile); 462relativeMsilPath = Path.GetFileName(inputFile); 464string standaloneMsilOutputFile = Path.Combine(outputDirectory, relativeMsilPath); 469standaloneMsilOutputFile = Path.ChangeExtension(standaloneMsilOutputFile, ".wasm"); 481Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
IBC\MIbcProfileParser.cs (1)
107ZipArchiveEntry mibcDataEntry = zipFile.GetEntry(Path.GetFileName(filename) + ".dll");
ObjectWriter\SymbolFileBuilder.cs (4)
30Console.WriteLine("Emitting PDB file: {0}", Path.Combine(pdbPath, Path.GetFileNameWithoutExtension(dllFileName) + ".ni.pdb")); 60string perfMapFileName = Path.Combine(perfMapPath, Path.GetFileNameWithoutExtension(dllFileName) + perfMapExtension);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (7)
138filePath = Path.GetFullPath(filePath); 194filePath = Path.GetFullPath(filePath); 345if (!Path.IsPathRooted(candidatePath) || !File.Exists(candidatePath)) 348candidatePath = Path.Combine(Path.GetDirectoryName(peFilePath), Path.GetFileName(candidatePath)); 364reader ??= UnmanagedPdbSymbolReader.TryOpenSymbolReaderForMetadataFile(peFilePath, Path.GetDirectoryName(pdbFileName));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
608Utf8String moduleName = new Utf8String(Path.GetFileName(_outputPath));
ILCompiler.RyuJit (1)
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\IBC\MIbcProfileParser.cs (1)
107ZipArchiveEntry mibcDataEntry = zipFile.GetEntry(Path.GetFileName(filename) + ".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)));
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")))
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.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.Components.Testing (9)
_generated\0\StartupHook.g.cs (2)
12var testBinDirectory = Path.GetDirectoryName(startupHookAssembly.Location); 16var candidatePath = Path.Combine(testBinDirectory, assemblyName.Name + ".dll");
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)}");
Microsoft.AspNetCore.Components.Testing.Tasks (8)
GenerateE2EManifest.cs (8)
85entry.WorkingDirectory = Path.Combine(E2EAppsRelativeDir, name); 90entry.WorkingDirectory = Path.GetDirectoryName(projectPath) ?? ""; 100? Path.Combine("publish", name) 102var relativeDir = Path.Combine(E2EAppsRelativeDir, subPath); 103var absoluteDir = Path.Combine(E2EAppsOutputDir, subPath); 106var appHostPath = Path.Combine(absoluteDir, name + exeSuffix); 107var appDllPath = Path.Combine(absoluteDir, name + ".dll"); 138var manifestDir = Path.GetDirectoryName(ManifestPath);
Microsoft.AspNetCore.Components.WebAssembly (2)
Services\LazyAssemblyLoader.cs (2)
56loadedAssemblies.Add(Assembly.Load(Path.GetFileNameWithoutExtension(assemblyName))); 84var 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\aspnetcore\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)
402var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug"); 428var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
Microsoft.AspNetCore.Components.WebView (3)
WebViewManager.cs (3)
306var name = Path.GetFileNameWithoutExtension(assembly.Location); 308return 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.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.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.DeveloperCertificates.XPlat (32)
src\aspnetcore\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\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 203var certificatePath = Path.GetTempFileName(); 338var certificatePath = Path.GetTempFileName(); 367Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 848var nssDb = Path.GetFullPath(path); 1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (2)
402Write(System.IO.Path.GetFileName(firstFrame.File)); 650Write(System.IO.Path.GetFileName(frame.File));
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\aspnetcore\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.Http (2)
BindingAddress.cs (1)
246if (isUnixPipe && !Path.IsPathRooted(GetUnixPipePath(host)))
src\aspnetcore\src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
Microsoft.AspNetCore.Http.Results (2)
PhysicalFileHttpResult.cs (1)
143if (!Path.IsPathRooted(fileName))
Results.cs (1)
481=> Path.IsPathRooted(path)
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.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.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.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\aspnetcore\src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.RazorPages (1)
ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.Testing (5)
WebApplicationFactory.cs (5)
463var contentRootCandidate = Path.Combine( 467var contentRootMarker = Path.Combine( 469Path.GetFileName(contentRootAttribute.ContentRootTest)); 572var depsFile = new FileInfo(Path.Combine(AppContext.BaseDirectory, depsFileName)); 577Path.GetFileName(depsFile.FullName)));
Microsoft.AspNetCore.Razor.Utilities.Shared (15)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\FileUtilities.cs (3)
63var directoryName = Path.GetDirectoryName(path).AssumeNotNull(); 64var baseFileName = Path.GetFileNameWithoutExtension(path); 72uniquePath = Path.Combine(directoryName, $"{baseFileName}{identifier}{extension}");
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\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.Server.IIS (4)
src\aspnetcore\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.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)
590if (!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\aspnetcore\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\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 203var certificatePath = Path.GetTempFileName(); 338var certificatePath = Path.GetTempFileName(); 367Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 848var nssDb = Path.GetFullPath(path); 1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
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.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.StaticFiles (2)
StaticFileMiddleware.cs (2)
49_logger.WebRootPathNotFound(Path.GetFullPath(Path.Combine(hostingEnv.ContentRootPath, hostingEnv.WebRootPath ?? "wwwroot")));
Microsoft.AspNetCore.TestHost (2)
WebHostBuilderExtensions.cs (2)
199builder.UseContentRoot(Path.GetFullPath(Path.Combine(directoryInfo.FullName, solutionRelativePath)));
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserRefreshMiddleware.cs (1)
146!string.Equals(Path.GetFileName(request.Path.Value), "blazor.boot.json", StringComparison.OrdinalIgnoreCase))
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.Build (274)
BackEnd\BuildManager\BuildManager.cs (2)
1409string projectName = projectFile is not null ? Path.GetFileName(projectFile) : "?"; 1632submission.BuildRequestData.ProjectFullPath = Path.Combine(
BackEnd\BuildManager\CacheSerialization.cs (1)
34Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
BackEnd\BuildManager\CoordinatorClient.cs (2)
489string coordinatorDll = Path.Combine(msbuildDir, "MSBuild.Coordinator.dll"); 490string coordinatorExe = Path.Combine(msbuildDir, "MSBuild.Coordinator.exe");
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (2)
161_debugDumpFilePath = Path.Combine(_debugDumpDirectory, $"EngineTrace_{EnvironmentUtilities.CurrentProcessId}.txt"); 420string projectDirectoryFullPath = Path.GetDirectoryName(config.ProjectFullPath);
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)
98string fileName = Path.GetFileName(msbuildLocation);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (10)
172nodeProcesses.AddRange(Process.GetProcessesByName(Path.GetFileNameWithoutExtension(msbuildtaskhostExeName))); 255msbuildLocation = Path.Combine(msbuildExeName, ".exe"); 523: (Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost()) ?? Constants.MSBuildAppName); 526? Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost()) 536bool isAppHost = Path.GetFileName(location) 539return Path.GetFileNameWithoutExtension( 562|| !Path.GetFileName(msbuildLocation).Equals(Constants.MSBuildExecutableName, StringComparison.OrdinalIgnoreCase) 563|| !string.Equals(Path.GetFileName(EnvironmentUtilities.ProcessPath), Constants.DotnetProcessName, StringComparison.OrdinalIgnoreCase)) 568string dllPath = Path.Combine(Path.GetDirectoryName(msbuildLocation), Constants.MSBuildAssemblyName);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (10)
488? Path.Combine(GetOrInitializeX64Clr2Path(toolName, basePath64), toolName) 489: Path.Combine(GetOrInitializeX32Clr2Path(toolName, basePath), toolName); 494return Path.Combine(s_pathToX64Clr4 ??= basePath64, toolName); 499return Path.Combine(s_pathToArm64Clr4 ??= basePathArm64, toolName); 502return Path.Combine(s_pathToX32Clr4 ??= basePath, toolName); 580string lastDirectoryName = Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar)); 614string fullPath = Path.Combine(envPath, toolName); 855string appHostPath = Path.Combine(msbuildAssemblyPath, Constants.MSBuildExecutableName); 858: (Path.Combine(msbuildAssemblyPath, Constants.MSBuildAssemblyName), false);
BackEnd\Components\Communications\RarNodeLauncher.cs (1)
64return pipeNames.Contains(Path.Combine(NamedPipeRoot, _pipeName));
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
187string pluginPath = FileUtilities.NormalizePath(Path.Combine(item.Project.Directory, item.EvaluatedInclude));
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (2)
547projectDirectory[i] = Path.GetDirectoryName(projectPath); 684outputItemFromTarget.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)
984string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); 1009string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); 1044string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); 1199path1 = Path.Combine(_project.Directory, path1); 1202path2 = Path.Combine(_project.Directory, path2);
BackEnd\Components\Scheduler\Scheduler.cs (2)
272_debugDumpTraceFilePath = Path.Combine(_debugDumpDirectory, $"SchedulerTrace_{EnvironmentUtilities.CurrentProcessId}.txt"); 273_debugDumpStateFilePath = Path.Combine(_debugDumpDirectory, $"SchedulerState_{EnvironmentUtilities.CurrentProcessId}.txt");
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
31string sdkPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath, sdk.Name, "Sdk");
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (4)
68Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, "SdkResolvers"), location); 95Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot, "SdkResolvers"), location); 131var manifest = Path.Combine(subfolder.FullName, $"{subfolder.Name}.xml"); 132var 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)
332if (MemoryExtensions.Equals(Path.GetFileName(ProjectFullPath.AsSpan()), "dirs.proj", StringComparison.OrdinalIgnoreCase)) 740Directory.CreateDirectory(Path.GetDirectoryName(cacheFile)); 846Assumed.True(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases"); 1018string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, "Configuration{0}.cache", _configId));
BackEnd\Shared\TargetResult.cs (4)
282string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, Path.Combine("Results{0}", "{1}.cache"), configId, targetToCache)); 292string directoryName = Path.GetDirectoryName(filename); 316Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (1)
77checkContext.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)
104return 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); 2103_directory = Path.GetDirectoryName(fullPath);
Construction\Solution\ProjectInSolution.cs (2)
188_absolutePath = Path.Combine(ParentSolution.SolutionFileDirectory, _relativePath); 243internal 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)
1074string escapedSolutionFileName = EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath)); 1082string localFile = Path.Combine(escapedSolutionDirectory, $"before.{escapedSolutionFileName}.targets"); 1086localFile = Path.Combine(escapedSolutionDirectory, $"after.{escapedSolutionFileName}.targets"); 1361baseName = Path.Combine(_solutionFile.SolutionFileDirectory, MakeIntoSafeItemName(project.GetUniqueProjectName())); 2351if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 2353directoryName += Path.DirectorySeparatorChar; 2357globalProperties.AddProperty("SolutionExt", EscapingUtilities.Escape(Path.GetExtension(_solutionFile.FullPath))); 2358globalProperties.AddProperty("SolutionFileName", EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath))); 2359globalProperties.AddProperty("SolutionName", EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_solutionFile.FullPath))); 2361globalProperties.AddProperty(SolutionPathPropertyName, EscapingUtilities.Escape(Path.Combine(_solutionFile.SolutionFileDirectory, Path.GetFileName(_solutionFile.FullPath))));
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)
178var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar); 204var xbuildToolsetsDir = Path.Combine(libraryPath, $"xbuild{Path.DirectorySeparatorChar}"); 210var version = Path.GetFileName(d); 211var binPath = Path.Combine(d, "bin"); 632if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) 634path = Path.GetFullPath( 635Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
ElementLocation\XmlDocumentWithLocation.cs (3)
358if (Path.GetFileName(fullPath).StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase)) 361Assumed.True(Path.IsPathRooted(fullPath), "should be full path"); 362string directory = Path.GetDirectoryName(fullPath);
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)
1232string projectFileWithoutExtension = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_projectRootElement.FullPath)); 1233string projectExtension = EscapingUtilities.Escape(Path.GetExtension(_projectRootElement.FullPath)); 1236string projectFullPath = Path.Combine(projectDirectory, projectFile); 1238int rootLength = Path.GetPathRoot(projectDirectory).Length; 1903ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(sdkResult.Path, project), 1916ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(additionalPath, project), 1953string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(sdkResult.Path, 5), Constants.DotnetProcessName); 2167if (directoryOfImportingFile != null && !Path.IsPathRooted(importFileUnescaped)) 2169importFileUnescaped = Path.Combine(directoryOfImportingFile, importFileUnescaped);
Evaluation\Expander.Function.cs (2)
426|| _receiverType == typeof(System.IO.Path)) 486string startingDirectory = String.IsNullOrWhiteSpace(elementLocation.File) ? String.Empty : Path.GetDirectoryName(elementLocation.File);
Evaluation\Expander.ItemExpander.Transforms.cs (10)
173if (Path.IsPathRooted(unescapedPath)) 185rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 223string combinedPath = Path.Combine(unescapedPath, relativePath); 263if (Path.IsPathRooted(unescapedPath)) 275rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 282directoryName = Path.GetDirectoryName(rootedPath); 298directoryName = Path.GetDirectoryName(directoryName); 348if (Path.IsPathRooted(unescapedPath)) 360rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 363directoryName = Path.GetDirectoryName(rootedPath);
Evaluation\Expander.PropertyExpander.cs (7)
524value = Path.GetFileName(elementLocation.File); 528value = Path.GetFileNameWithoutExtension(elementLocation.File); 536value = Path.GetExtension(elementLocation.File); 540value = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(elementLocation.File)); 544string directory = Path.GetDirectoryName(elementLocation.File); 545int rootLength = Path.GetPathRoot(directory).Length; 615return NativeMethodsShared.FrameworkBasePath + Path.DirectorySeparatorChar;
Evaluation\Expander\WellKnownFunctions.cs (24)
38var logFile = Path.Combine(Directory.GetCurrentDirectory(), fileName); 50if (string.Equals(methodName, nameof(Path.Combine), StringComparison.OrdinalIgnoreCase)) 62returnVal = Path.Combine(arg0); 69returnVal = Path.Combine(arg0, arg1); 76returnVal = Path.Combine(arg0, arg1, arg2); 83returnVal = Path.Combine(arg0, arg1, arg2, arg3); 90returnVal = Path.Combine(Array.ConvertAll(args, o => (string)o)); 96else if (string.Equals(methodName, nameof(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase)) 100returnVal = Path.DirectorySeparatorChar; 104else if (string.Equals(methodName, nameof(Path.GetFullPath), StringComparison.OrdinalIgnoreCase)) 109? Path.GetFullPath(Path.Combine(FileUtilities.CurrentThreadWorkingDirectory, arg0)) 110: Path.GetFullPath(arg0); 114else if (string.Equals(methodName, nameof(Path.IsPathRooted), StringComparison.OrdinalIgnoreCase)) 118returnVal = Path.IsPathRooted(arg0); 122else if (string.Equals(methodName, nameof(Path.GetTempPath), StringComparison.OrdinalIgnoreCase)) 126returnVal = Path.GetTempPath(); 130else if (string.Equals(methodName, nameof(Path.GetFileName), StringComparison.OrdinalIgnoreCase)) 134returnVal = Path.GetFileName(arg0); 138else if (string.Equals(methodName, nameof(Path.GetDirectoryName), StringComparison.OrdinalIgnoreCase)) 142returnVal = Path.GetDirectoryName(arg0); 146else if (string.Equals(methodName, nameof(Path.GetFileNameWithoutExtension), StringComparison.OrdinalIgnoreCase)) 150returnVal = Path.GetFileNameWithoutExtension(arg0); 856else if (receiverType == typeof(Path))
Evaluation\IntrinsicFunctions.cs (2)
296return 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)
308if (!solutionDirectoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 310solutionDirectoryName += Path.DirectorySeparatorChar; 314solutionGlobalPropertiesBuilder["SolutionExt"] = EscapingUtilities.Escape(Path.GetExtension(Solution.FullPath)); 315solutionGlobalPropertiesBuilder["SolutionFileName"] = EscapingUtilities.Escape(Path.GetFileName(Solution.FullPath)); 316solutionGlobalPropertiesBuilder["SolutionName"] = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(Solution.FullPath)); 317solutionGlobalPropertiesBuilder[SolutionProjectGenerator.SolutionPathPropertyName] = EscapingUtilities.Escape(Path.Combine(Solution.SolutionFileDirectory, Path.GetFileName(Solution.FullPath)));
Graph\ProjectGraph.cs (1)
546var nodeName = Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
Instance\ProjectInstance.cs (3)
390_directory = Path.GetDirectoryName(projectPath); 443_directory = Path.GetDirectoryName(projectPath); 3171DirectoryPath = Path.GetDirectoryName(projectFile)
Instance\ProjectItemInstance.cs (1)
2447if (Path.DirectorySeparatorChar != '\\' && includeEscaped?.IndexOf('\\') > -1)
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
263string assemblyName = loadInfo.AssemblyName ?? Path.GetFileName(loadInfo.AssemblyFile); 646netCoreSdkRoot = Path.GetDirectoryName(ridGraphPath);
Instance\TaskRegistry.cs (8)
80private static readonly string s_potentialTasksV4Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV4Filename); 99private static readonly string s_potentialTasksV12Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV12Filename); 118private static readonly string s_potentialTasksCoreLocation = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksCoreFilename); 359if (assemblyFile != null && !Path.IsPathRooted(assemblyFile)) 361assemblyFile = Strings.WeakIntern(Path.Combine(directoryOfImportingFile, assemblyFile)); 376string replacedAssemblyFile = Path.Combine(Path.GetDirectoryName(assemblyFile), s_tasksCoreFilename); 1197!FileClassifier.IsMicrosoftAssembly(Path.GetFileName(_taskFactoryAssemblyLoadInfo.AssemblyFile)) &&
Logging\BinaryLogger\BinaryLogger.cs (6)
367logDirectory = Path.GetDirectoryName(FilePath); 556string directory = Path.GetDirectoryName(additionalPath); 638string fullPath = Path.GetFullPath(generatedFileUsedEventArgs.FilePath); 688FilePath = Path.GetFullPath(FilePath); 722return Path.GetFullPath(DefaultBinlogFileName); 744return Path.GetFullPath(filePath);
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
403new ProjectImportsCollector(Path.GetRandomFileName(), false, runOnBackground: false); 1894filePath = Path.GetTempFileName();
Logging\BinaryLogger\BuildEventArgsWriter.cs (3)
1114if (Path.IsPathRooted(itemSpec) || string.IsNullOrEmpty(projectFile)) 1119string projectDirectory = Path.GetDirectoryName(projectFile); 1122: FileUtilities.GetFullPathNoThrow(Path.Combine(projectDirectory, itemSpec));
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 (3)
103logDirectory = Path.GetDirectoryName(Path.GetFullPath(_logFileName)); 244internal string FilePath => Path.GetFullPath(_logFileName);
Logging\LoggerDescription.cs (2)
60if (loggerAssemblyFile != null && !Path.IsPathRooted(loggerAssemblyFile)) 254AssemblyLoadInfo.Create(_loggerAssembly.AssemblyName, Path.GetFullPath(_loggerAssembly.AssemblyFile));
Logging\ProfilerLogger.cs (1)
292var content = System.IO.Path.GetExtension(FileToLog) == ".md"
Logging\TerminalLogger\TerminalLogger.cs (14)
938Uri.TryCreate(new(Path.GetDirectoryName(outputPathSpan)), UriKind.Absolute, out Uri? uri); 956&& (outputPathSpan[workingDirectorySpan.Length] == Path.DirectorySeparatorChar 957|| outputPathSpan[workingDirectorySpan.Length] == Path.AltDirectorySeparatorChar)) 965var relativePathFromWorkingDirToSourceRoot = Path.GetRelativePath(workingDirectorySpan.ToString(), sourceRootSpan.ToString()).AsSpan(); 970&& (outputPathSpan[sourceRootSpan.Length - 1] == Path.DirectorySeparatorChar 971|| outputPathSpan[sourceRootSpan.Length - 1] == Path.AltDirectorySeparatorChar)) 974projectDisplayPathSpan = Path.Combine(relativePathFromWorkingDirToSourceRoot.ToString(), outputPathSpan.Slice(sourceRootSpan.Length).ToString()).AsSpan(); 996Path.GetFileNameWithoutExtension(project.ProjectFile) : 1062string projectFile = Path.GetFileNameWithoutExtension(e.ProjectFile); 1185string projectFile = Path.GetFileNameWithoutExtension(e.ProjectFile); 1214var projectFileName = Path.GetFileName(e.ProjectFile.AsSpan()); 1216message.AsSpan().StartsWith(Path.GetFileNameWithoutExtension(projectFileName)) && hasProject) 1623int index = path.AsSpan().LastIndexOfAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Resources\Constants.cs (2)
266[DynamicDependency(PropertyFunctionMembers, typeof(Path))] 382availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(Path)));
src\msbuild\src\Shared\Debugging\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");
src\msbuild\src\Shared\Debugging\PrintLineDebugger.cs (1)
141return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
src\msbuild\src\Shared\Debugging\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");
src\msbuild\src\Shared\TypeLoader.cs (5)
77string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 78microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 249string baseDir = Path.GetDirectoryName(assemblyLoadInfo.AssemblyFile); 272string assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 310assembliesDictionary[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\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.Framework (156)
BackEnd\CommunicationsUtilities.cs (1)
809string filePath = Path.Combine(s_debugDumpPath, fileName);
BackEnd\NamedPipeUtil.cs (1)
31return Path.Combine("/tmp", pipeName);
BuildEnvironmentHelper.cs (13)
165return TryFromStandaloneMSBuildExe(Path.Combine(sdkRoot, Constants.MSBuildExecutableName)) 166?? TryFromStandaloneMSBuildExe(Path.Combine(sdkRoot, Constants.MSBuildAssemblyName)); 240var msBuildExecutableCandidate = Path.Combine(Path.GetDirectoryName(buildAssembly), Constants.MSBuildExecutableName); 368return TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildExecutableName)) 370?? TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildAssemblyName)); 392string directory = Path.GetDirectoryName(msBuildAssembly); 430var processFileName = Path.GetFileNameWithoutExtension(processName); 606CurrentMSBuildConfigurationFile = Path.ChangeExtension(currentMSBuildExePath, configFileExtension); 656MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 660MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 667? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 725defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
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);
ErrorUtilities.cs (1)
26if (!Path.IsPathRooted(value))
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;
FileUtilities_TempFiles.cs (5)
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);
FileUtilities.cs (41)
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"); 501string.Concat(path.AsSpan(start), new(in Path.DirectorySeparatorChar))); 591while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 690string fullPath = NewPath.GetFullPath(path); 696return NormalizePath(Path.Combine(directory, file)); 701return NormalizePath(Path.Combine(paths)); 853return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 864string? directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 876directory += Path.DirectorySeparatorChar; 921if (allowedExtensions != null && Path.HasExtension(fileName)) 953string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 967fullPath += Path.DirectorySeparatorChar; 1031var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1341string fullBase = NewPath.GetFullPath(basePath); 1342string fullPath = NewPath.GetFullPath(path); 1351while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1382sb.Append("..").Append(Path.DirectorySeparatorChar); 1386sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1389if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1426return Path.IsPathRooted(FixFilePath(path)); 1472return paths.Aggregate(root, Path.Combine); 1500var separator = Path.DirectorySeparatorChar; 1640string? lookInDirectory = NewPath.GetFullPath(startingDirectory); 1645string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1659lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1679if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
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));
Loader\CoreCLRAssemblyLoader.cs (2)
56Debug.Assert(Path.IsPathRooted(fullPath)); 186var candidatePath = Path.Combine(searchPath,
Loader\MSBuildLoadContext.cs (3)
45_resolver = FileSystems.Default.FileExists(assemblyPath) && FileSystems.Default.FileExists(Path.ChangeExtension(assemblyPath, ".deps.json")) 85var candidatePath = Path.Combine(_directory, 108var assemblyNameInExecutableDirectory = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory,
MSBuildConstants.cs (3)
129internal static readonly char[] DirectorySeparatorChar = [Path.DirectorySeparatorChar]; 133internal static readonly char[] PathSeparatorChar = [Path.PathSeparator]; 136internal static readonly SearchValues<char> InvalidPathChars = SearchValues.Create(Path.GetInvalidPathChars());
NativeMethods.cs (5)
573string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"INTCASESENSITIVETEST{Guid.NewGuid():N}"); 622Path.GetDirectoryName(baseTypeLocation) 643dir = Path.GetDirectoryName(dir); 1317/// Unlike <see cref="System.IO.Path.GetFullPath(string)"/>, this resolves symlinks against the real
PathHelpers\AbsolutePath.cs (8)
92if (!Path.IsPathFullyQualified(path)) 112string combined = Path.Combine(basePath.Value, path); 138|| Path.IsPathFullyQualified(combined)) 147string? root = Path.GetPathRoot(basePath); 156return Path.Combine(basePath, combined.Substring(2)); 170/// Returns the canonical form of this path, equivalent to calling <see cref="System.IO.Path.GetFullPath(string)"/>. 177/// The canonical form of a path is exactly what <see cref="System.IO.Path.GetFullPath(string)"/> would produce, 191return new AbsolutePath(System.IO.Path.GetFullPath(Value), OriginalValue, ignoreRootedCheck: true);
ProjectFinishedEventArgs.cs (1)
114RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(ProjectFile));
ProjectStartedEventArgs.cs (1)
536string? projectFilePath = Path.GetFileName(ProjectFile);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
TargetFinishedEventArgs.cs (1)
181RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
Telemetry\BuildTelemetry.cs (1)
218AddIfNotNull(ProjectPath != null ? Path.GetFileName(ProjectPath) : null, nameof(ProjectPath));
Utilities\AssemblyLoadInfo.cs (1)
198Assumed.True(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
Utilities\FileMatcher.cs (10)
33private static readonly string s_directorySeparatorString = Path.DirectorySeparatorChar.ToString(); 303Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) && 507longPath = Path.Combine(longPath, parts[i]); 535longParts[i - startingElement] = Path.GetFileName(longPath); 701return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 1672return IsMatch(Path.GetFileName(path.AsSpan()), pattern); 1983Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 2007var filespecUnescapedFullyQualified = Path.Combine(projectDirectoryUnescaped, filespecUnescaped); 2098fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart);
Utilities\FrameworkLocationHelper.cs (30)
445? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 455? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 465? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30) 475? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35) 485? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40) 495? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45) 505? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 515? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 592Path.DirectorySeparatorChar.ToString(), 596Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin"); 601s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar; 641s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools"); 836var frameworkPath = Path.Combine(NativeMethods.FrameworkBasePath, prefix ?? string.Empty); 846return Path.Combine(complusInstallRoot, complusVersion); 851string leaf = Path.GetFileName(currentRuntimePath); 859string baseLocation = Path.GetDirectoryName(currentRuntimePath); 979combinedPath = Path.GetFullPath(combinedPath); 987? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework") 988: Path.Combine(NativeMethods.FrameworkBasePath, "xbuild-frameworks"); 990return Path.GetFullPath(combinedPath); 1038string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString()); 1041path = Path.Combine(path, "Profile", frameworkName.Profile); 1044return Path.GetFullPath(path); 1066var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 1068Path.AltDirectorySeparatorChar.ToString(), 1087fixedPath += Path.DirectorySeparatorChar; 1145string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 1468(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, Constants.MSBuildExecutableName)) && 1469!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) 1501frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
Utilities\TaskFactoryUtilities.cs (5)
143string? directory = Path.GetDirectoryName(assemblyPath); 262path = Path.Combine(directory, assemblyName.CultureName, assemblyName.Name + ".dll"); 270path = Path.Combine(directory, assemblyName.Name + ".dll"); 298if (!isMultiThreadedBuild || Path.IsPathFullyQualified(path)) 304return Path.Combine(projectDirectory, path);
Utilities\TypeExtensions.cs (1)
38return location.Length == 0 ? location : Path.GetFullPath(location);
Microsoft.Build.NuGetSdkResolver (5)
GlobalJsonReader.cs (1)
145candidatePath = new FileInfo(Path.Combine(currentDirectory.FullName, file));
NuGetSdkResolver.cs (2)
305installedPath = Path.Combine(packageInfo.PathResolver.GetInstallPath(packageInfo.Id, packageInfo.Version), "Sdk"); 311installedPath = Path.Combine(packageInfo.PathResolver.GetInstallPath(packageInfo.Id, packageInfo.Version), "sdk");
RestoreRunnerEx.cs (2)
48var projectDirectory = Path.Combine(NuGetEnvironment.GetFolderPath(NuGetFolderPath.Temp), Guid.NewGuid().ToString("N", null)); 52var projectFullPath = Path.Combine(projectDirectory, $"{projectName}.proj");
Microsoft.Build.Tasks.CodeAnalysis (30)
src\roslyn\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\roslyn\src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (6)
74internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); 85_useAppHost = useAppHost = File.Exists(Path.Combine(GetToolDirectory(), AppHostToolName)); 173return Path.Combine(ToolPath ?? "", ToolExe); 262return Path.Combine(buildTaskDirectory, "bincore"); 303return Path.Combine(sdkDirectory, "Roslyn"); 310if (Path.GetDirectoryName(typeof(ManagedToolTask).Assembly.Location) is { Length: > 0 } buildTaskDirectory)
src\roslyn\src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (3)
82=> EndsWithDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 92return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
src\roslyn\src\Compilers\Core\MSBuildTask\Utilities.cs (3)
25=> string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 116path = Path.GetFullPath(path); 126combined = Path.Combine(path1, path2);
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (1)
304string actualPdb = Path.ChangeExtension(outputAssembly, ".pdb"); // This is the pdb that the compiler generated
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (7)
452var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 458commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 695clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 783var tempPath = Path.GetTempPath(); 784var result = Path.Combine(tempPath, ".roslyn"); 792FilePath = Path.Combine(mutexDirectory, name); 793GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
66var directoryName = Path.GetDirectoryName(dotNetPath); 101var filePath = Path.Combine(item, fileName);
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Build.Tasks.Core (282)
AddToWin32Manifest.cs (2)
151SaveManifest(document, Path.GetFileName(ApplicationManifest?.ItemSpec) ?? DefaultManifestName); 183string originalPath = Path.Combine(OutputDirectory, manifestName);
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 (16)
479if (!Path.IsPathRooted(assemblyFileName)) 529string simpleName = Path.GetFileNameWithoutExtension(assemblyFileName); 766pathRooted = Path.IsPathRooted(finalName); 904Path.GetExtension(itemSpec)); 964if (!String.IsNullOrEmpty(implementationFile) && Path.GetExtension(implementationFile) == ".dll") 966companionFile = Path.Combine(Path.GetDirectoryName(baseName), implementationFile); 1003string cultureName = Path.GetFileName(subDirectory); 1009string satelliteAssembly = Path.Combine(subDirectory, satelliteFilename); 1013reference.AddSatelliteFile(Path.Combine(cultureName, satelliteFilename)); 1032string serializationAssemblyPath = Path.Combine(reference.DirectoryName, serializationAssemblyFilename); 2770AddRelatedItem(serializationAssemblyItems, relatedItemBase, Path.Combine(reference.DirectoryName, serializationAssemblyFile)); 2776AddRelatedItem(scatterItems, relatedItemBase, Path.Combine(reference.DirectoryName, scatterFile)); 2788relatedItemBase.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile))); 2789AddRelatedItem(satelliteItems, relatedItemBase, Path.Combine(reference.DirectoryName, satelliteFile)); 2855yield return new KeyValuePair<string, string>(ItemMetadataNames.winmdImplmentationFile, Path.GetFileName(reference.ImplementationAssembly));
AssemblyDependency\ResolveAssemblyReference.cs (1)
3037string fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName);
AssemblyDependency\Resolver.cs (5)
168string candidateBaseName = Path.GetFileNameWithoutExtension(fullPathToCandidateAssembly); 332fullPath = Path.Combine(fullPathToDirectory, baseName); 379string weakNameBaseExtension = Path.GetExtension(weakNameBase); 380string weakNameBaseFileName = Path.GetFileNameWithoutExtension(weakNameBase); 388string fullPath = Path.Combine(fullPathToDirectory, 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);
BootstrapperUtil\BootstrapperBuilder.cs (27)
176string strOutputExe = System.IO.Path.Combine(settings.OutputPath, SETUP_EXE); 363string setupSourceFile = System.IO.Path.Combine(bootstrapperPath, SETUP_BIN); 432invariantPath = Util.AddTrailingChar(invariantPath, System.IO.Path.DirectorySeparatorChar); 455packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar))); 459string folder = System.IO.Path.GetDirectoryName(file); 505private string BootstrapperPath => System.IO.Path.Combine(Path, ENGINE_PATH); 507private string PackagePath => System.IO.Path.Combine(Path, PACKAGE_PATH); 509private string SchemaPath => System.IO.Path.Combine(Path, SCHEMA_PATH); 530string startDirectory = System.IO.Path.Combine(BootstrapperPath, RESOURCES_PATH); 537string resourceDirectory = System.IO.Path.Combine(startDirectory, subDirectory); 538string resourceFilePath = System.IO.Path.Combine(resourceDirectory, SETUP_RESOURCES_FILE); 608if (strSubDirectory[nStartIndex] == System.IO.Path.DirectorySeparatorChar) 882string strSubDirectoryFullPath = System.IO.Path.Combine(packagePath, strSubDirectory); 885string strBaseManifestFilename = System.IO.Path.Combine(strSubDirectoryFullPath, ROOT_MANIFEST_FILE); 886string strBaseManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 924UpdatePackageFileNodes(packageFilesNode, System.IO.Path.Combine(packagePath, strSubDirectory), strSubDirectory); 937string strLangManifestFilename = System.IO.Path.Combine(strLanguageDirectory, CHILD_MANIFEST_FILE); 938string strLangManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 969System.IO.Path.DirectorySeparatorChar) 1174string strSourceFile = System.IO.Path.Combine(strSourcePath, relativePath); 1178targetPathAttribute.Value = System.IO.Path.Combine(strTargetPath, relativePath); 1181string newNameValue = System.IO.Path.Combine(strTargetPath, relativePath); 1470string strDestinationFileName = System.IO.Path.Combine(settings.OutputPath, packageFileDestination.Value); 1479EnsureFolderExists(System.IO.Path.GetDirectoryName(strDestinationFileName)); 2005using (var xmlwriter = new XmlTextWriter(System.IO.Path.Combine(s_logPath, fileName), Encoding.UTF8)) 2047using (var fileWriter = new StreamWriter(System.IO.Path.Combine(s_logPath, fileName), append)) 2208string logPath = System.IO.Path.Combine(
BootstrapperUtil\Util.cs (1)
225string msbuildExtensionPackagesPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildExtensionsPath, BOOTSTRAPPER_MSBUILD_ADDITIONAL_PACKAGES_PATH);
CombinePath.cs (1)
70combinedPath.ItemSpec = Path.Combine(BasePath, path.ItemSpec);
ConvertToAbsolutePath.cs (1)
57if (!Path.IsPathRooted(path.ItemSpec))
Copy.cs (7)
285string destinationFolder = Path.GetDirectoryName(destinationFileState.Path); 286string originalDestinationFolder = Path.GetDirectoryName(destinationFileState.Path.OriginalValue); 830() => Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)), 858string srcName = Path.GetFileName(src); 869() => Path.Combine(src, file), 879() => 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);
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
FileIO\WriteLinesToFile.cs (4)
122string directoryPath = Path.GetDirectoryName(filePath); 176string directoryPath = Path.GetDirectoryName(filePath); 179temporaryFilePath = Path.Combine(directoryPath, Path.GetRandomFileName() + "~");
FindAppConfigFile.cs (1)
125string filename = (matchWholeItemSpec ? item.ItemSpec : Path.GetFileName(item.ItemSpec));
FindInList.cs (1)
108string filename = (MatchFileNameOnly ? Path.GetFileName(path) : path);
FormatUrl.cs (1)
50Path.GetFullPath(InputUrl);
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)
59LauncherPath = Path.Combine( 73string entryPointFileName = Path.GetFileName(EntryPoint.ItemSpec); 106string outputEntryPoint = Path.Combine(Path.GetDirectoryName(EntryPoint.ItemSpec), results.KeyFile);
GenerateManifestBase.cs (5)
190name = Path.GetFileNameWithoutExtension(entryPointIdentity.Name) + ".application"; 564file.TargetPath = Path.IsPathRooted(file.SourcePath) || file.SourcePath.StartsWith("..", StringComparison.Ordinal) ? Path.GetFileName(file.SourcePath) : file.SourcePath; 615string manifestFileName = Path.GetFileName(OutputManifest.ItemSpec); 654Util.WriteLog($"Total time to generate manifest '{Path.GetFileName(OutputManifest.ItemSpec)}': t={Environment.TickCount - _startTime}");
GenerateResource.cs (17)
578commandLineBuilder.AppendFileNameIfNotNull(Path.Combine(_resgenPath, "resgen.exe")); 1599string extension = Path.GetExtension(sourceFilePath); 2140OutputResources[i] = new TaskItem(Path.ChangeExtension(Sources[i].ItemSpec, ".resources")); 2617_assemblyNames[i] = new AssemblyNameExtension(Path.GetFileNameWithoutExtension(assemblyFile.ItemSpec)); 2747string priDirectory = Path.Combine(outFileOrDir ?? String.Empty, 2749currentOutputDirectory = Path.Combine(priDirectory, 2757currentOutputFile = Path.Combine(currentOutputDirectory, currentOutputFileNoPath); 2900return Path.GetFullPath(currentOutputFile); 2911currentOutputFile = Path.GetFullPath(currentOutputFile); 2921string shorterPath = Path.Combine(outputDirectory ?? String.Empty, cultureName ?? String.Empty); 2926currentOutputFile = Path.Combine(shorterPath, currentOutputFileNoPath); 2931currentOutputFile = Path.GetFullPath(currentOutputFile); 2982extension = Path.GetExtension(filename); 3012_logger.LogErrorWithCodeFromResources("GenerateResource.UnknownFileExtension", Path.GetExtension(filename), filename); 3506_stronglyTypedClassName = Path.GetFileNameWithoutExtension(outFile); 3551_logger.LogWarningWithCodeFromResources(null, Path.GetFullPath(inputFileName), 0, 0, 0, 0, messageKey, [skipped.Key, .. skipped.AdditionalMessageArgs]); 3574return Path.ChangeExtension(outputResourcesFile, provider.FileExtension);
GetSDKReferenceFiles.cs (12)
512string directory = Path.GetDirectoryName(reference.AssemblyLocation); 513string fileNameNoExtension = Path.GetFileNameWithoutExtension(reference.AssemblyLocation); 514string xmlFile = Path.Combine(directory, fileNameNoExtension + ".xml"); 553if (Path.GetExtension(file.RedistFile).Equals(".PRI", StringComparison.OrdinalIgnoreCase)) 578string fileExtension = Path.GetExtension(file); 630string targetPath = Path.Combine(targetPathRoot, relativeToBase); 731FileName = Path.GetFileNameWithoutExtension(assemblyLocation); 960referencesCacheFile = Path.Combine(_cacheFileDirectory, GetCacheFileName(saveContext.SdkIdentity, saveContext.SdkRoot, cacheFileInfo.Hash.ToString("X", CultureInfo.InvariantCulture))); 1030group reference by Path.GetDirectoryName(reference); 1085string referencesCacheFile = Path.Combine(cacheFileFolder, GetCacheFileName(sdkIdentity, sdkRoot, hash.ToString("X", CultureInfo.InvariantCulture))); 1165string redistPath = Path.Combine(sdkRoot, "Redist"); 1179string referencesPath = Path.Combine(sdkRoot, "References");
InstalledSDKResolver.cs (4)
60string referenceAssemblyFilePath = Path.Combine(sdkDirectory, "References", configuration, architecture); 61string referenceAssemblyCommonArchFilePath = Path.Combine(sdkDirectory, "References", "CommonConfiguration", architecture); 62string referenceAssemblyPathNeutral = Path.Combine(sdkDirectory, "References", configuration, "Neutral"); 63string referenceAssemblyArchFilePathNeutral = Path.Combine(sdkDirectory, "References", "CommonConfiguration", "Neutral");
LC.cs (1)
180outputPath = 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)
182string redistListPath = Path.Combine(referenceAssemblyPath, _redistListFolder); 183return Path.Combine(redistListPath, _redistListFile); 588manifestPath = Path.Combine(Path.GetDirectoryName(SourcePath), _entryPoint.TargetPath);
ManifestUtil\LauncherBuilder.cs (4)
67string launcherFilename = Path.GetFileName(LauncherPath); 71Path.Combine(outputPath.Value, launcherFilename), 72Path.Combine(outputPath.OriginalValue, launcherFilename), 108EnsureFolderExists(Path.GetDirectoryName(outputExe.Value));
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)
28string manifestFileName = Path.GetFileName(path); 100Util.WriteLogFile(Path.GetFileNameWithoutExtension(path) + ".embedded.xml", m);
ManifestUtil\ManifestWriter.cs (1)
146File.Copy(temp, Path.Combine(Util.logPath, n + ".trust-file.xml"), true);
ManifestUtil\PathUtil.cs (9)
24path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 25path = path.TrimEnd(Path.DirectorySeparatorChar); 39path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 40path = path.TrimEnd(Path.DirectorySeparatorChar); 82if (String.Equals(Path.GetExtension(path), ".application", StringComparison.Ordinal)) 87if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 157if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal))
ManifestUtil\SecurityUtil.cs (3)
888toolPath = Path.Combine(pathToDotNetFrameworkSdk, "bin", ToolName); 897toolPath = Path.Combine(Directory.GetCurrentDirectory(), ToolName); 962return 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)
155if (!uri.LocalPath.StartsWith(Path.GetTempPath(), StringComparison.Ordinal))
Move.cs (3)
131destinationFile = Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)); 238string destinationFolder = Path.GetDirectoryName(destinationFile);
MSBuild.cs (2)
497projectDirectory[i] = Path.GetDirectoryName(projectPath); 626outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
NativeMethods.cs (5)
230private static readonly string s_gacPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, "gac"); 372var assemblyName = Path.GetFileName(dir); 377var versionString = Path.GetFileName(version); 489var path = Path.Combine(s_gacPath, assemblyNameVersion.Name); 495path = Path.Combine(
RedistList.cs (3)
306string redistDirectory = Path.Combine(frameworkDirectory, RedistListFolder); 1103string subsetDirectory = Path.Combine(frameworkDirectory, subsetListFolder); 1110string subsetFilePath = Path.Combine(subsetDirectory, subsetName + ".xml");
ResolveCodeAnalysisRuleSet.cs (5)
84if (CodeAnalysisRuleSet == Path.GetFileName(CodeAnalysisRuleSet)) 90string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet); 103string fullName = Path.Combine(directory, CodeAnalysisRuleSet); 112else if (!Path.IsPathRooted(CodeAnalysisRuleSet)) 117string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet);
ResolveKeySource.cs (1)
103keyFileExtension = 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);
ResolveSDKReference.cs (1)
1015_sdkManifestPath = Path.Combine(ResolvedPath, "SDKManifest.xml");
ResourceHandling\MSBuildResXReader.cs (1)
237fileName = Path.Combine(
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (6)
97private static string GetThisAssemblyDirectory() => Path.GetDirectoryName(typeof(RoslynCodeTaskFactory).Assembly.ManifestModule.FullyQualifiedName); 499string projectDirectory = !string.IsNullOrEmpty(projectFilePath) ? Path.GetDirectoryName(projectFilePath) : null; 612string fullPath = Path.GetFullPath(reference); 624Path.Combine(ThisAssemblyDirectoryLazy.Value, ReferenceAssemblyDirectoryName), 627.FirstOrDefault(p => FileSystems.Default.FileExists(Path.Combine(p, assemblyFileName))); 631resolvedAssemblyReferences.Add(Path.Combine(resolvedDir, assemblyFileName));
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (5)
41() => Path.Combine(pathToBuildTools, "Roslyn", "bincore", Path.ChangeExtension(ToolName, ".dll")), 43() => Path.Combine(pathToBuildTools, "Roslyn", Path.ChangeExtension(ToolName, ".dll")), 124if (!String.IsNullOrWhiteSpace(ToolExe) && Path.IsPathRooted(ToolExe))
SdkToolsPathUtility.cs (5)
60pathToTool = Path.Combine(processorSpecificToolDirectory, toolName); 67pathToTool = Path.Combine(sdkToolsPath, toolName); 126ProcessorArchitecture.ARM => Path.Combine(sdkToolsPath, "arm"), 127ProcessorArchitecture.AMD64 => Path.Combine(sdkToolsPath, "x64"), 128ProcessorArchitecture.IA64 => Path.Combine(sdkToolsPath, "ia64"),
src\msbuild\src\Shared\Debugging\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");
src\msbuild\src\Shared\Debugging\PrintLineDebugger.cs (1)
141return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
src\msbuild\src\Shared\Debugging\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");
SystemState.cs (6)
464string filename = Path.GetFileName(path); 466foreach (AssemblyEntry a in redistList.FindAssemblyNameFromSimpleName(Path.GetFileNameWithoutExtension(path))) 468string pathFromRedistList = Path.Combine(a.FrameworkDirectory, filename); 615string stateFileDirectory = Path.GetDirectoryName(stateFilePath); 622AbsolutePath fullPath = taskEnvironment.GetAbsolutePath(Path.Combine(stateFileDirectory, relativePath)).GetCanonicalForm(); 647instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
TaskEnvironmentExtensions.cs (1)
18/// <see cref="System.IO.Path.GetFullPath(string)"/> on .NET Framework validates path characters and throws
Unzip.cs (2)
189AbsolutePath fullDestinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destinationDirectory.FullName, zipArchiveEntry.FullName)).GetCanonicalForm(); 196if (Path.GetFileName(destinationPath.FullName).Length == 0)
WriteCodeFragment.cs (5)
115if (OutputFile != null && OutputDirectory != null && !Path.IsPathRooted(OutputFile.ItemSpec)) 117OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, OutputFile.ItemSpec)); 128OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, Path.GetFileName(outputFilePath.Value))); 131FileUtilities.EnsureDirectoryExists(Path.GetDirectoryName(outputFilePath));
Microsoft.Build.Tasks.Git (62)
GitDataReader\GitConfig.Reader.cs (12)
103return Path.Combine(xdgConfigHome, "git"); 108return Path.Combine(_environment.HomeDirectory, ".config", "git"); 119var programDataConfig = Path.Combine(_environment.ProgramDataDirectory, "git", "config"); 130var systemConfig = Path.Combine(systemDir, "gitconfig"); 141var xdgConfig = Path.Combine(xdgDir, "config"); 151var globalConfig = Path.Combine(_environment.HomeDirectory, ".gitconfig"); 159var localConfig = Path.Combine(_commonDirectory, "config"); 180var mingwEtc = Path.Combine(_environment.SystemDirectory, "..", "mingw64", "etc"); 283root = Path.GetDirectoryName(basePath) ?? ""; 288return Path.GetFullPath(Path.Combine(root, relativePath)); 334pattern = PathUtils.CombinePosixPaths(PathUtils.ToPosixPath(Path.GetDirectoryName(configFilePath)!), pattern[2..]);
GitDataReader\GitEnvironment.cs (4)
121return Path.Combine(gitInstallDir, "etc"); 136var paths = pathList.Split(Path.PathSeparator); 141return Path.GetDirectoryName(gitExe); 147return Path.GetDirectoryName(gitCmd);
GitDataReader\GitIgnore.cs (2)
122var directory = PathUtils.ToPosixDirectoryPath(Path.GetFullPath(Path.GetDirectoryName(path)!));
GitDataReader\GitIgnore.Matcher.cs (1)
103var fullPathNoSlash = PathUtils.TrimTrailingSlash(PathUtils.ToPosixPath(Path.GetFullPath(fullPath)));
GitDataReader\GitReferenceResolver.cs (6)
70var packedRefsPath = Path.Combine(commonDirectory, PackedRefsFileName); 186var refTableDirectory = Path.Combine(commonDirectory, RefTableDirectoryName); 187var tablesFilePath = Path.Combine(refTableDirectory, TablesListFileName); 198var path = Path.Combine(refTableDirectory, fileName); 311ReferenceStorageFormat.LooseFiles => ParseObjectNameOrReference(ReadReferenceFromFile(Path.Combine(_gitDirectory, GitRepository.GitHeadFileName))), 354path = Path.Combine(_commonDirectory, referenceName);
GitDataReader\GitRepository.cs (18)
139return Path.GetFullPath(Path.Combine(location.GitDirectory, value)); 182var dotGitPath = Path.Combine(submoduleWorkingDirectoryFullPath, GitDirName); 244fullPath = Path.GetFullPath(Path.Combine(workingDirectory, path)); 281var submodulesConfigFile = Path.Combine(workingDirectory, GitModulesFileName); 323var commonInfoExclude = Path.Combine(CommonDirectory, "info", "exclude"); 341directory = Path.GetFullPath(directory); 364dir = Path.GetFullPath(dir); 381dir = Path.GetDirectoryName(dir); 391var dotGitPath = Path.Combine(directory, GitDirName); 449return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path)!, link)); 460if (!File.Exists(Path.Combine(directory, GitHeadFileName))) 467var commonLinkPath = Path.Combine(directory, CommonDirFileName); 472commonDirectory = Path.Combine(directory, File.ReadAllText(commonLinkPath).TrimEnd(CharUtils.AsciiWhitespace)); 474commonDirectory = Path.GetFullPath(commonDirectory);
GitDataReader\PathUtils.cs (8)
14public static bool IsUnixLikePlatform => Path.DirectorySeparatorChar == '/'; 16public static readonly string DirectorySeparatorStr = Path.DirectorySeparatorChar.ToString(); 36=> (Path.DirectorySeparatorChar == '\\') ? path.Replace('\\', '/') : path; 42=> Path.DirectorySeparatorChar == '/' || path.IndexOf('\\') < 0; 64=> c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 67=> Path.GetFullPath(path) == path; 81return path[0] == Path.DirectorySeparatorChar;
GitOperations.cs (3)
209=> Path.DirectorySeparatorChar == '\\' && 355var fullPath = Path.GetFullPath(Path.Combine(projectDirectory, file.ItemSpec));
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.Build.Utilities.Core (68)
CommandLineBuilder.cs (1)
342AppendTextWithQuoting("." + Path.DirectorySeparatorChar + fileName);
PlatformManifest.cs (1)
95string platformManifestPath = Path.Combine(_pathToManifest, "Platform.xml");
SDKManifest.cs (1)
311string sdkManifestPath = Path.Combine(_pathToSdk, "SDKManifest.xml");
src\msbuild\src\Shared\Debugging\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");
src\msbuild\src\Shared\Debugging\PrintLineDebugger.cs (1)
141return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
src\msbuild\src\Shared\Debugging\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");
ToolLocationHelper.cs (48)
664string legacyWindowsMetadataLocation = Path.Combine(sdkRoot, "Windows Metadata"); 845propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName); 849propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName, targetPlatformIdentifier, targetPlatformVersion); 1039winmdLocation = Path.Combine(sdkRoot, referencesFolderName, commonConfigurationFolderName, neutralArchitectureName); 1132string referencesRoot = Path.Combine(targetPlatformSdkRoot, referencesFolderName, targetPlatformSdkVersion); 1137string contractPath = Path.Combine(referencesRoot, contract.Name, contract.Version); 1224return Path.Combine(sdkLocation, folderName); 1237? Path.Combine(matchingSdk.Path, folderName, targetPlatformVersion) 1238: Path.Combine(matchingSdk.Path, folderName); 1436var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder)); 1501string fullPath = Path.Combine(root, file); 1766if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 1840if (legacyMsCorlib20Path != null && FileSystems.Default.FileExists(Path.Combine(legacyMsCorlib20Path, "mscorlib.dll"))) 1857if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 2258Path.DirectorySeparatorChar.ToString(), 2261dotNetFrameworkReferenceAssemblies[i] += Path.DirectorySeparatorChar; 2426string referenceAssemblyPath = Path.Combine(sdkRoot, contentFolderName, targetConfiguration, targetArchitecture); 2553string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml"); 2628string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version); 2629string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 2652string sdkFolderPath = Path.Combine(platformSDKDirectory, "ExtensionSDKs"); 2747string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 2825string sdkManifestFileLocation = Path.Combine(directoryName, "SDKManifest.xml"); 2903string localAppdataFolder = Path.Combine(userLocalAppData, "Microsoft SDKs"); 2910string defaultProgramFilesLocation = Path.Combine( 3028string platformsRoot = Path.Combine(sdk.Path, platformsFolderName); 3056string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml"); 3094string path = Path.GetFullPath(targetFrameworkDirectory); 3115string redistListFolder = Path.Combine(path, "RedistList"); 3116string redistFilePath = Path.Combine(redistListFolder, "FrameworkList.xml"); 3200pathToReturn = Path.Combine(pathToReturn, includeFramework); 3201pathToReturn = Path.GetFullPath(pathToReturn); 3349pathToSdk = Path.Combine(pathToSdk, "x64"); 3352pathToSdk = Path.Combine(pathToSdk, "ia64"); 3360string filePath = Path.Combine(pathToSdk, fileName); 3469pathToSdk = Path.Combine(pathToSdk, "bin"); 3510pathToSdk = Path.Combine(pathToSdk, "x86"); 3513pathToSdk = Path.Combine(pathToSdk, "x64"); 3521string filePath = Path.Combine(pathToSdk, fileName); 3584toolPath = Path.Combine(toolPath, fileName); 3614return pathToFx == null ? null : Path.Combine(pathToFx, fileName); 3622public static string GetPathToSystemFile(string fileName) => Path.Combine(PathToSystem, fileName); 3840string frameworkIdentifierPath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 3898string frameworkProfilePath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 3899frameworkProfilePath = Path.Combine(frameworkProfilePath, frameworkVersion); 3900frameworkProfilePath = Path.Combine(frameworkProfilePath, "Profiles"); 3945string dotNextFx30RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV30); 3952string dotNextFx35RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV35);
ToolTask.cs (6)
527pathToTool = Path.Combine(ToolPath, ToolExe); 539string directory = Path.GetDirectoryName(pathToTool); 540pathToTool = Path.Combine(directory, ToolExe); 548bool isOnlyFileName = Path.GetFileName(pathToTool).Length == pathToTool.Length; 1435.Select(folderPath => Path.Combine(folderPath, filename)) 1755sb[i] = Path.DirectorySeparatorChar;
TrackedDependencies\TrackedDependencies.cs (2)
39string? directoryName = Path.GetDirectoryName(item.ItemSpec); 40string searchPattern = Path.GetFileName(item.ItemSpec);
Microsoft.CodeAnalysis (83)
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)
200else if (Path.DirectorySeparatorChar == '/') 206else 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)
314var directory = Path.GetDirectoryName(normalizedPath) ?? normalizedPath; 1193Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1275emitOptions = emitOptions.WithPdbFilePath(Path.GetFileName(emitOptions.PdbFilePath)); 1818var 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 (2)
52filePath = Path.GetFileName(filePath); 538writer.Write("cryptoKeyFile", options.CryptoKeyFile is { } keyFile ? Path.GetFileName(keyFile) : null);
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)
170return 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 (3)
518var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 564var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 665return Path.Combine(baseDirectory ?? "", type.Assembly.GetName().Name ?? string.Empty, type.FullName!);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
60var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
Microsoft.CodeAnalysis.Analyzers (39)
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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\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\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.AnalyzerUtilities (27)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\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\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\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);
Microsoft.CodeAnalysis.CodeStyle (22)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
76var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\roslyn\src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
158var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
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.Workspaces (20)
FileBasedPrograms\FileBasedProgramService.cs (1)
45var entryPointFileFullPath = Path.GetFullPath(entryPointFilePath);
SyncedSource\FileBasedPrograms\ExternalHelpers.cs (2)
25=> Path.GetRelativePath(relativeTo, path); 28=> Path.IsPathFullyQualified(path);
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (5)
555var sourceDirectory = Path.GetDirectoryName(sourcePath) 558var resolvedProjectPath = Path.Combine(sourceDirectory, resolvedName.Replace('\\', '/')); 663var sourceDirectory = Path.GetDirectoryName(sourcePath) 666var resolvedFilePath = Path.GetFullPath(Path.Combine(sourceDirectory, Name.Replace('\\', '/')));
SyncedSource\FileBasedPrograms\VirtualProjectBuilder.cs (12)
107string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 155? Path.GetTempPath() 163return Path.Combine(directory, "dotnet", dotNetSubdirectory ?? "runfile"); 171return Path.Combine(GetTempSubdirectory(dotNetSubdirectory), name); 247var fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(includeOrExcludeDirective.Info.SourceFile.Path)!, expandedPath)); 338var entryPointDirectory = Path.GetDirectoryName(EntryPointFileFullPath)!; 398var compilePath = Path.GetFullPath(Path.Combine( 634<AssemblyName>{EscapeValue(Path.GetFileNameWithoutExtension(entryPointFilePath))}</AssemblyName> 937var entryPointDirectory = Path.GetDirectoryName(entryPointFilePath) ?? "";
Microsoft.CodeAnalysis.Extensions.Package (4)
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadMSBuildWorkspace.cs (1)
58Contract.ThrowIfFalse(projectPaths.All(Path.IsPathFullyQualified));
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Analyzers\OmnisharpAnalyzerLoaderFactory.cs (2)
13baseDirectory ??= Path.Combine(Path.GetTempPath(), "CodeAnalysis", "OmnisharpAnalyzerShadowCopies");
Microsoft.CodeAnalysis.Features (57)
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\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
76var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\roslyn\src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
158var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\roslyn\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);
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.NetAnalyzers (10)
Microsoft.CodeQuality.Analyzers\Maintainability\CodeMetricsAnalyzer.cs (2)
307string fileName = Path.GetFileName(textFile.Path); 431string arg2 = Path.GetFileName(additionalText.Path);
Microsoft.NetCore.Analyzers\Security\UseDefaultDllImportSearchPathsAttribute.cs (1)
119Path.IsPathRooted(value.ToString()))
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\AdditionalFileProvider.cs (2)
42=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 50=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
34editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 51var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 52var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
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)
47(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)
67var fileName = Path.GetFileNameWithoutExtension(path); 72var fileName = Path.GetFileNameWithoutExtension(path);
SourceGenerators\RazorSourceGenerator.RazorProviders.cs (1)
151.Replace(Path.DirectorySeparatorChar, '/')
Microsoft.CodeAnalysis.Rebuild (2)
CSharpCompilationFactory.cs (1)
52Path.GetFileNameWithoutExtension(AssemblyFileName),
VisualBasicCompilationFactory.cs (1)
52Path.GetFileNameWithoutExtension(AssemblyFileName),
Microsoft.CodeAnalysis.ResxSourceGenerator (33)
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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\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\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\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);
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\roslyn\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.Workspaces (86)
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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
src\roslyn\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\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\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));
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\IFileChangeWatcher.cs (2)
34if (!path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) 36path += System.IO.Path.DirectorySeparatorChar;
Workspace\ProjectSystem\ProjectSystemProject.cs (4)
184var rootPath = Path.GetDirectoryName(filePath); 983fullPath = Path.GetFullPath(fullPath); 1040private static string CreateDirectoryPathFragment(params string[] paths) => Path.Combine([" ", .. paths, " "]).Trim(); 1043fullPath.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)
Workspace\ProjectSystem\ReferenceFileChangeTracker.cs (3)
76referenceDirectories.Add(Path.Combine(dotnetRoot, "packs")); 81referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies", "Microsoft", "Framework")); 82referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "dotnet", "packs"));
Microsoft.CodeAnalysis.Workspaces.MSBuild (39)
MSBuild\BuildHostProcessManager.cs (7)
36private static string MSBuildWorkspaceDirectory => Path.GetDirectoryName(typeof(BuildHostProcessManager).Assembly.Location) ?? AppContext.BaseDirectory; 37private static bool IsLoadedFromNuGetPackage => File.Exists(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "microsoft.codeanalysis.workspaces.msbuild.nuspec")); 162dotnetPath = Path.GetFullPath(Path.Combine(msbuildLocation.Path, $"../../{DotnetExecutable}")); 313buildHostPath = Path.GetFullPath(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "contentFiles", "any", "any", contentFolderName, assemblyName)); 318buildHostPath = Path.Combine(MSBuildWorkspaceDirectory, contentFolderName, assemblyName);
MSBuild\MSBuildProjectLoader.cs (7)
175var solutionDir = Path.GetDirectoryName(absoluteSolutionPath)!; 350_directory = Path.GetDirectoryName(logFilePath) ?? "."; 351_filename = Path.GetFileNameWithoutExtension(logFilePath) is { Length: > 0 } fileName 354_extension = Path.GetExtension(logFilePath) is { Length: > 0 } extension 364? Path.Combine(_directory, _filename + _extension) 365: Path.Combine(_directory, $"{_filename}-{suffix}{_extension}"); 367return 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)
172return Path.GetFullPath(FileUtilities.ResolveRelativePath(path, baseDirectoryPath) ?? path); 498var fileName = Path.ChangeExtension(info.Name, extension); 501? Path.Combine(Path.Combine([.. info.Folders]), fileName) 504var fullPath = GetAbsolutePath(relativePath, Path.GetDirectoryName(project.FilePath)!); 527var dir = Path.GetDirectoryName(fullPath); 594s_frameworkRoot = Path.GetDirectoryName(runtimeDir); // back out one directory level to be root path of all framework versions 628var fileName = identity != null ? identity.Name : Path.GetFileNameWithoutExtension(peRef.FilePath); 633var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(CurrentSolution.GetRequiredProject(projectId).FilePath)!, peRef.FilePath); 634var fileName = Path.GetFileNameWithoutExtension(peRef.FilePath);
MSBuild\ProjectFileExtensionRegistry.cs (2)
55var extension = Path.GetExtension(projectFilePath); 86_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\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (20)
MSBuild\ProjectFile\ProjectFile.cs (1)
137var fileName = Path.GetFileNameWithoutExtension(filePath);
MSBuild\ProjectFile\ProjectInstanceReader.cs (1)
194=> !Path.GetFileName(item.ItemSpec).StartsWith("TemporaryGeneratedFile_", StringComparison.Ordinal);
NetCoreBuildHost.cs (1)
29WorkingDirectory = Path.GetDirectoryName(projectOrSolutionFilePath),
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\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\roslyn\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.Deployment.DotNet.Releases (3)
ReleaseFile.cs (2)
38public string FileName => Path.GetFileName(Address.LocalPath); 117string tempPath = !File.Exists(destinationPath) ? destinationPath : Path.GetTempFileName();
Utils.cs (1)
49string directory = Path.GetDirectoryName(fileName);
Microsoft.Diagnostics.DataContractReader.Legacy (4)
DebugExtensions.cs (1)
110string message = $"HResult mismatch - cDAC: 0x{unchecked((uint)cdacHr):X8}, DAC: 0x{unchecked((uint)dacHr):X8} ({Path.GetFileName(filePath)}:{lineNumber})";
LegacyFallbackHelper.cs (3)
51if (s_allowlist.Contains(name) || s_fileAllowlist.Contains(Path.GetFileName(file))) 53Console.Error.WriteLine($"[cDAC] Allowed fallback: {name} at {Path.GetFileName(file)}:{line}"); 57Console.Error.WriteLine($"[cDAC] Blocked fallback: {name} at {Path.GetFileName(file)}:{line}");
Microsoft.Diagnostics.NETCore.Client (9)
DiagnosticsClient\DiagnosticsClient.cs (3)
502if (!int.TryParse(Path.GetFileName(procEntry), NumberStyles.Integer, CultureInfo.InvariantCulture, out int hostPid)) 517string crossNsDir = Path.Combine(PidIpcEndpoint.GetProcessRootPath(hostPid), targetTmpDir.TrimStart(Path.DirectorySeparatorChar));
DiagnosticsClient\DiagnosticsClientConnector.cs (1)
65string fullPort = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? portConfig.Address : Path.GetFullPath(portConfig.Address);
DiagnosticsIpc\IpcTransport.cs (5)
243public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); 432string tmpDirPath = Path.GetTempPath(); 483return Path.GetTempPath(); 519searchDirectory = Path.Combine(GetProcessRootPath(pid), targetTmpDir.TrimStart(Path.DirectorySeparatorChar));
Microsoft.DiaSymReader (1)
SymUnmanagedFactory.cs (1)
135var moduleHandle = LoadLibraryW(Path.Combine(dir, DiaSymReaderModuleName));
Microsoft.DotNet.ApiCompat.Task (6)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RoslynResolver.cs (3)
50Assembly asm = loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{name.Name}.dll")); 60loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisCSharpName}.dll")); 62loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisName}.dll"));
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\ValidateAssemblies.cs (3)
113assemblyName: Path.GetFileNameWithoutExtension(assembly), 131string filename = Path.GetFileName(path); 134string? directoryName = Path.GetDirectoryName(path);
Microsoft.DotNet.ApiSymbolExtensions (11)
AssemblySymbolLoader.cs (11)
88ImmutableHashSet<string> fileNames = assembliesPaths.Select(path => Path.GetFileName(path)).ToImmutableHashSet(); 138string assemblyName = Path.GetFileName(path); 141string? directoryName = Path.GetDirectoryName(path); 160ImmutableHashSet<string> fileNames = paths.Select(path => Path.GetFileName(path)).ToImmutableHashSet(); 189ImmutableHashSet<string> fileNames = relativePaths.Select(relativePath => Path.GetFileName(relativePath)).ToImmutableHashSet(); 205string name = Path.GetFileName(relativePaths[i]); 310string possiblePath = Path.Combine(directory, name); 364string? directory = Path.GetDirectoryName(path); 384string name = Path.GetFileName(path); 456using FileStream resolvedStream = File.OpenRead(Path.Combine(fullReferencePath, assemblyReferenceName)); 467string potentialPath = Path.Combine(referencePathDirectory, assemblyReferenceName);
Microsoft.DotNet.Arcade.Sdk (21)
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 (6)
193string dotNetPath = Path.TrimEndingDirectorySeparator(DotNetPath); 284dotnetRoot = Path.Combine(dotnetRoot, architecture.ToLowerInvariant()); 289"dotnet" => Path.Combine(dotnetRoot, "shared", "Microsoft.NETCore.App", version), 290"aspnetcore" => Path.Combine(dotnetRoot, "shared", "Microsoft.AspNetCore.App", version), 291"windowsdesktop" => Path.Combine(dotnetRoot, "shared", "Microsoft.WindowsDesktop.App", version), 292_ => 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.Build.Tasks.FileCatalog (3)
CatalogEntry.cs (2)
23/// Optional logical name for the entry. Defaults to <see cref="Path.GetFileName(string)"/> 56return new CatalogEntry(name ?? Path.GetFileName(filePath), sha1.GetHashAndReset(), sha256.GetHashAndReset());
GenerateFileCatalog.cs (1)
68string? directory = Path.GetDirectoryName(OutputPath);
Microsoft.DotNet.Build.Tasks.Installers (78)
src\CreateLightCommandPackageDrop.cs (8)
33string packageDropOutputFolder = Path.Combine(LightCommandWorkingDir, Path.GetFileName(InstallerFile)); 55var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(WixProjectFile)); 57commandString.Append($" -wixprojectfile {Path.GetFileName(WixProjectFile)}"); 61commandString.Append($" -contentsfile {Path.GetFileName(ContentsFile)}"); 65commandString.Append($" -outputsfile {Path.GetFileName(OutputsFile)}"); 69commandString.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)
413baseNames.Add(Path.GetFileName(file.Name)); 414string dirName = Path.GetDirectoryName(file.Name)!; 473if (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)
24@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar), 25@"src\**\*".Replace('\\', Path.DirectorySeparatorChar) 32@"content\**\*".Replace('\\', Path.DirectorySeparatorChar), 33@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar) 211string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 262return Path.Combine(nupkgOutputDirectory, $"{id}.{version}{nupkgExtension}"); 267bool creatingSymbolsPackage = packSymbols && (Path.GetExtension(nupkgPath) == _symbolsPackageExtension); 273string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 310var directory = Path.GetDirectoryName(nupkgPath); 391if(Path.GetFileName(fileName) == "runtime.json" && file.Target == "") 393string 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.Templating (2)
GenerateFileFromTemplate.cs (2)
69ResolvedOutputPath = Path.GetFullPath(OutputPath.Replace('\\', '/')); 92string directory = Path.GetDirectoryName(ResolvedOutputPath);
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.Workloads (23)
EmbeddedTemplates.cs (1)
41string destinationPath = Path.Combine(destinationFolder, destinationFilename);
Swix\ComponentSwixProject.cs (3)
19SourcePath = Path.Combine(SourcePath, $"{component.SdkFeatureBand}", $"{Path.GetRandomFileName()}"); 63Path.Combine(base.GetRelativePackagePath(), "_package.json");
Swix\SwixProjectBase.cs (1)
59SourcePath = Path.Combine(SourcePath, "swix");
Utils.cs (2)
47return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
Wix\WixToolTask.cs (1)
101public string GetWixCommandLine() => Path.Combine(ToolPath, ToolExe) + " " +
Wix\WixToolTaskBase.cs (3)
47ToolPath = Path.GetDirectoryName(toolPath); 48ToolName = Path.GetFileName(toolPath); 51protected override string GenerateFullPathToTool() => Path.Combine(ToolPath, ToolName);
WorkloadPackageBase.cs (10)
210DestinationDirectory = Path.Combine(destinationBaseDirectory, Path.GetRandomFileName()); 213PackageFileName = Path.GetFileNameWithoutExtension(packagePath); 246File.Copy(PackagePath, Path.Combine(DestinationDirectory, Path.GetFileName(PackagePath)), overwrite: true); 254Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "_rels")); 255Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "package")); 257Utils.DeleteFile(Path.Combine(DestinationDirectory, ".signature.p7s")); 258Utils.DeleteFile(Path.Combine(DestinationDirectory, "[Content_Types].xml")); 259Utils.DeleteFile(Path.Combine(DestinationDirectory, $"{Id}.nuspec"));
WorkloadTemplateBase.cs (2)
78SourcePath = Path.Combine(OutputPath, "src"); 79IntermediateOutputPath = Path.Combine(OutputPath, "obj");
Microsoft.DotNet.Cli.CoreUtils (7)
DotnetFiles.cs (2)
18public static string VersionFile => Path.GetFullPath(Path.Combine(SdkPaths.SdkDirectory, ".version"));
PathUtilities.cs (1)
9=> EnsureTrailingCharacter(path, Path.DirectorySeparatorChar);
SdkPaths.cs (4)
75string? assemblyDirectory = Path.GetDirectoryName(typeof(SdkPaths).Assembly.Location); 87string? root = Path.GetPathRoot(path); 90&& (last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar)
Microsoft.DotNet.Cli.Definitions (16)
Commands\Test\TestCommandDefinition.cs (2)
112string globalJsonPath = Path.Combine(directory, "global.json"); 118directory = Path.GetDirectoryName(directory);
Commands\Workload\WorkloadElevateCommandDefinition.cs (1)
12/// the client's <see cref="System.IO.Path.GetTempPath"/>. Used by the elevated server to accept
Common\TargetPlatformOptions.cs (4)
114var sdkPath = dotnetRootPath is not null ? Path.Combine(dotnetRootPath, "sdk") : "sdk"; 117string runtimeIdentifierChainPath = string.IsNullOrEmpty(Product.Version) || !Directory.Exists(Path.Combine(sdkPath, Product.Version)) ? 118Path.Combine(Directory.GetDirectories(sdkPath)[0], ridFileName) : 119Path.Combine(sdkPath, Product.Version, ridFileName);
src\sdk\src\Resolvers\Microsoft.DotNet.NativeWrapper\EnvironmentProvider.cs (5)
10private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 33.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 46.Select(p => Path.Combine(p, commandNameWithExtension)) 67if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileName(dotnetExe) 106var dotnetDirectory = Path.GetDirectoryName(dotnetExe);
Utilities\CommandDirectoryContext.cs (2)
19? Path.GetFullPath(path, _basePath) 20: Path.GetFullPath(path);
Utilities\OptionExtensions.cs (2)
47if (!Path.EndsInDirectorySeparator(argVal)) 49argVal += Path.DirectorySeparatorChar;
Microsoft.DotNet.Cli.Utils (46)
DependencyProvider.cs (1)
127using RegistryKey dependentsKey = BaseKey.CreateSubKey(Path.Combine(DependentsKeyPath, dependent), writable: true);
EnvironmentProvider.cs (4)
13private static char[] s_pathSeparator = [Path.PathSeparator]; 63return Path.Combine(_userHomeDirectory.Value, path.Substring(tildeSlash.Length)); 81(p, s) => Path.Combine(p, commandName + s)) 94var commandPath = extensions.Select(e => Path.Combine(rootPath, commandName + e))
MSBuildForwardingAppWithoutLogging.cs (2)
284return Path.Combine( 303return Path.Combine(
Muxer.cs (6)
43string? rootPath = Path.GetDirectoryName(Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar))); 46string muxerPathMaybe = Path.Combine(rootPath, muxerFileName); 65if (processPath is not null && !Path.GetFileName(processPath).Equals(muxerFileName, StringComparison.OrdinalIgnoreCase)) 75processPath = Path.Combine(root, muxerFileName);
PathUtility.cs (33)
19return string.Equals(Path.GetFileName(path), "_._", StringComparison.Ordinal); 32dir = Path.GetFullPath(dir); 34candidate = Path.GetFullPath(candidate); 43if (lastChar == Path.DirectorySeparatorChar) 54string? directory = Path.GetDirectoryName(filePath); 92var dir = Path.GetDirectoryName(path); 101dir = Path.GetDirectoryName(dir); 116return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); 124if (!Path.IsPathRooted(path1) || !Path.IsPathRooted(path2)) 129return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); 138return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, false); 161if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare)) 173var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 174var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 246path = path.TrimEnd(Path.DirectorySeparatorChar); 247return path.Substring(Path.GetDirectoryName(path)?.Length ?? 0).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 262if (Path.DirectorySeparatorChar == '/') 279var components = path.Split(Path.DirectorySeparatorChar); 296result += Path.DirectorySeparatorChar; 301result = Path.Combine(result, component); 305if (path[path.Length - 1] == Path.DirectorySeparatorChar) 307result += Path.DirectorySeparatorChar; 322return Path.GetExtension(filePath).Equals(extension, comparison); 336return Path.GetFullPath(path); 368return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 373return Regex.Escape(Path.DirectorySeparatorChar.ToString()); 382var filePath = Path.Combine(directory.FullName, relativeFilePath);
Microsoft.DotNet.CMake.Sdk (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.Configurer (11)
AspNetCertificateSentinel.cs (1)
16private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL);
CliFolderPathCalculator.cs (5)
18Path.Combine(new DirectoryInfo(AppContext.BaseDirectory).Parent?.FullName ?? string.Empty, "NuGetFallbackFolder"); 20public static string ToolsShimPath => Path.Combine(DotnetUserProfileFolderPath, ToolsShimFolderName); 28Path.Combine(DotnetProfileDirectoryName, ToolsShimFolderName)); 41Path.Combine(DotnetHomePath, DotnetProfileDirectoryName); 43public static string ToolsResolverCachePath => Path.Combine(DotnetUserProfileFolderPath, ToolsResolverCacheFolderName);
FirstTimeUseNoticeSentinel.cs (1)
16private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL);
IFileExtensions.cs (1)
17var parentDirectory = Path.GetDirectoryName(filePath) ?? string.Empty;
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
ToolPackageFolderPathCalculator.cs (1)
11return Path.Combine(toolsShimPath, NestedToolPackageFolderName);
UserLevelCacheWriter.cs (1)
72return Path.Combine(_dotnetUserProfileFolderPath, $"{Product.Version}_{cacheKey}.dotnetUserLevelCache");
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.HotReload.Utils.Generator (5)
Config.cs (1)
57public string LiveCodingWatchDir { get => Path.GetDirectoryName(ProjectPath) ?? "."; }
DocResolver.cs (1)
39var absolutePath = Path.GetFullPath(relativePath);
Script\Json\Parsing.cs (3)
22_absDir = System.IO.Path.GetDirectoryName(System.IO.Path.GetFullPath(path))!; 40return System.IO.Path.GetFullPath(relativePath, _absDir);
Microsoft.DotNet.HotReload.Watch (67)
AppModels\HotReloadAppModel.cs (2)
15=> Path.Combine(Path.GetDirectoryName(typeof(HotReloadAppModel).Assembly.Location)!, "hotreload", targetFramework, assemblyName + ".dll");
Aspire\AspireServiceFactory.cs (1)
244WorkingDirectory = Path.GetDirectoryName(projectLaunchInfo.ProjectPath) ?? throw new InvalidOperationException(),
Build\BuildReporter.cs (2)
32? $"{file.FilePath}{Path.PathSeparator}{string.Join(Path.PathSeparator, file.StaticWebAssetRelativeUrl)}"
Build\EvaluationResult.cs (5)
174!Path.GetExtension(projectInstance.FullPath).Equals(".csproj", PathUtilities.OSSpecificPathComparison) || 178var projectDirectory = Path.GetDirectoryName(projectPath)!; 182StaticWebAssetsManifest.TryParseFile(Path.Combine(outputDir, StaticWebAsset.ManifestFileName), logger) is { } manifest) 215var filePath = Path.GetFullPath(Path.Combine(projectDirectory, relativePath));
Build\FilePathExclusions.cs (3)
53if (Path.DirectorySeparatorChar == '/') 58outputDirectories.Add(Path.TrimEndingDirectorySeparator(Path.GetFullPath(dir)));
Build\ProjectGraphUtilities.cs (5)
20=> $"{Path.GetFileNameWithoutExtension(project.FullPath)} ({project.GetTargetFramework()})"; 59=> project.GetPropertyValue(PropertyNames.TargetPath) is { Length: >0 } path ? Path.GetDirectoryName(Path.Combine(project.Directory, NormalizeSeparators(path))) : null; 65=> Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 68=> project.GetPropertyValue(PropertyNames.IntermediateOutputPath) is { Length: >0 } path ? Path.Combine(project.Directory, NormalizeSeparators(path)) : null;
Build\ProjectRepresentation.cs (2)
32=> Path.GetDirectoryName(ProjectOrEntryPointFilePath)!; 35=> string.Equals(Path.GetExtension(projectOrEntryPointFilePath), ".csproj", StringComparison.OrdinalIgnoreCase)
Context\EnvironmentOptions.cs (5)
74? Path.GetFullPath(Path.Combine(SdkDirectory, "..", "..", "dotnet" + PathUtilities.ExecutableExtension)) 86Debug.Assert(Path.GetFileName(path) == $"dotnet{PathUtilities.ExecutableExtension}"); 92? $"{Path.Combine(WorkingDirectory, options.BinaryLogPath)[..^".binlog".Length]}-dotnet-watch.{operationName}.{Path.GetFileName(projectPath)}.{Interlocked.Increment(ref _uniqueLogId)}.binlog"
FileWatcher\DirectoryWatcher.cs (1)
32if (watchedFileNames.Count > 0 && !watchedFileNames.Contains(Path.GetFileName(fullPath)))
FileWatcher\EventBasedDirectoryWatcher.cs (1)
68var oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1));
FileWatcher\FileWatcher.cs (2)
76group path by PathUtilities.EnsureTrailingSlash(PathUtilities.NormalizeDirectorySeparators(Path.GetDirectoryName(path)!)) 78select (g.Key, containingDirectories ? [] : g.Select(Path.GetFileName).ToImmutableHashSet(PathUtilities.OSSpecificPathComparer));
HotReload\HotReloadDotNetWatcher.cs (14)
612var extension = Path.GetExtension(filePath); 617|| string.Equals(Path.GetFileName(filePath), "global.json", PathUtilities.OSSpecificPathComparison); 640var dirUrl = match.WildcardDirectoryPartMatchGroup.Replace(Path.DirectorySeparatorChar, '/'); 721var outputDir = Path.Combine(Path.GetDirectoryName(projectPath)!, relativeOutputDir); 728var targetPath = Path.Combine(outputDir, item.GetMetadata(MetadataNames.TargetPath)); 738var directory = Path.GetDirectoryName(targetPath); 823if (Path.GetExtension(path) == ".binlog") 842=> Path.GetFileName(dir).StartsWith('.'); 1148var solutionFile = Path.Combine(Path.GetTempFileName() + ".slnx"); 1292WorkingDirectory = Path.GetDirectoryName(path), 1342return $".{(relativePath.StartsWith(Path.DirectorySeparatorChar) ? string.Empty : Path.DirectorySeparatorChar)}{relativePath}";
Process\ProcessSpec.cs (1)
23=> Path.GetFileNameWithoutExtension(Executable);
src\sdk\src\Dotnet.Watch\HotReloadClient\DefaultHotReloadClient.cs (1)
153environmentBuilder.InsertListItem(AgentEnvironmentVariables.DotNetStartupHooks, startupHookPath, Path.PathSeparator);
src\sdk\src\Dotnet.Watch\HotReloadClient\Utilities\PathExtensions.cs (2)
14=> Path.IsPathFullyQualified(path); 17=> Path.Join(path1, path2);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\AbstractBrowserRefreshServer.cs (2)
89builder.InsertListItem(MiddlewareEnvironmentVariables.DotNetStartupHooks, middlewareAssemblyPath, Path.PathSeparator); 90builder.InsertListItem(MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssemblies, Path.GetFileNameWithoutExtension(middlewareAssemblyPath), MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssembliesSeparator);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAsset.cs (5)
13private static readonly StringComparison OSSpecificPathComparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 34var sourceProjectName = Path.GetFileNameWithoutExtension(containingProjectFilePath); 64var webRoot = "wwwroot" + Path.DirectorySeparatorChar; 65var webRootDir = Path.Combine(Path.GetDirectoryName(containingProjectFilePath)!, webRoot);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetsManifest.cs (4)
94if (Path.GetFileName(path).Equals(bundleFileName, StringComparison.Ordinal)) 162if (Path.IsPathFullyQualified(root)) 205urlToPathMap[url] = Path.Join(root, node.Asset.SubPath.Replace('/', Path.DirectorySeparatorChar));
Utilities\PathUtilities.cs (9)
8public static readonly IEqualityComparer<string?> OSSpecificPathComparer = Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 9public static readonly StringComparison OSSpecificPathComparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 15=> (path is [.., var last] && last != Path.DirectorySeparatorChar) ? path + Path.DirectorySeparatorChar : path; 18=> path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 27fullPath = Path.TrimEndingDirectorySeparator(fullPath); 36var containingDir = Path.GetDirectoryName(fullPath); 50var containingDir = Path.GetDirectoryName(path);
Microsoft.DotNet.HotReload.WebAssembly.Browser (3)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (3)
318var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 321var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 324return string.Join(Path.PathSeparator, updatedValues);
Microsoft.DotNet.InternalAbstractions (12)
DirectoryPath.cs (8)
16if (!Path.IsPathRooted(value)) 18value = Path.GetFullPath(value); 30return new DirectoryPath(Path.Combine(insertValueInFront)); 35return new FilePath(Path.Combine(Value, fileName)); 93CopyDirectoryAcrossMounts(dir, Path.Combine(destPath, Path.GetFileName(dir))); 98new FileInfo(file).CopyTo(Path.Combine(destPath, Path.GetFileName(file)), true);
FilePath.cs (3)
16if (!Path.IsPathRooted(value)) 18value = Path.GetFullPath(value); 31return new DirectoryPath(Path.GetDirectoryName(Value)!);
TemporaryDirectory.cs (1)
14DirectoryPath = Path.Combine(CreateSubdirectory());
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.NativeWrapper (8)
EnvironmentProvider.cs (5)
10private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 33.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 46.Select(p => Path.Combine(p, commandNameWithExtension)) 67if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileName(dotnetExe) 106var dotnetDirectory = Path.GetDirectoryName(dotnetExe);
src\sdk\src\Common\HostFxrPathResolver.cs (3)
41string fxrDir = Path.Combine(dotnetRoot, "host", "fxr"); 54SemanticVersion.TryParse(Path.GetFileName(path), out SemanticVersion? version); 77string hostfxrPath = Path.Combine(latestFxr, hostfxrName);
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.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.PackageValidation (2)
ApiCompatRunnerExtensions.cs (1)
100return new MetadataInformation(Path.GetFileName(item.Path), item.Path, package.PackagePath, assemblyReferences, displayString);
Package.cs (1)
130if (!File.Exists(Path.GetFullPath(packagePath)))
Microsoft.DotNet.ProjectTools (27)
LaunchSettings\ExecutableLaunchProfileParser.cs (3)
56workingDirectory = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(launchSettingsPath)!, expandedValue));
LaunchSettings\LaunchSettings.cs (5)
24=> Path.Combine(directoryPath, propertiesDirectoryName, "launchSettings.json"); 27=> Path.Join(directoryPath, $"{projectNameWithoutExtension}.run.json"); 31var buildPathContainer = Path.GetDirectoryName(projectOrEntryPointFilePath); 37var propsDirectory = string.Equals(Path.GetExtension(projectOrEntryPointFilePath), ".vbproj", StringComparison.OrdinalIgnoreCase) 44string appName = Path.GetFileNameWithoutExtension(projectOrEntryPointFilePath);
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\ExternalHelpers.cs (2)
25=> Path.GetRelativePath(relativeTo, path); 28=> Path.IsPathFullyQualified(path);
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (5)
555var sourceDirectory = Path.GetDirectoryName(sourcePath) 558var resolvedProjectPath = Path.Combine(sourceDirectory, resolvedName.Replace('\\', '/')); 663var sourceDirectory = Path.GetDirectoryName(sourcePath) 666var resolvedFilePath = Path.GetFullPath(Path.Combine(sourceDirectory, Name.Replace('\\', '/')));
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\VirtualProjectBuilder.cs (12)
107string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 155? Path.GetTempPath() 163return Path.Combine(directory, "dotnet", dotNetSubdirectory ?? "runfile"); 171return Path.Combine(GetTempSubdirectory(dotNetSubdirectory), name); 247var fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(includeOrExcludeDirective.Info.SourceFile.Path)!, expandedPath)); 338var entryPointDirectory = Path.GetDirectoryName(EntryPointFileFullPath)!; 398var compilePath = Path.GetFullPath(Path.Combine( 634<AssemblyName>{EscapeValue(Path.GetFileNameWithoutExtension(entryPointFilePath))}</AssemblyName> 937var entryPointDirectory = Path.GetDirectoryName(entryPointFilePath) ?? "";
Microsoft.DotNet.SdkResolver (1)
NETCoreSdkResolver.cs (1)
137string minimumVersionFilePath = Path.Combine(netcoreSdkDir, "minimumMSBuildVersion");
Microsoft.DotNet.SharedFramework.Sdk (17)
src\arcade\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\arcade\src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
105var fileName = Path.GetFileName(assemblyInfo.Path); 106var existingFileName = Path.GetFileName(existingInfo.Path);
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\ValidateFileVersions.cs (1)
30var fileName = Path.GetFileName(file.ItemSpec);
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.TemplateLocator (46)
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString); 387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString); 392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 480string manifestId = Path.GetFileName(manifestDirectory); 488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 491return (directory: dir, version: Path.GetFileName(dir)); 500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 526.Select(dir => Path.GetFileName(dir)) 532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 639var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 668string globalJsonPath = Path.Combine(directory, "global.json"); 673directory = Path.GetDirectoryName(directory);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine( 40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState"); 44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.Localization.cs (4)
26var catalog = Path.Combine(localizationDir, $"WorkloadManifest.{culture.Name}.json"); 55var cultureName = Path.GetFileNameWithoutExtension(filePath).Substring("WorkloadManifest.".Length); 64string manifestDir = Path.GetDirectoryName(manifestFilePath) ?? throw new ArgumentException(nameof(manifestFilePath)); 65string localizationDir = Path.Combine(manifestDir, "localize");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt"); 48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray(); 329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion); 333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (1)
100if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
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.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.Configuration.FileExtensions (4)
FileConfigurationProvider.cs (1)
183/// Loads the contents of the file at <see cref="Path"/>.
FileConfigurationSource.cs (3)
82System.IO.Path.IsPathRooted(Path) && 83System.IO.Path.GetDirectoryName(Path) is string directory) 86Path = 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.DotNetDeltaApplier (5)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (2)
38var processDir = Path.GetDirectoryName(processPath)!; 60var path = Path.Combine(processDir, args.Name + ".dll");
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (3)
318var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 321var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 324return string.Join(Path.PathSeparator, updatedValues);
Microsoft.Extensions.FileProviders.Embedded (9)
EmbeddedFileProvider.cs (4)
25private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 107var everettId = MakeValidEverettIdentifier(Path.GetDirectoryName(subpath)); 117builder.Append(Path.GetFileName(subpath)); 125var name = Path.GetFileName(subpath);
Manifest\EmbeddedFilesManifest.cs (5)
16private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 17.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 25private static readonly char[] _separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
Microsoft.Extensions.FileProviders.Embedded.Manifest.Task (2)
GenerateEmbeddedResourcesManifest.cs (1)
101private static string NormalizePath(string path) => Path.DirectorySeparatorChar == '\\' ?
Manifest.cs (1)
26var paths = originalPath.Split(Path.DirectorySeparatorChar);
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)
109_root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(root)); 123string watcherFullPath = PathUtils.EnsureTrailingSlash(Path.GetFullPath(fswPath)); 178if (Path.IsPathRooted(filter) || PathUtils.PathNavigatesAboveRoot(filter)) 231var pollingChangeToken = new PollingFileChangeToken(new FileInfo(Path.Combine(_root, filePath))); 355string oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1)); 815(path[path.Length - 1] == Path.DirectorySeparatorChar || 816path[path.Length - 1] == Path.AltDirectorySeparatorChar); 926current = Path.GetDirectoryName(current) ?? throw new DirectoryNotFoundException(SR.Format(SR.RootDirectoryMissing, current)); 973while (Path.Combine(watchDir, _expectedName) is var childPath && Directory.Exists(childPath)) 1009string 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.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 (4)
FileLoaderTests.cs (1)
48loaderUnderTest.Start(Path.Combine("TestModels", "SentimentModel.zip"), false);
PredictionEnginePoolTests.cs (3)
35.FromFile(modelName: "model1", filePath: Path.Combine("TestModels", "SentimentModel.zip"), watchForChanges: false); 85using var stream = File.OpenRead(Path.Combine("TestModels", "SentimentModel.zip")); 113using var stream = File.OpenRead(Path.Combine("TestModels", "SentimentModel.zip"));
Microsoft.Extensions.ServiceDiscovery.Dns (8)
DnsSrvServiceEndpointProviderFactory.cs (8)
17private static readonly string s_serviceAccountPath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount"); 18private static readonly string s_serviceAccountNamespacePath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount", "namespace"); 19private static readonly string s_resolveConfPath = Path.Combine($"{Path.DirectorySeparatorChar}etc", "resolv.conf"); 133var tokenPath = Path.Combine(s_serviceAccountPath, "token"); 139var certPath = Path.Combine(s_serviceAccountPath, "ca.crt");
Microsoft.Gen.BuildMetadata (2)
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 (33)
BenchmarkBase.cs (6)
17DataDir = Path.Combine(RootDir, "test", "data"); 35return Path.GetFullPath(Path.Combine(DataDir, name)); 43var filePath = Path.GetFullPath(Path.Combine(DataDir, path, name)); 47var blobName = Path.GetFileName(name);
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\e4e90a0f3c9b109a\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\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\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 (51)
TensorFlowEstimatorTests.cs (3)
154var imageFolder = Path.GetDirectoryName(dataFile); 196var imageFolder = Path.GetDirectoryName(dataFile); 249var imageFolder = Path.GetDirectoryName(dataFile);
TensorflowTests.cs (48)
34tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 35assetsPath = Path.Combine(tempFolder, "assets"); 36parentWorkspacePath = Path.Combine(assetsPath, "cached"); 66string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs", 73_fullImagesetFolderPath = Path.Combine( 122var imageFolder = Path.GetDirectoryName(dataFile); 489var imageFolder = Path.GetDirectoryName(dataFile); 525var imageFolder = Path.GetDirectoryName(dataFile); 750var varDir = Path.Combine(modelLocation, "variables"); 995var imageFolder = Path.GetDirectoryName(dataFile); 1054var imageFolder = Path.GetDirectoryName(dataFile); 1097var imageFolder = Path.GetDirectoryName(dataFile); 1132var imageFolder = Path.GetDirectoryName(dataFile); 1169var mlModelLocation = DeleteOutputPath(Path.ChangeExtension(modelLocation, ".zip")); 1209var imageFolder = Path.GetDirectoryName(dataFile); 1433if (Directory.Exists(workspacePath) && File.Exists(Path.Combine(workspacePath, trainSetBottleneckCachedValuesFileName)) 1434&& File.Exists(Path.Combine(workspacePath, validationSetBottleneckCachedValuesFileName))) 1449string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int)arch); 1549ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg") 1555ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg") 1708ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg") 1714ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg") 1734Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.TrainSetBottleneckCachedValuesFileName))); 1735Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.ValidationSetBottleneckCachedValuesFileName))); 1736Assert.True(File.Exists(Path.Combine(Path.GetTempPath(), "MLNET", ImageClassificationTrainer.ModelFileName[options.Arch]))); 1828string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs", 1834string fullImagesetFolderPath = Path.Combine( 1908if (Path.GetExtension(file) != ".jpg") 1911var label = Path.GetFileName(file); 1942UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 1944if (!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias))) 1945Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder, "FPTSUT")); 1955UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 1957return Path.GetFileNameWithoutExtension(fileName); 1963destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 1967string relativeFilePath = Path.Combine(destDir, destFileName); 1978var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 1983if (File.Exists(Path.Combine(destFolder, flag))) 1987File.Create(Path.Combine(destFolder, flag)); 2010string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 2025string imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.TestFramework (23)
BaseTestBaseline.cs (12)
37private readonly string _logRootRelPath = Path.Combine("Logs", BuildString); // Relative to OutDir. 94string baselineRootDir = Path.Combine(RootDir, TestDir, "BaselineOutput"); 97_baselineCommonDir = Path.Combine(baselineRootDir, "Common"); 100string logDir = Path.Combine(OutDir, _logRootRelPath); 103string logPath = Path.Combine(logDir, FullTestName + LogSuffix); 288baselinePath = Path.GetFullPath(Path.Combine(_baselineCommonDir, subDir, baselineConfigDir, name)); 297return Path.GetFullPath(Path.Combine(_baselineCommonDir, subDir, name)); 411Contracts.Assert(!Path.IsPathRooted(name), "file name should not be a full path"); 412Contracts.Assert(!Path.IsPathRooted(nameBase), "file nameBase should not be a full path"); 414string relPath = Path.Combine(dir, name);
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 (19)
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));
TestDownloadUtils.cs (1)
16var directory = Path.GetDirectoryName(filePath);
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 (38)
BpeTests.cs (9)
366using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json")); 367using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt")); 380string vocabFile = Path.Combine(@"Gpt-2", "vocab.json"); 381string mergesFile = Path.Combine(@"Gpt-2", "merges.txt"); 546using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json")); 547using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt")); 894BpeOptions options = new BpeOptions(Path.Combine(@"Gpt-2", "vocab.json"), Path.Combine(@"Gpt-2", "merges.txt")) 951using Stream jsonModelStream = File.OpenRead(Path.Combine(@"DeepSeek", "tokenizer-DeepSeek-R1.json"));
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 (5)
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")); 616using Stream jsonStream = File.OpenRead(Path.Combine("Paraphrase-multilingual-MiniLM-L12-v2", "tokenizer.json")); 654using Stream jsonStream = File.OpenRead(Path.Combine("Paraphrase-multilingual-MiniLM-L12-v2", "tokenizer.json")); 1191using JsonDocument bundled = JsonDocument.Parse(File.ReadAllText(Path.Combine("Paraphrase-multilingual-MiniLM-L12-v2", "tokenizer.json")));
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.Build.Containers (21)
ContentStore.cs (9)
15string contentPath = Path.Join(ArtifactRoot, "Content"); 40string descriptorPath = Path.Combine(ContentRoot, digestValue) + extension; 44public static string GetTempFile() => Path.Join(TempPath, Path.GetRandomFileName()); 55string dotnetCacheDir = Path.Join(userCacheDir, "dotnet"); 58string containersCacheDir = Path.Join(dotnetCacheDir, "Containers"); 96if (!string.IsNullOrEmpty(xdgCacheHome) && Path.IsPathFullyQualified(xdgCacheHome)) 103return Path.Join(userHomeDirectory, ".cache"); 111return Path.Join(userHomeDirectory, "Library", "Caches");
Layer.cs (3)
114string relativePath = Path.GetRelativePath(directory, fsi.FullName); 229private static readonly char[] PathSeparators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
LocalDaemons\ArchiveFileRegistry.cs (6)
24var fullPath = Path.GetFullPath(ArchiveOutputPath); 26var directorySeparatorChar = Path.DirectorySeparatorChar; 29if (!Path.HasExtension(fullPath)) 31fullPath += Path.DirectorySeparatorChar; 37fullPath = Path.Combine(fullPath, destinationReference.Repository + ".tar.gz"); 41var parentDirectory = Path.GetDirectoryName(fullPath);
LocalDaemons\ContainerRuntimeOperations.cs (3)
97string archivePath = Path.Combine(temporaryDirectory.FullName, "image.tar"); 159foreach (string directory in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(Path.PathSeparator)) 161string fullPath = Path.Combine(
Microsoft.NET.Build.Extensions.Tasks (9)
src\sdk\src\Tasks\Common\ConflictResolution\ConflictItem.cs (1)
125_fileName = OriginalItem == null ? string.Empty : Path.GetFileName(OriginalItem.ItemSpec);
src\sdk\src\Tasks\Common\ConflictResolution\FrameworkListReader.cs (1)
23if (!Path.IsPathRooted(frameworkListPath.OriginalValue))
src\sdk\src\Tasks\Common\ConflictResolution\ResolvePackageFileConflicts.cs (2)
76AbsolutePath frameworkListPath = TaskEnvironment.GetAbsolutePath(Path.Combine(tfd.ItemSpec, "RedistList", "FrameworkList.xml")); 193compilePlatformWinners.Select(c => Path.GetFileNameWithoutExtension(c.FileName) ?? string.Empty)
src\sdk\src\Tasks\Common\FileUtilities.cs (1)
46var extension = Path.GetExtension(sourcePath);
src\sdk\src\Tasks\Common\ItemUtilities.cs (4)
74return Path.GetFileName(sourcePath); 104return targetPath != null ? Path.GetFileName(targetPath) : null; 141var fileName = Path.GetFileName(sourcePath); 148return Path.Combine(destinationSubDirectory, fileName);
Microsoft.NET.Build.Tasks (235)
AssetsFileResolver.cs (8)
57string sourcePath = Path.Combine(libraryPath, runtimeTarget.Path); 76string sourcePath = Path.Combine(libraryPath, resourceAssembly.Path); 98string srcpath = Path.Combine(libraryPath, item.Path); 112return Path.GetDirectoryName(runtimeTarget.Path) + Path.DirectorySeparatorChar; 127destPath = Path.GetDirectoryName(libraryPath.Substring(pkgRoot.Length)); 130if (destPath != null && destPath[destPath.Length - 1] != Path.DirectorySeparatorChar) 132destPath += Path.DirectorySeparatorChar;
CheckForUnsupportedWinMDReferences.cs (5)
29if (Path.GetExtension(referencePath.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 54if (!Path.GetExtension(referencePath.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase) && 59if (Path.GetFileName(referencePath.ItemSpec).Equals("System.Runtime.WindowsRuntime.dll", StringComparison.OrdinalIgnoreCase)) 66Log.LogError(Strings.WinMDTransitiveReferenceNotSupported, Path.GetFileName(referencePath.ItemSpec)); 76Log.LogError(Strings.WinMDReferenceNotSupportedOnTargetFramework, TargetFrameworkMoniker, Path.GetFileName(winMDReference.ItemSpec));
CheckSdkVulnerabilities.cs (2)
40if (SdkVersion.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) 45string summaryPath = Path.Combine(userProfileDir, CacheDirectoryName, $"{SummaryFilePrefix}{SdkVersion}.json");
DependencyContextBuilder.cs (10)
248referenceAssembliesPath[referenceAssembliesPath.Length - 1] == Path.DirectorySeparatorChar) 254_referenceAssembliesPath = referenceAssembliesPath + Path.DirectorySeparatorChar; 440resolvedPath = Path.GetFileName(referenceAssembly.FullPath); 651var fileName = Path.GetFileNameWithoutExtension(library.Path); 653? userRuntimeAssemblies.FirstOrDefault(p => Path.GetFileNameWithoutExtension(p.Path).Equals(fileName)) 655string mainProjectDirectory = Path.GetDirectoryName(_mainProjectInfo.ProjectPath); 656string libraryPath = !string.IsNullOrWhiteSpace(library.Path) ? Path.Combine(mainProjectDirectory, library.Path) : null; 858string mainProjectDirectory = Path.GetDirectoryName(_mainProjectInfo.ProjectPath); 859string fullProjectPath = Path.GetFullPath(Path.Combine(mainProjectDirectory, projectPath));
FrameworkPackages\FrameworkPackages.cs (8)
128var packsFolder = Path.Combine(targetingPackRoot, frameworkName + ".Ref"); 129var originalPacksFolder = Path.Combine(targetingPackRoot.OriginalValue, frameworkName + ".Ref"); 135log.LogMessage("Pack directories found: {0}", string.Join(Environment.NewLine, packDirectories.Select(d => Path.Combine(originalPacksFolder, Path.GetFileName(d))))); 137.Select(d => (Overrides: Path.Combine(d, "data", "PackageOverrides.txt"), OriginalOverrides: Path.Combine(originalPacksFolder, Path.GetFileName(d), "data", "PackageOverrides.txt"), Version: ParseVersion(Path.GetFileName(d))))
FrameworkReferenceResolver.cs (1)
59return Path.Combine(
GenerateDepsFile.cs (2)
270string destinationSubPath = string.IsNullOrEmpty(destinationSubDir) ? null : Path.Combine(destinationSubDir, Path.GetFileName(i.ItemSpec));
GenerateRegFreeComManifest.cs (1)
44Path.GetFileNameWithoutExtension(IntermediateAssembly),
GenerateRuntimeConfigurationFiles.cs (1)
400if (lastChar == Path.DirectorySeparatorChar)
GenerateShims.cs (2)
83var packagedShimOutputDirectoryAndRid = Path.Combine( 87var appHostDestinationFilePath = Path.Combine(
GetEmbeddedApphostPaths.cs (2)
40var packagedShimOutputDirectoryAndRid = Path.Combine( 44var appHostDestinationFilePath = Path.Combine(
GetPackagesToPrune.cs (1)
267string packageOverridesPath = Path.Combine(prunePackageDataRoot, targetFrameworkVersion, frameworkReference, "PackageOverrides.txt");
LockFileCache.cs (1)
29if (!Path.IsPathRooted(path))
NugetContentAssetPreprocessor.cs (3)
19_preprocessedOutputDirectory = Path.Combine(outputDirectoryBase, BuildPreprocessedContentHash(_preprocessorValues)); 31pathToFinalAsset = Path.Combine(_preprocessedOutputDirectory, relativeOutputPath); 35Directory.CreateDirectory(Path.GetDirectoryName(pathToFinalAsset));
NuGetPackageResolver.cs (2)
54return Path.Combine(packagePath, NormalizeRelativePath(relativePath)); 58=> relativePath.Replace('/', Path.DirectorySeparatorChar);
ParseTargetManifests.cs (1)
32var targetManifestFileName = Path.GetFileName(manifestFile);
PrepareForReadyToRunCompilation.cs (26)
170var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath); 182outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb"); 183outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb"); 184crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\""; 205outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension); 206outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension); 207crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\""; 250r2rFileToPublish.ItemSpec = Path.Combine(OutputPath, Path.GetFileName(outputR2RImageRelativePath)); 259r2rFileToPublish.ItemSpec = Path.Combine(OutputPath, Path.GetFileName(outputR2RImageRelativePath)); 303MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec)); 306compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, "r2r" + Path.GetExtension(compositeR2RImageRelativePath)); 323compositePDBImage = Path.ChangeExtension(compositeR2RImageOutputPath, ".ni.pdb"); 324compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb"); 330compositePDBImage = Path.ChangeExtension(compositeR2RImageOutputPath, perfmapExtension); 331compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension); 371r2rImageRelativePath = Path.ChangeExtension(r2rImageRelativePath, ".o"); 372r2rFinalImageRelativePath = Path.ChangeExtension(r2rImageRelativePath, ".dylib"); 375intermediateR2RImage = Path.Combine(OutputPath, r2rImageRelativePath); 376var r2rImageFinal = Path.Combine(OutputPath, r2rFinalImageRelativePath); 502bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec))); 503bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R; 504bool partialImage = (partialSet != null && partialSet.Contains(Path.GetFileName(file.ItemSpec))); 508bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ProcessFrameworkReferences.cs (4)
1122foreach (var packRoot in packRootEnvironmentVariable.Split(Path.PathSeparator)) 1124yield return Path.Combine(packRoot, "packs"); 1134yield return Path.Combine(userProfileDir, "packs"); 1146string packPath = Path.Combine(packFolder, packName, packVersion);
ProduceContentAssets.cs (3)
210string relativeOutputPath = Path.Combine(packageName, packageVersion, ppOutputPath); 252item.SetMetadata("Link", Path.Combine("NuGet", packageName, packageVersion, Path.GetFileName(resolvedPath)));
ReferenceInfo.cs (6)
16public string FileName => Path.GetFileName(FullPath); 82projectName = Path.GetFileNameWithoutExtension(projectFilePath); 87projectName = Path.GetFileNameWithoutExtension(referencePath.ItemSpec); 159string name = Path.GetFileNameWithoutExtension(fullPath); 169string destinationSubPath = string.IsNullOrEmpty(destinationSubDirectory) ? null : Path.Combine(destinationSubDirectory, Path.GetFileName(fullPath));
ResolveAppHosts.cs (3)
289string hostRelativePathInPackage = Path.Combine("runtimes", bestAppHostRuntimeIdentifier, "native", 298appHostPackPath = Path.Combine(TargetingPackRoot, hostPackName, appHostPackVersion); 306appHostItem.SetMetadata(MetadataKeys.Path, Path.Combine(appHostPackPath, hostRelativePathInPackage));
ResolveCopyLocalAssets.cs (1)
88item.SetMetadata(MetadataKeys.Culture, resolvedFile.DestinationSubDirectory.TrimEnd(Path.DirectorySeparatorChar));
ResolvedFile.cs (3)
33get { return Path.GetFileName(SourcePath); } 42Path.Combine(DestinationSubDirectory, FileName); 50SourcePath = Path.GetFullPath(sourcePath);
ResolvePackageAssets.cs (14)
777Directory.CreateDirectory(Path.GetDirectoryName(_task.TaskEnvironment.GetAbsolutePath(_task.ProjectAssetsCacheFile))); 1207string xmlFilePath = Path.ChangeExtension(itemSpec, fileExtension); 1365WriteCopyLocalMetadataIfNeeded(package, Path.GetFileName(asset.Path)); 1688Path.GetFileName(asset.Path), 1689destinationSubDirectory: locale + Path.DirectorySeparatorChar); 1692WriteMetadata(MetadataKeys.DestinationSubDirectory, locale + Path.DirectorySeparatorChar); 1706WriteCopyLocalMetadataIfNeeded(package, Path.GetFileName(asset.Path)); 1723Path.GetFileName(asset.Path), 1724destinationSubDirectory: Path.GetDirectoryName(asset.Path) + Path.DirectorySeparatorChar); 1728WriteMetadata(MetadataKeys.DestinationSubDirectory, Path.GetDirectoryName(asset.Path) + Path.DirectorySeparatorChar); 1872Path.Combine(destinationSubDirectory, assetsFileName)); 2028if (Path.GetFileName(resolvedPackageAssetPath) == apphostName)
ResolvePackageDependencies.cs (7)
455if (Path.DirectorySeparatorChar != '/') 457relativePath = relativePath.Replace('/', Path.DirectorySeparatorChar); 460if (Path.DirectorySeparatorChar != '\\') 462relativePath = relativePath.Replace('\\', Path.DirectorySeparatorChar); 465return Path.Combine(resolvedPackagePath, relativePath); 470string projectDirectory = Path.GetDirectoryName(ProjectPath); 476return Path.GetFullPath(new AbsolutePath(path, absProjectDir));
ResolveReadyToRunCompilers.cs (26)
308_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 309_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 310_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 315_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 316_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 317_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 324_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 325_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 326_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 336_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 337_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 338_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 343_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 344_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 347_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 351_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 361_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 362_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 367_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 368_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 377_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 378_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 389_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 390_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 425_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 432_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
ResolveRuntimePackAssets.cs (11)
151string runtimeListPath = Path.Combine(runtimePackRoot, "data", "RuntimeList.xml"); 152AbsolutePath absoluteRuntimeListPath = new(Path.Combine("data", "RuntimeList.xml"), absoluteRuntimePackRoot); 209? Path.GetFullPath(absoluteRuntimePackRoot) 210: Path.GetFullPath(new AbsolutePath(pathAttributeValue, absoluteRuntimePackRoot)); 233throw new BuildErrorException($"Culture not set in runtime manifest for {Path.GetFullPath(Path.Combine(runtimePack.GetMetadata(MetadataKeys.PackageDirectory), fileElement.Attribute("Path").Value))}"); 243throw new BuildErrorException($"Unrecognized file type '{typeAttributeValue}' in {Path.Combine(absoluteRuntimePackRoot.OriginalValue, absoluteRuntimeListPath.OriginalValue)}"); 280assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.GetFileName(assetPath)); 284assetItem.SetMetadata(MetadataKeys.DestinationSubDirectory, culture + Path.DirectorySeparatorChar); 285assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.Combine(culture, Path.GetFileName(assetPath)));
ResolveTargetingPackAssets.cs (13)
212Path.Combine(targetingPackRoot.OriginalValue, "ref", targetingPackTargetFramework)); 220Path.Combine(targetingPackRoot.OriginalValue, "ref", targetingPackTargetFramework)); 223string targetingPackOriginalDataPath = Path.Combine(targetingPackRoot.OriginalValue, "data"); 226Path.Combine(targetingPackOriginalDataPath, "PlatformManifest.txt")); 229Path.Combine(targetingPackOriginalDataPath, "PackageOverrides.txt")); 232Path.Combine(targetingPackOriginalDataPath, "FrameworkList.xml")); 309Path.Combine(targetingPackRoot.OriginalValue, "build", targetingPackTargetFramework, "ref")); 313string itemSpec = Path.Combine(targetingPackAssetPath.OriginalValue, Path.GetFileName(dll)); 321if (!Path.GetFileName(dll).Equals("netstandard.dll", StringComparison.OrdinalIgnoreCase)) 410Path.Combine(definition.TargetingPackRoot.OriginalValue, fileElement.Attribute("Path").Value) : 467string dllPath = Path.Combine(targetingPackDllFolder, assemblyName + ".dll"); 477var dllPath = Path.Combine(targetingPackDllFolder, assemblyName + ".dll");
ResourceAssemblyInfo.cs (2)
26string relativePath = Path.Combine(destinationSubDirectory, Path.GetFileName(referenceSatellitePath.ItemSpec));
RunCsWinRTGenerator.cs (2)
192return Path.Combine(CsWinRTToolsDirectory!, ToolName); 206return Path.Combine(CsWinRTToolsDirectory!, architectureDirectory, ToolName);
RunReadyToRunCompiler.cs (5)
238if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 330result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 335result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 436Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
RuntimeGraphCache.cs (1)
31if (!Path.IsPathRooted(runtimeJsonPath))
SingleProjectInfo.cs (2)
90string outputName = Path.GetFileName(projectReferencePath.ItemSpec); 91string name = Path.GetFileNameWithoutExtension(outputName);
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString); 387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString); 392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 480string manifestId = Path.GetFileName(manifestDirectory); 488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 491return (directory: dir, version: Path.GetFileName(dir)); 500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 526.Select(dir => Path.GetFileName(dir)) 532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 639var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 668string globalJsonPath = Path.Combine(directory, "global.json"); 673directory = Path.GetDirectoryName(directory);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine( 40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState"); 44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.Localization.cs (4)
26var catalog = Path.Combine(localizationDir, $"WorkloadManifest.{culture.Name}.json"); 55var cultureName = Path.GetFileNameWithoutExtension(filePath).Substring("WorkloadManifest.".Length); 64string manifestDir = Path.GetDirectoryName(manifestFilePath) ?? throw new ArgumentException(nameof(manifestFilePath)); 65string localizationDir = Path.Combine(manifestDir, "localize");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt"); 48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray(); 329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion); 333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (1)
100if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
src\sdk\src\Tasks\Common\ConflictResolution\ConflictItem.cs (1)
125_fileName = OriginalItem == null ? string.Empty : Path.GetFileName(OriginalItem.ItemSpec);
src\sdk\src\Tasks\Common\ConflictResolution\FrameworkListReader.cs (1)
23if (!Path.IsPathRooted(frameworkListPath.OriginalValue))
src\sdk\src\Tasks\Common\ConflictResolution\ResolvePackageFileConflicts.cs (2)
76AbsolutePath frameworkListPath = TaskEnvironment.GetAbsolutePath(Path.Combine(tfd.ItemSpec, "RedistList", "FrameworkList.xml")); 193compilePlatformWinners.Select(c => Path.GetFileNameWithoutExtension(c.FileName) ?? string.Empty)
src\sdk\src\Tasks\Common\FileUtilities.cs (1)
46var extension = Path.GetExtension(sourcePath);
src\sdk\src\Tasks\Common\ItemUtilities.cs (4)
74return Path.GetFileName(sourcePath); 104return targetPath != null ? Path.GetFileName(targetPath) : null; 141var fileName = Path.GetFileName(sourcePath); 148return Path.Combine(destinationSubDirectory, fileName);
Microsoft.NET.HostModel (7)
AppHost\HostWriter.cs (2)
126string destinationFileName = Path.GetFileName(appHostDestinationFilePath); 201if (Path.IsPathRooted(searchOptions.AppRelativeDotNet))
Bundle\Bundler.cs (4)
53if (!string.IsNullOrEmpty(Path.GetDirectoryName(hostName))) 59_outputDir = Path.GetFullPath(string.IsNullOrEmpty(outputDir) ? Environment.CurrentDirectory : outputDir); 216if (Path.GetExtension(fileSpec.BundleRelativePath).ToLowerInvariant().Equals(".pdb")) 315string bundlePath = Path.Combine(_outputDir, _hostName);
Bundle\TargetInfo.cs (1)
93return (IsWindows ? Path.GetFileNameWithoutExtension(hostName) : hostName);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (20)
BrotliCompress.cs (4)
14private static readonly char[] InvalidPathChars = Path.GetInvalidFileNameChars(); 33protected override string ToolName => Path.GetDirectoryName(DotNetPath); 87var outputRelativePath = Path.Combine(OutputDirectory, CalculateTargetPath(inputFullPath, ".br")); 88var outputFullPath = Path.GetFullPath(outputRelativePath);
GenerateBlazorWebAssemblyBootJson50.cs (1)
156result.config.Add(Path.GetFileName(configFile.ItemSpec));
GZipCompress.cs (3)
40inputFullPaths[i] = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FilesToCompress[i].ItemSpec)); 50var outputRelativePath = Path.Combine(OutputDirectory, targetFileName); 51var outputFullPath = Path.Combine(outputDirectory.Value, targetFileName);
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (11)
908return Path.Combine(normalizedPrefix, computedBasePath, route) 1136RelatedAsset = !string.IsNullOrEmpty(RelatedAsset) ? Path.GetFullPath(env.GetAbsolutePath(RelatedAsset)) : RelatedAsset; 1146=> Path.GetFullPath(string.IsNullOrEmpty(path) ? path : env.GetAbsolutePath(path)) + 1148(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch 1152(false, false) => Path.DirectorySeparatorChar 1235var fxDir = Path.Combine(intermediateOutputPath, "fx", originalSourceId); 1237var destPath = Path.Combine(fxDir, Normalize(fileSystemRelativePath)); 1239destPath = Path.GetFullPath(env.GetAbsolutePath(destPath)); 1253var destDir = Path.GetDirectoryName(destPath); 1540var pathWithTokens = Path.Combine(prefix, computedBasePath, RelativePath)
UpgradeLegacyWasmStaticWebAssets.cs (1)
34if (string.Equals(Path.GetExtension(legacyAsset.RelativePath), ".gz", StringComparison.Ordinal))
Microsoft.NET.Sdk.Publish.Tasks (57)
AppSettingsTransform.cs (3)
13string tempFileFullPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Kudu\KuduVfsDeploy.cs (1)
56string relUrl = relPath.Replace(Path.DirectorySeparatorChar, '/');
MsDeploy\CommonUtility.cs (6)
696string dir = Path.GetDirectoryName(destRoot) ?? string.Empty; 705strSucceedFailMsg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedPackage, Path.GetFileName(destRoot), string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); 776string dir = Path.GetDirectoryName(destRoot) ?? string.Empty; 781strSucceedFailMsg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedPackage, Path.GetFileName(destRoot), string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); 1744if (source is null || Path.IsPathRooted(source) || string.IsNullOrEmpty(sourceRootPath)) 1747return Path.Combine(sourceRootPath, source);
MsDeploy\VSMSDeployHostObject.cs (1)
54srcSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(Path.Combine(rootFolderOfFileToPublish, p.SourceFilePath)) + "$");
MsDeploy\VsMSDeployObject.cs (1)
98baseOptions.WebServerConfiguration.WebServerManifest = Path.GetFileName(vSMSDeployObject.WebServerManifest);
Tasks\GenerateEFSQLScripts.cs (1)
51string outputFileFullPath = Path.Combine(EFPublishDirectory, EFSQLScriptsFolderName, dbContext.ItemSpec + ".sql");
Tasks\GenerateEnvTransform.cs (2)
43string generatedTransformFileName = Path.Combine(PublishTempDirectory, Path.GetFileName(envTransformTemplatePath));
Tasks\Kudu\KuduDeploy.cs (2)
168string zipFileFullPath = Path.Combine(Path.GetTempPath(), string.Format("Publish{0}.zip", new Random().Next(int.MaxValue)));
Tasks\MsDeploy\MSDeploy.cs (7)
266string msdeployExePath = Path.Combine("IIS", "Microsoft Web Deploy V3"); 267m_exePath = Path.Combine(programFiles, msdeployExePath); 268if (!File.Exists(Path.Combine(m_exePath, ToolName))) 275m_exePath = Path.Combine(programFiles, msdeployExePath); 281m_exePath = Path.Combine(programFiles, msdeployExePath); 1016commandLine.AppendSwitchIfNotNull("-webServerManifest:", Path.GetFileName(WebServerManifest)); 1039string result = ExePath is null ? string.Empty : Path.Combine(ExePath, ToolName);
Tasks\OneDeploy\CreatePackageFile.cs (1)
49var packageFilePath = Path.Combine(IntermediateTempPath, packageFileName);
Tasks\OneDeploy\OneDeploy.WebJob.cs (1)
39publishUri, username, password, DefaultRequestContentType, userAgent, Path.GetFileName(fileToPublish), Encoding.UTF8, fileToPublishStream, cancellationToken);
Tasks\TransformAppSettings.cs (4)
65sourceAppSettingsFilePath = Path.Combine(ProjectDirectory, SourceAppSettingsName); 69DestinationAppSettingsName = $"{Path.GetFileNameWithoutExtension(SourceAppSettingsName)}.{EnvironmentName}{Path.GetExtension(SourceAppSettingsName)}"; 74destinationAppSettingsFilePath = Path.Combine(PublishDirectory, DestinationAppSettingsName);
Tasks\TransformWebConfig.cs (9)
83publishWebConfigPath = Path.Combine(PublishDir, defaultWebConfigPath); 90publishWebConfigPath = Path.Combine(PublishDir, Path.GetFileName(projectWebConfigPath)); 93publishWebConfigPath = Path.GetFullPath(publishWebConfigPath); 127string? outputFile = Path.GetFileName(TargetPath) ?? string.Empty; 158var projectDirectory = Path.GetDirectoryName(projectPath); 164.FirstOrDefault(file => string.Equals(Path.GetFileName(file), defaultWebConfigName, StringComparison.OrdinalIgnoreCase)); 165var webConfigFileName = currentWebConfigFileName == null ? defaultWebConfigName : Path.GetFileName(currentWebConfigFileName); 166var projectWebConfigPath = Path.Combine(projectDirectory, webConfigFileName);
Tasks\WebJobs\GenerateRunCommandFile.cs (2)
27bool isRunCommandFilePresent = ProjectDirectory is not null && File.Exists(Path.Combine(ProjectDirectory, runCmdFileName)); 33File.WriteAllText(Path.Combine(WebJobsDirectory, runCmdFileName), command);
Tasks\ZipDeploy\CreateZipFile.cs (1)
30CreatedZipPath = Path.Combine(PublishIntermediateTempPath, zipFileName);
WebConfigTelemetry.cs (4)
60string? solutionDirectory = Path.GetDirectoryName(projectFileFullPath); 104string? solutionFileDirectory = Path.GetDirectoryName(solutionFileFullPath); 107string projectFullPathConstructed = Path.Combine(solutionFileDirectory, projectRelativePath); 108projectFullPathConstructed = Path.GetFullPath((new Uri(projectFullPathConstructed)).LocalPath);
WebConfigTransform.cs (7)
93var appPath = Path.Combine(".", appName).Replace("/", "\\"); 98appPath = Path.ChangeExtension(appPath, !string.IsNullOrWhiteSpace(extension) ? extension : null); 102else if (string.Equals(Path.GetExtension(appPath), ".exe", StringComparison.OrdinalIgnoreCase)) 104appPath = Path.ChangeExtension(appPath, ".exe"); 131var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @".\logs", "stdout").Replace("/", "\\"); 149string? projectFolder = Path.GetDirectoryName(projectFullPath); 152projectWebConfigPath = Path.Combine(projectFolder, "web.config");
WebJobsCommandGenerator.cs (4)
10string? appName = Path.GetFileName(targetPath); 15command = Path.ChangeExtension(appName, !string.IsNullOrWhiteSpace(executableExtension) ? executableExtension : null); 25if (string.Equals(Path.GetExtension(targetPath), ".exe", StringComparison.OrdinalIgnoreCase)) 27command = Path.ChangeExtension(appName, ".exe");
Microsoft.NET.Sdk.Razor.Tasks (23)
DotnetToolTask.cs (3)
154var clientDir = Path.GetFullPath(Path.GetDirectoryName(ToolAssembly)); 285var toolCommand = Path.GetFileNameWithoutExtension(ToolAssembly) + " " + Command;
SdkRazorGenerate.cs (2)
122var outputPath = Path.Combine(ProjectRoot, input.GetMetadata(GeneratedOutput)); 201builder.AppendLine(Path.GetFullPath(Extensions[i].GetMetadata(AssemblyFilePath)));
SdkRazorTagHelper.cs (2)
67if (!Path.IsPathRooted(Assemblies[i])) 116builder.AppendLine(Path.GetFullPath(Extensions[i].GetMetadata(AssemblyFilePath)));
src\sdk\src\RazorSdk\Tool\PipeName.cs (1)
47baseDirectory = baseDirectory.TrimEnd(Path.DirectorySeparatorChar);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (13)
45/// is <paramref name="workingDir"/>. This function must emulate <see cref="Path.GetTempPath"/> as 54return Path.GetTempPath(); 58if (Path.IsPathRooted(tmp)) 64if (Path.IsPathRooted(temp)) 73return Path.Combine(workingDir, tmp); 78return Path.Combine(workingDir, temp); 83if (Path.IsPathRooted(userProfile)) 295if (exeName.Equals(Path.GetFileName(expectedPath), StringComparison.Ordinal)) 301var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); 304var dotnetPath = Path.Combine(path, exeName); 320var expectedCompilerPath = Path.Combine(clientDir, ServerName); 425public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 426public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerLogger.cs (1)
48loggingFileName = Path.Combine(loggingFileName, $"razorserver.{GetCurrentProcessId()}.log");
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerPaths.cs (1)
26/// The temporary directory a compilation should use instead of <see cref="Path.GetTempPath"/>. The latter
Microsoft.NET.Sdk.StaticWebAssets.Tasks (72)
CollectStaticWebAssetsToCopy.cs (2)
48fileOutputPath = Path.Combine(normalizedOutputPath, asset.ComputeTargetPath("", Path.DirectorySeparatorChar, StaticWebAssetTokenResolver.Instance));
Compression\BrotliCompress.cs (3)
24protected override string ToolName => Path.GetDirectoryName(DotNetPath); 75.Select(f => Path.GetDirectoryName(f.ItemSpec)) 89var outputFullPath = Path.GetFullPath(outputRelativePath);
Compression\DiscoverPrecompressedAssets.cs (1)
60Path.GetFileNameWithoutExtension(candidate.RelativePath));
Compression\GZipCompress.cs (1)
20.Select(f => Path.GetDirectoryName(f.ItemSpec))
Compression\ResolveCompressedAssets.cs (2)
123var outputPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(OutputPath)); 196return Path.Combine(outputPath, $"{pathHash}-{{0}}-{asset.Fingerprint}");
ComputeReferenceStaticWebAssetItems.cs (2)
80groupedAsset.OriginalItemSpec = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(groupedAsset.OriginalItemSpec)); 104selected.OriginalItemSpec = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(selected.OriginalItemSpec));
ComputeStaticWebAssetsTargetPaths.cs (4)
33var separator = UseAlternatePathDirectorySeparator ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar; 46if (AdjustPathsForPack && string.IsNullOrEmpty(Path.GetExtension(targetPath))) 48targetPath = Path.GetDirectoryName(targetPath);
Data\ContentTypeProvider.cs (4)
428var fileNameSpan = Path.GetFileName(context.Path); 483var extension = Path.GetExtension(fileName); 487var fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName); 488if (!Path.GetExtension(fileNameNoExtension).Equals("", StringComparison.Ordinal))
Data\StaticWebAsset.cs (11)
908return Path.Combine(normalizedPrefix, computedBasePath, route) 1136RelatedAsset = !string.IsNullOrEmpty(RelatedAsset) ? Path.GetFullPath(env.GetAbsolutePath(RelatedAsset)) : RelatedAsset; 1146=> Path.GetFullPath(string.IsNullOrEmpty(path) ? path : env.GetAbsolutePath(path)) + 1148(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch 1152(false, false) => Path.DirectorySeparatorChar 1235var fxDir = Path.Combine(intermediateOutputPath, "fx", originalSourceId); 1237var destPath = Path.Combine(fxDir, Normalize(fileSystemRelativePath)); 1239destPath = Path.GetFullPath(env.GetAbsolutePath(destPath)); 1253var destDir = Path.GetDirectoryName(destPath); 1540var pathWithTokens = Path.Combine(prefix, computedBasePath, RelativePath)
DefineStaticWebAssetEndpoints.cs (2)
233var finalRoute = asset.IsProject() || asset.IsPackage() ? StaticWebAsset.Normalize(Path.Combine(asset.BasePath, route)) : route; 352var finalRoute = asset.IsProject() || asset.IsPackage() ? StaticWebAsset.Normalize(Path.Combine(asset.BasePath, route)) : route;
DefineStaticWebAssets.Cache.cs (1)
90var candidateFullPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec));
DefineStaticWebAssets.cs (17)
133if (Path.IsPathRooted(candidateMatchPath) && candidateMatchPath == candidate.ItemSpec) 135var normalizedAssetPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec)); 136var normalizedDirectoryPath = Path.GetDirectoryName(BuildEngine.ProjectFileOfTaskNode); 144var withSeparator when withSeparator[withSeparator.Length - 1] == Path.DirectorySeparatorChar || withSeparator[withSeparator.Length - 1] == Path.AltDirectorySeparatorChar => normalizedDirectoryPath.Length, 236var identity = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec)); 281var fileNamePattern = Path.GetFileName(identity); 285identity = Path.Combine(Path.GetDirectoryName(identity) ?? string.Empty, expanded); 386var candidateFullPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec)); 416var identitySubPath = Path.GetDirectoryName(relativePath); 417var itemSpecFileName = Path.GetFileName(candidateFullPath); 418var relativeFileName = Path.GetFileName(relativePath); 424var finalIdentity = Path.Combine(normalizedContentRoot, identitySubPath ?? string.Empty, itemSpecFileName); 436var assetIdentity = Path.GetFullPath(Path.Combine(normalizedContentRoot, stem)); 504var normalizedAssetPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec));
FingerprintPatternMatcher.cs (6)
60var result = Path.Combine(directoryName.ToString(), $"{fileNamePrefix}{DefaultFingerprintExpression}{extension}"); 79var simpleExtensionResult = Path.Combine(directoryName.ToString(), $"{stem}{expression}{matchExtension}"); 124var fileName = Path.GetFileName(relativePathCandidate.Span); 125var directoryName = Path.GetDirectoryName(relativePathCandidate.Span); 126var stem = Path.GetFileNameWithoutExtension(relativePathCandidate.Span); 127var extension = Path.GetExtension(relativePathCandidate.Span);
GenerateStaticWebAssetEndpointsManifest.cs (1)
215var directoryName = Path.GetDirectoryName(exclusionCacheAbsolutePath);
JSModules\GenerateJSModuleManifest.cs (1)
45Directory.CreateDirectory(Path.GetDirectoryName(OutputFile));
Legacy\GenerateV1StaticWebAssetsManifest.cs (3)
117var normalizedContentRoot = $"{contentRoot.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)}{Path.DirectorySeparatorChar}";
Legacy\ValidateStaticWebAssetsUniquePaths.cs (1)
70private static string GetWebRootPath(string webRoot, string basePath, string relativePath) => $"{webRoot}/{Path.Combine(basePath, relativePath.TrimStart('.').TrimStart('/')).Replace("\\", "/").Trim('/')}";
MergeConfigurationProperties.cs (1)
116var projectReferenceFullPath = Path.GetFullPath((string)TaskEnvironment.GetAbsolutePath(referenceMetadata));
OverrideHtmlAssetPlaceholders.cs (1)
95string outputPath = Path.Combine(OutputPath, FileHasher.HashString(item.ItemSpec) + item.GetMetadata("Extension"));
ReadPackageAssetsManifest.cs (3)
194return Path.GetFullPath(Path.Combine(packageRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)));
ScopedCss\ConcatenateCssFiles.cs (2)
70var importPath = NormalizePath(Path.Combine(prefix, ProjectBundles[i].ItemSpec)); 101Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
ScopedCss\ConcatenateCssFiles50.cs (2)
70var importPath = NormalizePath(Path.Combine(prefix, bundleBasePath, relativePath)); 100Directory.CreateDirectory(Path.GetDirectoryName(OutputFile));
ScopedCss\RewriteCss.cs (1)
53Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
Microsoft.NET.Sdk.WorkloadManifestReader (46)
SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString); 387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString); 392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 480string manifestId = Path.GetFileName(manifestDirectory); 488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 491return (directory: dir, version: Path.GetFileName(dir)); 500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 526.Select(dir => Path.GetFileName(dir)) 532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 639var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 668string globalJsonPath = Path.Combine(directory, "global.json"); 673directory = Path.GetDirectoryName(directory);
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine( 40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState"); 44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
WorkloadManifestReader.Localization.cs (4)
26var catalog = Path.Combine(localizationDir, $"WorkloadManifest.{culture.Name}.json"); 55var cultureName = Path.GetFileNameWithoutExtension(filePath).Substring("WorkloadManifest.".Length); 64string manifestDir = Path.GetDirectoryName(manifestFilePath) ?? throw new ArgumentException(nameof(manifestFilePath)); 65string localizationDir = Path.Combine(manifestDir, "localize");
WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt"); 48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray(); 329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion); 333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
WorkloadSet.cs (1)
100if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (20)
CachingWorkloadResolver.cs (5)
67string sentinelPath = Path.Combine(SdkPaths.SdkDirectory, "DisableWorkloadResolver.sentinel"); 119string sdkPackSdkFolder = Path.Combine(sdkPackInfo.Path, "Sdk"); 120string autoImportPath = Path.Combine(sdkPackSdkFolder, "AutoImport.props"); 137var workloadManifestTargetPath = Path.Combine(manifestDirectory, "WorkloadManifest.targets"); 153return new SinglePathResolutionResult(Path.Combine(packInfo.Path, "Sdk"));
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any()) 22.Select(path => new SdkFeatureBand(Path.GetFileName(path))); 32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir); 36.Select(file => new WorkloadId(Path.GetFileName(file))); 46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString()); 49var pathDir = Path.GetDirectoryName(path); 60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
src\sdk\src\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\WindowsWorkloadInstallationRecordReader.cs (1)
41using RegistryKey? workloadKey = baseKey.OpenSubKey(Path.Combine(basePath, $"{sdkFeatureBand}"));
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
WorkloadSdkResolver.cs (3)
50var sdkVersion = Path.GetFileName(sdkDirectory); 108startDir = Path.GetDirectoryName(context.SolutionFilePath); 112startDir = Path.GetDirectoryName(context.ProjectFilePath);
Microsoft.Private.Windows.Core (1)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\PathExtensions.cs (1)
8extension(Path)
Microsoft.SourceLink.AzureDevOpsServer.Git (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.AzureRepos.Git (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Bitbucket.Git (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Common (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Gitea (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Gitee (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.GitHub (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.GitLab (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.GitWeb (8)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (8)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 56/// directory and drive). Unlike <see cref="Path.IsPathRooted"/>, rejects Windows drive-relative 87return Path.IsPathFullyQualified(path);
Microsoft.TemplateEngine.Cli (20)
Alias\AliasRegistry.cs (1)
20_aliasesFilePath = Path.Combine(_environmentSettings.Paths.HostVersionSettingsDir, "aliases.json");
CliTemplateEngineHost.cs (3)
44OutputPath = outputPath != null ? Path.Combine(workingPath, outputPath) : workingPath; 60string checkPath = Path.Combine(workingPath, fileName); 64workingPath = Path.GetDirectoryName(workingPath.TrimEnd('/', '\\'));
Commands\CliPathInfo.cs (3)
29HostSettingsDir = Path.Combine(GlobalSettingsDir, host.HostIdentifier); 30HostVersionSettingsDir = Path.Combine(GlobalSettingsDir, host.HostIdentifier, host.Version); 44? Path.Combine(CliFolderPathCalculator.DotnetHomePath, ".templateengine")
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (6)
48if (fileSystem.FileExists(Path.Combine(currentDirectory, "global.json")) || 49fileSystem.FileExists(Path.Combine(currentDirectory, ".git")) || 50fileSystem.DirectoryExists(Path.Combine(currentDirectory, ".git"))) 134string newJsonFilePath = Path.Combine(repoRoot ?? outputBasePath, jsonFileName); 248string? directory = fileSystem.DirectoryExists(startPath) ? startPath : Path.GetDirectoryName(startPath); 274directory = Path.GetPathRoot(directory) != directory ? Directory.GetParent(directory)?.FullName : null;
PostActionProcessors\PostActionProcessorBase.cs (3)
26outputBasePath = Path.GetFullPath(outputBasePath); 44results.Add(Path.GetFullPath(change.TargetRelativePath, outputBasePath)); 109.Select(p => Path.GetFullPath(p, outputBasePath))
PostActionProcessors\ProcessStartPostActionProcessor.cs (2)
100string executableCombinedFileName = Path.Combine(Path.GetFullPath(outputBasePath), executableFileName);
TemplateInvoker.cs (2)
126Path.Combine(_cliTemplateEngineHost.OutputPath, targetPath), 133char[] invalidChars = Path.GetInvalidFileNameChars();
Microsoft.TemplateEngine.Core (9)
Util\Orchestrator.cs (9)
113string targetPath = Path.Combine(targetDir, targetRel); 114string fullTargetDir = Path.GetDirectoryName(targetPath); 126string fileName = Path.GetFileName(sourceRel); 153string targetPath = Path.Combine(targetDir, targetRel); 157targetPath = Path.GetDirectoryName(targetPath); 158targetRel = Path.GetDirectoryName(targetRel); 197string fileName = Path.GetFileName(sourceRel); 262string targetPath = Path.Combine(targetDir, targetRel); 267string fullTargetDir = Path.GetDirectoryName(targetPath);
Microsoft.TemplateEngine.Edge (29)
BuiltInManagedProvider\GlobalSettings.cs (1)
30environmentSettings.Host.FileSystem.CreateDirectory(Path.GetDirectoryName(_globalSettingsFile));
BuiltInManagedProvider\GlobalSettingsTemplatePackageProvider.cs (2)
27string packagesFolder = Path.Combine(settings.Paths.GlobalSettingsDir, "packages"); 44string globalSettingsFilePath = Path.Combine(environmentSettings.Paths.GlobalSettingsDir, "packages.json");
DefaultPathInfo.cs (3)
103return Path.Combine(userDir, ".templateengine"); 116return Path.Combine(globalDir ?? GetDefaultGlobalSettingsDir(userDir!), host.HostIdentifier); 133return Path.Combine(globalDir ?? GetDefaultGlobalSettingsDir(userDir!), host.HostIdentifier, host.Version);
Installers\NuGet\NugetApiPackageManager.cs (1)
113string filePath = Path.Combine(downloadPath, packageMetadata.Identity.Id + "." + packageMetadata.Identity.Version + ".nupkg");
Installers\NuGet\NuGetInstaller.cs (1)
411string targetPackageLocation = Path.Combine(_installPath, packageInfo.PackageIdentifier + "." + packageInfo.PackageVersion + ".nupkg");
Mount\FileSystem\FileSystemDirectory.cs (3)
35string baseName = x.Substring(fileSystemMountPoint.MountPointRootPath.Length).Replace(Path.DirectorySeparatorChar, '/'); 60string baseName = x.Substring(((FileSystemMountPoint)MountPoint).MountPointRootPath.Length).Replace(Path.DirectorySeparatorChar, '/'); 85string baseName = x.Substring(((FileSystemMountPoint)MountPoint).MountPointRootPath.Length).Replace(Path.DirectorySeparatorChar, '/');
Mount\FileSystem\FileSystemMountPoint.cs (3)
43string fullPath = Path.Combine(MountPointRootPath, path.TrimStart('/')); 55string fullPath = Path.Combine(MountPointRootPath, path.TrimStart('/')); 61string fullPath = Path.Combine(MountPointRootPath, path.TrimStart('/'));
ReflectionLoadProbingPath.cs (7)
215DirectoryInfo info = new DirectoryInfo(Path.Combine(selector._path, stringName)); 221.Where(x => x.FullName.IndexOf($"{Path.DirectorySeparatorChar}lib{Path.DirectorySeparatorChar}", StringComparison.OrdinalIgnoreCase) > -1 222&& (x.FullName.IndexOf($"{Path.DirectorySeparatorChar}netstandard", StringComparison.OrdinalIgnoreCase) > -1 223|| x.FullName.IndexOf($"{Path.DirectorySeparatorChar}netcoreapp", StringComparison.OrdinalIgnoreCase) > -1)) 231else if (File.Exists(Path.Combine(selector._path, stringName + ".dll"))) 233FileInfo f = new FileInfo(Path.Combine(selector._path, stringName + ".dll"));
Settings\ComponentManager.cs (1)
215AddProbingPath(Path.GetDirectoryName(type.Assembly.Location));
Settings\Scanner.cs (2)
203string targetPath = Path.Combine(targetBasePath, Path.GetFileName(sourceLocation));
Settings\SettingsFilePaths.cs (5)
56string wholeTargetPath = Path.Combine(targetPath, localPath); 129return Path.GetFileName(path); 139current = Path.Combine(current, parts[i]); 156return Path.Combine(_environmentSettings.Paths.UserProfileDir, path.Substring(1)); 161return cache ??= Path.Combine(paths);
Microsoft.TemplateEngine.IDE (2)
Bootstrapper.cs (2)
53string hostSettingsDir = Path.Combine(hostSettingsLocation, host.HostIdentifier); 54string hostVersionSettingsDir = Path.Combine(hostSettingsLocation, host.HostIdentifier, host.Version);
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (5)
RunnableProjectConfig.cs (1)
266if ((singleConfig.IndexOfAny(Path.GetInvalidPathChars()) != -1)
RunnableProjectGenerator.cs (4)
147string target = Path.Combine(targetDirectory, source.Target); 159Path.Combine(source.Source, fileChange.SourceRelativePath), 160Path.Combine(source.Target, fileChange.TargetRelativePath), 323string target = Path.Combine(targetDirectory, source.Target);
Microsoft.TemplateEngine.Utils (31)
FileFindHelpers.cs (2)
14string? directory = fileSystem.DirectoryExists(startPath) ? startPath : Path.GetDirectoryName(startPath); 26directory = Path.GetPathRoot(directory) != directory ? Directory.GetParent(directory).FullName : null;
FileSystemInfoExtensions.cs (2)
16using Stream f = source.MountPoint.EnvironmentSettings.Host.FileSystem.CreateFile(Path.Combine(target, file.Name)); 24dir.CopyTo(Path.Combine(target, dir.Name));
IFileSystemInfoExtensions.cs (1)
26result = Path.Combine(fileSystemInfo.MountPoint.MountPointUri, fileSystemInfo.FullPath.Trim('/', '\\'));
InMemoryFileSystem.cs (15)
22_root = new FileSystemDirectory(Path.GetFileName(root.TrimEnd('/', '\\')), root); 26_root = new FileSystemDirectory(Path.GetFileName(newRoot.TrimEnd('/', '\\')), newRoot); 53dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 77dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 86targetFile = new FileSystemFile(parts[parts.Length - 1], Path.Combine(currentDir.FullPath, parts[parts.Length - 1])); 451dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 507dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 565dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 597dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 628dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 659dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 699if (!Path.IsPathRooted(path)) 701path = Path.Combine(GetCurrentDirectory(), path); 742processedPath = string.Join(Path.DirectorySeparatorChar + string.Empty, realParts); 743if (processedPath.Equals(_root.FullPath) || processedPath.StartsWith(_root.FullPath.TrimEnd('/', '\\') + Path.DirectorySeparatorChar))
InstallRequestPathResolution.cs (6)
38var arr = Path.GetInvalidPathChars(); 63string searchTarget = Path.Combine(environmentSettings.Host.FileSystem.GetCurrentDirectory(), baseDir.Trim()); 64string parentFolder = Path.GetFullPath(Path.GetDirectoryName(searchTarget)); 65string searchPattern = Path.GetFileName(searchTarget); 70return new[] { Path.GetFullPath(searchTarget) };
PhysicalFileSystem.cs (5)
114string basePath = Path.GetFullPath(relativeTo); 115string sourceFullPath = Path.GetFullPath(target); 128FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); 149char desiredDirectorySeparator = Path.DirectorySeparatorChar;
Microsoft.TemplateSearch.Common (2)
Providers\NuGetMetadataSearchProvider.cs (1)
105string preferredMetadataLocation = Path.Combine(_environmentSettings.Paths.HostVersionSettingsDir, TemplateDiscoveryMetadataFile);
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (1)
57string pathToConfig = Path.Combine(environmentSettings.Paths.HostVersionSettingsDir, filePath);
Microsoft.TestPlatform.Build (1)
Tasks\TestTaskUtils.cs (1)
251return StringUtils.IsNullOrEmpty(dotnetHostPath) ? null : Path.GetFullPath(dotnetHostPath);
Microsoft.TestPlatform.CommunicationUtilities (2)
DataCollectionRequestHandler.cs (2)
263datacollectorSearchPaths.Add(Path.GetDirectoryName(source)!); 276Path.GetFullPath(Environment.ExpandEnvironmentVariables(datacollectorSearchPath));
Microsoft.TestPlatform.CoreUtilities (14)
Helpers\DotnetHostHelper.cs (12)
114foreach (string path in pathString.Split(Path.PathSeparator)) 116string exeFullPath = Path.Combine(path.Trim(), executableBaseName); 140if (Path.GetFileName(currentProcessFileName) == _muxerName) 198muxerPath = Path.Combine(envVar, _muxerName); 265muxerPath = Path.Combine(_environmentVariableHelper.GetEnvironmentVariable("ProgramFiles(x86)")!, "dotnet", _muxerName); 271? Path.Combine(_environmentVariableHelper.GetEnvironmentVariable("ProgramFiles")!, "dotnet", "x64", _muxerName) 272: Path.Combine(_environmentVariableHelper.GetEnvironmentVariable("ProgramFiles")!, "dotnet", _muxerName); 281? Path.Combine("/usr/local/share/dotnet/x64", _muxerName) 282: Path.Combine("/usr/local/share/dotnet", _muxerName); 286muxerPath = Path.Combine("/usr/share/dotnet", _muxerName); 339string path = Path.Combine(installLocation.Trim(), _muxerName); 368string path = Path.Combine(content, _muxerName);
Helpers\FileHelper.cs (2)
87=> Path.GetFullPath(path); 118=> Path.GetTempPath();
Microsoft.TestPlatform.CrossPlatEngine (47)
Client\MTP\MtpProxyExecutionManager.cs (2)
479string display = GetStringProperty(attachment, MtpConstants.DisplayName) ?? Path.GetFileName(path!); 501: new Uri(Path.GetFullPath(path));
Client\MTP\MtpServerConnection.cs (3)
402string workingDirectory = Path.GetDirectoryName(source) ?? Directory.GetCurrentDirectory(); 403string extension = Path.GetExtension(source); 412string apphost = Path.ChangeExtension(source, ".exe");
Client\ProxyOperationManager.cs (2)
469: Path.ChangeExtension( 476Path.GetExtension(logFile))).AddDoubleQuote();
Constants.cs (1)
26internal static string DefaultAdapterLocation = Path.Combine(new ProcessHelper().GetCurrentProcessLocation(), "Extensions");
DataCollection\DefaultDataCollectionLauncher.cs (3)
55var dataCollectorDirectory = Path.GetDirectoryName(typeof(DefaultDataCollectionLauncher).Assembly.GetAssemblyLocation()); 67? Path.Combine(dataCollectorDirectory, "TestHostNetFramework", dataCollectorProcessName) 68: Path.Combine(dataCollectorDirectory, dataCollectorProcessName);
DataCollection\DotnetDataCollectionLauncher.cs (5)
64var dataCollectorDirectory = Path.GetDirectoryName(typeof(DefaultDataCollectionLauncher).Assembly.GetAssemblyLocation()); 67var dataCollectorAssemblyPath = Path.Combine(dataCollectorDirectory, DataCollectorProcessName); 68string dataCollectorFileName = Path.GetFileNameWithoutExtension(dataCollectorAssemblyPath); 73var runtimeConfigPath = Path.Combine(dataCollectorDirectory, string.Concat(dataCollectorFileName, ".runtimeconfig.json")); 87var depsFilePath = Path.Combine(dataCollectorDirectory, string.Concat(dataCollectorFileName, ".deps.json"));
DataCollection\InProcDataCollectionExtensionManager.cs (3)
70CodeBasePaths.Add(Path.GetDirectoryName(extensionPath)!); 240if (Path.IsPathRooted(codeBase)) 252var assemblyPath = Path.Combine(extensionPath, codeBase);
DataCollection\InProcDataCollector.cs (3)
75if (Path.GetFileName(codeBase) == Constants.CoverletDataCollectorCodebase) 82TPDebug.Assert(Path.IsPathRooted(codeBase), "Absolute path expected"); 83testPluginCache.AddResolverSearchDirectories([Path.GetDirectoryName(codeBase)!]);
DataCollection\ProxyDataCollectionManager.cs (4)
329return Path.ChangeExtension( 336Path.GetExtension(logFile))).AddDoubleQuote(); 350var extensionsFolder = Path.Combine(Path.GetDirectoryName(typeof(ITestPlatform).Assembly.GetAssemblyLocation())!, "Extensions");
Discovery\DiscovererEnumerator.cs (3)
301return Path.GetDirectoryName(discovererLocation)! 408Path.GetExtension(source), 486var fileExtension = Path.GetExtension(filePath);
Discovery\DiscoveryManager.cs (5)
257string src = !Path.IsPathRooted(source) ? Path.Combine(Directory.GetCurrentDirectory(), source) : source; 275src = !Path.IsPathRooted(source) ? Path.Combine(Path.GetDirectoryName(package)!, source) : source;
EventHandlers\PathConverter.cs (2)
39string normalizedLocalPath = fileHelper.GetFullPath(unquotedOriginalPath).TrimEnd('\\').TrimEnd('/') + Path.DirectorySeparatorChar; 43string normalizedDeploymentPath = fileHelper.GetFullPath(unquotedDeploymentPath).TrimEnd('\\').TrimEnd('/') + Path.DirectorySeparatorChar;
EventHandlers\TestRequestHandler.cs (1)
114? System.IO.Path.GetDirectoryName(currentProcessPath)
Execution\BaseRunTests.cs (1)
518executorsFromDeprecatedLocations |= Path.GetDirectoryName(executorLocation)!.Equals(CrossPlatEngine.Constants.DefaultAdapterLocation);
PostProcessing\ArtifactProcessingManager.cs (7)
68_processArtifactFolder = Path.Combine(_fileHelper.GetTempPath(), _testSessionCorrelationId); 76_testSessionProcessArtifactFolder = Path.Combine(_processArtifactFolder, $"{pid}_{Guid.NewGuid()}"); 113_fileHelper.WriteAllTextToFile(Path.Combine(_testSessionProcessArtifactFolder, RunsettingsFileName), runSettingsXml); 116_fileHelper.WriteAllTextToFile(Path.Combine(_testSessionProcessArtifactFolder, ExecutionCompleteFileName), serializedExecutionComplete); 234.Select(file => new { TestSessionId = Path.GetFileName(Path.GetDirectoryName(file)), Artifact = file }) 244return Path.GetFileName(fileName) switch
Utilities\TestSourcesUtility.cs (2)
48return Path.GetDirectoryName(source); 59return Path.GetDirectoryName(source);
Microsoft.TestPlatform.Extensions.BlameDataCollector (23)
BlameCollector.cs (7)
166var dumpPath = Path.Combine(dumpDirectory, $"%e_%p_%t_crashdump.dmp"); 516var filepath = Path.Combine(GetTempDirectory(), Constants.AttachmentFileName + "_" + _attachmentGuid); 595string dumpFileName = Path.GetFileNameWithoutExtension(dumpFileNameFullPath); 713var temp = Environment.GetEnvironmentVariable("VSTEST_DUMP_TEMP_PATH") ?? Environment.GetEnvironmentVariable("AGENT_TEMPDIRECTORY") ?? Path.GetTempPath(); 714_tempDirectory = Path.Combine(temp, Guid.NewGuid().ToString()); 736var dumpPath = Path.Combine(Path.GetFullPath(dumpDirectory));
NetClientHangDumper.cs (1)
67var outputFile = Path.Combine(outputDirectory, $"{p.ProcessName}_{p.Id}_{DateTime.Now:yyyyMMddTHHmmss}_hangdump.dmp");
ProcDumpDumper.cs (7)
120var outputFile = Path.Combine(outputDirectory, $"{_outputFilePrefix}.dmp"); 137_tempDirectory = Path.GetDirectoryName(outputFile); 138_dumpFileName = Path.GetFileNameWithoutExtension(outputFile); 264.Where(dump => Path.GetFileNameWithoutExtension(dump).StartsWith(_outputFilePrefix ?? string.Empty)) 292var outputFile = Path.Combine(outputDirectory, $"{process.ProcessName}_{processId}_{DateTime.Now:yyyyMMddTHHmmss}_hangdump.dmp"); 309var tempDirectory = Path.GetDirectoryName(outputFile); 310var dumpFileName = Path.GetFileNameWithoutExtension(outputFile);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
WindowsHangDumper.cs (4)
89var outputFile = Path.Combine(outputDirectory, $"{p.ProcessName}_{p.Id}_{DateTime.Now:yyyyMMddTHHmmss}_hangdump.dmp"); 144var dumpMinitoolPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)!, "dump", dumpMinitoolName); 156Path.GetDirectoryName(outputFile),
Microsoft.TestPlatform.PlatformAbstractions (15)
common\System\ProcessHelper.cs (3)
285return Path.GetDirectoryName(typeof(ProcessHelper).Assembly.Location); 370? Path.Combine(GetCurrentProcessLocation(), GetFormattedCurrentProcessArchitecture(), Arm) 371: Path.Combine(GetCurrentProcessLocation(), GetFormattedCurrentProcessArchitecture());
common\Tracing\PlatformEqtTrace.cs (7)
338string runnerLogFileName = $"{Path.GetFileNameWithoutExtension(process.MainModule!.FileName)}_{process.Id}.{DateTime.Now:yy-MM-dd_HH-mm-ss_fffff}.diag"; 339string logsDirectory = Path.GetTempPath(); 342LogFile ??= Path.Combine(logsDirectory, runnerLogFileName); 356runnerLogFileName = Path.Combine(LogFile, runnerLogFileName); 357LogFile = Path.Combine(LogFile, $"{Path.GetFileNameWithoutExtension(process.MainModule.FileName)}_{process.Id}.diag"); 400processName = Path.GetFileName(args[0]);
common\Tracing\RollingFileTraceListener.cs (4)
188string directory = Path.GetDirectoryName(actualFileName)!; 189string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(actualFileName); 190string extension = Path.GetExtension(actualFileName); 197string archiveFileName = Path.Combine(directory, fileNameBuilder.ToString());
netcore\System\ProcessHelper.cs (1)
21return Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!;
Microsoft.TestPlatform.TestHostRuntimeProvider (33)
Hosting\DefaultTestHostManager.cs (12)
180var currentWorkingDirectory = Path.GetDirectoryName(typeof(DefaultTestHostManager).Assembly.Location); 186var testhostProcessPath = Path.Combine(currentWorkingDirectory, testHostProcessName); 195testHostProcessName = Path.Combine("TestHostNetFramework", originalTestHostProcessName); 196testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", testHostProcessName); 225testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", originalTestHostProcessName); 323extensions = extensions.Concat(sources.SelectMany(s => _fileHelper.EnumerateFiles(Path.GetDirectoryName(s)!, SearchOption.TopDirectoryOnly, TestAdapterEndsWithPattern))); 343actualSources.Add(Path.Combine(Path.GetDirectoryName(uwpSource)!, GetUwpSources(uwpSource)!)); 437var extensionAssemblyName = Path.GetFileNameWithoutExtension(extensionFullPath); 596if (!Path.IsPathRooted(appxManifestPath)) 598appxManifestPath = Path.Combine(Path.GetDirectoryName(uwpSource)!, appxManifestPath);
Hosting\DotnetTestHostManager.cs (21)
269var dotnetExeArchitecture = GetExecutableArchitecture(Path.Combine(dotnetRoot, "dotnet.exe")); 306var sourceFile = Path.GetFileNameWithoutExtension(sourcePath); 307var sourceDirectory = Path.GetDirectoryName(sourcePath)!; 310var runtimeConfigPath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".runtimeconfig.json")); 325var depsFilePath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".deps.json")); 337var runtimeConfigDevPath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".runtimeconfig.dev.json")); 361var fullExePath = Path.Combine(sourceDirectory, exeName); 385var testHostExeNugetPath = Path.Combine(testHostNugetRoot.FullName, "build", "net8.0", folderName, exeName); 388testHostExeNugetPath = Path.Combine(testHostNugetRoot.FullName, "build", "net9.0", folderName, exeName); 419var testHostNextToRunner = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, "testhost.dll"); 442var testhostDeps = Path.Combine(Path.GetDirectoryName(testHostNextToRunner)!, "testhost.deps.json"); 456var testHostProbingPath = Path.GetDirectoryName(testHostNextToRunner)!; 471var testhostRuntimeConfig = Path.Combine(Path.GetDirectoryName(testHostNextToRunner)!, "testhost-latest.runtimeconfig.json"); 590var testhostDllPath = Path.ChangeExtension(startInfo.FileName, ".dll"); 842var sourceDirectory = Path.GetDirectoryName(sources.Single()); 1023testHostPath = Path.Combine(testhostPackage.Path, testHostPath); 1064testHostFullPath = Path.Combine(x.GetString()!, testHostPath); 1131var testHostNextToTestProject = Path.Combine(sourceDirectory, "testhost.dll");
Microsoft.TestPlatform.Utilities (10)
ClientUtilities.cs (4)
32var root = Path.GetDirectoryName(path)!; 68&& !Path.IsPathRooted(fileName)) 71fileName = Path.Combine(root, fileName); 72fileName = Path.GetFullPath(fileName);
CodeCoverageDataAttachmentsHandler.cs (2)
170var assemblyPath = Path.Combine(Path.GetDirectoryName(dataAttachmentAssemblyLocation)!, CodeCoverageIoAssemblyName + ".dll");
InferRunSettingsHelper.cs (1)
687var onlyFileName = Path.GetFileName(source);
MSTestSettingsUtilities.cs (3)
63return string.Equals(Path.GetExtension(settingsFile), ".testSettings", StringComparison.OrdinalIgnoreCase) 64|| string.Equals(Path.GetExtension(settingsFile), ".testrunConfig", StringComparison.OrdinalIgnoreCase) 65|| string.Equals(Path.GetExtension(settingsFile), ".vsmdi", StringComparison.OrdinalIgnoreCase);
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (1)
ConsoleParameters.cs (1)
75var directoryPath = Path.GetDirectoryName(value);
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 (16)
Microsoft\VisualBasic\Helpers\FileSystemUtils.vb (2)
152''' <exception cref="Path.GetFullPath"> 153''' <see cref="Path.GetFullPath"/> for possible exceptions.
Microsoft\VisualBasic\Logging\FileLogTraceListener.vb (14)
38Private _baseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) 137basePath = Path.GetDirectoryName(Application.ExecutablePath) 141basePath = Path.GetTempPath() 169Return Path.Join(basePath, fileName) 258Path.GetFullPath(value) 282Dim fileName As String = Path.GetFullPath(_customLocation) 288Dim tempPath As String = Path.GetFullPath(value) 594Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") 595Dim fileName As String = Path.GetDirectoryName(LogFileName) 641Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) 667Dim baseStreamName As String = Path.GetFullPath($"{LogFileName}{FILE_EXTENSION}") 675fileName = Path.GetFullPath($"{LogFileName}{FILE_EXTENSION}") 677fileName = Path.GetFullPath(FormattableString.Invariant($"{LogFileName}-{i}{FILE_EXTENSION}"))
Microsoft.VisualStudio.TestPlatform.Client (6)
TestPlatform.cs (6)
215var sourceDirectory = Path.GetDirectoryName(source); 270string extensionsFolder = Path.Combine( 271Path.GetDirectoryName(typeof(TestPlatform).Assembly.GetAssemblyLocation())!, 280extensionsFolder = Path.Combine(Path.GetDirectoryName(extensionsFolder)!, "vstest.console", "Extensions"); 314string adapterPath = Path.GetFullPath(Environment.ExpandEnvironmentVariables(path));
Microsoft.VisualStudio.TestPlatform.Common (26)
DataCollection\DataCollectionAttachmentManager.cs (8)
108SessionOutputDirectory = Path.Combine(Path.GetTempPath(), DefaultOutputDirectoryName, id.Id.ToString()); 114var absolutePath = Path.GetFullPath(expandedOutputDirectory); 115SessionOutputDirectory = Path.Combine(absolutePath, id.Id.ToString()); 210var directoryName = Path.GetDirectoryName(localFilePath); 249var directoryPath = Path.Combine( 252var localFilePath = Path.Combine(directoryPath, Path.GetFileName(fileTransferInfo.FileName));
ExtensionFramework\TestPluginCache.cs (9)
247var directories = _filterableExtensionPaths.Concat(_unfilterableExtensionPaths).Select(e => Path.GetDirectoryName(Path.GetFullPath(e))).Distinct(); 351var extensionDirectory = Path.GetDirectoryName(Path.GetFullPath(extensionAssembly))!; 354var currentDirectory = Path.GetDirectoryName(typeof(TestPluginCache).Assembly.GetAssemblyLocation())!; 372var extensionDirectories = GetExtensionPaths(string.Empty).Select(e => Path.GetDirectoryName(Path.GetFullPath(e))!).Distinct().ToList(); 379var currentDirectory = Path.GetDirectoryName(typeof(TestPluginCache).Assembly.GetAssemblyLocation())!; 432mergedExtensionsList = additionalExtensions.Select(Path.GetFullPath)
ExtensionFramework\TestPluginDiscoverer.cs (1)
94var assemblyName = Path.GetFileNameWithoutExtension(file);
Utilities\AssemblyResolver.cs (1)
136var assemblyPath = Path.Combine(dir, requestedName.Name + extension);
Utilities\InstallationContext.cs (6)
30var pathToDevenv = Path.Combine(vsInstallPath, DevenvExe); 45return Path.Combine(visualStudioDirectory, DevenvExe); 53Path.Combine(visualStudioDirectory, PrivateAssembliesDirName), 54Path.Combine(visualStudioDirectory, PublicAssembliesDirName), 55Path.Combine(visualStudioDirectory, "CommonExtensions", "Microsoft", "TestWindow"), 56Path.Combine(visualStudioDirectory, "CommonExtensions", "Microsoft", "TeamFoundation", "Team Explorer"),
Utilities\RunSettingsProviderExtensions.cs (1)
187var defaultResultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), Constants.ResultsDirectoryName);
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (4)
HtmlLogger.cs (4)
305HtmlFilePath = Path.Combine(TestResultsDirPath!, logFilePrefixValue); 311HtmlFilePath = Path.Combine(TestResultsDirPath!, logFileNameValue); 364var fileNameWithIter = i == 0 ? fileName : Path.GetFileNameWithoutExtension(fileName) + $"[{i}]"; 365var fullFilePath = Path.Combine(TestResultsDirPath!, $"TestResult_{fileNameWithIter}.{fileExtension}");
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (43)
ObjectModel\TestRun.cs (1)
166return Path.Combine(GetResultsDirectory(), result.RelativeTestResultsDirectory);
ObjectModel\TestRunConfiguration.cs (2)
82return Path.Combine(_runDeploymentRoot, DeploymentInDirectorySuffix); 145TrxFileHelper.MakePathRelative(_runDeploymentRoot, Path.GetDirectoryName(_runDeploymentRoot)!),
TrxLogger.cs (5)
175var logFileDir = Path.GetDirectoryName(logFileNameInit); 178testRunDirectory = Path.Combine(testRunDirectory, logFileDir); 564filePath = Path.Combine(_testResultsDirPath, Path.GetFileName(logFileNameValue!)); 571var trxFileDirPath = Path.GetDirectoryName(filePath);
Utility\Converter.cs (18)
440string runDirectoryName = Path.Combine(trxFileDirectory, testRun.RunConfiguration!.RunDeploymentRootDirectory); 441string inDirectory = Path.Combine(runDirectoryName, "In"); 446targetDirectory = Path.Combine(inDirectory, testResultExecutionId.ToString()); 449targetDirectory = Path.Combine(targetDirectory, Environment.MachineName); 462_ = (Path.GetFullPath(sourceFile) == sourceFile); 463TPDebug.Assert(Path.IsPathRooted(sourceFile), "Source file is not rooted"); 466string targetFileName = TrxFileHelper.GetNextIterationFileName(targetDirectory, Path.GetFileName(sourceFile), false); 474string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName)); 497string runDirectoryName = Path.Combine(trxFileDirectory, testRun.RunConfiguration!.RunDeploymentRootDirectory); 498string testResultDirectory = Path.Combine(runDirectoryName, "In"); 502testResultDirectory = Path.Combine(testResultDirectory, testResultExecutionId.ToString()); 505testResultDirectory = Path.Combine(testResultDirectory, Environment.MachineName); 519TPDebug.Assert(Path.IsPathRooted(sourceFile), "Source file is not rooted"); 521string targetFileName = TrxFileHelper.GetNextIterationFileName(testResultDirectory, Path.GetFileName(sourceFile), false); 529string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName)); 621string testCaseSource = Path.GetFileNameWithoutExtension(source);
Utility\TrxFileHelper.cs (17)
144var fileNamePrefix = Path.GetFileNameWithoutExtension(fileName); 145var extension = Path.GetExtension(fileName); 150string tryMePath = Path.Combine(directoryName, tryMe); 177if (!Path.IsPathRooted(path)) 181path = Path.Combine(basePath, path); 183path = Path.GetFullPath(path); 184basePath = Path.GetFullPath(basePath); 186char[] delimiters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 236newPath.Append(Path.DirectorySeparatorChar); 249newPath.Append(Path.DirectorySeparatorChar); 316string tryMePath = Path.Combine(baseDirectoryName, tryMe); 377string withoutExtensionName = Path.GetFileNameWithoutExtension(baseName); 379if (Path.HasExtension(baseName)) 381tryMe += Path.GetExtension(baseName); // Path.GetExtension already returns the leading ".". 397return !_checkMatchingDirectory || !Path.HasExtension(path) || !Directory.Exists(Path.ChangeExtension(path, string.Empty));
Microsoft.VisualStudio.TestPlatform.ObjectModel (10)
Constants.cs (1)
206public static readonly string DefaultResultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), ResultsDirectoryName);
DataCollector\Common\FileHelper.cs (1)
20char[] invalidCharsArray = Path.GetInvalidFileNameChars();
Navigation\DiaSession.cs (3)
114var pdbFilePath = Path.ChangeExtension(binaryPath, ".pdb"); 119? Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(pdbFilePath)!)
Navigation\FullSymbolReader.cs (2)
129if (!Path.IsPathRooted(filename)) 131filename = Path.Combine(Directory.GetCurrentDirectory(), filename);
Navigation\NativeMethods.cs (1)
562IntPtr modHandle = LoadLibraryEx(Path.Combine(nativeDllDirectory, "msdia140.dll"), IntPtr.Zero, 0);
Navigation\PortableSymbolReader.cs (1)
87var pdbFilePath = Path.ChangeExtension(binaryPath, ".pdb");
TestCase.cs (1)
190source = Path.GetFileName(source);
Microsoft.Web.XmlTransform (3)
NamedTypeFactory.cs (3)
37if (!Path.IsPathRooted(path)) { 39path = Path.Combine(Path.GetDirectoryName(relativePathRoot), path);
Mono.Cecil (8)
Mono.Cecil.Cil\Symbols.cs (1)
1202 return Path.ChangeExtension (assemblyFileName, ".pdb");
Mono.Cecil\AssemblyReader.cs (2)
685 var path = Path.GetDirectoryName (module.FileName); 686 return Path.Combine (path, name);
Mono.Cecil\BaseAssemblyResolver.cs (4)
202 foreach (var path in paths.Split (Path.PathSeparator)) 203 if (string.Equals (Path.GetExtension (path), ".dll", StringComparison.OrdinalIgnoreCase)) 204 result [Path.GetFileNameWithoutExtension (path)] = path; 215 string file = Path.Combine (directory, name.Name + extension);
Mono.Cecil\ModuleDefinition.cs (1)
1341 return Path.GetFullPath (file_stream.Name);
MSBuild (39)
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 566projectDirectory = Path.GetDirectoryName(Path.GetFullPath(projectFile)); 657string autoResponseFile = Path.Combine(path, autoResponseFileName);
OutOfProcTaskHostNode.cs (1)
1361? 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");
src\msbuild\src\Shared\Debugging\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");
src\msbuild\src\Shared\Debugging\PrintLineDebugger.cs (1)
141return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
src\msbuild\src\Shared\Debugging\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");
src\msbuild\src\Shared\TypeLoader.cs (5)
77string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 78microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 249string baseDir = Path.GetDirectoryName(assemblyLoadInfo.AssemblyFile); 272string assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 310assembliesDictionary[Path.GetFileName(path)] = path;
XMake.cs (16)
164s_exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath()); 2730Console.WriteLine($"{Path.Combine(s_exePath, s_exeName)} {equivalentCommandLine} {projectFile}"); 3540if (!extensionsToIgnore.Contains(Path.GetExtension(s)) && !s.EndsWith("~", StringComparison.CurrentCultureIgnoreCase)) 3555if (!extensionsToIgnore.Contains(Path.GetExtension(s))) 3573string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]); 3574string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]); 3593string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]); 3594string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]); 3648|| Path.IsPathRooted(projectFile) 3657if (string.IsNullOrEmpty(logicalCurrentDirectory) || !Path.IsPathRooted(logicalCurrentDirectory)) 3671string rebasedProjectFile = Path.GetFullPath(Path.Combine(logicalCurrentDirectory, projectFile)); 3695InitializationException.VerifyThrow(string.Equals(extension, Path.GetExtension(extension), StringComparison.OrdinalIgnoreCase), "InvalidExtensionToIgnore", extension, null, false); 4151if (!string.IsNullOrEmpty(logFileName) && !Path.IsPathRooted(logFileName)) 4154$"logFile={Path.Combine(Directory.GetCurrentDirectory(), logFileName)}"); 4171fileParameters += $"logFile={Path.Combine(Directory.GetCurrentDirectory(), msbuildLogFileName)}";
MSBuild.Coordinator (1)
CoordinatorServer.DefaultDebugOutput.cs (1)
37_debugDumpTraceFilePath = Path.Combine(_debugDumpDirectory, $"MSBuild_CoordinatorTrace_PID_{EnvironmentUtilities.CurrentProcessId}.txt");
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
338[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
netstandard (1)
netstandard.cs (1)
948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
NuGet.Build.Tasks (34)
BuildTasksUtility.cs (7)
252FileUtility.Delete(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName)); 264FileUtility.Delete(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))); 711return GetPackagesConfigFilePath(Path.GetDirectoryName(projectFullPath), Path.GetFileNameWithoutExtension(projectFullPath)); 733string packagesConfigPath = Path.Combine(projectDirectory, NuGetConstants.PackageReferenceFile); 740packagesConfigPath = Path.Combine(projectDirectory, "packages." + projectName + ".config");
GetRestoreProjectReferencesTask.cs (3)
62var parentDirectory = Path.GetDirectoryName(ParentProjectPath); 74var combinedPath = Path.Combine(parentDirectory, project.ItemSpec); 76var referencePath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(combinedPath));
GetRestoreSettingsTask.cs (7)
141Debug.Assert(Path.IsPathFullyQualified(ProjectUniqueName)); 142Debug.Assert(Path.IsPathFullyQualified(MSBuildStartupDirectory)); 143Debug.Assert(string.IsNullOrEmpty(RestoreRootConfigDirectory) || Path.IsPathFullyQualified(RestoreRootConfigDirectory)); 144Debug.Assert(string.IsNullOrEmpty(RestoreSolutionDirectory) || Path.IsPathFullyQualified(RestoreSolutionDirectory)); 155restoreDir = Path.GetDirectoryName(ProjectUniqueName); 178Path.GetDirectoryName(ProjectUniqueName), 187Path.GetDirectoryName(ProjectUniqueName),
GetRestoreSolutionProjectsTask.cs (3)
53var parentDirectory = Path.GetDirectoryName(SolutionFilePath); 62var combinedPath = Path.Combine(parentDirectory, project.ItemSpec); 64var projectPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(combinedPath));
RestoreSettingsUtils.cs (5)
31var solutionSettingsFile = Path.Combine( 37restoreConfigFile = Path.GetFullPath(restoreConfigFile); 57var configFileFullPath = Path.GetFullPath(restoreConfigFile); 58var directory = Path.GetDirectoryName(configFileFullPath); 59var configFileName = Path.GetFileName(configFileFullPath);
RestoreTask.cs (3)
281restoredProjectOutputPaths.Add(new TaskItem(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName))); 288restoredProjectOutputPaths.Add(new TaskItem(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))));
StaticGraphRestoreTaskBase.cs (6)
247yield return Path.Combine(ThisAssemblyLazy.Value.DirectoryName, Path.ChangeExtension(ThisAssemblyLazy.Value.Name, ".Console.dll")); 256yield return Path.Combine(MSBuildBinPath, "MSBuild.dll"); 353return Path.GetFullPath(processFileName); 357return Path.GetFullPath(Path.Combine(MSBuildBinPath, "..", "..", "dotnet"));
NuGet.Build.Tasks.Console (15)
MSBuildStaticGraphRestore.cs (14)
145if ((string.Equals(Path.GetExtension(entryProjectFilePath), ".sln", StringComparison.OrdinalIgnoreCase) 146|| string.Equals(Path.GetExtension(entryProjectFilePath), ".slnx", StringComparison.OrdinalIgnoreCase)) 622: Path.GetDirectoryName(solutionDir); 637return outputPath == null ? null : Path.GetFullPath(Path.Combine(project.Directory, outputPath)); 644return outputPath == null ? null : Path.GetFullPath(Path.Combine(projectDirectory, outputPath)); 716var extension = Path.GetExtension(entryProjectPath); 912var message = string.Format(CultureInfo.CurrentCulture, Strings.Error_ReadingProjectInformation, projectName ?? Path.GetFileNameWithoutExtension(projectPath), innerException.Message); 932outputPath ??= Path.Combine(projectDirectory, "obj"); 937Name = projectName ?? Path.GetFileNameWithoutExtension(projectPath), 1487LoggingQueue.Enqueue(new ConsoleOutLogEmbedInBinlog(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName))); 1494LoggingQueue.Enqueue(new ConsoleOutLogEmbedInBinlog(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))));
RestoreProjectAdapter.cs (1)
19Directory = Path.GetDirectoryName(fullPath) ?? throw new ArgumentNullException(nameof(fullPath));
NuGet.Build.Tasks.Pack (40)
GetPackOutputItemsTask.cs (4)
61outputs.Add(new TaskItem(Path.Combine(PackageOutputPath, nupkgFileName))); 62outputs.Add(new TaskItem(Path.Combine(NuspecOutputPath, nuspecFileName))); 68outputs.Add(new TaskItem(Path.Combine(PackageOutputPath, nupkgSymbolsFileName))); 69outputs.Add(new TaskItem(Path.Combine(NuspecOutputPath, nuspecSymbolsFileName)));
GetProjectReferencesFromAssetsFileTask.cs (4)
43assetsFilePath = Path.Combine(RestoreOutputAbsolutePath, LockFileFormat.AssetsFileName); 66var projectDirectory = Path.GetDirectoryName(assetsFile.PackageSpec.RestoreMetadata.ProjectPath); 71.Select(library => new TaskItem(Path.GetFullPath(Path.Combine(
PackTaskLogic.cs (32)
108var assetsFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName); 344string assetsFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName); 542targetPath = Path.GetFileName(finalOutputPath); 620packArgs.CurrentDirectory = Path.Combine( 622request.PackItem.GetProperty("Directory")).TrimEnd(Path.DirectorySeparatorChar); 639if (Path.IsPathRooted(request.NuspecOutputPath)) 645packArgs.PackTargetArgs.NuspecOutputPath = Path.Combine( 716var fileName = Path.GetFileName(sourcePath); 720Compare(Path.GetExtension(fileName), 721Path.GetExtension(targetPath)) == 0 722&& !string.IsNullOrEmpty(Path.GetExtension(fileName)) 724: Path.Combine(targetPath, recursiveDir)); 744if (setOfTargetPaths.Remove("contentFiles" + Path.DirectorySeparatorChar) 750Path.Combine("contentFiles", language, framework.GetShortFolderName() 764!Path.GetFileName(sourcePath) 771if (Path.IsPathRooted(identity)) 774identity = Path.GetDirectoryName(identity); 778else if (identity.EndsWith(Path.GetFileName(sourcePath), StringComparison.CurrentCultureIgnoreCase)) 780identity = Path.GetDirectoryName(identity); 785var newTargetPath = Path.Combine(targetPath, identity); 802var fileName = Path.GetFileName(sourcePath); 803if (string.IsNullOrEmpty(Path.GetExtension(fileName)) || 804!Path.GetExtension(fileName) 805.Equals(Path.GetExtension(targetPath), StringComparison.OrdinalIgnoreCase)) 807currentPath = Path.Combine(targetPath, fileName); 829sourcePath = Path.Combine(sourceProjectFile.Replace(Path.GetFileName(sourceProjectFile), string.Empty), identity); 831return Path.GetFullPath(sourcePath); 860sourceProjectFile = Path.GetDirectoryName(sourceProjectFile); 923library => Path.GetFullPath(Path.Combine( 924Path.GetDirectoryName(assetsFile.PackageSpec.RestoreMetadata.ProjectPath),
NuGet.CommandLine.XPlat (24)
Commands\Package\Update\PackageUpdateCommandRunner.cs (1)
104var projectName = Path.GetFileNameWithoutExtension(projectPath);
Commands\Package\Update\PackageUpdateIO.cs (3)
48string settingsRoot = Directory.Exists(solutionDirectory) ? solutionDirectory : Path.GetDirectoryName(solutionDirectory)!; 66string tempFile = Path.GetTempFileName(); 477var assetsFilePath = Path.Combine(packageSpec.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName);
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (4)
79var projectFullPath = Path.GetFullPath(packageReferenceArgs.ProjectPath); 89PathUtility.GetStringComparerBasedOnOS().Equals(Path.GetFullPath(p.RestoreMetadata.ProjectPath), projectFullPath)) 351var nuspecFilePath = Path.GetFullPath(Path.Combine(packageDirectory, nuspecFile));
Commands\PackageReferenceCommands\ListPackage\ListPackageCommand.cs (3)
263var configFileFullPath = Path.GetFullPath(configFile); 264var directory = Path.GetDirectoryName(configFileFullPath); 265var configFileName = Path.GetFileName(configFileFullPath);
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (1)
71string fileExtension = Path.GetExtension(listPackageArgs.Path);
Commands\Why\DependencyGraphFinder.cs (3)
106string projectDirectory = Path.GetDirectoryName(assetsFile.PackageSpec.FilePath)!; 110.ToDictionary(l => Path.GetFullPath(Path.Combine(projectDirectory, l.Path)), l => l, StringComparer.OrdinalIgnoreCase);
Commands\Why\WhyCommandRunner.cs (1)
175fullPath = Path.GetFullPath(path);
Utility\MSBuildAPIUtility.cs (2)
125string fullPath = Path.GetFullPath(path); 1070var fullPath = Path.GetFullPath(filename);
Utility\XPlatUtility.cs (6)
71var configFileFullPath = Path.GetFullPath(configFile); 72var directory = Path.GetDirectoryName(configFileFullPath); 73var configFileName = Path.GetFileName(configFileFullPath); 131var extension = System.IO.Path.GetExtension(fileName); 148var extension = System.IO.Path.GetExtension(fileName); 162var extension = Path.GetExtension(filename);
NuGet.Commands (122)
CommandRunners\PackCommandRunner.cs (30)
46@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar), 47@"src\**\*".Replace('\\', Path.DirectorySeparatorChar) 53@"content\**\*".Replace('\\', Path.DirectorySeparatorChar), 54@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar) 87var result = BuildPackage(Path.GetFullPath(Path.Combine(_packArgs.CurrentDirectory, _packArgs.Path))); 93string extension = Path.GetExtension(path); 117Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 202Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 204string resolvedNuSpecOutputPath = Path.Combine( 205Path.GetDirectoryName(outputPath), 230string tempOutputPath = Path.Combine( 232Path.GetRandomFileName()); 250Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 252string sha512OutputPath = Path.Combine(outputPath + ".sha512"); 256string tempOutputPath = Path.Combine( 258Path.GetRandomFileName()); 571WriteLine(Strings.Log_PackageCommandAttemptingToBuildSymbolsPackage, Path.GetFileName(path)); 706var fileName = Path.GetFileName(filePath); 748path = path.Substring(index + basePath.Length).TrimStart(Path.DirectorySeparatorChar); 823List<IPackageFile> toRemove = files.Where(t => !string.Equals(Path.GetExtension(t.Path), ".pdb", StringComparison.OrdinalIgnoreCase)).ToList(); 876return Path.Combine(finalOutputDirectory, outputFile); 911string directory = Path.GetDirectoryName(packArgs.Path); 919packArgs.OutputDirectory = Path.GetFullPath(packArgs.OutputDirectory); 924packArgs.BasePath = Path.GetFullPath(packArgs.BasePath); 948List<string> candidates = files.Where(file => AllowedExtensions.Contains(Path.GetExtension(file))).ToList(); 953!Path.GetFileName(ext).Equals(ProjectJsonPathUtilities.ProjectConfigFileName, StringComparison.OrdinalIgnoreCase) && 967candidates.RemoveAll(file => Path.GetExtension(file).Equals(NuGetConstants.ManifestExtension, StringComparison.OrdinalIgnoreCase)); 975candidates.RemoveAll(file => Path.GetExtension(file).Equals(".json", StringComparison.OrdinalIgnoreCase)); 987return Path.Combine(packArgs.CurrentDirectory, result);
MSBuildProjectFactory.cs (19)
103var manifestDirectory = Path.GetDirectoryName(manifestPath); 134var extension = Path.GetExtension(file.FinalOutputPath); 148Target = IsTool ? Path.Combine(targetFolders[i], targetPath) : Path.Combine(targetFolders[i], tfm, targetPath) 160var fileExtension = Path.GetExtension(packageFile.Source); 195Target = target.EndsWith(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal) || string.IsNullOrEmpty(target) 196? Path.Combine(target, Path.GetFileName(sourcePath)) 204var includePath = PathUtility.GetRelativePath("contentFiles" + Path.DirectorySeparatorChar, packageFile.Target, '/'); 207if (!Path.GetExtension(includePath) 208.Equals(Path.GetExtension(sourcePath), StringComparison.OrdinalIgnoreCase)) 210includePath = Path.Combine(includePath, Path.GetFileName(sourcePath)); 258var projectName = Path.GetFileName(projectDirectory); 259var targetPath = Path.Combine(SourcesFolder, projectName); 270var relativePath = Path.GetDirectoryName(sourcePath).Replace(projectDirectoryWithSeparatorChar, string.Empty, StringComparison.Ordinal); 282targetPath = Path.Combine(targetPath, relativePath); 285var finalTargetPath = Path.Combine(targetPath, Path.GetFileName(sourcePath));
PackagesLockFileBuilder.cs (1)
97var id = PathUtility.GetStringComparerBasedOnOS().Equals(Path.GetFileNameWithoutExtension(projectFullPath), projectReference.Name)
RestoreCommand\CompatibilityChecker.cs (4)
163.Where(p => Path.GetExtension(p.Path) 166var name = Path.GetFileNameWithoutExtension(compile.Path); 178.Where(p => Path.GetExtension(p.Path) 181var name = Path.GetFileNameWithoutExtension(runtime.Path);
RestoreCommand\ContentFiles\ContentFileUtils.cs (3)
131absolutePaths.Add(Path.Combine(MatcherRoot, key)); 221&& !string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(lockFileItem.Path)); 229destination = Path.GetFileName(lockFileItem.Path);
RestoreCommand\Diagnostics\UnresolvedMessages.cs (1)
95if (unresolved.Name.IndexOf(Path.DirectorySeparatorChar, StringComparison.Ordinal) > -1 && File.Exists(unresolved.Name))
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (1)
188var rootPath = Path.GetDirectoryName(project.PackageSpec.FilePath);
RestoreCommand\RequestFactory\RestoreArgs.cs (7)
94var configFileFullPath = Path.GetFullPath(ConfigFile); 95var directory = Path.GetDirectoryName(configFileFullPath); 96var configFileName = Path.GetFileName(configFileFullPath); 111return Path.GetFullPath(GlobalPackagesFolder); 117return Path.GetFullPath(Path.Combine(rootDirectory, globalPath)); 191request.LockFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName);
RestoreCommand\RestoreCommand.cs (2)
1761projectLockFilePath = Path.Combine(_request.RestoreOutputPath, LockFileFormat.AssetsFileName); 1765return Path.GetFullPath(projectLockFilePath);
RestoreCommand\RestoreRequest.cs (1)
51RestoreOutputPath = Path.GetDirectoryName(Project.FilePath);
RestoreCommand\RestoreRunner.cs (3)
179inputs.Add(Path.GetFullPath(".")); 207Path.GetFullPath(input)); 396var fileExtension = Path.GetExtension(input);
RestoreCommand\Utility\BuildAssetsUtils.cs (13)
76Directory.CreateDirectory(Path.GetDirectoryName(file.Path)); 180var resolvableAssetsFilePath = @"$(MSBuildThisFileDirectory)" + Path.GetFileName(assetsFilePath); 287var destinationSubDirectory = Path.GetDirectoryName(outputPath); 291entry.Add(new XElement(Namespace + "DestinationSubDirectory", destinationSubDirectory + Path.DirectorySeparatorChar)); 299var linkPath = string.Join(string.Empty + Path.DirectorySeparatorChar, 433var projFileName = Path.GetFileName(project.RestoreMetadata.ProjectPath); 434path = Path.Combine(project.RestoreMetadata.OutputPath, $"{projFileName}.nuget.g{extension}"); 439var dir = Path.GetDirectoryName(project.FilePath); 440path = Path.Combine(dir, $"{project.Name}.nuget{extension}"); 448var projFileName = Path.GetFileName(project.RestoreMetadata.ProjectPath); 450return Path.Combine(project.RestoreMetadata.OutputPath, $"{projFileName}.nuget.g{extension}"); 846return Path.Combine(package.Value.Package.ExpandedPath, LockFileUtils.ToDirectorySeparator(item.Path)); 868if (extension.Equals(Path.GetExtension(item.Path), StringComparison.OrdinalIgnoreCase))
RestoreCommand\Utility\LockFileUtils.cs (14)
312if (Path.GetFileName(btItem.Path).Equals(Path.GetFileName(buildItem.Path), StringComparison.OrdinalIgnoreCase)) 450lockFileLib.RuntimeAssemblies = lockFileLib.RuntimeAssemblies.Where(p => !p.Path.StartsWith("lib/", StringComparison.Ordinal) || referenceFilter.Contains(Path.GetFileName(p.Path))).ToList(); 451lockFileLib.CompileTimeAssemblies = lockFileLib.CompileTimeAssemblies.Where(p => !p.Path.StartsWith("lib/", StringComparison.Ordinal) || referenceFilter.Contains(Path.GetFileName(p.Path))).ToList(); 637string relativePath = PathUtility.GetPathWithForwardSlashes(Path.Combine("bin", "placeholder", $"{localMatch.Library.Name}.dll")); 805int lastSeparator = path.LastIndexOf(Path.AltDirectorySeparatorChar); 809int separator = path.IndexOf(Path.AltDirectorySeparatorChar, segmentStart); 878Path.GetFileName(c.Path), 889Path.GetFileName(c.Path), 979var fileName = Path.GetFileName(firstItem.Path); 1145if (Path.DirectorySeparatorChar == '/') 1150return path.Replace('/', Path.DirectorySeparatorChar); 1235item => Path.GetFileName(item.Path).Equals(Path.GetFileName(currentBuildItem.Path), StringComparison.OrdinalIgnoreCase));
RestoreCommand\Utility\MSBuildRestoreUtility.cs (5)
227?? Path.GetFileNameWithoutExtension(result.FilePath); 314pcRestoreMetadata.RepositoryPath = Path.Combine( 351var projectName = specItem.GetProperty("ProjectName") ?? Path.GetFileNameWithoutExtension(projectPath); 355outputPath = Path.Combine(Path.GetDirectoryName(projectPath), "obj");
RestoreCommand\Utility\NoOpRestoreUtilities.cs (7)
43return cacheRoot == null ? null : Path.Combine(cacheRoot, NoOpCacheFileName); 69return Path.Combine( 94return projectCacheFilePath != null ? Path.GetFullPath(projectCacheFilePath) : null; 151var packageDirectory = Path.GetDirectoryName(package); 152var metadataFile = Path.Combine(packageDirectory, PackagingCoreConstants.NupkgMetadataFileExtension); 209var projFileName = Path.GetFileName(request.Project.RestoreMetadata.ProjectPath); 211return Path.Combine(outputRoot, dgFileName);
RestoreCommand\Utility\PackageSpecFactory.cs (5)
439string packagesConfigPath = Path.Combine(projectDirectory, NuGetConstants.PackageReferenceFile); 446packagesConfigPath = Path.Combine(projectDirectory, "packages." + projectName + ".config"); 808: Path.GetDirectoryName(solutionDir)!; 938return outputPath == null ? null : Path.GetFullPath(Path.Combine(project.Directory, outputPath));
SignCommand\SignCommandRunner.cs (3)
115var tempPackageFile = new FileInfo(Path.GetTempFileName()); 127outputPath = Path.Combine(outputDirectory, Path.GetFileName(packagePath));
SourcesCommands\SourceRunners.cs (3)
341var configFileFullPath = Path.GetFullPath(configfile); 342var configDirectory = Path.GetDirectoryName(configFileFullPath); 343var configFileName = Path.GetFileName(configFileFullPath);
NuGet.Common (108)
ConcurrencyUtilities.cs (4)
252basePath = Path.Combine(NuGetEnvironment.GetFolderPath(NuGetFolderPath.Temp), "lock"); 268return Path.Combine(BasePath, FilePathToLockName(filePath)); 280var fullPath = Path.IsPathRooted(filePath) ? Path.GetFullPath(filePath) : filePath;
LocalResourceUtils.cs (2)
104var filePath = Path.Combine(folderPath, Path.GetFileName(file));
Migrations\Migration1.cs (10)
21string nugetPath = Path.Combine(localAppDataPath, "NuGet"); 37var v3cachePath = Path.Combine(nugetBaseDirectory, "v3-cache"); 43var pluginsCachePath = Path.Combine(nugetBaseDirectory, "plugins-cache"); 65var nugetLocalAppDataPath = Path.GetDirectoryName(httpCachePath); 87if (!path.StartsWith(homePath + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 92string? parent = Path.GetDirectoryName(path); 96parent = Path.GetDirectoryName(parent); 107return Path.Combine(home, ".config", "NuGet"); 111return Path.Combine(xdgConfigHome, "NuGet"); 118return Path.Combine(home, ".nuget", "NuGet");
Migrations\MigrationRunner.cs (4)
31var expectedMigrationFilename = Path.Combine(migrationsDirectory, MaxMigrationFilename); 92return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NuGet", "Migrations"); 98? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "NuGet", "Migrations") 99: Path.Combine(XdgDataHome, "NuGet", "Migrations");
PathUtil\FileUtility.cs (4)
26return Path.GetFullPath(Path.Combine(directory, fileName)); 95string? destFileDirectory = Path.GetDirectoryName(destFilePath); 133string? destFileDirectory = Path.GetDirectoryName(destFilePath);
PathUtil\NuGetEnvironment.cs (18)
64var tempPath = Path.GetTempPath(); 68nuGetScratch = Path.Combine(tempPath, 113return Path.Combine(machineWideBaseDir, 117return Path.Combine( 122return Path.Combine( 127return Path.Combine( 134return Path.Combine( 141return Path.Combine( 150return Path.Combine( 157return Path.Combine( 171return Path.Combine(programFilesPath, "MSBuild", "14.0", "Bin", "MSBuild.exe"); 238return Path.Combine(_getHome.Value, ".nuget"); 254return Path.Combine(_getHome.Value, ".local", "share"); 361foreach (var dir in path.Split(Path.PathSeparator)) 363var fullPath = Path.Combine(dir, executable); 375var fullPath = Path.Combine(programFiles, DotNet, DotNetExe); 385var fullPath = Path.Combine(programFiles, DotNet, DotNetExe); 397var fullPath = Path.Combine(localBin, DotNet);
PathUtil\PathResolver.cs (15)
70return Path.Combine(basePath, wildcard); 77if (Path.DirectorySeparatorChar == '/') 125searchPath = searchPath + "**" + Path.DirectorySeparatorChar + "*"; 133Regex searchRegex = WildcardToRegex(Path.Combine(basePath, searchPath)); 141bool isWildcardPath = Path.GetDirectoryName(searchPath)?.Contains('*') ?? false; 181string? searchRoot = Path.GetDirectoryName(searchPath); 186basePathToEnumerate = Path.Combine(basePath, searchRoot); 191int directorySeparatoryIndex = searchPath.LastIndexOf(Path.DirectorySeparatorChar, wildcardIndex); 201basePathToEnumerate = Path.Combine(basePath, nonWildcardPortion); 210string parentDirectoryPath = $"..{Path.DirectorySeparatorChar}"; 211string currentDirectoryPath = $".{Path.DirectorySeparatorChar}"; 220basePath = Path.Combine(basePath, parentDirectoryPath); 224return Path.GetFullPath(basePath); 238(path[path.Length - 1] == Path.DirectorySeparatorChar || 239path[path.Length - 1] == Path.AltDirectorySeparatorChar);
PathUtil\PathUtility.cs (31)
99return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar); 140dir = Path.GetFullPath(dir); 142candidate = Path.GetFullPath(candidate); 163return (ch == Path.DirectorySeparatorChar || 164ch == Path.AltDirectorySeparatorChar); 168return ch == Path.DirectorySeparatorChar; 174string? directory = Path.GetDirectoryName(filePath); 190return GetRelativePath(path1, path2, Path.DirectorySeparatorChar); 213if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare)) 225var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 226var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 298path = path.TrimEnd(Path.DirectorySeparatorChar); 299string? fullDirectoryPath = Path.GetDirectoryName(path); 304return path.Substring(fullDirectoryPath.Length).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 314if (Path.DirectorySeparatorChar == '/') 334return Uri.UnescapeDataString(path.Replace('/', Path.DirectorySeparatorChar)); 378var folder = path.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? string.Empty; 380folder = Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar; 382var root = Path.GetPathRoot(path); 417basePath = basePath.TrimEnd(Path.DirectorySeparatorChar); 423return path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 428return path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 485string? parentDirectory = Path.GetFullPath(path); 494parentDirectory = Path.GetDirectoryName(parentDirectory);
PathUtil\PathValidator.cs (5)
49Path.GetFullPath(path); 51return Path.IsPathRooted(path) && !path.StartsWith(@"\\", StringComparison.Ordinal); 74_ = Path.GetFullPath(path); 99_ = Path.GetFullPath(path); 101return !Regex.IsMatch(path, @"^\w+://", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && !Path.IsPathRooted(path);
PathUtil\ProjectJsonPathUtilities.cs (7)
39var configPath = Path.Combine(directoryPath, GetProjectConfigWithProjectName(projectName)); 44configPath = Path.Combine(directoryPath, ProjectConfigFileName); 86var dir = Path.GetDirectoryName(configFilePath); 96lockFilePath = Path.Combine(dir, ProjectLockFileName); 101lockFilePath = Path.Combine(dir, lockFileWithProject); 118var file = Path.GetFileName(configPath); 147file = Path.GetFileName(configPath);
RuntimeEnvironmentHelper.cs (1)
24var currentProcessName = Path.GetFileNameWithoutExtension(GetCurrentProcessFilePath());
UriUtility.cs (7)
41if (Path.DirectorySeparatorChar == '/' && !string.IsNullOrEmpty(source) && source[0] == '/') 99return GetAbsolutePath(Path.GetDirectoryName(sourceFile!), path)!; 129return Path.IsPathFullyQualified(rootDirectory) 130? Path.GetFullPath(local, rootDirectory) 131: Path.GetFullPath(Path.Combine(rootDirectory, local)); 141return Path.GetFullPath(local);
NuGet.Configuration (52)
Settings\ConfigurationDefaults.cs (1)
38if (File.Exists(Path.Combine(directory, configFile)))
Settings\Items\FileClientCertItem.cs (2)
38return new SettingsFile(Path.GetDirectoryName(settingsFilePath)!, Path.GetFileName(settingsFilePath), isMachineWide: false, isReadOnly: false);
Settings\Settings.cs (25)
471.OrderByDescending(file => file.FullName.Count(c => c == Path.DirectorySeparatorChar)) 556var defaultSettingsFilePath = Path.Combine(userSettingsDir, DefaultSettingsFileName); 588Path.Combine(rootDirectory, configFileName)); 602? Path.Combine(rootDirectory, "TestingGlobalPath") 608return Path.Combine(userSettingsDirectory, ConfigurationConstants.Config); 635var combinedPath = Path.Combine(paths); 654var index = combinedPath.LastIndexOf(Path.DirectorySeparatorChar); 685if (Path.IsPathRooted(settingsPath)) 687fileName = Path.GetFileName(settingsPath); 688directory = Path.GetDirectoryName(settingsPath)!; 692var fullPath = Path.Combine(root ?? string.Empty, settingsPath); 693fileName = Path.GetFileName(fullPath); 694directory = Path.GetDirectoryName(fullPath)!; 748var rawPath = Path.Combine(originDirectoryPath, ResolvePath(Path.GetDirectoryName(originFilePath)!, path)); 766root = Path.GetPathRoot(value)!; 780&& (root[0] == Path.DirectorySeparatorChar || value[0] == Path.AltDirectorySeparatorChar)) 782return Path.Combine(Path.GetPathRoot(configDirectory)!, value.Substring(1)); 784return Path.Combine(configDirectory, value); 793if (!Path.IsPathRooted(settingsPath) && !string.IsNullOrWhiteSpace(settingsRoot)) 795settingsPath = Path.Combine(settingsRoot, settingsPath); 844var file = Path.Combine(directory, nugetConfigCasing); 860current = Path.GetDirectoryName(current);
Settings\SettingsFile.cs (2)
108ConfigFilePath = Path.GetFullPath(Path.Combine(DirectoryPath, FileName));
Settings\SettingsLoadingContext.cs (1)
60if (!Path.IsPathRooted(filePath))
Utility\FileSystemUtility.cs (6)
33Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!); 57return String.Equals(path, Path.GetFileName(path), StringComparison.OrdinalIgnoreCase); 62return File.Exists(Path.Combine(root, file)); 67path = EnsureTrailingSlash(Path.Combine(root, path)); 99return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar); 104return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar);
Utility\SettingsUtility.cs (15)
19public static readonly string DefaultGlobalPackagesFolderPath = "packages" + Path.DirectorySeparatorChar; 73path = path!.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 268path = path!.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 269path = Path.GetFullPath(path); 273path = Path.Combine(NuGetEnvironment.GetFolderPath(NuGetFolderPath.NuGetHome), DefaultGlobalPackagesFolderPath); 315paths[i] = paths[i].Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 316paths[i] = Path.GetFullPath(paths[i]); 358path = path!.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 359path = Path.GetFullPath(path); 381path = Path.GetFullPath(path); 451if (!Path.IsPathRooted(path))
NuGet.Credentials (3)
PluginCredentialProvider.cs (1)
60var filename = System.IO.Path.GetFileName(path);
PluginCredentialProviderBuilder.cs (2)
79.GroupBy(Path.GetDirectoryName) 80.SelectMany(g => g.OrderBy(Path.GetFileName, StringComparer.OrdinalIgnoreCase))
NuGet.PackageManagement (88)
BuildIntegration\DependencyGraphRestoreUtility.cs (2)
277var projFileName = Path.GetFileName(packageSpec.RestoreMetadata.ProjectPath); 289var persistedDGSpecPath = Path.Combine(outputPath, dgFileName);
NuGetPackageManager.cs (3)
3582readmeFilePath = Path.Combine(packageFolderPath, Constants.ReadmeFileName); 3591readmeFilePath = Path.Combine(Path.GetDirectoryName(packagePath), Constants.ReadmeFileName);
Projects\FolderNuGetProject.cs (11)
155nuGetProjectContext.Log(MessageLevel.Info, Strings.AddingPackageToFolder, packageIdentity, Path.GetFullPath(Root)); 215nuGetProjectContext.Log(MessageLevel.Info, Strings.AddedPackageToFolder, packageIdentity, Path.GetFullPath(Root)); 221nuGetProjectContext.Log(MessageLevel.Debug, Strings.AddedPackageToFolderFromSource, packageIdentity, Path.GetFullPath(Root), downloadResourceResult.PackageSource); 432var installPath = Path.GetFullPath(Path.Combine(packageDirectory, packageName)); 488var installPath = Path.GetFullPath(Path.Combine(packageDirectory, manifestName)); 517var filePath = Path.GetFullPath(Path.Combine(packageDirectory, fileName)); 546return Path.GetDirectoryName(installFilePath); 583var packageDirectoryPath = Path.GetDirectoryName(packageFilePath);
Projects\MSBuildNuGetProject.cs (14)
320var referenceItemFullPath = Path.Combine(packageInstallPath, referenceItem); 321var referenceName = Path.GetFileName(referenceItem); 362var fullImportFilePath = Path.Combine(packageInstallPath, buildImportFile); 372ProjectSystem.AddExistingFile(Path.GetFileName(PackagesConfigNuGetProject.FullPath)); 402p => p.EndsWith(Path.DirectorySeparatorChar + PowerShellScripts.Install, StringComparison.OrdinalIgnoreCase)); 475p => p.EndsWith(Path.DirectorySeparatorChar + PowerShellScripts.Uninstall, 522ProjectSystem.RemoveFile(Path.GetFileName(PackagesConfigNuGetProject.FullPath)); 526ProjectSystem.AddExistingFile(Path.GetFileName(PackagesConfigNuGetProject.FullPath)); 537await ProjectSystem.RemoveReferenceAsync(Path.GetFileName(item)); 565var fullImportFilePath = Path.Combine(FolderNuGetProject.GetInstalledPath(packageIdentity), buildImportFile); 610if (!filePath.StartsWith(PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) 611&& !filePath.StartsWith(PackagingConstants.Folders.Lib + Path.AltDirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) 616var fileName = Path.GetFileName(filePath); 626Constants.AssemblyReferencesExtensions.Contains(Path.GetExtension(filePath), StringComparer.OrdinalIgnoreCase);
Projects\PackagesConfigNuGetProject.cs (6)
76PackagesConfigPath = Path.Combine(folderPath, "packages.config"); 79PackagesProjectNameConfigPath = Path.Combine(folderPath, "packages." + projectName + ".config"); 125nuGetProjectContext.Log(MessageLevel.Warning, Strings.PackageAlreadyExistsInPackagesConfig, packageIdentity, Path.GetFileName(FullPath)); 181nuGetProjectContext.Log(MessageLevel.Info, Strings.AddedPackageToPackagesConfig, packageIdentity, Path.GetFileName(FullPath)); 202nuGetProjectContext.Log(MessageLevel.Warning, Strings.PackageDoesNotExisttInPackagesConfig, packageIdentity, Path.GetFileName(FullPath)); 235nuGetProjectContext.Log(MessageLevel.Info, Strings.RemovedPackageFromPackagesConfig, packageIdentity, Path.GetFileName(FullPath));
Projects\PowerShellScripts.cs (1)
16public static readonly string InitPS1RelativePath = PackagingConstants.Folders.Tools + Path.AltDirectorySeparatorChar + Init;
Projects\ProjectJsonNuGetProject.cs (1)
61_projectName = Path.GetFileNameWithoutExtension(msBuildProjectPath);
Utility\FileSystemUtility.cs (28)
46return Path.Combine(root, path); 72|| string.IsNullOrEmpty(Path.GetFileName(path))) 77Directory.CreateDirectory(GetFullPath(root, Path.GetDirectoryName(path))); 96var folderPath = Path.GetDirectoryName(path); 100nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_AddedFileToFolder, Path.GetFileName(path), folderPath); 104nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_AddedFile, Path.GetFileName(path)); 127if (string.IsNullOrEmpty(Path.GetFileName(fullPath))) 142if (string.IsNullOrEmpty(Path.GetFileName(fullPath))) 148Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); 155|| string.IsNullOrEmpty(Path.GetFileName(fullPath))) 170path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path)); 188trimmedPaths.Add(filePath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar)); 192trimmedPaths.Add(filePath.TrimStart(Path.DirectorySeparatorChar)); 224var folderPath = Path.GetDirectoryName(fullPath); 230Path.GetFileName(fullPath), 231Path.GetFullPath(folderPath)); 235nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_RemovedFile, Path.GetFileName(fullPath)); 273var directoryLookup = filesToDelete.ToLookup(p => Path.GetDirectoryName(p)); 285var dirPath = Path.Combine(packagesDir, directory); 294var path = Path.Combine(packagesDir, file); 303DeleteDirectorySafe(Path.Combine(packagesDir, dirPath), recursive: false, nuGetProjectContext: nuGetProjectContext); 398for (var path = Path.GetDirectoryName(filePath); !string.IsNullOrEmpty(path); path = Path.GetDirectoryName(path)) 466foreach (var index in IndexOfAll(path, altDirectorySeparator ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar)) 491return fullPath.TrimStart(Path.DirectorySeparatorChar); 493return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar); 498return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar);
Utility\MSBuildNuGetProjectSystemUtility.cs (11)
27if (File.Exists(Path.Combine(msBuildNuGetProjectSystem.ProjectFullPath, path))) 31return Shared.XmlUtility.Load(Path.Combine(msBuildNuGetProjectSystem.ProjectFullPath, path), LoadOptions.PreserveWhitespace); 225p => Path.GetDirectoryName(ResolveTargetPath(projectSystem, 246if (!Directory.Exists(Path.Combine(projectFullPath, directory))) 394var fullPath = Path.Combine(projectSystem.ProjectFullPath, path); 434var fullPath = Path.Combine(projectSystem.ProjectFullPath, path); 514PackagingCoreConstants.EmptyFolder.Equals(Path.GetFileName(packageFilePath), StringComparison.OrdinalIgnoreCase); 570var fileName = Path.GetFileName(truncatedPath); 587if (effectivePathForContentFile.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) 589effectivePathForContentFile = effectivePathForContentFile.Substring((PackagingConstants.Folders.Content + Path.DirectorySeparatorChar).Length); 593var frameworkFolderEndIndex = effectivePathForContentFile.IndexOf(Path.DirectorySeparatorChar);
Utility\PackagesConfigContentHashProvider.cs (4)
49var metadataPath = Path.Combine(Path.GetDirectoryName(nupkgPath), PackagingCoreConstants.NupkgMetadataFileExtension); 61return Path.Combine(Path.GetDirectoryName(nupkgPath), PackagingCoreConstants.NupkgMetadataFileExtension);
Utility\PackagesConfigLockFileUtility.cs (2)
78return Path.Combine(projectPath, nuGetLockFilePath); 95var lockFilePath = GetPackagesLockFilePath(Path.GetDirectoryName(packagesConfigFile), nuGetLockFilePath, projectName);
Utility\PackagesFolderPathUtility.cs (3)
51return Uri.UnescapeDataString(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 53return Path.Combine(solutionDirectory, string.IsNullOrEmpty(path) ? DefaultRepositoryPath : path);
Utility\XmlUtility.cs (2)
15if (File.Exists(Path.Combine(root, path))) 19return Shared.XmlUtility.Load(Path.Combine(root, path), LoadOptions.PreserveWhitespace);
NuGet.Packaging (137)
Core\FrameworkNameValidatorUtility.cs (2)
11return IsValidFrameworkName(PackagingConstants.Folders.Build + Path.DirectorySeparatorChar 12+ framework.GetShortFolderName() + Path.DirectorySeparatorChar);
PackageArchiveReader.cs (5)
160path = path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 308var normalizedPath = Uri.UnescapeDataString(packageFileName.Replace('/', Path.DirectorySeparatorChar)); 313var targetFilePath = Path.Combine(destination, normalizedPath); 347var packageFileFullPath = Path.Combine(packageDirectory, packageFile);
PackageCreation\Authoring\EmptyFrameworkFolderFile.cs (1)
25TargetPath = System.IO.Path.Combine(directoryPathInPackage, PackagingConstants.PackageEmptyFileName);
PackageCreation\Authoring\PackageBuilder.cs (22)
50: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic) 55: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic, logger, versionOverride: "") 60: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic, logger, versionOverride) 429(f.Path.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) || 430f.Path.StartsWith(PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))); 440f.Path.StartsWith(PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) && 450file.Path.StartsWith(PackagingConstants.Folders.ContentFiles + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)); 464file.Path.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) && 506select Path.GetFileName(file.Path), StringComparer.OrdinalIgnoreCase); 599var ext = Path.GetExtension(licenseMetadata.License); 635var ext = Path.GetExtension(iconPath); 761var extension = Path.GetExtension(readmePath); 955var fileExtension = Path.GetExtension(file.Path); 990exclude = exclude?.Replace('\\', Path.DirectorySeparatorChar); 992List<PhysicalPackageFile> searchFiles = ResolveSearchPattern(basePath, source.Replace('\\', Path.DirectorySeparatorChar), destination, _includeEmptyDirectories).ToList(); 997searchFiles.RemoveAll(file => Path.GetFileName(file.TargetPath) == PackagingConstants.PackageEmptyFileName 1050packagePath = fullPath.Substring(searchDirectory.Length).TrimStart(Path.DirectorySeparatorChar); 1052else if (!isWildcardSearch && Path.GetExtension(searchPattern).Equals(Path.GetExtension(targetPath), StringComparison.OrdinalIgnoreCase)) 1060packagePath = Path.GetFileName(fullPath); 1062return Path.Combine(targetPath ?? string.Empty, packagePath); 1126var segments = path.Split(new[] { '/', '\\', Path.DirectorySeparatorChar }, StringSplitOptions.None)
PackageCreation\Utility\FrameworkNameUtility.cs (6)
19string folderPrefix = knownFolder + System.IO.Path.DirectorySeparatorChar; 64string targetFrameworkString = Path.GetDirectoryName(path)!.Split(Path.DirectorySeparatorChar).First(); 89string folderPrefix = knownFolder + System.IO.Path.DirectorySeparatorChar; 134string targetFrameworkString = Path.GetDirectoryName(path)!.Split(Path.DirectorySeparatorChar).First();
PackageExtraction\PackageHelper.cs (2)
55|| string.IsNullOrEmpty(Path.GetFileName(packageFileName))) 151runtimePackageDirectory = Path.GetDirectoryName(runtimePackageFilePath);
PackageExtraction\PackagePathHelper.cs (4)
22path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path)); 49path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path)); 94var name = Path.GetFileNameWithoutExtension(path); 130var manifestFileName = Path.ChangeExtension(packageFileName, PackagingCoreConstants.NuspecExtension);
PackageExtraction\StreamExtensions.cs (2)
75if (Path.GetFileName(fileFullPath).Length == 0) 81var directory = Path.GetDirectoryName(fileFullPath);
PackageExtractor.cs (27)
96var targetNuspecPath = Path.Combine( 125var nupkgFilePath = Path.Combine( 222var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentityFromNuspec)); 331var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentityFromNuspec)); 448var targetTempNupkg = Path.Combine(targetPath, Path.GetRandomFileName()); 449var tempHashPath = Path.Combine(targetPath, Path.GetRandomFileName()); 450var tempNupkgMetadataPath = Path.Combine(targetPath, Path.GetRandomFileName()); 494var hashFileName = Path.GetFileName(hashPath); 495var nupkgMetadataFileName = Path.GetFileName(nupkgMetadataFilePath); 724var targetTempNupkg = Path.Combine(targetPath, Path.GetRandomFileName()); 725var tempHashPath = Path.Combine(targetPath, Path.GetRandomFileName()); 726var tempNupkgMetadataFilePath = Path.Combine(targetPath, Path.GetRandomFileName()); 778var packageDirectoryPath = Path.GetDirectoryName(targetNuspec)!; 794var nuspecFileName = Path.GetFileName(targetNuspec); 795var actualNuspecFileName = Path.GetFileName(extractedNuspecFilePath); 799var tempNuspecFilePath = Path.Combine(packageDirectoryPath, Path.GetRandomFileName()); 814var hashFileName = Path.GetFileName(hashPath); 815var nupkgMetadataFileName = Path.GetFileName(nupkgMetadataFilePath); 904var fileName = Path.GetFileName(fullName); 917var extension = Path.GetExtension(fullName);
PackageFileExtractor.cs (7)
46var dllFile = Path.ChangeExtension(file, ".dll"); 54var resourceDll = Path.ChangeExtension(file, ".resources.dll"); 87return Path.ChangeExtension(fileAtParentDirectory, ".dll"); 101var extractDirectory = Path.GetDirectoryName(target)!; 108var targetZip = Path.ChangeExtension(target, ".xml.zip"); 112var entry = zipArchive.CreateEntry(Path.GetFileName(source)); 122if (Path.IsPathRooted(source))
PackageFolderReader.cs (4)
96var file = new FileInfo(Path.Combine(_root.FullName, path)); 123searchFolder = new DirectoryInfo(Path.Combine(_root.FullName, folder)); 210var targetPath = Path.Combine(destination, packageFile); 211Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!);
PackagePathResolver.cs (3)
36if (!Path.IsPathRooted(rootDirectory)) 85return Path.Combine(_rootDirectory, GetPackageDirectoryName(packageIdentity)); 92return string.IsNullOrEmpty(installedPackageFilePath) ? null : Path.GetDirectoryName(installedPackageFilePath);
PackageReaderBase.cs (9)
295var file = Path.GetFileName(path); 496var file = Path.GetFileName(path); 509var extension = Path.GetExtension(path); 556var fullPath = Path.GetFullPath(Path.Combine(normalizedDestination, normalizedFilePath)); 570if (!path.EndsWith(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal)) 572path += Path.DirectorySeparatorChar; 575return Path.GetFullPath(path); 583var normalizedPath = Uri.UnescapeDataString(p.Replace('/', Path.DirectorySeparatorChar));
PackageReaderExtensions.cs (2)
39Path.GetDirectoryName(item)! 40.Split(Path.DirectorySeparatorChar)
PackagesConfigWriter.cs (3)
524var directorypath = Path.GetDirectoryName(fullPath)!; 526var configFileCopyPath = Path.Combine(directorypath, 554var configFileNewPath = Path.Combine(directorypath,
Rules\ContentFolderInPackageReferenceProjectRule.cs (2)
27(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))) 33(PackagingConstants.Folders.ContentFiles + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)))
Rules\DependenciesGroupsForEachTFMRule.cs (1)
30Where(t => PathUtility.GetPathWithDirectorySeparator(t).Count(m => m == Path.DirectorySeparatorChar) > 1);
Rules\InitScriptNotUnderToolsRule.cs (3)
24var name = Path.GetFileName(file); 25var dirName = Path.GetFileName(Path.GetDirectoryName(file))!;
Rules\InstallScriptInPackageReferenceProjectRule.cs (1)
24t.StartsWith(PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar,
Rules\InvalidFrameworkFolderRule.cs (1)
29var parts = file.Split(Path.DirectorySeparatorChar);
Rules\InvalidPlaceholderFileRule.cs (3)
26if (Path.GetFileName(file).Equals(PackagingCoreConstants.EmptyFolder, StringComparison.Ordinal)) 28var directory = PathUtility.EnsureTrailingSlash(Path.GetDirectoryName(file)!); 29if (builder.GetFiles().Count(f => PathUtility.EnsureTrailingSlash(Path.GetDirectoryName(f)!).StartsWith(directory, StringComparison.OrdinalIgnoreCase)) > 1)
Rules\MisplaceAssemblyOutsideLibRule.cs (9)
64PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, 65PackagingConstants.Folders.Analyzers + Path.DirectorySeparatorChar, 66PackagingConstants.Folders.Ref + Path.DirectorySeparatorChar, 67PackagingConstants.Folders.Runtimes + Path.DirectorySeparatorChar, 68PackagingConstants.Folders.Native + Path.DirectorySeparatorChar, 69PackagingConstants.Folders.Build + Path.DirectorySeparatorChar, 70PackagingConstants.Folders.BuildCrossTargeting + Path.DirectorySeparatorChar, 71PackagingConstants.Folders.BuildTransitive + Path.DirectorySeparatorChar, 72PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar,
Rules\MisplacedAssemblyUnderLibRule.cs (1)
25var directory = Path.GetDirectoryName(file)!;
Rules\MisplacedScriptFileRule.cs (1)
34if (!file.StartsWith(ToolsDirectory + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
Rules\MisplacedTransformFileRule.cs (2)
39if (!file.StartsWith(ContentDirectory + Path.DirectorySeparatorChar, 41&& !file.StartsWith(ContentFilesDirectory + Path.DirectorySeparatorChar,
Rules\PathTooLongRule.cs (1)
26if (Path.Combine(installedPath, file).Length > _pathLenghtWarningThreshold)
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (1)
57.GroupBy(t => NuGetFramework.ParseFolder(t.Split('/')[1]).GetShortFolderName(), t => Path.GetFileName(t));
Rules\UnrecognizedScriptFileRule.cs (1)
34var name = Path.GetFileNameWithoutExtension(file);
Rules\UpholdBuildConventionRule.cs (1)
72foreach (var extension in tfm.GroupBy(Path.GetExtension))
Signing\Authoring\SigningOptions.cs (1)
177return Path.GetFullPath(filePath).TrimEnd('\\');
Signing\TrustStore\FallbackCertificateBundleX509ChainFactory.cs (1)
45string fullFilePath = Path.Combine(
Signing\Utility\SigningUtility.cs (1)
181var tempPackageFile = new FileInfo(Path.GetTempFileName());
VersionFolderPathResolver.cs (7)
53return Path.Combine( 65return Path.Combine( 78return Path.Combine( 92return Path.Combine( 105return Path.Combine( 129return Path.Combine( 152return Path.Combine(
NuGet.ProjectModel (13)
ExternalProjectReference.cs (1)
122?? Path.GetFileNameWithoutExtension(MSBuildProjectPath)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (2)
118string filePath = name == null ? null : Path.GetFullPath(packageSpecPath); 165packageSpec.FilePath = name == null ? null : Path.GetFullPath(packageSpecPath);
PackageSpec.cs (1)
46public string BaseDirectory => Path.GetDirectoryName(FilePath);
ProjectLockFile\PackagesLockFileUtilities.cs (4)
43return Path.Combine(project.BaseDirectory, path); 46var projectName = Path.GetFileNameWithoutExtension(project.RestoreMetadata.ProjectPath); 54var path = Path.Combine(baseDirectory, "packages." + projectName.Replace(' ', '_') + ".lock.json"); 62return Path.Combine(baseDirectory, PackagesLockFileFormat.LockFileName);
ToolPathResolver.cs (5)
34return Path.Combine(toolDirectory, LockFileFormat.AssetsFileName); 62return Path.Combine( 74return Path.Combine( 103var toolBasePath = Path.Combine(GetPackagesToolsBasePath(), _isLowercase ? packageId.ToLowerInvariant() : packageId); 113var version = Path.GetFileName(versionDirectory);
NuGet.Protocol (58)
HttpSource\HttpCacheUtility.cs (8)
30var cacheFolder = Path.Combine(httpCacheDirectory, baseFolderName); 31var cacheFile = Path.Combine(cacheFolder, baseFileName); 41var temporaryFile = Path.Combine(context.RootTempFolder!, Path.GetRandomFileName()); 42var newTemporaryFile = Path.Combine(context.RootTempFolder!, Path.GetRandomFileName()); 59var newCacheFileDirectory = Path.GetDirectoryName(result.NewFile)!; 60var cacheFileDirectory = Path.GetDirectoryName(result.CacheFile)!;
LocalRepositories\FindLocalPackagesResourceUnzipped.cs (4)
112validSet.IntersectWith(files.Select(file => Path.GetFileNameWithoutExtension(file.Name))); 119var nupkgPath = Path.Combine(rootDirInfo.FullName, $"{name}{PackagingCoreConstants.NupkgExtension}"); 138var nuspecPath = Path.Combine(root.FullName, name, $"{name}{PackagingCoreConstants.NuspecExtension}"); 147var nupkgPath = Path.Combine(root.FullName, $"{name}{PackagingCoreConstants.NupkgExtension}");
LocalRepositories\LocalPackageInfo.cs (3)
53var directoryName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Path)!, System.IO.Path.GetFileNameWithoutExtension(Path));
PackagesFolder\LocalPackageFileCache.cs (1)
231var runtimeGraphFile = Path.Combine(expandedPath, RuntimeGraph.RuntimeGraphFileName);
PackagesFolder\NuGetv3LocalRepository.cs (1)
184var versionPart = fullVersionDir.Substring(packageIdRoot.Length).TrimStart(Path.DirectorySeparatorChar);
Plugins\Logging\PluginLogger.cs (2)
134var fileName = $"NuGet_PluginLogFor_{Path.GetFileNameWithoutExtension(file.Name)}_{DateTime.UtcNow.Ticks:x}_{processId}.log"; 135var filePath = Path.Combine(logDirectoryPath, fileName);
Plugins\Plugin.cs (1)
113Name = Path.GetFileNameWithoutExtension(filePath);
Plugins\PluginCacheEntry.cs (2)
25RootFolder = Path.Combine(rootCacheFolder, CachingUtility.RemoveInvalidFileNameChars(CachingUtility.ComputeHash(pluginFilePath, addIdentifiableCharacters: false))); 26CacheFileName = Path.Combine(RootFolder, CachingUtility.RemoveInvalidFileNameChars(CachingUtility.ComputeHash(requestKey, addIdentifiableCharacters: false)) + ".dat");
Plugins\PluginDiscoverer.cs (3)
97var filePaths = _netCoreOrNetFXPluginPaths!.Split(new[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries); 191string[] paths = _nuGetPluginPaths?.Split([Path.PathSeparator], StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>(); 240string[] paths = nugetPluginPaths?.Split(Path.PathSeparator) ?? Array.Empty<string>();
Plugins\PluginDiscoveryUtility.cs (5)
57Path.Combine( 58Path.GetDirectoryName(nugetAssemblyPath)!, 68return Path.Combine(nuGetHome, 91var expectedPluginName = Path.Combine(pluginDirectory, Path.GetFileName(pluginDirectory) + ".dll");
Plugins\PluginPackageReader.cs (5)
853var file = Path.GetFileName(path); 1106var directory = Path.GetDirectoryName(nupkgFilePath)!; 1109var filePath = Path.Combine(directory, fileName); 1116var tempDirectoryPath = Path.Combine(NuGetEnvironment.GetFolderPath(NuGetFolderPath.Temp), Path.GetRandomFileName());
Resources\PackageUpdateResource.cs (9)
236Path.GetFileName(symbolPackagePath), 327Path.GetFileName(symbolPackagePath), 367Path.GetFileName(packageToPush), 414var symbolPath = Path.GetFileNameWithoutExtension(packagePath) + (isSnupkg ? NuGetConstants.SnupkgExtension : NuGetConstants.SymbolsExtension); 415var packageDir = Path.GetDirectoryName(packagePath)!; 416return Path.Combine(packageDir, symbolPath); 696var fullPath = Path.Combine(root, packageFileName); 806var nupkgFilePath = Path.Combine(root, packageFileName); 894var idDirectoryName = Path.GetFileName(idDirectory);
SourceCacheContext.cs (1)
102var newTempFolder = Path.Combine(
Utility\CachingUtility.cs (1)
89var invalid = Path.GetInvalidFileNameChars();
Utility\FindPackagesByIdNupkgDownloader.cs (1)
120string tempFilePath = Path.GetTempFileName();
Utility\GetDownloadResultUtility.cs (2)
186var randomComponent = Path.GetRandomFileName(); 188var directDownloadPath = Path.Combine(downloadContext.DirectDownloadDirectory!, fileName);
Utility\LocalFolderUtility.cs (6)
371var expectedPath = Path.Combine(rootDirInfo.FullName, idVersion, $"{idVersion}{PackagingCoreConstants.NupkgExtension}"); 473var nupkgPath = Path.Combine( 576fileName = Path.GetFileNameWithoutExtension(fileName); 1083packagePath = packagePath + Path.DirectorySeparatorChar + '*'; 1291var tempNupkgMetadataFilePath = Path.Combine(installPath, Path.GetRandomFileName());
Utility\OfflineFeedUtility.cs (3)
73return Path.GetDirectoryName( 87var invalidPathChars = Path.GetInvalidPathChars(); 101path = Path.GetFullPath(path);
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");
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\wpf\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\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
135string extensionWithDot = Path.GetExtension(docString);
src\wpf\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));
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(
RepoTasks (42)
BatchHelixWorkItems.cs (8)
51var batchRoot = Path.Combine(OutputDirectory, "batched"); 78File.WriteAllText(Path.Combine(payloadDirectory, "targets.txt"), testAssembly); 102var batchDirectory = Path.Combine(batchRoot, $"batch_{batchNumber}"); 117var destPath = Path.Combine(batchDirectory, Path.GetFileName(file)); 130var assemblyName = Path.GetFileNameWithoutExtension(testAssembly); 131var targetDirectory = Path.Combine(batchDirectory, assemblyName); 147File.WriteAllLines(Path.Combine(batchDirectory, "targets.txt"), targets);
FileUtilities.cs (1)
32if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
GenerateTestDevCert.cs (1)
46var devCertJsonFile = Path.ChangeExtension(CertificatePath, ".json");
src\aspnetcore\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\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 203var certificatePath = Path.GetTempFileName(); 338var certificatePath = Path.GetTempFileName(); 367Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 813return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 845var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 848var nssDb = Path.GetFullPath(path); 1050var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
ResultsOfTGenerator (2)
Program.cs (2)
17var classTargetFilePath = Path.Combine(pwd, "..", "..", "src", "ResultsOfT.Generated.cs"); 18var testsTargetFilePath = Path.Combine(pwd, "..", "..", "test", "ResultsOfTTests.Generated.cs");
Roslyn.Diagnostics.Analyzers (29)
src\roslyn\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\roslyn\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\roslyn\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\roslyn\src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
101_poolName = Path.GetFileName(filePath) + ":" + lineNumber; 117_poolName = Path.GetFileName(filePath) + ":" + lineNumber;
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
174? $" (allocated at {Path.GetFileName(group.Key.FilePath)}:{group.Key.LineNumber})"
src\roslyn\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\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
rzc (53)
CompilerHost.cs (2)
31Loader = new DefaultExtensionAssemblyLoader(Path.Combine(Path.GetTempPath(), "Razor-Server"));
DefaultExtensionAssemblyLoader.cs (3)
47if (!Path.IsPathRooted(filePath)) 52var assemblyName = Path.GetFileNameWithoutExtension(filePath); 112if (!Path.IsPathRooted(filePath))
DefaultExtensionDependencyChecker.cs (1)
67if (!Path.IsPathRooted(item.FilePath))
DiscoverCommand.cs (7)
93if (!Path.IsPathRooted(filePath)) 131if (!string.Equals(expectedOriginalPath, Path.GetFileNameWithoutExtension(extensionFilePath), StringComparison.OrdinalIgnoreCase)) 137currentDirectory ??= Path.GetDirectoryName(typeof(Application).Assembly.Location); 138extensionFilePaths.Values[i] = Path.Combine(currentDirectory, RazorCompilerFileName); 174outputFilePath = Path.Combine(projectDirectory, outputFilePath); 204outputFilePath = Path.Combine(projectDirectory, outputFilePath); 212var syntheticPath = Path.Combine(projectDirectory, "__rzc_discover__.cshtml");
GenerateCommand.cs (3)
173if (!Path.IsPathRooted(filePath)) 191tagHelperManifest = Path.Combine(projectDirectory, tagHelperManifest); 503.Replace(Path.DirectorySeparatorChar, '/')
MetadataCache.cs (1)
56Debug.Assert(Path.IsPathRooted(fullPath));
PipeName.cs (1)
47baseDirectory = baseDirectory.TrimEnd(Path.DirectorySeparatorChar);
Program.cs (2)
65var roslynPath = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "Roslyn", "bincore"); 71var loadedAssembly = context.LoadFromAssemblyPath(Path.Combine(roslynPath, assembly.Name + ".dll"));
ServerCommand.cs (2)
153var path = Path.Combine(directoryPath, fileName); 179path = Path.Combine(homePath, ".dotnet", "pids", "build");
ServerProtocol\ServerConnection.cs (13)
45/// is <paramref name="workingDir"/>. This function must emulate <see cref="Path.GetTempPath"/> as 54return Path.GetTempPath(); 58if (Path.IsPathRooted(tmp)) 64if (Path.IsPathRooted(temp)) 73return Path.Combine(workingDir, tmp); 78return Path.Combine(workingDir, temp); 83if (Path.IsPathRooted(userProfile)) 295if (exeName.Equals(Path.GetFileName(expectedPath), StringComparison.Ordinal)) 301var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); 304var dotnetPath = Path.Combine(path, exeName); 320var expectedCompilerPath = Path.Combine(clientDir, ServerName); 425public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 426public static bool IsUnix => Path.DirectorySeparatorChar == '/';
ServerProtocol\ServerLogger.cs (1)
48loggingFileName = Path.Combine(loggingFileName, $"razorserver.{GetCurrentProcessId()}.log");
ServerProtocol\ServerPaths.cs (1)
26/// The temporary directory a compilation should use instead of <see cref="Path.GetTempPath"/>. The latter
ShadowCopyManager.cs (15)
24BaseDirectory = baseDirectory ?? Path.Combine(Path.GetTempPath(), "Razor", "ShadowCopy"); 27UniqueDirectory = Path.Combine(BaseDirectory, guid); 42var destination = Path.Combine(assemblyDirectory, Path.GetFileName(filePath)); 45var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); 49foreach (var directory in Directory.EnumerateDirectories(Path.GetDirectoryName(filePath))) 51var directoryName = Path.GetFileName(directory); 53var resourcesPath = Path.Combine(directory, resourcesNameWithExtension); 56var resourcesShadowCopyPath = Path.Combine(assemblyDirectory, directoryName, resourcesNameWithExtension); 60resourcesPath = Path.Combine(directory, resourcesNameWithoutExtension, resourcesNameWithExtension); 63var resourcesShadowCopyPath = Path.Combine(assemblyDirectory, directoryName, resourcesNameWithoutExtension, resourcesNameWithExtension); 85var directory = Path.Combine(UniqueDirectory, id.ToString(CultureInfo.InvariantCulture)); 92var directory = Path.GetDirectoryName(shadowCopyPath); 146if (!Mutex.TryOpenExisting(Path.GetFileName(directory).ToLowerInvariant(), out mutex))
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
sdk-tasks (66)
CopyPreservingRelativeSymlinks.cs (6)
54sourcePathSet.Add(Path.GetFullPath(item.ItemSpec)); 93var destDir = Path.GetDirectoryName(destPath); 109var sourceDir = Path.GetDirectoryName(Path.GetFullPath(sourcePath))!; 110var resolvedTarget = Path.GetFullPath(Path.Combine(sourceDir, sourceInfo.LinkTarget));
Crossgen.cs (10)
46string tempDirPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 48TempOutputPath = Path.Combine(tempDirPath, Path.GetFileName(DestinationPath)); 54var files = Directory.GetFiles(Path.GetDirectoryName(TempOutputPath)); 55var destination = Path.GetDirectoryName(DestinationPath); 59File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), overwrite: true); 127platformAssemblyPaths += $"-r {excludeTaskItem.ItemSpec}{Path.DirectorySeparatorChar}*.dll ";
DeduplicateAssembliesWithLinks.cs (6)
146var duplicateDirectory = Path.GetDirectoryName(duplicateFilePath)!; 147var relativePath = Path.GetRelativePath(duplicateDirectory, primaryFilePath); 154var relativePath = Path.GetRelativePath(rootDirectory, filePath); 155return relativePath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Length - 1; 160var extension = Path.GetExtension(filePath);
ExtractArchiveToDirectory.cs (11)
71bool isZipArchive = Path.GetExtension(SourceArchive).Equals(".zip", StringComparison.OrdinalIgnoreCase); 93string destinationPath = Path.GetFullPath(Path.Combine(DestinationDirectory, entry.FullName)); 97Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)); 99Log.LogMessage(Path.GetDirectoryName(entry.FullName)); 128string destinationPath = Path.GetFullPath(Path.Combine(DestinationDirectory, entryName)); 131Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)); 182string fullDirectoryPath = Path.GetFullPath(directory); 184if (!fullDirectoryPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 186fullDirectoryPath = string.Concat(fullDirectoryPath, Path.DirectorySeparatorChar);
GenerateMSBuildExtensionsSWR.cs (9)
42string sourceFolder = Path.Combine(MSBuildExtensionsLayoutDirectory, relativeSourcePath); 44.Where(f => !Path.GetExtension(f).Equals(".pdb", StringComparison.OrdinalIgnoreCase) && !Path.GetExtension(f).Equals(".swr", StringComparison.OrdinalIgnoreCase)) 46if (files.Any(f => !Path.GetFileName(f).Equals("_._"))) 55sb.Append(Path.Combine(relativeSourcePath, Path.GetFileName(file))); 71string subfolderName = Path.GetFileName(subfolder); 72string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); 73string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
GenerateRuntimeAnalyzersSWR.cs (9)
59string sourceFolder = Path.Combine(RuntimeAnalyzersLayoutDirectory, relativeSourcePath); 66var path = Path.Combine(sourceFolder, file); 78var extension = Path.GetExtension(f); 81!Path.GetFileName(f).Equals("_._"); 92var fileName = Path.GetFileName(file); 95sb.Append(Path.Combine(relativeSourcePath, fileName)); 117string subfolderName = Path.GetFileName(subfolder); 118string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); 119string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
GetRuntimePackRids.cs (1)
20string runtimeJsonPath = Path.Combine(MetapackagePath, "runtime.json");
ProcessRuntimeAnalyzerVersions.cs (1)
61Directory.CreateDirectory(Path.GetDirectoryName(MetadataFilePath)!);
ReplaceFileContents.cs (1)
123var destinationDirectory = Path.GetDirectoryName(destinationFile);
ReplaceFilesWithSymbolicLinks.cs (4)
79string fileName = Path.GetFileName(file); 83string targetFile = Path.Combine(LinkToFilesFrom, fileName); 136string relativePath = Path.GetRelativePath(Path.GetDirectoryName(path)!, pathToTarget);
TarGzFileCreateFromDirectory.cs (5)
71SourceDirectory = Path.GetFullPath(SourceDirectory); 73SourceDirectory = SourceDirectory.EndsWith(Path.DirectorySeparatorChar.ToString()) 75: SourceDirectory + Path.DirectorySeparatorChar; 102var sourceDirectoryName = Path.GetFileName(Path.GetDirectoryName(SourceDirectory));
ZipFileCreateFromDirectory.cs (3)
58if (!Directory.Exists(Path.GetDirectoryName(DestinationArchive))) 59Directory.CreateDirectory(Path.GetDirectoryName(DestinationArchive)); 122if (subdirectory[chop] == Path.DirectorySeparatorChar)
Stress.ApiService (2)
Program.cs (2)
294var xmlLarge = File.ReadAllText(Path.Combine("content", "books.xml")); 301var jsonLarge = File.ReadAllText(Path.Combine("content", "example.json"));
SuperFileCheck (6)
Program.cs (6)
47var superFileCheckDir = Path.GetDirectoryName(superFileCheckPath); 51Directory.EnumerateFiles(Path.Combine(superFileCheckDir, "runtimes/"), "FileCheck*", SearchOption.AllDirectories) 59FileCheckPath = Path.Combine(superFileCheckDir, "FileCheck"); 681var checkFileNameNoExt = Path.GetFileNameWithoutExtension(checkFilePath); 719var tmpDirName = Path.GetDirectoryName(checkFilePath); 727tmpFilePath = Path.Combine(tmpDirName, tmpFileName);
System.CodeDom (5)
src\runtime\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.CommandLine (7)
ArgumentValidation.cs (3)
81var invalidFileNameChars = Path.GetInvalidFileNameChars(); 106var invalidPathChars = Path.GetInvalidPathChars(); 190if (!Path.Exists(token.Value))
Binding\ArgumentConverter.StringConverters.cs (2)
125else if (path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) || 126path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal))
Parsing\StringExtensions.cs (1)
287var potentialRootCommand = Path.GetFileName(args[0]);
RootCommand.cs (1)
128return Path.GetFileNameWithoutExtension(path).Replace(" ", "");
System.CommandLine.StaticCompletions (1)
ShellName.cs (1)
34var shellName = Path.GetFileName(shellPath);
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\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\runtime\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.Data.OleDb (1)
System\Data\Common\AdapterUtil.cs (1)
1028return Path.GetFullPath(filename);
System.Diagnostics.EventLog (6)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (1)
230dllDir = Path.Combine(installRoot, version);
System\Diagnostics\EventLog.cs (5)
699string dllPath = Path.Combine(NetFrameworkUtils.GetLatestBuildDllDirectory(machineName), DllName); 707dllPath = Path.Combine(Path.GetDirectoryName(assmLocation)!, AltDllName); 711dllPath = Path.Combine(AppContext.BaseDirectory, AltDllName); 806return Path.GetFullPath(path);
System.Diagnostics.FileVersionInfo (2)
System\Diagnostics\FileVersionInfo.cs (2)
301if (!Path.IsPathFullyQualified(fileName)) 303fileName = Path.GetFullPath(fileName);
System.Diagnostics.PerformanceCounter (4)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (1)
230dllDir = Path.Combine(installRoot, version);
System\Diagnostics\PerformanceCounterLib.cs (3)
233s_iniFilePath = Path.GetTempFileName(); 274s_symbolFilePath = Path.GetTempFileName(); 428iniWriter.WriteLine(Path.GetFileName(SymbolFilePath));
System.Diagnostics.Process (13)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
138currentCGroupMemoryPath = Path.GetDirectoryName(currentCGroupMemoryPath);
src\runtime\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)
153if (Path.IsPathRooted(filename)) 173workingDirectory = workingDirectory != null ? Path.GetFullPath(workingDirectory) : 175string filenameInWorkingDirectory = Path.Combine(workingDirectory, filename); 299if (Path.IsPathRooted(filename)) 312path = Path.Combine(Path.GetDirectoryName(path)!, filename); 322path = 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.Formats.Tar (68)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\Formats\Tar\TarEntry.cs (38)
334TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 358TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 367Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 372Path.IsPathFullyQualified(name) ? name : Path.Join(destinationDirectoryPath, name)); 387if (OperatingSystem.IsWindows() && Path.IsPathRooted(linkName) && !Path.IsPathFullyQualified(linkName)) 393Path.IsPathFullyQualified(linkName) ? linkName : Path.Join(Path.GetDirectoryName(fileDestinationPath), linkName)); 408Path.Join(destinationDirectoryPath, linkName)); 434string logicalDest = Path.GetFullPath(destinationDirectoryPath); 435string logicalPrefix = logicalDest.EndsWith(Path.DirectorySeparatorChar) 437: logicalDest + Path.DirectorySeparatorChar; 439string destPrefix = resolvedDest.EndsWith(Path.DirectorySeparatorChar) 441: resolvedDest + Path.DirectorySeparatorChar; 444string normalizedFile = Path.GetFullPath(fileDestinationPath); 455.TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 457string[] components = relative.Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, 464current = Path.Combine(current, component); 467string normalizedCurrent = Path.GetFullPath(current); 486return Path.GetFullPath(path); 497string fullPath = Path.GetFullPath(path); 498string? root = Path.GetPathRoot(fullPath); 506.Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); 510current = Path.Combine(current, component); 511if (Path.Exists(current)) 523Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 526string fullPath = Path.GetFullPath(qualifiedPath); // Removes relative segments 576Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 639string? directoryPath = Path.GetDirectoryName(filePath); 641if (!string.IsNullOrEmpty(directoryPath) && !Path.Exists(directoryPath)) 646if (!Path.Exists(filePath)) 669Debug.Assert(!Path.Exists(destinationFileName)); 696Debug.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)
951ReadOnlySpan<char> dirName = Path.GetDirectoryName(_name.AsSpan()); 954ReadOnlySpan<char> fileName = Path.GetFileName(_name.AsSpan()); 958$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}{Path.DirectorySeparatorChar}" : 973ReadOnlySpan<char> tmp = Path.TrimEndingDirectorySeparator(Path.GetTempPath());
System\Formats\Tar\TarHelpers.cs (1)
422=> c == Path.DirectorySeparatorChar;
System\Formats\Tar\TarHelpers.Unix.cs (3)
25string filename = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
System\Formats\Tar\TarWriter.cs (2)
358string fullPath = Path.GetFullPath(fileName); 359string? actualEntryName = string.IsNullOrEmpty(entryName) ? Path.GetFileName(fileName) : entryName;
System.IO.Compression (2)
System\IO\Compression\ZipArchiveEntry.cs (2)
177_externalFileAttr = entryName.EndsWith(Path.DirectorySeparatorChar) || entryName.EndsWith(Path.AltDirectorySeparatorChar)
System.IO.Compression.ZipFile (15)
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.Windows.cs (1)
20if (preserveDriveRoot && entryPath.Length >= 3 && entryPath[1] == ':' && Path.IsPathFullyQualified(entryPath))
System\IO\Compression\ZipFile.Create.cs (3)
530sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 531destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName); 550return Path.GetFullPath(sourceDirectoryName);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs (3)
85tempPath = Path.GetTempFileName(); 144tempPath = Path.GetTempFileName(); 187Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.cs (8)
76tempPath = Path.GetTempFileName(); 133tempPath = Path.GetTempFileName(); 223if (!destinationDirectoryFullPath.EndsWith(Path.DirectorySeparatorChar)) 225char sep = Path.DirectorySeparatorChar; 229fileDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectoryFullPath, ArchivingUtils.SanitizeEntryFilePath(source.FullName))); 236if (Path.GetFileName(fileDestinationPath).Length == 0) 257Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System.IO.FileSystem.AccessControl (7)
src\runtime\src\libraries\Common\src\System\IO\FileSystem.DirectoryCreation.Windows.cs (1)
120string? root = Path.GetPathRoot(fullPath);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
System\IO\FileSystemAclExtensions.cs (3)
31string fullPath = Path.GetFullPath(directoryInfo.FullName); 54string fullPath = Path.GetFullPath(fileInfo.FullName); 314if (errorCode == Interop.Errors.ERROR_PATH_NOT_FOUND && fullPath.Length == Path.GetPathRoot(fullPath)!.Length)
System\Security\AccessControl\FileSystemSecurity.cs (1)
21: base(isContainer, s_ResourceType, PathInternal.EnsureExtendedPrefixIfNeeded(Path.GetFullPath(name)), includeSections, _HandleErrorCode, isDirectory)
System.IO.FileSystem.DriveInfo (2)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.IO.FileSystem.Watcher (9)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\runtime\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)
302string name = System.IO.Path.GetFileName(directoryPath); 1030BasePath = 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\runtime\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\runtime\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\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.Management (1)
System\Management\ManagementScope.cs (1)
307string wminet_utilsPath = Path.Combine(
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\runtime\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 (155)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
176string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (2)
27string? directory = Path.GetDirectoryName(path); 32if (!Path.EndsInDirectorySeparator(directory))
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
131string fullPath = Path.GetFullPath(assemblyFile);
src\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
20string fullPath = Path.GetFullPath(path); 31string tempPath = Path.GetTempPath();
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.cs (1)
39if (Path.EndsInDirectorySeparator(OriginalRootDirectory) && PathInternal.StartsWithDirectorySeparator(relativePath))
src\runtime\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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
158_pending.Enqueue((Path.Join(_currentPath, entry.FileName), _remainingRecursionDepth - 1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (26)
55FileSystem.CopyFile(Path.GetFullPath(sourceFileName), Path.GetFullPath(destFileName), overwrite); 84FileSystem.DeleteFile(Path.GetFullPath(path)); 100path = Path.GetFullPath(path); 170return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize); 210=> FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false); 241=> FileSystem.SetCreationTime(Path.GetFullPath(path), GetUtcDateTimeOffset(creationTimeUtc), asDirectory: false); 273=> FileSystem.GetCreationTime(Path.GetFullPath(path)).LocalDateTime; 298=> FileSystem.GetCreationTime(Path.GetFullPath(path)).UtcDateTime; 323=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), lastAccessTime, false); 354=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastAccessTimeUtc), false); 385=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).LocalDateTime; 410=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).UtcDateTime; 435=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), lastWriteTime, false); 466=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastWriteTimeUtc), false); 497=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).LocalDateTime; 522=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).UtcDateTime; 547=> FileSystem.GetAttributes(Path.GetFullPath(path)); 571=> FileSystem.SetAttributes(Path.GetFullPath(path), fileAttributes); 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\runtime\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\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (2)
191=> GetAttributes(handle, handle.Path, Path.GetFileName(handle.Path), continueOnError); 500Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (1)
47fullPath = Path.TrimEndingDirectorySeparator(fullPath);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
57if (PathInternal.IsDirectorySeparator(ch) || ch == Path.VolumeSeparatorChar)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
102string tempPath = Path.GetTempPath();
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (8)
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( 824string runtimeTempDirectory = Path.Combine( 830string sharedMemoryDirectory = Path.Combine(
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
42string fullPath = Path.GetFullPath(path);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (1)
71string path = Path.Combine(_mediator.ModuleDir, fileName);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
899string? parentDirectory = Path.GetDirectoryName(parentAssembly.Location); 922string assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!, $"{assemblyName.Name}.dll"); 932assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!.ToLowerInvariant(), $"{assemblyName.Name}.dll");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\LibraryNameVariation.Unix.cs (1)
36bool containsDelim = libName.Contains(Path.DirectorySeparatorChar);
src\runtime\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\runtime\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\runtime\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))
System\Diagnostics\StackFrame.NativeAot.cs (1)
140ReadOnlySpan<char> fileNameWithoutExtension = Path.GetFileNameWithoutExtension(moduleFullFileName.AsSpan());
System\Runtime\InteropServices\NativeLibrary.NativeAot.cs (2)
78bool libNameIsRelativePath = !Path.IsPathFullyQualified(libraryName); 106ret = LoadLibraryHelper(Path.Combine(AppContext.BaseDirectory, currLibNameVariation), flags, ref errorTracker);
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)
237path = Path.Combine(Path.GetDirectoryName(type.Assembly.Location)!, $"{assemblyName}.dll"); 242path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, $"{assemblyName}.dll"); 247path = 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)
src\runtime\artifacts\obj\System.Runtime\Release\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 (1)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
425_ = Path.GetFullPath(fileName);
System.Speech (1)
Internal\SrgsCompiler\SRGSCompiler.cs (1)
51srgsPath = Path.GetDirectoryName(uri.IsAbsoluteUri ? uri.AbsolutePath : uri.OriginalString);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
27using StreamWriter sw = new StreamWriter($"{Path.Combine(path, classname)}.cs");
System.Windows.Extensions (1)
System\Media\SoundPlayer.cs (1)
364result = new Uri(Path.GetFullPath(partialUri));
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)
1338string 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)
5172_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)
304string ext = Path.GetExtension(file is null ? url : file.LocalPath + file.Fragment).ToLower(CultureInfo.InvariantCulture);
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.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.Xaml (1)
src\wpf\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");
testhost (5)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
src\vstest\src\testhost.x86\DefaultEngineInvoker.cs (1)
118EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}");
testhost.arm64 (5)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
src\vstest\src\testhost.x86\DefaultEngineInvoker.cs (1)
118EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}");
testhost.x86 (5)
DefaultEngineInvoker.cs (1)
118EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}");
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
TestProject.AppHost (1)
TestProgram.cs (1)
73var serviceAPath = Path.Combine(Projects.TestProject_AppHost.ProjectPath, @"..\TestProject.ServiceA\TestProject.ServiceA.csproj");
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
317return System.IO.Path.GetFileName(sb.ToString().ToLower(CultureInfo.InvariantCulture));
vbc (14)
src\roslyn\src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 111var tempDir = Path.GetTempPath();
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (7)
452var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 458commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 695clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 783var tempPath = Path.GetTempPath(); 784var result = Path.Combine(tempPath, ".roslyn"); 792FilePath = Path.Combine(mutexDirectory, name); 793GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
66var directoryName = Path.GetDirectoryName(dotNetPath); 101var filePath = Path.Combine(item, fileName);
src\roslyn\src\Compilers\Shared\Vbc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, VisualBasicCompiler.ResponseFileName);
VBCSCompiler (40)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (22)
133=> Path.Combine(_cachePath, dllName, hashKey); 152var cachedAssemblyPath = Path.Combine(entryDir, AssemblyFileName); 205return !File.Exists(Path.Combine(entryDir, cachedFileName)); 215copyAndUpdateTimestamp(Path.Combine(entryDir, cachedFileName), targetPath, outputTimestampUtc); 242var dllCacheDir = Path.Combine(_cachePath, dllName); 253.Select(d => (Path: d, Name: Path.GetFileName(d))) 268var keyPath = Path.Combine(entryPath, dllName + ".key"); 302var dllCacheDir = Path.Combine(_cachePath, dllName); 322stagingDir = Path.Combine(dllCacheDir, hashKey + "." + Guid.NewGuid().ToString("N") + ".tmp"); 325File.Copy(outputFiles.AssemblyPath, Path.Combine(stagingDir, AssemblyFileName), overwrite: false); 327tryCopyOptional(outputFiles.PdbPath, Path.Combine(stagingDir, PdbFileName)); 328tryCopyOptional(outputFiles.RefAssemblyPath, Path.Combine(stagingDir, RefAssemblyFileName)); 329tryCopyOptional(outputFiles.XmlDocPath, Path.Combine(stagingDir, XmlDocFileName)); 331File.WriteAllText(Path.Combine(stagingDir, dllName + ".key"), deterministicKey, Encoding.UTF8); 332File.WriteAllText(Path.Combine(stagingDir, CreatedFileName), DateTimeOffset.UtcNow.ToString("O", CultureInfo.InvariantCulture)); 457var path = Path.Combine(entryDir, LastUsedFileName); 488var dllName = Path.GetFileName(dllDir); 492var dirName = Path.GetFileName(entryDir); 553var lastUsedPath = Path.Combine(entryDir, LastUsedFileName); 581var createdPath = Path.Combine(entryDir, CreatedFileName); 621var dllName = Path.GetFileName(dllDir); 625var dirName = Path.GetFileName(entryDir);
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (2)
75AnalyzerAssemblyLoader = Microsoft.CodeAnalysis.AnalyzerAssemblyLoader.CreateNonLockingLoader(Path.Combine(Path.GetTempPath(), "VBCSCompiler", "AnalyzerAssemblyLoader"));
src\roslyn\src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (1)
22: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache, logger)
src\roslyn\src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
79var allModules = GetAllModules(primaryModule, Path.GetDirectoryName(fullPath)!);
src\roslyn\src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (1)
22: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache, logger)
src\roslyn\src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 111var tempDir = Path.GetTempPath();
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (7)
452var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 458commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 695clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 783var tempPath = Path.GetTempPath(); 784var result = Path.Combine(tempPath, ".roslyn"); 792FilePath = Path.Combine(mutexDirectory, name); 793GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
126loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
66var directoryName = Path.GetDirectoryName(dotNetPath); 101var filePath = Path.Combine(item, fileName);
vbi (3)
Vbi.vb (3)
18Dim vbiDirectory = Path.GetDirectoryName(GetType(Vbi).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName) 24tempDir:=Path.GetTempPath()) 27responseFile:=Path.Combine(vbiDirectory, InteractiveResponseFileName),
vstest.console (25)
CommandLine\Executor.cs (1)
502if (Path.GetFileName(_processHelper.GetCurrentProcessFileName()) == NonARM64RunnerName &&
CommandLine\InferHelper.cs (2)
177var extension = Path.GetExtension(source); 230var extType = Path.GetExtension(filePath);
Internal\ConsoleLogger.cs (1)
779var sourceName = Path.GetFileName(sd.Key);
Internal\FilePatternParser.cs (6)
53if (!Path.IsPathRooted(filePattern)) 55filePattern = Path.Combine(_fileHelper.GetCurrentDirectory(), filePattern); 87matchingFiles.Add(Path.Combine(splitPattern.Item1, match.Path)); 110pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar), 111pathBeforeWildCard.LastIndexOf(Path.AltDirectorySeparatorChar)); 116directorySeparatorIndex = pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar);
Processors\AeDebuggerArgumentProcessor.cs (1)
145procDumpPath = Path.Combine(procDumpToolDirectoryPath.FullName, ProcDumpExecutableHelper.ProcDumpFileName(_environment.Architecture));
Processors\CollectArgumentProcessor.cs (1)
128string collectorPath = Path.Combine(adapterPath, CoverletConstants.CoverletDataCollectorCodebase);
Processors\EnableDiagArgumentProcessor.cs (3)
150EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}"); 227return Path.GetFullPath(diagFilePathArgument); 238var directory = Path.GetDirectoryName(filePath);
Processors\ResultsDirectoryArgumentProcessor.cs (2)
120if (!Path.IsPathRooted(argument)) 122argument = Path.GetFullPath(argument);
Publisher\TextFileTelemetryPublisher.cs (2)
61?? Path.GetTempPath() + "TelemetryLogs"; 63string path = Path.Combine(resultDirectory, resultFileName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
TestPlatformHelpers\TestRequestManager.cs (2)
1388var extension = Path.GetExtension(settings); 1557if (KnownPlatformSources.Contains(Path.GetFileName(source)))
vstest.console.arm64 (25)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
src\vstest\src\vstest.console\CommandLine\Executor.cs (1)
502if (Path.GetFileName(_processHelper.GetCurrentProcessFileName()) == NonARM64RunnerName &&
src\vstest\src\vstest.console\CommandLine\InferHelper.cs (2)
177var extension = Path.GetExtension(source); 230var extType = Path.GetExtension(filePath);
src\vstest\src\vstest.console\Internal\ConsoleLogger.cs (1)
779var sourceName = Path.GetFileName(sd.Key);
src\vstest\src\vstest.console\Internal\FilePatternParser.cs (6)
53if (!Path.IsPathRooted(filePattern)) 55filePattern = Path.Combine(_fileHelper.GetCurrentDirectory(), filePattern); 87matchingFiles.Add(Path.Combine(splitPattern.Item1, match.Path)); 110pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar), 111pathBeforeWildCard.LastIndexOf(Path.AltDirectorySeparatorChar)); 116directorySeparatorIndex = pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar);
src\vstest\src\vstest.console\Processors\AeDebuggerArgumentProcessor.cs (1)
145procDumpPath = Path.Combine(procDumpToolDirectoryPath.FullName, ProcDumpExecutableHelper.ProcDumpFileName(_environment.Architecture));
src\vstest\src\vstest.console\Processors\CollectArgumentProcessor.cs (1)
128string collectorPath = Path.Combine(adapterPath, CoverletConstants.CoverletDataCollectorCodebase);
src\vstest\src\vstest.console\Processors\EnableDiagArgumentProcessor.cs (3)
150EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}"); 227return Path.GetFullPath(diagFilePathArgument); 238var directory = Path.GetDirectoryName(filePath);
src\vstest\src\vstest.console\Processors\ResultsDirectoryArgumentProcessor.cs (2)
120if (!Path.IsPathRooted(argument)) 122argument = Path.GetFullPath(argument);
src\vstest\src\vstest.console\Publisher\TextFileTelemetryPublisher.cs (2)
61?? Path.GetTempPath() + "TelemetryLogs"; 63string path = Path.Combine(resultDirectory, resultFileName);
src\vstest\src\vstest.console\TestPlatformHelpers\TestRequestManager.cs (2)
1388var extension = Path.GetExtension(settings); 1557if (KnownPlatformSources.Contains(Path.GetFileName(source)))
Yarp.AppHost (1)
Program.cs (1)
21.WithStaticFiles(Path.Combine("..", "static-content"))