20574 references to Path
AnalyzerRunner (8)
CodeRefactoringRunner.cs (1)
217WriteLine($"Skipped assembly '{Path.GetFileNameWithoutExtension(file)}' during code refactoring discovery.", ConsoleColor.Yellow);
DiagnosticAnalyzerRunner.cs (5)
223string directoryName = Path.GetDirectoryName(fileName); 224string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 225string extension = Path.GetExtension(fileName); 226string uniqueFileName = Path.Combine(directoryName, $"{fileNameWithoutExtension}-Unique{extension}"); 306var analyzerReference = new AnalyzerFileReference(Path.GetFullPath(path), AssemblyLoader.Instance);
PersistentStorageConfiguration.cs (2)
28var location = Path.Combine(Path.GetTempPath(), "RoslynTests", "AnalyzerRunner", "temp-db");
ArgumentForwarding.Tests (3)
ArgumentForwardingTests.cs (2)
27ReflectorPath = Path.Combine(AppContext.BaseDirectory, s_reflectorDllName); 28ReflectorCmdPath = Path.Combine(AppContext.BaseDirectory, s_reflectorCmdName);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
aspire (89)
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);
Commands\ConfigCommand.cs (1)
214if (Path.Exists(settingsFilePath))
Commands\InitCommand.cs (13)
190project => Path.GetFileNameWithoutExtension(project.ProjectFile.Name), 243project => Path.GetFileNameWithoutExtension(project.ProjectFile.Name), 265var tempProjectDir = Path.Combine(Path.GetTempPath(), $"aspire-init-{Guid.NewGuid()}"); 345var finalAppHostDir = Path.Combine(initContext.SolutionDirectory.FullName, appHostProjectDir.Name); 346var finalServiceDefaultsDir = Path.Combine(initContext.SolutionDirectory.FullName, serviceDefaultsProjectDir.Name); 355var appHostProjectFile = new FileInfo(Path.Combine(finalAppHostDir, $"{appHostProjectDir.Name}.csproj")); 356var serviceDefaultsProjectFile = new FileInfo(Path.Combine(finalServiceDefaultsDir, $"{serviceDefaultsProjectDir.Name}.csproj")); 436InteractionService.DisplayError($"Failed to add reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 470InteractionService.DisplayError($"Failed to add ServiceDefaults reference to {Path.GetFileNameWithoutExtension(project.ProjectFile.Name)}."); 684public string SolutionName => Path.GetFileNameWithoutExtension(SelectedSolutionFile!.Name); 694public string ExpectedAppHostDirectory => Path.Combine(SolutionDirectory.FullName, $"{SolutionName}.AppHost"); 699public string ExpectedServiceDefaultsDirectory => Path.Combine(SolutionDirectory.FullName, $"{SolutionName}.ServiceDefaults");
Commands\PublishCommand.cs (1)
54: Path.Combine(Environment.CurrentDirectory, "aspire-output");
Commands\PublishCommandBase.cs (1)
182var fullyQualifiedOutputPath = outputPath != null ? Path.GetFullPath(outputPath) : null;
Commands\RunCommand.cs (3)
261var appHostRelativePath = Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, effectiveAppHostFile.FullName); 414var logsPath = Path.Combine(homeDirectory, ".aspire", "cli", "logs"); 415var logFilePath = Path.Combine(logsPath, $"apphost-{Environment.ProcessId}-{DateTime.UtcNow:yyyy-MM-dd-HH-mm-ss}.log");
Commands\UpdateCommand.cs (8)
80var fileName = Path.GetFileNameWithoutExtension(processPath); 187var installDir = Path.Combine(homeDir, ".aspire", "bin"); 191var targetExePath = Path.Combine(installDir, exeName); 202var newExePath = Path.Combine(tempExtractDir, exeName); 277CleanupDirectory(Path.GetDirectoryName(archivePath)!); 289var pathSeparator = Path.PathSeparator; 293string.Equals(Path.GetFullPath(p.Trim()), Path.GetFullPath(directory),
Configuration\ConfigurationService.cs (1)
34var directory = Path.GetDirectoryName(settingsFilePath);
DotNet\DotNetCliRunner.cs (9)
501var aspireCliPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 509var socketPath = Path.Combine(aspireCliPath, $"cli.sock.{uniqueSocketPathSegment}"); 896var filePath = Path.IsPathRooted(configPath) 898: Path.Combine(workingDirectory.FullName, configPath); 1157var projectPath = Path.IsPathRooted(line) 1159: Path.Combine(solutionFile.Directory!.FullName, line); 1206var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", sdkVersion); 1207var dotnetExecutablePath = Path.Combine( 1226startInfo.EnvironmentVariables["PATH"] = $"{sdkInstallPath}{Path.PathSeparator}{currentPath}";
DotNet\DotNetSdkInstaller.cs (5)
38var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", minimumVersion); 40? Path.Combine(sdkInstallPath, "dotnet.exe") 41: Path.Combine(sdkInstallPath, "dotnet"); 133var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", sdkVersion); 149var scriptPath = Path.Combine(sdksDirectory, scriptFileName);
Packaging\NuGetConfigMerger.cs (1)
68var targetPath = Path.Combine(targetDirectory.FullName, "NuGet.config");
Packaging\TemporaryNuGetConfig.cs (4)
22var tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 24var tempFilePath = Path.Combine(tempDirectory, "NuGet.config");
Program.cs (5)
44var aspirePath = Path.Combine(homeDirectory, ".aspire"); 51var globalSettingsPath = Path.Combine(usersAspirePath, "globalsettings.json"); 169var hivesDirectory = Path.Combine(homeDirectory, "hives"); 176var sdksPath = Path.Combine(homeDirectory, "sdks"); 192var cacheDirectoryPath = Path.Combine(homeDirectory, "cache");
Projects\FallbackProjectParser.cs (3)
160var fullPath = Path.IsPathRooted(include) 162: Path.GetFullPath(Path.Combine(projectFile.DirectoryName!, include));
Projects\ProjectLocator.cs (13)
69var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName); 78var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName); 100var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName); 182var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath); 254var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateProject.FullName); 276var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName); 312file => $"{file.Name} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName)})", 402MultipleAppHostProjectsFoundBehavior.Prompt => await interactionService.PromptForSelectionAsync(InteractionServiceStrings.SelectAppHostToUse, results.BuildableAppHost, projectFile => $"{projectFile.Name} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName)})", cancellationToken), 429var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/'); 434var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
Projects\ProjectUpdater.cs (3)
87var configPathDirectories = configPaths.Select(Path.GetDirectoryName).ToArray(); 143var globalNuGetFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget"); 428var directoryPackagesPropsPath = Path.Combine(current.FullName, "Directory.Packages.props");
Projects\SolutionLocator.cs (2)
42solutionFile => $"{solutionFile.Name} ({Path.GetRelativePath(startDirectory.FullName, solutionFile.FullName)})", 86.OrderBy(f => f.Directory?.FullName.Count(c => c == Path.DirectorySeparatorChar) ?? 0)
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
Templating\DotNetTemplateFactory.cs (2)
433return Path.GetFullPath(outputPath); 501var normalizedOutputPath = Path.GetFullPath(outputPath);
Utils\AppHostHelper.cs (2)
56var relativePath = Path.GetRelativePath(workingDirectory.FullName, projectFile.FullName); 69var relativePath = Path.GetRelativePath(workingDirectory.FullName, projectFile.FullName);
Utils\CliDownloader.cs (2)
62var archivePath = Path.Combine(tempDir, archiveFilename); 63var checksumPath = Path.Combine(tempDir, checksumFilename);
Utils\ConfigurationHelper.cs (1)
45return Path.Combine(workingDirectory, ".aspire", "settings.json");
Utils\FileSystemHelper.cs (2)
39var targetFilePath = Path.Combine(currentDestination, file.Name); 46var targetSubDir = Path.Combine(currentDestination, subDir.Name);
Aspire.Cli.Tests (354)
Caching\DiskCacheTests.cs (8)
19var hives = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 20var cacheDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache")); 21var ctx = new CliExecutionContext(workspace.WorkspaceRoot, hives, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 71var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search"); 117var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search"); 122var nameNoExt = Path.GetFileNameWithoutExtension(current); 126var oldName = Path.Combine(diskPath, $"{hash}.{oldUnix}.json");
Commands\ConfigCommandTests.cs (5)
70var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 93var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 118var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 152var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 272var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
Commands\ExtensionInternalCommandTests.cs (3)
62var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp.AppHost.csproj")); 107var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App1.AppHost.csproj")); 108var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App2.AppHost.csproj"));
Commands\InitCommandTests.cs (4)
66var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 121var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 247Assert.Equal(workspace.WorkspaceRoot.FullName, Path.GetFullPath(outputPath)); 250var appHostFile = Path.Combine(outputPath, "apphost.cs");
Commands\PublishCommandTests.cs (1)
203Assert.True(Path.IsPathRooted(outputPath));
Commands\RunCommandTests.cs (27)
411$"{InteractionServiceStrings.BuildingAppHost} src{Path.DirectorySeparatorChar}MyApp.AppHost{Path.DirectorySeparatorChar}MyApp.AppHost.csproj", 420var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost"); 422var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj"); 748var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 758workingDirectory: 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")) 802var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 812workingDirectory: 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")) 852var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 862workingDirectory: 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")) 906var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 916workingDirectory: 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")) 955var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 965workingDirectory: 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")) 1005var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1015workingDirectory: 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")) 1055var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1065workingDirectory: 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")) 1119new FileInfo(Path.Combine(searchDirectory, "AppHost1.csproj")), 1120new FileInfo(Path.Combine(searchDirectory, "AppHost2.csproj"))
DotNet\DotNetCliRunnerTests.cs (31)
26var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache")); 27return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 34var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 83var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 121var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 169var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 216var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 266var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 362var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 410var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 460var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 515var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 570var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 631var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 700var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 773var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 778var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj")); 782var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj")); 810invocationOptions.StandardOutputCallback?.Invoke($"Project1{Path.DirectorySeparatorChar}Project1.csproj"); 811invocationOptions.StandardOutputCallback?.Invoke($"Project2{Path.DirectorySeparatorChar}Project2.csproj"); 829var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 832var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj")); 871var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 926var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 980var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1034var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 1094var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1152var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1209var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 1254var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
DotNetSdkInstallerTests.cs (6)
20var tempPath = Path.Combine(Path.GetTempPath(), "aspire-cli-tests", Guid.NewGuid().ToString()); 22var hivesDirectory = new DirectoryInfo(Path.Combine(tempPath, "hives")); 23var cacheDirectory = new DirectoryInfo(Path.Combine(tempPath, "cache")); 24var sdksDirectory = new DirectoryInfo(Path.Combine(tempPath, "sdks")); 120var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", sdkVersion);
Interaction\ConsoleInteractionServiceTests.cs (26)
17var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 30var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 51var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 76var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 101var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 132var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 159var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 184var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), debugMode: true); 211var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), debugMode: true); 230var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 244var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 259var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 274var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")));
Interaction\SpectreConsoleLoggerProviderTests.cs (10)
19var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 52var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 96var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 139var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 179var executionContext = new CliExecutionContext(new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo("."), new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")));
NuGet\NuGetPackagePrefetcherTests.cs (4)
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")));
Packaging\NuGetConfigMergerSnapshotTests.cs (26)
46var path = Path.Combine(dir.FullName, "NuGet.config"); 64var cacheDir = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache")); 65var executionContext = new CliExecutionContext(root, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 86var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 92var hivePath = Path.Combine(hivesDir.FullName, channelName); 113var cacheDir2 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache")); 114var executionContext = new CliExecutionContext(root, hivesDir, cacheDir2, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 148var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 154var hivePath = Path.Combine(hivesDir.FullName, channelName); 175var cacheDir3 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache")); 176var executionContext = new CliExecutionContext(root, hivesDir, cacheDir3, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 209var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 215var hivePath = Path.Combine(hivesDir.FullName, channelName); 236var cacheDir4 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache")); 237var executionContext = new CliExecutionContext(root, hivesDir, cacheDir4, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 268var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 274var hivePath = Path.Combine(hivesDir.FullName, channelName); 295var cacheDir5 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache")); 296var executionContext = new CliExecutionContext(root, hivesDir, cacheDir5, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 332var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 338var hivePath = Path.Combine(hivesDir.FullName, channelName);
Packaging\NuGetConfigMergerTests.cs (16)
23var path = Path.Combine(dir.FullName, "NuGet.config"); 65var targetConfigPath = Path.Combine(root.FullName, "NuGet.config"); 89var targetConfigPath = Path.Combine(root.FullName, "NuGet.config"); 133var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 172var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 212var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 322var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 372var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 441var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 507var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config")); 580var targetConfigPath = Path.Combine(root.FullName, "NuGet.config"); 610var targetConfigPath = Path.Combine(root.FullName, "NuGet.config"); 660var targetConfigPath = Path.Combine(root.FullName, "NuGet.config"); 682var originalContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "NuGet.config")); 703var targetConfigPath = Path.Combine(root.FullName, "NuGet.config"); 725var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
Packaging\PackagingServiceTests.cs (19)
45var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 46var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache")); 47var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 80var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 81var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache")); 82var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 124var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 125var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache")); 126var executionContext = new CliExecutionContext(tempDir, hivesDir, cacheDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 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"))); 203new CliExecutionContext(tempDir, tempDir, tempDir, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))), 215var nugetConfigPath = Path.Combine(tempDir.FullName, "NuGet.config");
Projects\FallbackProjectParserTests.cs (8)
16var tempDir = Path.GetTempPath(); 17var projectFile = Path.Combine(tempDir, $"Test{Guid.NewGuid()}.csproj"); 53var tempDir = Path.GetTempPath(); 54var projectFile = Path.Combine(tempDir, $"Test{Guid.NewGuid()}.csproj"); 102var tempDir = Path.GetTempPath(); 103var projectFile = Path.Combine(tempDir, $"Test{Guid.NewGuid()}.csproj"); 149var tempDir = Path.GetTempPath(); 150var projectFile = Path.Combine(tempDir, $"Test{Guid.NewGuid()}.csproj");
Projects\ProjectLocatorTests.cs (51)
26var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache")); 27return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 37var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 60var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 64var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj")); 68var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 73appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName) 99var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 103var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj")); 107var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 112appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName) 135var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj")); 140var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 178var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj")); 181var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj")); 201var appHostProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 204var webProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebProject.csproj")); 256var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectFileExtension}")); 275var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 297var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 309var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"); 320var settingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json")); 338var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 366var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs")); 396var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs")); 406var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj")); 411var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs")); 447var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 471var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj")); 476var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs")); 519var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 547var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 571var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 582var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj")); 601var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt")); 625var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 630var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs")); 736var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj")); 795var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj")); 797var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj")); 833var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs")); 865var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj")); 899var exeProjectFile = new FileInfo(Path.Combine(exeProjectDir.FullName, "ExeProject.csproj")); 904var libProjectFile = new FileInfo(Path.Combine(libProjectDir.FullName, "LibProject.csproj")); 940var winExeProjectFile = new FileInfo(Path.Combine(winExeProjectDir.FullName, "WinExeProject.csproj")); 975var lib1File = new FileInfo(Path.Combine(lib1Dir.FullName, "Lib1.csproj")); 979var lib2File = new FileInfo(Path.Combine(lib2Dir.FullName, "Lib2.csproj")); 1031var exe1File = new FileInfo(Path.Combine(exe1Dir.FullName, "Exe1.csproj")); 1035var exe2File = new FileInfo(Path.Combine(exe2Dir.FullName, "Exe2.csproj")); 1039var winExeFile = new FileInfo(Path.Combine(winExeDir.FullName, "WinExe.csproj"));
Projects\ProjectUpdaterTests.cs (41)
29var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 32var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 35var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 139var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 142var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 145var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 276var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 279var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 282var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 432var sharedProjectFile = new FileInfo(Path.Combine(sharedProjectFolder.FullName, "SharedProject.csproj")); 435var projectAFile = new FileInfo(Path.Combine(projectAFolder.FullName, "ProjectA.csproj")); 438var projectBFile = new FileInfo(Path.Combine(projectBFolder.FullName, "ProjectB.csproj")); 441var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "DiamondTest.AppHost.csproj")); 565var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 568var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 570var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 701var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 703var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 803var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 805var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 906var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache")); 907return new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes"))); 936var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 938var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1049var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1051var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1173var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1175var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1287var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1289var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1398var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1492var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1494var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1594var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1673var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1755var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs")); 1838var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs")); 1920var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2006var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2084var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
Templating\DotNetTemplateFactoryTests.cs (19)
54var path = Path.Combine(dir.FullName, "NuGet.config"); 79var nugetConfigPath = Path.Combine(workingDir.FullName, "NuGet.config"); 111var nugetConfigPath = Path.Combine(workingDir.FullName, "NuGet.config"); 124var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 149var parentConfigPath = Path.Combine(workingDir.FullName, "NuGet.config"); 155var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config"); 168var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 191var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config"); 205var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 218var workingConfigPath = Path.Combine(workingDir.FullName, "NuGet.config"); 222var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config"); 235var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 244var workingConfigPath = Path.Combine(workingDir.FullName, "NuGet.config"); 245var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config"); 256var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 265var workingConfigPath = Path.Combine(workingDir.FullName, "NuGet.config"); 266var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config"); 335var executionContext = new CliExecutionContext(workingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")));
TestServices\TestCliDownloader.cs (1)
30var path = Path.Combine(_tempDirectory.FullName, filename);
TestServices\TestDotNetCliRunner.cs (2)
77PlatformID.Win32NT => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet", "NuGet.Config")], 78_ => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet.Config")],
TestServices\TestProjectLocator.cs (3)
29var fakeProjectFilePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString(), "AppHost.csproj"); 58var fakeProjectFilePath = Path.Combine(searchDirectory, "SomeExecutable.csproj");
Utils\CliTestHelper.cs (7)
60var globalSettingsFilePath = Path.Combine(options.WorkingDirectory.FullName, ".aspire", "settings.global.json"); 134var hivesDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "hives")); 135var cacheDirectory = new DirectoryInfo(Path.Combine(WorkingDirectory.FullName, ".aspire", "cache")); 136return new CliExecutionContext(WorkingDirectory, hivesDirectory, cacheDirectory, new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-sdks"))); 198var globalSettingsFilePath = Path.Combine(workingDirectory.FullName, ".aspire", "settings.global.json"); 343var tmpDirectory = new DirectoryInfo(Path.Combine(executionContext.WorkingDirectory.FullName, "tmp"));
Utils\FileSystemHelperTests.cs (34)
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");
Utils\TemporaryRepo.cs (2)
59var tempPath = Path.GetTempPath(); 60var path = Path.Combine(tempPath, "Aspire.Cli.Tests", "TemporaryWorkspaces", Guid.NewGuid().ToString());
Aspire.Components.Common.TestUtilities (1)
ConformanceTests.cs (1)
29protected string JsonSchemaPath => Path.Combine(AppContext.BaseDirectory, "ConfigurationSchema.json");
Aspire.Dashboard (4)
Components\Pages\ConsoleLogs.razor.cs (1)
948: string.Join("_", PageViewModel.SelectedResource.Id!.InstanceId!.Split(Path.GetInvalidFileNameChars()));
Model\ResourceIconHelpers.cs (1)
51var extension = Path.GetExtension(projectPath);
Model\ResourceSourceViewModel.cs (2)
22return CreateResourceSourceViewModel(Path.GetFileName(projectPath), projectPath, commandLineInfo); 27return CreateResourceSourceViewModel(Path.GetFileName(executablePath), executablePath, commandLineInfo);
Aspire.Dashboard.Tests (19)
Integration\OtlpGrpcServiceTests.cs (1)
163var configPath = Path.GetTempFileName();
Integration\Playwright\Infrastructure\DashboardServerFixture.cs (2)
42var currentAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 53WebRootPath = Path.Combine(aspireAssemblyDirectory, "wwwroot"),
Integration\StartupTests.cs (10)
140var configFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 239var fileConfigDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 553var configFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 898var 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.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)!) 151File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "EndPointWriterHook_cs"), Path.Combine(project.AppHostProjectDirectory, "EndPointWriterHook.cs")); 152string programCsPath = Path.Combine(project.AppHostProjectDirectory, "AppHost.cs"); 251_testOutput.WriteLine($"----------- [{Path.GetFileName(AppHostProjectDirectory)}] app has exited -------------"); 330workingDirectory ??= Path.Combine(RootDir, $"{Id}.AppHost"); 334var res = await restoreCmd.ExecuteAsync($"restore \"-bl:{Path.Combine(LogPath!, $"{Id}-restore.binlog")}\" /p:TreatWarningsAsErrors=true"); 337var 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"); 84var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName); 87sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath); 92string workloadsProjString = Path.Combine("tests", "workloads.proj"); 103.Split(Path.PathSeparator) 104.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 110sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 116BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping"); 126.Split(Path.PathSeparator) 127.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 133sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 143string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath); 149sdkForTemplatePath = Path.Combine(baseDir, sdkDirName); 164sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath); 166NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null; 174EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"; 187DotNet = Path.Combine(sdkForTemplatePath!, "dotnet"); 195LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath); 200LogRootPath = 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 (120)
ApplicationModel\AspireStore.cs (6)
24if (!Path.IsPathRooted(basePath)) 43filenameTemplate = Path.GetFileName(filenameTemplate); 46var tempFileName = Path.GetTempFileName(); 58var name = Path.GetFileNameWithoutExtension(filenameTemplate); 59var ext = Path.GetExtension(filenameTemplate); 60var finalFilePath = Path.Combine(_basePath, $"{name}.{Convert.ToHexString(hash.GetCurrentHash())[..12].ToLowerInvariant()}{ext}");
ApplicationModel\ContainerFileSystemCallbackAnnotation.cs (6)
25if (Path.GetDirectoryName(value) != string.Empty) 134var fullPath = Path.GetFullPath(path); 150var fileName = Path.GetFileName(relativePath); 151var parts = relativePath.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries); 209Name = Path.GetFileName(fullPath),
ApplicationModel\ContainerMountAnnotation.cs (1)
31if (!Path.IsPathRooted(source))
ContainerResourceBuilderExtensions.cs (15)
184var sourcePath = Path.IsPathRooted(source) ? source : Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory); 500var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 501.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 505var fullyQualifiedDockerfilePath = Path.GetFullPath(dockerfilePath, fullyQualifiedContextPath); 615var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 616.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 619var tempDockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{builder.Resource.Name}.{Guid.NewGuid():N}"); 1171var sourceFullPath = Path.GetFullPath(sourcePath, builder.ApplicationBuilder.AppHostDirectory); 1269var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 1270.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Dashboard\DashboardEventHandlers.cs (24)
119if (string.Equals(".dll", Path.GetExtension(assemblyPath), StringComparison.OrdinalIgnoreCase)) 121runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json"); 127var directory = Path.GetDirectoryName(assemblyPath)!; 128var fileName = Path.GetFileName(assemblyPath); 129var baseName = Path.GetExtension(fileName) switch 131".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe 134runtimeConfigPath = Path.Combine(directory, $"{baseName}.runtimeconfig.json"); 190if (string.Equals(".dll", Path.GetExtension(dashboardPath), StringComparison.OrdinalIgnoreCase)) 193originalRuntimeConfig = Path.ChangeExtension(dashboardPath, ".runtimeconfig.json"); 199var directory = Path.GetDirectoryName(dashboardPath)!; 200var fileName = Path.GetFileName(dashboardPath); 201var baseName = Path.GetExtension(fileName) switch 203".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe 206originalRuntimeConfig = Path.Combine(directory, $"{baseName}.runtimeconfig.json"); 228var customConfigPath = Path.ChangeExtension(Path.GetTempFileName(), ".json"); 270var tempPath = Path.ChangeExtension(Path.GetTempFileName(), ".json"); 284var fullyQualifiedDashboardPath = Path.GetFullPath(dashboardPath); 285var dashboardWorkingDirectory = Path.GetDirectoryName(fullyQualifiedDashboardPath); 292if (string.Equals(".dll", Path.GetExtension(fullyQualifiedDashboardPath), StringComparison.OrdinalIgnoreCase)) 301var directory = Path.GetDirectoryName(fullyQualifiedDashboardPath)!; 302var fileName = Path.GetFileName(fullyQualifiedDashboardPath); 326dashboardDll = Path.Combine(directory, $"{baseName}.dll");
Dcp\DcpExecutor.cs (4)
1016exeSpec.Spec.WorkingDirectory = Path.GetDirectoryName(projectMetadata.ProjectPath); 2127var caBundlePath = Path.Join(_locations.DcpSessionDir, modelResource.Name, "cert.pem"); 2184Directory.CreateDirectory(Path.Join(_locations.DcpSessionDir, modelResource.Name)); 2399Name = Path.GetFileName(bundlePath),
Dcp\DcpHost.cs (1)
226var directoryName = Path.GetDirectoryName(socketPath);
Dcp\DcpOptions.cs (3)
139if (Path.GetDirectoryName(options.CliPath) is string dcpDir && !string.IsNullOrEmpty(dcpDir)) 141options.ExtensionsPath = Path.Combine(dcpDir, "ext"); 142options.BinPath = Path.Combine(options.ExtensionsPath, "bin");
Dcp\Locations.cs (2)
12public string DcpKubeconfigPath => Path.Combine(DcpSessionDir, "kubeconfig"); 14public 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 (4)
196var appHostPath = Path.Join(AppHostDirectory, appHostName); 199AppHostPath = Path.GetFullPath(appHostPath); 321return new AspireStore(Path.Combine(aspireDir, ".aspire")); 730var deploymentStatePath = Path.Combine(
DistributedApplicationOptions.cs (1)
133return Path.GetFileName(projectDirectory);
Exec\ExecResourceManager.cs (1)
199var projectDir = Path.GetDirectoryName(projectMetadata.ProjectPath) ?? throw new InvalidOperationException("Project path is invalid.");
ExecutableResourceBuilderExtensions.cs (2)
55workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 202workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.ApplicationBuilder.AppHostDirectory, workingDirectory));
IProjectMetadata.cs (2)
36public bool IsFileBasedApp => string.Equals(Path.GetExtension(ProjectPath), ".cs", StringComparison.OrdinalIgnoreCase); 65return Path.GetFullPath(projectFiles[0]);
ProjectResourceBuilderExtensions.cs (11)
285projectPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, projectPath)); 365path = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, path)); 389&& await DotnetSdkUtils.TryGetVersionAsync(Path.GetDirectoryName(projectPath)).ConfigureAwait(false) is { } version 396throw new DistributedApplicationException($"File-based apps are only supported on .NET 10 or later. The version active in '{Path.GetDirectoryName(projectPath)}' {versionValue}."); 846var projectDirectoryPath = Path.GetDirectoryName(projectFilePath) ?? throw new InvalidOperationException($"Unable to get directory name for {projectFilePath}"); 895var projectDirectoryPath = Path.GetDirectoryName(projectMetadata.ProjectPath)!; 897var appSettingsPath = Path.Combine(projectDirectoryPath, "appsettings.json"); 898var appSettingsEnvironmentPath = Path.Combine(projectDirectoryPath, $"appsettings.{env}.json"); 900var appFileName = Path.GetFileName(projectDirectoryPath); 901var appNameSettingsPath = Path.Combine(projectDirectoryPath, $"{appFileName}.settings.json"); 902var appNameSettingsEnvironmentPath = Path.Combine(projectDirectoryPath, $"{appFileName}.settings.{env}.json");
Publishing\DockerContainerRuntime.cs (4)
72outputType += $",dest={Path.Combine(options.OutputPath, resourceName)}.tar"; 145var normalizedContextPath = Path.GetFullPath(contextPath).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Publishing\Internal\FileDeploymentStateManager.cs (3)
37var aspireDir = Path.Combine( 44return Path.Combine(aspireDir, $"{environment}.json"); 66Directory.CreateDirectory(Path.GetDirectoryName(deploymentStatePath)!);
Publishing\Internal\UserSecretsDeploymentStateManager.cs (1)
39Directory.CreateDirectory(Path.GetDirectoryName(userSecretsPath)!);
Publishing\Internal\UserSecretsPathHelper.cs (2)
64? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 65: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
Publishing\ManifestPublisher.cs (2)
42_options.Value.OutputPath = Path.Combine(_options.Value.OutputPath, "aspire-manifest.json"); 57var fullyQualifiedPath = Path.GetFullPath(_options.Value.OutputPath);
Publishing\ManifestPublishingContext.cs (8)
68var fullyQualifiedManifestPath = Path.GetFullPath(ManifestPath); 69var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 71var normalizedPath = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 72var relativePath = Path.GetRelativePath(manifestDirectory, normalizedPath); 338var manifestDirectory = Path.GetDirectoryName(Path.GetFullPath(ManifestPath))!; 339var resourceDockerfilePath = Path.Combine(manifestDirectory, $"{container.Name}.Dockerfile");
Publishing\PodmanContainerRuntime.cs (1)
45arguments += $" --output \"{Path.Combine(options.OutputPath, resourceName)}.tar\"";
Publishing\Publisher.cs (2)
184Path.GetFullPath(options.Value.OutputPath) : null); 216var outputPath = Path.GetFullPath(options.Value.OutputPath!);
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\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
src\Shared\SecretsStore.cs (2)
66var tempFilename = Path.GetTempFileName(); 80var directoryName = Path.GetDirectoryName(_secretsFilePath);
Aspire.Hosting.Analyzers.Tests (1)
AnalyzerTest.cs (1)
39Path.Combine("ref", $"net{s_targetFrameworkVersion}"));
Aspire.Hosting.Azure (17)
AzureBicepResource.cs (5)
126? Path.Combine(directory ?? Directory.CreateTempSubdirectory("aspire").FullName, $"{Name.ToLowerInvariant()}.module.bicep") 127: Path.Combine(TempDirectory, $"{Name.ToLowerInvariant()}.module.bicep"); 138: Path.Combine(directory, $"{TemplateResourceName.ToLowerInvariant()}"); 149var targetPath = directory is not null ? Path.Combine(directory, path) : path; 186using var template = GetBicepTemplateFile(Path.GetDirectoryName(context.ManifestPath), deleteTemporaryFileOnDispose: false);
AzureBicepResourceExtensions.cs (2)
27var path = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, bicepFile));
AzureProvisioningResource.cs (2)
84var moduleSourcePath = Path.Combine(generationPath, "main.bicep"); 92var moduleDestinationPath = Path.Combine(directory ?? generationPath, $"{Name}.module.bicep");
AzurePublishingContext.cs (4)
160var modulePath = Path.Combine(moduleDirectory.FullName, $"{resource.Name}.bicep"); 332var resourceDockerfilePath = Path.Combine(outputPath, $"{resource.Name}.Dockerfile"); 345var modulePath = Path.Combine(moduleDirectory.FullName, $"{resource.Name}.bicep"); 480var bicepPath = Path.Combine(outputDirectoryPath, $"{MainInfrastructure.BicepName}.bicep");
Provisioning\Internal\BicepCompiler.cs (2)
87foreach (var directory in (pathVariable ?? string.Empty).Split(Path.PathSeparator)) 89var fullPath = Path.Combine(directory, command);
Provisioning\UserSecretsPathHelper.cs (2)
64? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 65: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
Aspire.Hosting.Azure.Functions (3)
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)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
Aspire.Hosting.Azure.Tests (33)
AzureAppServiceTests.cs (2)
192File.WriteAllText(Path.Combine(directory.FullName, "Dockerfile"), ""); 363Path.Combine(tempDir.Path, "aspire-manifest.json"),
AzureContainerAppsTests.cs (3)
64File.WriteAllText(Path.Combine(directory.FullName, "Dockerfile"), ""); 1632await VerifyFile(Path.Combine(tempDir.Path, "aspire-manifest.json")); 2006File.WriteAllText(Path.Combine(tempDirectory.Path, "Dockerfile"), "FROM alpine");
AzureDeployerTests.cs (4)
49var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep"); 51var envBicepPath = Path.Combine(tempDir.FullName, "env", "env.bicep"); 1169var deploymentStatePath = Path.Combine( 1176Directory.CreateDirectory(Path.GetDirectoryName(deploymentStatePath)!);
AzureEnvironmentResourceTests.cs (10)
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"); 123var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep"); 172var mainBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "main.bicep")); 173var storageBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "storage", "storage.bicep")); 207var mainBicepPath = Path.Combine(tempDir.Path, "main.bicep"); 212var includedStorageBicepPath = Path.Combine(tempDir.Path, "included-storage", "included-storage.bicep"); 216var excludedStorageBicepPath = Path.Combine(tempDir.Path, "excluded-storage", "excluded-storage.bicep"); 238var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile");
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();
AzureManifestUtils.cs (2)
38if (pathNode?.ToString() is not { } path || !File.Exists(Path.Combine(manifestDir, path))) 43var bicepText = await File.ReadAllTextAsync(Path.Combine(manifestDir, path));
AzureResourceOptionsTests.cs (3)
23var outputPath = Path.Combine(tempDir.FullName, "aspire-manifest.json"); 42var sbBicep = await File.ReadAllTextAsync(Path.Combine(tempDir.FullName, "sb.module.bicep")); 44var sqlBicep = await File.ReadAllTextAsync(Path.Combine(tempDir.FullName, "sql-server.module.bicep"));
AzureServiceBusExtensionsTests.cs (2)
555var configJsonPath = Path.GetTempFileName(); 780var configJsonPath = Path.GetTempFileName();
AzureStorageExtensionsTests.cs (2)
36Assert.Equal(Path.Combine(builder.AppHostDirectory, ".azurite", "storage"), volumeAnnotation.Source); 62Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
Aspire.Hosting.Containers.Tests (12)
ContainerResourceTests.cs (1)
236Assert.Equal(Path.Combine(basePath, "source"), mountAnnotation.Source);
DockerSocketBindMountTests.cs (2)
24var dockerFilePath = Path.Combine(dir.Path, "Dockerfile"); 48var infoFile = Path.Combine(outDir.Path, "docker-info.txt");
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
WithDockerfileTests.cs (7)
256var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 304var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 351var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 397var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 824var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 868var manifestPath = Path.Combine(tempDir.FullName, "manifest.json"); 883var dockerfilePath = Path.Combine(tempDir.FullName, "testcontainer.Dockerfile");
Aspire.Hosting.DevTunnels (8)
RequiredCommandValidator.cs (8)
136if (command.IndexOfAny([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]) >= 0) 138var candidate = Path.GetFullPath(command); 149var paths = pathEnv.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); 154var hasExtension = Path.HasExtension(command); 162var candidate = Path.Combine(dir, command); 172var candidate = Path.Combine(dir, command + ext); 185var candidate = Path.Combine(dir, command);
Aspire.Hosting.Docker (8)
DockerComposePublishingContext.cs (7)
107var resourceDockerfilePath = Path.Combine(OutputPath, $"{serviceResource.TargetResource.Name}.Dockerfile"); 167var outputFile = Path.Combine(OutputPath, "docker-compose.yaml"); 175var envFilePath = Path.Combine(OutputPath, ".env"); 236sourcePath = Path.Combine(OutputPath, composeService.Name, Path.GetFileName(file.SourcePath)); 238Directory.CreateDirectory(Path.Combine(OutputPath, composeService.Name)); 242sourcePath = Path.GetRelativePath(OutputPath, sourcePath).Replace('\\', '/');
src\Shared\PublishingContextUtils.cs (1)
18return Path.Combine(context.OutputPath, environment.Name);
Aspire.Hosting.Docker.Tests (23)
DockerComposePublisherTests.cs (17)
97var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 98var envPath = Path.Combine(tempDir.Path, ".env"); 130var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 131var envPath = Path.Combine(tempDir.Path, ".env"); 158var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 193var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 242var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 244var envPath = Path.Combine(tempDir.Path, ".env"); 255var envFilePath = Path.Combine(tempDir.Path, ".env"); 286var envFilePath = Path.Combine(tempDir.Path, ".env"); 341var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 367var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 393var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 421var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 453var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml"); 478var dockerfilePath = Path.Combine(tempDir.Path, "testcontainer.Dockerfile"); 502var composePath = Path.Combine(tempDir.Path, "docker-compose.yaml");
DockerComposeTests.cs (4)
54var composeFile = Path.Combine(tempDir.FullName, "docker-compose.yaml"); 79var composeFile = Path.Combine(tempDir.FullName, "docker-compose.yaml"); 162var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml"); 196var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml");
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
Aspire.Hosting.Garnet.Tests (4)
AddGarnetTests.cs (1)
241Assert.Equal(Path.Combine(builder.AppHostDirectory, "mygarnetdata"), volumeAnnotation.Source);
GarnetFunctionalTests.cs (3)
126bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Kafka.Tests (4)
AddKafkaTests.cs (1)
142Assert.Equal(Path.Combine(appBuilder.AppHostDirectory, "kafka-data"), volumeAnnotation.Source);
KafkaFunctionalTests.cs (3)
140bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Keycloak (2)
KeycloakResourceBuilderExtensions.cs (2)
162var importFullPath = Path.GetFullPath(import, builder.ApplicationBuilder.AppHostDirectory); 190var 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 (6)
KubernetesPublishingContext.cs (5)
90var resourceDockerfilePath = Path.Combine(OutputPath, $"{serviceResource.TargetResource.Name}.Dockerfile"); 161var templatesFolder = Path.Combine(OutputPath, "templates", resource.Name); 167var outputFile = Path.Combine(templatesFolder, fileName); 195var outputFile = Path.Combine(OutputPath!, "values.yaml"); 215var outputFile = Path.Combine(OutputPath, "Chart.yaml");
src\Shared\PublishingContextUtils.cs (1)
18return Path.Combine(context.OutputPath, environment.Name);
Aspire.Hosting.Kubernetes.Tests (15)
KubernetesEnvironmentResourceTests.cs (3)
28var chartYaml = Path.Combine(tempDir.FullName, "Chart.yaml"); 29var valuesYaml = Path.Combine(tempDir.FullName, "values.yaml"); 30var deploymentYaml = Path.Combine(tempDir.FullName, "templates", "service", "deployment.yaml");
KubernetesPublisherTests.cs (10)
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");
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
Aspire.Hosting.Maui (6)
MauiWindowsExtensions.cs (3)
101if (!Path.IsPathRooted(projectPath)) 104Path.Combine(builder.ApplicationBuilder.AppHostDirectory, projectPath)); 107var workingDirectory = Path.GetDirectoryName(projectPath)
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
Aspire.Hosting.Maui.Tests (6)
MauiWindowsExtensionsTests.cs (4)
240var tempFile = Path.GetTempFileName(); 241var tempProjectFile = Path.ChangeExtension(tempFile, ".csproj"); 376var nonExistentFile = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".csproj");
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
Aspire.Hosting.Milvus.Tests (3)
MilvusFunctionalTests.cs (3)
97bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
242var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.MongoDB.Tests (11)
MongoDbFunctionalTests.cs (11)
137bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 259var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 264var initFilePath = Path.Combine(bindMountPath, "mongo-init.js"); 357var initFilesPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 362var initFilePath = Path.Combine(initFilesPath, "mongo-init.js");
Aspire.Hosting.MySql (2)
MySqlBuilderExtensions.cs (2)
370var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory); 378var filePath = Path.GetTempFileName();
Aspire.Hosting.MySql.Tests (8)
MySqlFunctionalTests.cs (8)
306var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 312File.WriteAllText(Path.Combine(bindMountPath, "init.sql"), """ 393var initFilesPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 399File.WriteAllText(Path.Combine(initFilesPath, "init.sql"), """
Aspire.Hosting.NodeJs (12)
NodeExtensions.cs (9)
42workingDirectory ??= Path.GetDirectoryName(scriptPath)!; 43workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 74workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 128workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 169if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile"))) 265var nvmrcPath = Path.Combine(workingDirectory, ".nvmrc"); 277var nodeVersionPath = Path.Combine(workingDirectory, ".node-version"); 289var packageJsonPath = Path.Combine(workingDirectory, "package.json"); 314var toolVersionsPath = Path.Combine(workingDirectory, ".tool-versions");
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
Aspire.Hosting.NodeJs.Tests (17)
AddViteAppTests.cs (13)
18var viteDir = Path.Combine(builder.AppHostDirectory, "vite"); 49var dockerfilePath = Path.Combine(builder.AppHostDirectory, "vite.Dockerfile"); 82File.WriteAllText(Path.Combine(tempDir.Path, "package.json"), packageJson); 90var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 102File.WriteAllText(Path.Combine(tempDir.Path, ".nvmrc"), "18.20.0"); 110var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 122File.WriteAllText(Path.Combine(tempDir.Path, ".node-version"), "v21.5.0"); 130var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 147File.WriteAllText(Path.Combine(tempDir.Path, ".tool-versions"), toolVersions); 155var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 173var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile")); 189File.WriteAllText(Path.Combine(tempDir.Path, ".nvmrc"), versionString); 197var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "vite.Dockerfile"));
NodeAppFixture.cs (3)
32var scriptPath = Path.Combine(_nodeAppPath, "app.js"); 76File.WriteAllText(Path.Combine(tempDir, "app.js"), 96File.WriteAllText(Path.Combine(tempDir, "package.json"),
ResourceCreationTests.cs (1)
44Assert.Equal(Path.Combine(builder.AppHostDirectory, "test"), resource.WorkingDirectory);
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
146var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.Oracle.Tests (2)
OracleFunctionalTests.cs (2)
275File.WriteAllText(Path.Combine(bindMountPath, "01_init.sql"), $""" 367File.WriteAllText(Path.Combine(initFilesPath, "01_init.sql"), $"""
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
420var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.PostgreSQL.Tests (13)
AddPostgresTests.cs (2)
555Assert.Equal(".toml", Path.GetExtension(file.Name)); 562Assert.Equal(".toml", Path.GetExtension(file.Name));
PostgresFunctionalTests.cs (11)
224bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 367var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 373File.WriteAllText(Path.Combine(bindMountPath, "init.sql"), """ 455var initFilesPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 461File.WriteAllText(Path.Combine(initFilesPath, "init.sql"), """
Aspire.Hosting.Python (13)
PythonAppResourceBuilderExtensions.cs (6)
289var resource = new PythonAppResource(name, "python", Path.GetFullPath(appDirectory, builder.AppHostDirectory)); 368? Path.GetFullPath(entrypoint, resource.WorkingDirectory) 414if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile"))) 456var uvLockPath = Path.Combine(resource.WorkingDirectory, "uv.lock"); 671var virtualEnvironment = new VirtualEnvironment(Path.IsPathRooted(virtualEnvironmentPath) 673: Path.GetFullPath(virtualEnvironmentPath, builder.Resource.WorkingDirectory));
PythonVersionDetector.cs (2)
20var pythonVersionFile = Path.Combine(appDirectory, ".python-version"); 31var pyprojectFile = Path.Combine(appDirectory, "pyproject.toml");
src\Shared\PathNormalizer.cs (3)
16path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 18return Path.GetFullPath(path);
VirtualEnvironment.cs (2)
21return Path.Join(virtualEnvironmentPath, "Scripts", name + ".exe"); 24return Path.Join(virtualEnvironmentPath, "bin", name);
Aspire.Hosting.Python.Tests (65)
AddPythonAppTests.cs (58)
24var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 28options.ProjectDirectory = Path.GetFullPath(projectDirectory); 62var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 66options.ProjectDirectory = Path.GetFullPath(projectDirectory); 161Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 165Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 199Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 203Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 241Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 245Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 259var projectDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 271var pythonExecutable = Path.Combine(projectDirectory, 282var scriptPath = Path.Combine(projectDirectory, "main.py"); 285var requirementsPath = Path.Combine(projectDirectory, "requirements.txt"); 289var dockerFilePath = Path.Combine(projectDirectory, "Dockerfile"); 323var relativePipPath = Path.Combine( 328var pipPath = Path.GetFullPath(relativePipPath, projectDirectory); 403var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 407Assert.Equal(Path.Join(expectedProjectDirectory, "custom-venv", "Scripts", "python.exe"), pythonProjectResource.Command); 411Assert.Equal(Path.Join(expectedProjectDirectory, "custom-venv", "bin", "python"), pythonProjectResource.Command); 438Assert.Equal(Path.Join(tempVenvDir.Path, "Scripts", "python.exe"), pythonProjectResource.Command); 442Assert.Equal(Path.Join(tempVenvDir.Path, "bin", "python"), pythonProjectResource.Command); 526var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 681var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 686Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 690Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 715var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 719Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 723Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 749var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, tempDir.Path)); 753Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", $"{executableName}.exe"), pythonProjectResource.Command); 757Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", executableName), pythonProjectResource.Command); 961File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 962File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent); 963File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 965var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 984var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 987var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile"); 990var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile"); 1026File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 1028File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 1030var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 1049var scriptDockerfilePath = Path.Combine(outputDir.Path, "script-app.Dockerfile"); 1052var moduleDockerfilePath = Path.Combine(outputDir.Path, "module-app.Dockerfile"); 1055var executableDockerfilePath = Path.Combine(outputDir.Path, "executable-app.Dockerfile"); 1081var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1083var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1113var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1115var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv"); 1144var appDirectory = Path.Combine(tempDir.Path, "myapp"); 1146var virtualEnvironmentPath = Path.Combine(tempDir.Path, ".venv");
AddUvicornAppTests.cs (5)
43File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 44File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent); 45File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 47var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 73var appDockerfilePath = Path.Combine(outputDir.Path, "main.Dockerfile");
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
Aspire.Hosting.Qdrant.Tests (3)
QdrantFunctionalTests.cs (3)
115bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Redis.Tests (4)
AddRedisTests.cs (1)
599Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
RedisFunctionalTests.cs (3)
277var bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
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)
183var path = Path.Combine(source, dir);
Aspire.Hosting.SqlServer.Tests (3)
SqlServerFunctionalTests.cs (3)
156bindMountPath = 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 (4)
TestingBuilderTests.cs (2)
48Path.Combine(MSBuildUtils.GetRepoRoot(), "artifacts", "bin", "TestProject.AppHost"), 54var 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")))
Aspire.Hosting.Tests (110)
AspireStoreTests.cs (9)
17Assert.True(Directory.Exists(Path.GetDirectoryName(store.BasePath))); 27Assert.True(Path.IsPathRooted(path)); 34builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath(); 40Assert.DoesNotContain($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}", path); 41Assert.Contains(Path.GetTempPath(), path); 58builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath(); 76var tempFilename = Path.GetTempFileName(); 132builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath();
Dashboard\DashboardLifecycleHookTests.cs (14)
196var tempDir = Path.GetTempFileName(); 202var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 203var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 289var tempDir = Path.GetTempFileName(); 295var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard.exe"); 296var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 297var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 361var tempDir = Path.GetTempFileName(); 367var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard"); // No extension for Unix 368var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 369var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 433var tempDir = Path.GetTempFileName(); 439var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 440var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json");
Dashboard\DashboardResourceTests.cs (3)
34var dashboardPath = Path.GetFullPath("dashboard"); 169var dashboardPath = Path.GetFullPath("dashboard.dll"); 465var dashboardPath = Path.GetFullPath("dashboard");
DistributedApplicationOptionsTests.cs (4)
83var expectedPath = Path.GetFullPath(Path.Join(projectDirectory, "CustomName")); 127var expectedPath = Path.GetFullPath(Path.Join(projectDirectory, "ExplicitlySetName"));
DistributedApplicationTests.cs (2)
1032var sourcePath = Path.GetFullPath("/etc/path-here"); 1079Assert.True(Path.IsPathRooted(redisContainer.Spec.VolumeMounts[0].Source));
ExecutableResourceBuilderExtensionTests.cs (2)
22var expectedPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 48var expectedPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory));
ManifestGenerationTests.cs (2)
557var manifestPath = Path.Combine(Path.GetTempPath(), "tempmanifests", Guid.NewGuid().ToString(), "manifest.json");
MSBuildTests.cs (18)
22var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost"); 25File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 53File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 78var appHostDirectory = Path.Combine(tempDirectory.Path, "AppHost"); 81File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 108File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 118var metadataDirectory = Path.Combine(appHostDirectory, "obj", "Debug", "net8.0", "Aspire", "references"); 119var appHostMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "_AppHost.ProjectMetadata.g.cs")); 120var appMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "App.ProjectMetadata.g.cs")); 133.Replace(Path.DirectorySeparatorChar, '/'); 141File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"), 151File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"), 162var libraryDirectory = Path.Combine(basePath, name); 165File.WriteAllText(Path.Combine(libraryDirectory, $"{name}.csproj"), 177File.WriteAllText(Path.Combine(libraryDirectory, "Class1.cs"), 189var appDirectory = Path.Combine(basePath, name); 192File.WriteAllText(Path.Combine(appDirectory, $"{name}.csproj"), 203File.WriteAllText(Path.Combine(appDirectory, "Program.cs"),
Pipelines\DistributedApplicationPipelineTests.cs (2)
833options.OutputPath = Path.GetTempPath(); 874options.OutputPath = Path.GetTempPath();
ProjectResourceTests.cs (6)
44var projectDirectoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 45var projectFilePath = Path.Combine(projectDirectoryPath, "Project.csproj"); 46var propertiesDirectoryPath = Path.Combine(projectDirectoryPath, "Properties"); 47var launchSettingsFilePath = Path.Combine(propertiesDirectoryPath, "launchSettings.json");
PublishAsDockerfileTests.cs (8)
217var projectPath = Path.Combine(path, "project.csproj"); 274var projectPath = Path.Combine(path, "project.csproj"); 291var projectPath = Path.Combine(path, "project.csproj"); 311var projectPath = Path.Combine(path, "project.csproj"); 334var projectPath = Path.Combine(path, "project.csproj"); 410var projectPath = Path.Combine(path, "project.csproj"); 428var projectPath = Path.Combine(path, "project.csproj"); 453File.WriteAllText(Path.Join(tempDir.Path, "Dockerfile"), "this does not matter");
Publishing\ResourceContainerImageBuilderTests.cs (10)
206var tempOutputPath = Path.GetTempPath(); 250OutputPath = Path.Combine(tempDir.Path, "NewFolder"), // tests that the folder is created if it doesn't exist 404var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar; 594var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar; 611Assert.False(buildCall.contextPath.EndsWith(Path.DirectorySeparatorChar.ToString())); 612Assert.False(buildCall.contextPath.EndsWith(Path.AltDirectorySeparatorChar.ToString())); 615Assert.Equal(Path.GetFullPath(tempContextPath), Path.GetFullPath(buildCall.contextPath)); 735var tempFile = Path.GetTempFileName();
PublishingTests.cs (1)
30Assert.True(Path.IsPathFullyQualified(context.OutputPath));
Schema\SchemaTests.cs (16)
48var tempPath = Path.GetTempPath(); 49var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName()); 51var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 60var tempPath = Path.GetTempPath(); 61var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName()); 63var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 78var tempPath = Path.GetTempPath(); 79var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName()); 81var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 112var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 208var relativePath = Path.Combine("Schema", "aspire-8.0.json"); 209var schemaPath = Path.GetFullPath(relativePath); 221var builder = TestDistributedApplicationBuilder.Create(["--publisher", "manifest", "--output-path", Path.Combine(manifestDir, "not-used.json")]);
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
UserSecretsParameterDefaultTests.cs (1)
76var 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 (2)
34var context = new ManifestPublishingContext(executionContext, Path.Combine(manifestDirectory, "manifest.json"), writer); 54var 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)
84bindMountPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Aspire.Hosting.Yarp.Tests (3)
tests\Shared\TestModuleInitializer.cs (2)
16? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots") 23directory: Path.Combine(projectDirectory, target),
YarpConfigGeneratorTests.cs (1)
293var composeFile = Path.Combine(tempDir.Path, "docker-compose.yaml");
Aspire.Playground.Tests (5)
Infrastructure\DistributedApplicationExtensions.cs (2)
231var projectDirectory = Path.GetDirectoryName(project.GetProjectMetadata().ProjectPath) ?? throw new UnreachableException(); 237var projectAssemblyPath = Path.Combine(projectDirectory, "bin", configuration, "net8.0", $"{projectName}.dll");
Infrastructure\ResourceExtensions.cs (1)
16return Path.GetFileNameWithoutExtension(metadata.ProjectPath);
tests\Aspire.TestUtilities\FileUtil.cs (2)
10public static string? FindFullPathFromPath(string command) => FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists); 44var fullPath = Path.Combine(directory, command);
Aspire.Templates.Tests (70)
AppHostTemplateTests.cs (1)
27var projectPath = Path.Combine(project.RootDir, $"{projectId}.csproj");
BuildAndRunTemplateTests.cs (1)
93var cpmFilePath = Path.Combine(project.RootDir, "Directory.Packages.props");
NewUpAndBuildSupportProjectTemplatesTests.cs (2)
16var topLevelDir = Path.Combine(BuildEnvironment.TestRootPath, id + "_root"); 45project.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)!) 151File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "EndPointWriterHook_cs"), Path.Combine(project.AppHostProjectDirectory, "EndPointWriterHook.cs")); 152string programCsPath = Path.Combine(project.AppHostProjectDirectory, "AppHost.cs"); 251_testOutput.WriteLine($"----------- [{Path.GetFileName(AppHostProjectDirectory)}] app has exited -------------"); 330workingDirectory ??= Path.Combine(RootDir, $"{Id}.AppHost"); 334var res = await restoreCmd.ExecuteAsync($"restore \"-bl:{Path.Combine(LogPath!, $"{Id}-restore.binlog")}\" /p:TreatWarningsAsErrors=true"); 337var 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"); 84var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName); 87sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath); 92string workloadsProjString = Path.Combine("tests", "workloads.proj"); 103.Split(Path.PathSeparator) 104.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 110sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 116BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping"); 126.Split(Path.PathSeparator) 127.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 133sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 143string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath); 149sdkForTemplatePath = Path.Combine(baseDir, sdkDirName); 164sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath); 166NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null; 174EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"; 187DotNet = Path.Combine(sdkForTemplatePath!, "dotnet"); 195LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath); 200LogRootPath = 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 (2)
FileUtil.cs (2)
10public static string? FindFullPathFromPath(string command) => FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists); 44var fullPath = Path.Combine(directory, command);
AspireWithNode.AppHost (7)
DevCertHostingExtensions.cs (7)
44var certFileName = Path.GetFileName(certPath); 45var certKeyFileName = Path.GetFileName(certKeyPath); 47var bindSource = Path.GetDirectoryName(certPath) ?? throw new UnreachableException(); 80var tempDir = Path.Combine(Path.GetTempPath(), $"aspire.{appNameHash}"); 81var certExportPath = Path.Combine(tempDir, "dev-cert.pem"); 82var certKeyExportPath = Path.Combine(tempDir, "dev-cert.key");
AutobahnTestApp (1)
Program.cs (1)
63var certPath = Path.Combine(AppContext.BaseDirectory, "TestResources", "testCert.pfx");
Binding.UDS.IntegrationTests (4)
UDSBindingTests.cs (4)
210return Path.Combine(Path.GetTempPath(), "unix1.txt"); 215return Path.Combine(Path.GetTempPath(), "invalid.txt");
blazor-devserver (6)
Server\Program.cs (5)
28var applicationDirectory = Path.GetDirectoryName(applicationPath)!; 29var name = Path.ChangeExtension(applicationPath, ".staticwebassets.runtime.json"); 30name = !File.Exists(name) ? Path.ChangeExtension(applicationPath, ".StaticWebAssets.xml") : name; 32var endpointsManifest = Path.ChangeExtension(applicationPath, ".staticwebassets.endpoints.json"); 45config.AddJsonFile(Path.Combine(applicationDirectory, "blazor-devserversettings.json"), optional: true, reloadOnChange: true);
Server\Startup.cs (1)
45var fileExtension = Path.GetExtension(ctx.Request.Path);
BoundTreeGenerator (1)
Program.cs (1)
23Console.Error.WriteLine("Usage: \"{0} <language> <input> <output>\", where <language> is \"VB\" or \"CSharp\"", Path.GetFileNameWithoutExtension(args[0]));
BuildActionTelemetryTable (6)
Program.cs (5)
24private static readonly string s_executingPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 65var filepath = Path.GetFullPath("ActionTable.txt"); 78var filepath = Path.GetFullPath("CodeActionDescriptions.Review.cs"); 103var rootedPath = Path.IsPathRooted(path) 105: Path.GetFullPath(path);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
BuildBoss (48)
CompilerNuGetCheckerUtil.cs (15)
95var publishDataPath = Path.Combine(RepositoryDirectory, "eng", "config", "PublishData.json"); 101var packagesDirectory = Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"); 104var packageFileName = Path.GetFileName(packageFullPath); 143FindNuGetPackage(Path.Combine(ArtifactsDirectory, "VSSetup", Configuration, "DevDivPackages"), "VS.Tools.Roslyn"), 161FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset.Arm64"), 170FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset.Framework"), 179FindNuGetPackage(Path.Combine(ArtifactsDirectory, "packages", Configuration, "Shipping"), "Microsoft.Net.Compilers.Toolset"), 215=> Path.Combine(ArtifactsDirectory, "bin", projectName, Configuration, tfm); 218=> Path.Combine(ArtifactsDirectory, "bin", projectName, Configuration, tfm, "publish"); 254buildAssetRelativePath = Path.Combine(folderRelativePath, buildAssetRelativePath); 361var packageFilePath = FindNuGetPackage(Path.Combine(ArtifactsDirectory, "VSSetup", Configuration, "DevDivPackages"), "VS.ExternalAPIs.Roslyn"); 384if (Path.GetExtension(name) is not (".dll" or ".exe")) 389foundDllNameSet.Add(Path.GetFileNameWithoutExtension(name)); 431var fileName = Path.GetFileName(filePath); 441var directory = Path.Combine(ArtifactsDirectory, "VSSetup", Configuration);
Extensions.cs (1)
25internal static string GetName(this PackagePart part) => Path.GetFileName(GetRelativeName(part));
OptProfCheckerUtil.cs (3)
29OptProfFile = Path.Combine(RepositoryDirectory, "eng", "config", "OptProf.json"); 62string vsixRoot = Path.Combine(ArtifactsDirectory, "VSSetup", Configuration, "Insertion"); 63string vsixFullPath = Path.Combine(vsixRoot, vsixName);
Program.cs (7)
68(solutionFiles.Count > 0) ? Path.GetDirectoryName(solutionFiles[0]) : AppContext.BaseDirectory); 88while (dir != null && !File.Exists(Path.Combine(dir, "global.json"))) 90dir = Path.GetDirectoryName(dir); 101allGood &= ProcessSolution(Path.Combine(repositoryDirectory, solutionFileName), isPrimarySolution: solutionFileName == primarySolution); 104var artifactsDirectory = Path.Combine(repositoryDirectory, "artifacts"); 144var targetsDirectory = Path.Combine(repositoryDirectory, @"eng\targets"); 151var logFilePath = Path.Combine(artifactsDirectory, $@"log\{configuration}\Build.binlog");
ProjectCheckerUtil.cs (1)
164?? Path.GetFileNameWithoutExtension(projectData.FileName);
ProjectData.cs (4)
19internal string FileName => Path.GetFileName(FilePath); 20internal string Directory => Path.GetDirectoryName(FilePath); 24internal bool IsUnitTestProject => Path.GetFileNameWithoutExtension(FilePath).EndsWith(".UnitTests"); 25internal bool IsIntegrationTestProject => Path.GetFileNameWithoutExtension(FilePath).EndsWith(".IntegrationTests");
ProjectEntry.cs (1)
51switch (Path.GetExtension(path))
ProjectKey.cs (2)
16internal string FileName => FilePath != null ? Path.GetFileName(FilePath) : ""; 20FilePath = Path.GetFullPath(filePath);
ProjectUtil.cs (4)
26internal bool IsUnitTestProject => Path.GetFileNameWithoutExtension(Key.FilePath).EndsWith(".UnitTests"); 27internal bool IsIntegrationTestProject => Path.GetFileNameWithoutExtension(Key.FilePath).EndsWith(".IntegrationTests"); 113var directory = Path.GetDirectoryName(Key.FilePath); 135var path = Path.Combine(directory, relativePath);
SharedUtil.cs (4)
21internal static bool IsSolutionFile(string path) => Path.GetExtension(path) == ".sln"; 22internal static bool IsPropsFile(string path) => Path.GetExtension(path) == ".props"; 23internal static bool IsTargetsFile(string path) => Path.GetExtension(path) == ".targets"; 24internal static bool IsXslt(string path) => Path.GetExtension(path) == ".xslt";
SolutionCheckerUtil.cs (4)
36SolutionPath = Path.GetDirectoryName(SolutionFilePath); 90var projectFilePath = Path.Combine(SolutionPath, projectEntry.RelativeFilePath); 150if (Path.GetExtension(projectKey.FileName) == ".shproj") 155var directory = Path.GetDirectoryName(projectKey.FilePath);
StructuredLoggerCheckerUtil.cs (1)
37if (doubleWrites.Any(doubleWrite => Path.GetFileName(doubleWrite.Key) != "Microsoft.VisualStudio.Text.Internal.dll"))
TargetsCheckerUtil.cs (1)
28var fileName = Path.GetFileName(filePath);
BuildValidator (37)
CompilationDiff.cs (18)
219File.WriteAllText(Path.Combine(debugPath, "error.txt"), MiscErrorMessage); 227using var writer = new StreamWriter(Path.Combine(debugPath, "diagnostics.txt"), append: false); 237using var writer = new StreamWriter(Path.Combine(debugPath, "references.txt"), append: false); 282var originalDataFiles = createBuildArtifacts(Path.Combine(debugPath, "original"), assemblyFileName, originalInfo); 283var rebuildDataFiles = createBuildArtifacts(Path.Combine(debugPath, "rebuild"), assemblyFileName, rebuildInfo); 295File.WriteAllText(Path.Combine(debugPath, scriptName), $@"code --diff (Join-Path $PSScriptRoot ""{originalFilePath}"") (Join-Path $PSScriptRoot ""{rebuildFilePath}"")"); 299var sourcesPath = Path.Combine(debugPath, "sources"); 305var sourceFilePath = Path.Combine(sourcesPath, Path.GetFileName(tree.FilePath)); 315var assemblyName = Path.GetFileNameWithoutExtension(assemblyFileName); 316var assemblyFilePath = Path.Combine(outputPath, assemblyFileName); 318AssemblyMdvFilePath: Path.Combine(outputPath, assemblyName + ".mdv"), 319PdbMdvFilePath: Path.Combine(outputPath, assemblyName + ".pdb.mdv"), 320ILFilePath: Path.Combine(outputPath, assemblyName + ".il"), 321PdbXmlFilePath: Path.Combine(outputPath, assemblyName + ".pdb.xml"), 322CustomDataFilePath: Path.Combine(outputPath, "custom-data.txt")); 330var pdbFilePath = Path.Combine(outputPath, assemblyName + ".extracted.pdb"); 405writer.WriteLine($@"\t""{Path.GetFileName(info.SourceTextInfo.OriginalSourceFilePath)}"" - {hashString}");
IldasmUtilities.cs (2)
27var directory = Path.GetDirectoryName(typeof(IldasmUtilities).GetTypeInfo().Assembly.Location) ?? throw new DirectoryNotFoundException(); 46return Path.Combine(directory, "runtimes", ridName, "native", ildasmExeName);
LocalReferenceResolver.cs (4)
91nugetPackageDirectory ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget"); 124if (Path.GetFileName(filePath) != metadataReferenceInfo.FileName) 126filePath = Path.Combine(Path.GetDirectoryName(filePath)!, metadataReferenceInfo.FileName);
LocalSourceResolver.cs (2)
36onDiskPath = Path.GetFullPath(Path.Combine(Options.SourcePath, originalFilePath.Substring(link.Prefix.Length)));
Program.cs (8)
105debugPath ??= Path.Combine(Path.GetTempPath(), $"BuildValidator"); 109excludes.Add(Path.DirectorySeparatorChar + "runtimes" + Path.DirectorySeparatorChar); 129var fullDebugPath = Path.GetFullPath(debugPath); 249var debugPath = Path.Combine( 252Path.GetFileNameWithoutExtension(assemblyInfo.FileName)); 253logger.LogInformation($@"Writing diffs to ""{Path.GetFullPath(debugPath)}""");
Records.cs (3)
12internal string FileName => Path.GetFileName(FilePath); 13internal string TargetFramework => Path.GetFileName(Path.GetDirectoryName(FilePath))!;
CatalogService (1)
CatalogApi.cs (1)
40var path = Path.Combine(environment.ContentRootPath, "Images", item.PictureFileName);
ClientSample (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
CodeStyleConfigFileGenerator (4)
Program.cs (3)
68var configDir = Path.Combine(outputDir, "config"); 91var configFilePath = Path.Combine(directory.FullName, configFileName); 205var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
ConfigurationSchemaGenerator (1)
ConfigSchemaGenerator.cs (1)
47var docPath = Path.ChangeExtension(path, "xml");
ConfigurationSchemaGenerator.Tests (2)
GeneratorTests.cs (2)
1595var outputPath = Path.Combine(Directory.GetCurrentDirectory(), "IntegrationTest.json"); 1603var baseline = File.ReadAllText(Path.Combine("Baselines", "IntegrationTest.baseline.json")).ReplaceLineEndings();
containerize.UnitTests (13)
ParserTests.cs (12)
15DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"), nameof(CanParseLabels))); 58DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"), nameof(CanParseLabels))); 94DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"), nameof(CanParseLabels))); 126DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"), nameof(CanParseEnvironmentVariables))); 170DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"), nameof(CanParsePorts))); 215DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"), nameof(CanParsePorts)));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Crossgen2Tasks (49)
CommonFilePulledFromSdkRepo\RuntimeGraphCache.cs (1)
30if (!Path.IsPathRooted(runtimeJsonPath))
PrepareForReadyToRunCompilation.cs (17)
135var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath); 145outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb"); 146outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb"); 147crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\""; 167outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension); 168outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension); 169crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\""; 233MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec)); 236compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, "r2r" + Path.GetExtension(compositeR2RImageRelativePath)); 237var compositeR2RImage = Path.Combine(OutputPath, compositeR2RImageRelativePath); 251compositePDBImage = Path.ChangeExtension(compositeR2RImage, ".ni.pdb"); 252compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb"); 257compositePDBImage = Path.ChangeExtension(compositeR2RImage, perfmapExtension); 258compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension); 387bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec))); 388bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R;
ResolveReadyToRunCompilers.cs (26)
256_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 257_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 258_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 263_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 264_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 265_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 272_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 273_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 274_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 284_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 285_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 286_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 291_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 292_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 295_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 299_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 311_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 312_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 321_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 322_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 327_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 328_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 337_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 338_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 369_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 376_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
RunReadyToRunCompiler.cs (5)
232if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 324result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 329result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 391Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
csc (14)
src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 114var tempDir = Path.GetTempPath();
src\Compilers\Shared\BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\Csc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
CSharpSyntaxGenerator (5)
Program.cs (5)
104var outputMainFile = Path.Combine(outputLocation.Trim('"'), $"CSharp.Generated.g4"); 143var prefix = Path.GetFileName(inputFile); 144var outputMainFile = Path.Combine(outputPath, $"{prefix}.Main.Generated.cs"); 145var outputInternalFile = Path.Combine(outputPath, $"{prefix}.Internal.Generated.cs"); 146var outputSyntaxFile = Path.Combine(outputPath, $"{prefix}.Syntax.Generated.cs");
csi (3)
Csi.cs (3)
24string csiDirectory = Path.GetDirectoryName(typeof(Csi).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 30tempDir: Path.GetTempPath()); 33responseFile: Path.Combine(csiDirectory, InteractiveResponseFileName),
CustomEncryptorSample (1)
Program.cs (1)
14var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
dotnet (509)
BuildServer\BuildServerProvider.cs (2)
57Path.GetFileName(path).StartsWith(RazorPidFile.FilePrefix)) 77Path.Combine(
BuildServer\VBCSCompilerServer.cs (4)
19internal static readonly string VBCSCompilerPath = Path.Combine( 20Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), 41var toolsetPackageDirectory = Path.Join(nuGetPackageRoot, s_toolsetPackageName); 47var vbcsCompilerPath = Path.Join(versionDirectory, s_vbcsCompilerExeFileName);
BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
CommandDirectoryContext.cs (2)
21? Path.GetFullPath(path, _basePath) 22: Path.GetFullPath(path);
CommandFactory\CommandResolution\AppBaseDllCommandResolver.cs (1)
21var localPath = Path.Combine(AppContext.BaseDirectory,
CommandFactory\CommandResolution\DepsJsonCommandResolver.cs (9)
136Path.GetFileNameWithoutExtension(p).Equals(commandName, StringComparison.OrdinalIgnoreCase))); 142p => Path.GetFileNameWithoutExtension(p) 164.FirstOrDefault(p => Path.GetExtension(p.RelativeCommandPath) 199var commandDir = Path.GetDirectoryName(commandPath); 232return Path.Combine( 233nugetPackageRoot.Replace('/', Path.DirectorySeparatorChar), 234PackageName.Replace('/', Path.DirectorySeparatorChar), 235PackageVersion.Replace('/', Path.DirectorySeparatorChar), 236RelativeCommandPath.Replace('/', Path.DirectorySeparatorChar));
CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (2)
16_dotnetToolPath = Path.Combine(AppContext.BaseDirectory, 32var packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, arguments.CommandName));
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)
169var depsFileRoot = Path.GetDirectoryName(toolLockFile.Path)!; 286var depsJsonPath = Path.Combine( 330var tempDepsFile = Path.Combine(PathUtilities.CreateTempSubdirectory(), Path.GetRandomFileName()); 359buildRelativePath = Path.GetDirectoryName(buildRelativePath)!; 361string platformLibraryBuildFolderPath = Path.Combine(platformLibraryPath, buildRelativePath); 378Path.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)
33entryPointFileFullPath: Path.GetFullPath(appFilePath),
Commands\CommandFactory.cs (1)
37return configureVirtualCommand(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)
34var exeName = Path.GetFileName(result.GetValue(InternalReportInstallSuccessCommandParser.Argument));
Commands\New\BuiltInTemplatePackageProvider.cs (8)
47var sdkDirectory = Path.GetDirectoryName(typeof(Utils.DotnetFiles).Assembly.Location); 48var dotnetRootPath = Path.GetDirectoryName(Path.GetDirectoryName(sdkDirectory)); 51string templatesRootFolder = Path.GetFullPath(Path.Combine(dotnetRootPath, "templates")); 58.Select(versionedFolder => Path.Combine(templatesRootFolder, versionedFolder))); 62string templatesDir = Path.Combine(sdkDirectory, "Templates"); 79if (SemanticVersion.TryParse(Path.GetFileName(directory), out SemanticVersion versionInfo))
Commands\New\MSBuildEvaluation\MSBuildEvaluationResult.cs (1)
24string extension = Path.GetExtension(projectPath);
Commands\New\MSBuildEvaluation\MSBuildEvaluator.cs (2)
32_projectFullPath = projectPath != null ? Path.GetFullPath(projectPath) : null; 105projectPath = Path.GetFullPath(foundFiles.Single());
Commands\New\OptionalWorkloadProvider.cs (4)
36var sdkDirectory = Path.GetDirectoryName(typeof(DotnetFiles).Assembly.Location); 37var sdkVersion = Path.GetFileName(sdkDirectory); 38var dotnetRootPath = Path.GetDirectoryName(Path.GetDirectoryName(sdkDirectory));
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 (3)
45filesToAdd.Add(Path.GetFullPath(templateCreationResult.PrimaryOutputs[index].Path, outputBasePath)); 60filesToAdd.Add(Path.GetFullPath(pathString, outputBasePath)); 77IReadOnlyList<string> projectFiles = GetConfiguredFiles(action.Args, creationEffects, "projectFiles", outputBasePath, (path) => Path.GetExtension(path).EndsWith("proj", StringComparison.OrdinalIgnoreCase));
Commands\New\SdkInfoProvider.cs (3)
49sdks = NETCoreSdkResolverNativeWrapper.GetAvailableSdks(dotnetDir).Select(Path.GetFileName); 55string sdkDir = Path.Combine(dotnetDir, "sdk"); 56sdks = Directory.Exists(sdkDir) ? Directory.GetDirectories(sdkDir).Select(Path.GetFileName).Where(IsValidFxVersion) : [];
Commands\Pack\PackCommand.cs (3)
45entryPointFileFullPath: Path.GetFullPath(appFilePath), 111packArgs.BasePath = Path.GetDirectoryName(packArgs.Path); 138if (args.Count > 0 && Path.GetExtension(args[0]).Equals(".nuspec", StringComparison.OrdinalIgnoreCase))
Commands\Package\Add\PackageAddCommand.cs (2)
51tempDgFilePath = Path.GetTempFileName(); 174var fullPath = Path.GetFullPath(path);
Commands\Package\List\PackageListCommand.cs (2)
27return Path.GetFullPath(Path.Combine(currentDirectory, relativePath));
Commands\Package\Remove\PackageRemoveCommand.cs (1)
69var fullPath = Path.GetFullPath(path);
Commands\Project\Convert\ProjectConvertCommand.cs (14)
22string file = Path.GetFullPath(_file); 41var targetFile = Path.Join(targetDirectory, Path.GetFileName(file)); 55string projectFile = Path.Join(targetDirectory, Path.GetFileNameWithoutExtension(file) + ".csproj"); 70string targetItemFullPath = Path.Combine(targetDirectory, item.RelativePath); 78string targetItemDirectory = Path.GetDirectoryName(targetItemFullPath)!; 114string entryPointFileDirectory = PathUtility.EnsureTrailingSlash(Path.GetDirectoryName(file)!); 138string itemFullPath = Path.GetFullPath(path: item.GetMetadataValue("FullPath"), basePath: entryPointFileDirectory); 150string itemRelativePath = Path.GetRelativePath(relativeTo: entryPointFileDirectory, path: itemFullPath); 158string defaultValue = Path.ChangeExtension(file, null); 159string defaultValueRelative = Path.GetRelativePath(relativeTo: Environment.CurrentDirectory, defaultValue); 181error = string.Format(CliCommandStrings.DirectoryAlreadyExists, Path.GetFullPath(path)); 185result = path is null ? null : Path.GetFullPath(path);
Commands\Publish\PublishCommand.cs (1)
48entryPointFileFullPath: Path.GetFullPath(appFilePath),
Commands\Reference\Add\ReferenceAddCommand.cs (1)
76Path.GetRelativePath(
Commands\Reference\Remove\ReferenceRemoveCommand.cs (2)
38var fullPath = Path.GetFullPath(p); 44return Path.GetRelativePath(
Commands\Restore\RestoreCommand.cs (1)
31entryPointFileFullPath: Path.GetFullPath(appFilePath),
Commands\Run\CommonRunHelpers.cs (2)
26=> Path.Combine(directoryPath, propertiesDirectoryName, "launchSettings.json"); 29=> Path.Join(directoryPath, $"{projectNameWithoutExtension}.run.json");
Commands\Run\CSharpCompilerCommand.cs (18)
43private static string DotNetRootPath => field ??= Path.GetDirectoryName(Path.GetDirectoryName(SdkPath)!)!; 44private static string ClientDirectory => field ??= Path.Combine(SdkPath, "Roslyn", "bincore"); 53public string BaseDirectory => field ??= Path.GetDirectoryName(EntryPointFileFullPath)!; 85tempDirectory: Path.GetTempPath(), 160rspPath = Path.Join(ArtifactsPath, "csc.rsp"); 168string fileDirectory = Path.GetDirectoryName(EntryPointFileFullPath) ?? string.Empty; 169string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(EntryPointFileFullPath); 173string objDir = Path.Join(ArtifactsPath, "obj", "debug"); 175string binDir = Path.Join(ArtifactsPath, "bin", "debug"); 178string assemblyAttributes = Path.Join(objDir, $".NETCoreApp,Version=v{TargetFrameworkVersion}.AssemblyAttributes.cs"); 190string globalUsings = Path.Join(objDir, $"{fileNameWithoutExtension}.GlobalUsings.g.cs"); 206string assemblyInfo = Path.Join(objDir, $"{fileNameWithoutExtension}.AssemblyInfo.cs"); 236string editorconfig = Path.Join(objDir, $"{fileNameWithoutExtension}.GeneratedMSBuildEditorConfig.editorconfig"); 258build_property.ProjectDir = {fileDirectory}{Path.DirectorySeparatorChar} 267var apphostTarget = Path.Join(binDir, $"{fileNameWithoutExtension}{FileNameSuffixes.CurrentPlatform.Exe}"); 271var apphostSource = Path.Join(SdkPath, "..", "..", "packs", $"Microsoft.NETCore.App.Host.{rid}", RuntimeVersion, "runtimes", rid, "native", $"apphost{FileNameSuffixes.CurrentPlatform.Exe}"); 279var runtimeConfig = Path.Join(binDir, $"{fileNameWithoutExtension}{FileNameSuffixes.RuntimeConfigJson}");
Commands\Run\RunCommand.cs (14)
254var buildPathContainer = Path.GetDirectoryName(projectOrEntryPointFilePath)!; 261if (string.Equals(Path.GetExtension(projectOrEntryPointFilePath), ".vbproj", StringComparison.OrdinalIgnoreCase)) 273string appName = Path.GetFileNameWithoutExtension(projectOrEntryPointFilePath); 462command.EnvironmentVariable(rootVariableName, Path.GetDirectoryName(new Muxer().MuxerPath)); 469var exePath = Path.Join(artifactsPath, "bin", "debug", Path.GetFileNameWithoutExtension(entryPointFileFullPath) + FileNameSuffixes.CurrentPlatform.Exe); 472.WorkingDirectory(Path.GetDirectoryName(entryPointFileFullPath)); 526entryPointFilePath = Path.GetFullPath(filePath); 541if (Path.DirectorySeparatorChar != '\\') 597arg = Path.GetFullPath(arg); 680string directory = VirtualProjectBuildingCommand.GetTempSubpath(Path.GetRandomFileName()); 682entryPointFilePath = Path.Join(directory, "app.cs"); 882? Path.GetDirectoryName(ProjectFileFullPath) 887if (Directory.Exists(Path.Combine(currentDir, ".git")))
Commands\Run\RunTelemetry.cs (1)
103? Path.GetRelativePath(repoRoot, projectFilePath)
Commands\Run\VirtualProjectBuildingCommand.cs (16)
110Debug.Assert(Path.IsPathFullyQualified(entryPointFileFullPath)); 728string implicitBuildFilePath = Path.Join(directory.FullName, implicitBuildFile.Name); 749var successCacheFile = new FileInfo(Path.Join(artifactsDirectory, BuildSuccessCacheFileName)); 757var startCacheFile = new FileInfo(Path.Join(artifactsDirectory, BuildStartCacheFileName)); 884return DeserializeCacheEntry(Path.Join(ArtifactsPath, BuildSuccessCacheFileName)); 1025File.WriteAllText(Path.Join(directory, BuildStartCacheFileName), EntryPointFileFullPath); 1035string successCacheFile = Path.Join(ArtifactsPath, BuildSuccessCacheFileName); 1066var projectFileFullPath = Path.ChangeExtension(EntryPointFileFullPath, ".csproj"); 1088string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 1102? Path.GetTempPath() 1105return Path.Join(directory, "dotnet", "runfile"); 1113return Path.Join(GetTempSubdirectory(), name); 1358var targetDirectory = Path.GetDirectoryName(targetFilePath) ?? ""; 1875var sourceDirectory = Path.GetDirectoryName(context.SourceFile.Path) ?? "."; 1876var resolvedProjectPath = Path.Combine(sourceDirectory, directiveText.Replace('\\', '/')); 1880directiveText = Path.GetRelativePath(relativeTo: sourceDirectory, fullFilePath);
Commands\Sdk\Check\SdkCheckCommand.cs (1)
31var configFilePath = Path.Combine(_dotnetPath, "sdk", dotnetVersion ?? Product.Version, "sdk-check-config.json");
Commands\Solution\Add\SolutionAddCommand.cs (15)
30return "/" + string.Join("/", PathUtility.GetPathWithDirectorySeparator(path).Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) + "/"; 36&& !Path.IsPathRooted(relativePath) // This means path is in a different volume 63var fullPath = Path.GetFullPath(project); 84relativeSolutionFolderPath = Path.GetDirectoryName(relativeProjectPath); 88if (relativeSolutionFolderPath.Split(Path.DirectorySeparatorChar).LastOrDefault() == Path.GetFileNameWithoutExtension(relativeProjectPath)) 90relativeSolutionFolderPath = Path.Combine([.. relativeSolutionFolderPath.Split(Path.DirectorySeparatorChar).SkipLast(1)]); 146string solutionRelativeProjectPath = Path.GetRelativePath(Path.GetDirectoryName(_solutionFileFullPath)!, fullProjectPath); 162string projectTypeGuid = solution.ProjectTypes.FirstOrDefault(t => t.Extension == Path.GetExtension(fullProjectPath))?.ProjectTypeId.ToString() 169string projectFileName = Path.GetFileName(solutionRelativeProjectPath); 179p => IsInSameFolderHierarchy(p.Parent, rootFolder) && Path.GetFileName(p.FilePath).Equals(projectFileName, StringComparison.OrdinalIgnoreCase)); 248.Select(item => Path.GetFullPath(item.EvaluatedInclude, Path.GetDirectoryName(fullProjectPath)!));
Commands\Solution\List\SolutionListCommand.cs (1)
40.Select(folder => Path.GetDirectoryName(folder.Path.TrimStart('/')))];
Commands\Solution\Migrate\SolutionMigrateCommand.cs (1)
27string 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), 77if (project is null && !Path.HasExtension(projectPath)) 79var projectsMatchByName = solution.SolutionProjects.Where(p => Path.GetFileNameWithoutExtension(p.DisplayName).Equals(projectPath));
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)
115string.Join(Environment.NewLine, vsTestTestProjects.Select(module => Path.GetFileName(module.ProjectFullPath))).Red().Bold()));
Commands\Test\MTP\MSBuildUtility.cs (5)
33Path.GetDirectoryName(solutionModel.Description)! : 42ConcurrentBag<ParallelizableTestModuleGroupWithSequentialInnerModules> projects = GetProjectsProperties(collection, evaluationContext, solutionModel.SolutionProjects.Select(p => Path.Combine(rootDirectory, p.FilePath)), buildOptions); 80resultsDirectory = Path.GetFullPath(resultsDirectory); 86configFile = Path.GetFullPath(configFile); 92diagnosticOutputDirectory = Path.GetFullPath(diagnosticOutputDirectory);
Commands\Test\MTP\SolutionAndProjectUtility.cs (12)
40string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]); 41string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]); 66string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]); 67string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]); 156return (false, string.Format(CliStrings.SolutionDoesNotExist, directory + Path.DirectorySeparatorChar)); 161return (false, string.Format(CliStrings.MoreThanOneSolutionInDirectory, directory + Path.DirectorySeparatorChar)); 214string? fileDirectory = Path.GetDirectoryName(solutionOrProjectFilePath); 227Logger.LogTrace($"Loaded project '{Path.GetFileName(projectFilePath)}' with TargetFramework '{targetFramework}', TargetFrameworks '{targetFrameworks}', IsTestProject '{projectInstance.GetPropertyValue(ProjectProperties.IsTestProject)}', and '{ProjectProperties.IsTestingPlatformApplication}' is '{projectInstance.GetPropertyValue(ProjectProperties.IsTestingPlatformApplication)}'."); 257Logger.LogTrace($"Loaded inner project '{Path.GetFileName(projectFilePath)}' has '{ProjectProperties.IsTestingPlatformApplication}' = '{projectInstance.GetPropertyValue(ProjectProperties.IsTestingPlatformApplication)}' (TFM: '{framework}')."); 271Logger.LogTrace($"Loaded inner project '{Path.GetFileName(projectFilePath)}' has '{ProjectProperties.IsTestingPlatformApplication}' = '{projectInstance.GetPropertyValue(ProjectProperties.IsTestingPlatformApplication)}' (TFM: '{framework}')."); 334var 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)
19public string AssemblyName { get; } = Path.GetFileName(assembly)!;
Commands\Test\MTP\TestApplication.cs (1)
122processStartInfo.Environment[Module.DotnetRootArchVariableName] = Path.GetDirectoryName(new Muxer().MuxerPath);
Commands\Test\MTP\ValidationUtility.cs (3)
118if (!CliConstants.SolutionExtensions.Contains(Path.GetExtension(path))) 136if (!Path.GetExtension(path).EndsWith("proj", StringComparison.OrdinalIgnoreCase)) 149Reporter.Error.WriteLine(string.Format(CliCommandStrings.CmdNonExistentFileErrorDescription, Path.GetFullPath(filePath)));
Commands\Test\TestCommandParser.cs (2)
208string globalJsonPath = Path.Combine(directory, "global.json"); 214directory = Path.GetDirectoryName(directory);
Commands\Test\VSTest\TestCommand.cs (2)
262string 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 (1)
149throw new GracefulException(string.Format(CliCommandStrings.ToolInstallNuGetConfigurationFileDoesNotExist, Path.GetFullPath(_configFilePath)));
Commands\Tool\Install\ToolInstallLocalInstaller.cs (1)
56Path.GetFullPath(_configFilePath)));
Commands\Workload\Clean\WorkloadCleanCommand.cs (3)
92var bandedDotnetPath = Path.Exists(Path.Combine(_dotnetPath, "sdk", sdkVersion)) ? _dotnetPath : defaultDotnetWinPath; 94if (!Path.Exists(bandedDotnetPath))
Commands\Workload\GlobalJsonWorkloadSetFile.cs (2)
13public string Path { get; } = System.IO.Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "globaljsonworkloadsets.json"); 24Directory.CreateDirectory(System.IO.Path.GetDirectoryName(Path));
Commands\Workload\Install\FileBasedInstaller.cs (51)
58_dotnetDir = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath); 69_workloadMetadataDir = Path.Combine(_workloadRootDir, "metadata", "workloads"); 103var workloadSetPath = Path.Combine(_workloadRootDir, "sdk-manifests", workloadSetFeatureBand.ToString(), "workloadsets", workloadSetVersion); 133var tempExtractionDir = Path.Combine(_tempPackagesDir.Value, $"{WorkloadManifestUpdater.WorkloadSetManifestId}-{workloadSetPackageVersion}-extracted"); 175var packagePath = Path.Combine(offlineCache.Value.Value, $"{packInfo.ResolvedPackageId}.{packInfo.Version}.nupkg"); 192if (!Directory.Exists(Path.GetDirectoryName(packInfo.Path))) 194Directory.CreateDirectory(Path.GetDirectoryName(packInfo.Path)); 203var tempExtractionDir = Path.Combine(_tempPackagesDir.Value, $"{packInfo.ResolvedPackageId}-{packInfo.Version}-extracted"); 270return Path.Combine(_workloadRootDir, "sdk-manifests", sdkFeatureBand); 275var newManifestPath = Path.Combine(GetManifestInstallDirForFeatureBand(manifestUpdate.NewFeatureBand), manifestUpdate.ManifestId.ToString(), manifestUpdate.NewVersion.ToString()); 317packagePath = Path.Combine(offlineCache.Value.Value, $"{packageId}.{packageVersion}.nupkg"); 327tempBackupDir = Path.Combine(_tempPackagesDir.Value, $"{packageId} - {packageVersion}-backup"); 363var versionDir = Path.GetDirectoryName(packagePath); 367var idDir = Path.GetDirectoryName(versionDir); 406var installedSdkFeatureBands = NETCoreSdkResolverNativeWrapper.GetAvailableSdks(_dotnetDir).Select(sdkDir => new SdkFeatureBand(Path.GetFileName(sdkDir))).ToHashSet(); 451string workloadSetDirectory = Path.Combine(GetManifestInstallDirForFeatureBand(workloadSetFeatureBand.ToString()), SdkDirectoryWorkloadManifestProvider.WorkloadSetsFolderName, workloadSetVersion); 492var manifestPath = Path.Combine(GetManifestInstallDirForFeatureBand(manifestFeatureBand.ToString()), manifestId.ToString(), manifestVersion.ToString()); 538var installationRecordDirectory = Path.GetDirectoryName(GetPackInstallRecordPath(packId, packVersion, featureBandsToRemove.First())); 549string packIdDirectory = Path.GetDirectoryName(installationRecordDirectory); 589string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, _workloadRootDir), "default.json"); 590Directory.CreateDirectory(Path.GetDirectoryName(path)); 626return Path.Combine(_workloadMetadataDir, RuntimeInformation.ProcessArchitecture.ToString(), _sdkFeatureBand.ToString(), HistoryDir); 633string logFile = Path.Combine(historyDirectory, $"{workloadHistoryRecord.TimeStarted:yyyy'-'MM'-'dd'T'HHmmss}_{workloadHistoryRecord.CommandName}.json"); 663var extractionPath = Path.Combine(_tempPackagesDir.Value, "dotnet-sdk-advertising-temp", $"{Path.GetFileName(nupkgPath)}-extracted"); 677Directory.CreateDirectory(Path.GetDirectoryName(targetPath)); 678FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(Path.Combine(extractionPath, "data"), targetPath)); 713var packIdDir = Path.GetDirectoryName(packInfo.Path); 726Path.Combine(_workloadMetadataDir, InstalledWorkloadSetsDir, "v1", workloadSetVersion, workloadSetFeatureBand.ToString(), referencingFeatureBand.ToString()); 731Directory.CreateDirectory(Path.GetDirectoryName(path)); 746var installedWorkloadSetsDir = Path.Combine(_workloadMetadataDir, InstalledWorkloadSetsDir, "v1"); 755var workloadSetVersion = Path.GetFileName(workloadSetVersionDir); 758var workloadSetFeatureBand = new SdkFeatureBand(Path.GetFileName(workloadSetFeatureBandDir)); 761var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 777Path.Combine(_workloadMetadataDir, InstalledManifestsDir, "v1", manifestId.ToString(), manifestVersion.ToString(), featureBand.ToString(), referencingFeatureBand.ToString()); 782Directory.CreateDirectory(Path.GetDirectoryName(path)); 797var installedManifestsDir = Path.Combine(_workloadMetadataDir, InstalledManifestsDir, "v1"); 806var manifestId = new ManifestId(Path.GetFileName(manifestIdDir)); 809var manifestVersion = new ManifestVersion(Path.GetFileName(manifestVersionDir)); 812var manifestFeatureBand = new SdkFeatureBand(Path.GetFileName(manifestFeatureBandDir)); 815var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(featureBandInstallationRecord)); 833Path.Combine(_workloadMetadataDir, InstalledPacksDir, "v1", packId, packVersion, featureBand.ToString()); 839var installedPacksDir = Path.Combine(_workloadMetadataDir, InstalledPacksDir, "v1"); 848var packId = new WorkloadPackId(Path.GetFileName(packIdDir)); 851var packVersion = Path.GetFileName(packVersionDir); 854var referencingFeatureBand = new SdkFeatureBand(Path.GetFileName(bandRecord)); 873if (!Directory.Exists(Path.GetDirectoryName(path))) 875Directory.CreateDirectory(Path.GetDirectoryName(path)); 887var packRecordVersionDir = Path.GetDirectoryName(packInstallRecord); 892var packRecordIdDir = Path.GetDirectoryName(packRecordVersionDir); 903var packInstallRecordDir = Path.Combine(_workloadMetadataDir, InstalledPacksDir, "v1", packInfo.Id, packInfo.Version);
Commands\Workload\Install\MsiInstallerBase.cs (27)
48public static readonly string WorkloadDataRoot = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads"); 121string dotNetHome = Path.Combine(Environment.GetFolderPath(programFiles), "dotnet"); 200string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, DotNetHome), "default.json"); 228string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, DotNetHome), "default.json"); 262SecurityUtils.CreateSecureDirectory(Path.GetDirectoryName(workloadSetsFile.Path)); 284SecurityUtils.CreateSecureDirectory(Path.GetDirectoryName(workloadSetsFile.Path)); 377return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "dotnet", "workloads", RuntimeInformation.ProcessArchitecture.ToString(), sdkFeatureBand.ToString(), "history"); 383string logFile = Path.Combine(historyDirectory, $"{workloadHistoryRecord.TimeStarted:yyyy'-'MM'-'dd'T'HHmmss}_{workloadHistoryRecord.CommandName}.json"); 410return Path.Combine(Path.GetDirectoryName(Log.LogPath), 411Path.GetFileNameWithoutExtension(Log.LogPath) + $"_{packInfo.ResolvedPackageId}-{packInfo.Version}_{action}.log"); 422return Path.Combine(Path.GetDirectoryName(Log.LogPath), 423Path.GetFileNameWithoutExtension(Log.LogPath) + $"_{msi.Manifest.Payload}_{action}.log"); 434return Path.Combine(Path.GetDirectoryName(Log.LogPath), 435Path.GetFileNameWithoutExtension(Log.LogPath) + $"_{productCode}_{action}.log"); 445return Path.Combine(Path.GetDirectoryName(Log.LogPath), 446Path.GetFileNameWithoutExtension(Log.LogPath) + $"_{Path.GetFileNameWithoutExtension(msiPath)}_AdminInstall.log"); 457return Path.Combine(Path.GetDirectoryName(Log.LogPath), 458Path.GetFileNameWithoutExtension(Log.LogPath) + $"_{record.MsiId}-{record.MsiNuGetVersion}_{action}.log"); 546string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, DotNetHome), "default.json"); 583string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, DotNetHome), "default.json"); 609SecurityUtils.CreateSecureDirectory(Path.GetDirectoryName(path));
Commands\Workload\Install\NetSdkMsiInstallerClient.cs (12)
369string installationFolder = Path.Combine(DotNetHome, "sdk-manifests", workloadSetFeatureBand.ToString(), "workloadsets", workloadSetVersion); 761string extractedManifestPath = Path.Combine(extractionPath, "data", "extractedManifest"); 765Directory.CreateDirectory(Path.GetDirectoryName(targetPath)); 770string packageDataPath = Path.Combine(extractionPath, "data"); 775string msiExtractionPath = Path.Combine(extractionPath, "msi"); 795var manifestsFolder = Path.Combine(msiExtractionPath, "dotnet", "sdk-manifests"); 944packagePath = Path.Combine(offlineCache.Value.Value, $"{packageId}.{packageVersion}.nupkg"); 955string extractionDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 1001string manifestPath = Path.Combine(extractedPackageRootPath, "data", "msi.json"); 1122shouldLog ? new TimestampedFileLogger(Path.Combine(Path.GetTempPath(), string.Create(CultureInfo.InvariantCulture, $"Microsoft.NET.Workload_{Environment.ProcessId}_{DateTime.Now:yyyyMMdd_HHmmss_fff}.log")))
Commands\Workload\Install\NetSdkMsiInstallerClient.InstallRecords.cs (4)
134string sdkManifestFolder = Path.Combine(DotNetHome, "sdk-manifests"); 138if (!ReleaseVersion.TryParse(Path.GetFileName(manifestFeatureBandFolder), out ReleaseVersion releaseVersion)) 153var lowerCasedManifestID = Path.GetFileName(manifestIDFolder); 158string manifestVersionString = Path.GetFileName(manifestVersionFolder);
Commands\Workload\Install\NetSdkMsiInstallerClient.PackGroup.cs (1)
42var packGroupFile = Path.Combine(manifest.ManifestDirectory, "WorkloadPackGroups.json");
Commands\Workload\Install\WorkloadGarbageCollector.cs (1)
83var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _dotnetDir), "default.json");
Commands\Workload\Install\WorkloadInstallCommand.cs (1)
225var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _workloadRootDir), "default.json");
Commands\Workload\Install\WorkloadInstallerFactory.cs (6)
30dotnetDir = string.IsNullOrWhiteSpace(dotnetDir) ? Path.GetDirectoryName(Environment.ProcessPath) : dotnetDir; 66dotnetDir ??= Path.GetDirectoryName(Environment.ProcessPath); 69var testPath = Path.Combine(dotnetDir, "metadata", Path.GetRandomFileName()); 70if (Directory.Exists(Path.GetDirectoryName(testPath))) 76Directory.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\RegistryWorkloadInstallationRecordRepository.cs (3)
56string workloadInstallationKeyName = Path.Combine(BasePath, $"{sdkFeatureBand}", $"{workloadId}"); 83using RegistryKey wrk = _baseKey.OpenSubKey(Path.Combine(BasePath, $"{sdkFeatureBand}")); 100string subkeyName = Path.Combine(BasePath, $"{sdkFeatureBand}", $"{workloadId}");
Commands\Workload\Install\WorkloadManifestUpdater.cs (16)
63var dotnetPath = Path.GetDirectoryName(Environment.ProcessPath); 130string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "default.json"); 141if (Directory.Exists(Path.GetDirectoryName(filePath))) 143Directory.CreateDirectory(Path.GetDirectoryName(filePath)); 183var workloadSetVersionFilePath = Path.Combine(advertisedPath, Constants.workloadSetVersionFileName); 227var overlayProvider = new TempDirectoryWorkloadManifestProvider(Path.Combine(_userProfileDir, "sdk-advertising", _sdkFeatureBand.ToString()), _sdkFeatureBand.ToString()); 326Path.GetFileName(path).StartsWith(manifestPackageId.ToString(), StringComparison.OrdinalIgnoreCase) && 344File.WriteAllText(Path.Combine(adManifestPath, "AdvertisedManifestFeatureBand.txt"), band.ToString()); 357File.WriteAllText(Path.Combine(adManifestPath, Constants.workloadSetVersionFileName), workloadSetVersion); 380var versionDir = Path.GetDirectoryName(packagePath); 385var idDir = Path.GetDirectoryName(versionDir); 413var manifestPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "WorkloadManifest.json"); 423var adManifestFeatureBandPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "AdvertisedManifestFeatureBand.txt"); 521private string GetAdvertisingManifestSentinelPath(SdkFeatureBand featureBand) => Path.Combine(_userProfileDir, $".workloadAdvertisingManifestSentinel{featureBand}"); 525private static string GetAdvertisingWorkloadsFilePath(string userProfileDir, SdkFeatureBand featureBand) => Path.Combine(userProfileDir, $".workloadAdvertisingUpdates{featureBand}"); 527private string GetAdvertisingManifestPath(SdkFeatureBand featureBand, ManifestId manifestId) => Path.Combine(_userProfileDir, "sdk-advertising", featureBand.ToString(), manifestId.ToString());
Commands\Workload\Install\WorkloadResolverFactory.cs (1)
36result.DotnetPath = Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\InstallingWorkloadCommand.cs (4)
176string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkFeatureBand, _workloadRootDir), "default.json"); 372tempPath = new DirectoryPath(Path.Combine(TempDirectoryPath, "dotnet-manifest-extraction")); 373string extractedManifestsPath = Path.Combine(tempPath.Value.Value, "manifests"); 401await _workloadInstaller.ExtractManifestAsync(downloadedPackagePath, Path.Combine(extractedManifestsPath, download.Id));
Commands\Workload\Restore\WorkloadRestoreCommand.cs (7)
123.Where(s => Path.GetExtension(s).Equals(".sln", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(s).Equals(".slnx", StringComparison.OrdinalIgnoreCase)) 124.Select(Path.GetFullPath)]; 126.Where(s => Path.GetExtension(s).EndsWith("proj", StringComparison.OrdinalIgnoreCase)) 127.Select(Path.GetFullPath)]; 134p => Path.GetFullPath(p.FilePath, Path.GetDirectoryName(solutionFilePath))));
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (1)
73dotnetDir: Path.GetDirectoryName(Environment.ProcessPath),
Commands\Workload\WorkloadCommandBase.cs (1)
111TempPackagesDirectory = new DirectoryPath(Path.Combine(TempDirectoryPath, "dotnet-sdk-advertising-temp"));
Commands\Workload\WorkloadCommandParser.cs (2)
70var useWorkloadSets = InstallStateContents.FromPath(Path.Combine(WorkloadInstallType.GetInstallStateFolder(workloadInfoHelper._currentSdkFeatureBand, workloadInfoHelper.UserLocalPath), "default.json")).ShouldUseWorkloadSets(); 98string dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\WorkloadInfoHelper.cs (1)
37DotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
CommonOptions.cs (4)
452var sdkPath = dotnetRootPath is not null ? Path.Combine(dotnetRootPath, "sdk") : "sdk"; 455string runtimeIdentifierChainPath = string.IsNullOrEmpty(Product.Version) || !Directory.Exists(Path.Combine(sdkPath, Product.Version)) ? 456Path.Combine(Directory.GetDirectories(sdkPath)[0], ridFileName) : 457Path.Combine(sdkPath, Product.Version, ridFileName);
CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
Installer\Windows\InstallerBase.cs (2)
99protected static string SdkDirectory => Path.GetFileName(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
Installer\Windows\MsiPackageCache.cs (12)
33? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads") 68string msiPath = Path.Combine(Path.GetDirectoryName(manifestPath), Path.GetFileName(msiManifest.Payload)); 70string cachedMsiPath = Path.Combine(packageDirectory, Path.GetFileName(msiPath)); 71string cachedManifestPath = Path.Combine(packageDirectory, Path.GetFileName(manifestPath)); 90return Path.Combine(PackageCacheRoot, packageId, packageVersion); 120manifestPath = Path.Combine(packageDataPath, "msi.json"); 133string possibleMsiPath = Path.Combine(Path.GetDirectoryName(manifestPath), msiManifest.Payload);
Installer\Windows\MsiPayload.cs (1)
48public string Name => Path.GetFileName(MsiPath);
Installer\Windows\Security\Signature.cs (1)
91fixed (char* p = Path.GetFullPath(path))
Installer\Windows\TimestampedFileLogger.cs (2)
67Directory.CreateDirectory(Path.GetDirectoryName(path)); 69LogPath = Path.GetFullPath(path);
MsbuildProject.cs (2)
285string fullPath = Path.GetFullPath(reference); 287ret.Add(Path.GetRelativePath(ProjectDirectory, fullPath));
NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
NuGetForwardingApp.cs (1)
40return Path.Combine(
NugetPackageDownloader\NuGetPackageDownloader.cs (12)
125Directory.CreateDirectory(Path.GetDirectoryName(nupkgPath)); 196_reporter.WriteLine(CliStrings.VerifyingNuGetPackageSignature, Path.GetFileNameWithoutExtension(nupkgPath)); 201_reporter.WriteLine(CliStrings.NuGetPackageShouldNotBeSigned, Path.GetFileNameWithoutExtension(nupkgPath)); 215return Path.Combine( 250Path.GetRelativePath(targetFolder.Value, p).Equals("data/UnixFilePermissions.xml", 260Path.Combine(targetFolder.Value, fileAndPermission.Path), 320return Path.GetRelativePath(targetPath, p).StartsWith("tools" + Path.DirectorySeparatorChar) && 321(Path.GetFileName(p) == Path.GetFileNameWithoutExtension(p)); 341allowListNuspec.Contains(Path.GetFileName(f), comparer: StringComparer.OrdinalIgnoreCase))) 381string nugetConfigFileName = Path.GetFileName(packageSourceLocation.NugetConfig.Value.Value);
NugetPackageDownloader\PackageSourceLocation.cs (2)
42if (!Uri.IsWellFormedUriString(feed, UriKind.Absolute) && !Path.IsPathRooted(feed)) 44localFeedsThatIsRooted[index] = Path.GetFullPath(feed, basePath);
Parser.cs (1)
198var filePath = Path.GetFullPath(tokenToReplace);
PerformanceLogEventListener.cs (1)
74string logFilePath = Path.Combine(logDirectory, $"perf-{Environment.ProcessId}-{Guid.NewGuid().ToString("N")}.log");
PerformanceLogManager.cs (2)
43Instance._perfLogRoot = Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, PerfLogRoot); 70CurrentLogDirectory = Path.Combine(_perfLogRoot, Guid.NewGuid().ToString("N"));
PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
Program.cs (1)
145IFileSentinel toolPathSentinel = new FileSentinel(new FilePath(Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, ToolPathSentinelFileName)));
ReleasePropertyProjectLocator.cs (10)
115return new VirtualProjectBuildingCommand(Path.GetFullPath(arg), MSBuildArgs.FromProperties(globalProps)) 150string slnFullPath = Path.GetFullPath(slnPath); 151if (!Path.Exists(slnFullPath)) 179string projectFullPath = Path.GetFullPath(project.FilePath, Path.GetDirectoryName(slnFullPath)); 223string projectFullPath = Path.GetFullPath(project.FilePath, Path.GetDirectoryName(slnPath)); 266return File.Exists(path) && Path.GetExtension(path).EndsWith("proj"); 272return File.Exists(path) && (Path.GetExtension(path).Equals(".sln") || Path.GetExtension(path).Equals(".slnx"));
RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
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))
SlnFileFactory.cs (6)
23if (string.IsNullOrWhiteSpace(slnFileOrDirectory) || slnFileOrDirectory.IndexOfAny(Path.GetInvalidPathChars()) != -1) 29return Path.GetFullPath(slnFileOrDirectory); 46return Path.GetFullPath(files.Single()); 95originalSolutionPathAbsolute = Path.GetFullPath(originalSolutionPath, Path.GetDirectoryName(filteredSolutionPath)); 120.Select(path => path.Replace('\\', Path.DirectorySeparatorChar))
SudoEnvironmentDirectoryOverride.cs (3)
60var userSettingsDir = Path.Combine(homeBeforeOverride, ".nuget", "NuGet"); 63.Select(fileName => Path.Combine(userSettingsDir, fileName)) 67var 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\MacAddressGetter.cs (1)
92FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "getmac.exe"),
Telemetry\PersistenceChannel\StorageService.cs (10)
92_storageDirectoryPath = Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, 97if (!Path.IsPathRooted(desireStorageDirectoryPath)) 163File.Delete(Path.Combine(StorageFolder, item.FileName)); 219File.Move(Path.Combine(StorageFolder, tempFileName), Path.Combine(StorageFolder, newFileName)); 231using (Stream stream = File.OpenWrite(Path.Combine(StorageFolder, file))) 251using (Stream stream = File.OpenRead(Path.Combine(StorageFolder, file))) 300using (FileStream stream = File.OpenRead(Path.Combine(StorageFolder, file))) 339DateTime creationTime = File.GetCreationTimeUtc(Path.Combine(StorageFolder, file)); 343File.Delete(Path.Combine(StorageFolder, file));
Telemetry\PersistenceChannel\StorageTransmission.cs (1)
20FileName = Path.GetFileName(fullPath);
Telemetry\TelemetryCommonProperties.cs (1)
81Path.Combine(
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)
27cacheDirectory ?? 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 (7)
57_runtimeJsonPath = runtimeJsonPathForTests ?? Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "RuntimeIdentifierGraph.json"); 281CreateAssetFile(packageId, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 291CreateAssetFile(ridSpecificPackage, packageVersion, packageDownloadDir, Path.Combine(assetFileDirectory.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 308CreateAssetFile(packageId, packageVersion, _localToolDownloadDir, Path.Combine(_localToolAssetDir.Value, ToolPackageInstance.AssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 318Path.Combine(_localToolAssetDir.Value, ToolPackageInstance.RidSpecificPackageAssetsFileName), _runtimeJsonPath, verbosity, targetFramework); 380var runtimeConfigFilePath = Path.ChangeExtension(toolPackageInstance.Command.Executable.Value, ".runtimeconfig.json");
ToolPackage\ToolPackageInstance.cs (2)
104var toolsPackagePath = Path.Combine(installPath, "tools"); 106.Select(path => NuGetFramework.ParseFolder(Path.GetFileName(path))).ToList();
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)),
WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
dotnet.Tests (1419)
BuildServerTests\BuildServerProviderTests.cs (8)
76.Be(Path.Combine( 86var pidDirectory = Path.Combine(fileSystem.Directory.CreateTemporaryDirectory().DirectoryPath, "path/to/some/directory"); 104string pidDirectory = Path.GetFullPath("var/pids/build"); 105string pidFilePath = Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}{ProcessId}"); 109var serverPath = Path.Combine(fileSystemMockBuilder.TemporaryFolder, "path/to/rzc.dll"); 115Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}not-a-pid-file"), 145string pidDirectory = Path.GetFullPath("var/pids/build"); 146string pidFilePath = Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}{ProcessId}");
BuildServerTests\RazorServerTests.cs (9)
26string pidDirectory = Path.GetFullPath("var/pids/build"); 27string pidFilePath = Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}{ProcessId}"); 29var serverPath = Path.GetFullPath("path/to/rzc.dll"); 65string pidDirectory = Path.GetFullPath("var/pids/build"); 66string pidFilePath = Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}{ProcessId}"); 68var serverPath = Path.GetFullPath("path/to/rzc.dll"); 99string pidDirectory = Path.GetFullPath("var/pids/build"); 100string pidFilePath = Path.Combine(pidDirectory, $"{RazorPidFile.FilePrefix}{ProcessId}"); 102var serverPath = Path.GetFullPath("path/to/rzc.dll");
BundledTargetFramworkTests.cs (1)
20var filePath = Path.Combine(
CommandFactoryTests\CommandResolverTestUtils.cs (1)
14var filePath = Path.Combine(directory, filename + extension);
CommandFactoryTests\GivenADotnetToolsCommandResolver.cs (1)
17var dotnetToolPath = Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "DotnetTools");
CommandFactoryTests\GivenALocalToolsCommandResolver.cs (5)
32new DirectoryPath(Path.Combine(temporaryDirectory, "cache"))); 87_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 120_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 161_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename), 183_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, ManifestFilename),
CommandFactoryTests\GivenAnAppBaseCommandResolver.cs (4)
63var commandFile = Path.GetFileNameWithoutExtension(result.Path); 74var testDir = Path.Combine(AppContext.BaseDirectory, "appbasetestsubdir"); 149var commandFile = Path.GetFileName(result.Path); 174var commandFile = Path.GetFileName(result.Path);
CommandFactoryTests\GivenAProjectDependencyCommandResolver.cs (5)
19Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "MSBuild.dll")); 52var commandFile = Path.GetFileNameWithoutExtension(result.Path); 135var outputDir = Path.Combine(testAsset.Path, "out"); 154var depsFilePath = Path.Combine(outputDir, "TestAppWithProjDepTool.deps.json"); 166Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "MSBuild.dll"));
CommandFactoryTests\GivenAProjectPathCommandResolver.cs (7)
13private static readonly string s_testProjectDirectory = Path.Combine(AppContext.BaseDirectory, "testprojectdirectory"); 72var testDir = Path.Combine(s_testProjectDirectory, "projectpathtestsubdir"); 106var commandFile = Path.GetFileNameWithoutExtension(result.Path); 140var extensionTestDir = Path.Combine(s_testProjectDirectory, "testext" + extension); 156var commandFileName = Path.GetFileName(result.Path); 204var commandFile = Path.GetFileName(result.Path); 230var commandFile = Path.GetFileName(result.Path);
CommandFactoryTests\GivenAProjectToolsCommandResolver.cs (12)
127var commandFile = Path.GetFileNameWithoutExtension(result.Path); 242var directory = Path.GetDirectoryName(lockFilePath); 246.FirstOrDefault(p => Path.GetFileName(p).EndsWith(FileNameSuffixes.DepsJson)); 282var depsJsonFile = Path.GetTempFileName(); 332var fallbackFolder = Path.Combine(testProjectDirectory, "fallbackFolder"); 357var fallbackFolder = Path.Combine(testProjectDirectory, "fallbackFolder"); 358var nugetPackages = Path.Combine(testProjectDirectory, "nugetPackages"); 377Directory.Delete(Path.Combine(fallbackFolder, "dotnet-fallbackfoldertool"), true); 387var nugetConfigPath = Path.Combine(testProjectDirectory, "NuGet.Config"); 395Directory.Delete(Path.Combine(fallbackFolder, ".tools"), true); 400var nugetConfig = Path.Combine(testInstance.Path, "NuGet.Config"); 432return Path.Combine(TestContext.Current.ToolsetUnderTest.SdksPath, "Microsoft.NET.Sdk", "targets", "GenerateDeps", "GenerateDeps.proj");
CommandTests\Build\GivenDotnetBuildBuildsCsproj.cs (9)
33var outputDll = Path.Combine(outputPathCalculator.GetOutputDirectory(configuration: configuration), $"{testAppName}.dll"); 77string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); 105string responseFilePath = Path.Combine(testInstance.Path, "Directory.Build.rsp"); 219.WithWorkingDirectory(Path.Combine(testInstance.Path, testProject.Name ?? string.Empty)) 278new DotnetBuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name ?? string.Empty)) 310.WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name ?? string.Empty)) 382Path.Combine(CliFolderPathCalculator.DotnetHomePath, ".dotnet", "NuGetFallbackFolder") 389if (nugetRoot is not null && absoluteNuGetPath.StartsWith(nugetRoot + Path.DirectorySeparatorChar)) 392.Replace(Path.DirectorySeparatorChar, '/');
CommandTests\BuildServer\Shutdown\BuildServerShutdownCommandTests.cs (1)
163var pipeName = Path.GetRandomFileName();
CommandTests\MSBuild\GivenDotnetStoreInvocation.cs (2)
60string path = Path.Combine("some", "path"); 65.GetArgumentTokensToMSBuild().Should().BeEquivalentTo([..ExpectedPrefix, $"--property:ComposeDir={Path.GetFullPath(path)}", "--property:_CommandLineDefinedOutputPath=true"]);
CommandTests\MSBuild\GivenDotnetVsTestForwardingApp.cs (2)
21string dummyPath = Path.Join(Path.GetTempPath(), "vstest.custom.console.dll");
CommandTests\MSBuild\TestPathUtilities.cs (3)
11=> Path.Combine( 14: Path.DirectorySeparatorChar.ToString(), 15directoryName ?? "TestWorkDir") + Path.DirectorySeparatorChar;
CommandTests\New\DotnetAddPostActionTests.cs (23)
38string projFileFullPath = Path.Combine(targetBasePath, "MyApp.proj"); 52string fooprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fooproj"); 67string fooprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fooproj"); 82string fooprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fooproj"); 85string barprojFileFullPath = Path.Combine(targetBasePath, "MyApp.barproj"); 88string csprojFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 91string fsprojFileFullPath = Path.Combine(targetBasePath, "MyApp.fsproj"); 106string projFileFullPath = Path.Combine(targetBasePath, "MyApp.xproj"); 109string outputBasePath = Path.Combine(targetBasePath, "ChildDir", "GrandchildDir"); 122string projFileFullPathOne = Path.Combine(targetBasePath, "MyApp.anysproj"); 125string projFileFullPathTwo = Path.Combine(targetBasePath, "MyApp2.someproj"); 139string projFileFullPathOne = Path.Combine(targetBasePath, "MyApp.fooproj"); 142string projFileFullPathTwo = Path.Combine(targetBasePath, "MyApp2.barproj"); 145string outputBasePath = Path.Combine(targetBasePath, "ChildDir", "GrandchildDir"); 159string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 160string referencedProjFileFullPath = Path.Combine(targetBasePath, "NewName.csproj"); 187string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 188string referencedProjFileFullPath = Path.Combine(targetBasePath, "Reference.csproj"); 216string existingProjectPath = Path.Combine(targetBasePath, existingProjectFolder); 219string existingProjectFileFullPath = Path.Combine(existingProjectPath, existingProjectFile); 222string referencedProjectFileFullPath = Path.Combine(targetBasePath, "Reference.csproj"); 257string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 283string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj");
CommandTests\New\DotnetRestorePostActionTests.cs (2)
27string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 52string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj");
CommandTests\New\DotnetSlnPostActionTests.cs (25)
24string solutionFileFullPath = Path.Combine(targetBasePath, "MySln.sln"); 39string solutionFileFullPath = Path.Combine(targetBasePath, "MySln.slnx"); 54string slnFileFullPath = Path.Combine(targetBasePath, "MySln.sln"); 55string slnxFileFullPath = Path.Combine(targetBasePath, "MySln.slnx"); 77ICreationResult creationResult = new MockCreationResult(primaryOutputs: new[] { new MockCreationPath(Path.GetFullPath("outputProj1.csproj")) }); 100new MockCreationPath(Path.GetFullPath("outputProj1.csproj")), 101new MockCreationPath(Path.GetFullPath("dontFindMe.csproj")), 102new MockCreationPath(Path.GetFullPath("outputProj2.csproj")) 153string outputFileFullPath0 = Path.Combine(outputBasePath, creationResult.PrimaryOutputs[0].Path); 154string dontFindMeFullPath1 = Path.Combine(outputBasePath, creationResult.PrimaryOutputs[1].Path); 155string outputFileFullPath2 = Path.Combine(outputBasePath, creationResult.PrimaryOutputs[2].Path); 183string outputFileFullPath0 = Path.Combine(outputBasePath, creationResult.PrimaryOutputs[0].Path); 184string outputFileFullPath1 = Path.Combine(outputBasePath, creationResult.PrimaryOutputs[1].Path); 200string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); 201string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 229string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); 230string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 258string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); 259string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 290string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); 291string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 322string slnFileFullPath = Path.Combine(targetBasePath, "MyApp.sln"); 323string projFileFullPath = Path.Combine(targetBasePath, "MyApp.csproj"); 351while (!string.IsNullOrEmpty(currentPath) && currentPath != Path.GetPathRoot(currentPath)) 357currentPath = Path.GetDirectoryName(currentPath);
CommandTests\New\SdkInfoProviderTests.cs (1)
16Environment.SetEnvironmentVariable("PATH", dotnetRootUnderTest + Path.PathSeparator + pathOrig);
CommandTests\Pack\PackTests.cs (24)
29var outputDir = new DirectoryInfo(Path.Combine(testInstance.Path, "bin", "Test")); 44var outputDir = new DirectoryInfo(Path.Combine(testInstance.Path, "bin2")); 69var output = new FileInfo(Path.Combine(testInstance.Path, 78var outputPackage = new FileInfo(Path.Combine(testInstance.Path, 96var outputPackage = new FileInfo(Path.Combine(testInstance.Path, 120var outputPackage = new FileInfo(Path.Combine(testInstance.Path, 130var symbolsPackage = new FileInfo(Path.Combine(testInstance.Path, 212var outputDir = new DirectoryInfo(Path.Combine(testInstance.Path, "bin", "Debug")); 217var outputPackage = new FileInfo(Path.Combine(outputDir.FullName, "TestLibraryWithConfiguration.1.0.0.nupkg")); 235var rootPath = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, "TestProject"); 259new DirectoryInfo(Path.Combine(rootPath, "bin")) 300string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec"); 312var nupkgPath = Path.Combine(testInstance.Path, "PackNoCsproj.1.2.3.nupkg"); 329string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec"); 344string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec"); 355var nupkgPath = Path.Combine(testInstance.Path, "CustomID.1.0.0.nupkg"); 375string nuspecPath = Path.Combine(testInstance.Path, "TestingPackWithConfig.nuspec"); 377var configDir = Path.Combine(testInstance.Path, "bin", configuration); 379File.WriteAllText(Path.Combine(configDir, "libraryclass.cs"), "// dummy source file for test"); 386var outputPackage = new FileInfo(Path.Combine(testInstance.Path, "TestPackWithConfig.1.0.0.nupkg")); 402string nuspecPath = Path.Combine(testInstance.Path, "PackNoCsproj.nuspec"); 403string outputDirPath = Path.Combine(testInstance.Path, "output"); 414var nupkgPath = Path.Combine(outputDirPath, "PackNoCsproj.1.0.0.nupkg"); 426string nuspecPath = Path.Combine(testInstance.Path, "NonExistent.nuspec");
CommandTests\Package\Add\GivenDotnetPackageAdd.cs (31)
31$"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'."); 61"$(RestoreSources);" + string.Join(";", packages.Select(package => Path.GetDirectoryName(package)))); 66.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name)) 91"$(RestoreSources);" + string.Join(";", packages.Select(package => Path.GetDirectoryName(package)))); 96.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name)) 137var csproj = $"{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj"; 159var packageDirectory = Path.Combine(projectDirectory, "local packages"); 161var csproj = $"{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj"; 172var restoredPackageDirectory = Path.Combine(packageDirectory, packageName.ToLowerInvariant(), packageVersion); 194$"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'.") 216$"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'.") 289$"added to file '{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj'."); 297var file = Path.Join(testInstance.Path, "Program.cs"); 321var file = Path.Join(testInstance.Path, "Program.cs"); 345var restoreSources = string.Join(";", packages.Select(package => Path.GetDirectoryName(package))); 347var file = Path.Join(testInstance.Path, "Program.cs"); 382var restoreSources = string.Join(";", packages.Select(package => Path.GetDirectoryName(package))); 384var file = Path.Join(testInstance.Path, "Program.cs"); 407var file = Path.Join(testInstance.Path, "Program.cs"); 428var file = Path.Join(testInstance.Path, "Program.cs"); 447var file = Path.Join(testInstance.Path, "Program.cs"); 465var file = Path.Join(testInstance.Path, "Program.cs"); 486var file = Path.Join(testInstance.Path, "Program.cs"); 492var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 528var file = Path.Join(testInstance.Path, "Program.cs"); 544var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 587var restoreSources = string.Join(";", packages.Select(package => Path.GetDirectoryName(package))); 589var file = Path.Join(testInstance.Path, "Program.cs"); 596var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props"); 631var file = Path.Join(testInstance.Path, "Program.cs"); 638var directoryPackagesProps = Path.Join(testInstance.Path, "Directory.Packages.props");
CommandTests\Package\List\GivenDotnetListPackage.cs (2)
204var projectDirectory = Path.Combine(testAsset.Path, testProject.Name); 442var subFolderPath = Path.Combine(projectDirectory, subFolderName);
CommandTests\Package\Remove\GivenDotnetPackageRemove.cs (1)
27.And.HaveStdOutContaining($"Removing PackageReference for package '{packageName}' from project '{projectDirectory + Path.DirectorySeparatorChar}TestAppSimple.csproj'.")
CommandTests\Package\Remove\GivenDotnetRemovePackage.cs (4)
85remove.StdOut.Should().Contain($"Removing PackageReference for package '{packageName}' from project '{projectDirectory + Path.DirectorySeparatorChar}TestAppSimple.csproj'."); 93var file = Path.Join(testInstance.Path, "Program.cs"); 115var file = Path.Join(testInstance.Path, "Program.cs"); 143var file = Path.Join(testInstance.Path, "Program.cs");
CommandTests\Project\Convert\DotnetProjectConvertTests.cs (87)
23var dotnetProjectConvert = Path.Join(testInstance.Path, "dotnetProjectConvert"); 26var csFile = Path.Combine(dotnetProjectConvert, "Program.cs"); 38new DirectoryInfo(Path.Join(dotnetProjectConvert, "Program")) 42var dotnetProjectConvertProject = Path.Join(dotnetProjectConvert, "Program", "Program.csproj"); 44Path.GetFileName(dotnetProjectConvertProject).Should().Be("Program.csproj"); 46var dotnetNewConsole = Path.Join(testInstance.Path, "DotnetNewConsole"); 71var directoryPath = Path.Join(testInstance.Path, "MyApp"); 73File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();"); 90Directory.CreateDirectory(Path.Join(testInstance.Path, "MyApp")); 91File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();"); 102new DirectoryInfo(Path.Join(testInstance.Path, "MyApp")) 105new DirectoryInfo(Path.Join(testInstance.Path, "MyApp1")) 114var directoryPath = Path.Join(testInstance.Path, "SomeOutput"); 116File.WriteAllText(Path.Join(testInstance.Path, "MyApp.cs"), "Console.WriteLine();"); 133File.WriteAllText(Path.Join(testInstance.Path, "Program1.cs"), "Console.WriteLine(1);"); 134File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), "Console.WriteLine(2);"); 145new DirectoryInfo(Path.Join(testInstance.Path, "Program1")) 174.And.HaveStdErrContaining(string.Format(CliCommandStrings.InvalidFilePath, Path.Join(testInstance.Path, "NotHere.cs"))); 184var filePath = Path.Join(testInstance.Path, "Program.vb"); 202File.WriteAllText(Path.Join(testInstance.Path, "Program.CS"), "Console.WriteLine();"); 213new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 224File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), content); 235File.ReadAllText(Path.Join(testInstance.Path, "Program.cs")) 238new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 242File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.cs")) 250var appDirectory = Path.Join(testInstance.Path, "app"); 252File.WriteAllText(Path.Join(appDirectory, "Program.cs"), "Console.WriteLine();"); 259new DirectoryInfo(Path.Join(testInstance.Path, "app")) 263new DirectoryInfo(Path.Join(testInstance.Path, "app", "Program")) 275File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 278File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 279File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 280File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 281Directory.CreateDirectory(Path.Join(testInstance.Path, "subdir")); 282File.WriteAllText(Path.Join(testInstance.Path, "subdir", "second.json"), ""); 293new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 297new DirectoryInfo(Path.Join(testInstance.Path, "Program", "subdir")) 306File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 310File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 311File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 312File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 323new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 332File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 336File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 337File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 338File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 349new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 361File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 364File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 365File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 366File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 367File.WriteAllText(Path.Join(testInstance.Path, "second.json"), ""); 369File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """ 387new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 396File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 399File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), """ 402File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 429new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 445var subdir = Path.Join(testInstance.Path, "subdir"); 447File.WriteAllText(Path.Join(subdir, "Program.cs"), """ 450File.WriteAllText(Path.Join(subdir, "Util.cs"), """ 453File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 479new DirectoryInfo(Path.Join(subdir, "Program")) 495var subdir = Path.Join(testInstance.Path, "subdir"); 497File.WriteAllText(Path.Join(subdir, "Program.cs"), """ 500File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), """ 503File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 529new DirectoryInfo(Path.Join(subdir, "Program")) 551File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 554File.WriteAllText(Path.Join(testInstance.Path, "my.json"), ""); 555File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), ""); 556File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), ""); 557File.WriteAllText(Path.Join(testInstance.Path, $"repo.{ext}"), ""); 568new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 583var filePath = Path.Join(testInstance.Path, "Program.cs"); 592new DirectoryInfo(Path.Join(testInstance.Path)) 604var filePath = Path.Join(testInstance.Path, "Program.cs"); 614new DirectoryInfo(Path.Join(testInstance.Path)) 629File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), originalSource); 640File.ReadAllText(Path.Join(testInstance.Path, "Program.cs")) 643new DirectoryInfo(Path.Join(testInstance.Path, "Program")) 647File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.cs")) 650File.ReadAllText(Path.Join(testInstance.Path, "Program", "Program.csproj")) 783var libDir = Path.Join(testInstance.Path, "lib"); 785File.WriteAllText(Path.Join(libDir, "Lib.csproj"), "test"); 787var slash = Path.DirectorySeparatorChar; 789filePath: Path.Join(testInstance.Path, "app", "Program.cs"),
CommandTests\Publish\GivenDotnetPublishPublishesProjects.cs (10)
39var outputDll = Path.Combine(OutputPathCalculator.FromProject(testProjectDirectory).GetPublishDirectory(configuration: configuration), $"{testAppName}.dll"); 70string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); 124var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); 139var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); 183.WithWorkingDirectory(Path.Combine(testAsset.Path, "MainProject")) 229var outputProgram = Path.Combine(outputDirectory.FullName, $"{testAppName}{Constants.ExeSuffix}"); 258.Execute(Path.Combine(outputDirectory.FullName, $"{testAppName}.dll")) 322var outputProgram = Path.Combine(OutputPathCalculator.FromProject(rootDir).GetPublishDirectory(configuration: configuration), $"TestAppSimple.dll"); 374var outputProgram = Path.Combine(OutputPathCalculator.FromProject(rootPath).GetPublishDirectory(configuration: configuration, runtimeIdentifier: rid), $"TestAppSimple.dll"); 451var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release");
CommandTests\Reference\Add\GivenDotnetAddReference.cs (19)
145string brokenFolder = Path.Combine(setup.TestRoot, "Broken"); 147string brokenProjectPath = Path.Combine(brokenFolder, "Broken.csproj"); 172var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne"); 177cmd.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneProjectInDirectory, workingDir + Path.DirectorySeparatorChar)); 190cmd.StdErr.Should().Be(string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, setup.TestRoot + Path.DirectorySeparatorChar)); 197var invalidProjDirectory = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, "InvalidProj"); 198var invalidProjPath = Path.Combine(invalidProjDirectory, "InvalidProj.csproj"); 368var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithExistingRefCondOnItem")); 403var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithExistingRefCondWhitespaces")); 418var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefNoCondNonUniform")); 433var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefNoCondNonUniform")); 450var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefCondNonUniform")); 465var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithRefCondNonUniform")); 482var proj = new ProjDir(Path.Combine(setup.TestRoot, "EmptyItemGroup")); 625var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); 642var net452netcoreapp10lib = new ProjDir(Path.Combine(setup.TestRoot, "Net452AndNetCoreApp10Lib")); 664var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); 682var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); 709.Execute(Path.GetDirectoryName(setup.ValidRefCsprojPath) ?? string.Empty);
CommandTests\Reference\List\GivenDotnetListReference.cs (6)
100string brokenFolder = Path.Combine(setup.TestRoot, "Broken"); 102string brokenProjectPath = Path.Combine(brokenFolder, "Broken.csproj"); 128var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne"); 133cmd.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneProjectInDirectory, workingDir + Path.DirectorySeparatorChar)); 146cmd.StdErr.Should().Be(string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, setup.TestRoot + Path.DirectorySeparatorChar)); 241var dir = new ProjDir(Path.Combine(basePath, testProjectName));
CommandTests\Reference\Remove\GivenDotnetRemoveP2P.cs (18)
190string brokenFolder = Path.Combine(setup.TestRoot, "Broken"); 192string brokenProjectPath = Path.Combine(brokenFolder, "Broken.csproj"); 218var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne"); 223cmd.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneProjectInDirectory, workingDir + Path.DirectorySeparatorChar)); 236cmd.StdErr.Should().Be(string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, setup.TestRoot + Path.DirectorySeparatorChar)); 253cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 272cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 292cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 348cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 373cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 398cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 411var proj = new ProjDir(Path.Combine(setup.TestRoot, "WithDoubledRef")); 495string outputText = $@"{string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))} 496{string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine(setup.ValidRefCsprojRelPath))}"; 520{string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine(setup.ValidRefCsprojRelPath))}"; 547result.StdOut.Should().Be(string.Format(CliStrings.ProjectReferenceRemoved, Path.Combine("Lib", setup.LibCsprojName))); 565result.StdErr.Should().Be(string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, Path.Combine(setup.TestRoot, reference))); 582result.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneProjectInDirectory, Path.Combine(setup.TestRoot, reference)));
CommandTests\Restore\GivenThatIWantToRestoreApp.cs (12)
24string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); 67var rootPath = Path.Combine(testAsset.TestRoot, testProject.Name); 70string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); 91Log.WriteLine(File.ReadAllText(Path.Combine(rootPath, "obj", "project.assets.json"))); 109string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); 132string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir)); 197var rootPath = Path.Combine(testAsset.TestRoot, testProject.Name); 208var assetsFilePath = Path.Combine(rootPath, "obj", "project.assets.json");
CommandTests\Run\GivenDotnetRunBuildsCsProj.cs (12)
62string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); 161var projectFile = Path.Combine(testInstance.Path, testAppName + ".csproj"); 195var projectFile = Path.Combine(testInstance.Path, testAppName + ".csproj"); 382{Path.Join(testInstance.Path, "Properties", "launchSettings.json")} 383{Path.Join(testInstance.Path, "MSBuildTestApp.run.json")} 414var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 435var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 455var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 475var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 495var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 514var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 1010var nonExistentProject = Path.Combine(tempDir.Path, "nonexistent.csproj");
CommandTests\Run\GivenDotnetRunBuildsVbProj.cs (4)
32{Path.Join(testInstance.Path, "My Project", "launchSettings.json")} 33{Path.Join(testInstance.Path, "VBTestApp.run.json")} 102var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json"); 122var launchSettingsPath = Path.Combine(testProjectDirectory, "My Project", "launchSettings.json");
CommandTests\Run\GivenDotnetRunThrowsAParseError.cs (1)
17.WithWorkingDirectory(Path.GetTempPath())
CommandTests\Run\GivenThatWeCanPassNonProjectFilesToDotnetRun.cs (1)
22var slnFullPath = Path.Combine(projectDirectory, "SlnFileWithNoProjectReferences.sln");
CommandTests\Run\RunFileTests.cs (220)
120string outOfTreeBaseDirectory = TestPathUtility.ResolveTempPrefixLink(Path.Join(Path.GetTempPath(), "dotnetSdkTests")); 124var sourceNuGetConfig = Path.Join(TestContext.Current.TestExecutionDirectory, "NuGet.config"); 125var targetNuGetConfig = Path.Join(outOfTreeBaseDirectory, "NuGet.config"); 153var programPath = Path.Join(testInstance.Path, "Program.cs"); 185File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 195File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $""" 217new DotnetCommand(Log, $".{Path.DirectorySeparatorChar}Program.cs") 223new DotnetCommand(Log, Path.Join(testInstance.Path, "Program.cs")) 275File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 303File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 305var dirName = Path.GetFileName(testInstance.Path); 308.WithWorkingDirectory(Path.GetDirectoryName(testInstance.Path)!) 321File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 341File.WriteAllText(Path.Join(testInstance.Path, cmd), """ 345File.WriteAllText(Path.Join(testInstance.Path, $"dotnet-{cmd}"), """ 381File.WriteAllText(Path.Join(testInstance.Path, "test.dll"), """ 408File.WriteAllText(Path.Join(testInstance.Path, "complog"), """ 509File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 530File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 550File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 551File.WriteAllText(Path.Join(testInstance.Path, "App.csproj"), s_consoleProject); 567Directory.CreateDirectory(Path.Join(testInstance.Path, "file")); 568File.WriteAllText(Path.Join(testInstance.Path, "file", "Program.cs"), s_program); 569Directory.CreateDirectory(Path.Join(testInstance.Path, "proj")); 570File.WriteAllText(Path.Join(testInstance.Path, "proj", "App.csproj"), s_consoleProject); 573.WithWorkingDirectory(Path.Join(testInstance.Path, "proj")) 585Directory.CreateDirectory(Path.Join(testInstance.Path, "file")); 586File.WriteAllText(Path.Join(testInstance.Path, "file", "Program.cs"), s_program); 587Directory.CreateDirectory(Path.Join(testInstance.Path, "proj")); 588File.WriteAllText(Path.Join(testInstance.Path, "proj", "App.csproj"), s_consoleProject); 591.WithWorkingDirectory(Path.Join(testInstance.Path, "proj")) 610File.WriteAllText(Path.Join(testInstance.Path, fileName), """ 633File.WriteAllText(Path.Join(testInstance.Path, fileName), s_program); 649File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 650File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), s_program); 690File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 706File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 725File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programDependingOnUtil); 726File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 735File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $""" 756File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programDependingOnUtil); 757File.WriteAllText(Path.Join(testInstance.Path, "Util.cs"), s_util); 782File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 783Directory.CreateDirectory(Path.Join(testInstance.Path, "nested")); 784File.WriteAllText(Path.Join(testInstance.Path, "nested", "App.csproj"), s_consoleProject); 801File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 802File.WriteAllText(Path.Join(testInstance.Path, "App.csproj"), s_consoleProject); 804var dirName = Path.GetFileName(testInstance.Path); 806var workDir = Path.GetDirectoryName(testInstance.Path)!; 825File.Delete(Path.Join(testInstance.Path, "MSBuildTestApp.csproj")); 841File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), string.Empty); 857File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 858File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 877File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 878File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """ 902File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 903File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.targets"), """ 932File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 951File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 970File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 994File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1016File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1045File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1053var fileName = arg.Split(':', 2) is [_, { Length: > 0 } value] ? Path.GetFileNameWithoutExtension(value) : "msbuild"; 1065File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1086File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1107File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1128File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 1136string binaryLogPath = Path.Join(testInstance.Path, "msbuild.binlog"); 1151var programFile = Path.Join(testInstance.Path, "Program.cs"); 1176var programFile = Path.Join(testInstance.Path, "Program.cs"); 1193var programFile = Path.Join(testInstance.Path, "Program.cs"); 1209File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 1222File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 1242File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource); 1243File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx); 1254File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), $""" 1278File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource); 1279File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx); 1280File.WriteAllText(Path.Join(testInstance.Path, $"repo.{ext}"), ""); 1295var programFile = Path.Join(testInstance.Path, "Program.cs"); 1327var programFile = Path.Join(testInstance.Path, "Program.cs"); 1364File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 1371var programFile = Path.Join(testInstance.Path, "Program.cs"); 1388var programFile = Path.Join(testInstance.Path, "Program.cs"); 1409var programFile = Path.Join(testInstance.Path, "Program.cs"); 1449var programFile = Path.Join(testInstance.Path, "Program.cs"); 1490var programFile = Path.Join(testInstance.Path, "Program.cs"); 1496var publishDir = Path.Join(testInstance.Path, "artifacts"); 1508new RunExeCommand(Log, Path.Join(publishDir, "Program", $"Program{Constants.ExeSuffix}")) 1521var programFile = Path.Join(testInstance.Path, "Program.cs"); 1527var publishDir = Path.Join(testInstance.Path, "artifacts"); 1549var programFile = Path.Join(testInstance.Path, "Program.cs"); 1555File.WriteAllText(Path.Join(testInstance.Path, "config.json"), """ 1562var publishDir = Path.Join(testInstance.Path, "artifacts"); 1580var programFile = Path.Join(testInstance.Path, "Program.cs"); 1586var publishDir = Path.Join(testInstance.Path, "artifacts"); 1605var programFile = Path.Join(testInstance.Path, "MyCustomProgram.cs"); 1611var publishDir = Path.Join(testInstance.Path, "artifacts"); 1628var programFile = Path.Join(testInstance.Path, "Program.cs"); 1631var customPublishDir = Path.Join(testInstance.Path, "custom-publish"); 1648var programFile = Path.Join(testInstance.Path, "Program.cs"); 1649var publishDir = Path.Join(testInstance.Path, "directive-publish"); 1671var subDir = Directory.CreateDirectory(Path.Combine(testInstance.Path, "subdir")); 1673var programFile = Path.Join(subDir.FullName, "Program.cs"); 1679var publishDir = Path.Join(subDir.FullName, "artifacts"); 1696var programFile = Path.Join(testInstance.Path, "MyFileBasedTool.cs"); 1715var outputDir = Path.Join(testInstance.Path, "artifacts"); 1743var programFile = Path.Join(testInstance.Path, "MyFileBasedTool.cs"); 1760var outputDir = Path.Join(testInstance.Path, "custom"); 1784var programFile = Path.Join(testInstance.Path, "Program.cs"); 1814var programFile = Path.Join(testInstance.Path, "Program.cs"); 1852File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program + """ 1856var fullPath = Path.Join(testInstance.Path, relativePath); 1857Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!); 1901File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program + """ 1905Directory.CreateDirectory(Path.Join(testInstance.Path, "Properties")); 1906string launchSettings = Path.Join(testInstance.Path, "Properties", "launchSettings.json"); 1908string runJson = Path.Join(testInstance.Path, "Program.run.json"); 1953File.WriteAllText(Path.Join(testInstance.Path, "First.cs"), source); 1954File.WriteAllText(Path.Join(testInstance.Path, "First.run.json"), s_launchSettings.Replace("TestProfileMessage", "First")); 1955File.WriteAllText(Path.Join(testInstance.Path, "Second.cs"), source); 1956File.WriteAllText(Path.Join(testInstance.Path, "Second.run.json"), s_launchSettings.Replace("TestProfileMessage", "Second")); 1982File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 1999File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2016File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2038File.WriteAllText(Path.Join(testInstance.Path, "Directory.Packages.props"), """ 2048File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2071File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2090File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2110var libDir = Path.Join(testInstance.Path, "Lib"); 2113File.WriteAllText(Path.Join(libDir, "Lib.csproj"), $""" 2121File.WriteAllText(Path.Join(libDir, "Lib.cs"), """ 2129var appDir = Path.Join(testInstance.Path, "App"); 2132File.WriteAllText(Path.Join(appDir, "Program.cs"), $""" 2148File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2157.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2158string.Format(CliStrings.CouldNotFindProjectOrDirectory, Path.Join(testInstance.Path, "wrong.csproj")))); 2160File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2169.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2170string.Format(CliStrings.CouldNotFindProjectOrDirectory, Path.Join(testInstance.Path, "dir/")))); 2172Directory.CreateDirectory(Path.Join(testInstance.Path, "dir")); 2179.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2180string.Format(CliStrings.CouldNotFindAnyProjectInDirectory, Path.Join(testInstance.Path, "dir/")))); 2182File.WriteAllText(Path.Join(testInstance.Path, "dir", "proj1.csproj"), "<Project />"); 2183File.WriteAllText(Path.Join(testInstance.Path, "dir", "proj2.csproj"), "<Project />"); 2190.And.HaveStdErrContaining(DirectiveError(Path.Join(testInstance.Path, "Program.cs"), 1, CliCommandStrings.InvalidProjectDirective, 2191string.Format(CliStrings.MoreThanOneProjectInDirectory, Path.Join(testInstance.Path, "dir/")))); 2204string entryPointPath = Path.Join(testInstance.Path, fileName); 2219var msbuildCall = FindCompilerCall(Path.Join(testInstance.Path, "msbuild.binlog")); 2392var codeFolder = new DirectoryInfo(Path.Join( 2433var rspFilePath = Path.Join(artifactsDir, "csc.rsp"); 2481string entryPointPath = Path.Join(testInstance.Path, fileName); 2487string programName = Path.GetFileNameWithoutExtension(fileName); 2492var artifactsBackupDir = Path.ChangeExtension(artifactsDir, ".bak"); 2518Path.GetDirectoryName(f) != artifactsBackupDir && // exclude top-level marker files 2519Path.GetFileName(f) != programName && // binary on unix 2520Path.GetExtension(f) is not (".dll" or ".exe" or ".pdb")); // other binaries 2524var relativePath = Path.GetRelativePath(relativeTo: artifactsBackupDir, path: cscOnlyFile); 2525var msbuildFile = Path.Join(artifactsDir, relativePath); 2560File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2565var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2575File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 2582File.WriteAllText(Path.Join(testInstance.Path, "Program2.cs"), "test"); 2587string buildPropsFile = Path.Join(testInstance.Path, "Directory.Build.props"); 2607string importedFile = Path.Join(testInstance.Path, "Settings.props"); 2716File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 2732File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_programReadingEmbeddedResource); 2733File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx); 2738File.WriteAllText(Path.Join(testInstance.Path, "Resources.resx"), s_resx.Replace("TestValue", "UpdatedValue")); 2743File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), "//v2\n" + s_programReadingEmbeddedResource); 2755File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2760var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2765File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2786File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2800File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2821File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2842File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), "<Project />"); 2872File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2878var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2881File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), "<Project />"); 2890File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 2900File.Delete(Path.Join(testInstance.Path, "Directory.Build.props")); 2918File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 2921var artifactsDir = VirtualProjectBuildingCommand.GetArtifactsPath(Path.Join(testInstance.Path, "Program.cs")); 2925.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages")) 2933.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages")) 2939File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """ 2944.WithEnvironmentVariable("NUGET_PACKAGES", Path.Join(testInstance.Path, "packages")) 2960var programPath = Path.Join(testInstance.Path, programFileName); 2986var programPath = Path.Join(testInstance.Path, "Program.cs"); 3042var programPath = Path.Join(testInstance.Path, programFileName); 3063var libDir = Path.Join(testInstance.Path, "Lib"); 3066File.WriteAllText(Path.Join(libDir, "Lib.csproj"), $""" 3074var libPath = Path.Join(libDir, "Lib.cs"); 3084var appDir = Path.Join(testInstance.Path, "App"); 3092var programPath = Path.Join(appDir, "Program.cs"); 3126File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), $""" 3144var programPath = Path.Join(testInstance.Path, "Program.cs"); 3172var programPath = Path.Join(testInstance.Path, "Program.cs"); 3207var programPath = Path.Join(testInstance.Path, "Program.cs"); 3282var programPath = Path.Join(testInstance.Path, "Program.cs"); 3349var programPath = Path.Join(testInstance.Path, "Program.cs"); 3433var programPath = Path.Join(testInstance.Path, "Program.cs"); 3460var filePath = Path.Join(testInstance.Path, "Program.cs"); 3485File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), """" 3502File.WriteAllText(Path.Join(testInstance.Path, fileName), """ 3507var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), Path.Join(testInstance.Path, fileName)); 3512.And.HaveStdOut($"EntryPointFilePath: {Path.GetFullPath(relativePath)}"); 3519var dirWithSpaces = Path.Join(testInstance.Path, "dir with spaces"); 3521var filePath = Path.Join(dirWithSpaces, "Program.cs"); 3539File.WriteAllText(Path.Join(testInstance.Path, fileName), """ 3556var filePath = Path.Join(testInstance.Path, unicodeFileName); 3574File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 3604File.WriteAllText(Path.Join(testInstance.Path, "Program.cs"), s_program); 3606File.WriteAllText(Path.Join(testInstance.Path, "Directory.Build.props"), """ 3626File.WriteAllText(Path.Join(testInstance.Path, "Program.csproj"), s_consoleProject); 3650File.Delete(Path.Join(testInstance.Path, file));
CommandTests\Run\RunParserTests.cs (1)
25var projectPath = Path.Combine(newWorkingDir, "HelloWorld.csproj");
CommandTests\Run\RunTelemetryTests.cs (3)
55var repoRoot = "/repo/root".Replace('/', Path.DirectorySeparatorChar); 56var projectPath = "/repo/root/src/project.csproj".Replace('/', Path.DirectorySeparatorChar); 57var expectedRelativePath = "src/project.csproj".Replace('/', Path.DirectorySeparatorChar);
CommandTests\Sdk\Check\GivenDotnetSdkCheck.cs (3)
31fakeReleasesPath = Path.Combine(_testAssetsManager.TestAssetsRoot, "TestReleases", "TestRelease"); 200var configFilePath = Path.Combine(dotnetRoot, "sdk", "6.0.100", "sdk-check-config.json"); 201Directory.CreateDirectory(Path.GetDirectoryName(configFilePath));
CommandTests\Sdk\Check\MockProductCollectionProvider.cs (2)
22return ProductCollection.GetFromFileAsync(Path.Combine(_path, "releases-index.json"), false).Result; 27return product.GetReleasesAsync(Path.Combine(_path, product.ProductVersion, "releases.json"), false).Result;
CommandTests\Solution\Add\GivenDotnetSlnAdd.cs (81)
121var projectToAdd = Path.Combine("Lib", "Lib.csproj"); 126cmd.StdErr.Should().Match(string.Format(CliStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, $"InvalidSolution{solutionExtension}"), "*")); 144? Path.Join(projectDirectoryRoot, "Sln") 145: Path.Join(projectDirectoryRoot, "Slnx"); 147var solutionPath = Path.Combine(projectDirectory, $"InvalidSolution{solutionExtension}"); 148var projectToAdd = Path.Combine("..", "Lib", "Lib.csproj"); 187var solutionPath = Path.Combine(projectDirectory, "App"); 192cmd.StdErr.Should().Be(string.Format(CliStrings.SolutionDoesNotExist, solutionPath + Path.DirectorySeparatorChar)); 206var projectToAdd = Path.Combine("Lib", "Lib.csproj"); 211cmd.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneSolutionInDirectory, projectDirectory + Path.DirectorySeparatorChar)); 228var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); 234var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 275projectToAdd = Path.Combine("foo", "bar"); 309projectToAdd = Path.Combine("Base", "Second", "TestCollision.csproj"); 317projectToAdd = Path.Combine("Base", "Second", "Third", "Second.csproj"); 345var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 366var slnFullPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 377Path.Combine(projectDirectory, directoryToAdd))); 395var slnFullPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 406Path.Combine(projectDirectory, directoryToAdd))); 424var projectToAdd = Path.Combine("Lib", "Lib.csproj"); 430ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Combine(projectDirectory, $"App{solutionExtension}")); 431SolutionModel solution = await serializer.OpenAsync(Path.Combine(projectDirectory, $"App{solutionExtension}"), CancellationToken.None); 452var projectToAdd = Path.Combine("Shared", "Shared.shproj"); 479var projectToAdd = Path.Combine($"{firstComponent}", "src", "src", "Lib", "Lib.csproj"); 485ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Combine(projectDirectory, $"App{solutionExtension}")); 486SolutionModel solution = await serializer.OpenAsync(Path.Combine(projectDirectory, $"App{solutionExtension}"), CancellationToken.None); 528var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 558var projectPath = Path.Combine("Lib", "Lib.csproj"); 585using (var stream = new FileStream(Path.Combine(projectDirectory, "App.sln"), FileMode.Open)) 627ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Combine(projectDirectory, $"App{solutionExtension}")); 628SolutionModel solution = await serializer.OpenAsync(Path.Combine(projectDirectory, $"App{solutionExtension}"), CancellationToken.None); 639solution = await serializer.OpenAsync(Path.Combine(projectDirectory, $"App{solutionExtension}"), CancellationToken.None); 665var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 679var appPathCalculator = OutputPathCalculator.FromProject(Path.Combine(projectDirectory, "App", "App.csproj")); 684var libPathCalculator = OutputPathCalculator.FromProject(Path.Combine(projectDirectory, "Lib", "Lib.csproj")); 704var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 705var projectToAdd = Path.Combine("Lib", "Lib.csproj"); 725var slnFullPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 728var projectToAdd = Path.Combine("Lib", "Lib.csproj"); 749var slnFullPath = Path.Combine(projectDirectory, "App.sln"); 752var projectToAdd = Path.Combine("UnknownProject", "UnknownProject.unknownproj"); 787var projectToAdd = Path.Combine(projectDir, projectName); 795ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Combine(projectDirectory, "App.sln")); 796SolutionModel solution = await serializer.OpenAsync(Path.Combine(projectDirectory, "App.sln"), CancellationToken.None); 814var solutionPath = Path.Combine(solutionDirectory, $"App{solutionExtension}"); 817var projectToAdd = Path.Combine("UnknownProject", "UnknownProject.unknownproj"); 825Path.Combine(solutionDirectory, projectToAdd))); 865var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); 871ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Combine(projectDirectory, $"App{solutionExtension}")); 872SolutionModel solution = await serializer.OpenAsync(Path.Combine(projectDirectory, $"App{solutionExtension}"), CancellationToken.None); 888var slnFullPath = Path.Combine(slnDirectory, $"App{solutionExtension}"); 895var expectedResult = File.ReadAllText(Path.Combine(slnDirectory, "Results", $"ExpectedSlnFileAfterAddingProjectWithoutMatchingConfigs{solutionExtension}")); 913var slnFullPath = Path.Combine(slnDirectory, $"App{solutionExtension}"); 920var expectedResult = File.ReadAllText(Path.Combine(slnDirectory, "Results", $"ExpectedSlnFileAfterAddingProjectWithMatchingConfigs{solutionExtension}")); 938var slnFullPath = Path.Combine(slnDirectory, $"App{solutionExtension}"); 945var expectedResult = File.ReadAllText(Path.Combine(slnDirectory, "Results", $"ExpectedSlnFileAfterAddingProjectWithAdditionalConfigs{solutionExtension}")); 963var projectToAdd = Path.Combine("MultitargetedCS", "MultitargetedCS.csproj"); 986var projectToAdd = Path.Combine("MultitargetedVB", "MultitargetedVB.vbproj"); 1009var slnFullPath = Path.Combine(solutionDirectory, "App.sln"); 1010var projectToAdd = Path.Combine("MultitargetedFS", "MultitargetedFS.fsproj"); 1032var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); 1038var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 1060var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); 1066var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 1088var solutionPath = Path.Combine(solutionDirectory, $"App{solutionExtension}"); 1091var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); 1120var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); 1126var slnPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 1147var projectToAdd = Path.Combine("..", "Lib", "Lib.csproj"); 1149.WithWorkingDirectory(Path.Join(projectDirectory, "Dir")) 1153ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Join(projectDirectory, "Dir", $"App{solutionExtension}")); 1154SolutionModel solution = await serializer.OpenAsync(Path.Join(projectDirectory, "Dir", $"App{solutionExtension}"), CancellationToken.None); 1174var projectToAdd = Path.Combine("A", "A.csproj"); 1176.WithWorkingDirectory(Path.Join(projectDirectory)) 1180ISolutionSerializer serializer = SolutionSerializers.GetSerializerByMoniker(Path.Join(projectDirectory, $"App{solutionExtension}")); 1181SolutionModel solution = await serializer.OpenAsync(Path.Join(projectDirectory, $"App{solutionExtension}"), CancellationToken.None); 1288File.Delete(Path.Join(projectDirectory, "App.slnx")); 1292File.Delete(Path.Join(projectDirectory, "App.sln")); 1295var projectArg = Path.Combine("Lib", "Lib.csproj"); 1314return File.ReadAllText(Path.Join(templateContentDirectory, templateFileName));
CommandTests\Solution\List\GivenDotnetSlnList.cs (15)
102string.Format(CliStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, "InvalidSolution.sln"), "").TrimEnd('.')); 119? Path.Join(projectRootDirectory, "Sln") 120: Path.Join(projectRootDirectory, "Slnx"); 122var solutionFullPath = Path.Combine(projectDirectory, $"InvalidSolution{solutionExtension}"); 142var solutionDir = Path.Combine(projectDirectory, "App"); 147cmd.StdErr.Should().Be(string.Format(CliStrings.SolutionDoesNotExist, solutionDir + Path.DirectorySeparatorChar)); 165cmd.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneSolutionInDirectory, projectDirectory + Path.DirectorySeparatorChar)); 197{Path.Combine("App", "App.csproj")} 198{Path.Combine("Lib", "Lib.csproj")}"; 221{Path.Combine("App", "App.csproj")} 222{Path.Combine("Lib", "Lib.csproj")}"; 229var slnFileName = Path.Combine(projectDirectory, $"App{solutionExtension}"); 249$"{Path.Combine("NestedSolution", "NestedFolder", "NestedFolder")}" }; 270$"{Path.Combine("src", "App", "App.csproj")}" }; 290$"{Path.Combine("src", "App", "App.csproj")}" };
CommandTests\Solution\Migrate\GivenDotnetSlnMigrate.cs (2)
19var slnFileName = Path.Combine(projectDirectory, "App.sln"); 25var slnxFileName = Path.ChangeExtension(slnFileName, ".slnx");
CommandTests\Solution\Remove\GivenDotnetSlnRemove.cs (46)
102var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 107cmd.StdErr.Should().Match(string.Format(CliStrings.InvalidSolutionFormatString, Path.Combine(projectDirectory, $"InvalidSolution{solutionExtension}"), "*")); 124? Path.Join(projectDirectoryRoot, "Sln") 125: Path.Join(projectDirectoryRoot, "Slnx"); 127var solutionPath = Path.Combine(projectDirectory, $"InvalidSolution{solutionExtension}"); 128var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 167var solutionPath = Path.Combine(projectDirectory, "App"); 172cmd.StdErr.Should().Be(string.Format(CliStrings.SolutionDoesNotExist, solutionPath + Path.DirectorySeparatorChar)); 186var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 191cmd.StdErr.Should().Be(string.Format(CliStrings.MoreThanOneSolutionInDirectory, projectDirectory + Path.DirectorySeparatorChar)); 207var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 230var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 237var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 246solution.SolutionProjects.Single().FilePath.Should().Be(Path.Combine("App", "App.csproj")); 261var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 273cmd.StdOut.Should().Be(string.Format(CliStrings.ProjectRemovedFromTheSolution, Path.Combine(projectToRemove, "Lib.csproj"))); 277solution.SolutionProjects.Single().FilePath.Should().Be(Path.Combine("App", "App.csproj")); 292var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 294var projectToRemove = Path.Combine("ConsoleApp1", "ConsoleApp1.csproj"); 317var solutionPath = Path.Combine(projectDirectory, "App.sln"); 322var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 334solution.SolutionProjects.Single().FilePath.Should().Be(Path.Combine("App", "App.csproj")); 349var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 356var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 370solution.SolutionProjects.Single().FilePath.Should().Be(Path.Combine("App", "App.csproj")); 385var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 392var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 415var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 452Path.Combine(projectDirectory, directoryToRemove))); 476Path.Combine(projectDirectory, directoryToRemove))); 492var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 499var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 517var outputCalculator = OutputPathCalculator.FromProject(Path.Combine(projectDirectory, "App")); 536var projectToRemove = Path.Combine("Lib", "Lib.csproj"); 544using (var stream = new FileStream(Path.Combine(projectDirectory, "App.sln"), FileMode.Open)) 579var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 585var appPath = Path.Combine("App", "App.csproj"); 586var libPath = Path.Combine("Lib", "Lib.csproj"); 609var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 611var projectToRemove = Path.Combine("src", "NotLastProjInSrc", "NotLastProjInSrc.csproj"); 634var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 636var projectToRemove = Path.Combine("src", "Lib", "Lib.csproj"); 659var solutionPath = Path.Combine(projectDirectory, $"App{solutionExtension}"); 661var projectToRemove = Path.Combine("Second", "Second.csproj"); 684var projectArg = Path.Combine("Lib", "Lib.csproj"); 703return File.ReadAllText(Path.Join(templateContentDirectory, templateFileName));
CommandTests\Store\GivenDotnetStoresAndPublishesProjects.cs (14)
27var localAssemblyCache = Path.Combine(testProjectDirectory, "localAssemblyCache"); 28var intermediateWorkingDirectory = Path.Combine(testProjectDirectory, "workingDirectory"); 30var profileProject = Path.Combine(profileProjectPath, $"{profileProjectName}.xml"); 46var profileFilter = Path.Combine(localAssemblyCache, _arch, _tfm, "artifact.xml"); 55var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll"); 78var profileFilter = Path.Combine(profileProjectPath, targetManifestFileName); 94var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll"); 115var localAssemblyCache = Path.Combine(testProjectDirectory, "lAC"); 116var intermediateWorkingDirectory = Path.Combine(testProjectDirectory, "workingDirectory"); 119var profileProject = Path.Combine(profileProjectPath, $"{profileProjectName}.xml"); 120var profileFilter = Path.Combine(profileProjectPath, "NewtonsoftFilterProfile.xml"); 123var profileProject1 = Path.Combine(profileProjectPath1, $"{profileProjectName1}.xml"); 124var profileFilter1 = Path.Combine(profileProjectPath1, "FluentFilterProfile.xml"); 150var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, _tfm, "publish", $"{testAppName}.dll");
CommandTests\Test\GivenDotnetTestBuildsAndRunsArtifactPostProcessing.cs (9)
40"--test-adapter-path", merge ? Path.GetDirectoryName(s_dataCollectorDll) : Path.GetDirectoryName(s_dataCollectorNoMergeDll), 58new PublishCommand(Log, Path.Combine(testInstance.Path, "sln.sln")).Execute("/p:Configuration=Release").Should().Pass(); 69$"--test-adapter-path:{(merge ? Path.GetDirectoryName(s_dataCollectorDll) : Path.GetDirectoryName(s_dataCollectorNoMergeDll))}", 87new PublishCommand(Log, Path.Combine(testInstance.Path, "sln.sln")).Execute("/p:Configuration=Release").Should().Pass(); 97$"--testAdapterPath:{(merge ? Path.GetDirectoryName(s_dataCollectorDll) : Path.GetDirectoryName(s_dataCollectorNoMergeDll))}", 202string runsettingsPath = Path.Combine(resultsDir, "test_" + Guid.NewGuid() + ".runsettings");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestBasedOnGlobbingFilter.cs (5)
26var binDirectory = new FileInfo($"{testInstance.Path}{Path.DirectorySeparatorChar}bin").Directory; 31.Execute(MicrosoftTestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar)); 66var binDirectory = new FileInfo($"{testInstance.Path}{Path.DirectorySeparatorChar}bin").Directory; 69string filterExpression = $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/*TestProject.dll".Replace('/', Path.DirectorySeparatorChar); 111.Execute(MicrosoftTestingPlatformOptions.TestModulesFilterOption.Name, $"**/bin/**/Debug/{ToolsetInfo.CurrentTargetFramework}/TestProject.dll".Replace('/', Path.DirectorySeparatorChar),
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestfromCsproj.cs (14)
165string trxLoggerDirectory = Path.Combine(testProjectDirectory, "RD"); 202string expectedError = Path.Combine(testProjectDirectory, "bin", 230string trxLoggerDirectory = Path.Combine(testProjectDirectory, "TR", "x.y"); 261string trxLoggerDirectory = Path.Combine(testProjectDirectory, "RD"); 439string resultsDirectory = Path.Combine(testProjectDirectory, "RD"); 447var settingsPath = Path.Combine(AppContext.BaseDirectory, "CollectCodeCoverage.runsettings"); 456File.WriteAllText(Path.Combine(testProjectDirectory, "output.txt"), 480string resultsDirectory = Path.Combine(testProjectDirectory, "RD"); 516string resultsDirectory = Path.Combine(testProjectDirectory, "RD"); 552string resultsDirectory = Path.Combine(testProjectDirectory, "RD"); 653Path.GetFileNameWithoutExtension(dotnet).Should().Be("dotnet"); 656result.StartInfo.EnvironmentVariables[dotnetRoot].Should().Be(Path.GetDirectoryName(dotnet)); 719var pathWithComma = Path.Combine(AppContext.BaseDirectory, "a,b"); 767string flagDirectory = Path.Combine(testProjectDirectory, "flag-dir");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs (2)
107string resultsDirectory = Path.Combine(testProjectDirectory, "RD"); 134string projectDirectory = Path.Combine(testInstance.Path, "XUnitProject");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestfromCsprojWithCorrectTestRunParameters.cs (1)
55var outputDll = Path.Combine(OutputPathCalculator.FromProject(testProjectDirectory).GetOutputDirectory(configuration: configuration), "VSTestTestRunParameters.dll");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestFromDll.cs (5)
34var outputDll = Path.Combine(buildCommand.GetOutputDirectory(configuration: configuration).FullName, $"{testAppName}.dll"); 68var outputDll = Path.Combine(testRoot, "bin", configuration, ToolsetInfo.CurrentTargetFramework, $"{testAppName}.dll"); 76Path.GetFileNameWithoutExtension(dotnet).Should().Be("dotnet"); 79result.StartInfo.EnvironmentVariables[dotnetRoot].Should().Be(Path.GetDirectoryName(dotnet)); 98var outputDll = Path.Combine(testRoot, "bin", configuration, ToolsetInfo.CurrentTargetFramework, $"{testAppName}.dll");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTests.cs (5)
130File.Move(Path.Join(testInstance.Path, "Properties", "launchSettings.json"), Path.Join(testInstance.Path, "TestProjectWithLaunchSettings.run.json")); 141.And.Contain(runJson ? "TestProjectWithLaunchSettings.run.json..." : $"Properties{Path.DirectorySeparatorChar}launchSettings.json...") 188.And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json...") 498.And.Contain($"Properties{Path.DirectorySeparatorChar}launchSettings.json...")
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs (2)
57string? versionsPropsPath = PathUtility.FindFileInParentDirectories(TestContext.Current.TestExecutionDirectory, $"eng{Path.DirectorySeparatorChar}Version.Details.props") ?? throw new FileNotFoundException("Version.Details.props file not found."); 59testInstance.UpdateProjectFileWithMSTestPackageVersion(Path.Combine($@"{testInstance.Path}{PathUtility.GetDirectorySeparatorChar()}TestProject", "TestProject.csproj"), msTestVersion);
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs (12)
25string testProjectPath = $"TestProject{Path.DirectorySeparatorChar}TestProject.csproj"; 85.WithWorkingDirectory($"{testInstance.Path}{Path.DirectorySeparatorChar}SolutionFilter") 101string invalidProjectPath = $"TestProject{Path.DirectorySeparatorChar}TestProject.txt"; 160string testProjectPath = $"TestProject{Path.DirectorySeparatorChar}TestProject.csproj"; 181string testProjectPath = $"TestProject{Path.DirectorySeparatorChar}OtherTestProject.csproj"; 188string fullProjectPath = $"{testInstance.TestRoot}{Path.DirectorySeparatorChar}{testProjectPath}"; 208string fullSolutionPath = $"{testInstance.TestRoot}{Path.DirectorySeparatorChar}{solutionPath}"; 350var binDirectory = new FileInfo($"{testInstance.Path}{Path.DirectorySeparatorChar}bin").Directory; 377Assert.True(File.Exists(string.Format("{0}{1}{2}", testInstance.TestRoot, Path.DirectorySeparatorChar, CliConstants.BinLogFileName))); 547Assert.True(File.Exists(Path.Combine(testInstance.Path, traceFile)), "Trace file should exist after test execution."); 559string traceFile = $"directory_{configuration}{Path.DirectorySeparatorChar}logs.txt"; 565Assert.True(File.Exists(Path.Combine(testInstance.Path, traceFile)), "Trace file should exist after test execution.");
CommandTests\Test\GivenDotnetTestContainsEnvironmentVariables.cs (1)
75var outputDll = Path.Combine(buildCommand.GetOutputDirectory(configuration: configuration).FullName, $"{TestAppName}.dll");
CommandTests\Test\TestCommandValidationTests.cs (6)
22var testFilePath = Path.Combine(testDir.Path, filename); 24File.WriteAllText(Path.Combine(testDir.Path, "global.json"), 48var subDir = Path.Combine(testDir.Path, "test_directory"); 50File.WriteAllText(Path.Combine(testDir.Path, "global.json"), 76var dllPath = Path.Combine(testDir.Path, "test.dll"); 78File.WriteAllText(Path.Combine(testDir.Path, "global.json"),
CommandTests\Tool\Install\ToolInstallGlobalOrToolPathCommandTests.cs (9)
56_toolsDirectory = Path.Combine(_temporaryDirectory, "tools"); 57_pathToPlaceShim = Path.Combine(_temporaryDirectory, "pathToPlace"); 98_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 109_fileSystem.File.Delete(Path.Combine(_temporaryDirectory, "nuget.config")); 121nugetConfig: new FilePath(Path.Combine(testAsset.Path, "NuGet.config")), 283_fileSystem.Directory.Exists(Path.Combine(_pathToPlacePackages, PackageId)).Should().BeFalse(); 306_fileSystem.Directory.Exists(Path.Combine(_pathToPlacePackages, PackageId)).Should().BeFalse(); 799_fileSystem.Directory.Exists(Path.Combine(_pathToPlacePackages, PackageId)).Should().BeFalse(); 934return Path.Combine(
CommandTests\Tool\Install\ToolInstallLocalCommandTests.cs (19)
49_pathToPlacePackages = Path.Combine(_temporaryDirectory, "pathToPlacePackage"); 78new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 81_manifestFilePath = Path.Combine(_temporaryDirectory, "dotnet-tools.json"); 82_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonContent); 91new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 105_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 117_fileSystem.File.Delete(Path.Combine(_temporaryDirectory, "nuget.config")); 177var explicitManifestFilePath = Path.Combine(_temporaryDirectory, "subdirectory", "dotnet-tools.json"); 179_fileSystem.Directory.CreateDirectory(Path.Combine(_temporaryDirectory, "subdirectory")); 323var configDirectory = Path.Combine(_temporaryDirectory, ".config"); 325var configManifestPath = Path.Combine(configDirectory, "dotnet-tools.json"); 431_fileSystem.Directory.CreateDirectory(Path.Combine(_temporaryDirectory, ".git")); 433var currentFolder = Path.Combine(_temporaryDirectory, "subdirectory1", "subdirectory2"); 450_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 472_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 478_fileSystem.Directory.CreateDirectory(Path.Combine(_temporaryDirectory, "test1.sln")); 480var currentFolder = Path.Combine(_temporaryDirectory, "subdirectory1", "subdirectory2"); 497_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue(); 519_fileSystem.File.Exists(Path.Combine(_temporaryDirectory, "dotnet-tools.json")).Should().BeTrue();
CommandTests\Tool\List\ToolListGlobalOrToolPathCommandTests.cs (2)
71var toolPath = Path.GetTempPath(); 87var toolPath = Path.GetTempPath();
CommandTests\Tool\List\ToolListLocalCommandTests.cs (3)
30_temporaryDirectory = Path.GetTempPath(); 31_testManifestPath = Path.Combine(Path.GetTempPath(), "filename");
CommandTests\Tool\Restore\ToolRestoreCommandTests.cs (8)
61_pathToPlacePackages = Path.Combine(_temporaryDirectory, "pathToPlacePackage"); 107new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 355File.WriteAllText(Path.Combine(testDir, "dotnet-tools.json"), configContents); 357string CliHome = Path.Combine(testDir, ".home"); 410File.WriteAllText(Path.Combine(testDir, "dotnet-tools.json"), configContents); 412string CliHome = Path.Combine(testDir, ".home"); 425var cacheFilePath = Path.Combine(CliHome, ".dotnet", "toolResolverCache", "1", "dotnet-ef"); 441new ToolManifestFinder(new DirectoryPath(Path.GetTempPath()), _fileSystem, new FakeDangerousFileDetector());
CommandTests\Tool\Restore\ToolRestoreCommandWithMultipleNugetConfigTests.cs (8)
48string pathToPlacePackages = Path.Combine(temporaryDirectory, "pathToPlacePackage"); 59new DirectoryPath(Path.Combine(temporaryDirectory, "cache")), 65var testRoot = Path.Combine(temporaryDirectory, "testRoot"); 67_nugetConfigUnderTestRoot = Path.Combine(testRoot, "nuget.config"); 69var subDir = Path.Combine(testRoot, "sub"); 71_nugetConfigUnderSubDir = Path.Combine(subDir, "nuget.config"); 120new DirectoryPath(Path.GetDirectoryName(_nugetConfigUnderTestRoot)), 124new DirectoryPath(Path.GetDirectoryName(_nugetConfigUnderSubDir)),
CommandTests\Tool\Run\ToolRunCommandTests.cs (2)
73fileSystem.File.WriteAllText(Path.Combine(testDirectoryRoot.Path, ManifestFilename), 86new DirectoryPath(Path.Combine(temporaryDirectory, "cache")));
CommandTests\Tool\Uninstall\ToolUninstallGlobalOrToolPathCommandTests.cs (8)
37_shimsDirectory = Path.Combine(tempDirectory, "shims"); 38_toolsDirectory = Path.Combine(tempDirectory, "tools"); 72var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 74var shimPath = Path.Combine( 114var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 116var shimPath = Path.Combine( 184var packageDirectory = new DirectoryPath(Path.GetFullPath(_toolsDirectory)) 186var shimPath = Path.Combine(
CommandTests\Tool\Uninstall\ToolUninstallLocalCommandTests.cs (8)
36_temporaryDirectory = Path.Combine(_temporaryDirectoryParent, "sub"); 39_manifestFilePath = Path.Combine(_temporaryDirectory, "dotnet-tools.json"); 40_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonContent); 91var explicitManifestFilePath = Path.Combine(_temporaryDirectory, "subdirectory", "dotnet-tools.json"); 93_fileSystem.Directory.CreateDirectory(Path.Combine(_temporaryDirectory, "subdirectory")); 142var parentManifestFilePath = Path.Combine(_temporaryDirectoryParent, "dotnet-tools.json"); 154var parentManifestFilePath = Path.Combine(_temporaryDirectoryParent, "dotnet-tools.json"); 168var parentManifestFilePath = Path.Combine(_temporaryDirectoryParent, "dotnet-tools.json");
CommandTests\Tool\Update\ToolUpdateGlobalOrToolPathCommandTests.cs (5)
44_shimsDirectory = Path.Combine(_tempDirectory, "shims"); 45_toolsDirectory = Path.Combine(_tempDirectory, "tools"); 117_fileSystem.File.WriteAllText(Path.Combine(_tempDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 122_fileSystem.File.Delete(Path.Combine(_tempDirectory, "nuget.config")); 443return Path.Combine(
CommandTests\Tool\Update\ToolUpdateLocalCommandTests.cs (12)
56_temporaryDirectory = Path.Combine(_temporaryDirectoryParent, "sub"); 58_pathToPlacePackages = Path.Combine(_temporaryDirectory, "pathToPlacePackage"); 98new DirectoryPath(Path.Combine(_temporaryDirectory, "cache")), 101_manifestFilePath = Path.Combine(_temporaryDirectory, "dotnet-tools.json"); 102_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonContent); 147_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, "nuget.config"), _nugetConfigWithInvalidSources); 159_fileSystem.File.Delete(Path.Combine(_temporaryDirectory, "nuget.config")); 227_fileSystem.File.WriteAllText(Path.Combine(_temporaryDirectory, _manifestFilePath), _jsonEmptyContent); 247string explicitManifestFilePath = Path.Combine(_temporaryDirectory, "subdirectory", "dotnet-tools.json"); 249_fileSystem.Directory.CreateDirectory(Path.Combine(_temporaryDirectory, "subdirectory")); 315var parentManifestFilePath = Path.Combine(_temporaryDirectoryParent, "dotnet-tools.json"); 332var parentManifestFilePath = Path.Combine(_temporaryDirectoryParent, "dotnet-tools.json");
CommandTests\VSTest\VSTestTests.cs (9)
34var outputDll = Path.Combine(buildCommand.GetOutputDirectory(configuration: configuration).FullName, $"{testAppName}.dll"); 63var outputDll = Path.Combine(OutputPathCalculator.FromProject(testProjectDirectory).GetOutputDirectory(configuration: configuration), "VSTestTestRunParameters.dll"); 107var outputDll = Path.Combine(testRoot, "bin", configuration, ToolsetInfo.CurrentTargetFramework, $"{testAppName}.dll"); 115Path.GetFileNameWithoutExtension(dotnet).Should().Be("dotnet"); 118result.StartInfo.EnvironmentVariables[dotnetRoot].Should().Be(Path.GetDirectoryName(dotnet)); 132var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, ToolsetInfo.CurrentTargetFramework, "VSTestTestRunParameters.dll"); 134var logFileName = $"{Path.GetTempFileName()}.trx"; 160var testResultsDirectory = new FileInfo(Path.Combine(Environment.CurrentDirectory, "TestResults", logFileName)); 175var outputDll = Path.Combine(testProjectDirectory, "bin", configuration, ToolsetInfo.CurrentTargetFramework, "VSTestTestRunParameters.dll");
CommandTests\Workload\Clean\GivenDotnetWorkloadClean.cs (13)
31var dotnetRoot = Path.Combine(testDirectory, dotnet); 32var userProfileDir = Path.Combine(testDirectory, _profileDirectoryLeafName); 42_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 98var workloadInstallationRecordDirectory = Path.Combine(installRoot, "metadata", "workloads", _sdkFeatureVersion, "InstalledWorkloads"); 146var packRecordPath = Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1", "Test.Pack.A", "1.0.0", sdkBand); 147var packPath = Path.Combine(installRoot, "packs", "Test.Pack.A", "1.0.0"); 148Directory.CreateDirectory(Path.GetDirectoryName(packRecordPath)); 156var packPath = Path.Combine(installRoot, "packs", "Test.Pack.A", "1.0.0"); 164File.WriteAllText(Path.Combine(installationPath, "foo"), ""); 172new DirectoryInfo(Path.GetDirectoryName(Path.GetDirectoryName(extraPackRecordPath))).Should().NotExist(); 184Directory.GetDirectories(Path.Combine(installRoot, "packs")).Length.Should().Be(expectedPackCount); 185Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")).Length.Should().Be(expectedPackRecordCount);
CommandTests\Workload\Install\FailingNuGetPackageInstaller.cs (3)
19MockPackageDir = Path.Combine(testDir, "MockPackages"); 30var mockPackagePath = Path.Combine(MockPackageDir, $"{packageId}.{packageVersion}.nupkg"); 38File.WriteAllText(Path.Combine(targetFolder.Value, "testfile.txt"), string.Empty);
CommandTests\Workload\Install\GivenDotnetWorkloadInstall.cs (47)
28_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 110var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 148var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 181var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 246var cachePath = Path.Combine(_testAssetsManager.CreateTestDirectory(identifier: AppendForUserLocal("mockCache_", userLocal) + sdkVersion).Path, 271var cachePath = Path.Combine(_testAssetsManager.CreateTestDirectory(identifier: AppendForUserLocal("mockCache_", userLocal) + sdkVersion).Path, "mockCachePath"); 329var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "UnsupportedPlatform.json"); 331var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 352var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 353var userProfileDir = Path.Combine(testDirectory, "user-profile"); 354var tmpDir = Path.Combine(testDirectory, "tmp"); 355var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockWorkloadsSample.json"); 385var installRecordPath = Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads"); 387File.Exists(Path.Combine(installRecordPath, existingWorkload)) 389var packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 391var installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 399var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 400var userProfileDir = Path.Combine(testDirectory, "user-profile"); 401var tmpDir = Path.Combine(testDirectory, "tmp"); 402var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockWorkloadsSample.json"); 412string directory = Path.GetDirectoryName(path); 418CreateFile(Path.Combine(dotnetRoot, "sdk", prev7SdkFeatureVersion, "dotnet.dll")); 419CreateFile(Path.Combine(dotnetRoot, "sdk", rc1SdkFeatureVersion, "dotnet.dll")); 438var prev7InstallRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", prev7FormattedFeatureVersion, "InstalledWorkloads"); 440File.Exists(Path.Combine(prev7InstallRecordPath, existingWorkload)) 443var rc1InstallRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", rc1FormattedFeatureVersion, "InstalledWorkloads"); 445File.Exists(Path.Combine(rc1InstallRecordPath, existingWorkload)) 449var packRecordDirs = Directory.GetDirectories(Path.Combine(dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1")); 451var installPacks = Directory.GetDirectories(Path.Combine(dotnetRoot, "packs")); 457featureBandRecords.Select(recordPath => Path.GetFileName(recordPath)) 473var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 474var userProfileDir = Path.Combine(testDirectory, "user-profile"); 505var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 506var userProfileDir = Path.Combine(testDirectory, "user-profile"); 507var tmpDir = Path.Combine(testDirectory, "tmp"); 508var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockWorkloadsSample.json"); 513var rollbackFilePath = Path.Combine(testDirectory, "rollback.json"); 531var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 532var userProfileDir = Path.Combine(testDirectory, "user-profile"); 533var tmpDir = Path.Combine(testDirectory, "tmp"); 534var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockWorkloadsSample.json"); 539var rollbackFilePath = Path.Combine(testDirectory, "rollback.json"); 555var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 556var userProfileDir = Path.Combine(testDirectory, "user-profile"); 557var tmpDir = Path.Combine(testDirectory, "tmp"); 558var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockWorkloadsSample.json"); 584var installRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads");
CommandTests\Workload\Install\GivenFileBasedWorkloadInstall.cs (39)
28_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample2.json"); 37var path = Path.Combine(dotnetRoot, "metadata", "workloads", RuntimeInformation.ProcessArchitecture.ToString(), stringFeatureBand, "InstallState", "default.json"); 81string path = Path.Combine(dotnetRoot, "metadata", "workloads", version.ToString(), "InstalledWorkloads"); 83File.Create(Path.Combine(path, "6.0.100")).Close(); 99string path = Path.Combine(dotnetRoot, "metadata", "workloads", version, "InstalledWorkloads"); 115var net6Path = Path.Combine(dotnetRoot, "metadata", "workloads", version, "InstalledWorkloads"); 119File.WriteAllText(Path.Combine(net6Path, workload), string.Empty); 121var net7Path = Path.Combine(dotnetRoot, "metadata", "workloads", "7.0.100", "InstalledWorkloads"); 123File.WriteAllText(Path.Combine(net7Path, workloads.First()), string.Empty); 136var expectedPath = Path.Combine(dotnetRoot, "metadata", "workloads", version, "InstalledWorkloads", workloadId.ToString()); 159var installationRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1", packId, packVersion, version); 162Directory.Exists(Path.Combine(dotnetRoot, "packs", packId, packVersion)).Should().BeTrue(); 179var installationRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1", packId, packVersion, version); 185File.Exists(Path.Combine(dotnetRoot, "template-packs", $"{packId}.{packVersion}.nupkg".ToLowerInvariant())).Should().BeTrue(); 206Directory.Exists(Path.Combine(dotnetRoot, "packs", packId, packVersion)).Should().BeTrue(); 234Directory.CreateDirectory(Path.Combine(dotnetRoot, "packs", packId, packVersion)); 258Directory.Exists(Path.Combine(dotnetRoot, "packs", packId, packVersion)).Should().BeFalse(); 267CreatePackInfo("Xamarin.Android.Sdk", "8.4.7", WorkloadPackKind.Library, Path.Combine(dotnetRoot, "packs", "Xamarin.Android.Sdk", "8.4.7"), "Xamarin.Android.Sdk"), 268CreatePackInfo("Xamarin.Android.Framework", "8.4.0", WorkloadPackKind.Framework, Path.Combine(dotnetRoot, "packs", "Xamarin.Android.Framework", "8.4.0"), "Xamarin.Android.Framework") 272CreatePackInfo("Test.Pack.A", "1.0.0", WorkloadPackKind.Sdk, Path.Combine(dotnetRoot, "packs", "Test.Pack.A", "1.0.0"), "Test.Pack.A"), 273CreatePackInfo("Test.Pack.B", "2.0.0", WorkloadPackKind.Framework, Path.Combine(dotnetRoot, "packs", "Test.Pack.B", "2.0.0"), "Test.Pack.B"), 278var installedPacksPath = Path.Combine(dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1"); 281Directory.CreateDirectory(Path.Combine(dotnetRoot, "metadata", "workloads", sdkVersion, "InstalledWorkloads")); 284var packRecordPath = Path.Combine(installedPacksPath, pack.Id, pack.Version, sdkVersion); 285Directory.CreateDirectory(Path.GetDirectoryName(packRecordPath)); 292var installedWorkloadsPath = Path.Combine(dotnetRoot, "metadata", "workloads", sdkVersions[1], "InstalledWorkloads", "xamarin-android-build"); 306var expectedRecordPath = Path.Combine(installedPacksPath, pack.Id, pack.Version, sdkVersions[1]); 350var installedPacksPath = Path.Combine(dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1"); 351var packRecordPath = Path.Combine(installedPacksPath, packId, packVersion, version); 352Directory.CreateDirectory(Path.GetDirectoryName(packRecordPath)); 356Directory.CreateDirectory(Path.Combine(dotnetRoot, "packs", packId, packVersion)); 359var workloadsRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", version, "InstalledWorkloads"); 361File.Create(Path.Combine(workloadsRecordPath, "android-sdk-workload")).Close(); 383var cachePath = Path.Combine(dotnetRoot, "MockCache"); 387var nupkgPath = Path.Combine(cachePath, $"{packId}.{packVersion}.nupkg"); 400var installationRecordPath = Path.Combine(dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1", packId, packVersion, version); 402Directory.Exists(Path.Combine(dotnetRoot, "packs", packId, packVersion)).Should().BeTrue(); 412var cachePath = Path.Combine(dotnetRoot, "MockCache"); 425var dotnetRoot = Path.Combine(testDirectory, "dotnet");
CommandTests\Workload\Install\GivenWorkloadManifestUpdater.cs (103)
99var dotnetRoot = Path.Combine(testDir, "dotnet"); 106var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", featureBand); 107var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", featureBand); 112Directory.CreateDirectory(Path.Combine(installedManifestDir, manifestUpdate.ManifestId.ToString())); 113File.WriteAllText(Path.Combine(installedManifestDir, manifestUpdate.ManifestId.ToString(), _manifestFileName), GetManifestContent(manifestUpdate.ExistingVersion)); 114Directory.CreateDirectory(Path.Combine(adManifestDir, manifestUpdate.ManifestId.ToString())); 115File.WriteAllText(Path.Combine(adManifestDir, manifestUpdate.ManifestId.ToString(), _manifestFileName), GetManifestContent(manifestUpdate.NewVersion)); 119Directory.CreateDirectory(Path.Combine(installedManifestDir, manifest.ToString())); 120File.WriteAllText(Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName), GetManifestContent(new ManifestVersion("5.0.0"))); 121Directory.CreateDirectory(Path.Combine(adManifestDir, manifest.ToString())); 122File.WriteAllText(Path.Combine(adManifestDir, manifest.ToString(), _manifestFileName), GetManifestContent(new ManifestVersion("5.0.0"))); 127.Select(manifest => Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName)) 133var manifestUpdater = new WorkloadManifestUpdater(_reporter, workloadResolver, nugetDownloader, userProfileDir: Path.Combine(testDir, ".dotnet"), installationRepo, new MockPackWorkloadInstaller(dotnetRoot)); 145var dotnetRoot = Path.Combine(testDir, "dotnet"); 153var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", currentFeatureBand); 157var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", manifestUpdate.ExistingFeatureBand); 163Directory.CreateDirectory(Path.Combine(installedManifestDir, manifestUpdate.ManifestId.ToString())); 164File.WriteAllText(Path.Combine(installedManifestDir, manifestUpdate.ManifestId.ToString(), _manifestFileName), GetManifestContent(manifestUpdate.ExistingVersion)); 166var AdManifestPath = Path.Combine(adManifestDir, manifestUpdate.ManifestId.ToString()); 168File.WriteAllText(Path.Combine(AdManifestPath, _manifestFileName), GetManifestContent(manifestUpdate.NewVersion)); 169File.WriteAllText(Path.Combine(AdManifestPath, "AdvertisedManifestFeatureBand.txt"), manifestUpdate.NewFeatureBand); 174var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", currentFeatureBand); 180Directory.CreateDirectory(Path.Combine(installedManifestDir, manifest.ToString())); 181File.WriteAllText(Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName), GetManifestContent(new ManifestVersion("5.0.0"))); 183var AdManifestPath = Path.Combine(adManifestDir, manifest.ToString()); 185File.WriteAllText(Path.Combine(AdManifestPath, _manifestFileName), GetManifestContent(new ManifestVersion("5.0.0"))); 186File.WriteAllText(Path.Combine(AdManifestPath, "AdvertisedManifestFeatureBand.txt"), currentFeatureBand); 190manifest => (manifest.ManifestId.ToString(), Path.Combine(testDir, "dotnet", "sdk-manifests", manifest.ExistingFeatureBand, manifest.ManifestId.ToString(), "WorkloadManifest.json"), manifest.ExistingVersion.ToString(), manifest.ExistingFeatureBand)) 192manifestId => (manifestId.ToString(), Path.Combine(testDir, "dotnet", "sdk-manifests", currentFeatureBand, manifestId.ToString(), "WorkloadManifest.json"), "2.0.0", currentFeatureBand))) 202var manifestUpdater = new WorkloadManifestUpdater(_reporter, workloadResolver, nugetDownloader, userProfileDir: Path.Combine(testDir, ".dotnet"), installationRepo, new MockPackWorkloadInstaller(dotnetRoot)); 222var dotnetRoot = Path.Combine(testDir, "dotnet"); 223var installedManifestDir6_0_200 = Path.Combine(dotnetRoot, "sdk-manifests", "6.0.200"); 225var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", sdkFeatureBand); 230Directory.CreateDirectory(Path.Combine(installedManifestDir6_0_200, testManifestName)); 231File.WriteAllText(Path.Combine(installedManifestDir6_0_200, testManifestName, _manifestFileName), GetManifestContent(new ManifestVersion("1.0.0"))); 233string manifestPath = Path.Combine(installedManifestDir6_0_200, testManifestName, _manifestFileName); 244var manifestUpdater = new WorkloadManifestUpdater(_reporter, workloadResolver, nugetDownloader, Path.Combine(testDir, ".dotnet"), installationRepo, new MockPackWorkloadInstaller(dotnetRoot)); 249offlineCacheDir = Path.Combine(testDir, "offlineCache"); 251File.Create(Path.Combine(offlineCacheDir, $"{testManifestName}.Manifest-6.0.200.nupkg")).Close(); 273var advertisedManifestContents = File.ReadAllText(Path.Combine(adManifestDir, testManifestName, "WorkloadManifest.json")); 277var savedFeatureBand = File.ReadAllText(Path.Combine(adManifestDir, testManifestName, "AdvertisedManifestFeatureBand.txt")); 301var dotnetRoot = Path.Combine(testDir, "dotnet"); 303var emptyInstalledManifestsDir = Path.Combine(dotnetRoot, "sdk-manifests", "6.0.200"); 306var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", sdkFeatureBand); 310Directory.CreateDirectory(Path.Combine(emptyInstalledManifestsDir, testManifestName)); 311File.WriteAllText(Path.Combine(emptyInstalledManifestsDir, testManifestName, _manifestFileName), GetManifestContent(new ManifestVersion("1.0.0"))); 313var workloadManifestProvider = new MockManifestProvider((testManifestName, Path.Combine(emptyInstalledManifestsDir, testManifestName, _manifestFileName), "1.0.0", "6.0.200")) 321var manifestUpdater = new WorkloadManifestUpdater(_reporter, workloadResolver, nugetDownloader, Path.Combine(testDir, ".dotnet"), installationRepo, new MockPackWorkloadInstaller(dotnetRoot)); 326offlineCacheDir = Path.Combine(testDir, "offlineCache"); 367var dotnetRoot = Path.Combine(testDir, "dotnet"); 369var emptyInstalledManifestsDir = Path.Combine(dotnetRoot, "sdk-manifests", "6.0.300"); 372var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", sdkFeatureBand); 376Directory.CreateDirectory(Path.Combine(emptyInstalledManifestsDir, testManifestName)); 377File.WriteAllText(Path.Combine(emptyInstalledManifestsDir, testManifestName, _manifestFileName), GetManifestContent(new ManifestVersion("1.0.0"))); 379var workloadManifestProvider = new MockManifestProvider(Path.Combine(emptyInstalledManifestsDir, testManifestName, _manifestFileName)) 387var manifestUpdater = new WorkloadManifestUpdater(_reporter, workloadResolver, nugetDownloader, Path.Combine(testDir, ".dotnet"), installationRepo, new MockPackWorkloadInstaller(dotnetRoot)); 392offlineCacheDir = Path.Combine(testDir, "offlineCache"); 423var dotnetRoot = Path.Combine(testDir, "dotnet"); 429var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", currentFeatureBand); 430var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", currentFeatureBand); 435Directory.CreateDirectory(Path.Combine(installedManifestDir, manifestUpdate.ManifestId.ToString())); 436File.WriteAllText(Path.Combine(installedManifestDir, manifestUpdate.ManifestId.ToString(), _manifestFileName), GetManifestContent(manifestUpdate.ExistingVersion)); 440var rollbackDefPath = Path.Combine(testDir, "testRollbackDef.txt"); 444.Select(manifest => Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName)) 461var dotnetRoot = Path.Combine(testDir, "dotnet"); 467var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", featureBand); 468var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", featureBand); 473Directory.CreateDirectory(Path.Combine(installedManifestDir, manifestId.ToString())); 474File.WriteAllText(Path.Combine(installedManifestDir, manifestId.ToString(), _manifestFileName), GetManifestContent(existingVersion)); 478Directory.CreateDirectory(Path.Combine(installedManifestDir, "test-manifest-3")); 479File.WriteAllText(Path.Combine(installedManifestDir, "test-manifest-3", _manifestFileName), GetManifestContent(new ManifestVersion("1.0.0"))); 482var rollbackDefPath = Path.Combine(testDir, "testRollbackDef.txt"); 487.Select(manifest => Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName)) 504var dotnetRoot = Path.Combine(testDir, "dotnet"); 510var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", featureBand); 511var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", featureBand); 516Directory.CreateDirectory(Path.Combine(installedManifestDir, manifestId.ToString())); 517File.WriteAllText(Path.Combine(installedManifestDir, manifestId.ToString(), _manifestFileName), GetManifestContent(existingVersion)); 525var rollbackDefPath = Path.Combine(testDir, "testRollbackDef.txt"); 529.Select(manifest => Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName)) 547var dotnetRoot = Path.Combine(testDir, "dotnet"); 550var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", featureBand); 551var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", featureBand); 553Directory.CreateDirectory(Path.Combine(installedManifestDir, manifestId)); 554File.WriteAllText(Path.Combine(installedManifestDir, manifestId, _manifestFileName), GetManifestContent(new ManifestVersion("1.0.0"))); 557var offlineCache = Path.Combine(testDir, "cache"); 559File.Create(Path.Combine(offlineCache, $"{manifestId}.manifest-{featureBand}.2.0.0.nupkg")).Close(); 560File.Create(Path.Combine(offlineCache, $"{manifestId}.manifest-{featureBand}.3.0.0.nupkg")).Close(); 562var workloadManifestProvider = new MockManifestProvider(new string[] { Path.Combine(installedManifestDir, manifestId, _manifestFileName) }); 572installer.ExtractCallParams[0].Item1.Should().Be(Path.Combine(offlineCache, $"{manifestId}.manifest-{featureBand}.3.0.0.nupkg")); 586Directory.CreateDirectory(Path.Combine(testInstance.Path, ".dotnet")); 587File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", $".workloadAdvertisingUpdates{sdkFeatureBand}"), @"[""maui""]"); 589File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", $".workloadAdvertisingManifestSentinel{sdkFeatureBand}"), string.Empty); 624Directory.CreateDirectory(Path.Combine(testInstance.Path, ".dotnet")); 625File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", $".workloadAdvertisingUpdates6.0.100"), @"[""maui""]"); 627File.WriteAllText(Path.Combine(testInstance.Path, ".dotnet", ".workloadAdvertisingManifestSentinel" + sdkFeatureBand.ToString()), string.Empty); 703var dotnetRoot = Path.Combine(testDir, "dotnet"); 706var installedManifestDir = Path.Combine(testDir, "dotnet", "sdk-manifests", featureBand); 707var adManifestDir = Path.Combine(testDir, ".dotnet", "sdk-advertising", featureBand); 712Directory.CreateDirectory(Path.Combine(installedManifestDir, manifest.ToString())); 713File.WriteAllText(Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName), GetManifestContent(new ManifestVersion("1.0.0"))); 717.Select(manifest => Path.Combine(installedManifestDir, manifest.ToString(), _manifestFileName)) 728var sentinelPath = Path.Combine(testDir, _manifestSentinelFileName + featureBand);
CommandTests\Workload\Install\MockManifestProvider.cs (3)
18string manifestId = Path.GetFileNameWithoutExtension(Path.GetDirectoryName(mp)); 42Path.GetDirectoryName(path),
CommandTests\Workload\Install\MockPackWorkloadInstaller.cs (7)
48_dotnetDir = dotnetDir ?? Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 74var installStatePath = Path.Combine(Path.GetTempPath(), "dotnetTestPath", "metadata", "workloads", sdkFeatureBand.ToString(), "InstallState", "default.json"); 208File.WriteAllText(Path.Combine(targetPath, "WorkloadManifest.json"), manifestContents); 220string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, _dotnetDir), "default.json"); 231string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, _dotnetDir), "default.json"); 232Directory.CreateDirectory(Path.GetDirectoryName(path));
CommandTests\Workload\Install\WorkloadGarbageCollectionTests.cs (27)
57var workloadsRecordPath = Path.Combine(_dotnetRoot, "metadata", "workloads", sdkVersions[1], "InstalledWorkloads"); 59File.Create(Path.Combine(workloadsRecordPath, "xamarin-android-build")).Close(); 91var installedPacksPath = Path.Combine(_dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1"); 128var workloadsRecordPath = Path.Combine(_dotnetRoot, "metadata", "workloads", "6.0.300", "InstalledWorkloads"); 130File.Create(Path.Combine(workloadsRecordPath, "xamarin-android-build")).Close(); 163new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.100", "testmanifest", "1.0.0", "WorkloadManifest.json")).Should().NotExist(); 164new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "2.0.0", "WorkloadManifest.json")).Should().NotExist(); 165new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "3.0.0", "WorkloadManifest.json")).Should().Exist(); 208var workloadsRecordPath = Path.Combine(_dotnetRoot, "metadata", "workloads", "6.0.300", "InstalledWorkloads"); 210File.Create(Path.Combine(workloadsRecordPath, "xamarin-android-build")).Close(); 243new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.100", "testmanifest", "1.0.0", "WorkloadManifest.json")).Should().NotExist(); 244new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "2.0.0", "WorkloadManifest.json")).Should().Exist(); 245new FileInfo(Path.Combine(_dotnetRoot, "sdk-manifests", "6.0.300", "testmanifest", "3.0.0", "WorkloadManifest.json")).Should().NotExist(); 303path = Path.Combine(_dotnetRoot, "library-packs", $"{resolvedPackageId}.{version}.nupkg"); 307path = Path.Combine(_dotnetRoot, "packs", id, version); 315var installedPacksPath = Path.Combine(_dotnetRoot, "metadata", "workloads", "InstalledPacks", "v1"); 316var packRecordPath = Path.Combine(installedPacksPath, pack.Id, pack.Version, sdkFeatureBand); 325Directory.CreateDirectory(Path.GetDirectoryName(packRecordPath.FullName)); 332Directory.CreateDirectory(Path.GetDirectoryName(pack.Path)); 343var installStateFolder = Path.Combine(_dotnetRoot!, "metadata", "workloads", RuntimeInformation.ProcessArchitecture.ToString(), featureBand, "InstallState"); 346string installStatePath = Path.Combine(installStateFolder, "default.json"); 356_dotnetRoot = Path.Combine(_testDirectory, "dotnet"); 365var manifestDirectory = Path.Combine(_dotnetRoot, "sdk-manifests", featureBand, manifestId); 368manifestDirectory = Path.Combine(manifestDirectory, manifestVersion); 373string manifestSourcePath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), sourceManifestName); 375File.Copy(manifestSourcePath, Path.Combine(manifestDirectory, "WorkloadManifest.json")); 380return new FileInfo(Path.Combine(_dotnetRoot, "metadata", "workloads", "InstalledManifests", "v1", manifestId.ToLowerInvariant(), manifestVersion, manifestFeatureBand, referencingFeatureBand));
CommandTests\Workload\Install\WorkloadInstallAspireDeprecationTests.cs (7)
26var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 27var userProfileDir = Path.Combine(testDirectory, "user-profile"); 61var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 62var userProfileDir = Path.Combine(testDirectory, "user-profile"); 97var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 98var userProfileDir = Path.Combine(testDirectory, "user-profile"); 127private string _manifestPath => Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json");
CommandTests\Workload\List\GivenAnMsiInstallation.cs (1)
60Registry.CurrentUser.CreateSubKey(Path.Combine(RecordManager.BasePath, "6.0.300"));
CommandTests\Workload\List\GivenDotnetWorkloadList.cs (5)
26_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockListSample.json"); 105var userProfileDir = Path.Combine(testDirectory, "user-profile"); 106var manifestPath = Path.Combine(userProfileDir, "sdk-advertising", "6.0.100", "SampleManifest", "WorkloadManifest.json"); 107Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)); 108File.Copy(Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockListSampleUpdated.json"), manifestPath);
CommandTests\Workload\List\GivenWorkloadInstallerAndWorkloadsInstalled.cs (2)
47_dotnetRoot = Path.Combine(_testDirectory, "dotnet"); 107string manifestFile = Path.Combine(_testDirectory, u.update.ManifestId.ToString() + ".json");
CommandTests\Workload\Repair\GivenDotnetWorkloadRepair.cs (18)
28_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 38var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 39var userProfileDir = Path.Combine(testDirectory, "user-profile"); 64var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 65var userProfileDir = Path.Combine(testDirectory, "user-profile"); 87var extraPackRecordPath = Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1", "Test.Pack.A", "1.0.0", sdkFeatureVersion); 88Directory.CreateDirectory(Path.GetDirectoryName(extraPackRecordPath)); 89var extraPackPath = Path.Combine(installRoot, "packs", "Test.Pack.A", "1.0.0"); 100Directory.Exists(Path.GetDirectoryName(Path.GetDirectoryName(extraPackRecordPath))).Should().BeFalse(); 104Directory.GetDirectories(Path.Combine(installRoot, "packs")).Length.Should().Be(7); 105Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")).Length.Should().Be(8); 114var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 115var userProfileDir = Path.Combine(testDirectory, "user-profile"); 137var deletedPackRecordPath = Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1", "Xamarin.Android.Sdk", "8.4.7", sdkFeatureVersion); 139var deletedPackPath = Path.Combine(installRoot, "packs", "Xamarin.Android.Sdk"); 151Directory.GetDirectories(Path.Combine(installRoot, "packs")).Length.Should().Be(7); 152Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")).Length.Should().Be(8);
CommandTests\Workload\Restore\DiscoverAllProjectsTests.cs (10)
23result.Should().Contain(f => Path.GetFileName(f) == "App.csproj"); 38Path.Combine(projectDirectory, "App.sln"), 39Path.Combine(projectDirectory, "Lib", "Lib.csproj") 43result.Should().Contain(f => Path.GetFileName(f) == "App.csproj", "from checking the sln file"); 44result.Should().Contain(f => Path.GetFileName(f) == "Lib.csproj", "from directly pass in"); 56WorkloadRestoreCommand.DiscoverAllProjects(Path.Combine(projectDirectory, "Multiple")); 58result.Should().Contain(f => Path.GetFileName(f) == "First.csproj"); 59result.Should().Contain(f => Path.GetFileName(f) == "Second.csproj"); 74Path.Combine(projectDirectory, "App.sln"), 78result.Should().Contain(f => Path.GetFileName(f) == "App.csproj", "from checking the sln file");
CommandTests\Workload\Uninstall\GivenDotnetWorkloadUninstall.cs (37)
23var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 24var userProfileDir = Path.Combine(testDirectory, "user-profile"); 35var installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 37File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", fakeWorkloadNameToInstall)) 39var packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 49_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "MockWorkloadsSample.json"); 74var installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 76File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installingWorkload)) 78var packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 103var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 104var userProfileDir = Path.Combine(testDirectory, "user-profile"); 119var installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 121File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installedWorkload)) 123File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", uninstallingWorkload)) 125var packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 131installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 133File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", uninstallingWorkload)) 135File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installedWorkload)) 137packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 147var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 148var userProfileDir = Path.Combine(testDirectory, "user-profile"); 155string directory = Path.GetDirectoryName(path); 161CreateFile(Path.Combine(dotnetRoot, "sdk", prevSdkFeatureVersion, "dotnet.dll")); 162CreateFile(Path.Combine(dotnetRoot, "sdk", sdkFeatureVersion, "dotnet.dll")); 175var installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 177File.Exists(Path.Combine(installRoot, "metadata", "workloads", prevSdkFeatureVersion, "InstalledWorkloads", uninstallingWorkload)) 179File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", uninstallingWorkload)) 181var packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 183var featureBandMarkerFiles = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")) 191installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 193File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", uninstallingWorkload)) 195File.Exists(Path.Combine(installRoot, "metadata", "workloads", prevSdkFeatureVersion, "InstalledWorkloads", uninstallingWorkload)) 197packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 203var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 204var userProfileDir = Path.Combine(testDirectory, "user-profile"); 218var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 219var userProfileDir = Path.Combine(testDirectory, "user-profile");
CommandTests\Workload\Update\GivenDotnetWorkloadUpdate.cs (55)
34_manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 79Path.Combine(Path.GetTempPath(), "dotnetTestPath"), 116var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 117var userProfileDir = Path.Combine(testDirectory, "user-profile"); 139var installPacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 145File.Exists(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1", "Xamarin.Android.Sdk", "8.4.7", "6.0.100")) // Original pack version is installed 147File.Exists(Path.Combine(installRoot, "template-packs", "xamarin.android.templates.1.0.3.nupkg")) 150File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installingWorkload)) 152var packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 163new MockManifestProvider(new[] { Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleUpdatedManifest"), "Sample.json") }), 173var updatePacks = Directory.GetDirectories(Path.Combine(installRoot, "packs")); 179File.Exists(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1", "Xamarin.Android.Sdk", "8.5.7", "6.0.100")) // New pack version is installed 181File.Exists(Path.Combine(installRoot, "template-packs", "xamarin.android.templates.2.1.3.nupkg")) 184File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installingWorkload)) 186packRecordDirs = Directory.GetDirectories(Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1")); 202var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 203var userProfileDir = Path.Combine(testDirectory, "user-profile"); 204var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "BasicSample.json"); 212string dotnetDllPath = Path.Combine(dotnetRoot, "sdk", "5.0.110", "dotnet.dll"); 213Directory.CreateDirectory(Path.GetDirectoryName(dotnetDllPath)); 225CreatePackInfo("mock-pack-1", "1.0.0", WorkloadPackKind.Framework, Path.Combine(installRoot, "packs", "mock-pack-1", "1.0.0"), "mock-pack-1"), 226CreatePackInfo("mock-pack-2", "2.0.0", WorkloadPackKind.Framework, Path.Combine(installRoot, "packs", "mock-pack-2", "2.0.0"), "mock-pack-2") 231var packRecordDir = Path.Combine(installRoot, "metadata", "workloads", "InstalledPacks", "v1"); 234Directory.CreateDirectory(Path.Combine(packRecordDir, pack.Id, pack.Version)); 235File.Create(Path.Combine(packRecordDir, pack.Id, pack.Version, oldFeatureBand)).Close(); 237Directory.CreateDirectory(Path.Combine(installRoot, "metadata", "workloads", oldFeatureBand, "InstalledWorkloads")); 238Directory.CreateDirectory(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads")); 239File.Create(Path.Combine(installRoot, "metadata", "workloads", oldFeatureBand, "InstalledWorkloads", installingWorkload)).Close(); 240File.Create(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installingWorkload)).Close(); 247var installStatePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(new SdkFeatureBand(sdkFeatureVersion), installRoot), "default.json"); 253Directory.CreateDirectory(Path.GetDirectoryName(installStatePath)); 263File.Exists(Path.Combine(packRecordDir, pack.Id, pack.Version, oldFeatureBand)) 266File.Exists(Path.Combine(installRoot, "metadata", "workloads", oldFeatureBand, "InstalledWorkloads", installingWorkload)) 268File.Exists(Path.Combine(installRoot, "metadata", "workloads", sdkFeatureVersion, "InstalledWorkloads", installingWorkload)) 296string dotnetDir = Path.Combine(testDir.Path, "dotnet"); 297string userProfileDir = Path.Combine(testDir.Path, "userProfileDir"); 324var installStatePath = Path.Combine(dotnetDir, "metadata", "workloads", RuntimeInformation.ProcessArchitecture.ToString(), sdkVersion, "InstallState", "default.json"); 328Directory.CreateDirectory(Path.GetDirectoryName(installStatePath)); 380new WorkloadManifestInfo("Microsoft.NET.Sdk.iOS", "17.4.3", Path.Combine(testDirectory, "iosManifest"), "9.0.100"), 381new WorkloadManifestInfo("Microsoft.NET.Sdk.macOS", "14.4.3", Path.Combine(testDirectory, "macosManifest"), "9.0.100"), 382new WorkloadManifestInfo("Microsoft.NET.Sdk.Maui", "14.4.3", Path.Combine(testDirectory, "mauiManifest"), "9.0.100") 389workloadResolverFactory: new MockWorkloadResolverFactory(Path.Combine(testDirectory, "dotnet"), "9.0.100", resolver, userProfileDir: testDirectory), 421var cachePath = Path.Combine(_testAssetsManager.CreateTestDirectory(identifier: "cachePath").Path, "mockCachePath"); 487var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 488var userProfileDir = Path.Combine(testDirectory, "user-profile"); 550var defaultJsonPath = Path.Combine(dotnetPath, "metadata", "workloads", RuntimeInformation.ProcessArchitecture.ToString(), "6.0.300", "InstallState", "default.json"); 588var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 589var userProfileDir = Path.Combine(testDirectory, "user-profile"); 593var rollbackFilePath = Path.Combine(testDirectory, "rollback.json"); 626var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 628CreatePackInfo("Xamarin.Android.Sdk", "8.4.7", WorkloadPackKind.Sdk, Path.Combine(dotnetRoot, "packs", "Xamarin.Android.Sdk", "8.4.7"), "Xamarin.Android.Sdk"), 629CreatePackInfo("Xamarin.Android.Framework", "8.2.0", WorkloadPackKind.Framework, Path.Combine(dotnetRoot, "packs", "Xamarin.Android.Framework", "8.2.0"), "Xamarin.Android.Framework") 635var copiedManifestFolder = Path.Combine(dotnetRoot, "sdk-manifests", new SdkFeatureBand(sdkVersion).ToString(), "SampleManifest"); 637var copiedManifestFile = Path.Combine(copiedManifestFolder, "WorkloadManifest.json");
CompletionTests\DotnetCliSnapshotTests.cs (2)
24settings.UseDirectory(Path.Combine(Environment.CurrentDirectory, "snapshots", provider.ArgumentName)); 29settings.UseDirectory(Path.Combine("snapshots", provider.ArgumentName));
CompletionTests\VerifySettings.cs (1)
17directory: Path.Combine(Environment.CurrentDirectory, "snapshots"),
ConfigurerTests\GivenAFirstTimeUseNoticeSentinel.cs (1)
77var sentinel = Path.Combine(DOTNET_USER_PROFILE_FOLDER_PATH, FirstTimeUseNoticeSentinel.SENTINEL);
ConfigurerTests\GivenAFunctionReturnStringAndFakeFileSystem.cs (2)
55var path = Path.Combine("some path", $"{Product.Version}_fooKey.dotnetUserLevelCache"); 63var cacheFilePath = Path.Combine("some path", $"fooCache.dotnetUserLevelCache");
crossgen.Tests.cs (5)
23cliPath = Path.GetDirectoryName(cliPath) ?? string.Empty; 33sharedFxPath = Path.GetDirectoryName(sharedFxPath) ?? string.Empty; 64foreach (string path in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator)) 66string dotnetPath = Path.Combine(path, dotnetExecutable); 69var directoryName = Path.GetDirectoryName(dotnetPath);
GivenParserDirectives.cs (1)
15File.WriteAllText(Path.Combine(Directory.GetCurrentDirectory(), "response.rsp"), "build");
GivenThatICareAboutVBApps.cs (1)
49var outputDll = Path.Combine(
GivenThatTheUserIsRunningDotNetForTheFirstTime.cs (7)
23var testNuGetHome = Path.Combine(TestDirectory, "nuget_home"); 24var cliTestFallbackFolder = Path.Combine(testNuGetHome, ".dotnet", "NuGetFallbackFolder"); 25var profiled = Path.Combine(TestDirectory, "profile.d"); 26var pathsd = Path.Combine(TestDirectory, "paths.d"); 38DotDotnetFolder = new DirectoryInfo(Path.Combine(testNuGetHome, ".dotnet")); 220var profiled = Path.Combine(dotnetFirstTime.TestDirectory, "profile.d"); 236var pathsd = Path.Combine(dotnetFirstTime.TestDirectory, "paths.d");
GivenThatWeWantToBeBackwardsCompatibleWith1xProjects.cs (3)
22ChangeProjectTargetFramework(Path.Combine(testInstance.Path, $"{testAppName}.csproj"), target); 32var outputDll = Path.Combine(buildCommand.GetOutputDirectory(target, configuration).FullName, $"{testAppName}.dll"); 51ChangeProjectTargetFramework(Path.Combine(testInstance.Path, $"{testAppName}.csproj"), target);
NuGetSignatureVerificationEnablerTests.cs (2)
14private static readonly string FakeFilePath = Path.Combine(Path.GetTempPath(), "file.fake");
OutputPathOptionTests.cs (1)
63string outputDirectory = Path.Combine(slnDirectory, "bin");
PackagedCommandTests.cs (2)
91projectFolder = Path.GetDirectoryName(projectPath); 115var toolFolder = Path.Combine(projectFolder,
ParserTests\ResponseFileTests.cs (2)
19var tempFilePath = Path.Combine(tempFileDir, "params.rsp"); 49var tempFilePath = Path.Combine(tempFileDir, "skips.rsp");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
RuntimeConfigTests.cs (2)
126return Path.Combine(_testAssetsManager.CreateTestDirectory(callingMethod).Path, Path.GetTempFileName());
ShellShimTests\AppHostShellShimMakerTests.cs (8)
35var tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 37var appHostShellShimMaker = new AppHostShellShimMaker(Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "AppHostTemplate")); 38string shimPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 41new FilePath(Path.GetFullPath(Path.Combine("WpfBinaryTestAssets", "testwpf.dll"))),
ShellShimTests\ShellShimRepositoryTests.cs (24)
33var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 51var relativePathToShim = Path.GetRelativePath( 56var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 79var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 101var extraNonExistDirectory = Path.GetRandomFileName(); 102var shellShimRepository = new ShellShimRepository(new DirectoryPath(Path.Combine(testFolder, extraNonExistDirectory)), GetAppHostTemplateFromStage2()); 103var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 120var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 138var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 183var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 226var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 253var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 284var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 322var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 362var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 365var dummyShimPath = Path.Combine(packagedShimFolder, shellCommandName); 391var shellCommandName = nameof(ShellShimRepositoryTests) + Path.GetRandomFileName(); 394var dummyShimPath = Path.Combine(packagedShimFolder, shellCommandName); 438File.WriteAllText(Path.Combine(pathToPlaceShim, shellCommandName), string.Empty); 447var file = Path.Combine(cleanFolderUnderTempRoot, shellCommandName + ".exe"); 457var file = Path.Combine(cleanFolderUnderTempRoot, shellCommandName); 492Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "AppHostTemplate"); 512return new FilePath(Path.Combine(outputDirectory.FullName, $"{testAppName}.dll")); 517return _testAssetsManager.CreateTestDirectory(testName: callingMethod, identifier: "cleanfolder" + identifier + Path.GetRandomFileName()).Path;
TelemetryTests\SenderTests.cs (2)
171string tempPath = Path.Combine(_testAssetsManager.CreateTestDirectory("TestStorageService", identifier: testName).Path, Path.GetTempFileName());
TestFolderTests.cs (2)
21static string GetThisFolderPath([CallerFilePath] string filePath = null) => Path.GetDirectoryName(filePath); 23var srcTestsFolderPath = Path.Combine(GetThisFolderPath(), @"..\..\src\Tests");
ToolManifestTests\ToolManifestEditorTests.cs (11)
29string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 72string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 100string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 128string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 148string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 172string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 186string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 213string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 232string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 253string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename); 271string manifestFile = Path.Combine(_testDirectoryRoot, _manifestFilename);
ToolManifestTests\ToolManifestFinderTests.cs (60)
48_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 63var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 64_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 79var dotnetconfigDirectory = Path.Combine(_testDirectoryRoot, ".config"); 81_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 101var dotnetconfigDirectory = Path.Combine(rootDirectory.Value, ".config"); 103_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 139var dotnetconfigDirectory = Path.Combine(rootDirectory.Value, ".config"); 141_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 162var dotnetconfigDirectory = Path.Combine(rootDirectory.Value, ".config"); 164_fileSystem.File.WriteAllText(Path.Combine(dotnetconfigDirectory, _manifestFilename), _jsonContent); 203_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 222_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, customFileName), _jsonContent); 230toolManifest.Find(new FilePath(Path.Combine(_testDirectoryRoot, customFileName))); 255Action a = () => toolManifest.Find(new FilePath(Path.Combine(_testDirectoryRoot, "non-exists"))); 258Path.Combine(_testDirectoryRoot, "non-exists"), 279_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithMissingField); 290Path.Combine(_testDirectoryRoot, _manifestFilename), 299_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithInvalidField); 316Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithInvalidType); 333Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonInvalidJsonInterger); 348var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 350_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 352_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 392var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 394string manifestFileInParentDirectory = Path.Combine(_testDirectoryRoot, _manifestFilename); 397string manifestFileInSubDirectory = Path.Combine(subdirectoryOfTestRoot, _manifestFilename); 429var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 446var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 448_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 450_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 466_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContentHigherVersion); 483_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContentIsRootMissing); 498_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 518_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 538var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 539_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContent); 571_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithMissingField); 585_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonWithInvalidField); 599_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), _jsonContentInvalidJson); 613var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 615_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 617_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 638var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 640_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 642_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 658string manifestFilePath = Path.Combine(_testDirectoryRoot, _manifestFilename); 676_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 692string manifestPath = Path.Combine(_testDirectoryRoot, _manifestFilename); 708string manifestPath = Path.Combine(_testDirectoryRoot, _manifestFilename); 739var subdirectoryOfTestRoot = Path.Combine(_testDirectoryRoot, "sub"); 741_fileSystem.File.WriteAllText(Path.Combine(_testDirectoryRoot, _manifestFilename), 743_fileSystem.File.WriteAllText(Path.Combine(subdirectoryOfTestRoot, _manifestFilename), 749.SourceManifest.Value.Should().Be(Path.Combine(_testDirectoryRoot, "sub", _manifestFilename)); 752.SourceManifest.Value.Should().Be(Path.Combine(_testDirectoryRoot, _manifestFilename)); 755.SourceManifest.Value.Should().Be(Path.Combine(_testDirectoryRoot, "sub", _manifestFilename)); 761var testRoot = Path.Combine(_testDirectoryRoot); 778createdManifest.Value.Should().Be(Path.Combine(_testDirectoryRoot, "dotnet-tools.json")); 779_fileSystem.File.Exists(Path.Combine(_testDirectoryRoot, "dotnet-tools.json")).Should().BeTrue(); 780_fileSystem.Directory.Exists(Path.Combine(_testDirectoryRoot, ".config")).Should().BeFalse("New manifests should not create .config directories");
WindowsInstallerTests.cs (7)
17private static string s_testDataPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestData"); 35var logFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 145int status = Signature.IsAuthenticodeSigned(Path.Combine(s_testDataPath, file)); 164int result = Signature.HasMicrosoftTrustedRoot(Path.Combine(s_testDataPath, file));
dotnet-dev-certs (34)
Program.cs (2)
444reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}"); 451reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}");
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-format (24)
Analyzers\CodeStyleInformationProvider.cs (4)
13private static readonly string s_executingPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; 15private readonly string _featuresPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.Features.dll"); 16private readonly string _featuresCSharpPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.CSharp.Features.dll"); 17private readonly string _featuresVisualBasicPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.VisualBasic.Features.dll");
Commands\FormatCommandCommon.cs (5)
207formatOptions = Path.GetExtension(binaryLogPath)?.Equals(".binlog") == false 208? (formatOptions with { BinaryLogPath = Path.ChangeExtension(binaryLogPath, ".binlog") }) 318var workspaceDirectory = Path.GetDirectoryName(workspaceFilePath); 330path[^1] != Path.DirectorySeparatorChar 331? path + Path.DirectorySeparatorChar
Formatters\OrganizeImportsFormatter.cs (1)
57logger.LogWarning(Resources.Unable_to_organize_imports_for_0_The_document_is_too_complex, Path.GetFileName(document.FilePath));
ReportWriter.cs (3)
13var reportFolderPath = Path.GetDirectoryName(reportFilePath); 40return Path.Combine(Environment.CurrentDirectory, defaultReportName); 44return Path.Combine(reportPath, defaultReportName);
Utilities\EditorConfigFinder.cs (1)
15: Path.GetDirectoryName(path);
Utilities\GeneratedCodeUtilities.cs (3)
40var fileName = Path.GetFileName(filePath); 46var extension = Path.GetExtension(fileName); 49var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath);
Workspaces\FolderWorkspace_FolderSolutionLoader.cs (2)
17var absoluteFolderPath = Path.GetFullPath(folderPath, Directory.GetCurrentDirectory()); 77var filePath = Path.GetFullPath(paths[index], folderPath);
Workspaces\MSBuildWorkspaceFinder.cs (5)
24if (!Path.IsPathRooted(workspacePath)) 26workspacePath = Path.GetFullPath(workspacePath, searchDirectory); 57var workspaceExtension = Path.GetExtension(workspacePath); 67throw new FileNotFoundException(string.Format(Resources.The_file_0_does_not_appear_to_be_a_valid_project_or_solution_file, Path.GetFileName(workspacePath))); 88.Where(f => !DnxProjectExtension.Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase));
dotnet-format.UnitTests (68)
Analyzers\AnalyzerAssemblyGenerator.cs (3)
38var nugetConfigPath = Path.Combine(TestContext.Current.TestExecutionDirectory, "NuGet.config"); 41Path.Combine("ref", sdkTargetFrameworkTargetFramework)); 45references.AddRange(netcoreMetadataReferences.Where(reference => Path.GetFileName(reference.Display) != "System.Collections.Immutable.dll"));
Analyzers\ThirdPartyAnalyzerFormatterTests.cs (2)
17private static readonly string s_analyzerProjectFilePath = Path.Combine("for_analyzer_formatter", "analyzer_project", "analyzer_project.csproj"); 39var workspacePath = Path.Combine(TestProjectsPathHelper.GetProjectsDirectory(), s_analyzerProjectFilePath);
CodeFormatterTests.cs (36)
16private static readonly string s_formattedProjectPath = Path.Combine("for_code_formatter", "formatted_project"); 17private static readonly string s_formattedProjectFilePath = Path.Combine(s_formattedProjectPath, "formatted_project.csproj"); 18private static readonly string s_formattedSolutionFilePath = Path.Combine("for_code_formatter", "formatted_solution", "formatted_solution.sln"); 20private static readonly string s_unformattedProjectPath = Path.Combine("for_code_formatter", "unformatted_project"); 21private static readonly string s_unformattedProjectFilePath = Path.Combine(s_unformattedProjectPath, "unformatted_project.csproj"); 22private static readonly string s_unformattedProgramFilePath = Path.Combine(s_unformattedProjectPath, "program.cs"); 23private static readonly string s_unformattedSolutionFilePath = Path.Combine("for_code_formatter", "unformatted_solution", "unformatted_solution.sln"); 25private static readonly string s_fSharpProjectPath = Path.Combine("for_code_formatter", "fsharp_project"); 26private static readonly string s_fSharpProjectFilePath = Path.Combine(s_fSharpProjectPath, "fsharp_project.fsproj"); 28private static readonly string s_generatedProjectPath = Path.Combine("for_code_formatter", "generated_project"); 29private static readonly string s_generatedProjectFilePath = Path.Combine(s_generatedProjectPath, "generated_project.csproj"); 31private static readonly string s_codeStyleSolutionPath = Path.Combine("for_code_formatter", "codestyle_solution"); 32private static readonly string s_codeStyleSolutionFilePath = Path.Combine(s_codeStyleSolutionPath, "codestyle_solution.sln"); 34private static readonly string s_codeStyleSolutionFilterFilePath = Path.Combine(s_codeStyleSolutionPath, "codestyle_solution_filter.slnf"); 36private static readonly string s_analyzersSolutionPath = Path.Combine("for_code_formatter", "analyzers_solution"); 37private static readonly string s_analyzersSolutionFilePath = Path.Combine(s_analyzersSolutionPath, "analyzers_solution.sln"); 39private static readonly string s_generatorSolutionPath = Path.Combine("for_code_formatter", "generator_solution"); 42private static readonly string s_suppressorProjectPath = Path.Combine("for_code_formatter", "suppressor_project"); 43private static readonly string s_suppressorProjectFilePath = Path.Combine(s_suppressorProjectPath, "suppressor_project.csproj"); 145Path.GetDirectoryName(s_unformattedProjectFilePath), 159Path.GetDirectoryName(s_unformattedSolutionFilePath), 191var include = new[] { s_unformattedProjectPath + Path.DirectorySeparatorChar }; 221var include = new[] { Path.Combine(s_unformattedProjectPath, "does_not_exist.cs") }; 288}.Select(path => path.Replace('\\', Path.DirectorySeparatorChar)).ToArray(); 518Path.Combine(solutionPath, "library", "library.csproj"), 531var unshippedPublicApi = File.ReadAllText(Path.Combine(solutionPath, "library", "PublicAPI.Unshipped.txt")); 549var solutionFilePath = Path.Combine(solutionPath, s_generatorSolutionFileName); 569var unshippedPublicApi = File.ReadAllText(Path.Combine(solutionPath, "console_app", "PublicAPI.Unshipped.txt")); 597var solutionFilePath = Path.Combine(solutionPath, s_generatorSolutionFileName); 617var unshippedPublicApi = File.ReadAllText(Path.Combine(solutionPath, "console_app", "PublicAPI.Unshipped.txt")); 666var workspacePath = Path.GetFullPath(workspaceFilePath); 724var fullPath = Path.GetFullPath(sourcePath, TestProjectsPathHelper.GetProjectsDirectory()); 725var tempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 752var tempPath = Path.Combine(destDirName, file.Name); 761var tempPath = Path.Combine(destDirName, subdir.Name);
Formatters\AbstractFormatterTests.cs (6)
46protected virtual string DefaultFolderPath => Path.DirectorySeparatorChar + DefaultTestProjectName; 48protected virtual string DefaultTestProjectPath => Path.Combine(DefaultFolderPath, $"{DefaultTestProjectName}.{DefaultFileExt}proj"); 50protected virtual string DefaultEditorConfigPath => Path.Combine(DefaultFolderPath, ".editorconfig"); 52protected virtual string DefaultFilePath => Path.Combine(DefaultFolderPath, $"{DefaultFilePathPrefix}0.{DefaultFileExt}"); 343solution = solution.AddDocument(documentId, newFileName, source, filePath: Path.Combine(DefaultFolderPath, newFileName)); 391outputFilePath: Path.ChangeExtension(DefaultTestProjectPath, "dll"),
MSBuild\MSBuildWorkspaceFinderTests.cs (10)
26testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 39testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 52testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 65testInstance.Path).Replace('/', Path.DirectorySeparatorChar); 79var solutionFileName = System.IO.Path.GetFileName(workspacePath); 93var solutionFileName = System.IO.Path.GetFileName(workspacePath); 105var solutionFileName = System.IO.Path.GetFileName(workspacePath); 117var solutionFileName = System.IO.Path.GetFileName(workspacePath); 131var solutionFileName = System.IO.Path.GetFileName(workspacePath); 145var solutionFileName = System.IO.Path.GetFileName(workspacePath);
MSBuild\MSBuildWorkspaceLoaderTests.cs (4)
134var binaryLogPath = Path.ChangeExtension(projectFilePath, ".binlog"); 164return Path.Combine(ProjectsPath, "for_workspace_loader", projectName); 169var projectName = Path.GetFileName(projectPath); 176return Path.Combine(projectPath, $"{projectName}.{projectExtension}");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Utilities\DotNetHelper.cs (4)
29var workspacePath = Path.IsPathRooted(workspaceFilePath) 31: Path.Combine(TestProjectsPathHelper.GetProjectsDirectory(), workspaceFilePath); 43var workspacePath = Path.IsPathRooted(workspaceFilePath) 45: Path.Combine(TestProjectsPathHelper.GetProjectsDirectory(), workspaceFilePath);
Utilities\TestProjectsPathHelper.cs (1)
15var assetsDirectory = Path.Combine(TestContext.Current.TestAssetsDirectory, "dotnet-format");
XUnit\ConditionalFactAttribute.cs (1)
93public static bool IsWindows => Path.DirectorySeparatorChar == '\\';
dotnet-getdocument (14)
Commands\InvokeCommand.cs (11)
43var thisPath = Path.GetFullPath(Path.GetDirectoryName(typeof(InvokeCommand).Assembly.Location)); 47var targetDirectory = Path.GetDirectoryName(assemblyPath); 60toolsDirectory = Path.Combine( 64var executableSource = Path.Combine(toolsDirectory, InsideManName + ".exe"); 65executable = Path.Combine(targetDirectory, InsideManName + ".exe"); 84toolsDirectory = Path.Combine(thisPath, $"net{targetFramework.Version}"); 91args.Add(Path.ChangeExtension(assemblyPath, ".deps.json")); 105args.Add(packageFolder.TrimEnd(Path.DirectorySeparatorChar)); 109var runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json"); 125args.Add(Path.Combine(toolsDirectory, InsideManName + ".dll"));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-MsiInstallation.Tests (17)
Framework\VirtualMachine.cs (5)
43var testSettingsFile = Path.Combine(Environment.CurrentDirectory, "VMTestSettings.json"); 80_stateFile = Path.Combine(Environment.CurrentDirectory, "VMState.json"); 382if (!Directory.Exists(Path.GetDirectoryName(targetSharePath))) 384Directory.CreateDirectory(Path.GetDirectoryName(targetSharePath)); 473sb.AppendLine($"{Path.GetRelativePath(relativeTo, file.FullName)}:{file.LastWriteTimeUtc.Ticks}-{file.Length}");
Framework\VMTestBase.cs (4)
34foreach (var file in sdkTestingDir.Files.Select(f => Path.GetFileName(f))) 118foreach (var file in sdkTestingDir.Files.Select(Path.GetFileName)) 178var vmVersionFilePath = Path.Combine(installedSdkFolder, ".version"); 180var newVersionFileContents = File.ReadAllLines(Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, ".version"));
MsiInstallerTests.cs (5)
330var manifestFeatureBand = Path.GetFileName(manifestFeatureBandPath); 339var manifestId = Path.GetFileName(manifestIdPath); 340VM.GetRemoteFile(Path.Combine(manifestIdPath, "WorkloadManifest.json")) 345VM.GetRemoteFile(Path.Combine(manifestVersionPath, "WorkloadManifest.json")) 348var manifestVersion = Path.GetFileName(manifestVersionPath);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
WorkloadSetTests2.cs (2)
53var testProjectFolder = Path.Combine(SdkTestingDirectory, "ConsoleApp"); 90.And.HaveStdErrContaining(Path.Combine(SdkTestingDirectory, "global.json"));
dotnet-new.IntegrationTests (189)
BaseIntegrationTest.cs (16)
17public static string DotnetNewTestAssets { get; } = VerifyExists(Path.Combine(TestContext.Current.TestAssetsDirectory, "TestPackages", "dotnet-new")); 22public static string DotnetNewTestPackagesBasePath { get; } = VerifyExists(Path.Combine(DotnetNewTestAssets, "nupkg_templates")); 27public static string DotnetNewTestTemplatesBasePath { get; } = VerifyExists(Path.Combine(DotnetNewTestAssets, "test_templates")); 32public static string DotnetNewTestTemplatePackageProjectPath { get; } = VerifyFileExists(Path.Combine(DotnetNewTestAssets, "Microsoft.TemplateEngine.TestTemplates.csproj")); 42public static string RepoTemplatePackages { get; } = VerifyExists(Path.Combine(CodeBaseRoot, "template_feed")); 61string templateLocation = Path.GetFullPath(Path.Combine(DotnetNewTestTemplatesBasePath, templateName)); 135return Path.GetFullPath(testTemplate); 144string testProject = Path.GetFileName(DotnetNewTestTemplatePackageProjectPath); 147string outputLocation = Path.Combine(testPath, "TestNuGetPackage"); 154string createdPackagePath = Directory.GetFiles(outputLocation).Single(f => Path.GetExtension(f).Equals(".nupkg", StringComparison.OrdinalIgnoreCase)); 161folder = Path.GetFullPath(folder); 171file = Path.GetFullPath(file); 181string repoRoot = Path.GetFullPath(Path.Combine(TestContext.Current.TestAssetsDirectory, "..", "..")); 186if (!File.Exists(Path.Combine(repoRoot, "sdk.slnx")))
CommonTemplatesTests.cs (5)
82if (path.Replace(Path.DirectorySeparatorChar, '/') == "std-streams/stdout.txt") 200string projectDir = Path.Combine(workingDir, outputDir); 201string finalProjectName = Path.Combine(projectDir, $"{projName}.{extension}"); 394string projectDir = Path.Combine(workingDir, outputDir); 395string finalProjectName = Path.Combine(projectDir, $"{projName}.{extension}");
DotnetClassTemplateTests.cs (3)
83if (path.Replace(Path.DirectorySeparatorChar, '/') == "std-streams/stdout.txt") 163if (path.Replace(Path.DirectorySeparatorChar, '/') == "std-streams/stdout.txt") 226return Path.GetFileNameWithoutExtension(Directory
DotnetNewDebugOptionsTests.cs (4)
22string cacheFilePath = Path.Combine(home, "dotnetcli", Product.Version, "templatecache.json"); 46string cacheFilePath = Path.Combine(home, "dotnetcli", Product.Version, "templatecache.json"); 120Assert.Contains(Path.Combine(home, "packages"), createdCacheEntries); 121Assert.True(File.Exists(Path.Combine(home, "dotnetcli", Product.Version, "templatecache.json")));
DotnetNewDetailsTest.Approval.cs (1)
43File.WriteAllText(Path.Combine(folder, "NuGet.Config"), @"<?xml version=""1.0"" encoding=""utf-8""?>
DotnetNewInstallTests.Approval.cs (1)
247var globalSettingsFile = Path.Combine(homeDirectory, "packages.json");
DotnetNewInstallTests.cs (15)
47string path = Path.Combine(Path.GetTempPath(), "repro@4"); 52new DotnetCommand(_log, "add", "package", "--project", Path.Combine(path, "myconsole.csproj"), "Microsoft.Azure.Functions.Worker.ProjectTemplates", "-v", "4.0.5086", "--package-directory", path).Execute().Should().Pass(); 53new DotnetCommand(_log, "new", "install", Path.Combine(path, "microsoft.azure.functions.worker.projecttemplates/4.0.5086/microsoft.azure.functions.worker.projecttemplates.4.0.5086.nupkg")).Execute().Should().Pass(); 408Assert.True(File.Exists(Path.Combine(home, "packages", "Microsoft.DotNet.Common.ProjectTemplates.5.0.5.0.0.nupkg"))); 434Assert.False(File.Exists(Path.Combine(home, "packages", "Microsoft.DotNet.Common.ProjectTemplates.5.0.5.0.0.nupkg"))); 435Assert.True(File.Exists(Path.Combine(home, "packages", "Microsoft.DotNet.Common.ProjectTemplates.5.0.5.0.1.nupkg"))); 509string testTemplateLocationAbsolute = Path.GetFullPath(testTemplateLocation); 510string pattern = testTemplateLocation + Path.DirectorySeparatorChar + "*"; 518.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "ConfigurationKitchenSink")) 519.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateResolution")) 520.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateWithSourceName")) 521.And.HaveStdOutContaining($"Success: {Path.Combine(testTemplateLocationAbsolute, "ConfigurationKitchenSink")} installed the following templates:") 522.And.HaveStdOutContaining($"Success: {Path.Combine(testTemplateLocationAbsolute, "TemplateResolution")} installed the following templates:") 523.And.HaveStdOutContaining($"Success: {Path.Combine(testTemplateLocationAbsolute, "TemplateWithSourceName")} installed the following templates:")
DotnetNewInstantiateTests.Approval.cs (9)
280string resultFileContent = File.ReadAllText(Path.Combine(workingDirectory, "Test.cs")); 304string resultFileContent = File.ReadAllText(Path.Combine(workingDirectory, "Test.cs")); 337string resultFileContent = File.ReadAllText(Path.Combine(workingDirectory, "Test.cs")); 379actualFiles.Where(f => Path.GetExtension(f).Equals(".txt")).Select( 382.UseMethodName($"CanInstantiateTemplate_ConditionalProcessing_{Path.GetFileName(file)}") 485output.Replace($"{templateLocation}{Path.DirectorySeparatorChar}", "%TEMPLATE ROOT%"); 596string templateLocation = Path.Combine(workingDir, "template"); 697return Verify(File.ReadAllText(Path.Combine(workingDirectory, "Test.cs"))) 723return Verify(File.ReadAllText(Path.Combine(workingDirectory, "Test.cs")))
DotnetNewInstantiateTests.cs (15)
73new DirectoryInfo(Path.Combine(workingDirectory, "no-alias")).EnumerateFileSystemInfos().Select(fi => fi.Name), 74new DirectoryInfo(Path.Combine(workingDirectory, "alias")).EnumerateFileSystemInfos().Select(fi => fi.Name)); 164string sourceImage = Path.Combine(templateLocation, "image.png"); 165string targetImage = Path.Combine(workingDirectory, "image.png"); 191string sourceImage = Path.Combine(templateLocation, "image.png"); 192string targetImage = Path.Combine(workingDirectory, "image.png"); 272string testFile = Path.Combine(workingDirectory, fileName); 286testFile = Path.Combine(workingDirectory, fileName); 300testFile = Path.Combine(workingDirectory, fileName); 324string testFile = Path.Combine(workingDirectory, expectedFileName); 340Path.Combine(DotnetNewTestPackagesBasePath, nugetFileName), 481string expectedFsprojPath = Path.Combine(rootPath, "f1", "f1.fsproj"); 496string expectedCsprojPath = Path.Combine(rootPath, "c1", "c1.csproj"); 511string expectedCsprojPath = Path.Combine(rootPath, "vb1", "vb1.vbproj"); 527string expectedCsprojPath = Path.Combine(rootPath, "c1", "c1.csproj");
DotnetNewLocaleTests.cs (6)
27string? thisDir = Path.GetDirectoryName(typeof(DotnetNewLocaleTests).Assembly.Location); 51string? thisDir = Path.GetDirectoryName(typeof(DotnetNewLocaleTests).Assembly.Location); 161Path.Combine(invalidTestTemplateLocation, ".template.config", "localize", "templatestrings.de-DE.json"), 162Path.Combine(tmpTemplateLocation, ".template.config", "localize", "templatestrings.de-DE.json"), 221Path.Combine(invalidTestTemplateLocation, ".template.config", "localize", "templatestrings.de-DE.json"), 222Path.Combine(tmpTemplateLocation, ".template.config", "localize", "templatestrings.de-DE.json"),
DotnetNewTestTemplatesTests.cs (6)
33private static readonly string PackagesJsonPath = Path.Combine(CodeBaseRoot, "test", "TestPackages", "cgmanifest.json"); 59string templatePackagePath = Path.Combine( 185Directory.CreateDirectory(Path.Combine(outputDirectory, ".git")); 203File.Exists(Path.Combine(outputDirectory, "global.json")).Should().BeTrue(); 227var fsproj = Path.Combine(outputDirectory, $"{projectName}.fsproj"); 327if (Path.GetDirectoryName(PackagesJsonPath) is string directoryPath)
DotnetNewUninstallTests.Approval.cs (1)
35var globalSettingsFile = Path.Combine(homeDirectory, "packages.json");
DotnetNewUninstallTests.cs (26)
37.And.HaveStdOutContaining($"TemplateResolution{Path.DirectorySeparatorChar}DifferentLanguagesGroup{Path.DirectorySeparatorChar}BasicFSharp") 110.And.HaveStdOutContaining($"TemplateResolution{Path.DirectorySeparatorChar}DifferentLanguagesGroup{Path.DirectorySeparatorChar}BasicFSharp") 111.And.HaveStdOutMatching($"^\\s*dotnet new uninstall .*TemplateResolution{Regex.Escape(Path.DirectorySeparatorChar.ToString())}DifferentLanguagesGroup{Regex.Escape(Path.DirectorySeparatorChar.ToString())}BasicFSharp$", RegexOptions.Multiline); 168Assert.True(File.Exists(Path.Combine(home, "packages", "Microsoft.DotNet.Web.ProjectTemplates.5.0.5.0.0.nupkg"))); 174Directory.CreateDirectory(Path.Combine(workingDir, packageNameToUnisntall)); 196Assert.False(File.Exists(Path.Combine(home, "packages", "Microsoft.DotNet.Web.ProjectTemplates.5.0.5.0.0.nupkg"))); 391string testTemplateLocationAbsolute = Path.GetFullPath(testTemplateLocation); 392string pattern = testTemplateLocation + Path.DirectorySeparatorChar + "*"; 400.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "ConfigurationKitchenSink")) 401.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateResolution")) 402.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateWithSourceName")) 403.And.HaveStdOutContaining($"Success: {Path.Combine(testTemplateLocationAbsolute, "ConfigurationKitchenSink")} installed the following templates:") 404.And.HaveStdOutContaining($"Success: {Path.Combine(testTemplateLocationAbsolute, "TemplateResolution")} installed the following templates:") 405.And.HaveStdOutContaining($"Success: {Path.Combine(testTemplateLocationAbsolute, "TemplateWithSourceName")} installed the following templates:") 415.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "ConfigurationKitchenSink")) 416.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateResolution")) 417.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateWithSourceName")); 424.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "ConfigurationKitchenSink")) 425.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateResolution")) 426.And.HaveStdOutContaining(Path.Combine(testTemplateLocationAbsolute, "TemplateWithSourceName")); 440string testTemplateLocationAbsolute = Path.GetFullPath(testTemplateLocation); 483string testFolderWithSpace = Path.Combine(workingDirectory, "My Test Folder"); 489string testFolderWithoutSpace = Path.Combine(workingDirectory, "MyTestFolder");
DotnetNewUpdateTests.Approval.cs (1)
40var globalSettingsFile = Path.Combine(homeDirectory, "packages.json");
DotnetNewUpdateTests.cs (1)
61Path.Combine(DotnetNewTestPackagesBasePath, nugetFileName),
MSBuildEvaluationTests.cs (8)
33string projectPath = Path.Combine(tempDir, "MyConsole"); 41string testFilePath = Path.Combine(projectPath, "MyTestClass.cs"); 71string projectPath = Path.Combine(tempDir, "MyTestProject"); 80string testFilePath = Path.Combine(projectPath, "MyTestClass.cs"); 122string projectPath = Path.Combine(tempDir, "MyConsole"); 156string projectPath = Path.Combine(tempDir, "MyProject"); 195string projectPath = Path.Combine(tempDir, "ConsoleFullFramework"); 204.And.HaveStdErrContaining($"Project capabilities: The project {Path.Combine(projectPath, "ConsoleFullFramework.csproj")} is not an SDK style project, and is not supported for evaluation.");
PostActionTests.Approval.cs (2)
206Assert.False(File.Exists(Path.Combine(workingDirectory, "MyProject.csproj"))); 207Assert.False(File.Exists(Path.Combine(workingDirectory, "Program.cs")));
PostActionTests.cs (47)
46Assert.True(File.Exists(Path.Combine(workingDirectory, targetSubfolder, $"MyProject.csproj"))); 47Assert.True(File.Exists(Path.Combine(workingDirectory, targetSubfolder, $"Program.cs"))); 50.WithWorkingDirectory(Path.Combine(workingDirectory, targetSubfolder)) 80.And.HaveStdOutContaining(Path.Combine(outputDirectory, "MyProject.csproj")); 82Assert.True(File.Exists(Path.Combine(outputDirectory, $"MyProject.csproj"))); 83Assert.True(File.Exists(Path.Combine(outputDirectory, $"Program.cs"))); 116.And.HaveStdOutContaining(Path.Combine(workingDirectory, outputDirectory, "MyProject.csproj")); 118Assert.True(File.Exists(Path.Combine(workingDirectory, outputDirectory, $"MyProject.csproj"))); 119Assert.True(File.Exists(Path.Combine(workingDirectory, outputDirectory, $"Program.cs"))); 122.WithWorkingDirectory(Path.Combine(workingDirectory, outputDirectory)) 153Assert.True(File.Exists(Path.Combine(workingDirectory, $"MyAwesomeTestProject.csproj"))); 154Assert.True(File.Exists(Path.Combine(workingDirectory, $"Program.cs"))); 188Assert.True(File.Exists(Path.Combine(workingDirectory, $"src/TemplateApplication/TemplateApplication.csproj"))); 189Assert.True(File.Exists(Path.Combine(workingDirectory, $"test/TemplateApplication.Tests/TemplateApplication.Tests.csproj"))); 230Assert.True(File.Exists(Path.Combine(workingDirectory, $"TemplateApplication.UI/TemplateApplication.UI.csproj"))); 231Assert.True(File.Exists(Path.Combine(workingDirectory, $"TemplateApplication.Tests/TemplateApplication.Tests.csproj"))); 264expectedRestoredProjects = expectedRestoredProjects.Replace('/', Path.DirectorySeparatorChar); 265unexpectedRestoredProjects = unexpectedRestoredProjects.Replace('/', Path.DirectorySeparatorChar); 296string projectName = Path.GetFileNameWithoutExtension(p); 477.And.HaveStdOutContaining(Path.Combine(outputDirectory, "MyProject.csproj")); 479new DotnetBuildCommand(_log, Path.Combine(outputDirectory, "MyProject.csproj")) 508.And.HaveStdOutContaining(Path.Combine(workingDirectory, "output", "MyProject.csproj")); 510new DotnetBuildCommand(_log, Path.Combine("output", "MyProject.csproj")) 608string src = Path.Combine(workingDirectory, "src"); 666.And.HaveStdOutContaining(Path.Combine(outputDirectory, "Project1", "Project1.csproj")) 667.And.HaveStdOutContaining(Path.Combine(outputDirectory, "Project2", "Project2.csproj")); 669new DotnetBuildCommand(_log, Path.Combine(outputDirectory, "Project1", "Project1.csproj")) 696.And.HaveStdOutContaining(Path.Combine(workingDirectory, "output", "Project1", "Project1.csproj")) 697.And.HaveStdOutContaining(Path.Combine(workingDirectory, "output", "Project2", "Project2.csproj")); 699new DotnetBuildCommand(_log, Path.Combine("output", "Project1", "Project1.csproj")) 778Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(workingDirectory, "MySolution.slnx"))); 811.And.HaveStdOutContaining(Path.Combine(outputDirectory, "MySolution.sln")) 812.And.HaveStdOutContaining(Path.Combine(outputDirectory, "MyProject.csproj")); 814Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(outputDirectory, "MySolution.slnx"))); 847.And.HaveStdOutContaining(Path.Combine(outputDirectory, "MySolution.sln")) 848.And.HaveStdOutContaining(Path.Combine(outputDirectory, "MyProject.csproj")); 850Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(outputDirectory, "MySolution.slnx"))); 883.And.HaveStdOutContaining(Path.Combine(workingDirectory, outputDirectory, "MySolution.sln")) 884.And.HaveStdOutContaining(Path.Combine(workingDirectory, outputDirectory, "MyProject.csproj")); 886Assert.Contains("MyProject.csproj", File.ReadAllText(Path.Combine(workingDirectory, outputDirectory, "MySolution.slnx"))); 919Assert.True(File.Exists(Path.Combine(workingDirectory, "MySolution.slnx"))); 920Assert.True(File.Exists(Path.Combine(workingDirectory, "Server/Server.csproj"))); 921Assert.True(File.Exists(Path.Combine(workingDirectory, "Client/Client.csproj"))); 923string solutionFileContents = File.ReadAllText(Path.Combine(workingDirectory, "MySolution.slnx")); 1126string jsonFileContents = File.ReadAllText(Path.Combine(workingDirectory, "testfile.json")); 1157string jsonFileContents = File.ReadAllText(Path.Combine(workingDirectory, "testfile.json")); 1201string jsonFileLocation = Path.Combine(workingDirectory, "testfile.json");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
SourcesTests.cs (2)
29Directory.EnumerateFiles(workingDirectory, "*", SearchOption.AllDirectories).Select(Path.GetFileName).OrderBy(s => s)); 40Directory.EnumerateFiles(workingDirectory, "*", SearchOption.AllDirectories).Select(Path.GetFileName).OrderBy(s => s));
TemplateDiscoveryTests.cs (14)
27downloadDirectory: Path.GetDirectoryName(testTemplatesPackagePath)); 34Path.GetDirectoryName(packagePath) ?? throw new Exception("Couldn't get package location directory"), 39Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfo.json"), 40Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfoVer2.json") 82Path.GetDirectoryName(packageLocation) ?? throw new Exception("Couldn't get package location directory"), 87Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfo.json"), 88Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfoVer2.json") 107Path.GetDirectoryName(packageLocation) ?? throw new Exception("Couldn't get package location directory"), 114Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfo.json"), 115Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfoVer2.json") 126Path.GetDirectoryName(packageLocation) ?? throw new Exception("Couldn't get package location directory"), 131Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfoVer2.json")) 136Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfo.json"), 137Path.Combine(testDir, "SearchCache", "NuGetTemplateSearchInfoVer2.json")
TemplateDiscoveryTool.cs (1)
18string toolManifestPath = Path.Combine(dotnetNewTestExecutionDir, "dotnet-tools.json");
Utilities.cs (3)
18return Path.Combine(TestContext.Current.TestExecutionDirectory, "dotnet-new.IntegrationTests"); 27string baseDir = Path.Combine(GetTestExecutionTempFolder(), caller, customName); 31string workingDir = Path.Combine(baseDir, DateTime.UtcNow.ToString("yyyyMMddHHmmssfff"));
WebProjectsTests.cs (1)
42string workingDir = Path.Combine(_fixture.BaseWorkingDirectory, testName);
dotnet-openapi (15)
Commands\BaseCommand.cs (12)
137return File.Exists(Path.GetFullPath(file)) && file.EndsWith(".csproj", StringComparison.Ordinal); 277var directory = Path.GetDirectoryName(fullPath); 278destinationPath = GetUniqueFileName(directory, Path.GetFileNameWithoutExtension(fileName), Path.GetExtension(fileName)); 344var filePath = Path.Combine(directory, fileName + extension); 358filePath = Path.Combine(directory, uniqueName + extension); 372var fileName = Path.GetFileName(contentDisposition.FileName); 373if (!Path.HasExtension(fileName)) 386if (!Path.HasExtension(lastSegment)) 439return Path.IsPathFullyQualified(path) 441: Path.GetFullPath(path, WorkingDirectory); 551var destinationDirectory = Path.GetDirectoryName(destinationPath);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-razorpagegenerator (4)
Program.cs (4)
63@class.ClassName = Path.GetFileNameWithoutExtension(document.Source.FilePath); 134var generatedCodeFilePath = Path.ChangeExtension(projectItem.PhysicalPath, ".Designer.cs"); 194var basePath = System.IO.Path.GetDirectoryName(_source.PhysicalPath); 214var includeFileContent = File.ReadAllText(System.IO.Path.Combine(basePath, includeFileName));
dotnet-sql-cache (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-svcutil.xmlserializer (18)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (4)
156char[] invalidPathChars = Path.GetInvalidPathChars(); 164string dirPath = Path.GetDirectoryName(path); 166dirPath = "." + Path.DirectorySeparatorChar; 174string filename = Path.GetFileName(path);
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (4)
193if (!directoryArgValue.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 194directoryArgValue += Path.DirectorySeparatorChar; 196_parent._directoryArg = Path.GetFullPath(directoryArgValue); 227int invalidCharacterIndex = value.IndexOfAny(Path.GetInvalidPathChars());
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (9)
41string combinedPath = Path.Combine(directoryPath, outputFileWithExtension); 49if (extension != null && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 63return "." + Path.DirectorySeparatorChar; 66if (!directory.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 67return TryGetFullPath(directory + Path.DirectorySeparatorChar, null); 77return Path.GetFullPath(path); 105string directoryPath = Path.GetDirectoryName(path); 215if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
Microsoft\Tools\ServiceModel\SvcUtil\XmlSerializerGenerator.cs (1)
66string codePath = Path.GetTempFileName();
dotnet-svcutil.xmlserializer.IntegrationTests (1)
SvcutilTests.cs (1)
21string outputFile = Path.GetTempFileName() + ".cs";
dotnet-svcutil-lib (162)
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")); 170string programFilePath = Path.Combine(this.MSBuildProj.DirectoryPath, "Program.cs"); 177var 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)
170fileOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(fileUri.LocalPath))); 389workingDirectory = Path.IsPathRooted(this.OutputFile.OriginalPath()) ? 390Path.GetDirectoryName(this.OutputFile.FullName) : Path.GetDirectoryName(Path.Combine(Directory.GetCurrentDirectory(), this.OutputFile.OriginalPath())); 397new DirectoryInfo(Path.Combine(workingDirectory, this.UpdateServiceReferenceFolder)) : 407if (!Path.IsPathRooted(originalDirSpec)) 410this.OutputDir = new DirectoryInfo(Path.Combine(workingDirectory, originalDirSpec)); 486var updateFileName = Path.GetFileName(this.UpdateServiceReferenceFolder); 491this.UpdateServiceReferenceFolder = Path.GetDirectoryName(this.UpdateServiceReferenceFolder); 500var paramsFiles = jsonFiles.Except(excludeJsonFiles).Where(fn => Path.GetFileName(fn).Equals(CommandProcessorOptions.SvcutilParamsFileName, RuntimeEnvironmentHelper.FileStringComparison) || 501Path.GetFileName(fn).Equals(CommandProcessorOptions.WCFCSParamsFileName, RuntimeEnvironmentHelper.FileStringComparison)); 515var svcRefNames = paramsFiles.Select(pf => { PathHelper.GetRelativePath(Path.GetDirectoryName(pf), new DirectoryInfo(projectDir), out var relPath); return relPath; }) 525var svcutilParmasFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.SvcutilParamsFileName); 528var wcfcsParamsFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.WCFCSParamsFileName); 536var relDir = Path.GetDirectoryName(fileRelPath); 545if (Path.GetFileName(paramsFilePath).Equals(CommandProcessorOptions.WCFCSParamsFileName)) 555updateOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(paramsFilePath))); 574var tempDir = Path.GetTempPath(); 578this.BootstrapPath = new DirectoryInfo(Path.Combine(tempDir, baseDirName, sessionDirName)); 698var projectFullPath = Path.Combine(this.BootstrapPath.FullName, "TFMResolver", "TFMResolver.csproj"); 704Directory.Delete(Path.GetDirectoryName(projectFullPath)); 836string 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.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}\\**")), 797var assetsFile = new FileInfo(Path.Combine(this.DirectoryPath, "obj", "project.assets.json")).FullName; 816if (Path.GetExtension(compiletimeAssembly.Path) == ".dll") 818var dependency = ProjectDependency.FromPackage(Path.GetFileNameWithoutExtension(compiletimeAssembly.Path), lib.Name, lib.Version.ToNormalizedString()); 874if (!Path.IsPathRooted(outputPath)) 876outputPath = Path.Combine(this.DirectoryPath, outputPath.Trim(new char[] { '\"' })); 880Path.Combine(outputPath, $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json") : 895var targetLib = Path.GetFileName(this._resolvedProperties["TargetPath"].Trim('\"')); 898targetLib = $"{Path.ChangeExtension(this.FileName, ".dll")}"; 912if (!Path.GetFileName(assetPath).Equals(targetLib, RuntimeEnvironmentHelper.FileStringComparison)) 914dependency = ProjectDependency.FromAssembly(Path.Combine(outputPath, assetPath)); 996var fileName = $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json"; 1005.Where(d => Path.GetFileName(d).Equals(fileName, RuntimeEnvironmentHelper.FileStringComparison)) 1006.Where(f => PathHelper.GetFolderName(Path.GetDirectoryName(f)) == this.TargetFramework || Directory.GetParent(Directory.GetParent(f).FullName).Name == this.TargetFramework)
Shared\Options\UpdateOptions.cs (2)
107if (this.OutputFile != null && !Path.IsPathRooted(this.OutputFile.OriginalPath())) 109this.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 (138)
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 (33)
76Directory.CreateDirectory(Path.Combine(this_TestCaseOutputDir, "SvcutilBootstrapper")); 78var uri = $"\"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}\""; 99File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.cs"), Path.Combine(this_TestCaseOutputDir, "FullFramework.cs"), true); 100File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.csproj"), Path.Combine(this_TestCaseOutputDir, "FullFramework.csproj"), true); 102var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl"); 103var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference"); 120this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testCaseName); 122this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName); 123this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{testCaseName}.log"); 124this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testCaseName); 127File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, "Program.cs"), Path.Combine(this_TestCaseOutputDir, "Program.cs"), true); 128File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, $"{testCaseName}.csproj"), Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), true); 129this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), null, CancellationToken.None); 134var uri = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl"); 135var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference"); 148this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testClientFolder); 151this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName); 152this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{this_TestCaseName}.log"); 153this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testClientFolder); 156FileUtil.CopyDirectory(Path.Combine(g_TestCasesDir, this_TestCaseName), this_TestGroupOutputDir, true); 157this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testClientFolder}.csproj"), null, CancellationToken.None); 164var uri = Path.Combine(g_TestCasesDir, "wsdl", "TypeReuseSvc.wsdl"); 165var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference"); 183var url = $"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}"; 187var paramsFilePath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.params.json"); 218var uri = Path.Combine(g_TestCasesDir, "TypeReuse", "TypeReuseIXmlSerializable.wsdl"); 219var refs = Path.Combine(g_TestCasesDir, "TypeReuse", "CommonTypes.dll");
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-user-jwts (30)
Commands\ClearCommand.cs (2)
68var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\CreateCommand.cs (2)
264var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\RemoveCommand.cs (2)
59var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Helpers\DevJwtCliHelpers.cs (6)
58else if (!File.Exists(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))) 60reporter.Error(Resources.FormatRemoveCommand_AppsettingsFileNotFound_Error(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))); 75var launchSettingsFilePath = Path.Combine(Path.GetDirectoryName(project)!, "Properties", "launchSettings.json");
Helpers\JwtStore.cs (3)
17_filePath = Path.Combine(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(userSecretsId)), FileName); 45var tempFilename = Path.GetTempFileName();
Helpers\SigningKeysHandler.cs (1)
63Directory.CreateDirectory(Path.GetDirectoryName(secretsFilePath));
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (7)
51var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 135var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); 138Path.Combine(AppContext.BaseDirectory, "assets"), 139Path.Combine(assemblyDir, "assets"), 144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-user-secrets (17)
Internal\SecretsStore.cs (3)
33var secretDir = Path.GetDirectoryName(_secretsFilePath); 71Directory.CreateDirectory(Path.GetDirectoryName(_secretsFilePath)); 85var tempFilename = Path.GetTempFileName();
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (7)
51var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 135var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); 138Path.Combine(AppContext.BaseDirectory, "assets"), 139Path.Combine(assemblyDir, "assets"), 144var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-watch (61)
AbstractBrowserRefreshServer.cs (2)
91builder.InsertListItem(MiddlewareEnvironmentVariables.DotNetStartupHooks, middlewareAssemblyPath, Path.PathSeparator); 92builder.InsertListItem(MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssemblies, Path.GetFileNameWithoutExtension(middlewareAssemblyPath), MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssembliesSeparator);
Aspire\AspireServiceFactory.cs (1)
213WorkingDirectory = Path.GetDirectoryName(projectLaunchInfo.ProjectPath) ?? throw new InvalidOperationException(),
Build\BuildReporter.cs (1)
31? $"{file.FilePath}{Path.PathSeparator}{file.StaticWebAssetPath}"
Build\EvaluationResult.cs (3)
115var projectDirectory = Path.GetDirectoryName(projectPath)!; 146var filePath = Path.GetFullPath(Path.Combine(projectDirectory, include));
Build\FilePathExclusions.cs (3)
53if (Path.DirectorySeparatorChar == '/') 58outputDirectories.Add(Path.TrimEndingDirectorySeparator(Path.GetFullPath(dir)));
Build\ProjectGraphUtilities.cs (4)
77=> $"{Path.GetFileNameWithoutExtension(projectNode.ProjectInstance.FullPath)} ({projectNode.GetTargetFramework()})"; 107=> projectNode.ProjectInstance.GetPropertyValue(PropertyNames.TargetPath) is { Length: >0 } path ? Path.GetDirectoryName(Path.Combine(projectNode.ProjectInstance.Directory, path)) : null; 113=> projectNode.ProjectInstance.GetPropertyValue(PropertyNames.IntermediateOutputPath) is { Length: >0 } path ? Path.Combine(projectNode.ProjectInstance.Directory, path) : null;
CommandLine\EnvironmentOptions.cs (3)
76Debug.Assert(Path.GetFileNameWithoutExtension(muxerPath) == "dotnet", $"Invalid muxer path {muxerPath}"); 82? $"{Path.Combine(WorkingDirectory, options.BinaryLogPath)[..^".binlog".Length]}-dotnet-watch.{operationName}.{Path.GetFileName(projectPath)}.{Interlocked.Increment(ref _uniqueLogId)}.binlog"
DefaultHotReloadClient.cs (1)
113environmentBuilder.InsertListItem(AgentEnvironmentVariables.DotNetStartupHooks, startupHookPath, Path.PathSeparator);
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)
75group path by PathUtilities.EnsureTrailingSlash(PathUtilities.NormalizeDirectorySeparators(Path.GetDirectoryName(path)!)) 77select (g.Key, containingDirectories ? [] : g.Select(path => Path.GetFileName(path)).ToImmutableHashSet(PathUtilities.OSSpecificPathComparer));
HotReload\AppModels\HotReloadAppModel.cs (2)
15=> Path.Combine(Path.GetDirectoryName(typeof(HotReloadAppModel).Assembly.Location)!, "hotreload", targetFramework, assemblyName + ".dll");
HotReload\HotReloadDotNetWatcher.cs (9)
605var outputDir = Path.Combine(Path.GetDirectoryName(projectPath)!, relativeOutputDir); 612var targetPath = Path.Combine(outputDir, item.GetMetadata(MetadataNames.TargetPath)); 619var directory = Path.GetDirectoryName(targetPath); 701if (Path.GetExtension(path) == ".binlog") 720=> Path.GetFileName(dir).StartsWith('.'); 873WorkingDirectory = Path.GetDirectoryName(projectPath)!, 900return $".{(relativePath.StartsWith(Path.DirectorySeparatorChar) ? string.Empty : Path.DirectorySeparatorChar)}{relativePath}";
HotReload\ScopedCssFileHandler.cs (1)
84var relativeUrl = Path.GetFileNameWithoutExtension(projectNode.ProjectInstance.FullPath) + ".css";
Process\LaunchSettingsProfile.cs (2)
31var projectDirectory = Path.GetDirectoryName(projectPath); 37var projectNameWithoutExtension = Path.GetFileNameWithoutExtension(projectPath);
Process\ProcessSpec.cs (1)
24=> Path.GetFileNameWithoutExtension(Executable);
Program.cs (6)
35sdkRootDirectory = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", ".."); 115if (!Path.IsPathRooted(projectPath)) 117projectPath = Path.Combine(searchBase, projectPath); 123.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase)) 290var roslynPath = Path.Combine(sdkRootDirectory, "Roslyn", "bincore"); 296var loadedAssembly = context.LoadFromAssemblyPath(Path.Combine(roslynPath, assembly.Name + ".dll"));
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; 12=> (path is [.., var last] && last != Path.DirectorySeparatorChar) ? path + Path.DirectorySeparatorChar : path; 15=> path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 24fullPath = Path.TrimEndingDirectorySeparator(fullPath); 33var containingDir = Path.GetDirectoryName(fullPath); 47var containingDir = Path.GetDirectoryName(path);
Watch\BuildEvaluator.cs (1)
168var extension = Path.GetExtension(fileName.AsSpan());
Watch\MsBuildFileSetFactory.cs (8)
42var watchList = Path.GetTempFileName(); 45var projectDir = Path.GetDirectoryName(rootProjectFile); 72Logger.LogError("Error(s) finding watch items project file '{FileName}'.", Path.GetFileName(rootProjectFile)); 120Debug.Assert(fileItems.Values.All(f => Path.IsPathRooted(f.FilePath)), "All files should be rooted paths"); 180var assemblyDir = Path.GetDirectoryName(typeof(MSBuildFileSetFactory).Assembly.Location); 185Path.Combine(AppContext.BaseDirectory, "assets"), 186Path.Combine(assemblyDir, "assets"), 191var targetPath = searchPaths.Select(p => Path.Combine(p, WatchTargetsFileName)).FirstOrDefault(File.Exists);
dotnet-watch.Tests (183)
Build\EvaluationTests.cs (6)
427var projectA = Path.Combine(testDirectory, "A", "A.csproj"); 489var options = TestOptions.GetEnvironmentOptions(workingDirectory: Path.GetDirectoryName(project1Path)!, muxerPath: MuxerPath); 556=> Path.GetRelativePath(testDir, fullPath).Replace('\\', '/'); 565var match = Regex.Match(line, $"> ([^{Path.PathSeparator}]*)({Path.PathSeparator}(.*))?"); 577=> Path.Combine(projectAsset.Path, projectAsset.TestProject!.Name!, projectAsset.TestProject!.Name + ".csproj");
Build\FileSetSerializerTests.cs (1)
108var outputPath = Path.Combine(dir, "output.txt");
CommandLine\BinaryLoggerTests.cs (1)
49Assert.Equal(Path.Combine(dir, expected), actualPath);
CommandLine\EnvironmentOptionsTests.cs (6)
11var root = Path.GetTempPath(); 12var projectPath = Path.Combine(root, "project.csproj"); 13var workingDirectory = Path.Combine(root, "working"); 16AssertEx.Equal(Path.Combine(workingDirectory, "msbuild-dotnet-watch.Restore.project.csproj.1.binlog"), 22AssertEx.Equal(Path.Combine(root, "logs", "test-dotnet-watch.Build.project.csproj.2.binlog"), 26new GlobalOptions() { BinaryLogPath = Path.Combine(root, "logs", "test.binlog") }));
CommandLine\LaunchSettingsTests.cs (3)
97var source = Path.Combine(testAsset.Path, "Program.cs"); 135["--project", Path.Combine(directoryInfo.Name, "WatchAppWithLaunchSettings.csproj")], 136workingDirectory: Path.GetFullPath(directoryInfo.Parent.FullName));
CommandLine\ProgramTests.cs (5)
210var testFile = Path.Combine(testAsset.Path, "UnitTest1.cs"); 274var packagePath = Path.Combine(testAsset.Path, "bin", "Release", "WatchNoDepsApp.1.0.0.nupkg"); 300App.AssertOutputContains(Path.Combine("Release", ToolsetInfo.CurrentTargetFramework, "publish")); 328if (Path.GetFileName(path) == "App.WithDeps.csproj") 343App.AssertOutputContains($"dotnet watch ❌ The project file could not be loaded. Could not find a part of the path '{Path.Combine(testAsset.Path, "AppWithDeps", "NonExistentDirectory", "X.csproj")}'");
FileWatcher\FileWatcherTests.cs (32)
101var dirA = Path.Combine(root, "A"); 102var dirB = Path.Combine(root, "B"); 103var dirBC = Path.Combine(dirB, "C"); 104var a1 = Path.Combine(dirA, "a1"); 105var a2 = Path.Combine(dirA, "a2"); 106var a3 = Path.Combine(dirA, "a3"); 107var a4 = Path.Combine(dirA, "a4"); 108var b1 = Path.Combine(dirB, "b1"); 109var b2 = Path.Combine(dirB, "b2"); 110var bc1 = Path.Combine(dirBC, "bc1"); 154var file = Path.Combine(dir, "file"); 186var dir1 = Path.Combine(dir, "dir1"); 187var dir2 = nested ? Path.Combine(dir1, "dir2") : dir1; 188var fileInSubdir = Path.Combine(dir2, "file_in_subdir"); 223var file = Path.Combine(dir, "file"); 239var srcFile = Path.Combine(dir, "file"); 240var dstFile = Path.Combine(dir, "file2"); 270var subdir = Path.Combine(dir, "subdir"); 273var fileInDir = Path.Combine(dir, "file_in_dir"); 276var fileInSubdir = Path.Combine(subdir, "file_in_subdir"); 330var testFileFullPath = Path.Combine(dir, "foo"); 356var file = Path.Combine(dir, "file"); 376var file1 = Path.Combine(dir, "a1"); 377var file2 = Path.Combine(dir, "a2"); 378var file3 = Path.Combine(dir, "a3"); 379var file4 = Path.Combine(dir, "a4"); 420var expectedPath = Path.Combine(directory, Path.GetRandomFileName()); 464var subdir = Path.Combine(dir, "subdir"); 467var f1 = Path.Combine(subdir, "foo1"); 468var f2 = Path.Combine(subdir, "foo2"); 469var f3 = Path.Combine(subdir, "foo3");
HotReload\ApplyDeltaTests.cs (62)
20var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 27UpdateSourceFile(Path.Combine(dependencyDir, "AnotherLib.cs"), """ 38UpdateSourceFile(Path.Combine(dependencyDir, "Foo.cs"), """ 55var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 69UpdateSourceFile(Path.Combine(dependencyDir, "Foo.cs"), newSrc); 80var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 87Path.Combine(testAsset.Path, "Directory.Build.props"), 106UpdateSourceFile(Path.Combine(dependencyDir, "Foo.cs"), newSrc); 121var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 122var libSourcePath = Path.Combine(dependencyDir, "Foo.cs"); 123var buildFilePath = isDirectoryProps ? Path.Combine(testAsset.Path, "Directory.Build.props") : Path.Combine(dependencyDir, "Dependency.csproj"); 160var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 161var libSourcePath = Path.Combine(dependencyDir, "Foo.cs"); 162var directoryBuildProps = Path.Combine(testAsset.Path, "Directory.Build.props"); 203var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 204var libSourcePath = Path.Combine(dependencyDir, "Foo.cs"); 205var directoryBuildProps = Path.Combine(testAsset.Path, "Directory.Build.props"); 250var appDataDir = Path.Combine(testAsset.Path, "AppData", "dir"); 251var appDataFilePath = Path.Combine(appDataDir, "ShouldBeIgnored.cs"); 288var binDir = Path.Combine(testAsset.Path, "bin", "Debug", ToolsetInfo.CurrentTargetFramework); 289var binDirFilePath = Path.Combine(binDir, "ShouldBeIgnored.cs"); 291var objDir = Path.Combine(testAsset.Path, "obj", "Debug", ToolsetInfo.CurrentTargetFramework); 292var objDirFilePath = Path.Combine(objDir, "ShouldBeIgnored.cs"); 316var programPath = Path.Combine(testAsset.Path, "Program.cs"); 317var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj"); 353var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj"); 354var logDir = Path.Combine(testAsset.Path, "logs"); 355var binLogPath = Path.Combine(logDir, "Test.binlog"); 356var binLogPathBase = Path.ChangeExtension(binLogPath, "").TrimEnd('.'); 420var programPath = Path.Combine(testAsset.Path, "Program.cs"); 449var programPath = Path.Combine(testAsset.Path, "Program.cs"); 504var programPath = Path.Combine(testAsset.Path, "Program.cs"); 538var programPath = Path.Combine(testAsset.Path, "Program.cs"); 565UpdateSourceFile(Path.Combine(testAsset.Path, "Program.fs"), content => content.Replace("Hello World!", "<Updated>")); 590var sourcePath = Path.Combine(testAsset.Path, "Program.fs"); 635UpdateSourceFile(Path.Combine(testAsset.Path, "App", "Update.cs"), newSrc); 646var sourcePath = Path.Combine(testAsset.Path, "Program.cs"); 679var sourcePath = Path.Combine(testAsset.Path, "Program.cs"); 727var programPath = Path.Combine(testAsset.Path, "Program.cs"); 798UpdateSourceFile(Path.Combine(testAsset.Path, "Pages", "Index.razor"), newSource); 897var scopedCssPath = Path.Combine(testAsset.Path, "RazorClassLibrary", "Components", "Example.razor.css"); 913var cssPath = Path.Combine(testAsset.Path, "RazorApp", "wwwroot", "app.css"); 950var razorPath = Path.Combine(testAsset.Path, "Components", "Pages", "Home.razor"); 961var cssPath = Path.Combine(testAsset.Path, "wwwroot", "css", "app.css"); 1002File.WriteAllText(Path.Combine(testAsset.Path, "App", "Update.cs"), newSrc); 1017var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 1018var oldFilePath = Path.Combine(dependencyDir, "Foo.cs"); 1019var newFilePath = Path.Combine(dependencyDir, "Renamed.cs"); 1069var dependencyDir = Path.Combine(testAsset.Path, "Dependency"); 1070var oldSubdir = Path.Combine(dependencyDir, "Subdir"); 1071var newSubdir = Path.Combine(dependencyDir, "NewSubdir"); 1089File.Delete(Path.Combine(dependencyDir, "Foo.cs")); 1091File.WriteAllText(Path.Combine(oldSubdir, "Foo.cs"), source); 1106File.WriteAllText(Path.Combine(newSubdir, "Foo.cs"), source); 1124var serviceSourcePath = Path.Combine(testAsset.Path, "WatchAspire.ApiService", "Program.cs"); 1125var serviceProjectPath = Path.Combine(testAsset.Path, "WatchAspire.ApiService", "WatchAspire.ApiService.csproj"); 1128var webSourcePath = Path.Combine(testAsset.Path, "WatchAspire.Web", "Program.cs"); 1129var webProjectPath = Path.Combine(testAsset.Path, "WatchAspire.Web", "WatchAspire.Web.csproj"); 1142await App.WaitUntilOutputContains($"ApiService working directory: '{Path.GetDirectoryName(serviceProjectPath)}'"); 1220var webSourcePath = Path.Combine(testAsset.Path, "WatchAspire.Web", "Program.cs"); 1221var webProjectPath = Path.Combine(testAsset.Path, "WatchAspire.Web", "WatchAspire.Web.csproj");
HotReload\CompilationHandlerTests.cs (2)
15var hostDir = Path.Combine(testAsset.Path, "Host"); 16var hostProject = Path.Combine(hostDir, "Host.csproj");
HotReload\RuntimeProcessLauncherTests.cs (42)
153var hostDir = Path.Combine(testAsset.Path, "Host"); 154var hostProject = Path.Combine(hostDir, "Host.csproj"); 155var serviceDirA = Path.Combine(testAsset.Path, "ServiceA"); 156var serviceSourceA1 = Path.Combine(serviceDirA, "A1.cs"); 157var serviceSourceA2 = Path.Combine(serviceDirA, "A2.cs"); 158var serviceProjectA = Path.Combine(serviceDirA, "A.csproj"); 159var serviceDirB = Path.Combine(testAsset.Path, "ServiceB"); 160var serviceProjectB = Path.Combine(serviceDirB, "B.csproj"); 161var libDir = Path.Combine(testAsset.Path, "Lib"); 162var libProject = Path.Combine(libDir, "Lib.csproj"); 163var libSource = Path.Combine(libDir, "Lib.cs"); 318var hostDir = Path.Combine(testAsset.Path, "Host"); 319var hostProject = Path.Combine(hostDir, "Host.csproj"); 320var serviceDirA = Path.Combine(testAsset.Path, "ServiceA"); 321var serviceProjectA = Path.Combine(serviceDirA, "A.csproj"); 322var serviceDirB = Path.Combine(testAsset.Path, "ServiceB"); 323var serviceProjectB = Path.Combine(serviceDirB, "B.csproj"); 324var libDir = Path.Combine(testAsset.Path, "Lib"); 325var libProject = Path.Combine(libDir, "Lib.csproj"); 326var libSource = Path.Combine(libDir, "Lib.cs"); 412var hostDir = Path.Combine(testAsset.Path, "Host"); 413var hostProject = Path.Combine(hostDir, "Host.csproj"); 414var hostProgram = Path.Combine(hostDir, "Program.cs"); 415var libProject = Path.Combine(testAsset.Path, "Lib2", "Lib2.csproj"); 416var lib = Path.Combine(testAsset.Path, "Lib2", "Lib2.cs"); 501var hostDir = Path.Combine(testAsset.Path, "Host"); 502var hostProject = Path.Combine(hostDir, "Host.csproj"); 503var serviceDirA = Path.Combine(testAsset.Path, "ServiceA"); 504var serviceSourceA2 = Path.Combine(serviceDirA, "A2.cs"); 505var serviceProjectA = Path.Combine(serviceDirA, "A.csproj"); 562dir = Path.Combine(workingDirectory, "bin", "Debug", ToolsetInfo.CurrentTargetFramework); 566dir = Path.Combine(workingDirectory, "obj", "Debug", ToolsetInfo.CurrentTargetFramework); 570dir = Path.Combine(workingDirectory, ".dir"); 582var path = Path.Combine(dir, "File" + extension); 590var project = Path.Combine(workingDirectory, "WatchNoDepsApp.csproj"); 654var projectPath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj"); 655var programPath = Path.Combine(testAsset.Path, "Program.cs"); 707var appProjDir = Path.Combine(testAsset.Path, "AppWithDeps"); 708var appProjFile = Path.Combine(appProjDir, "App.WithDeps.csproj"); 709var appFile = Path.Combine(appProjDir, "Program.cs"); 769var projFilePath = Path.Combine(testAsset.Path, "WatchHotReloadApp.csproj"); 770var programFilePath = Path.Combine(testAsset.Path, "Program.cs");
Process\LaunchSettingsProfileTest.cs (7)
29WriteFile(project, Path.Combine("Properties", "launchSettings.json"), 51var projectPath = Path.Combine(project.TestRoot, "Project1", "Project1.csproj"); 73WriteFile(project, Path.Combine("Properties", "launchSettings.json"), 84var projectPath = Path.Combine(project.Path, "Project1", "Project1.csproj"); 92var path = Path.Combine(GetTestProjectDirectory(testAsset), name); 93Directory.CreateDirectory(Path.GetDirectoryName(path)); 100=> Path.Combine(testAsset.Path, testAsset.TestProject.Name);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
TestUtilities\AssertEx.cs (1)
219var expected = expectedFiles.Select(p => Path.Combine(root, p));
TestUtilities\DebugTestOutputLogger.cs (1)
14=> WriteLine($"[TEST {Path.GetFileName(testPath)}:{testLine}] {message}");
TestUtilities\ModuleInitializer.cs (3)
25var watchDir = Path.Combine(sdkDir, "DotnetTools", "dotnet-watch", toolset.SdkVersion, "tools", ToolsetInfo.CurrentTargetFramework, "any"); 51path = Path.Combine(path, name.CultureName); 54path = Path.Combine(path, name.Name + ".dll");
TestUtilities\TestOptions.cs (1)
31? Path.Combine(ciOutputRoot, ".hotreload", asset.Name)
TestUtilities\WatchableApp.cs (1)
154var projectDirectory = (relativeProjectDirectory != null) ? Path.Combine(asset.Path, relativeProjectDirectory) : asset.Path;
Watch\GlobbingAppTests.cs (6)
30UpdateSourceFile(Path.Combine(projectDir, "include", "Foo.cs"), src => src); 41File.Delete(Path.Combine(projectDir, "include", "Foo.cs")); 52Directory.Delete(Path.Combine(projectDir, "include"), recursive: true); 63var oldFile = Path.Combine(projectDir, "include", "Foo.cs"); 64var newFile = Path.Combine(projectDir, "include", "Foo_new.cs"); 82var changedFile = Path.Combine(testAsset.Path, "exclude", "Baz.cs");
Watch\NoDepsAppTests.cs (2)
19UpdateSourceFile(Path.Combine(testAsset.Path, "Program.cs")); 44UpdateSourceFile(Path.Combine(testAsset.Path, "Program.cs"));
EndToEnd.Tests (25)
GivenDotNetLinuxInstallers.cs (1)
17var ext = Path.GetExtension(installerFile);
GivenFrameworkDependentApps.cs (1)
60string assetsFilePath = Path.Combine(_testInstance.TestRoot, "obj", "project.assets.json");
GivenNetFrameworkSupportsNetStandard2.cs (1)
15string projectDirectory = Path.Combine(_testInstance.Path, "TestApp");
GivenSelfContainedAppsRollForward.cs (4)
24string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj"); 51string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj");
GivenUsingDefaultRuntimeFrameworkVersions.cs (1)
59var resolvedVersionsFile = File.ReadAllLines(Path.Combine(binDirectory.FullName, outputFile));
GivenWeWantToRequireWindowsForDesktopApps.cs (2)
28string packagesPath = Path.Combine(testInstance.TestRoot, "packages"); 68string packagesPath = Path.Combine(testInstance.TestRoot, "packages", $"runtime.{Rid}.microsoft.windowsdesktop.app");
GivenWindowsApp.cs (1)
28var projectPath = Path.Combine(testInstance.Path, "consolecswinrt.csproj");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
ProjectBuildTests.cs (6)
23string projectPath = Path.Combine(projectDirectory, new DirectoryInfo(directory.Path).Name + ".csproj"); 65string projectPath = Path.Combine(projectDirectory, new DirectoryInfo(directory.Path).Name + ".csproj"); 405string dotnetFolder = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath); 406string[] runtimeFolders = Directory.GetDirectories(Path.Combine(dotnetFolder, "shared", "Microsoft.NETCore.App")); 407int latestMajorVersion = runtimeFolders.Select(folder => int.Parse(Path.GetFileName(folder).Split('.').First())).Max(); 471string dotnetRoot = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath);
Utilities\TestProjectCreator.cs (1)
37string projectPath = Path.Combine(projectDirectory, "TestAppSimple.csproj");
ValidateInsertedManifests.cs (3)
15var sdkManifestDir = Path.Combine(Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath), "sdk-manifests"); 23string manifestFile = new FileInfo(Path.Combine(manifestDir.FullName, "WorkloadManifest.json")).FullName;
VersionTests.cs (3)
16var dotnetFolder = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath); 17var sdkFolders = Directory.GetDirectories(Path.Combine(dotnetFolder, "sdk")); 20var expectedSdkVersion = Path.GetFileName(sdkFolders.Single());
FilesWebSite (10)
Controllers\DownloadFilesController.cs (10)
18_testFilesPath = Path.Combine(Path.GetTempPath(), "test-files"); 23var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 29var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 37var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 43var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 51var path = Path.Combine(_hostingEnvironment.ContentRootPath, "sample.txt"); 52var symlink = Path.Combine(_testFilesPath, Path.GetRandomFileName()); 120Directory.Delete(Path.Combine(_testFilesPath), recursive: true);
finalizer (6)
Program.cs (6)
244string? subKeyName = Path.GetFileName(name.TrimEnd(Path.DirectorySeparatorChar)); 253tempName = Path.GetDirectoryName(tempName); 265subKeyName = Path.GetFileName(tempName.TrimEnd(Path.DirectorySeparatorChar)); 287string installStatePath = Path.Combine(programDataPath, "dotnet", "workloads", platform, featureBandVersion.ToString(), "installstate", "default.json");
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 (21)
Program.cs (21)
100var assemblyName = Path.GetFileNameWithoutExtension(assembly); 101string path = Path.Combine(binDirectory, assemblyName, configuration, tfm, assembly); 260var fileWithPath = Path.Combine(directory.FullName, propsFileName); 269fileWithPath = Path.Combine(directory.FullName, propsFileToDisableNetAnalyzersInNuGetPackageName); 341var fileWithPath = Path.Combine(directory.FullName, analyzerDocumentationFileName); 345var fileTitle = Path.GetFileNameWithoutExtension(analyzerDocumentationFileName); 436var fileWithPath = Path.Combine(directory.FullName, tempAnalyzerSarifFileName); 530Validate(Path.Combine(directory.FullName, analyzerSarifFileName), File.ReadAllText(fileWithPath), fileNamesWithValidationFailures); 566var fileWithPath = Path.Combine(directory.FullName, "RulesMissingDocumentation.md"); 689var assemblyDir = Path.GetDirectoryName(assemblyPath); 695var assemblyName = Path.GetFileNameWithoutExtension(assembly); 696var shippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.ShippedFileName); 697var unshippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.UnshippedFileName); 869var assemblyName = Path.GetFileNameWithoutExtension(assembly); 870var assemblyDir = Path.Combine(binDirectory, assemblyName, configuration, tfm); 871return Path.Combine(assemblyDir, assembly); 902var rulesetFilePath = Path.Combine(directory.FullName, rulesetFileName); 966var directory = Directory.CreateDirectory(Path.Combine(analyzerEditorconfigsDir, editorconfigFolder)); 967var editorconfigFilePath = Path.Combine(directory.FullName, ".editorconfig"); 1185var configFilePath = Path.Combine(directory.FullName, fileName.ToLowerInvariant()); 1397var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
GenerateRulesMissingDocumentation (3)
Program.cs (3)
41var fileWithPath = Path.Combine(directory.FullName, rulesMissingDocumentationFileName); 146var assemblyName = Path.GetFileNameWithoutExtension(assembly); 147string path = Path.Combine(binDirectory, assemblyName, configuration, "netstandard2.0", assembly);
GetDocument.Insider (8)
Commands\GetDocumentCommand.cs (3)
67.Except([Path.GetFullPath(thisAssembly.Location)]) 68.ToDictionary(Path.GetFileNameWithoutExtension, path => new AssemblyInfo(path)); 140AssemblyName = Path.GetFileNameWithoutExtension(assemblyPath),
Commands\GetDocumentCommandWorker.cs (2)
32private static readonly char[] _invalidFilenameCharacters = Path.GetInvalidFileNameChars(); 423path = Path.Combine(outputDirectory, path);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
HelixTasks (11)
AssemblyScheduler.cs (2)
29DisplayName = Path.GetFileName(assemblyPath); 143var assemblyName = Path.GetFileName(_assemblyPath);
CreateLocalHelixTestLayout.cs (2)
27var destination = new DirectoryInfo(Path.Combine(TestOutputDirectory ?? string.Empty, relativeDestinationPathOnHelix)); 54fi.CopyTo(Path.Combine(target.ToString(), fi.Name), true);
SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs (2)
121string assemblyName = Path.GetFileName(targetPath); 162$"{(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .{Path.DirectorySeparatorChar} --logger trx --logger \"console;verbosity=detailed\" --blame-hang --blame-hang-timeout 25m {testFilter} {enableDiagLogging} {arguments}";
TarGzFileCreateFromDirectory.cs (5)
74SourceDirectory = Path.GetFullPath(SourceDirectory); 76SourceDirectory = SourceDirectory.EndsWith(Path.DirectorySeparatorChar.ToString()) 78: SourceDirectory + Path.DirectorySeparatorChar; 122var sourceDirectoryName = Path.GetFileName(Path.GetDirectoryName(SourceDirectory));
HelixTestRunner (23)
ProcessUtil.cs (6)
33var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{process.ProcessName}-{process.Id}.dmp"); 48var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{process.ProcessName}.{process.Id}.dmp"); 108process.StartInfo.EnvironmentVariables["COMPlus_DbgMiniDumpName"] = Path.Combine(dumpDirectoryPath, $"{Path.GetFileName(filename)}.%d.dmp"); 181var dumpFilePath = Path.Combine(dumpDirectoryPath, $"{Path.GetFileName(filename)}.{process.Id}.dmp");
TestRunner.cs (17)
36var nugetRestore = Path.Combine(helixDir, "nugetRestore"); 38var dotnetEFFullPath = Path.Combine(nugetRestore, helixDir, "dotnet-ef.exe"); 67DisplayContents(Path.Combine(Options.DotnetRoot, "host", "fxr")); 68DisplayContents(Path.Combine(Options.DotnetRoot, "shared", "Microsoft.NETCore.App")); 69DisplayContents(Path.Combine(Options.DotnetRoot, "shared", "Microsoft.AspNetCore.App")); 70DisplayContents(Path.Combine(Options.DotnetRoot, "packs", "Microsoft.AspNetCore.App.Ref")); 89ProcessUtil.PrintMessage(Path.GetFileName(file)); 93ProcessUtil.PrintMessage(Path.GetFileName(file)); 231var diagLog = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"), "vstest.log"); 315var logName = $"{Path.GetFileName(Path.GetDirectoryName(file))}_{Path.GetFileName(file)}"; 316ProcessUtil.PrintMessage($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, logName)}"); 317File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, logName)); 329var fileName = Path.GetFileName(file); 330ProcessUtil.PrintMessage($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName)}"); 331File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName));
HttpClientApp (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
HttpStress (4)
Program.cs (4)
374Console.WriteLine(" .NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(object).Assembly.Location))); 375Console.WriteLine(" ASP.NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(IWebHostBuilder).Assembly.Location)));
IdeBenchmarks (10)
FormatterBenchmarks.cs (4)
40var path = Path.Combine(Path.GetFullPath(@"..\..\..\..\..\src\Compilers\CSharp\Portable\Generated"), Document + ".cs"); 53var path = Path.Combine(Path.GetFullPath(@"..\..\..\..\..\src\Compilers\VisualBasic\Portable\Generated"), Document + ".vb");
InheritanceMargin\InheritanceMarginServiceBenchmarks.cs (1)
36var solutionPath = Path.Combine(roslynRoot, @"src\Tools\IdeCoreBenchmarks\Assets\Microsoft.CodeAnalysis.sln");
Program.cs (2)
23return Path.Combine(Path.GetDirectoryName(sourceFilePath), @"..\..\..");
SQLitePersistentStorageBenchmark.cs (3)
133var tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
IdeCoreBenchmarks (19)
ClassificationBenchmarks.cs (2)
45_solutionPath = Path.Combine(roslynRoot, @"Roslyn.sln"); 55var solutionPath = Path.Combine(roslynRoot, "Roslyn.sln");
CSharpIdeAnalyzerBenchmarks.cs (3)
37_solutionPath = Path.Combine(roslynRoot, @"src\Tools\IdeCoreBenchmarks\Assets\Microsoft.CodeAnalysis.sln"); 48var analyzerAssemblyPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Microsoft.CodeAnalysis.CSharp.Features.dll");
FindReferencesBenchmarks.cs (2)
44var solutionPath = Path.Combine(roslynRoot, "Compilers.slnf"); 54var solutionPath = Path.Combine(roslynRoot, "Compilers.slnf");
FormatterBenchmarks.cs (1)
30var csFilePath = Path.Combine(roslynRoot, @"src\Compilers\CSharp\Portable\Generated\Syntax.xml.Syntax.Generated.cs");
IncrementalAnalyzerBenchmarks.cs (3)
36_solutionPath = Path.Combine(roslynRoot, @"src\Tools\IdeCoreBenchmarks\Assets\Microsoft.CodeAnalysis.sln"); 47var analyzerAssemblyPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Microsoft.CodeAnalysis.Features.dll");
IncrementalSourceGeneratorBenchmarks.cs (2)
47_solutionPath = Path.Combine(roslynRoot, @"Compilers.slnf"); 57_solutionPath = Path.Combine(roslynRoot, @"Roslyn.sln");
NavigateToBenchmarks.cs (2)
48_solutionPath = Path.Combine(roslynRoot, @"Roslyn.sln"); 58_solutionPath = Path.Combine(roslynRoot, @"Roslyn.sln");
Program.cs (2)
37return Path.Combine(Path.GetDirectoryName(sourceFilePath), @"..\..\..");
RenameBenchmarks.cs (1)
28_csFilePath = Path.Combine(roslynRoot, @"src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs");
SyntacticChangeRangeBenchmark.cs (1)
33var csFilePath = Path.Combine(roslynRoot, @"src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs");
IIS.FunctionalTests (38)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
61var temporaryFile = Path.GetTempFileName(); 70var requestHandlerPath = Path.Combine(GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20), "aspnetcorev2_outofprocess.dll"); 215file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); 221return Path.Combine(deploymentResult.ContentRoot, 244var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); 245var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); 265var destFileName = Path.Combine(target.FullName, fileInfo.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (6)
92WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); 119AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); 133AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 149AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 157var firstTempFile = Path.GetTempFileName(); 158var secondTempFile = Path.GetTempFileName();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
145return Path.Combine(siteRoot, "web.config");
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (3)
51(args, contentRoot) => $"{args} CreateFile \"{Path.Combine(contentRoot, "Started.txt")}\""); 57await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue); 101await Helpers.Retry(async () => await File.ReadAllTextAsync(Path.Combine(result.ContentRoot, "Started.txt")), TimeoutExtensions.DefaultTimeoutValue);
IIS.LongTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 615parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 623parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 631parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 639parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 647parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 655parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 686parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 695parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.Microbenchmarks (1)
StartupTimeBenchmark.cs (1)
26var deploymentParameters = new DeploymentParameters(Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS/test/testassets/InProcessWebSite"),
IIS.NewHandler.FunctionalTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 615parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 623parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 631parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 639parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 647parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 655parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 686parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 695parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.NewShim.FunctionalTests (47)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 615parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 623parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 631parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 639parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 647parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 655parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 686parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 695parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
IIS.ShadowCopy.Tests (47)
ShadowCopyTests.cs (26)
45var directoryName = Path.GetRandomFileName(); 62var tempDirectoryPath = Path.Combine(deploymentResult.ContentRoot, directoryName); 149var deleteDirPath = Path.Combine(deploymentResult.ContentRoot, "wwwroot/deletethis"); 151File.WriteAllText(Path.Combine(deleteDirPath, "file.dll"), ""); 180DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true); 207DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true); 219Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped"); 230Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "2")), "Expected 2 shadow copy directory"); 247DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "1"), copySubDirs: true); 248DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "3"), copySubDirs: true); 249DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "10"), copySubDirs: true); 261Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "0")), "Expected 0 shadow copy directory to be skipped"); 272Assert.True(Directory.Exists(Path.Combine(directory.DirectoryPath, "11")), "Expected 11 shadow copy directory"); 278Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "1")), "Expected 1 shadow copy directory to be deleted"); 279Assert.False(Directory.Exists(Path.Combine(directory.DirectoryPath, "3")), "Expected 3 shadow copy directory to be deleted"); 291DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true); 304Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy"))); 306Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy"))); 321DirectoryCopy(deploymentResult.ContentRoot, Path.Combine(directory.DirectoryPath, "0"), copySubDirs: true); 334Assert.True(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy"))); 336Assert.False(Directory.Exists(Path.Combine(deploymentResult.ContentRoot, "ShadowCopy", "0", "ShadowCopy"))); 346var directoryPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 414string tempPath = Path.Combine(destDirName, file.Name); 427string tempPath = Path.Combine(destDirName, subdir.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (4)
55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
IIS.Tests (5)
Utilities\TestServer.cs (5)
33internal static string BasePath => Path.Combine(Path.GetDirectoryName(typeof(TestServer).Assembly.Location), 37internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll); 99_appHostConfigPath = Path.GetTempFileName(); 125var webHostConfig = XDocument.Load(Path.GetFullPath("HostableWebCore.config"));
IISExpress.FunctionalTests (57)
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
61var temporaryFile = Path.GetTempFileName(); 70var requestHandlerPath = Path.Combine(GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20), "aspnetcorev2_outofprocess.dll"); 215file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); 221return Path.Combine(deploymentResult.ContentRoot, 244var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); 245var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); 265var destFileName = Path.Combine(target.FullName, fileInfo.Name);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (8)
71return Path.Combine(folder, result.DeploymentParameters.SiteName); 75return Path.Combine(folder, "W3SVC1"); 92var destFileName = Path.Combine(target.FullName, fileInfo.Name); 99var webConfigPath = Path.Combine(deploymentResult.ContentRoot, "web.config"); 203return Path.Combine(logFolderPath, $"std_{startTime.Year}{startTime.Month:D2}" + 216var path = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.runtimeconfig.json"); 226Path.Combine(deploymentResult.DeploymentParameters.PublishedApplicationRootPath, "aspnetcore-debug.log"), 267File.WriteAllText(Path.Combine(rootApplicationDirectory.FullName, "web.config"), "<configuration></configuration>");
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (5)
24LogFolderPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 39File.WriteAllText(Path.Combine(appPath, "app_offline.htm"), content); 45() => File.Delete(Path.Combine(appPath, "app_offline.htm")), 78var name = Path.GetFileName(file);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\PublishedApplicationPublisher.cs (4)
25var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters)); 48var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName); 51var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters)); 72return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (6)
92WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine("Q:", "std"))); 119AssertLogs(Path.Combine(deploymentResult.ContentRoot, "subdirectory", "debug.txt")); 133AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 149AssertLogs(Path.Combine(deploymentResult.ContentRoot, "aspnetcore-debug.log")); 157var firstTempFile = Path.GetTempFileName(); 158var secondTempFile = Path.GetTempFileName();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (1)
145return Path.Combine(siteRoot, "web.config");
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (3)
106using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 124using (var stream = File.Open(Path.Combine(deploymentResult.ContentRoot, "app_offline.htm"), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None)) 178File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "Microsoft.AspNetCore.Server.IIS.dll"), "");
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (23)
114deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation); 209deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); 213Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); 214Assert.False(File.Exists(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"))); 215Assert.Contains("InProcessWebSite.exe", Helpers.ReadAllTextFromFile(Path.Combine(deploymentResult.ContentRoot, "web.config"), Logger)); 280Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"), 281Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), 345File.WriteAllText(Path.Combine(deploymentResult.ContentRoot, "hostfxr.dll"), ""); 405File.Delete(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll")); 446File.Delete(Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll")); 615parameters.TransformArguments((arguments, root) => "exec " + Path.Combine(root, "bin", arguments)); 623parameters.TransformArguments((arguments, root) => Path.Combine(pathWithSpace, arguments)); 631parameters.TransformArguments((arguments, root) => Path.Combine(root, pathWithSpace, arguments)); 639parameters.TransformArguments((arguments, root) => "exec \"" + Path.Combine(root, pathWithSpace, arguments) + "\" extra arguments"); 647parameters.TransformArguments((arguments, root) => Path.Combine("bin", arguments) + " \"extra argument\""); 655parameters.TransformArguments((arguments, root) => Path.Combine(root, "bin", arguments) + " extra arguments"); 686parameters.TransformPath((path, root) => Path.Combine(pathWithSpace, path)); 695parameters.TransformPath((path, root) => Path.Combine(root, pathWithSpace, path)); 715Assert.Equal(Path.GetDirectoryName(deploymentResult.HostProcess.MainModule.FileName), await deploymentResult.HttpClient.GetStringAsync("/CurrentDirectory")); 741var applicationDll = Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.dll"); 742var handlerDll = Path.Combine(deploymentResult.ContentRoot, "aspnetcorev2_inprocess.dll"); 961deploymentParameters.EnvironmentVariables["ANCM_LAUNCHER_ARGS"] = Path.ChangeExtension(Path.Combine(publishedApp.Path, deploymentParameters.ApplicationPublisher.ApplicationPath), ".dll");
illink (26)
ILLink.Tasks (6)
LinkTask.cs (6)
259protected override string ToolName => Path.GetFileName(DotNetPath); 273var taskDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 277_illinkPath = Path.Combine(Path.GetDirectoryName(taskDirectory), "net", "illink.dll"); 364var assemblyName = Path.GetFileNameWithoutExtension(assemblyPath); 426var assemblyName = Path.GetFileNameWithoutExtension(assemblyPath);
Infrastructure.Common (1)
CertificateManager.cs (1)
73return Path.Combine(Environment.CurrentDirectory, "wcfLocal.keychain");
InMemory.FunctionalTests (5)
HttpsConnectionMiddlewareTests.cs (2)
75["Certificates:Default:Path"] = Path.Combine("shared", "TestCertificates", "https-aspnet.crt"), 76["Certificates:Default:KeyPath"] = Path.Combine("shared", "TestCertificates", "https-aspnet.key"),
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
InProcessWebSite (2)
Startup.cs (2)
188File.WriteAllText(System.IO.Path.Combine(hostingEnv.ContentRootPath, "Started.txt"), ""); 957var tempFile = System.IO.Path.GetTempFileName();
installer.tasks (10)
FileUtilities.cs (1)
32if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
GenerateFileVersionProps.cs (3)
59var fileName = Path.GetFileName(file.ItemSpec); 131var manifestFileName = Path.GetFileName(PlatformManifestFile); 135Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestFile));
GenerateRunScript.cs (3)
41Directory.CreateDirectory(Path.GetDirectoryName(OutputPath)); 45string extension = Path.GetExtension(Path.GetFileName(OutputPath)).ToLowerInvariant();
GenerateTestSharedFrameworkDepsFile.cs (3)
58if (ignoredExtensions.Contains(Path.GetExtension(filePath))) 61string fileName = Path.GetFileName(filePath); 101using (var depsFileStream = File.Create(Path.Combine(SharedFrameworkDirectory, $"{sharedFxName}.deps.json")))
InteractiveHost.UnitTests (15)
AbstractInteractiveHostTests.cs (2)
50while (dir != null && !File.Exists(Path.Combine(dir, "dotnet.exe"))) 52dir = Path.GetDirectoryName(dir);
InteractiveHostCoreInitTests.cs (3)
33var dir = Path.GetDirectoryName(typeof(InteractiveHostCoreInitTests).Assembly.Location); 58var dllDir = Path.GetDirectoryName(dll.Path)!; 86await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopInitTests.cs (2)
31var dllDir = Path.GetDirectoryName(dll.Path)!; 59await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopTests.cs (6)
305Assert.True(await LoadReference(Path.Combine(fxDir, "System.Data.dll"))); 723{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 803$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 831{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 853$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 1038{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))}
TestUtils.cs (2)
11public static readonly string HostRootPath = Path.Combine(Path.GetDirectoryName(typeof(TestUtils).Assembly.Location)!, "Host");
Interop.FunctionalTests (13)
H2SpecCommands.cs (5)
54var root = Path.Combine(Environment.CurrentDirectory, "h2spec"); 57return Path.Combine(root, "windows", "h2spec.exe"); 61var toolPath = Path.Combine(root, "linux", "h2spec"); 67var toolPath = Path.Combine(root, "darwin", "h2spec"); 217var tempFile = Path.GetTempPath() + Guid.NewGuid() + ".xml";
Http3\Http3TlsTests.cs (5)
418new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 444Directory.CreateDirectory(Path.GetDirectoryName(path)); 519var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 520basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 521return Path.Combine(basePath, $"{typeof(Http3TlsTests).Assembly.GetName().Name}.pfx");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
InteropTests (2)
InteropTests.cs (2)
16private readonly string _clientPath = Path.Combine(Directory.GetCurrentDirectory(), "InteropClient", "InteropClient.dll"); 17private readonly string _serverPath = Path.Combine(Directory.GetCurrentDirectory(), "InteropWebsite", "InteropWebsite.dll");
InteropWebsite (2)
Program.cs (2)
57var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); 58var certPath = Path.Combine(basePath!, "Certs", "server1.pfx");
IOperationGenerator (3)
IOperationClassWriter.cs (2)
106var outFileName = Path.Combine(_location, $"{@namespace}.Generated.cs"); 161using (_writer = new StreamWriter(File.Open(Path.Combine(_location, "OperationKind.Generated.cs"), FileMode.Create), Encoding.UTF8))
Program.cs (1)
18Console.Error.WriteLine("Usage: \"{0} <input> <output>\"", Path.GetFileNameWithoutExtension(args[0]));
KeyManagementSample (1)
Program.cs (1)
15var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
Metrics (31)
MetricsOutputWriter.cs (1)
43writer.WriteAttributeString("Name", Path.GetFileName(filePath));
Program.cs (5)
303Console.WriteLine($"Loading {Path.GetFileName(projectFile)}..."); 310Console.WriteLine($"Computing code metrics for {Path.GetFileName(projectFile)}..."); 329Console.WriteLine($"Loading {Path.GetFileName(solutionFile)}..."); 336Console.WriteLine($"Computing code metrics for {Path.GetFileName(solutionFile)}..."); 343Console.WriteLine($" Computing code metrics for {Path.GetFileName(project.FilePath)}...");
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Metrics.Legacy (31)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Tools\Metrics\MetricsOutputWriter.cs (1)
43writer.WriteAttributeString("Name", Path.GetFileName(filePath));
src\RoslynAnalyzers\Tools\Metrics\Program.cs (5)
303Console.WriteLine($"Loading {Path.GetFileName(projectFile)}..."); 310Console.WriteLine($"Computing code metrics for {Path.GetFileName(projectFile)}..."); 329Console.WriteLine($"Loading {Path.GetFileName(solutionFile)}..."); 336Console.WriteLine($"Computing code metrics for {Path.GetFileName(solutionFile)}..."); 343Console.WriteLine($" Computing code metrics for {Path.GetFileName(project.FilePath)}...");
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.Analyzers.Extra.Tests (4)
Resources\FileVisibleToAnalyzer.cs (1)
24public override string Path => System.IO.Path.Combine(Directory.GetCurrentDirectory(), _fileName);
Resources\RoslynTestUtils.cs (3)
36var runtimeDir = Path.GetDirectoryName(corelib)!; 42refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 43refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Analyzers.Local (2)
ApiLifecycle\ModelLoader.cs (2)
29var fileName = Path.GetFileNameWithoutExtension(filePath); 30var fileExtension = Path.GetExtension(filePath);
Microsoft.Analyzers.Local.Tests (4)
Resources\FileVisibleToAnalyzer.cs (1)
24public override string Path => System.IO.Path.Combine(Directory.GetCurrentDirectory(), _fileName);
Resources\RoslynTestUtils.cs (3)
36var runtimeDir = Path.GetDirectoryName(corelib)!; 42refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 43refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Arcade.Common (13)
CommandFactory.cs (4)
56var extension = Path.GetExtension(executable); 61else if (executable.Contains(Path.DirectorySeparatorChar)) 73foreach (var path in System.Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 75var candidate = Path.Combine(path, executable + ".exe");
FileSystem.cs (8)
21public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 23public string? GetFileName(string? path) => Path.GetFileName(path); 25public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 27public string? GetExtension(string? path) => Path.GetExtension(path); 29public string GetFullPath(string path) => Path.GetFullPath(path); 31public string PathCombine(string path1, string path2) => Path.Combine(path1, path2); 33public string PathCombine(string path1, string path2, string path3) => Path.Combine(path1, path2, path3); 37string? dirPath = Path.GetDirectoryName(path);
ZipArchiveManager.cs (1)
30string entryName = Path.GetFileName(filePath);
Microsoft.Arcade.Test.Common (4)
MockFileSystem.cs (4)
50public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 52public string? GetFileName(string? path) => Path.GetFileName(path); 54public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 56public string? GetExtension(string? path) => Path.GetExtension(path);
Microsoft.AspNetCore (8)
HostingPathResolver.cs (8)
15Path.EndsInDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 21return Path.GetFullPath(basePath); 23if (Path.IsPathRooted(contentRootPath)) 25return Path.GetFullPath(contentRootPath); 27return Path.GetFullPath(Path.Combine(Path.GetFullPath(basePath), contentRootPath));
Microsoft.AspNetCore.Analyzer.Testing (4)
DiagnosticVerifier.cs (4)
194var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 201dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
44var name = Path.GetFileNameWithoutExtension(assemblyPath);
Microsoft.AspNetCore.App.Analyzers.Test (5)
TestDiagnosticAnalyzer.cs (2)
157if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Verifiers\CSharpAnalyzerVerifier.cs (3)
52Path.Combine( 55Path.Combine(TestData.GetRepoRoot(), "NuGet.config"); 61Path.Combine("ref", "net10.0"))
Microsoft.AspNetCore.App.UnitTests (36)
PackageTests.cs (6)
35Path.Combine( 53var outputPath = Path.Combine(_packageLayoutRoot, Path.GetFileNameWithoutExtension(package)); 88var packageAssembliesDir = Path.Combine(packageDir, "lib"); 119var packageToolsDir = Path.Combine(packageDir, "tools"); 123.Where(f => !toolAssembliesToSkip.Any(s => Path.GetFileNameWithoutExtension(f).Contains(s, StringComparison.OrdinalIgnoreCase)));
SharedFxTests.cs (9)
27_sharedFxRoot = Path.Combine( 38.Select(Path.GetFileNameWithoutExtension) 62.Select(Path.GetFileNameWithoutExtension) 88var runtimeConfigFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.json"); 91AssertEx.FileDoesNotExists(Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.runtimeconfig.dev.json")); 105var depsFilePath = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.deps.json"); 178var name = Path.GetFileNameWithoutExtension(path); 229if (!repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path))) 250var versionFile = Path.Combine(_sharedFxRoot, ".version");
TargetingPackTests.cs (21)
28_targetingPackRoot = Path.Combine( 38var actualAssemblies = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll") 39.Select(Path.GetFileNameWithoutExtension) 73IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); 78var expectedVersion = repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path)) ? 82var fileName = Path.GetFileNameWithoutExtension(path); 90if (repoAssemblies.Contains(Path.GetFileNameWithoutExtension(path))) 113IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref", _targetingPackTfm), "*.dll", SearchOption.AllDirectories); 127Assert.True(result, $"In {Path.GetFileName(path)}, {reference.GetAssemblyName()} has unexpected version {reference.Version}."); 135var packageOverridePath = Path.Combine(_targetingPackRoot, "data", "PackageOverrides.txt"); 211IEnumerable<string> dlls = Directory.GetFiles(Path.Combine(_targetingPackRoot, "ref"), "*.dll", SearchOption.AllDirectories); 243var platformManifestPath = Path.Combine(_targetingPackRoot, "data", "PlatformManifest.txt"); 248var fileName = Path.GetFileName(i); 308var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); 321var analyzersDir = Path.Combine(_targetingPackRoot, "analyzers"); 324.Select(p => Path.GetFileNameWithoutExtension(p)) 375var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); 385var targetingPackPath = Path.Combine( 417var frameworkListPath = Path.Combine(_targetingPackRoot, "data", "FrameworkList.xml"); 431string expectedLanguage = Path.GetFileName(Path.GetDirectoryName(assemblyPath));
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (92)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
UserJwtsTestFixture.cs (9)
64var projectPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest", Guid.NewGuid().ToString())); 65Directory.CreateDirectory(Path.Combine(projectPath.FullName, "Properties")); 70Directory.CreateDirectory(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId))); 74Path.Combine(projectPath.FullName, "TestProject.csproj"), 77File.WriteAllText(Path.Combine(projectPath.FullName, "Properties", "launchSettings.json"), 81Path.Combine(projectPath.FullName, "appsettings.Development.json"), 85Path.Combine(projectPath.FullName, "appsettings.Local.json"), 94var secretsDir = Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId));
UserJwtsTests.cs (76)
27var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 37var project = Path.Combine(fixture.CreateProject(false), "TestProject.csproj"); 48var project = Path.Combine(fixture.CreateProject(false), "TestProject.csproj"); 61var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 62var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 73var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 74var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 105var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 106var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 122var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 123var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Local.json"); 139var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 149var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 163var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 184var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 196var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 197var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 214var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 215var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Local.json"); 232var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 233var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Development.json"); 250var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 251var appsettings = Path.Combine(Path.GetDirectoryName(project), "appsettings.Local.json"); 268var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 282var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 310var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 322var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 336var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 351var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 365var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 378var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 397var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 417var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 438var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 460var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 475var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj"); 489var project = Path.Combine(projectPath, "TestProject.csproj"); 491var launchSettingsPath = Path.Combine(projectPath, "Properties", "launchSettings.json"); 505var project = Path.Combine(projectPath, "TestProject.csproj"); 532var project = Path.Combine(projectPath, "TestProject.csproj"); 560var project = Path.Combine(projectPath, "TestProject.csproj"); 577var project = Path.Combine(projectPath, "TestProject.csproj"); 598var project = Path.Combine(projectPath, "TestProject.csproj"); 620var project = Path.Combine(projectPath, "TestProject.csproj"); 645var project = Path.Combine(projectPath, "TestProject.csproj"); 671var project = Path.Combine(projectPath, "TestProject.csproj"); 708var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 723var expectedAppsettingsPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.DoesNotExist.json"); 734var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 748var expectedAppsettingsPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.DoesNotExist.json"); 759var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 773var expectedAppsettingsPath = Path.Combine(Directory.GetCurrentDirectory(), "appsettings.DoesNotExist.json"); 784var path = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "userjwtstest")); 797var project = Path.Combine(projectPath, "TestProject.csproj"); 802Assert.Contains(Path.Combine(projectPath, project), _console.GetOutput()); 809var tempPath = Path.GetTempPath(); 810var targetPath = Path.GetRelativePath(tempPath, projectPath); 811var project = Path.Combine(projectPath, "TestProject.csproj"); 818Assert.Contains(Path.Combine(projectPath, project), _console.GetOutput()); 825var tempPath = Path.GetTempPath(); 826var targetPath = Path.GetRelativePath(tempPath, projectPath); 840var tempPath = Path.GetTempPath(); 841var targetPath = Path.GetRelativePath(tempPath, projectPath); 855var project = Path.Combine(fixture.CreateProject(), "TestProject.csproj");
Microsoft.AspNetCore.BrowserTesting (11)
BrowserManagerConfiguration.cs (4)
76BaseArtifactsFolder = Path.GetFullPath(configuration.GetValue(nameof(BaseArtifactsFolder), Path.Combine(Directory.GetCurrentDirectory(), "playwright"))); 182if (Path.IsPathRooted(folderPath)) 189folderPath = Path.Combine(BaseArtifactsFolder, folderPath);
BrowserTestBase.cs (6)
39var basePath = Path.GetDirectoryName(typeof(BrowserTestBase).Assembly.Location); 49.AddJsonFile(Path.Combine(basePath, "playwrightSettings.json")) 50.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.{os}.json"), optional: true); 54builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.ci.json"), optional: true) 55.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.ci.{os}.json"), optional: true); 60builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.debug.json"), optional: true);
ContextInformation.cs (1)
58browserContextOptions.RecordHarPath = Path.Combine(
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
AnalyzerTestBase.cs (1)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source);
Microsoft.AspNetCore.Components.Endpoints.Tests (5)
Builder\TestFileProvider\TestFileProvider.cs (5)
44PhysicalPath = Path.Combine(Root, NormalizeAndEnsureValidPhysicalPath(path)), 45Name = Path.GetFileName(path), 56var directoryContent = new TestDirectoryContent(Path.GetFileName(path), files); 114filePath = filePath.Replace('/', Path.DirectorySeparatorChar); 116if (filePath[0] == Path.DirectorySeparatorChar)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
AnalyzerTestBase.cs (1)
21var filePath = Path.Combine(ProjectDirectory, "TestFiles", GetType().Name, source);
Microsoft.AspNetCore.Components.WebAssembly (2)
Services\LazyAssemblyLoader.cs (2)
56loadedAssemblies.Add(Assembly.Load(Path.GetFileNameWithoutExtension(assemblyName))); 88var assemblyName = Path.GetFileNameWithoutExtension(newAssembliesToLoad[i]);
Microsoft.AspNetCore.Components.WebAssembly.Server (11)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
110var fileExtension = Path.GetExtension(requestPath.Value); 120var originalPath = Path.GetFileNameWithoutExtension(requestPath.Value);
DebugProxyLauncher.cs (2)
125var debugProxyPath = Path.Combine( 126Path.GetDirectoryName(assembly.Location)!,
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
TargetPickerUi.cs (4)
399var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug"); 425var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
Microsoft.AspNetCore.Components.WebView (3)
WebViewManager.cs (3)
304var name = Path.GetFileNameWithoutExtension(assembly.Location); 306return Path.Combine(Path.GetDirectoryName(assembly.Location)!, $"{name}.staticwebassets.runtime.json");
Microsoft.AspNetCore.Components.WebView.Maui (4)
Extensions\UriExtensions.cs (1)
10 if (Path.HasExtension(uriString))
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
Microsoft.AspNetCore.Components.WebView.Photino (3)
BlazorWindow.cs (3)
47var contentRootDir = Path.GetDirectoryName(Path.GetFullPath(hostPage))!; 48var hostPageRelativePath = Path.GetRelativePath(contentRootDir, hostPage);
Microsoft.AspNetCore.Components.WebView.Test (1)
StaticContentProviderTests.cs (1)
119public string Name => Path.GetFileName(_filePath);
Microsoft.AspNetCore.Components.WebView.WindowsForms (10)
BlazorWebView.cs (6)
180 appRootDir = Path.GetDirectoryName(entryAssemblyLocation)!; 186 var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage!)); // HostPage is nonnull because RequiredStartupPropertiesSet is checked above 187 var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!; 188 var contentRootRelativePath = Path.GetRelativePath(appRootDir, contentRootDirFullPath); 189 var hostPageRelativePath = Path.GetRelativePath(contentRootDirFullPath, hostPageFullPath);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
415 var result = Path.Combine(
Microsoft.AspNetCore.Components.WebView.Wpf (10)
BlazorWebView.cs (6)
263 appRootDir = Path.GetDirectoryName(entryAssemblyLocation)!; 269 var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage)); 270 var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!; 271 var hostPageRelativePath = Path.GetRelativePath(contentRootDirFullPath, hostPageFullPath); 272 var contentRootDirRelativePath = Path.GetRelativePath(appRootDir, contentRootDirFullPath);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
415 var result = Path.Combine(
Microsoft.AspNetCore.Components.WebViewE2E.Test (3)
BasicBlazorHybridTest.cs (2)
23var thisProgramDir = Path.GetDirectoryName(typeof(Program).Assembly.Location); 26var newNativePath = Path.Combine(thisProgramDir, "runtimes", RuntimeInformation.RuntimeIdentifier, "native");
WebViewManagerE2ETests.cs (1)
32WorkingDirectory = Path.GetDirectoryName(photinoTestProgramExePath),
Microsoft.AspNetCore.DataProtection (10)
Internal\ContainerUtils.cs (2)
65var fs_file = new DirectoryInfo(fields[1].TrimEnd(Path.DirectorySeparatorChar)).FullName; 70if (fs_file.Equals(dir.FullName.TrimEnd(Path.DirectorySeparatorChar), StringComparison.Ordinal))
Internal\HostingApplicationDiscriminator.cs (2)
14private readonly string DirectorySeparator = Path.DirectorySeparatorChar.ToString(); 15private readonly string AltDirectorySeparator = Path.AltDirectorySeparatorChar.ToString();
Repositories\DefaultKeyStorageDirectories.cs (3)
55retVal = GetKeyStorageDirectoryFromBaseAppDataPath(Path.Combine(homePath, "AppData", "Local")); 60retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName)); 110return new DirectoryInfo(Path.Combine(basePath, "ASP.NET", DataProtectionKeysFolderName));
Repositories\FileSystemXmlRepository.cs (3)
140var tempFilename = Path.Combine(Directory.FullName, Guid.NewGuid().ToString() + ".tmp"); 141var finalFilename = Path.Combine(Directory.FullName, filename + ".xml"); 146var tempTempFilename = Path.GetTempFileName();
Microsoft.AspNetCore.DataProtection.Extensions.Tests (12)
DataProtectionProviderTests.cs (12)
51var keysPath = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 121var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx"); 148var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCertWithoutPrivateKey.pfx"), "password"); 176var certWithoutKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3WithoutPrivateKey.pfx"), "password3", X509KeyStorageFlags.Exportable); 193var certWithKey = new X509Certificate2(Path.Combine(GetTestFilesPath(), "TestCert3.pfx"), "password3"); 216var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx"); 245var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx"); 287var filePath = Path.Combine(GetTestFilesPath(), "TestCert2.pfx"); 323string uniqueTempPath = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 340=> Path.Combine(AppContext.BaseDirectory, "TestFiles");
Microsoft.AspNetCore.DataProtection.Tests (17)
Repositories\FileSystemXmlRepositoryTests.cs (10)
19? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET") 20: Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".aspnet"); 21var expectedDir = new DirectoryInfo(Path.Combine(baseDir, "DataProtection-Keys")).FullName; 205var filePath1 = Path.Combine(dirInfo.FullName, "friendly1.xml"); 206var filePath2 = Path.Combine(dirInfo.FullName, "friendly2.xml"); 207var filePath3 = Path.Combine(dirInfo.FullName, "friendly3.xml"); 222fileLock2 = new FileStream(Path.Combine(dirInfo.FullName, "friendly2.xml"), FileMode.Open, FileAccess.ReadWrite, FileShare.None); 255var filePath = Path.Combine(dirInfo.FullName, "friendly1.xml"); 318string uniqueTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
XmlEncryption\EncryptedXmlDecryptorTests.cs (7)
18var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 32var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 33var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password"); 50var fullCert = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 51var publicKeyOnly = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.PublicKeyOnly.cer"), ""); 68var testCert1 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert1.pfx"), "password"); 69var testCert2 = new X509Certificate2(Path.Combine(AppContext.BaseDirectory, "TestFiles", "TestCert2.pfx"), "password");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (29)
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.DeveloperCertificates.XPlat.Tests (3)
CertificateManagerTests.cs (3)
185var exportedCertificate = X509Certificate2.CreateFromEncryptedPemFile(CertificateName, certificatePassword, Path.ChangeExtension(CertificateName, "key")); 347var exportedCertificate = X509Certificate2.CreateFromPemFile(CertificateName, Path.ChangeExtension(CertificateName, "key")); 373.EnsureAspNetCoreHttpsDevelopmentCertificate(now, now.AddYears(1), Path.Combine("NoSuchDirectory", CertificateName));
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (2)
402Write(System.IO.Path.GetFileName(firstFrame.File)); 650Write(System.IO.Path.GetFileName(frame.File));
Microsoft.AspNetCore.Diagnostics.Tests (2)
ExceptionDetailsProviderTest.cs (2)
41Path.Combine(rootPath, "TestFiles/SourceFile.txt") 46Path.Combine(rootPath, @"TestFiles\SourceFile.txt");
Microsoft.AspNetCore.FunctionalTests (18)
WebApplicationFunctionalTests.cs (13)
16var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 21await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @" 59var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 64await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.Development.json"), @" 102var contentRootPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 107await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @" 143await File.WriteAllTextAsync(Path.Combine(contentRootPath, "appsettings.json"), @"
WebHostFunctionalTests.cs (5)
156var deploymentParameters = new DeploymentParameters(Path.Combine(GetTestSitesPath(), applicationName), ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) 211var deploymentParameters = new DeploymentParameters(Path.Combine(GetTestSitesPath(), applicationName), ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitectures.Current) 242var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "DefaultBuilder.slnf")); 245return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "testassets"));
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Infrastructure\OpenApiTestHelpers.cs (1)
24var filePath = Path.Combine(System.AppContext.BaseDirectory, "Microsoft.AspNetCore.Grpc.Swagger.Tests.xml");
Microsoft.AspNetCore.Hosting (13)
Internal\HostingEnvironmentExtensions.cs (6)
30var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 38hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 43hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath); 81var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 89hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 94hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath);
src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StaticWebAssets\StaticWebAssetsLoader.cs (2)
77var basePath = string.IsNullOrEmpty(assemblyLocation) ? AppContext.BaseDirectory : Path.GetDirectoryName(assemblyLocation); 78return Path.Combine(basePath!, $"{environment.ApplicationName}.staticwebassets.runtime.json");
WebHostBuilder.cs (3)
370if (Path.IsPathRooted(contentRootPath)) 374return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
Microsoft.AspNetCore.Hosting.FunctionalTests (3)
LinkedApplicationTests.cs (1)
21var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets",
ShutdownTests.cs (1)
46var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets",
WebHostBuilderTests.cs (1)
28var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets", "IStartupInjectionAssemblyName");
Microsoft.AspNetCore.Hosting.Tests (30)
HostingApplicationDiagnosticsTests.cs (5)
180var testSource = new ActivitySource(Path.GetRandomFileName()); 1014var testSource = new ActivitySource(Path.GetRandomFileName()); 1086var testSource = new ActivitySource(Path.GetRandomFileName()); 1128var testSource = new ActivitySource(Path.GetRandomFileName()); 1187var testSource = new ActivitySource(Path.GetRandomFileName());
HostingApplicationTests.cs (4)
95var testSource = new ActivitySource(Path.GetRandomFileName()); 96var dummySource = new ActivitySource(Path.GetRandomFileName()); 137var testSource = new ActivitySource(Path.GetRandomFileName()); 138var dummySource = new ActivitySource(Path.GetRandomFileName());
HostingEnvironmentExtensionsTests.cs (12)
24env.Initialize(Path.GetFullPath("."), webHostOptions); 26Assert.Equal(Path.GetFullPath("."), env.ContentRootPath); 27Assert.Equal(Path.GetFullPath("testroot"), env.WebRootPath); 37env.Initialize(Path.GetFullPath("testroot"), CreateWebHostOptions()); 39Assert.Equal(Path.GetFullPath("testroot"), env.ContentRootPath); 40Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.WebRootPath); 50env.Initialize(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), CreateWebHostOptions()); 52Assert.Equal(Path.GetFullPath(Path.Combine("testroot", "wwwroot")), env.ContentRootPath); 71env.Initialize(Path.GetFullPath("."), webHostOptions);
StaticWebAssets\ManifestStaticWebAssetsFileProviderTests.cs (3)
20manifest.ContentRoots = new[] { Path.GetDirectoryName(typeof(ManifestStaticWebAssetsFileProviderTest).Assembly.Location) }; 368manifest.ContentRoots = new[] { Path.Combine(AppContext.BaseDirectory, "testroot", "wwwroot") }; 616manifest.ContentRoots = new[] { Path.GetDirectoryName(typeof(ManifestStaticWebAssetsFileProviderTest).Assembly.Location) };
WebHostBuilderTests.cs (4)
687Assert.True(Path.IsPathRooted(basePath)); 688Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath); 690Assert.True(Path.IsPathRooted(basePath2)); 691Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath2);
WebHostTests.cs (2)
850Assert.Equal(Path.GetFullPath("testroot"), env.WebRootPath); 856Assert.Equal(Path.GetFullPath("testroot"), env1.WebRootPath);
Microsoft.AspNetCore.Http (2)
BindingAddress.cs (1)
246if (isUnixPipe && !Path.IsPathRooted(GetUnixPipePath(host)))
src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
EndpointFilterInvocationContextOfTTests.cs (2)
87var currentContentPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "EndpointFilterInvocationContextOfT.Generated.cs"); 88var templatePath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "EndpointFilterInvocationContextOfT.Generated.tt");
Microsoft.AspNetCore.Http.Microbenchmarks (7)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (7)
120var symbolsName = Path.ChangeExtension(assemblyName, "pdb"); 357? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "RequestDelegateGenerator", "Baselines") 359var baselineFilePath = Path.Combine(baselineFilePathRoot!, $"{callerName}.generated.txt"); 422var dll = Path.Combine(Directory.GetCurrentDirectory(), "refs", Path.GetFileName(assembly)); 430dll = Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(assembly));
Microsoft.AspNetCore.Http.Results (2)
PhysicalFileHttpResult.cs (1)
143if (!Path.IsPathRooted(fileName))
Results.cs (1)
481=> Path.IsPathRooted(path)
Microsoft.AspNetCore.Http.Results.Tests (59)
ResultsCacheTests.cs (2)
13var currentContentPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsCache.StatusCodes.cs"); 14var templatePath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsCache.StatusCodes.tt");
ResultsOfTTests.cs (4)
27var resultsOfTGeneratedPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsOfT.Generated.cs"); 28var testsGeneratedPath = Path.Combine(AppContext.BaseDirectory, "Shared", "GeneratedContent", "ResultsOfTTests.Generated.cs"); 30var testResultsOfTGeneratedPath = Path.GetTempFileName(); 31var testTestsGeneratedPath = Path.GetTempFileName();
ResultsTests.cs (2)
1754(() => Results.File(Path.Join(Path.DirectorySeparatorChar.ToString(), "rooted", "path"), null, null, null, null, false), typeof(PhysicalFileHttpResult)),
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (40)
38var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 60Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 69var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 92Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 101var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 119Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 128var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 146Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 158var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 175Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 186var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 215var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 242var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 270var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 294var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 310Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 327var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt")); 337Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile_ASCII.txt")), sendFile.Name); 347var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")); 357Assert.Equal(Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (11)
44var path = Path.GetFullPath("helllo.txt"); 81var path = Path.GetFullPath("helllo.txt"); 118var path = Path.GetFullPath("helllo.txt"); 151var path = Path.GetFullPath("helllo.txt"); 187var path = Path.GetFullPath("helllo.txt"); 221var path = Path.GetFullPath("helllo.txt"); 257var path = Path.GetFullPath("helllo.txt"); 288var path = Path.GetFullPath("helllo.txt"); 324var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt"); 345Assert.Equal(Path.Combine("TestFiles", "FilePathResultTestFile.txt"), sendFile.Name); 379var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt");
Microsoft.AspNetCore.HttpLogging (4)
FileLoggerProcessor.cs (4)
53_path = Path.Join(environment.ContentRootPath, "logs"); 55else if (!Path.IsPathRooted(_path)) 57_path = Path.Join(environment.ContentRootPath, _path); 329return Path.Combine(_path, FormattableString.Invariant($"{_fileName}{date.Year:0000}{date.Month:00}{date.Day:00}.{_fileNumber:0000}.txt"));
Microsoft.AspNetCore.HttpLogging.Tests (23)
FileLoggerProcessorTests.cs (21)
22TempPath = Path.Combine(Environment.CurrentDirectory, "_"); 34var path = Path.Combine(TempPath, Path.GetRandomFileName()); 70var path = Path.Combine(TempPath, Path.GetRandomFileName()); 112var path = Path.Combine(TempPath, Path.GetRandomFileName()); 152var path = Path.Combine(TempPath, Path.GetRandomFileName()); 154File.WriteAllText(Path.Combine(path, "randomFile.txt"), "Text"); 207var path = Path.Combine(TempPath, Path.GetRandomFileName()); 272var path = Path.Combine(TempPath, Path.GetRandomFileName()); 358var path = Path.Combine(TempPath, Path.GetRandomFileName()); 421var path = Path.Combine(TempPath, Path.GetRandomFileName()); 490var path = Path.Combine(TempPath, Path.GetRandomFileName()); 589return Path.Combine(path, GetLogFileName(prefix, dateTime, fileNumber));
W3CLoggerTests.cs (2)
17var path = Path.GetTempFileName() + "_"; 61var path = Path.GetTempFileName() + "_";
Microsoft.AspNetCore.Identity.Test (6)
IdentityUIScriptsTest.cs (6)
84var wwwrootDir = Path.Combine(GetProjectBasePath(), "assets", scriptTag.Version); 87Path.Combine(wwwrootDir, scriptTag.FallbackSrc.Replace("Identity", "").TrimStart('~').TrimStart('/'))); 109var uiDirV4 = Path.Combine(GetProjectBasePath(), "Areas", "Identity", "Pages", "V4"); 110var uiDirV5 = Path.Combine(GetProjectBasePath(), "Areas", "Identity", "Pages", "V5"); 166return Directory.Exists(projectPath) ? projectPath : Path.Combine(FindHelixSlnFileDirectory(), "UI"); 171var applicationPath = Path.GetDirectoryName(typeof(IdentityUIScriptsTest).Assembly.Location);
Microsoft.AspNetCore.Identity.UI (4)
Areas\Identity\Pages\V4\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Areas\Identity\Pages\V5\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Microsoft.AspNetCore.InternalTesting (16)
AssemblyTestLog.cs (5)
120logOutputDirectory = Path.Combine(_baseDirectory, className); 140var testOutputFile = Path.Combine(logOutputDirectory, $"{testName}{LogFileExtension}"); 148testOutputFile = Path.Combine(logOutputDirectory, $"{testName}.{i}{LogFileExtension}"); 191var globalLogFileName = Path.Combine(baseDirectory, "global.log"); 274var dir = Path.GetDirectoryName(fileName);
CollectDumpAttribute.cs (1)
30var path = Path.Combine(context.FileOutput.TestClassOutputDirectory, context.FileOutput.GetUniqueFileName(context.FileOutput.TestName, ".dmp"));
HelixHelper.cs (3)
20? Path.Combine(Path.GetTempPath(), uploadFileName) 21: Path.Combine(uploadRoot, uploadFileName);
TestFileOutputContext.cs (4)
43TestClassOutputDirectory = Path.Combine(AssemblyOutputDirectory, TestClassName); 64var path = Path.Combine(TestClassOutputDirectory, $"{prefix}{extension}"); 69path = Path.Combine(TestClassOutputDirectory, $"{prefix}{i++}{extension}"); 91return Path.Combine(baseDirectory, assembly.GetName().Name, attribute.TargetFramework);
TestPathUtilities.cs (3)
19var projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, $"{solution}.slnf")); 25projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "AspNetCore.slnx")); 29directoryInfo = new DirectoryInfo(Path.Combine(directoryInfo.FullName, "src"));
Microsoft.AspNetCore.InternalTesting.Tests (16)
AssemblyTestLogTests.cs (15)
47var tfmPath = Path.Combine(tempDir, assemblyName, TestableAssembly.TFM); 48var globalLogPath = Path.Combine(tfmPath, "global.log"); 49var testLog = Path.Combine(tfmPath, TestableAssembly.TestClassName, $"{testName}.log"); 148var globalLogPath = Path.Combine( 153var testLog = Path.Combine( 184var globalLogPath = Path.Combine( 189var testLog = Path.Combine( 230var globalLogPath = Path.Combine( 235var testLog = Path.Combine( 298Path.Combine(tempDir, TestableAssembly.ThisAssemblyName, TestableAssembly.TFM, "FakeTestClass")) 301var testFileName = Path.GetFileNameWithoutExtension(testLog.Name); 343Assert.True(File.Exists(Path.Combine( 353Assert.True(File.Exists(Path.Combine( 368var tempDir = Path.Combine(Path.GetTempPath(), $"TestLogging_{Guid.NewGuid():N}");
TestableAspNetTestAssemblyRunner.cs (1)
54.Returns(Path.Combine(Directory.GetCurrentDirectory(), $"{testAssemblyName}.dll"));
Microsoft.AspNetCore.Mvc.Core (3)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
72Path.GetDirectoryName(assembly.Location); 90var relatedAssemblyLocation = Path.Combine(assemblyDirectory, attribute.AssemblyFileName + ".dll");
Infrastructure\PhysicalFileResultExecutor.cs (1)
79if (!Path.IsPathRooted(result.FileName))
Microsoft.AspNetCore.Mvc.Core.Test (62)
ApplicationParts\RelatedAssemblyPartTest.cs (5)
12private static readonly string AssemblyDirectory = Path.GetTempPath().TrimEnd(Path.DirectorySeparatorChar); 44var assemblyPath = Path.Combine(AssemblyDirectory, "MyAssembly.dll"); 59var assemblyPath = Path.Combine(AssemblyDirectory, "MyAssembly.dll"); 89public string LocationSettable { get; set; } = Path.Combine(AssemblyDirectory, "MyAssembly.dll");
ControllerBaseTest.cs (4)
1773var path = Path.GetFullPath("somepath"); 1795var path = Path.GetFullPath("somepath"); 1817var path = Path.GetFullPath("somepath"); 1839var path = Path.GetFullPath("somepath");
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (40)
38var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 60Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 69var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 92Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 101var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 119Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 128var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 146Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 158var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 175Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 186var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 215var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 242var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 270var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 294var path = Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")); 310Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile.txt")), sendFile.Name); 327var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile_ASCII.txt")); 337Assert.Equal(Path.GetFullPath(Path.Combine("TestFiles", "FilePathResultTestFile_ASCII.txt")), sendFile.Name); 347var path = Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")); 357Assert.Equal(Path.GetFullPath(Path.Combine(".", "TestFiles", "FilePathResultTestFile.txt")), sendFile.Name);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (11)
44var path = Path.GetFullPath("helllo.txt"); 81var path = Path.GetFullPath("helllo.txt"); 118var path = Path.GetFullPath("helllo.txt"); 151var path = Path.GetFullPath("helllo.txt"); 187var path = Path.GetFullPath("helllo.txt"); 221var path = Path.GetFullPath("helllo.txt"); 257var path = Path.GetFullPath("helllo.txt"); 288var path = Path.GetFullPath("helllo.txt"); 324var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt"); 345Assert.Equal(Path.Combine("TestFiles", "FilePathResultTestFile.txt"), sendFile.Name); 379var path = Path.Combine("TestFiles", "FilePathResultTestFile.txt");
VirtualFileResultTest.cs (2)
23var path = Path.GetFullPath("helllo.txt"); 36var path = Path.GetFullPath("helllo.txt");
Microsoft.AspNetCore.Mvc.FunctionalTests (9)
Infrastructure\ResourceFile.cs (2)
228var projectPath = Path.Combine(solutionPath, "test", assembly.GetName().Name); 229var fullPath = Path.Combine(projectPath, resourceName);
SimpleWithWebApplicationBuilderTests.cs (2)
205expectedWebRoot = Path.GetFullPath(Path.Combine(builder.GetSetting(WebHostDefaults.ContentRootKey), webRoot));
WebApplicationFactorySlnxTests.cs (5)
20_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")[..8]); 21_contentDirectory = Path.Combine(_tempDirectory, "BasicWebSite"); 27var wwwrootDir = Path.Combine(_contentDirectory, "wwwroot"); 37var slnxFile = Path.Combine(_tempDirectory, "TestSolution.slnx");
Microsoft.AspNetCore.Mvc.Localization (1)
ViewLocalizer.cs (1)
97var extension = Path.GetExtension(path);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
FileProviderRazorProjectFileSystem.cs (1)
64else if (string.Equals(RazorFileExtension, Path.GetExtension(fileInfo.Name), StringComparison.OrdinalIgnoreCase))
FileProviderRazorProjectItem.cs (2)
83(PhysicalPath[_root.Length] == Path.DirectorySeparatorChar || PhysicalPath[_root.Length] == Path.AltDirectorySeparatorChar))
RuntimeViewCompiler.cs (1)
339var assemblyName = Path.GetRandomFileName();
src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (18)
AssemblyPartExtensionTest.cs (1)
25references.Select(Path.GetFileNameWithoutExtension));
FileProviderRazorProjectFileSystemTest.cs (17)
53Assert.Equal(Path.Combine("BasePath", "File1.cshtml"), file.PhysicalPath); 60Assert.Equal(Path.Combine("BasePath", "File3.cshtml"), file.PhysicalPath); 89var file5 = fileProvider.AddFile(Path.Combine("Level1-Dir2", "File5.cshtml"), "content"); 104Assert.Equal(Path.Combine("BasePath", "File1.cshtml"), file.PhysicalPath); 111Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File2.cshtml"), file.PhysicalPath); 112Assert.Equal(Path.Combine("Level1-Dir1", "File2.cshtml"), file.RelativePhysicalPath); 118Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File3.cshtml"), file.PhysicalPath); 119Assert.Equal(Path.Combine("Level1-Dir1", "File3.cshtml"), file.RelativePhysicalPath); 125Assert.Equal(Path.Combine("BasePath", "Level1-Dir2", "File5.cshtml"), file.PhysicalPath); 126Assert.Equal(Path.Combine("Level1-Dir2", "File5.cshtml"), file.RelativePhysicalPath); 154var file5 = fileProvider.AddFile(Path.Combine("Level1-Dir2", "File5.cshtml"), "content"); 169Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File2.cshtml"), file.PhysicalPath); 170Assert.Equal(Path.Combine("Level1-Dir1", "File2.cshtml"), file.RelativePhysicalPath); 176Assert.Equal(Path.Combine("BasePath", "Level1-Dir1", "File3.cshtml"), file.PhysicalPath); 177Assert.Equal(Path.Combine("Level1-Dir1", "File3.cshtml"), file.RelativePhysicalPath); 199Assert.Equal(Path.Combine("BasePath", "File3.cshtml"), item.PhysicalPath); 221Assert.Equal(Path.Combine("BasePath2", "File3.cshtml"), item.PhysicalPath);
Microsoft.AspNetCore.Mvc.RazorPages (1)
ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.RazorPages.Test (4)
PageModelTest.cs (2)
1410var path = Path.GetFullPath("somepath"); 1427var path = Path.GetFullPath("somepath");
PageTest.cs (2)
1400var path = Path.GetFullPath("somepath"); 1417var path = Path.GetFullPath("somepath");
Microsoft.AspNetCore.Mvc.Testing (5)
WebApplicationFactory.cs (5)
417var contentRootCandidate = Path.Combine( 421var contentRootMarker = Path.Combine( 423Path.GetFileName(contentRootAttribute.ContentRootTest)); 526var depsFile = new FileInfo(Path.Combine(AppContext.BaseDirectory, depsFileName)); 531Path.GetFileName(depsFile.FullName)));
Microsoft.AspNetCore.Mvc.Views.TestCommon (5)
TestFileProvider.cs (5)
44PhysicalPath = Path.Combine(Root, NormalizeAndEnsureValidPhysicalPath(path)), 45Name = Path.GetFileName(path), 56var directoryContent = new TestDirectoryContent(Path.GetFileName(path), files); 114filePath = filePath.Replace('/', Path.DirectorySeparatorChar); 116if (filePath[0] == Path.DirectorySeparatorChar)
Microsoft.AspNetCore.OpenApi.Build.Tests (16)
GenerateAdditionalXmlFilesForOpenApiTests.cs (13)
22WorkingDirectory = Path.GetDirectoryName(projectFile), 46var classLibTempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 50var classLibProjectPath = Path.Combine(classLibTempPath, "ClassLibrary.csproj"); 63var classLibSourcePath = Path.Combine(classLibTempPath, "Class1.cs"); 74var tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 78var sourceTargetsPath = Path.Combine(AppContext.BaseDirectory, "Microsoft.AspNetCore.OpenApi.targets"); 79var targetTargetsPath = Path.Combine(tempPath, "Microsoft.AspNetCore.OpenApi.targets"); 82var projectPath = Path.Combine(tempPath, "TestProject.csproj"); 101var sourcePath = Path.Combine(tempPath, "Program.cs");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
Microsoft.AspNetCore.OpenApi.Tests (3)
Integration\OpenApiDocumentIntegrationTests.cs (2)
43? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots") 45var outputDirectory = Path.Combine(baseSnapshotsDirectory, version.ToString());
Integration\OpenApiDocumentLocalizationTests.cs (1)
15? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots")
Microsoft.AspNetCore.OutputCaching.Tests (1)
TestUtils.cs (1)
57var path = Path.Combine(AppContext.BaseDirectory, "TestDocument.txt");
Microsoft.AspNetCore.ResponseCaching.Tests (1)
TestUtils.cs (1)
82var path = Path.Combine(AppContext.BaseDirectory, "TestDocument.txt");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (7)
ResponseCachingTests.cs (2)
25_absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName());
ResponseSendFileTests.cs (2)
31RelativeFilePath = Path.GetFileName(AbsoluteFilePath); 308var emptyFilePath = Path.Combine(Directory.GetCurrentDirectory(), "zz_" + Guid.NewGuid().ToString() + "EmptyTestFile.txt");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
DelegateOutOfProcTests.cs (1)
25var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("HttpSysServer"), "test", "testassets",
Microsoft.AspNetCore.Server.IIS (4)
src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StartupHook.cs (1)
50var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
WebHostBuilderIISExtensions.cs (1)
34var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
Microsoft.AspNetCore.Server.IntegrationTesting (22)
ApplicationPublisher.cs (1)
122var tempPath = Path.GetTempPath() + Guid.NewGuid().ToString("N");
CachingApplicationPublisher.cs (1)
70var destFileName = Path.Combine(target.FullName, fileInfo.Name);
Common\DotNetCommands.cs (4)
27var result = Path.Combine(Directory.GetCurrentDirectory(), _dotnetFolderName); 50result = Path.Combine(userProfile, _dotnetFolderName); 63var archSpecificDir = Path.Combine(dotnetDir, arch.ToString()); 83return Path.Combine(dotnetDir, dotnetFile);
Deployers\NginxDeployer.cs (4)
32_configFile = Path.GetTempFileName(); 138var pidFile = Path.Combine(DeploymentParameters.ApplicationPath, $"{Guid.NewGuid()}.nginx.pid"); 139var errorLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.error.log"); 140var accessLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.access.log");
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (9)
91_deployedFolderPathInFileShare = Path.Combine(_deploymentParameters.RemoteServerFileSharePath, folderId); 153var webConfigFilePath = Path.Combine(_deploymentParameters.PublishedApplicationRootPath, "web.config"); 163Path.Combine(_deploymentParameters.DotnetRuntimePath, "dotnet.exe")); 204executableParameters = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".dll"); 208executablePath = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".exe"); 289var temppath = Path.Combine(destDirName, file.Name); 297var temppath = Path.Combine(destDirName, subdir.Name); 318var physicalFilePath = Path.Combine(Path.GetTempPath(), embeddedFileName);
Deployers\SelfHostDeployer.cs (2)
98workingDirectory = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework); 103var executable = Path.Combine(workingDirectory, DeploymentParameters.ApplicationName + executableExtension);
xunit\IISExpressAncmSchema.cs (1)
21var ancmConfigPath = Path.Combine(
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (23)
IISDeployer.cs (11)
100_debugLogFile = Path.GetTempFileName(); 113IISDeploymentParameters.ServerConfigLocation = Path.Combine(@"C:\inetpub\temp\apppools", _appPoolName, $"{_appPoolName}.config"); 185var file = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, debugLogLocation); 308_configPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("D")); 309_applicationHostConfig = Path.Combine(_configPath, "applicationHost.config"); 510HelixHelper.PreserveFile(Path.Combine(DeploymentParameters.PublishedApplicationRootPath, "web.config"), fileNamePrefix + ".web.config"); 511HelixHelper.PreserveFile(Path.Combine(_configPath, "applicationHost.config"), fileNamePrefix + ".applicationHost.config"); 512HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\ApplicationHost.config"), fileNamePrefix + ".inetsrv.applicationHost.config"); 513HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\redirection.config"), fileNamePrefix + ".inetsrv.redirection.config"); 514var tmpFile = Path.GetRandomFileName();
IISDeployerBase.cs (4)
43var path = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, "web.config"); 94var basePath = File.Exists(Path.Combine(AppContext.BaseDirectory, "x64", "aspnetcorev2.dll")) ? "" : @"ANCM\"; 96var ancmFile = Path.Combine(AppContext.BaseDirectory, arch); 99ancmFile = Path.Combine(AppContext.BaseDirectory, ancmDllName);
IISDeploymentParameterExtensions.cs (1)
132WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogFile", Path.Combine(path, "std")));
IISExpressDeployer.cs (7)
69var entryPoint = Path.Combine(dllRoot, DeploymentParameters.ApplicationName + executableExtension); 120dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.RuntimeArchitecture.ToString(), 126dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework); 185WorkingDirectory = Path.GetDirectoryName(iisExpressPath) 298var webConfigPath = Path.Combine(contentRoot, "web.config"); 308DeploymentParameters.ServerConfigLocation = Path.GetTempFileName(); 384var iisExpressPath = Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + "\\", programFiles, "IIS Express", "iisexpress.exe");
Microsoft.AspNetCore.Server.Kestrel.Core (46)
Internal\CertificatePathWatcher.cs (7)
115var path = Path.Combine(_contentRootDir, certificateConfig.Path); 116var dir = Path.GetDirectoryName(path)!; 141() => dirMetadata.FileProvider.Watch(Path.GetFileName(path)), 176var dirMetadata = _metadataForDirectory[Path.GetDirectoryName(path)!]; 185var fileInfo = dirMetadata.FileProvider.GetFileInfo(Path.GetFileName(path)); 218var path = Path.Combine(_contentRootDir, certificateConfig.Path); 219var dir = Path.GetDirectoryName(path)!;
Internal\Certificates\CertificateConfigLoader.cs (3)
40var certificatePath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!); 46var certificateKeyPath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.KeyPath); 75return (new X509Certificate2(Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!), certInfo.Password), fullChain);
KestrelServerOptions.cs (1)
587if (!Path.IsPathRooted(socketPath))
ListenOptionsHttpsExtensions.cs (3)
39return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName))); 53return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password)); 68return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password), configureOptions);
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
TlsConfigurationLoader.cs (3)
192var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 193basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 194path = basePath != null ? Path.Combine(basePath, $"{applicationName}.pfx") : null;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (23)
CertificatePathWatcherTests.cs (20)
22var fileName = Path.GetRandomFileName(); 23var filePath = Path.Combine(dir, fileName); 79dirs[i] = Path.Combine(rootDir, $"dir{i}"); 122var fileName = Path.GetRandomFileName(); 123var filePath = Path.Combine(dir, fileName); 172var fileName = Path.GetRandomFileName(); 173var filePath = Path.Combine(dir, fileName); 211var dir = Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName()); 222Path = Path.Combine(dir, "test.pfx"), 239var fileName = Path.GetRandomFileName(); 240var filePath = Path.Combine(dir, fileName); 273var fileName = Path.GetRandomFileName(); 274var filePath = Path.Combine(dir, fileName); 313var fileName = Path.GetRandomFileName(); 314var filePath = Path.Combine(dir, fileName); 344var fileName = Path.GetRandomFileName(); 345var filePath = Path.Combine(dir, fileName); 404var fileName = Path.GetRandomFileName(); 405var filePath = Path.Combine(dir, fileName);
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
NamedPipesTransportBenchmark.cs (1)
41_pipeName = "MicrobenchmarksTestPipe-" + Path.GetRandomFileName();
Microsoft.AspNetCore.Server.Kestrel.Tests (48)
GeneratedCodeTests.cs (10)
24var httpHeadersGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpHeaders.Generated.cs"); 25var httpProtocolGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpProtocol.Generated.cs"); 26var httpUtilitiesGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "HttpUtilities.Generated.cs"); 27var transportMultiplexedConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportMultiplexedConnection.Generated.cs"); 28var transportConnectionGeneratedPath = Path.Combine(AppContext.BaseDirectory, "shared", "GeneratedContent", "TransportConnection.Generated.cs"); 30var testHttpHeadersGeneratedPath = Path.GetTempFileName(); 31var testHttpProtocolGeneratedPath = Path.GetTempFileName(); 32var testHttpUtilitiesGeneratedPath = Path.GetTempFileName(); 33var testTransportMultiplexedConnectionGeneratedPath = Path.GetTempFileName(); 34var testTransportConnectionGeneratedPath = Path.GetTempFileName();
HttpsConfigurationTests.cs (6)
33serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"); 105new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 146new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 183new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx")), 220serverOptions.TestOverrideDefaultCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"); 253ServerCertificate = new X509Certificate2(Path.Combine("shared", "TestCertificates", "aspnetdevcert.pfx"), "testPassword"),
KestrelConfigurationLoaderTests.cs (29)
279Directory.CreateDirectory(Path.GetDirectoryName(path)); 320Directory.CreateDirectory(Path.GetDirectoryName(devCertPath)); 446Directory.CreateDirectory(Path.GetDirectoryName(path)); 493Directory.CreateDirectory(Path.GetDirectoryName(path)); 542Directory.CreateDirectory(Path.GetDirectoryName(path)); 595new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 596new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")) 619new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 620new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-ecdsa.key")), 644new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 645new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.key")), 669new KeyValuePair<string, string>("Certificates:Default:Path", Path.Combine("shared", "TestCertificates", "https-aspnet.crt")), 670new KeyValuePair<string, string>("Certificates:Default:KeyPath", Path.Combine("shared", "TestCertificates", "https-aspnet.pub")), 806certificateFilePath = Path.Combine(tempDir, $"test{extension}"); 807certificateKeyPath = Path.Combine(tempDir, "test.key"); 984Directory.CreateDirectory(Path.GetDirectoryName(path)); 1140Directory.CreateDirectory(Path.GetDirectoryName(certificatePath)); 1220var oldDir = Directory.CreateDirectory(Path.Combine(tempDir, "old")); 1221var newDir = Directory.CreateDirectory(Path.Combine(tempDir, "new")); 1222var oldCertPath = Path.Combine(oldDir.FullName, "tls.key"); 1223var newCertPath = Path.Combine(newDir.FullName, "tls.key"); 1225var dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./old"); 1226var fileLink = File.CreateSymbolicLink(Path.Combine(tempDir, "tls.key"), "./link/tls.key"); 1271dirLink = Directory.CreateSymbolicLink(Path.Combine(tempDir, "link"), "./new"); 1628var certPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.pem"); 1629var keyPath = Path.Combine("shared", "TestCertificates", "https-ecdsa.key"); 2144var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 2145basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 2146return Path.Combine(basePath, $"TestApplication.pfx");
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Microsoft.AspNetCore.Shared.Tests (5)
DotNetMuxerTests.cs (2)
20Assert.True(Path.IsPathRooted(muxerPath), "The path should be rooted"); 21Assert.Equal("dotnet", Path.GetFileNameWithoutExtension(muxerPath), ignoreCase: true);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
src\SignalR\common\Shared\TestCertificates.cs (4)
35var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCert.pfx"); 41var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCertECC.pfx");
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (2)
Docker.cs (2)
63foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 65var candidate = Path.Combine(dir, "docker" + _exeSuffix);
Microsoft.AspNetCore.SpaProxy (6)
SpaHostingStartup.cs (1)
20var spaProxyConfigFile = Path.Combine(AppContext.BaseDirectory, "spa.proxy.json");
SpaProxyLaunchManager.cs (5)
178if (OperatingSystem.IsWindows() && !Path.HasExtension(command)) 197WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 243WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 268var scriptPath = Path.Combine(AppContext.BaseDirectory, fileName); 305WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory)
Microsoft.AspNetCore.SpaServices.Extensions (1)
StaticFiles\DefaultSpaStaticFileProvider.cs (1)
31var absoluteRootPath = Path.Combine(
Microsoft.AspNetCore.StaticAssets (5)
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (3)
60return Path.Combine(AppContext.BaseDirectory, $"{environment.ApplicationName}.staticwebassets.endpoints.json"); 63return Path.IsPathRooted(staticAssetsManifestPath) ? staticAssetsManifestPath : Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath);
StaticAssetsEndpointRouteBuilderExtensions.cs (2)
33staticAssetsManifestPath = !Path.IsPathRooted(staticAssetsManifestPath) ? 34Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath) :
Microsoft.AspNetCore.StaticAssets.Tests (11)
StaticAssetsIntegrationTests.cs (11)
325var filePath = Path.Combine(webRoot, "sample.txt"); 382File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified"); 435File.WriteAllText(Path.Combine(webRoot, "sample.txt"), "Hello, World! Modified"); 444Assert.Equal(GetGzipEtag(Path.Combine(webRoot, "sample.txt")), response.Headers.ETag.Tag); 473var contentRoot = Path.Combine(AppContext.BaseDirectory, appName); 474var webRoot = Path.Combine(contentRoot, "wwwroot"); 482var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{appName}.staticwebassets.endpoints.json"); 491var filePath = Path.Combine(webRoot, resource.Path); 514var compressedFilePath = Path.Combine(webRoot, resource.Path + ".gz"); 1035return Path.GetExtension(filePath) switch 1084public string Name => Path.GetFileName(testResource.Path);
Microsoft.AspNetCore.StaticFiles (2)
StaticFileMiddleware.cs (2)
49_logger.WebRootPathNotFound(Path.GetFullPath(Path.Combine(hostingEnv.ContentRootPath, hostingEnv.WebRootPath ?? "wwwroot")));
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
FallbackStaticFileTest.cs (1)
48FileProvider = new PhysicalFileProvider(Path.Combine(environment.WebRootPath, "SubFolder")),
StaticFileMiddlewareTests.cs (6)
108var last = File.GetLastWriteTimeUtc(Path.Combine(AppContext.BaseDirectory, "TestDocument.txt")); 145.UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) 158var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 187.UseWebRoot(Path.Combine(AppContext.BaseDirectory, baseDir)) 200var fileInfo = hostingEnvironment.WebRootFileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 247.UseWebRoot(Path.Combine(AppContext.BaseDirectory))
Microsoft.AspNetCore.StaticFiles.Tests (33)
DefaultContentTypeProviderTests.cs (1)
65Assert.True(provider.TryGetContentType($"{new string(System.IO.Path.GetInvalidPathChars())}.txt", out contentType));
DefaultFilesMiddlewareTests.cs (6)
60using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 83using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 126using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 208using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 255using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 310using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
DirectoryBrowserMiddlewareTests.cs (7)
81using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 100using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 141using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 214using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 258using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 308using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 356using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
StaticFileMiddlewareTests.cs (19)
51var badLink = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName() + ".txt"); 53Process.Start("ln", $"-s \"/tmp/{Path.GetRandomFileName()}\" \"{badLink}\"").WaitForExit(); 72var response = await server.CreateClient().GetAsync(Path.GetFileName(badLink)); 177using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 185var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 213using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)); 224var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 253using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)); 266var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 296using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)); 316var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 340using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 359var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 388using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, "."))) 444using var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, ".")); 470using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir))) 478var fileInfo = fileProvider.GetFileInfo(Path.GetFileName(requestUrl)); 530using (var fileProvider = new PhysicalFileProvider(Path.Combine(AppContext.BaseDirectory, baseDir)))
Microsoft.AspNetCore.TestHost (2)
WebHostBuilderExtensions.cs (2)
199builder.UseContentRoot(Path.GetFullPath(Path.Combine(directoryInfo.FullName, solutionRelativePath)));
Microsoft.AspNetCore.TestHost.Tests (15)
UseSolutionRelativeContentRootTests.cs (15)
18_tempDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")[..8]); 19_contentDirectory = Path.Combine(_tempDirectory, "src"); 26var solutionFile = Path.Combine(_tempDirectory, "TestApp.sln"); 44var solutionFile = Path.Combine(_tempDirectory, "TestApp.slnx"); 69var subDirectory = Path.Combine(_tempDirectory, "sub"); 72var slnFile = Path.Combine(subDirectory, "TestApp.sln"); 73var slnxFile = Path.Combine(_tempDirectory, "TestApp.slnx"); 98var expectedPath = Path.Combine(_contentDirectory, "sub"); 101var slnFile = Path.Combine(_tempDirectory, "TestApp.sln"); 102var slnxFile = Path.Combine(_contentDirectory, "TestApp.slnx"); 127var slnFile = Path.Combine(_tempDirectory, "TestApp.sln"); 128var slnxFile = Path.Combine(_tempDirectory, "TestApp.slnx"); 167var subDirectory = Path.Combine(_tempDirectory, "sub", "folder"); 170var solutionFile = Path.Combine(_tempDirectory, "TestApp.slnx");
Microsoft.AspNetCore.Tests (47)
WebApplicationTests.cs (47)
391var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 392var webRoot = Path.Combine(contentRoot, "wwwroot"); 411var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 412var webRoot = Path.Combine(contentRoot, "wwwroot"); 468var contentRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 476builder.Host.UseContentRoot(contentRoot + Path.DirectorySeparatorChar); 480builder.WebHost.UseContentRoot(contentRoot + Path.DirectorySeparatorChar); 502var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 504var fullWebRootPath = Path.Combine(contentRoot, "wwwroot2"); 531var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 533var fullWebRootPath = Path.Combine(contentRoot, "wwwroot"); 573var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 575var fullWebRootPath = Path.Combine(contentRoot, "wwwroot"); 622builder.Host.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory)); 626builder.WebHost.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory)); 633Path.TrimEndingDirectorySeparator(Path.GetFullPath(unnormalizedPath)); 788var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 791var fullWebRootPath = Path.Combine(contentRoot, webRoot); 831var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 834var fullWebRootPath = Path.Combine(contentRoot, webRoot); 880var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 883var fullWebRootPath = Path.Combine(contentRoot, webRoot); 1079var contentRoot = Path.GetTempPath().ToString(); 2216var wwwroot = Path.Combine(AppContext.BaseDirectory, "wwwroot"); 2249var contentRoot = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 2281ContentRootPath = Path.GetTempPath() 2300Assert.Equal(Path.GetTempPath(), hostEnv.ContentRootPath);
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
BrowserRefreshMiddleware.cs (1)
140!string.Equals(Path.GetFileName(request.Path.Value), "blazor.boot.json", StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Watch.BrowserRefresh.Tests (1)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.AspNetCore.WebSockets.ConformanceTests (9)
Autobahn\AutobahnTester.cs (3)
33var specFile = Path.GetTempFileName(); 64var outputFile = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", Spec.OutputDirectory, "index.json"); 133var configPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "Http.config");
Autobahn\Executable.cs (2)
22foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 24var candidate = Path.Combine(dir, name + _exeSuffix);
AutobahnTests.cs (2)
38Path.Combine(AppContext.BaseDirectory, "autobahnreports"); 86var iisExpressExe = Path.Combine(pf, "IIS Express", "iisexpress.exe");
Helpers.cs (2)
10return Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, projectName));
Microsoft.AspNetCore.WebUtilities (6)
AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
FileBufferingReadStream.cs (2)
243_tempFileName = Path.Combine(_tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid().ToString() + ".tmp"); 248var tempTempFileName = Path.GetTempFileName();
FileBufferingWriteStream.cs (3)
37/// uses the value returned by <see cref="Path.GetTempPath"/>. 270var tempFileName = Path.Combine(tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid() + ".tmp"); 275var tempTempFileName = Path.GetTempFileName();
Microsoft.AspNetCore.WebUtilities.Tests (3)
FileBufferingWriteStreamTests.cs (3)
12private readonly string TempDirectory = Path.Combine(Path.GetTempPath(), "FileBufferingWriteTests", Path.GetRandomFileName());
Microsoft.Build (325)
AssemblyLoadInfo.cs (1)
196ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
BackEnd\BuildManager\BuildManager.cs (1)
1362submission.BuildRequestData.ProjectFullPath = Path.Combine(
BackEnd\BuildManager\CacheSerialization.cs (1)
33Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1552using (StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, @"EngineTrace_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true))
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (1)
150(_projectRootDirectory = Path.GetDirectoryName(RequestConfiguration.ProjectFullPath));
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (5)
155nodeProcesses.AddRange(Process.GetProcessesByName(Path.GetFileNameWithoutExtension(msbuildtaskhostExeName))); 215msbuildLocation = Path.Combine(msbuildExeName, ".exe"); 321string taskHostNameForClr2TaskHost = Path.GetFileNameWithoutExtension(NodeProviderOutOfProcTaskHost.TaskHostNameForClr2TaskHost); 322if (Path.GetFileNameWithoutExtension(msbuildLocation).Equals(taskHostNameForClr2TaskHost, StringComparison.OrdinalIgnoreCase)) 405var expectedProcessName = Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost() ?? msbuildLocation);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (9)
429return isX64 ? Path.Combine(GetOrInitializeX64Clr2Path(toolName), toolName) : Path.Combine(GetOrInitializeX32Clr2Path(toolName), toolName); 434return Path.Combine(s_pathToX64Clr4 ??= s_baseTaskHostPath64, toolName); 439return Path.Combine(s_pathToArm64Clr4 ??= s_baseTaskHostPathArm64, toolName); 442return Path.Combine(s_pathToX32Clr4 ??= s_baseTaskHostPath, toolName); 518string lastDirectoryName = Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar)); 556string fullPath = Path.Combine(envPath, toolName); 639string.Format(commandLineArgsPlaceholder, Path.Combine(msbuildAssemblyPath, Constants.MSBuildAssemblyName), NodeReuseIsEnabled(hostContext), ComponentHost.BuildParameters.LowPriority),
BackEnd\Components\Communications\RarNodeLauncher.cs (1)
63return pipeNames.Contains(Path.Combine(NamedPipeRoot, _pipeName));
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
183string pluginPath = FileUtilities.NormalizePath(Path.Combine(item.Project.Directory, item.EvaluatedInclude));
BackEnd\Components\RequestBuilder\FullTracking.cs (1)
106tracking._tlogDirectory = Path.Combine(projectRootDirectory, tlogRelativeDirectoryValue);
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (2)
556projectDirectory[i] = Path.GetDirectoryName(projectPath); 693outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
348if (!Path.IsPathRooted(projectFiles[i])) 350projectFiles[i] = Path.Combine(_requestEntry.ProjectRootDirectory, projectFiles[i]);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (5)
987string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); 1012string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); 1047string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); 1202path1 = Path.Combine(_project.Directory, path1); 1205path2 = Path.Combine(_project.Directory, path2);
BackEnd\Components\Scheduler\Scheduler.cs (5)
2679using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerTrace_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true); 2707shouldWriteHeader = !FileSystems.Default.FileExists(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId)); 2710using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true); 2834using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true); 2874using StreamWriter file = FileUtilities.OpenWrite(string.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), EnvironmentUtilities.CurrentProcessId), append: true);
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
33string sdkPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath, sdk.Name, "Sdk");
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (5)
54Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, "SdkResolvers"), location); 81Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot, "SdkResolvers"), location); 117var manifest = Path.Combine(subfolder.FullName, $"{subfolder.Name}.xml"); 118var assembly = Path.Combine(subfolder.FullName, $"{subfolder.Name}.dll"); 236string resolverFileName = Path.GetFileNameWithoutExtension(resolverPath);
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (3)
83if (!System.IO.Path.IsPathRooted(manifest.Path)) 85manifest.Path = System.IO.Path.Combine(manifestFolder, manifest.Path); 86manifest.Path = System.IO.Path.GetFullPath(manifest.Path);
BackEnd\Shared\BuildRequestConfiguration.cs (3)
715Directory.CreateDirectory(Path.GetDirectoryName(cacheFile)); 823ErrorUtilities.VerifyThrow(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases"); 992string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, "Configuration{0}.cache", _configId));
BackEnd\Shared\TargetResult.cs (4)
263string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, Path.Combine("Results{0}", "{1}.cache"), configId, targetToCache)); 273string directoryName = Path.GetDirectoryName(filename); 297Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (1)
75checkContext.DispatchFailedAcquisitionTelemetry(System.IO.Path.GetFileName(checkAcquisitionData.AssemblyPath), ex);
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
84Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\EmbeddedResourceCheck.cs (3)
79Path.GetFileName(context.Data.ProjectFilePath), 108string extension = Path.GetExtension(Path.GetFileNameWithoutExtension(s));
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)
89return 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);
BuildEnvironmentHelper.cs (9)
201var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 202var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 335.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 358string directory = Path.GetDirectoryName(msBuildAssembly); 415var processFileName = Path.GetFileNameWithoutExtension(processName); 614MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 620MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 625? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 683defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommunicationsUtilities.cs (1)
1091string.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), EnvironmentUtilities.CurrentProcessId, nodeId), append: true))
Construction\ProjectRootElement.cs (2)
438_directory = Path.GetDirectoryName(newFullPath); 2109_directory = Path.GetDirectoryName(fullPath);
Construction\Solution\ProjectInSolution.cs (3)
189_absolutePath = Path.Combine(ParentSolution.SolutionFileDirectory, _relativePath); 198_absolutePath = Path.GetFullPath(_absolutePath); 244internal string Extension => Path.GetExtension(_relativePath);
Construction\Solution\SolutionFile.cs (7)
252SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 646SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 675return FileUtilities.GetFullPath(solution.GetProperty("path").GetString(), Path.GetDirectoryName(solutionFilterFile), escape: false); 920new BuildEventFileInfo(FileUtilities.GetFullPath(project, Path.GetDirectoryName(_solutionFile))), 1144string fullPathToEtpProj = Path.Combine(SolutionFileDirectory, etpProj.RelativePath); 1145string etpProjectRelativeDir = Path.GetDirectoryName(etpProj.RelativePath); 1198RelativePath = Path.Combine(etpProjectRelativeDir, fileElementValue)
Construction\Solution\SolutionProjectGenerator.cs (16)
1022string escapedSolutionFileName = EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath)); 1030string localFile = Path.Combine(escapedSolutionDirectory, $"before.{escapedSolutionFileName}.targets"); 1034localFile = Path.Combine(escapedSolutionDirectory, $"after.{escapedSolutionFileName}.targets"); 1299baseName = Path.Combine(_solutionFile.SolutionFileDirectory, MakeIntoSafeItemName(project.GetUniqueProjectName())); 1715(aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.AltDirectorySeparatorChar) || 1716(aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.DirectorySeparatorChar)) 1726lastFolderInPhysicalPath = Path.GetFileName(aspNetPhysicalPath); 1756string publishWebsitePath = EscapingUtilities.Escape(WebProjectOverrideFolder) + Path.DirectorySeparatorChar + EscapingUtilities.Escape(lastFolderInPhysicalPath) + Path.DirectorySeparatorChar; 2288if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 2290directoryName += Path.DirectorySeparatorChar; 2294globalProperties.AddProperty("SolutionExt", EscapingUtilities.Escape(Path.GetExtension(_solutionFile.FullPath))); 2295globalProperties.AddProperty("SolutionFileName", EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath))); 2296globalProperties.AddProperty("SolutionName", EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_solutionFile.FullPath))); 2298globalProperties.AddProperty(SolutionPathPropertyName, EscapingUtilities.Escape(Path.Combine(_solutionFile.SolutionFileDirectory, Path.GetFileName(_solutionFile.FullPath))));
DebugUtils.cs (6)
44debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 48debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 110var extension = Path.GetExtension(fileName); 111var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 113var fullPath = Path.Combine(DebugPath, fileName); 119fullPath = Path.Combine(DebugPath, fileName);
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)
42System.IO.Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "Roslyn"),
Definition\ToolsetReader.cs (8)
164var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar); 190var xbuildToolsetsDir = Path.Combine(libraryPath, $"xbuild{Path.DirectorySeparatorChar}"); 196var version = Path.GetFileName(d); 197var binPath = Path.Combine(d, "bin"); 620if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) 622path = Path.GetFullPath( 623Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
ElementLocation\XmlDocumentWithLocation.cs (3)
356if (Path.GetFileName(fullPath).StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase)) 359ErrorUtilities.VerifyThrow(Path.IsPathRooted(fullPath), "should be full path"); 360string directory = Path.GetDirectoryName(fullPath);
ErrorUtilities.cs (1)
178if (!Path.IsPathRooted(value))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (5)
85return lastCharacter == Path.DirectorySeparatorChar || lastCharacter == Path.AltDirectorySeparatorChar || lastCharacter == '\\'; 171if (state.EvaluationDirectory != null && !Path.IsPathRooted(item.ItemSpec)) 173list.Add(Path.GetFullPath(Path.Combine(state.EvaluationDirectory, item.ItemSpec)));
Evaluation\Evaluator.cs (9)
1186string projectFileWithoutExtension = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_projectRootElement.FullPath)); 1187string projectExtension = EscapingUtilities.Escape(Path.GetExtension(_projectRootElement.FullPath)); 1190string projectFullPath = Path.Combine(projectDirectory, projectFile); 1192int rootLength = Path.GetPathRoot(projectDirectory).Length; 1854ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(sdkResult.Path, project), 1867ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(additionalPath, project), 1904string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(sdkResult.Path, 5), Constants.DotnetProcessName); 2118if (directoryOfImportingFile != null && !Path.IsPathRooted(importFileUnescaped)) 2120importFileUnescaped = Path.Combine(directoryOfImportingFile, importFileUnescaped);
Evaluation\Expander\WellKnownFunctions.cs (22)
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)) 108returnVal = Path.GetFullPath(arg0); 112else if (string.Equals(methodName, nameof(Path.IsPathRooted), StringComparison.OrdinalIgnoreCase)) 116returnVal = Path.IsPathRooted(arg0); 120else if (string.Equals(methodName, nameof(Path.GetTempPath), StringComparison.OrdinalIgnoreCase)) 124returnVal = Path.GetTempPath(); 128else if (string.Equals(methodName, nameof(Path.GetFileName), StringComparison.OrdinalIgnoreCase)) 132returnVal = Path.GetFileName(arg0); 136else if (string.Equals(methodName, nameof(Path.GetDirectoryName), StringComparison.OrdinalIgnoreCase)) 140returnVal = Path.GetDirectoryName(arg0); 144else if (string.Equals(methodName, nameof(Path.GetFileNameWithoutExtension), StringComparison.OrdinalIgnoreCase)) 148returnVal = Path.GetFileNameWithoutExtension(arg0); 852else if (receiverType == typeof(Path))
Evaluation\IntrinsicFunctions.cs (2)
297return Path.Combine(NativeMethodsShared.FrameworkBasePath, m.Groups[0].Value) + Path.DirectorySeparatorChar;
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (1)
101evaluationLocation.File == null ? string.Empty : System.IO.Path.GetFileName(evaluationLocation.File),
ExceptionHandling.cs (1)
378s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (38)
77string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}"); 131internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 144cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 195string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 237fileSpec += Path.DirectorySeparatorChar; 277path.Substring(start) + Path.DirectorySeparatorChar); 370return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 400while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 492return NormalizePath(Path.Combine(directory, file)); 498return NormalizePath(Path.Combine(paths)); 517Path.HasExtension(uncheckedFullPath); 521return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 524return Path.GetFullPath(path); 566return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 704return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 716string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 728directory += Path.DirectorySeparatorChar; 775if (Path.HasExtension(fileName)) 797internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 812string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 826fullPath += Path.DirectorySeparatorChar; 890var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1200string fullBase = Path.GetFullPath(basePath); 1201string fullPath = Path.GetFullPath(path); 1210while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1241sb.Append("..").Append(Path.DirectorySeparatorChar); 1245sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1248if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1292return Path.IsPathRooted(FixFilePath(path)); 1338return paths.Aggregate(root, Path.Combine); 1366var separator = Path.DirectorySeparatorChar; 1510string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1524lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1544if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
FrameworkLocationHelper.cs (31)
443? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 453? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 463? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30) 473? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35) 483? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40) 493? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45) 503? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 513? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 590Path.DirectorySeparatorChar.ToString(), 594Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin"); 599s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar; 639s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools"); 814var frameworkPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, prefix ?? string.Empty); 824return Path.Combine(complusInstallRoot, complusVersion); 829string leaf = Path.GetFileName(currentRuntimePath); 837string baseLocation = Path.GetDirectoryName(currentRuntimePath); 957combinedPath = Path.GetFullPath(combinedPath); 965? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework") 966: Path.Combine(NativeMethodsShared.FrameworkBasePath, "xbuild-frameworks"); 968return Path.GetFullPath(combinedPath); 1016string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString()); 1019path = Path.Combine(path, "Profile", frameworkName.Profile); 1022return Path.GetFullPath(path); 1046var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 1048Path.AltDirectorySeparatorChar.ToString(), 1067fixedPath += Path.DirectorySeparatorChar; 1125string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 1423Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 1435(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && 1436!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) 1468frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
Globbing\MSBuildGlob.cs (3)
143var rootedInput = Path.Combine(_state.Value.GlobRoot, stringToMatch); 150normalizedInput += Path.DirectorySeparatorChar; 239var parentedFixedPart = Path.Combine(globRoot, fixedDirPart);
Graph\GraphBuilder.cs (7)
296if (!solutionDirectoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 298solutionDirectoryName += Path.DirectorySeparatorChar; 302solutionGlobalPropertiesBuilder["SolutionExt"] = EscapingUtilities.Escape(Path.GetExtension(Solution.FullPath)); 303solutionGlobalPropertiesBuilder["SolutionFileName"] = EscapingUtilities.Escape(Path.GetFileName(Solution.FullPath)); 304solutionGlobalPropertiesBuilder["SolutionName"] = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(Solution.FullPath)); 305solutionGlobalPropertiesBuilder[SolutionProjectGenerator.SolutionPathPropertyName] = EscapingUtilities.Escape(Path.Combine(Solution.SolutionFileDirectory, Path.GetFileName(Solution.FullPath)));
Graph\ProjectGraph.cs (1)
517var nodeName = Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
InprocTrackingNativeMethods.cs (1)
208string fileTrackerPath = Path.Combine(buildToolsPath, fileTrackerDllName.Value);
Instance\ProjectInstance.cs (3)
380_directory = Path.GetDirectoryName(projectPath); 433_directory = Path.GetDirectoryName(projectPath); 3091DirectoryPath = Path.GetDirectoryName(projectFile)
Instance\ProjectItemInstance.cs (1)
2427if (Path.DirectorySeparatorChar != '\\' && includeEscaped?.IndexOf('\\') > -1)
Instance\TaskRegistry.cs (8)
81private static readonly string s_potentialTasksV4Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV4Filename); 100private static readonly string s_potentialTasksV12Location = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksV12Filename); 119private static readonly string s_potentialTasksCoreLocation = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, s_tasksCoreFilename); 360if (assemblyFile != null && !Path.IsPathRooted(assemblyFile)) 362assemblyFile = Strings.WeakIntern(Path.Combine(directoryOfImportingFile, assemblyFile)); 377string replacedAssemblyFile = Path.Combine(Path.GetDirectoryName(assemblyFile), s_tasksCoreFilename); 1286!FileClassifier.IsMicrosoftAssembly(Path.GetFileName(_taskFactoryAssemblyLoadInfo.AssemblyFile)) &&
Logging\BinaryLogger\BinaryLogger.cs (3)
186logDirectory = Path.GetDirectoryName(FilePath); 417string fullPath = Path.GetFullPath(generatedFileUsedEventArgs.FilePath); 472FilePath = Path.GetFullPath(FilePath);
Logging\BinaryLogger\BuildEventArgsReader.cs (2)
401new ProjectImportsCollector(Path.GetRandomFileName(), false, runOnBackground: false); 1833filePath = Path.GetTempFileName();
Logging\BinaryLogger\ProjectImportsCollector.cs (4)
52=> Path.ChangeExtension(logFilePath, sourcesArchiveExtension); 73_archiveFilePath = Path.Combine( 76Path.GetFileName(logFilePath), 235filePath = Path.GetFullPath(filePath);
Logging\DistributedLoggers\DistributedFileLogger.cs (1)
105string extension = Path.GetExtension(_logFile);
Logging\FileLogger.cs (2)
104logDirectory = Path.GetDirectoryName(Path.GetFullPath(_logFileName));
Logging\LoggerDescription.cs (2)
59if (loggerAssemblyFile != null && !Path.IsPathRooted(loggerAssemblyFile)) 284AssemblyLoadInfo.Create(_loggerAssembly.AssemblyName, Path.GetFullPath(_loggerAssembly.AssemblyFile));
Logging\ProfilerLogger.cs (1)
292var content = System.IO.Path.GetExtension(FileToLog) == ".md"
Modifiers.cs (9)
214modifiedItemSpec = Path.GetPathRoot(fullPath); 223modifiedItemSpec += Path.DirectorySeparatorChar; 238modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 252modifiedItemSpec = Path.GetExtension(itemSpec); 367modifiedItemSpec = Path.Combine( 418if (!Path.IsPathRooted(path)) 451return Path.GetDirectoryName(path) == null; 464fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
Resources\Constants.cs (1)
386availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(Path)));
TaskFactoryUtilities.cs (3)
138string? directory = Path.GetDirectoryName(assemblyPath); 253path = Path.Combine(directory, assemblyName.CultureName, assemblyName.Name + ".dll"); 261path = Path.Combine(directory, assemblyName.Name + ".dll");
TempFileUtilities.cs (7)
69path = Path.Combine(Path.GetTempPath(), $"{msbuildTempFolderPrefix}{Guid.NewGuid():N}"); 84string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 185string file = Path.Combine(directory, $"{fileName}{extension}"); 209string destFile = Path.Combine(dest, fileInfo.Name); 214string destDir = Path.Combine(dest, subdirInfo.Name); 231: System.IO.Path.Combine(TempFileDirectory, name);
TypeLoader.cs (5)
54string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 55microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 194string[] localAssemblies = Directory.GetFiles(Path.GetDirectoryName(path), "*.dll"); 200assembliesDictionary.Add(Path.GetFileName(localPath), localPath); 205assembliesDictionary[Path.GetFileName(runtimeAssembly)] = runtimeAssembly;
Utilities\FileSpecMatchTester.cs (3)
68fileToMatch = FileUtilities.GetFullPathNoThrow(Path.Combine(_currentDirectory, fileToMatch)); 89string filename = Path.GetFileName(normalizedFileToMatch); 128var absoluteFixedDirPart = Path.Combine(currentDirectory, fixedDirPart);
Utilities\NuGetFrameworkWrapper.cs (2)
205Path.Combine(BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory, "Common7", "IDE", "CommonExtensions", "Microsoft", "NuGet") : 208string assemblyPath = Path.Combine(assemblyDirectory, NuGetFrameworksFileName);
WindowsFileSystem.cs (3)
130var searchDirectoryPath = Path.Combine(directoryPath, "*"); 167result.Add(Path.Combine(directoryPath, findResult.CFileName)); 175Path.Combine(directoryPath, findResult.CFileName),
Xml\ProjectXmlUtilities.cs (1)
100if (Path.GetExtension(element.Location.File).Equals(".dwproj", StringComparison.OrdinalIgnoreCase))
Microsoft.Build.BuildCheck.UnitTests (65)
ConfigurationProvider_Tests.cs (10)
33var configs = configurationProvider.GetConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 55var configs = configurationProvider.GetConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 89var customConfiguration = configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 115var buildConfig = configurationProvider.GetUserConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 146configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 151configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.Path, "test123.csproj"), "rule_id"); 178configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 183configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.Path, "test123.csproj"), "rule_id"); 209configurationProvider.GetCustomConfiguration(Path.Combine(workFolder1.Path, "test.csproj"), "rule_id"); 214configurationProvider.CheckCustomConfigurationDataValidity(Path.Combine(workFolder1.Path, "test123.csproj"), "rule_id");
DoubleWritesAnalyzer_Tests.cs (1)
49{ "DestinationFiles", new TaskInvocationCheckData.TaskParameter(Path.Combine("outdir", "source1"), IsOutput: false) },
EditorConfigParser_Tests.cs (4)
66TransientTestFolder workFolder2 = testEnvironment.CreateFolder(Path.Combine(workFolder1.Path, "subfolder"), createFolder: true); 84var listOfEditorConfigFile = parser.DiscoverEditorConfigFiles(Path.Combine(workFolder1.Path, "subfolder", "projectfile.proj")).ToList(); 98TransientTestFolder workFolder2 = testEnvironment.CreateFolder(Path.Combine(workFolder1.Path, "subfolder"), createFolder: true); 113var listOfEditorConfigFile = parser.DiscoverEditorConfigFiles(Path.Combine(workFolder1.Path, "subfolder", "projectfile.proj")).ToList();
EndToEndTests.cs (45)
38private static string AssemblyLocation { get; } = Path.Combine(Path.GetDirectoryName(typeof(EndToEndTests).Assembly.Location) ?? AppContext.BaseDirectory); 40private static string TestAssetsRootPath { get; } = Path.Combine(AssemblyLocation, "TestAssets"); 165CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.Path); 166ReplaceStringInFile(Path.Combine(workFolder.Path, referencedProjectName, $"{referencedProjectName}.csproj"), 169Path.Combine(workFolder.Path, referencedProjectName, "Resource1.resx"), 170Path.Combine(workFolder.Path, referencedProjectName, $"Resource1.{resourceExtension}.resx")); 172_env.SetCurrentDirectory(Path.Combine(workFolder.Path, entryProjectName)); 179string[] depsFiles = Directory.GetFiles(Path.Combine(workFolder.Path, entryProjectName), $"{entryProjectName}.deps.json", SearchOption.AllDirectories); 275CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.Path); 277_env.SetCurrentDirectory(Path.Combine(workFolder.Path, entryProjectName)); 380CopyFilesRecursively(Path.Combine(TestAssetsRootPath, testAssetsFolderName), workFolder.Path); 381ReplaceStringInFile(Path.Combine(workFolder.Path, $"{projectName}.csproj"), 548$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore" + 583var projectDirectory = Path.GetDirectoryName(projectFile.Path); 587$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore {(checkRequested ? "-check" : string.Empty)} -bl:{logFile}", 596$"{logFile} -flp:logfile={Path.Combine(projectDirectory!, "logFile.log")};verbosity=diagnostic", 638$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check", 662string checkCandidatePath = Path.Combine(TestAssetsRootPath, "CheckCandidate"); 668string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName); 678$"{Path.Combine(checkCandidatePath, $"CheckCandidate.csproj")} /m:1 -nr:False -restore -check -verbosity:n", out bool success, timeoutMilliseconds: 1200_0000); 697string? projectDirectory = Path.GetDirectoryName(projectFile.Path); 701$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -bl:{logFile}", 707$"{logFile} -flp:logfile={Path.Combine(projectDirectory!, "logFile.log")};verbosity=diagnostic {(checkRequested ? "-check" : string.Empty)}", 752$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds); 788$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds); 812$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -restore -check" + 842var checkCandidatePath = Path.Combine(TestAssetsRootPath, checkCandidate); 846$"{Path.Combine(checkCandidatePath, $"{checkCandidate}.csproj")} /m:1 -nr:False -restore -check -verbosity:n", 875string checkCandidatePath = Path.Combine(TestAssetsRootPath, checkCandidate); 879string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName); 886$"{Path.Combine(checkCandidatePath, $"{checkCandidate}.csproj")} /m:1 -nr:False -restore -check -verbosity:n", out bool _, timeoutMilliseconds: timeoutInMilliseconds); 904string checkCandidatePath = Path.Combine(TestAssetsRootPath, checkCandidate); 908string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName); 915$"{Path.Combine(checkCandidatePath, $"{checkCandidate}.csproj")} /m:1 -nr:False -restore -check -verbosity:n", out bool success, timeoutMilliseconds: timeoutInMilliseconds); 935$"{Path.GetFileName(projectFile.Path)} /m:1 -nr:False -t:restore -check", 950var nugetTemplatePath = Path.Combine(TestAssetsRootPath, "CheckCandidate", nugetTemplateName); 951File.Copy(nugetTemplatePath, Path.Combine(workFolder.Path, nugetTemplateName)); 960var buildCheckTemplatePath = Path.Combine(BuildCheckUnitTestsConstants.RepoRoot, "template_feed", "content", "Microsoft.CheckTemplate"); 975var nugetTemplatePath = Path.Combine(checkCandidatePath, "nugetTemplate.config"); 984string checksPackagesPath = Path.Combine(Directory.GetParent(AssemblyLocation)?.Parent?.FullName ?? string.Empty, "CustomChecks"); 997doc.Save(Path.Combine(checkCandidatePath, "nuget.config")); 1066_env.SetCurrentDirectory(Path.GetDirectoryName(projectFile.Path)); 1076File.ReadAllText(Path.Combine(TestAssetsRootPath, testAssetsFolderName, fileName)) 1100string configContent = File.ReadAllText(Path.Combine(TestAssetsRootPath, testAssetsFolderName, $"{EditorConfigFileName}test"));
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
Microsoft.Build.CommandLine.UnitTests (68)
MSBuildServer_Tests.cs (6)
24using Path = System.IO.Path; 111string? dir = Path.GetDirectoryName(markerFile.Path); 120watcher.Filter = Path.GetFileName(markerFile.Path); 192string? dir = Path.GetDirectoryName(markerFile.Path); 200watcher.Filter = Path.GetFileName(markerFile.Path); 338_env.SetCurrentDirectory(Path.GetDirectoryName(project.Path));
PerfLog_Tests.cs (3)
42string projectPath = Path.Combine(projectFolder.Path, "ClassLibrary.csproj"); 65string perfLogPath = Path.Combine(perfLogFolder.Path, "logs"); 78string projectPath = Path.Combine(projectFolder.Path, "ClassLibrary.csproj");
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
XMake_Tests.cs (54)
91private static string TestAssetsRootPath { get; } = Path.Combine(Path.Combine(Path.GetDirectoryName(typeof(XMakeAppTests).Assembly.Location) ?? AppContext.BaseDirectory), "TestAssets"); 1133string tempdir = Path.GetTempPath(); 1134string projectFileName = Path.Combine(tempdir, "msbEnvironmenttest.proj"); 1167string tempdir = Path.GetTempPath(); 1168string projectFileName = Path.Combine(tempdir, "msbLoggertest.proj"); 1169string logFile = Path.Combine(tempdir, "logFile"); 1203? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe") 1255Directory.SetCurrentDirectory(Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe)); 1278string projectPath = Path.Combine(directory, "my.proj"); 1279string rspPath = Path.Combine(directory, AutoResponseFileName); 1385directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 1387string projectPath = Path.Combine(directory, "my.proj"); 1388string rspPath = Path.Combine(directory, AutoResponseFileName); 1391string exePath = Path.Combine(exeDirectory, MSBuildExeName); 1392string mainRspPath = Path.Combine(exeDirectory, AutoResponseFileName); 1429string projectPath = Path.Combine(directory, "my.proj"); 1430string rspPath = Path.Combine(directory, AutoResponseFileName); 1431string exePath = Path.Combine(directory, MSBuildExeName); 1544output.ShouldContain($"[A={directory.Path}{Path.DirectorySeparatorChar}]"); 1988if (Path.GetExtension(file).Contains("proj")) 2004string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName; 2027string projectDirectory = Directory.CreateDirectory(Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N"))).FullName; 2145distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2158distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"{fileLoggerParameters[0]};logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2171distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"{fileLoggerParameters[0]};logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2184distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($";Parameter1;logFile={Path.Combine(Directory.GetCurrentDirectory(), "MSBuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2201fileLoggerParameters = new[] { "Parameter1", "verbosity=Normal;logfile=" + Path.Combine("..", "cat.log") + ";Parameter1" }; 2208distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"Parameter1;verbosity=Normal;logFile={Path.Combine(Directory.GetCurrentDirectory(), "..", "cat.log")};Parameter1", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2217distributedLoggerRecords[0].ForwardingLoggerDescription.LoggerSwitchParameters.ShouldBe($"Parameter1;Parameter;;;Parameter;Parameter;logFile={Path.Combine(Directory.GetCurrentDirectory(), "msbuild.log")}", StringCompareShould.IgnoreCase); // "Expected parameter in logger to match parameter passed in" 2537var dllFilePath = Path.Combine(tempDir.Path, expectedLoggerName); 2562$"\"{Path.Combine(tempLoggerProjDir, "CustomLogger.csproj")}\" -restore -verbosity:n", out bool success); 2564var loggerDllPath = Path.Combine(tempLoggerProjDir, "artifacts", "bin", "netstandard2.0", expectedLoggerName); 2589$"{Path.Combine(tempLoggerProjDir, $"FaultyLogger.csproj")} -restore -verbosity:n", out bool success); 2591var loggerDllPath = Path.Combine(tempLoggerProjDir, "artifacts", "bin", "netstandard2.0", expectedLoggerName); 2817string binlogPath = Path.Combine(testProject.TestRoot, match.Groups[1] + ".binlog"); 2844string binlogPath = Path.Combine(testProject.TestRoot, match.Groups[1] + ".binlog"); 2876var preprocessFile = Path.Combine(testProject.TestRoot, "Preprocess.xml"); 2930string source = Path.GetDirectoryName(RunnerUtilities.PathToCurrentlyRunningMsBuildExe); 2931dest = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 2943if (Path.GetFileName(d).Equals("TestTemp", StringComparison.InvariantCultureIgnoreCase)) 2952File.Copy(file, Path.Combine(dest, Path.GetFileName(file))); 2957string dirName = Path.GetFileName(directory); 2958string destSubDir = Path.Combine(dest, dirName); 2997File.WriteAllText(Path.Combine(testProject.TestRoot, item.Key), item.Value); 3016var testAssetsPath = Path.Combine(TestAssetsRootPath, folderName); 3017var loggerProjDir = Path.Combine(testAssetsPath, "LoggerProject"); 3021var tempLoggerProjDir = Path.Combine(tempDir.Path, "LoggerProject"); 3027var destPath = Path.Combine(tempLoggerProjDir, relativePath); 3028Directory.CreateDirectory(Path.GetDirectoryName(destPath));
Microsoft.Build.Engine.OM.UnitTests (216)
BuildEnvironmentHelper.cs (9)
201var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 202var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 335.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 358string directory = Path.GetDirectoryName(msBuildAssembly); 415var processFileName = Path.GetFileNameWithoutExtension(processName); 614MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 618MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 625? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 683defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
Construction\ConstructionEditing_Tests.cs (4)
3211var testSdkDirectory = Path.Combine(testSdkRoot, "MSBuildUnitTestSdk", "Sdk"); 3214string sdkPropsPath = Path.Combine(testSdkDirectory, "Sdk.props"); 3215string sdkTargetsPath = Path.Combine(testSdkDirectory, "Sdk.targets"); 3235var updated = Path.Combine(testProject.TestRoot, "updated.proj");
Construction\ProjectFormatting_Tests.cs (7)
409directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 412string file = Path.Combine(directory, "test.proj"); 464directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 467string file = Path.Combine(directory, "test.proj"); 712FileUtilities.DeleteDirectoryNoThrow(Path.GetDirectoryName(file), false);
Construction\ProjectImportElement_Tests.cs (4)
240string tempPath = Path.GetTempPath(); 241string testTempPath = Path.Combine(tempPath, "UnitTestsPublicOm"); 242string projectfile = Path.Combine(testTempPath, "a.proj"); 243string targetsFile = Path.Combine(tempPath, "x.targets");
Construction\ProjectRootElement_Tests.cs (16)
159Assert.Equal(project.FullPath, Path.Combine(Directory.GetCurrentDirectory(), "X")); 188projectXml1.FullPath = Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc"); 206ProjectRootElement projectXml2 = ProjectRootElement.Open(Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc")); 225ProjectRootElement projectXml2 = ProjectRootElement.Open(Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc")); 242projectXml1.FullPath = Path.Combine(Directory.GetCurrentDirectory(), @"xyz\abc"); 535string path = Path.Combine(toolsPath, target); 634directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 636string path = Path.Combine(directory, file); 662Directory.SetCurrentDirectory(Path.GetTempPath()); // should be used for project.DirectoryPath; it must exist 666string file = "bar" + Path.DirectorySeparatorChar + "foo.proj"; 667string path = Path.Combine(curDir, file); 668directory = Path.Combine(curDir, "bar"); 1672var fullPath = Path.GetFullPath("foo"); 1775projectFileAssert.Invoke(Path.GetDirectoryName(initialLocation), Path.GetDirectoryName(reloadLocation), rootElement.DirectoryPath);
DebugUtils.cs (6)
44debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 48debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 110var extension = Path.GetExtension(fileName); 111var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 113var fullPath = Path.Combine(DebugPath, fileName); 119fullPath = Path.Combine(DebugPath, fileName);
Definition\DefinitionEditing_Tests.cs (17)
285string wildcard = Path.Combine(Path.GetDirectoryName(paths[0]), "*.xxx;"); 667string directory = Path.GetDirectoryName(paths[0]); 668string wildcard = Path.Combine(directory, "*.xxx;"); 788string directory = Path.GetDirectoryName(paths[0]); 789string wildcard = Path.Combine(directory, "*.xxx;"); 1093string directory = Path.GetDirectoryName(paths[0]); 1094string wildcard = Path.Combine(directory, "*.xxx;"); 1111ProjectCollection.Escape(Path.Combine(directory, "i2.xxx"))); 1133string directory = Path.GetDirectoryName(paths[0]); 1134string wildcard = Path.Combine(directory, "*.xxx;"); 1143item.Rename(Path.Combine(directory, "i2.xxx")); 1388string directory = Path.GetDirectoryName(paths[0]); 1389string wildcard = Path.Combine(directory, "*.xxx;"); 1408ProjectCollection.Escape(Path.Combine(directory, "i2.xxx"))); 2209string wildcard = Path.Combine(Path.GetDirectoryName(paths[0]), "*.xxx;");
Definition\Project_Tests.cs (42)
206string file = Path.GetTempPath() + Path.DirectorySeparatorChar + Guid.NewGuid().ToString("N"); 654Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386", "foo.dll")); 685project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll")); 686projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj\i386\foo.dll")); 690project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll")); 691projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), @"obj/i386/foo.dll")); 721project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 722projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 757project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 758projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory, "obj", "i386").Substring(RootPrefixLength) + Path.DirectorySeparatorChar); 777<IntermediateAssembly Include='obj" + Path.DirectorySeparatorChar + "i386" 778+ Path.DirectorySeparatorChar 796project.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386")); 797projectInstance.GetItems("BuiltProjectOutputGroupKeyOutput").First().EvaluatedInclude.ShouldBe(Path.Combine(FileUtilities.TempFileDirectory /* remove c:\ */, "obj", "i386")); 1730testFileRoot = Path.Combine(Path.GetTempPath(), "foodir"); 1736string filePath = Path.Combine(testFileRoot, fileName); 1742projectConstruction.AddItem("foo", Path.Combine(testFileRoot, "*.foo")); 2490directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 2491string subdirectory = Path.Combine(directory, "sub"); 2494string projectPath = Path.Combine(subdirectory, "a.proj"); 2495string targetsPath = Path.Combine(directory, "b.targets"); 2497string unevaluatedInclude = ".." + Path.DirectorySeparatorChar + "*"; 2498string evaluatedInclude = ".." + Path.DirectorySeparatorChar + "b.targets"; 2596string myTempDir = Path.Combine(Path.GetTempPath() + "MyTempDir"); 2603ProjectRootElement one = ProjectRootElement.Create(Path.Combine(myTempDir, "1.targets")); 2607ProjectRootElement two = ProjectRootElement.Create(Path.Combine(myTempDir, "2.targets")); 2611ProjectRootElement zero = ProjectRootElement.Create(Path.Combine(myTempDir, "0.targets")); 2615zero.AddImport(Path.Combine(myTempDir, "*.targets")); 3294var absoluteFile = Path.Combine(Path.GetDirectoryName(testFiles.ProjectFile), "1.foo"); 3772var absoluteFile = Path.Combine(Path.GetDirectoryName(testFiles.ProjectFile), "a.cs"); 4111string importPath = Path.Combine(pre.DirectoryPath, Guid.NewGuid().ToString()); 4154string importGlob = Path.Combine(pre.DirectoryPath, @"__NoMatch__\**");
Definition\ProjectCollection_Tests.cs (2)
1239collection.AddToolset(new Toolset("testTools", Path.GetTempPath(), collection, Path.GetTempPath()));
Definition\ProjectItem_Tests.cs (22)
350directory = Path.Combine(Path.GetTempPath(), "a"); 356subdirectory = Path.Combine(directory, "b"); 362file = Path.Combine(subdirectory, "c"); 397directory = Path.Combine(Path.GetTempPath(), "a"); 403subdirectory = Path.Combine(directory, "b"); 409file = Path.Combine(subdirectory, "c"); 761expectedInclude = expectedInclude.Select(p => setSlashes(p, Path.DirectorySeparatorChar)).ToArray(); 1091? Path.GetFullPath(Path.Combine(testRoot, relativeFragmentFromRootToFile, file)) 1092: Path.Combine(relativeFragmentFromRootToFile, file); 1102var projectFileDir = Path.GetDirectoryName(projectFile); 1985string projectDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 1989string sourceFile = Path.Combine(projectDirectory, "a.cs"); 1990string renamedSourceFile = Path.Combine(projectDirectory, "b.cs"); 1994project.FullPath = Path.Combine(projectDirectory, "test.proj"); // assign a path so the wildcards can lock onto something. 1998Assert.Equal(Path.GetFileName(sourceFile), projectItem.EvaluatedInclude); 2000projectItem.Rename(Path.GetFileName(renamedSourceFile)); 2004Assert.Equal(Path.GetFileName(renamedSourceFile), projectItem.EvaluatedInclude);
ErrorUtilities.cs (1)
178if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
378s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (36)
77string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}"); 131internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 144cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 195string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 237fileSpec += Path.DirectorySeparatorChar; 275string.Concat(path.AsSpan(start), new(in Path.DirectorySeparatorChar))); 370return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 400while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 492return NormalizePath(Path.Combine(directory, file)); 498return NormalizePath(Path.Combine(paths)); 524return Path.GetFullPath(path); 566return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 704return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 716string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 728directory += Path.DirectorySeparatorChar; 775if (Path.HasExtension(fileName)) 797internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 812string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 826fullPath += Path.DirectorySeparatorChar; 890var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1200string fullBase = Path.GetFullPath(basePath); 1201string fullPath = Path.GetFullPath(path); 1210while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1241sb.Append("..").Append(Path.DirectorySeparatorChar); 1245sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1248if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1292return Path.IsPathRooted(FixFilePath(path)); 1338return paths.Aggregate(root, Path.Combine); 1366var separator = Path.DirectorySeparatorChar; 1510string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1524lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1544if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Instance\ProjectInstance_Tests.cs (22)
285directory = Path.Combine(Path.GetTempPath(), "WildcardsInsideTargets"); 287file1 = Path.Combine(directory, "a.exe"); 288file2 = Path.Combine(directory, "b.exe"); 289file3 = Path.Combine(directory, "c.bat"); 294string path = Path.Combine(directory, "*.exe"); 420projA.FullPath = Path.Combine(Path.GetTempPath(), "a.proj"); 421projB.FullPath = Path.Combine(Path.GetTempPath(), "b.proj"); 456projA.FullPath = Path.Combine(Path.GetTempPath(), "a.proj"); 457projB.FullPath = Path.Combine(Path.GetTempPath(), "b.proj"); 499string tempDir = Path.GetTempFileName(); 502File.Create(Path.Combine(tempDir, "aItem.cs")).Dispose(); 504projA.FullPath = Path.Combine(tempDir, "a.proj"); 505projB.FullPath = Path.Combine(tempDir, "b.proj"); 530string projectA = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 531string projectB = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj"); 533string includeFileA = Path.Combine(ObjectModelHelpers.TempProjectDir, "aaa4.cs"); 534string includeFileB = Path.Combine(ObjectModelHelpers.TempProjectDir, "bbb4.cs");
NugetRestoreTests.cs (3)
37string currentAssemblyDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 38string bootstrapMsBuildBinaryDir = Path.Combine(RunnerUtilities.BootstrapMsBuildBinaryLocation, msbuildSubFolder); 62RunnerUtilities.RunProcessAndGetOutput(Path.Combine(currentAssemblyDir, "nuget", "NuGet.exe"), "restore " + sln.Path + " -MSBuildPath \"" + bootstrapMsBuildBinaryDir + "\"", out bool success, outputHelper: _output);
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
TempFileUtilities.cs (5)
84string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 185string file = Path.Combine(directory, $"{fileName}{extension}"); 209string destFile = Path.Combine(dest, fileInfo.Name); 214string destDir = Path.Combine(dest, subdirInfo.Name); 231: System.IO.Path.Combine(TempFileDirectory, name);
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
TransientIO.cs (7)
33private static bool IsDirSlash(char c) => c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 53path = Path.GetFullPath(path); 65var parent = Path.GetDirectoryName(absolute); 82var absolute = Path.GetFullPath(Path.IsPathRooted(relative) ? relative : Path.Combine(tempRoot, relative));
WindowsFileSystem.cs (3)
130var searchDirectoryPath = Path.Combine(directoryPath, "*"); 167result.Add(Path.Combine(directoryPath, findResult.CFileName)); 175Path.Combine(directoryPath, findResult.CFileName),
Microsoft.Build.Engine.UnitTests (871)
BackEnd\BinaryTranslator_Tests.cs (2)
551Assert.Equal(Path.Combine(directory, fileName), deserializedFullPath); 584Assert.Equal(fullPath, Path.Combine(deserializedDirectory, deserializedFileName));
BackEnd\BuildManager_Tests.cs (6)
350string shutdownProjectDirectory = Path.Combine(Path.GetTempPath(), String.Format(CultureInfo.InvariantCulture, "VSNodeShutdown_{0}_UnitTest", Process.GetCurrentProcess().Id)); 3503string fileName = Path.GetTempFileName(); 3527var resultsFiles = Directory.EnumerateFiles(directory).Select(Path.GetFileName); 3639string rootProjectPath = Path.Combine(shutdownProjectDirectory, String.Format(CultureInfo.InvariantCulture, "RootProj_{0}.proj", Guid.NewGuid().ToString("N"))); 3851root.FullPath = Path.GetTempFileName();
BackEnd\BuildRequestConfiguration_Tests.cs (3)
159Assert.Equal(config1.ProjectFullPath, Path.GetFullPath("file")); 474string problematicTmpPath = Path.Combine(originalTmp, "}", "blabla", "temp"); 500configWithoutEvaluation.ShouldSkipIsolationConstraintsForReference(Path.GetFullPath("foo"));
BackEnd\BuildRequestEngine_Tests.cs (3)
442BuildRequestData data = new BuildRequestData(Path.GetFullPath("TestFile"), new Dictionary<string, string>(), "TestToolsVersion", Array.Empty<string>(), null); 448BuildRequestData data2 = new BuildRequestData(Path.GetFullPath("OtherFile"), new Dictionary<string, string>(), "TestToolsVersion", Array.Empty<string>(), null); 466Assert.Equal(Path.GetFullPath("OtherFile"), _newConfiguration_Config.ProjectFullPath);
BackEnd\CustomTaskHelper.cs (3)
29string[] referenceAssemblies = new string[] { "System.dll", Path.Combine(referenceAssembliesPath, "Microsoft.Build.Framework.dll"), Path.Combine(referenceAssembliesPath, "Microsoft.Build.Utilities.Core.dll"), Path.Combine(referenceAssembliesPath, "Microsoft.Build.Tasks.Core.dll") };
BackEnd\IntrinsicTask_Tests.cs (7)
2535<i1 Remove='" + projectDirectory.Path + Path.DirectorySeparatorChar + @"*.tmp'/> 3332string tempPath = Path.GetTempPath(); 3333string directoryForTest = Path.Combine(tempPath, "IncludeCheckOnMetadata_3\\Test"); 3334string fileForTest = Path.Combine(directoryForTest, "a.dll"); 3354<Content Include='" + Path.Combine(directoryForTest, "..", "**") + @"' Condition=""'%(Content.Extension)' == '.dll'""/> 3364"[" + Path.Combine(directoryForTest, "..", "Test", "a.dll") + @"]->[.dll]->[Test" 3365+ Path.DirectorySeparatorChar + "]");
BackEnd\LoggingServicesLogMethod_Tests.cs (8)
442string tempPath = Path.GetTempPath(); 443string testTempPath = Path.Combine(tempPath, "VerifyErrorPostfixForInvalidProjectFileException"); 444string projectFile = Path.Combine(testTempPath, "a.proj"); 445string targetsFile = Path.Combine(testTempPath, "x.targets"); 829message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectStartedPrefixForTopLevelProjectWithTargetNames", Path.GetFileName(projectFile), targetNames); 833message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", Path.GetFileName(projectFile)); 1401string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(success ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(projectFile)); 1491string message = ResourceUtilities.FormatResourceStringStripCodeAndKeyword(succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
BackEnd\MSBuild_Tests.cs (5)
45Directory.SetCurrentDirectory(Path.GetTempPath()); 60string fileName = Path.GetFileName(tempProject); 68int rootLength = Path.GetPathRoot(tempProject).Length; 757logger.AssertLogContains($"iout6=[a{Path.DirectorySeparatorChar}b.foo]"); 763logger.AssertLogContains($"iin6=[a{Path.DirectorySeparatorChar}b.foo]");
BackEnd\RequestBuilder_Tests.cs (1)
288return Path.GetTempPath() + "testProject" + configId + ".proj";
BackEnd\SdkResolverLoader_Tests.cs (26)
62var d1 = Directory.CreateDirectory(Path.Combine(root, "Resolver1")); 65var f1 = Path.Combine(d1.FullName, "Resolver1.dll"); 68var f2 = Path.Combine(d1.FullName, "Dependency.dll"); 69var f3 = Path.Combine(d1.FullName, "InvalidName.dll"); 70var f4 = Path.Combine(d1.FullName, "NoResolver.txt"); 95var testFolder = Directory.CreateDirectory(Path.Combine(root, "MyTestResolver")); 97var wrongResolverDll = Path.Combine(testFolder.FullName, "MyTestResolver.dll"); 98var resolverManifest = Path.Combine(testFolder.FullName, "MyTestResolver.xml"); 99var assemblyToLoad = Path.Combine(root, "SomeOtherResolver.dll"); 221var resolverPath = Path.Combine(root, "MyTestResolver"); 222var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 246var resolverPath = Path.Combine(root, "MyTestResolver"); 247var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 273var resolverPath = Path.Combine(root, "MyTestResolver"); 274var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 297var resolverPath = Path.Combine(root, "MyTestResolver"); 313var resolverPath = Path.Combine(root, "MyTestResolver"); 314var resolverManifest = Path.Combine(resolverPath, "MyTestResolver.xml"); 371var resolver1Path = Path.Combine(additionalRoot, resolver1, $"{resolver1}.dll"); 372Directory.CreateDirectory(Path.Combine(testRoot, resolver1)); 373File.WriteAllText(Path.Combine(testRoot, resolver1, $"{resolver1}.dll"), string.Empty); 374Directory.CreateDirectory(Path.Combine(additionalRoot, resolver1)); 377var resolver2Path = Path.Combine(testRoot, resolver2, $"{resolver2}.dll"); 378Directory.CreateDirectory(Path.Combine(testRoot, resolver2)); 381var resolver3Path = Path.Combine(additionalRoot, resolver3, $"{resolver3}.dll"); 382Directory.CreateDirectory(Path.Combine(additionalRoot, resolver3));
BackEnd\SdkResultOutOfProc_Tests.cs (10)
107string projectPath = Path.Combine(projectFolder, "TestProject.proj"); 142string entryProjectPath = Path.Combine(projectFolder, "EntryProject.proj"); 152string projectWithSdkImportPath = Path.Combine(projectFolder, "ProjectWithSdkImport.proj"); 200var sdkResolver = SetupSdkResolver(Path.GetDirectoryName(projectPath)); 216Directory.CreateDirectory(Path.Combine(projectFolder, "Sdk1")); 217Directory.CreateDirectory(Path.Combine(projectFolder, "Sdk2")); 233File.WriteAllText(Path.Combine(projectFolder, "Sdk1", "Sdk.props"), CleanupFileContents(sdk1propsContents)); 234File.WriteAllText(Path.Combine(projectFolder, "Sdk2", "Sdk.props"), CleanupFileContents(sdk2propsContents)); 241Path.Combine(projectFolder, "Sdk1"), 242Path.Combine(projectFolder, "Sdk2")
BackEnd\TargetUpToDateChecker_Tests.cs (1)
599string projectFile = Path.Combine(ObjectModelHelpers.TempProjectDir, "temp.proj");
BackEnd\TaskBuilder_Tests.cs (8)
429<CreateItem Include='{Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)}\**\*.dll'> 443string slashAndBracket = Path.DirectorySeparatorChar.ToString() + "]"; 642string fileName = Path.GetFileName(realTaskPath); 643string directoryName = Path.GetDirectoryName(realTaskPath); 647string customTaskFolder = Path.Combine(directoryName, "buildCrossTargeting"); 651<UsingTask TaskName=`RegisterObject` AssemblyFile=`" + Path.Combine(customTaskFolder, "..", fileName) + @"` /> 956string projectAPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "a.proj"); 957string projectBPath = Path.Combine(ObjectModelHelpers.TempProjectDir, "b.proj");
BackEnd\TaskRegistry_Tests.cs (4)
166Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(assemblyName, assemblyFile == null ? null : Path.GetFullPath(assemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 271Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(assemblyName, assemblyFile == null ? null : Path.GetFullPath(assemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 1150Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(expandedAssemblyName, expandedAssemblyFile == null ? null : Path.GetFullPath(expandedAssemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!" 1203Assert.Equal(taskAssemblyLoadInfo, AssemblyLoadInfo.Create(expandedAssemblyName, Path.GetFullPath(expandedAssemblyFile))); // "Task record was not properly registered by TaskRegistry.RegisterTask!"
BackEnd\TaskRouter_IntegrationTests.cs (7)
60string projectFile = Path.Combine(_testProjectsDir, "NonEnlightenedTaskProject.proj"); 105string projectFile = Path.Combine(_testProjectsDir, "InterfaceTaskProject.proj"); 150string projectFile = Path.Combine(_testProjectsDir, "AttributeTaskProject.proj"); 195string projectFile = Path.Combine(_testProjectsDir, "NonEnlightenedTaskSingleThreaded.proj"); 239string projectFile = Path.Combine(_testProjectsDir, "InterfaceTaskSingleThreaded.proj"); 293string projectFile = Path.Combine(_testProjectsDir, "MixedTasksProject.proj"); 351string projectFile = Path.Combine(_testProjectsDir, "ExplicitTaskHostFactory.proj");
BinaryLogger_Tests.cs (15)
345RunnerUtilities.ExecMSBuild($"{_logFile} -flp:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic", out success); 348string text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile.log")); 402RunnerUtilities.ExecMSBuild($"{projectFile.Path} -nr:False -bl:{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile2.log")};verbosity=normal", out bool success); 407string text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile.log")); 411string text2 = File.ReadAllText(Path.Combine(logFolder.Path, "logFile2.log")); 414RunnerUtilities.ExecMSBuild($"{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile3.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile4.log")};verbosity=normal", out success); 416text = File.ReadAllText(Path.Combine(logFolder.Path, "logFile3.log")); 420text2 = File.ReadAllText(Path.Combine(logFolder.Path, "logFile4.log")); 445var projectImportsZipPath = Path.ChangeExtension(_logFile, ".ProjectImports.zip"); 465string symlinkPath = Path.Combine(testFolder2.Path, symlinkName); 466string symlinkLvl2Path = Path.Combine(testFolder2.Path, symlinkLvl2Name); 505var projectImportsZipPath = Path.ChangeExtension(_logFile, ".ProjectImports.zip"); 652string expectedLog = Path.GetFullPath(expectedBinlogFile);
BuildEnvironmentHelper_Tests.cs (32)
26var msbuildPath = Path.GetDirectoryName(FileUtilities.ExecutingAssemblyPath); 27string expectedMSBuildPath = Path.Combine(msbuildPath, MSBuildExeName).ToLowerInvariant(); 35Path.GetDirectoryName(expectedMSBuildPath).ShouldBe(toolsDirectoryPath); 45var msBuildPath = Path.Combine(path, MSBuildExeName); 46var msBuildConfig = Path.Combine(path, $"{MSBuildExeName}.config"); 72var msBuildPath = Path.Combine(msbuildBinDirectory, MSBuildExeName); 73var msBuildConfig = Path.Combine(msbuildBinDirectory, $"{MSBuildExeName}.config"); 74var vsMSBuildDirectory = Path.Combine(env.TempFolderRoot, "MSBuild"); 183Path.GetFileName(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath).ShouldBe(MSBuildExeName); 359var msBuild64Exe = Path.Combine(env.BuildDirectory, "amd64", MSBuildExeName); 364BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64")); 380BuildEnvironmentHelper.Instance.MSBuildToolsDirectory64.ShouldBe(Path.Combine(env.BuildDirectory, "amd64")); 405var entryProcess = Path.Combine(Path.GetTempPath(), "foo.exe"); 410BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.ShouldBe(Path.GetDirectoryName(entryProcess)); 421var msBuildAssembly = Path.Combine(env.BuildDirectory, "Microsoft.Build.dll"); 438var msBuildAssembly = Path.Combine(env.BuildDirectory64, "Microsoft.Build.dll"); 463public string MSBuildExePath64 => Path.Combine(BuildDirectory64, MSBuildExeName); 470BuildDirectory = Path.Combine(TempFolderRoot, "MSBuild", toolsVersion, "Bin"); 471BuildDirectory64 = Path.Combine(BuildDirectory, "amd64"); 472DevEnvPath = Path.Combine(TempFolderRoot, "Common7", "IDE", "devenv.exe"); 473BlendPath = Path.Combine(TempFolderRoot, "Common7", "IDE", "blend.exe"); 478File.WriteAllText(Path.Combine(BuildDirectory, file), string.Empty); 484File.WriteAllText(Path.Combine(BuildDirectory64, file), string.Empty); 487Directory.CreateDirectory(Path.Combine(TempFolderRoot, "Common7", "IDE")); 506public string MSBuildExePath => Path.Combine(BuildDirectory, MSBuildExeName); 517TempFolderRoot = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 518BuildDirectory = Path.Combine(TempFolderRoot, "MSBuild"); 528Directory.CreateDirectory(Path.Combine(BuildDirectory, "amd64")); 529File.WriteAllText(Path.Combine(BuildDirectory, "amd64", msBuildExeName), string.Empty); 530File.WriteAllText(Path.Combine(BuildDirectory, "amd64", $"{MSBuildExePath}.config"), string.Empty);
BuildEventArgsSerialization_Tests.cs (1)
158projectFile: Path.Combine("a", "test.proj"),
ConsoleLogger_Tests.cs (3)
375string tempProjectDir = Path.Combine(Path.GetTempPath(), "EmptyTargetsOnDetailedButNotNotmal"); 376string tempProjectPath = Path.Combine(tempProjectDir, "test.proj");
Construction\ElementLocation_Tests.cs (7)
32Path.Combine(AppContext.BaseDirectory, "Microsoft.Common.targets"); 105file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 140file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Construction\SolutionFile_OldParser_Tests.cs (27)
168string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 219string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 220string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproja.proj"); 320Project('{F14B399A-7131-4C87-9E4B-1186C45EF12D}') = 'RptProj', '" + Path.GetFileName(rptprojPath) + @"', '{CCCCCCCC-9925-4D57-9DAF-E0A9D936ABDB}' 324Project('{D2ABAB84-BF74-430A-B69E-9DC6D40DDA17}') = 'DwProj', '" + Path.GetFileName(dqprojPath) + @"', '{DEA89696-F42B-4B58-B7EE-017FF40817D1}' 344string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 345string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp"); 539string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 540string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp"); 541string proj3Path = Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest", "someproj3.etp"); 586<FILE>" + Path.Combine("..", "SomeFolder", "ClassLibrary1.csproj") + @"</FILE> 594Directory.CreateDirectory(Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest")); 613solution.ProjectsInOrder[3].RelativePath.ShouldBe(Path.Combine("ETPProjUpgradeTest", "..", "SomeFolder", "ClassLibrary1.csproj")); 631string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 689string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); 773var solutionFolder = env.CreateFolder(Path.Combine(FileUtilities.GetTemporaryDirectory(), "sln")); 774env.CreateFolder(Path.Combine(solutionFolder.Path, "RelativePath")); 777p.FullPath = Path.Combine(solutionFolder.Path, "RelativePath", "project file"); 778p.SolutionFileDirectory = Path.GetFullPath(solutionFolder.Path); 786proj.RelativePath.ShouldBe(Path.Combine("RelativePath", "project file")); 803sp.SolutionFileDirectory = Path.GetTempPath(); 2426string expectedRelativePath = Path.Combine("..", "ProjectA", "ProjectA.csproj"); 2429solution.ProjectsInOrder[0].AbsolutePath.ShouldBe(Path.GetFullPath(Path.Combine(Path.GetDirectoryName(solution.FullPath)!, expectedRelativePath))); 2519if (project.AbsolutePath.Contains(Path.DirectorySeparatorChar.ToString()))
Construction\SolutionFilter_Tests.cs (28)
54TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "ClassLibrary"), createFolder: true); 55TransientTestFolder classLibSubFolder = testEnvironment.CreateFolder(Path.Combine(classLibFolder.Path, "ClassLibrary"), createFolder: true); 64TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "SimpleProject"), createFolder: true); 65TransientTestFolder simpleProjectSubFolder = testEnvironment.CreateFolder(Path.Combine(simpleProjectFolder.Path, "SimpleProject"), createFolder: true); 125Directory.GetCurrentDirectory().ShouldNotBe(Path.GetDirectoryName(filterFile.Path)); 232TransientTestFolder src = testEnvironment.CreateFolder(Path.Combine(folder.Path, "src"), createFolder: true); 244Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build"", """ + Path.Combine("src", Path.GetFileName(microsoftBuild.Path)) + @""", ""{69BE05E2-CBDA-4D27-9733-44E12B0F5627}"" 246Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""MSBuild"", """ + Path.Combine("src", Path.GetFileName(msbuild.Path)) + @""", ""{6F92CA55-1D15-4F34-B1FE-56C0B7EB455E}"" 248Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.CommandLine.UnitTests"", """ + Path.Combine("src", Path.GetFileName(commandLineUnitTests.Path)) + @""", ""{0ADDBC02-0076-4159-B351-2BF33FAA46B2}"" 250Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.Tasks.UnitTests"", """ + Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)) + @""", ""{CF999BDE-02B3-431B-95E6-E88D621D9CBF}"" 270""" + Path.Combine("src", Path.GetFileName(microsoftBuild.Path)!).Replace("\\", "\\\\") + @""", 271""" + Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)!).Replace("\\", "\\\\") + @""" 276sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(microsoftBuild.Path)!)).ShouldBeTrue(); 277sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(tasksUnitTests.Path)!)).ShouldBeTrue(); 280(sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(commandLineUnitTests.Path)!)) 281|| sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(msbuild.Path)!)) 282|| sp.ProjectShouldBuild(Path.Combine("src", "notAProject.csproj"))) 293folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, $"test@folder%special$symbols"), createFolder: true);
Construction\SolutionProjectGenerator_Tests.cs (24)
122TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true); 132TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true); 167TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true); 183TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true); 242TransientTestFolder classLibFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "classlib"), createFolder: true); 258TransientTestFolder simpleProjectFolder = testEnvironment.CreateFolder(Path.Combine(folder.Path, "simpleProject"), createFolder: true); 910<ProjectConfiguration Project="{786E302A-96CE-43DC-B640-D6B6CC9BF6C0}" AbsolutePath="##temp##{{Path.Combine("Project1", "A.csproj")}}" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration> 911<ProjectConfiguration Project="{881C1674-4ECA-451D-85B6-D7C59B7F16FA}" AbsolutePath="##temp##{{Path.Combine("Project2", "B.csproj")}}" BuildProjectInSolution="True">Debug|AnyCPU<ProjectDependency Project="{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}" /></ProjectConfiguration> 912<ProjectConfiguration Project="{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}" AbsolutePath="##temp##{{Path.Combine("Project3", "C.csproj")}}" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration> 1158string tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "ClassLibrary1", "ClassLibrary1.csproj"); 1161tempProjectPath = Path.GetFullPath(tempProjectPath); 1165tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "MainApp", "MainApp.vcxproj"); 1166tempProjectPath = Path.GetFullPath(tempProjectPath); 2600string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), 2620ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"), 2659string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), 2679ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"after.{Path.GetFileName(solutionFilePath)}.targets"), 2737string solutionFilePath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, $"{Guid.NewGuid():N}.sln"), 2757string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, projectName), 2769ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.props"), 2778ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine(baseDirectory, "Directory.Solution.targets"), 2847projectInSolution.AbsolutePath.ShouldBe(Path.Combine(solution.SolutionFileDirectory, projectInSolution.RelativePath));
Definition\ProjectEvaluationContext_Tests.cs (53)
123{Path.Combine(_env.DefaultTestDirectory.Path, "1.file"), 1}, 124{Path.Combine(_env.DefaultTestDirectory.Path, "2.file"), 1} 182{ Path.Combine(_env.DefaultTestDirectory.Path, "1.file"), 2 } 378File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.cs"), ""); 388File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.cs"), ""); 438File.WriteAllText(Path.Combine(projectDirectory1, $"1.{evaluationCount}.cs"), ""); 439File.WriteAllText(Path.Combine(projectDirectory2, $"2.{evaluationCount}.cs"), ""); 445Path.Combine(projectDirectory1, "1"), 448<i Include=`{Path.Combine("**", "*.cs")}` /> 452Path.Combine(projectDirectory2, "2"), 455<i Include=`{Path.Combine("**", "*.cs")}` /> 462var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 472File.WriteAllText(Path.Combine(projectDirectory1, $"1.{evaluationCount}.cs"), ""); 473File.WriteAllText(Path.Combine(projectDirectory2, $"2.{evaluationCount}.cs"), ""); 493File.WriteAllText(Path.Combine(project1GlobDirectory, $"1.{evaluationCount}.cs"), ""); 494File.WriteAllText(Path.Combine(project2GlobDirectory, $"2.{evaluationCount}.cs"), ""); 500Path.Combine(project1Directory, "1"), 503<i Include=`{Path.Combine("..", "Glob", "**", "*.cs")}`/> 507Path.Combine(project2Directory, "2"), 510<i Include=`{Path.Combine("..", "Glob", "**", "*.cs")}`/> 517var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 521.Select(i => Path.Combine("..", "Glob", projectName, $"{projectName}.{i}")) 529File.WriteAllText(Path.Combine(project1GlobDirectory, $"1.{evaluationCount}.cs"), ""); 530File.WriteAllText(Path.Combine(project2GlobDirectory, $"2.{evaluationCount}.cs"), ""); 555File.WriteAllText(Path.Combine(project1GlobDirectory, $"{evaluationCount}.cs"), ""); 562Path.Combine(project1Directory.Path, "1"), 565<i Include=`{Path.Combine("Glob", "**", "*.cs")}` /> 570Path.Combine(project2Directory.Path, "2"), 573<i Include=`{Path.Combine(project1Directory.Path, "Glob", "**", "*.cs")}` /> 580var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 584.Select(i => Path.Combine("Glob", "1", i)) 591.Select(i => Path.Combine(project1Directory.Path, i)) 600File.WriteAllText(Path.Combine(project1GlobDirectory, $"{evaluationCount}.cs"), ""); 622File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 628Path.Combine(project1Directory.Path, "1"), 635Path.Combine(project2Directory.Path, "2"), 645var projectName = Path.GetFileNameWithoutExtension(project.FullPath); 647? Path.Combine("..", "..", "glob") 648: Path.Combine("..", "..", "..", "glob"); 652.Select(i => Path.Combine(globFixedDirectoryPart, i)) 660File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 686? Path.Combine("..", "GlobDirectory") 702prependedGlobExpansion[i] = Path.Combine(itemSpecDirectoryPart, globExpansion[i]); 710<i Include=`{Path.Combine("{0}", "**", "*.cs")}`/> 715<i Include=`{Path.Combine("{0}", "**", "*.cs")}`/> 720.Select((p, i) => new ProjectSpecification(Path.Combine(testDirectory.Path, $"ProjectDirectory{i}", $"Project{i}.proj"), p)); 726File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 736File.WriteAllText(Path.Combine(globDirectory.Path, $"{evaluationCount}.cs"), ""); 763File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.props"), $"<Project><ItemGroup><i Include=`{evaluationCount}.cs`/></ItemGroup></Project>".Cleanup()); 773File.WriteAllText(Path.Combine(projectDirectory, $"{evaluationCount}.props"), $"<Project><ItemGroup><i Include=`{evaluationCount}.cs`/></ItemGroup></Project>".Cleanup()); 804var theFile = Path.Combine(projectDirectory, "0.cs"); 958projectContents.Select((p, i) => new ProjectSpecification(Path.Combine(_env.DefaultTestDirectory.Path, $"Project{i}.proj"), p)), 992Directory.CreateDirectory(Path.GetDirectoryName(projectFilePath));
Definition\ToolsetConfigurationReaderTestHelper.cs (3)
32s_testFolderFullPath = Path.Combine(Path.GetTempPath(), "configFileTests"); 34string configFilePath = Path.Combine(s_testFolderFullPath, "test.exe.config");
Definition\ToolsVersion_Tests.cs (6)
260if (Path.GetDirectoryName(file.Path).Equals(dir, StringComparison.OrdinalIgnoreCase) 266if (Path.GetDirectoryName(file.Path).Equals(overrideDir, StringComparison.OrdinalIgnoreCase) 960Path.GetFileName(path); 962string pathWithoutTrailingSlash = path.EndsWith(Path.DirectorySeparatorChar.ToString()) 973bool sameFolder = (String.Equals(Path.GetDirectoryName(candidate), 976return !sameFolder || !Regex.IsMatch(Path.GetFileName(candidate), finalPattern);
EscapingInProjects_Tests.cs (6)
638string path = Path.Combine(Path.GetTempPath(), projectRelativePath); 639string projectAbsolutePath = Path.Combine(path, projectName); 1805File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "a.weirdo"), String.Empty); 1806File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "b.weirdo"), String.Empty); 1807File.WriteAllText(Path.Combine(ObjectModelHelpers.TempProjectDir, "c.weirdo"), String.Empty);
Evaluation\Evaluator_Tests.cs (146)
107TransientTestFolder projDirectory = env.CreateFolder(Path.Combine(env.CreateNewTempPath().TempPath, projectPathCandidate), createFolder: true); 140yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}')""", true }; 141yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false }; 142yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "projectThatDoesNotExist.csproj")}""", false }; 143yield return new object[] { $@"Project=""{Path.Combine("nonexistentDirectory", "*.*proj")}""", true }; 146yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}')""", true }; 147yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false }; 148yield return new object[] { $@"Project=""{Path.Combine("realFolder", "projectThatDoesNotExist.csproj")}""", false }; 149yield return new object[] { $@"Project=""{Path.Combine("realFolder", "*.*proj")}""", true }; 152yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}"" Condition=""Exists('{Path.Combine("realFolder", "realFile.csproj")}')""", true }; 153yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}"" Condition=""'true'""", true }; 154yield return new object[] { $@"Project=""{Path.Combine("realFolder", "realFile.csproj")}""", true }; 155yield return new object[] { $@"Project=""{Path.Combine("realFolder", "*.*proj")}""", true }; 160yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""Exists('{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}')""", true }; 161yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}"" Condition=""'true'""", false }; 162yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "projectThatDoesNotExist.csproj")}""", false }; 163yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "nonexistentDirectory", "*.*proj")}""", true }; 164yield return new object[] { $@"Project=""{Path.Combine("$(VSToolsPath)", "*.*proj")}""", true }; 332string tempPath = Path.GetTempPath(); 333string targetDirectory = Path.Combine(tempPath, "VerifyConditionsInsideOutsideTargets"); 334string subDirectory = Path.Combine(targetDirectory, "subdir"); 336string testTargetPath = Path.Combine(targetDirectory, "test.targets"); 337string targetDirectoryTargetsPath = Path.Combine(targetDirectory, "targetdir.targets"); 338string targetDirectoryTargetsPath2 = Path.Combine(targetDirectory, "targetdir2.targets"); 339string subdirProjPath = Path.Combine(subDirectory, "test.proj"); 340string projectDirectoryTargetsPath = Path.Combine(subDirectory, "projdir.targets"); 341string projectDirectoryTargetsPath2 = Path.Combine(subDirectory, "projdir2.targets"); 342string textTextPath = Path.Combine(targetDirectory, "test.txt"); 461string tempPath = Path.GetTempPath(); 462string targetDirectory = Path.Combine(tempPath, "VerifyConditionsInsideOutsideTargets"); 463string subDirectory = Path.Combine(targetDirectory, "subdir"); 465string testTargetPath = Path.Combine(targetDirectory, "test.targets"); 466string targetDirectoryTargetsPath = Path.Combine(targetDirectory, "targetdir.targets"); 467string targetDirectoryTargetsPath2 = Path.Combine(targetDirectory, "targetdir2.targets"); 468string subdirProjPath = Path.Combine(subDirectory, "test.proj"); 469string projectDirectoryTargetsPath = Path.Combine(subDirectory, "projdir.targets"); 470string projectDirectoryTargetsPath2 = Path.Combine(subDirectory, "projdir2.targets"); 471string textTextPath = Path.Combine(targetDirectory, "test.txt"); 489logger.AssertLogContains("PropertyOutsideTarget: " + Path.Combine("..", "test.txt")); 491logger.AssertLogContains("PropertyInsideTarget: " + Path.Combine("..", "test.txt")); 492logger.AssertLogContains("PropertyGroupInsideTarget: " + Path.Combine("..", "test.txt")); 533string tempPath = Path.GetTempPath(); 534string targetDirectory = Path.Combine(tempPath, "VerifyUsedUnInitializedPropertyInImports"); 536string targetAPath = Path.Combine(targetDirectory, "targetA.targets"); 537string targetBPath = Path.Combine(targetDirectory, "targetB.targets"); 538string projectPath = Path.Combine(targetDirectory, "test.proj"); 580string tempPath = Path.GetTempPath(); 581string targetDirectory = Path.Combine(tempPath, "EmptyPropertyIsThenSet"); 582string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 622string tempPath = Path.GetTempPath(); 623string targetDirectory = Path.Combine(tempPath, "EmptyPropertyIsThenSet"); 624string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 668string tempPath = Path.GetTempPath(); 669string targetDirectory = Path.Combine(tempPath, "SetPropertyToItself"); 670string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 714string tempPath = Path.GetTempPath(); 715string targetDirectory = Path.Combine(tempPath, "UsePropertyInCondition"); 716string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 758string tempPath = Path.GetTempPath(); 759string targetDirectory = Path.Combine(tempPath, "UsePropertyBeforeSet"); 760string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 804string tempPath = Path.GetTempPath(); 805string targetDirectory = Path.Combine(tempPath, "UsePropertyBeforeSetDuplicates"); 806string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 1156directory = Path.Combine(Path.GetTempPath(), "fol$der"); 1157directory2 = Path.Combine(Path.GetTempPath(), "fol$der" + Path.DirectorySeparatorChar + "fol$der2"); 1160string importPathRelativeEscaped = Path.Combine("fol$(x)$der2", "Escap%3beab$(x)leChar$ac%3BtersInI*tPa?h"); 1161string importRelative1 = Path.Combine("fol$der2", "Escap;eableChar$ac;tersInImportPath"); 1162string importRelative2 = Path.Combine("fol$der2", "Escap;eableChar$ac;tersInI_XXXX_tPath"); 1163importPath1 = Path.Combine(directory, importRelative1); 1164importPath2 = Path.Combine(directory, importRelative2); 1185projectPath = Path.Combine(directory, "my.proj"); // project path has $ in too 1418logger.AssertLogContains(aProjName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar); 1425logger.AssertLogContains(targets1FileName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar); 1432logger.AssertLogContains(targets2FileName + @": MSBuildThisFileDirectoryNoRoot=a" + Path.DirectorySeparatorChar + "b" + Path.DirectorySeparatorChar); 2272string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative"); 2273string directory2 = Path.Combine(directory, "sub"); 2275VerifyImportTargetRelativePath(directory, directory2, new string[] { Path.Combine("**", "*.targets") }); 2284string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative2"); 2285string directory2 = Path.Combine(directory, "sub"); 2290new string[] { Path.Combine(directory2, "*.targets"), Path.Combine(directory, "*.targets") }); 2299string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsRelative3"); 2300string directory2 = Path.Combine(directory, "sub"); 2307Path.Combine(directory2, "..", "*.targets"), Path.Combine( 2321string directory = Path.Combine(Path.GetTempPath(), "ImportWildcardsFullPath"); 2322string directory2 = Path.Combine(directory, "sub"); 2325string file1 = Path.Combine(directory, "1.targets"); 2326string file2 = Path.Combine(directory2, "2.targets"); 2327string file3 = Path.Combine(directory2, "3.cpp.targets"); 3422string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyPropertySetInImportStillOverrides"); 3433string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3434string import = Path.Combine(projectDirectory, "import.proj"); 3483string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyInImportDoesntAffectParentProjectAboveIt"); 3494string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3495string import = Path.Combine(projectDirectory, "import.proj"); 3543string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyInImportAffectsParentProjectBelowIt"); 3554string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3555string import = Path.Combine(projectDirectory, "import.proj"); 3615string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyTreatAsLocalPropertyUnionBetweenImports"); 3626string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3627string import = Path.Combine(projectDirectory, "import.proj"); 3688string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyDuplicateTreatAsLocalProperty"); 3699string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3700string import = Path.Combine(projectDirectory, "import.proj"); 3753string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyGlobalPropertyPassedToP2P"); 3764string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3765string project2 = Path.Combine(projectDirectory, "project2.proj"); 3815string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyLocalPropertyPropagatesIfExplicitlyPassedToP2P"); 3826string primaryProject = Path.Combine(projectDirectory, "project.proj"); 3827string project2 = Path.Combine(projectDirectory, "project2.proj"); 4388string projectDirectory = Path.Combine(Path.GetTempPath(), "VerifyDTDProcessingIsDisabled"); 4399string projectFilename = Path.Combine(projectDirectory, "project.proj"); 4541string projectDirectory = Path.Combine(Path.GetTempPath(), "ThrownInvalidProjectExceptionProperlyHandled"); 4552string primaryProject = Path.Combine(projectDirectory, "project.proj"); 4553string import = Path.Combine(projectDirectory, "import.proj"); 5074string tempPath = Path.GetTempPath(); 5075string targetDirectory = Path.Combine(tempPath, "LogPropertyAssignments"); 5076string testTargetPath = Path.Combine(targetDirectory, "test.proj"); 5221string file0 = Path.Combine(directory, "my.proj"); 5222file1 = Path.Combine(directory, "1.targets"); 5223file2 = Path.Combine(directory2, "2.targets"); 5224file3 = Path.Combine(directory2, "3.cpp.targets"); 5225file4 = Path.Combine(directory2, "4.nottargets");
Evaluation\Expander_Tests.cs (87)
42private static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 262Assert.Equal(Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory"), itemsTrue[0].EvaluatedInclude); 268Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"seconddirectory"), itemsDir[0].EvaluatedInclude); 288Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, itemsTrue[5].EvaluatedInclude); 344Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, result); 536log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar)); 558log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar)); 580log.AssertLogContains(String.Format(@"[{0}foo;{0}bar]", current + Path.DirectorySeparatorChar)); 661Assert.Equal(Path.Combine("firstdirectory", "seconddirectory") + Path.DirectorySeparatorChar, itemsTrue[5].EvaluatedInclude); 699Assert.Equal(Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory"), itemsTrue[5].EvaluatedInclude); 720Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"secondd;rectory"), items[5].EvaluatedInclude); 721Assert.Equal(Path.Combine(Directory.GetCurrentDirectory(), @"someo;herplace"), items[6].EvaluatedInclude); 762pi.SetMetadata("Meta" + m.ToString(), Path.Combine(s_rootPathPrefix, "firstdirectory", "seconddirectory", "file") + m.ToString() + ".ext"); 764pi.SetMetadata("Meta9", Path.Combine("seconddirectory", "file.ext")); 765pi.SetMetadata("Meta10", String.Format(";{0};{1};", Path.Combine("someo%3bherplace", "foo.txt"), Path.Combine("secondd%3brectory", "file.ext"))); 1436subdir1" + Path.DirectorySeparatorChar + @": aaa=111 1437subdir2" + Path.DirectorySeparatorChar + @": bbb=222 1487"subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar, 1539@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + 1540Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi", 1561@"string$(p);dialogs%253b ; splash.bmp ; ; ; ; \jk ; l\mno%253bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%253bdef;ghi", 1672Assert.Equal(@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1" + Path.DirectorySeparatorChar + ";subdir2" + Path.DirectorySeparatorChar + " ; english_abc%3bdef;ghi", expander.ExpandIntoStringAndUnescape(value, ExpanderOptions.ExpandAll, MockElementLocation.Instance)); 1700Assert.Equal("subdir1" + Path.DirectorySeparatorChar, expanded[5]); 1701Assert.Equal("subdir2" + Path.DirectorySeparatorChar, expanded[6]); 2148pg.Set(ProjectPropertyInstance.Create("RootPath", Path.Combine(s_rootPathPrefix, "this", "is", "the", "root"))); 2149pg.Set(ProjectPropertyInstance.Create("MyPath", Path.Combine(s_rootPathPrefix, "this", "is", "the", "root", "my", "project", "is", "here.proj"))); 2155Assert.Equal(Path.Combine(Path.DirectorySeparatorChar.ToString(), "my", "project", "is", "here.proj"), result); 2182pg.Set(ProjectPropertyInstance.Create("PathRoot", Path.Combine(s_rootPathPrefix, "goo"))); 2183pg.Set(ProjectPropertyInstance.Create("PathRoot2", Path.Combine(s_rootPathPrefix, "goop") + Path.DirectorySeparatorChar)); 2187string result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot2.Endswith(" + Path.DirectorySeparatorChar + "))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); 2189result = expander.ExpandIntoStringLeaveEscaped(@"$(PathRoot.Endswith(" + Path.DirectorySeparatorChar + "))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); 2317pg.Set(ProjectPropertyInstance.Create("PathRoot", Path.Combine(s_rootPathPrefix, "goo"))); 2318pg.Set(ProjectPropertyInstance.Create("PathRoot2", Path.Combine(s_rootPathPrefix, "goop") + Path.DirectorySeparatorChar)); 2324@"'$(PathRoot2.Endswith(`" + Path.DirectorySeparatorChar + "`))' == 'true'", 2334@"'$(PathRoot.EndsWith(" + Path.DirectorySeparatorChar + "))' == 'false'", 2517pg.Set(ProjectPropertyInstance.Create("ParentPath", Path.Combine(s_rootPathPrefix, "abc", "def"))); 2518pg.Set(ProjectPropertyInstance.Create("FilePath", Path.Combine(s_rootPathPrefix, "abc", "def", "foo.cpp"))); 2535pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo", "file.txt"))); 2541Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result); 2680pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo", "file.txt"))); 2686Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result); 2696pg.Set(ProjectPropertyInstance.Create("File", "foo goo" + Path.DirectorySeparatorChar + "file.txt")); 2701Path.Combine(s_rootPathPrefix, "foo goo") + "`, `$(File)`))", 2704Assert.Equal(Path.Combine(s_rootPathPrefix, "foo goo", "foo goo", "file.txt"), result); 2714pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo bar", "baz.txt"))); 2719Path.Combine(s_rootPathPrefix, "foo baz") + @"`, `$(File)`))", 2722Assert.Equal(Path.Combine(s_rootPathPrefix, "foo baz", "foo bar", "baz.txt"), result); 2732pg.Set(ProjectPropertyInstance.Create("File", Path.Combine("foo bar", "baz.txt"))); 2737Path.Combine(s_rootPathPrefix, "foo baz") + @" `, `$(File)`))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance); 2739Assert.Equal(Path.Combine(s_rootPathPrefix, "foo baz ", "foo bar", "baz.txt"), result); 2795pg.Set(ProjectPropertyInstance.Create("File", "foo" + Path.DirectorySeparatorChar + "file.txt")); 2803Assert.Equal(Path.Combine(s_rootPathPrefix, "foo", "file.txt"), result); 2813pg.Set(ProjectPropertyInstance.Create("File", "foo" + Path.DirectorySeparatorChar + "file.txt")); 3386string tempFile = Path.GetFileName(FileUtilities.GetTemporaryFile()); 3390string directoryStart = Path.Combine(tempPath, "one\\two\\three\\four\\five"); 3421MockElementLocation mockElementLocation = new MockElementLocation(Path.Combine(ObjectModelHelpers.TempProjectDir, "one", "two", "three", "four", "five", Path.GetRandomFileName())); 3428pg.Set(ProjectPropertyInstance.Create("FileToFind", Path.GetFileName(fileToFind))); 3466string fileWithPath = Path.Combine("foo", "bar", "file.txt"); 3616$"{Path.GetFullPath("one")}{Path.DirectorySeparatorChar}", 3620$"{Path.GetFullPath(Path.Combine("one", "two"))}{Path.DirectorySeparatorChar}", 3918pg.Set(ProjectPropertyInstance.Create("SomePath", Path.Combine(s_rootPathPrefix, "some", "path"))); 3928Assert.Equal(Path.Combine(s_rootPathPrefix, "some", "path", "fOo.Cs"), result); 4346string path = Path.Combine("foo", "bar"); 4357Assert.Equal(path + Path.DirectorySeparatorChar, result); 4362Assert.Equal(path + Path.DirectorySeparatorChar, result); 4902var expectedAlphaSquigglePath = Path.Combine("Alpha", ".squiggle"); 4903var expectedBetaSquigglePath = Path.Combine("Beta", ".squiggle"); 4904var expectedAlphaGammaSquigglePath = Path.Combine("Alpha", "Gamma", ".squiggle"); 4949var alphaOnePath = Path.Combine("alpha", "One.cs"); 4950var alphaThreePath = Path.Combine("alpha", "Three.cs"); 4990var alphaBetaPath = Path.Combine("alpha", "beta"); 4991var alphaDeltaPath = Path.Combine("alpha", "delta"); 5173string reflectionInfoPath = Path.Combine(Directory.GetCurrentDirectory(), "PropertyFunctionsRequiringReflection");
Evaluation\ImportFromMSBuildExtensionsPath_Tests.cs (40)
50extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), GetExtensionTargetsFileContent1()); 55projColln.ResetToolsetsForTests(WriteConfigFileAndGetReader("MSBuildExtensionsPath", extnDir1, Path.Combine("tmp", "nonexistent"))); 92string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContentWithCondition); 95CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir1, Path.Combine("tmp", "nonexistent") }, 128string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1); 129string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn2.proj"), 133new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 }, 158string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent); 196string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 198string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), 204new[] { extnDir1, Path.Combine("tmp", "nonexistent"), extnDir2 }, 246string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("circularwildcardtest", "extn.proj"), 248string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("circularwildcardtest", "extn.proj"), 250string extnDir3 = GetNewExtensionsPathAndCreateFile("extensions3", Path.Combine("circularwildcardtest", "extn3.proj"), 256string mainProjectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("extensions2", "circularwildcardtest", "main.proj"), mainTargetsFileContent); 283string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent); 286CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { Path.Combine("tmp", "nonexistent"), extnDir1 }, 300extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent); 305Path.Combine("tmp", "nonexistent"))); 355string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1); 356string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), extnTargetsFileContent2); 359CreateAndBuildProjectForImportFromExtensionsPath(mainProjectPath, "MSBuildExtensionsPath", new string[] { extnDir2, Path.Combine("tmp", "nonexistent"), extnDir1 }, 399string extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), extnTargetsFileContent1); 400string extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("foo", "extn.proj"), extnTargetsFileContent2); 407projColln.ResetToolsetsForTests(WriteConfigFileAndGetReader("MSBuildExtensionsPath", Path.Combine("tmp", "non-existent"), extnDir1)); 486extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 488extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("bar", "extn2.proj"), 490extnDir3 = GetNewExtensionsPathAndCreateFile("extensions3", Path.Combine("xyz", "extn3.proj"), 566extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 627extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 698extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("Microsoft", "VisualStudio", "v99", "DNX", "Microsoft.DNX.Props"), 763extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("file.props"), 804extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("file.props"), string.Empty); 837logger.AssertLogContains(@"MSB4226: The imported project """ + Path.Combine("$(UndefinedProperty)", "filenotfound.props") 889extnDir1 = GetNewExtensionsPathAndCreateFile("extensions1", Path.Combine("foo", "extn.proj"), 891extnDir2 = GetNewExtensionsPathAndCreateFile("extensions2", Path.Combine("bar", "extn2.proj"), 999var extnDir = Path.Combine(ObjectModelHelpers.TempProjectDir, extnDirName); 1000Directory.CreateDirectory(Path.Combine(extnDir, Path.GetDirectoryName(relativeFilePath))); 1001File.WriteAllText(Path.Combine(extnDir, relativeFilePath), fileContents);
Evaluation\IntrinsicFunctionOverload_Tests.cs (3)
132string testFilePath = Path.Combine(env.DefaultTestDirectory.Path, "TestFile.txt"); 172string testDirPath = Path.Combine(env.DefaultTestDirectory.Path, "TestDir"); 213string testDirPath = Path.Combine(env.DefaultTestDirectory.Path, "TestDir");
Evaluation\ItemSpec_Tests.cs (3)
48var projectFile = Path.Combine(absoluteRootPath, "build.proj"); 49var absoluteSpec = Path.Combine(absoluteRootPath, "s.cs"); 85return new ProjectInstanceItemSpec(itemSpec, expander, location, Path.GetDirectoryName(location.File));
Evaluation\Preprocessor_Tests.cs (57)
94" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 102" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 109" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 138" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 146" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 153" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 182" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 190" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 197" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 226" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 234" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 244" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 274" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 308" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 319" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 326" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 386" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 429" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 441" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 451" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 487" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 499" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 509" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 516" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3 526" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 560" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 568" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 575" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 582" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3 589" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 621" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 629" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p2 636" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 643" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p3 650" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 681" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 707directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 711xml0.AddImport(directory + Path.DirectorySeparatorChar + "*.targets"); 713xml1 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "1.targets"); 717xml2 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "2.targets"); 721xml3 = ProjectRootElement.Create(directory + Path.DirectorySeparatorChar + "3.xxxxxx"); 737" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 743<Import Project=""" + Path.Combine(directoryXmlCommentFriendly, "*.targets") + @"""> 745" + Path.Combine(directoryXmlCommentFriendly, "1.targets") + @" 758<Import Project=""" + Path.Combine(directoryXmlCommentFriendly, "*.targets") + @"""> 760" + Path.Combine(directoryXmlCommentFriendly, "2.targets") + @" 770" + CurrentDirectoryXmlCommentFriendly + Path.DirectorySeparatorChar + @"p1 858string sdkPropsPath = Path.Combine(testSdkDirectory, "Sdk.props"); 859string sdkTargetsPath = Path.Combine(testSdkDirectory, "Sdk.targets"); 974string importedPropsPath = Path.Combine(testDirectory, "Import.props"); 981string projectPath = Path.Combine(testDirectory, "TestProject.csproj"); 1065string sdkPropsPath1 = Path.Combine(sdk1, "Sdk.props"); 1066string sdkTargetsPath1 = Path.Combine(sdk1, "Sdk.targets"); 1079string sdkPropsPath2 = Path.Combine(sdk2, "Sdk.props"); 1080string sdkTargetsPath2 = Path.Combine(sdk2, "Sdk.targets"); 1099string importPath = Path.GetFullPath(import.ProjectFile);
Evaluation\ProjectSdkImplicitImport_Tests.cs (13)
89_testSdkDirectory = Path.Combine(_testSdkRoot, SdkName, "Sdk"); 90_sdkPropsPath = Path.Combine(_testSdkDirectory, "Sdk.props"); 91_sdkTargetsPath = Path.Combine(_testSdkDirectory, "Sdk.targets"); 192string testSdkDirectory = Directory.CreateDirectory(Path.Combine(_testSdkRoot, sdkName, "Sdk")).FullName; 194File.WriteAllText(Path.Combine(testSdkDirectory, "Sdk.props"), $"<Project><PropertyGroup><InitialImportProperty>{sdkName}</InitialImportProperty></PropertyGroup></Project>"); 195File.WriteAllText(Path.Combine(testSdkDirectory, "Sdk.targets"), $"<Project><PropertyGroup><FinalImportProperty>{sdkName}</FinalImportProperty></PropertyGroup></Project>"); 211VerifyPropertyFromImplicitImport(project, "InitialImportProperty", Path.Combine(_testSdkRoot, sdkNames.Last(), "Sdk", "Sdk.props"), sdkNames.Last()); 212VerifyPropertyFromImplicitImport(project, "FinalImportProperty", Path.Combine(_testSdkRoot, sdkNames.Last(), "Sdk", "Sdk.targets"), sdkNames.Last()); 359var p1Path = Path.Combine(projectFolder, "p1.proj"); 360var p2Path = Path.Combine(projectFolder, "p2.proj"); 548import.SdkResult.Path.ShouldBe(Path.GetDirectoryName(expectedSdkPath)); 676var expectedSdkPath = Path.GetDirectoryName(_sdkPropsPath); 679expectedSdkPath.ShouldBe(Path.GetDirectoryName(_sdkTargetsPath));
Evaluation\SdkResultEvaluation_Tests.cs (25)
130string projectPath = Path.Combine(_testFolder, "project.proj"); 163string projectPath = Path.Combine(_testFolder, "project.proj"); 193Path.Combine(_testFolder, "Sdk"), 200new[] { Path.Combine(_testFolder, "Sdk") }, 225string projectPath = Path.Combine(_testFolder, "project.proj"); 235string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props"); 236Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk")); 288Path.Combine(_testFolder, "Sdk1"), 289Path.Combine(_testFolder, "Sdk2") 313string projectPath = Path.Combine(_testFolder, "project.proj"); 323string sdk1PropsPath = Path.Combine(_testFolder, "Sdk1", "Sdk.props"); 324Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk1")); 334string sdk2PropsPath = Path.Combine(_testFolder, "Sdk2", "Sdk.props"); 335Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk2")); 389new[] { Path.Combine(_testFolder, "Sdk") }, 405string projectPath = Path.Combine(_testFolder, "project.proj"); 415string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props"); 416Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk")); 426string sdkTargetsPath = Path.Combine(_testFolder, "Sdk", "Sdk.targets"); 482string projectPath = Path.Combine(_testFolder, "project.proj"); 503factory.IndicateSuccess(Path.Combine(_testFolder, "Sdk"), "1.0.0", null, null, null, environmentVariablesToAdd: new Dictionary<string, string> 523string projectPath = Path.Combine(_testFolder, "project.proj"); 528string sdkPropsPath = Path.Combine(_testFolder, "Sdk", "Sdk.props"); 529Directory.CreateDirectory(Path.Combine(_testFolder, "Sdk")); 534string sdkTargetsPath = Path.Combine(_testFolder, "Sdk", "Sdk.targets");
FileLogger_Tests.cs (15)
335string directory = Path.Combine(ObjectModelHelpers.TempProjectDir, Guid.NewGuid().ToString("N")); 336string log = Path.Combine(directory, "build.log"); 494fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile.log"); 496Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile3.log") + ";", StringComparison.OrdinalIgnoreCase)); 500fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile.log"); 502Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "mylogfile4.log") + ";", StringComparison.OrdinalIgnoreCase)); 505Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "tempura")); 507fileLogger.Parameters = "logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile.log"); 509Assert.Equal(0, string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile1.log") + ";", StringComparison.OrdinalIgnoreCase)); 514if (Directory.Exists(Path.Combine(Directory.GetCurrentDirectory(), "tempura"))) 516File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "tempura", "mylogfile1.log")); 517FileUtilities.DeleteWithoutTrailingBackslash(Path.Combine(Directory.GetCurrentDirectory(), "tempura")); 519File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile0.log")); 520File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile3.log")); 521File.Delete(Path.Combine(Directory.GetCurrentDirectory(), "mylogfile4.log"));
FileMatcher_Tests.cs (57)
65File.WriteAllBytes(Path.Combine(testFolder.Path, file), new byte[1]); 79TransientTestFolder tf2 = _env.CreateFolder(Path.Combine(testFolder.Path, "subfolder")); 80string symlinkPath = Path.Combine(tf2.Path, "mySymlink"); 104foreach (string fullPath in GetFilesComplexGlobbingMatchingInfo.FilesToCreate.Select(i => Path.Combine(testFolder.Path, i.ToPlatformSlash()))) 106Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); 126.Select(i => i.Replace(Path.DirectorySeparatorChar, '\\')) 618return new string[] { Path.Combine(path, "LongDirectoryName") }; 625return new string[] { Path.Combine(path, "LongSubDirectory") }; 632return new string[] { Path.Combine(path, "LongFileName.txt") }; 639return new string[] { Path.Combine(path, "pomegranate") }; 656private static readonly char S = Path.DirectorySeparatorChar; 787"Source" + Path.DirectorySeparatorChar + "**", 790"Source" + Path.DirectorySeparatorChar + "Bart.txt", 791"Source" + Path.DirectorySeparatorChar + "Sub" + Path.DirectorySeparatorChar + "Homer.txt", 795"Destination" + Path.DirectorySeparatorChar + "Bart.txt", 796"Destination" + Path.DirectorySeparatorChar + "Sub" + Path.DirectorySeparatorChar + "Homer.txt", 995ValidateFileMatch(Path.Combine(".", "File.txt"), Path.Combine(".", "File.txt"), false); 996ValidateNoFileMatch(Path.Combine(".", "File.txt"), Path.Combine(".", "File.bin"), false); 1002ValidateFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine("..", "..", "File.txt"), false); 1006ValidateFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine("..", "..", "File"), false); 1008ValidateNoFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine(new[] { "..", "..", "dir1", "dir2", "File.txt" }), false); 1009ValidateNoFileMatch(Path.Combine("..", "..", "*.*"), Path.Combine(new[] { "..", "..", "dir1", "dir2", "File" }), false); 1020ValidateFileMatch(Path.Combine("**", "*.cs"), Path.Combine("dir1", "dir2", "file.cs"), true); 1021ValidateFileMatch(Path.Combine("**", "*.cs"), "file.cs", true); 1250string workingPathSubfolder = Path.Combine(workingPath, "SubDir"); 1251string offendingPattern = Path.Combine(workingPath, @"*\..\bar"); 1264string fileName = Path.Combine(workingPath, "MyFile.txt"); 1265string offendingPattern = Path.Combine(workingPath, @"**\**"); 1281string workingPathSubdir = Path.Combine(workingPath, "subdir"); 1282string workingPathSubdirBing = Path.Combine(workingPathSubdir, "bing"); 1284string offendingPattern = Path.Combine(workingPath, @"**\sub*\*."); 2094candidateDirectoryName = Path.GetDirectoryName(normalizedCandidate); 2136if (normalizedCandidate == Path.Combine(path, pattern)) 2178string baseMatch = Path.GetFileName(normalizedCandidate.Substring(0, nextSlash)); 2251string normalized = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 2252if (Path.DirectorySeparatorChar != '\\') 2254normalized = path.Replace("\\", Path.DirectorySeparatorChar.ToString()); 2263normalized = normalized.Replace(@".." + Path.DirectorySeparatorChar, "<:PARENT:>"); 2266string doubleSeparator = Path.DirectorySeparatorChar.ToString() + Path.DirectorySeparatorChar.ToString(); 2267normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString()); 2268normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString()); 2269normalized = normalized.Replace(doubleSeparator, Path.DirectorySeparatorChar.ToString()); 2272normalized = normalized.Replace(@"." + Path.DirectorySeparatorChar, ""); 2276normalized = normalized.Replace("<:PARENT:>", @".." + Path.DirectorySeparatorChar); 2293if (path.Length == 0 && !Path.IsPathRooted(candidate)) 2486return new string[] { Path.Combine(path, pattern) };
FileUtilities_Tests.cs (29)
43Assert.Equal(@"foo" + Path.DirectorySeparatorChar, modifier); 47Assert.Equal(@"foo" + Path.DirectorySeparatorChar, modifier); 418Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath))); 432Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath))); 535Assert.True(FileUtilities.FileOrDirectoryExistsNoThrow(Path.GetTempPath())); 756Assert.StartsWith(Path.GetTempPath(), path); 778Assert.StartsWith(Path.GetTempPath(), path); 793string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "subfolder"); 824Assert.StartsWith(Path.GetTempPath(), path); 863var secondSlash = SystemSpecificAbsolutePath.Substring(1).IndexOf(Path.DirectorySeparatorChar) + 1; 887string firstDirectory = Path.GetDirectoryName(Path.GetDirectoryName(filePath)); 888string tmpDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath))); 918string firstDirectory = Path.GetDirectoryName(Path.GetDirectoryName(filePath)); 919string tmpDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(filePath))); 946string path = Path.Combine(root, "1", "2", "3", "4", "5"); 948Assert.Equal(Path.Combine(root, "1", "2", "3", "4", "5"), FileUtilities.GetFolderAbove(path, 0)); 949Assert.Equal(Path.Combine(root, "1", "2", "3", "4"), FileUtilities.GetFolderAbove(path)); 950Assert.Equal(Path.Combine(root, "1", "2", "3"), FileUtilities.GetFolderAbove(path, 2)); 951Assert.Equal(Path.Combine(root, "1", "2"), FileUtilities.GetFolderAbove(path, 3)); 952Assert.Equal(Path.Combine(root, "1"), FileUtilities.GetFolderAbove(path, 4)); 966Path.Combine(root, "path1"), 970Path.Combine(root, "path1", "path2", "file.txt"), 1012expectedTruncatedPath = expectedTruncatedPath.Replace('/', Path.DirectorySeparatorChar);
FixPathOnUnix_Tests.cs (2)
41ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("projectDirectory", "lib", "foo.dll"), "just a text file"); 52logger.AssertLogContains($"ItemMetadata: Md0 = {Path.Combine("lib", "foo.dll")}");
Globbing\MSBuildGlob_Tests.cs (8)
33Assert.Equal(glob.TestOnlyGlobRoot.LastOrDefault(), Path.DirectorySeparatorChar); 42var expectedRoot = Path.Combine(Directory.GetCurrentDirectory(), globRoot).WithTrailingSlash(); 119var expectedFixedDirectory = Path.Combine(globRoot, "b").WithTrailingSlash(); 170Assert.EndsWith("%42" + Path.DirectorySeparatorChar, glob.FixedDirectoryPart); 318return Path.Combine(Directory.GetCurrentDirectory(), expectedFixedDirectoryPart).Replace("/", "\\").WithTrailingSlash(); 358string normalizedPath = path.Replace(Path.DirectorySeparatorChar == '/' ? '\\' : '/', Path.DirectorySeparatorChar); 362var rootedFixedDirectoryPart = Path.Combine(FileUtilities.NormalizePath(globRoot), fixedDirectoryPart);
Graph\GetCompatiblePlatformGraph_Tests.cs (6)
354TransientTestFolder project1Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, firstProjectName), createFolder: true); 355TransientTestFolder project1SubFolder = testEnvironment.CreateFolder(Path.Combine(project1Folder.Path, firstProjectName), createFolder: true); 369TransientTestFolder project2Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, secondProjectName), createFolder: true); 370TransientTestFolder project2SubFolder = testEnvironment.CreateFolder(Path.Combine(project2Folder.Path, secondProjectName), createFolder: true); 380TransientTestFolder project3Folder = testEnvironment.CreateFolder(Path.Combine(folder.Path, thirdProjectName), createFolder: true); 381TransientTestFolder project3SubFolder = testEnvironment.CreateFolder(Path.Combine(project3Folder.Path, thirdProjectName), createFolder: true);
Graph\GraphTestingUtilities.cs (2)
169return Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath); 175return Path.GetFileNameWithoutExtension(config.ProjectFullPath);
Graph\IsolateProjects_Tests.cs (4)
142_env.SetTempPath(Path.Combine(Directory.GetCurrentDirectory(), Guid.NewGuid().ToString("N")), deleteTempDirectory: true); 452var directory = Path.GetDirectoryName(path); 453var file = Path.GetFileName(path); 455return Path.Combine("..", directory, file);
Graph\ProjectGraph_Tests.cs (10)
844string project1Path = Path.Combine(env.DefaultTestDirectory.Path, "Project1.csproj"); 845string project2Path = Path.Combine(env.DefaultTestDirectory.Path, "Project2.vcxproj"); 846string project3Path = Path.Combine(env.DefaultTestDirectory.Path, "Project3.vcxproj"); 847string project4Path = Path.Combine(env.DefaultTestDirectory.Path, "Project4.vcxproj"); 848string project5Path = Path.Combine(env.DefaultTestDirectory.Path, "Project5.vcxproj"); 849string project6Path = Path.Combine(env.DefaultTestDirectory.Path, "Project6.wapproj"); 850string project7Path = Path.Combine(env.DefaultTestDirectory.Path, "Project7.csproj"); 851string project8Path = Path.Combine(env.DefaultTestDirectory.Path, "Project8.csproj"); 2109var referenceNumbersSet = innerBuildWithCommonReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet(); 2115referenceNumbersSet = innerBuildWithAdditionalReferences.ProjectReferences.Select(r => Path.GetFileNameWithoutExtension(r.ProjectInstance.FullPath)).ToHashSet();
Graph\ResultCacheBasedBuilds_Tests.cs (2)
349var rootNode = topoSortedNodes.First(n => Path.GetFileNameWithoutExtension(n.ProjectInstance.FullPath) == "1"); 509private static string ProjectNumber(ProjectGraphNode node) => Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
Instance\ProjectInstance_Internal_Tests.cs (2)
73project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t0", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af0")); 74project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t1", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af1a"));
InvalidProjectFileException_Tests.cs (2)
30string file = Path.GetTempPath() + Guid.NewGuid().ToString("N"); 62string file = Path.GetTempPath() + Guid.NewGuid().ToString("N");
NetTaskHost_E2E_Tests.cs (10)
20private static string AssemblyLocation { get; } = Path.Combine(Path.GetDirectoryName(typeof(NetTaskHost_E2E_Tests).Assembly.Location) ?? AppContext.BaseDirectory); 22private static string TestAssetsRootPath { get; } = Path.Combine(AssemblyLocation, "TestAssets"); 37string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj"); 50var customTaskAssemblyLocation = Path.GetFullPath(Path.Combine(AssemblyLocation, "..", LatestDotNetCoreForMSBuild, "ExampleTask.dll")); 55Path.Combine(RunnerUtilities.BootstrapRootPath, "net472", "MSBuild", "Current", "Bin", "Microsoft.Build.dll"), 65string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTask", "TestNetTask.csproj"); 125string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestMSBuildTaskInNet", "TestMSBuildTaskInNet.csproj"); 144string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj");
NodeStatus_Transition_Tests.cs (2)
164Get-Content {{Path.Combine(directory, received)}} {{pipeline}} 167Get-Content {{Path.Combine(directory, verified)}} {{pipeline}}
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
ProjectCache\ProjectCacheTests.cs (9)
67private static readonly string s_samplePluginPath = Path.Combine( 77() => Path.Combine( 78Path.GetFullPath(s_samplePluginPath), 626var projectName = Path.GetFileNameWithoutExtension(projectPath); 656var projectName = Path.GetFileNameWithoutExtension(projectPath); 853private static int GetProjectNumber(string projectPath) => int.Parse(Path.GetFileNameWithoutExtension(projectPath)); 884itemResult.GetMetadata("File").ShouldBe(Path.GetFileName(projectPath)); 1735string bootstrapCorePath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", Constants.DotnetProcessName); 1738string appDllPath = Path.Combine(directory.Path, $"bin/{s_currentTargetNETFramework}/app.dll");
TerminalLogger_Tests.cs (4)
273var projectName = Path.GetFileNameWithoutExtension(projectFilePath); 274var outputPath = Path.ChangeExtension(projectFilePath, "dll"); 844RunnerUtilities.ExecMSBuild($"{projectFile.Path} /m /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success, outputHelper: _outputHelper); 848RunnerUtilities.ExecMSBuild($"{projectFile.Path} /m /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithoutTL.log")};verbosity=diagnostic", out success, outputHelper: _outputHelper);
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
TypeLoader_Dependencies_Tests.cs (9)
17private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "TaskWithDependency"); 27string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 33string dllPath = Path.Combine(dir.Path, TaskDllFileName); 45string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 48var newTaskDllPath = Path.Combine(tempDir, TaskDllFileName); 65var originalTaskDllPath = Path.Combine(originalDirectory, TaskDllFileName); 66var originalDependencyDllPath = Path.Combine(originalDirectory, DependencyDllFileName); 70var newTaskDllPath = Path.Combine(temporaryDirectory, TaskDllFileName); 71var newDependencyDllPath = Path.Combine(temporaryDirectory, DependencyDllFileName);
TypeLoader_Tests.cs (18)
21private static readonly string ProjectFileFolder = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "PortableTask"); 24private static string PortableTaskFolderPath = Path.GetFullPath( 25Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "..", "..", "..", "Samples", "PortableTask")); 67string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 75string dllPath = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, dllName); 84string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 90string dllPath = Path.Combine(dir.Path, DLLFileName); 104string newAssemblyLocation = Path.Combine(folder.Path, Path.GetFileName(currentAssembly)); 107string portableTaskPath = Path.Combine(Directory.GetDirectories(PortableTaskFolderPath).First(), "netstandard2.0", "OldMSBuild"); 108string utilities = Path.Combine(portableTaskPath, utilitiesName); 109File.Copy(utilities, Path.Combine(folder.Path, utilitiesName)); 123string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 124string originalDLLPath = Path.Combine(dir.Path, DLLFileName); 148string projectFilePath = Path.Combine(dir.Path, ProjectFileName); 149string originalDLLPath = Path.Combine(dir.Path, DLLFileName); 174var newDllPath = Path.Combine(temporaryDirectory, DLLFileName); 201var tempDirectoryPath = Path.GetDirectoryName(newDllPath);
Microsoft.Build.Framework (19)
Constants.cs (3)
132internal static readonly char[] DirectorySeparatorChar = [Path.DirectorySeparatorChar]; 136internal static readonly char[] PathSeparatorChar = [Path.PathSeparator]; 141internal static readonly char[] InvalidPathChars = Path.GetInvalidPathChars();
Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
FileClassifier.cs (7)
125RegisterImmutableDirectory(Path.Combine(programFiles, "Reference Assemblies", "Microsoft"), false); 158string processFileName = Path.GetFileNameWithoutExtension(processName); 181Path.GetDirectoryName(msBuildAssembly)?.EndsWith(@"\amd64", StringComparison.OrdinalIgnoreCase) == true 331return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 351return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 358fileSpec += Path.DirectorySeparatorChar;
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];
NativeMethods.cs (2)
890Path.GetDirectoryName(baseTypeLocation) 910dir = Path.GetDirectoryName(dir);
ProjectFinishedEventArgs.cs (1)
115RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(ProjectFile));
ProjectStartedEventArgs.cs (1)
543string? projectFilePath = Path.GetFileName(ProjectFile);
TargetFinishedEventArgs.cs (1)
182RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
Microsoft.Build.Framework.UnitTests (20)
FileClassifier_Tests.cs (15)
32classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}"); 33classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test2")}"); 35classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 36classifier.IsNonModifiable(Path.Combine(volume, "Test2", "File.ext")).ShouldBeTrue(); 37classifier.IsNonModifiable(Path.Combine(volume, "Test3", "File.ext")).ShouldBeFalse(); 49classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}"); 50classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test2")}"); 53classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 54classifier.IsNonModifiable(Path.Combine(volume, "Test2", "File.ext")).ShouldBeTrue(); 55classifier.IsNonModifiable(Path.Combine(volume, "Test3", "File.ext")).ShouldBeFalse(); 64classifier.RegisterImmutableDirectory($"{Path.Combine(volume, "Test1")}"); 68classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 69classifier.IsNonModifiable(Path.Combine(volume, "test1", "File.ext")).ShouldBeFalse(); 73classifier.IsNonModifiable(Path.Combine(volume, "Test1", "File.ext")).ShouldBeTrue(); 74classifier.IsNonModifiable(Path.Combine(volume, "test1", "File.ext")).ShouldBeTrue();
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
Microsoft.Build.Tasks.CodeAnalysis (27)
src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (3)
530string? tempDirectory = Path.GetTempPath(); 544var clientDirectory = Path.GetDirectoryName(PathToBuiltInTool); 850OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(Sources[0].ItemSpec));
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (5)
59internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); 70_useAppHost = useAppHost = File.Exists(Path.Combine(GetToolDirectory(), AppHostToolName)); 150return Path.Combine(ToolPath ?? "", ToolExe); 217return Path.Combine(buildTaskDirectory, "bincore"); 228var buildTaskDirectory = Path.GetDirectoryName(buildTask.Location);
src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (2)
85return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
src\Compilers\Core\MSBuildTask\Utilities.cs (2)
25=> string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 116path = Path.GetFullPath(path);
src\Compilers\Core\MSBuildTask\Vbc.cs (1)
304string actualPdb = Path.ChangeExtension(outputAssembly, ".pdb"); // This is the pdb that the compiler generated
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (27)
src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (3)
530string? tempDirectory = Path.GetTempPath(); 544var clientDirectory = Path.GetDirectoryName(PathToBuiltInTool); 850OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(Sources[0].ItemSpec));
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (5)
59internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); 70_useAppHost = useAppHost = File.Exists(Path.Combine(GetToolDirectory(), AppHostToolName)); 150return Path.Combine(ToolPath ?? "", ToolExe); 220? Path.Combine(buildTaskDirectory, "..", "bincore") 228var buildTaskDirectory = Path.GetDirectoryName(buildTask.Location);
src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (2)
85return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
src\Compilers\Core\MSBuildTask\Utilities.cs (2)
25=> string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 116path = Path.GetFullPath(path);
src\Compilers\Core\MSBuildTask\Vbc.cs (1)
304string actualPdb = Path.ChangeExtension(outputAssembly, ".pdb"); // This is the pdb that the compiler generated
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests (4)
SdkManagedToolTests.cs (3)
23var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; 28Path.Combine(taskPath, "..", "bincore", "csc.dll"), 29Path.Combine(taskPath, "..", "bincore", "csc.exe"),
src\Compilers\Core\MSBuildTaskTests\TestUtilities\IntegrationTestBase.cs (1)
39_msbuildExecutable = s_msbuildDirectory == null ? null : Path.Combine(s_msbuildDirectory, "MSBuild.exe");
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (85)
CopyRefAssemblyTests.cs (2)
35SourcePath = Path.Combine(dir.Path, "does_not_exist.dll") 66var dest = Path.Combine(dir.Path, "dest.dll");
CscTests.cs (9)
468csc.ToolExe = Path.Combine("path", "to", "custom_csc"); 471Assert.Equal(Path.Combine("path", "to", "custom_csc"), csc.GeneratePathToTool()); 474csc.ToolExe = Path.Combine("path", "to", "custom_csc"); 477Assert.Equal(Path.Combine("path", "to", "custom_csc"), csc.GeneratePathToTool()); 484csc.ToolPath = Path.Combine("path", "to", "custom_csc"); 488AssertEx.Equal(Path.Combine("path", "to", "custom_csc", $"csc{PlatformInformation.ExeExtension}"), csc.GeneratePathToTool()); 491csc.ToolPath = Path.Combine("path", "to", "custom_csc"); 494AssertEx.Equal(Path.Combine("path", "to", "custom_csc", $"csc{PlatformInformation.ExeExtension}"), csc.GeneratePathToTool()); 508Assert.Equal($@"/out:test.exe /analyzerconfig:.editorconfig /analyzerconfig:subdir\.editorconfig test.cs subdir{Path.DirectorySeparatorChar}test.cs", csc.GenerateResponseFileContents());
DotNetSdkTests.cs (36)
28var root1 = Path.GetFullPath(ProjectDir.Path + Path.DirectorySeparatorChar); 29var root2 = Path.GetFullPath(sourcePackageDir.Path + Path.DirectorySeparatorChar); 31root3 ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages"); 32root3 += Path.DirectorySeparatorChar; 38var sourceLinkJsonPath = Path.Combine(ObjDir.Path, ProjectName + ".sourcelink.json"); 54<SourceRoot Include=""{root1}sub1{Path.DirectorySeparatorChar}"" SourceControl=""git"" NestedRoot=""sub1"" ContainingRoot=""{root1}"" SourceLinkUrl=""https://raw.githubusercontent.com/M1/*""/> 55<SourceRoot Include=""{root1}sub2{Path.DirectorySeparatorChar}"" SourceControl=""git"" NestedRoot=""sub2"" ContainingRoot=""{root1}"" SourceLinkUrl=""https://raw.githubusercontent.com/M2/*""/> 100$@"{root1}sub1{Path.DirectorySeparatorChar}: /_/sub1/", 101$@"{root1}sub2{Path.DirectorySeparatorChar}: /_/sub2/", 140$@"{root1}sub1{Path.DirectorySeparatorChar}: {root1}sub1{Path.DirectorySeparatorChar}", 141$@"{root1}sub2{Path.DirectorySeparatorChar}: {root1}sub2{Path.DirectorySeparatorChar}", 150$@"[{root1}sub1{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M1/*]," + 151$@"[{root1}sub2{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M2/*]", 178$@"{root1}sub1{Path.DirectorySeparatorChar}: {root1}sub1{Path.DirectorySeparatorChar}", 179$@"{root1}sub2{Path.DirectorySeparatorChar}: {root1}sub2{Path.DirectorySeparatorChar}", 188$@"[{root1}sub1{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M1/*]," + 189$@"[{root1}sub2{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M2/*]", 216$@"{root1}sub1{Path.DirectorySeparatorChar}: {root1}sub1{Path.DirectorySeparatorChar}", 217$@"{root1}sub2{Path.DirectorySeparatorChar}: {root1}sub2{Path.DirectorySeparatorChar}", 226$@"[{root1}sub1{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M1/*]," + 227$@"[{root1}sub2{Path.DirectorySeparatorChar}]=[https://raw.githubusercontent.com/M2/*]", 347$"X{Path.DirectorySeparatorChar}", 348$"Y{Path.DirectorySeparatorChar}", 349$"Z{Path.DirectorySeparatorChar}", 432Path.Combine(ProjectDir.Path, ".editorconfig"), 493Path.Combine(ProjectDir.Path, ".editorconfig"), 528Path.Combine(ProjectDir.Path, ".editorconfig"), 653Path.Combine(ProjectDir.Path, ".editorconfig"),
GenerateMSBuildEditorConfigTests.cs (3)
246string executingLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)?.Replace('\\', '/') ?? string.Empty; 280string executingLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)?.Replace('\\', '/') ?? string.Empty; 362var fileName = Path.Combine(TempRoot.Root, "ConfigFileCanBeWrittenToDisk.GenerateMSBuildEditorConfig.editorconfig");
IntegrationTests.cs (3)
18return new DisposableFile(Path.Combine(directory.Path, resultFileName)); 23return ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path)); 520{ { "MyMSBuildToolsPath", Path.GetDirectoryName(typeof(IntegrationTests).Assembly.Location)! } });
MSBuildManagedToolTests.cs (3)
16var taskPath = Path.GetDirectoryName(typeof(ManagedCompiler).Assembly.Location)!; 18? Path.Combine("bincore", $"csc{PlatformInformation.ExeExtension}") 21Assert.Equal(Path.Combine(taskPath, relativePath), task.PathToBuiltInTool);
SdkIntegrationTests.cs (5)
46var dir = Path.GetDirectoryName(p)!; 47var targets = Path.Combine(dir, "Microsoft.CSharp.Core.targets"); 61var workingDirectory = Path.GetDirectoryName(projectFilePath)!; 84return Path.Combine(workingDirectory, "msbuild.binlog"); 123Assert.True(compilations[0].SyntaxTrees.Any(x => Path.GetFileName(x.FilePath) == "hello.cs"));
TargetTests.cs (3)
798var intermediatePath = intermediatePathDir + Path.DirectorySeparatorChar.ToString(); 903var path = Path.Combine(Path.GetDirectoryName(assembly.Location)!, "Microsoft.Managed.Core.targets");
TestUtilities\DotNetSdkTestBase.cs (19)
64=> Path.Combine(dotnetInstallDir, "sdk", version); 68DotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe"); 73=> dotnetDir != null && File.Exists(Path.Combine(dotnetDir, DotNetExeName)) && Directory.Exists(GetSdkPath(dotnetDir, DotNetSdkVersion)); 78dotnetInstallDir = Environment.GetEnvironmentVariable("PATH")?.Split(Path.PathSeparator).FirstOrDefault(isMatchingDotNetInstance); 98var filePath = Path.Combine(objDirectory, projectFileName + ".TestHelpers.g.props"); 116var filePath = Path.Combine(objDirectory, projectFileName + ".TestHelpers.g.targets"); 126<MakeDir Directories=""{Path.GetDirectoryName(outputFile)}"" /> 151DotNetPath = Path.Combine(DotNetInstallDir, DotNetExeName); 152var testBinDirectory = Path.GetDirectoryName(typeof(DotNetSdkTests).Assembly.Location) ?? string.Empty; 153var sdksDir = Path.Combine(DotNetSdkPath ?? string.Empty, "Sdks"); 174var csharpCoreTargets = Path.Combine(testBinDirectory, "Microsoft.CSharp.Core.targets"); 175var visualBasicCoreTargets = Path.Combine(testBinDirectory, "Microsoft.VisualBasic.Core.targets"); 196Assert.True(File.Exists(Path.Combine(ObjDir.Path, "project.assets.json"))); 197Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.props"))); 198Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.targets"))); 207var workingDirectory = Path.GetDirectoryName(projectFilePath)!; 210var projectFileName = Path.GetFileName(projectFilePath); 221var evaluationResultsFile = Path.Combine(OutDir.Path, "EvaluationResult.txt"); 227var testBinDirectory = Path.GetDirectoryName(typeof(DotNetSdkTests).Assembly.Location);
TestUtilities\IntegrationTestBase.cs (1)
39_msbuildExecutable = s_msbuildDirectory == null ? null : Path.Combine(s_msbuildDirectory, "MSBuild.exe");
VbcTests.cs (1)
448Assert.Equal(@$"/optionstrict:custom /out:test.exe /analyzerconfig:.editorconfig /analyzerconfig:subdir\.editorconfig test.vb subdir{Path.DirectorySeparatorChar}test.vb", vbc.GenerateResponseFileContents());
Microsoft.Build.Tasks.Core (393)
AddToWin32Manifest.cs (2)
139SaveManifest(document, Path.GetFileName(ApplicationManifest?.ItemSpec) ?? DefaultManifestName); 171ManifestPath = Path.Combine(OutputDirectory, manifestName);
AssemblyDependency\AssemblyInformation.cs (2)
97var newLocation = Path.Combine(Path.GetDirectoryName(location), nameParts[0].Trim() + ".dll");
AssemblyDependency\Node\RarNodeExecuteRequest.cs (2)
30rar.AppConfigFile = Path.GetFullPath(rar.AppConfigFile); 35rar.StateFile = Path.GetFullPath(rar.StateFile);
AssemblyDependency\Reference.cs (5)
445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference."); 538_directoryName = Path.GetDirectoryName(_fullPath); 558_fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_fullPath); 573_fullPathWithoutExtension = Path.Combine(DirectoryName, FileNameWithoutExtension);
AssemblyDependency\ReferenceTable.cs (17)
458if (!Path.IsPathRooted(assemblyFileName)) 460reference.FullPath = Path.GetFullPath(assemblyFileName); 508string simpleName = Path.GetFileNameWithoutExtension(assemblyFileName); 745pathRooted = Path.IsPathRooted(finalName); 883Path.GetExtension(itemSpec)); 943if (!String.IsNullOrEmpty(implementationFile) && Path.GetExtension(implementationFile) == ".dll") 945companionFile = Path.Combine(Path.GetDirectoryName(baseName), implementationFile); 982string cultureName = Path.GetFileName(subDirectory); 988string satelliteAssembly = Path.Combine(subDirectory, satelliteFilename); 992reference.AddSatelliteFile(Path.Combine(cultureName, satelliteFilename)); 1011string serializationAssemblyPath = Path.Combine(reference.DirectoryName, serializationAssemblyFilename); 2760ITaskItem item = new TaskItem(Path.Combine(reference.DirectoryName, satelliteFile)); 2764item.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile))); 2773ITaskItem item = new TaskItem(Path.Combine(reference.DirectoryName, serializationAssemblyFile)); 2784ITaskItem item = new TaskItem(Path.Combine(reference.DirectoryName, scatterFile)); 2821referenceItem.SetMetadata(ItemMetadataNames.winmdImplmentationFile, Path.GetFileName(reference.ImplementationAssembly));
AssemblyDependency\ResolveAssemblyReference.cs (1)
2892string fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName);
AssemblyDependency\Resolver.cs (5)
161string candidateBaseName = Path.GetFileNameWithoutExtension(pathToCandidateAssembly); 325fullPath = Path.Combine(directory, baseName); 372string weakNameBaseExtension = Path.GetExtension(weakNameBase); 373string weakNameBaseFileName = Path.GetFileNameWithoutExtension(weakNameBase); 381string fullPath = Path.Combine(directory, weakNameBase);
AssignTargetPath.cs (5)
55string fullRootPath = Path.GetFullPath(RootFolder); 91!Path.IsPathRooted(Files[i].ItemSpec) && 93!Files[i].ItemSpec.Contains("." + Path.DirectorySeparatorChar) && 107string itemSpecFullFileNamePath = Path.GetFullPath(Files[i].ItemSpec); 117targetPath = Path.GetFileName(Files[i].ItemSpec);
AxReference.cs (1)
92axImp.OutputAssembly = Path.Combine(OutputDirectory, GetWrapperFileName());
AxTlbBaseReference.cs (1)
193return Path.Combine(OutputDirectory, GetWrapperFileName());
BootstrapperUtil\BootstrapperBuilder.cs (27)
174string strOutputExe = System.IO.Path.Combine(settings.OutputPath, SETUP_EXE); 361string setupSourceFile = System.IO.Path.Combine(bootstrapperPath, SETUP_BIN); 430invariantPath = Util.AddTrailingChar(invariantPath, System.IO.Path.DirectorySeparatorChar); 453packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar))); 457string folder = System.IO.Path.GetDirectoryName(file); 503private string BootstrapperPath => System.IO.Path.Combine(Path, ENGINE_PATH); 505private string PackagePath => System.IO.Path.Combine(Path, PACKAGE_PATH); 507private string SchemaPath => System.IO.Path.Combine(Path, SCHEMA_PATH); 528string startDirectory = System.IO.Path.Combine(BootstrapperPath, RESOURCES_PATH); 535string resourceDirectory = System.IO.Path.Combine(startDirectory, subDirectory); 536string resourceFilePath = System.IO.Path.Combine(resourceDirectory, SETUP_RESOURCES_FILE); 606if (strSubDirectory[nStartIndex] == System.IO.Path.DirectorySeparatorChar) 880string strSubDirectoryFullPath = System.IO.Path.Combine(packagePath, strSubDirectory); 883string strBaseManifestFilename = System.IO.Path.Combine(strSubDirectoryFullPath, ROOT_MANIFEST_FILE); 884string strBaseManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 922UpdatePackageFileNodes(packageFilesNode, System.IO.Path.Combine(packagePath, strSubDirectory), strSubDirectory); 935string strLangManifestFilename = System.IO.Path.Combine(strLanguageDirectory, CHILD_MANIFEST_FILE); 936string strLangManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 967System.IO.Path.DirectorySeparatorChar) 1172string strSourceFile = System.IO.Path.Combine(strSourcePath, relativePath); 1176targetPathAttribute.Value = System.IO.Path.Combine(strTargetPath, relativePath); 1179string newNameValue = System.IO.Path.Combine(strTargetPath, relativePath); 1468string strDestinationFileName = System.IO.Path.Combine(settings.OutputPath, packageFileDestination.Value); 1477EnsureFolderExists(System.IO.Path.GetDirectoryName(strDestinationFileName)); 2000using (var xmlwriter = new XmlTextWriter(System.IO.Path.Combine(s_logPath, fileName), Encoding.UTF8)) 2042using (var fileWriter = new StreamWriter(System.IO.Path.Combine(s_logPath, fileName), append)) 2203string logPath = System.IO.Path.Combine(
BootstrapperUtil\ResourceUpdater.cs (1)
40string filePath = Path.Combine(Directory.GetCurrentDirectory(), filename);
BootstrapperUtil\Util.cs (1)
200string msbuildExtensionPackagesPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildExtensionsPath, BOOTSTRAPPER_MSBUILD_ADDITIONAL_PACKAGES_PATH);
BuildEnvironmentHelper.cs (9)
201var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 202var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 335.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 358string directory = Path.GetDirectoryName(msBuildAssembly); 415var processFileName = Path.GetFileNameWithoutExtension(processName); 614MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 620MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 625? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 683defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CodeTaskFactory.cs (2)
871Directory.CreateDirectory(Path.GetTempPath()); 885outputPath = Path.Combine(tempDirectory, fileName);
CombinePath.cs (1)
70combinedPath.ItemSpec = Path.Combine(BasePath, path.ItemSpec);
CommunicationsUtilities.cs (1)
1091string.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), EnvironmentUtilities.CurrentProcessId, nodeId), append: true))
ConvertToAbsolutePath.cs (1)
56if (!Path.IsPathRooted(path.ItemSpec))
Copy.cs (8)
283string destinationFolder = Path.GetDirectoryName(destinationFileState.Name); 776() => Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)), 803string srcName = Path.GetFileName(src); 814() => Path.Combine(src, file), 824() => Path.Combine(DestinationFolder.ItemSpec, srcName, file), 1095source.FileNameFullPath = Path.GetFullPath(source.Name); 1096destination.FileNameFullPath = Path.GetFullPath(destination.Name);
CreateCSharpManifestResourceName.cs (10)
164string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 165string directoryName = Path.GetDirectoryName(info.cultureNeutralFilename); 182manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 185manifestName.Replace(Path.DirectorySeparatorChar, '.'); 186manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 207manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 210manifestName.Replace(Path.DirectorySeparatorChar, '.'); 211manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 218manifestName.Insert(0, Path.DirectorySeparatorChar); 235string extension = Path.GetExtension(fileName);
CreateManifestResourceName.cs (8)
159string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 171isResxFile = Path.GetExtension(fileName) == resxFileExtension; 178string conventionDependentUpon = Path.ChangeExtension(Path.GetFileName(fileName), SourceFileExtension); 193if (FileSystems.Default.FileExists(Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon))) 217string pathToDependent = Path.Combine(Path.GetDirectoryName(fileName), dependentUpon);
CreateVisualBasicManifestResourceName.cs (5)
169string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 177manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 193manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 200manifestName.Insert(0, Path.DirectorySeparatorChar); 217string extension = Path.GetExtension(fileName);
Culture.cs (8)
40if (treatAsCultureNeutral || string.Equals(Path.GetFileNameWithoutExtension(parentName), 41Path.GetFileNameWithoutExtension(name), 55string baseFileNameWithCulture = Path.GetFileNameWithoutExtension(name); 58string cultureName = Path.GetExtension(baseFileNameWithCulture); 75string extension = Path.GetExtension(name); 76string baseFileName = Path.GetFileNameWithoutExtension(baseFileNameWithCulture); 77string baseFolder = Path.GetDirectoryName(name); 79info.cultureNeutralFilename = Path.Combine(baseFolder, fileName);
DebugUtils.cs (6)
44debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 48debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 110var extension = Path.GetExtension(fileName); 111var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 113var fullPath = Path.Combine(DebugPath, fileName); 119fullPath = Path.Combine(DebugPath, fileName);
DownloadFile.cs (2)
180var destinationFile = new FileInfo(Path.Combine(destinationDirectory.FullName, filename)); 326: Path.GetFileName(requestUri.LocalPath); // Otherwise attempt to get a file name from the URI
ErrorUtilities.cs (1)
178if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
378s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileIO\WriteLinesToFile.cs (1)
100var directoryPath = Path.GetDirectoryName(FileUtilities.NormalizePath(File.ItemSpec));
FileUtilities.cs (38)
77string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}"); 131internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 144cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 195string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 237fileSpec += Path.DirectorySeparatorChar; 277path.Substring(start) + Path.DirectorySeparatorChar); 370return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 400while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 492return NormalizePath(Path.Combine(directory, file)); 498return NormalizePath(Path.Combine(paths)); 517Path.HasExtension(uncheckedFullPath); 521return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 524return Path.GetFullPath(path); 566return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 704return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 716string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 728directory += Path.DirectorySeparatorChar; 775if (Path.HasExtension(fileName)) 797internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 812string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 826fullPath += Path.DirectorySeparatorChar; 890var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1200string fullBase = Path.GetFullPath(basePath); 1201string fullPath = Path.GetFullPath(path); 1210while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1241sb.Append("..").Append(Path.DirectorySeparatorChar); 1245sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1248if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1292return Path.IsPathRooted(FixFilePath(path)); 1338return paths.Aggregate(root, Path.Combine); 1366var separator = Path.DirectorySeparatorChar; 1510string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1524lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1544if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
FindAppConfigFile.cs (1)
124string filename = (matchWholeItemSpec ? item.ItemSpec : Path.GetFileName(item.ItemSpec));
FindInList.cs (1)
108string filename = (MatchFileNameOnly ? Path.GetFileName(path) : path);
GenerateApplicationManifest.cs (2)
233name = Path.GetFileName(item.ItemSpec); 393manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateDeploymentManifest.cs (1)
136manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateLauncher.cs (4)
54LauncherPath = Path.Combine( 67string entryPointFileName = Path.GetFileName(EntryPoint.ItemSpec); 101OutputEntryPoint = new TaskItem(Path.Combine(Path.GetDirectoryName(EntryPoint.ItemSpec), results.KeyFile));
GenerateManifestBase.cs (5)
182name = Path.GetFileNameWithoutExtension(entryPointIdentity.Name) + ".application"; 541file.TargetPath = Path.IsPathRooted(file.SourcePath) || file.SourcePath.StartsWith("..", StringComparison.Ordinal) ? Path.GetFileName(file.SourcePath) : file.SourcePath; 592string manifestFileName = Path.GetFileName(OutputManifest.ItemSpec); 628Util.WriteLog($"Total time to generate manifest '{Path.GetFileName(OutputManifest.ItemSpec)}': t={Environment.TickCount - _startTime}");
GenerateResource.cs (23)
570commandLineBuilder.AppendFileNameIfNotNull(Path.Combine(_resgenPath, "resgen.exe")); 961internetSecurityManager.MapUrlToZone(Path.GetFullPath(filename), out zone, 0); 970string extension = Path.GetExtension(filename); 1102_resgenPath = Path.GetDirectoryName(_resgenPath); 1155if (!_resgenPath.Equals(Path.GetDirectoryName(NativeMethodsShared.GetLongFilePath(ToolLocationHelper.GetPathToDotNetFrameworkSdkFile("resgen.exe", TargetDotNetFrameworkVersion.Version35))), StringComparison.OrdinalIgnoreCase)) 1522string extension = Path.GetExtension(sourceFilePath); 1750string extension = Path.GetExtension(source.ItemSpec); 2063OutputResources[i] = new TaskItem(Path.ChangeExtension(Sources[i].ItemSpec, ".resources")); 2540_assemblyNames[i] = new AssemblyNameExtension(Path.GetFileNameWithoutExtension(assemblyFile.ItemSpec)); 2670string priDirectory = Path.Combine(outFileOrDir ?? String.Empty, 2672currentOutputDirectory = Path.Combine(priDirectory, 2680currentOutputFile = Path.Combine(currentOutputDirectory, currentOutputFileNoPath); 2827return Path.GetFullPath(currentOutputFile); 2838currentOutputFile = Path.GetFullPath(currentOutputFile); 2848string shorterPath = Path.Combine(outputDirectory ?? String.Empty, cultureName ?? String.Empty); 2853currentOutputFile = Path.Combine(shorterPath, currentOutputFileNoPath); 2858currentOutputFile = Path.GetFullPath(currentOutputFile); 2909extension = Path.GetExtension(filename); 2939_logger.LogErrorWithCodeFromResources("GenerateResource.UnknownFileExtension", Path.GetExtension(filename), filename); 3007String fullPath = Path.GetFullPath(filename); 3008resXReader.BasePath = Path.GetDirectoryName(fullPath); 3433_stronglyTypedClassName = Path.GetFileNameWithoutExtension(outFile); 3498return Path.ChangeExtension(outputResourcesFile, provider.FileExtension);
GetSDKReferenceFiles.cs (12)
512string directory = Path.GetDirectoryName(reference.AssemblyLocation); 513string fileNameNoExtension = Path.GetFileNameWithoutExtension(reference.AssemblyLocation); 514string xmlFile = Path.Combine(directory, fileNameNoExtension + ".xml"); 553if (Path.GetExtension(file.RedistFile).Equals(".PRI", StringComparison.OrdinalIgnoreCase)) 578string fileExtension = Path.GetExtension(file); 630string targetPath = Path.Combine(targetPathRoot, relativeToBase); 731FileName = Path.GetFileNameWithoutExtension(assemblyLocation); 960referencesCacheFile = Path.Combine(_cacheFileDirectory, GetCacheFileName(saveContext.SdkIdentity, saveContext.SdkRoot, cacheFileInfo.Hash.ToString("X", CultureInfo.InvariantCulture))); 1030group reference by Path.GetDirectoryName(reference); 1085string referencesCacheFile = Path.Combine(cacheFileFolder, GetCacheFileName(sdkIdentity, sdkRoot, hash.ToString("X", CultureInfo.InvariantCulture))); 1165string redistPath = Path.Combine(sdkRoot, "Redist"); 1179string referencesPath = Path.Combine(sdkRoot, "References");
InstalledSDKResolver.cs (4)
60string referenceAssemblyFilePath = Path.Combine(sdkDirectory, "References", configuration, architecture); 61string referenceAssemblyCommonArchFilePath = Path.Combine(sdkDirectory, "References", "CommonConfiguration", architecture); 62string referenceAssemblyPathNeutral = Path.Combine(sdkDirectory, "References", configuration, "Neutral"); 63string referenceAssemblyArchFilePathNeutral = Path.Combine(sdkDirectory, "References", "CommonConfiguration", "Neutral");
LC.cs (1)
170outputPath = Path.Combine(OutputDirectory, outputPath);
ListOperators\FindUnderPath.cs (2)
62System.IO.Path.GetFullPath(FileUtilities.FixFilePath(Path.ItemSpec))); 83System.IO.Path.GetFullPath(FileUtilities.FixFilePath(item.ItemSpec)));
ManifestUtil\ApplicationManifest.cs (7)
432string outputFileName = Path.GetFileName(SourcePath); 630Path.GetFileNameWithoutExtension(assembly.TargetPath), 633OutputMessages.AddErrorMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath)); 738OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 749OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 759OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 766OutputMessages.AddWarningMessage("GenerateManifest.UnmanagedCodePermission", Path.GetFileNameWithoutExtension(path));
ManifestUtil\AssemblyIdentity.cs (2)
534string path = Path.Combine(searchPath, file); 541path = Path.Combine(searchPath, file);
ManifestUtil\AssemblyReferenceCollection.cs (1)
134String.Equals(identity.Name, System.IO.Path.GetFileNameWithoutExtension(a.SourcePath), StringComparison.OrdinalIgnoreCase))
ManifestUtil\BaseReference.cs (2)
54if (!Path.IsPathRooted(path)) 59return Path.GetFileName(path);
ManifestUtil\DeployManifest.cs (4)
181string redistListPath = Path.Combine(referenceAssemblyPath, _redistListFolder); 182return Path.Combine(redistListPath, _redistListFile); 581manifestPath = Path.Combine(Path.GetDirectoryName(SourcePath), _entryPoint.TargetPath);
ManifestUtil\LauncherBuilder.cs (3)
37string launcherFilename = Path.GetFileName(LauncherPath); 56string strOutputExe = System.IO.Path.Combine(outputPath, launcherFilename); 91EnsureFolderExists(Path.GetDirectoryName(strOutputExe));
ManifestUtil\Manifest.cs (14)
215defaultDir = Path.GetDirectoryName(_sourcePath); 218if (!Path.IsPathRooted(defaultDir)) 220defaultDir = Path.Combine(Directory.GetCurrentDirectory(), defaultDir); 312if (Path.IsPathRooted(path)) 329string resolvedPath = Path.Combine(searchPath, path); 330resolvedPath = Path.GetFullPath(resolvedPath); 512string fileName = Path.GetFileName(f.ResolvedPath); 518f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), f.TargetPath); 522f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), AssemblyName); 540f.TargetPath = BaseReference.GetDefaultTargetPath(Path.GetFileName(f.ResolvedPath)); 650Path.GetFileNameWithoutExtension(assembly.TargetPath), 653OutputMessages.AddWarningMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath));
ManifestUtil\ManifestReader.cs (2)
27string manifestFileName = Path.GetFileName(path); 97Util.WriteLogFile(Path.GetFileNameWithoutExtension(path) + ".embedded.xml", m);
ManifestUtil\ManifestWriter.cs (1)
133File.Copy(temp, Path.Combine(Util.logPath, n + ".trust-file.xml"), true);
ManifestUtil\PathUtil.cs (10)
23path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 24path = path.TrimEnd(Path.DirectorySeparatorChar); 38path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 39path = path.TrimEnd(Path.DirectorySeparatorChar); 81if (String.Equals(Path.GetExtension(path), ".application", StringComparison.Ordinal)) 86if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 156if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 239return Path.GetFullPath(path); // make sure it's a full path
ManifestUtil\SecurityUtil.cs (5)
177string path = Path.Combine(paths[0], PermissionSetsFolder); 192string fileInfoNoExt = Path.GetFileNameWithoutExtension(files[i]); 866toolPath = Path.Combine(pathToDotNetFrameworkSdk, "bin", ToolName); 875toolPath = Path.Combine(Directory.GetCurrentDirectory(), ToolName); 940return versionIndependentToolPath != null ? Path.Combine(versionIndependentToolPath, toolName) : null;
ManifestUtil\Util.cs (6)
112return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 268string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\VisualStudio\8.0\VSPLOG"); 429key = Path.GetFullPath(item.ItemSpec).ToUpperInvariant(); 477s_logFileWriter = new StreamWriter(Path.Combine(logPath, "Microsoft.Build.Tasks.log"), false); 508string path = Path.Combine(logPath, filename); 538string path = Path.Combine(logPath, filename);
ManifestUtil\XmlUtil.cs (1)
151if (!uri.LocalPath.StartsWith(Path.GetTempPath(), StringComparison.Ordinal))
Modifiers.cs (9)
214modifiedItemSpec = Path.GetPathRoot(fullPath); 223modifiedItemSpec += Path.DirectorySeparatorChar; 238modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 252modifiedItemSpec = Path.GetExtension(itemSpec); 367modifiedItemSpec = Path.Combine( 418if (!Path.IsPathRooted(path)) 451return Path.GetDirectoryName(path) == null; 464fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
Move.cs (3)
133destinationFile = Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)); 234string destinationFolder = Path.GetDirectoryName(destinationFile);
MSBuild.cs (2)
513projectDirectory[i] = Path.GetDirectoryName(projectPath); 642outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
NativeMethods.cs (5)
1245private static readonly string s_gacPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, "gac"); 1389var assemblyName = Path.GetFileName(dir); 1394var versionString = Path.GetFileName(version); 1459var path = Path.Combine(s_gacPath, assemblyNameVersion.Name); 1465path = Path.Combine(
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
RedistList.cs (3)
305string redistDirectory = Path.Combine(frameworkDirectory, RedistListFolder); 1083string subsetDirectory = Path.Combine(frameworkDirectory, subsetListFolder); 1090string subsetFilePath = Path.Combine(subsetDirectory, subsetName + ".xml");
RegisterAssembly.cs (1)
105tlbPath = Path.ChangeExtension(Assemblies[i].ItemSpec, ".tlb");
ResGen.cs (4)
286StronglyTypedClassName = Path.GetFileNameWithoutExtension(outputFile.ItemSpec); 484outputFiles[i] = new TaskItem(Path.ChangeExtension(inputFileAsITaskItem2.EvaluatedIncludeEscaped, ".resources")); 488outputFiles[i] = new TaskItem(Path.ChangeExtension(EscapingUtilities.Escape(inputFiles[i].ItemSpec), ".resources")); 508pathToTool = Path.Combine(ToolPath, ToolExe);
ResGenDependencies.cs (1)
293resxReader.BasePath = baseLinkedFileDirectory ?? Path.GetDirectoryName(filename);
ResolveCodeAnalysisRuleSet.cs (5)
80if (CodeAnalysisRuleSet == Path.GetFileName(CodeAnalysisRuleSet)) 86string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet); 98string fullName = Path.Combine(directory, CodeAnalysisRuleSet); 106else if (!Path.IsPathRooted(CodeAnalysisRuleSet)) 111string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet);
ResolveComReference.cs (5)
513_tlbimpPath = Path.GetDirectoryName(_tlbimpPath); 555_aximpPath = Path.GetDirectoryName(_aximpPath); 739if (!Path.IsPathRooted(refPath)) 741refPath = Path.Combine(Directory.GetCurrentDirectory(), refPath); 1167if (String.Equals(Path.GetFileName(ResolvedAssemblyReferences[i].ItemSpec), assemblyName, StringComparison.OrdinalIgnoreCase))
ResolveKeySource.cs (1)
101keyFileExtension = Path.GetExtension(KeyFile);
ResolveManifestFiles.cs (9)
291targetPath = Path.GetFileName(item.ItemSpec); 369targetPath = Path.GetFileName(item.ItemSpec); 377targetPath = Path.Combine(itemCulture.ToString(), targetPath); 510var outputAssembliesMap = outputAssemblies.ToDictionary(p => Path.GetFullPath(p.ItemSpec), StringComparer.OrdinalIgnoreCase); 522string key = Path.GetFullPath(item.ItemSpec); 584string fileExtension = Path.GetExtension(entry.item.ItemSpec); 860fusionName = Path.Combine(destSubDir, Path.GetFileNameWithoutExtension(item.ItemSpec)); 864fusionName = Path.GetFileNameWithoutExtension(item.ItemSpec);
ResolveNativeReference.cs (1)
296itemLooseEtcFile.SetMetadata(ItemMetadataNames.parentFile, Path.GetFileName(path));
ResolveSDKReference.cs (1)
1015_sdkManifestPath = Path.Combine(ResolvedPath, "SDKManifest.xml");
ResourceHandling\MSBuildResXReader.cs (1)
236fileName = Path.Combine(
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (5)
92private static readonly Lazy<string> ThisAssemblyDirectoryLazy = new Lazy<string>(() => Path.GetDirectoryName(typeof(RoslynCodeTaskFactory).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName)); 565string fullPath = Path.GetFullPath(reference); 577Path.Combine(ThisAssemblyDirectoryLazy.Value, ReferenceAssemblyDirectoryName), 580.FirstOrDefault(p => FileSystems.Default.FileExists(Path.Combine(p, assemblyFileName))); 584resolvedAssemblyReferences.Add(Path.Combine(resolvedDir, assemblyFileName));
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (2)
37() => Path.Combine(pathToBuildTools, "Roslyn", ToolName), 124if (!String.IsNullOrWhiteSpace(ToolExe) && Path.IsPathRooted(ToolExe))
SdkToolsPathUtility.cs (5)
63ProcessorArchitecture.ARM => Path.Combine(sdkToolsPath, "arm"), 64ProcessorArchitecture.AMD64 => Path.Combine(sdkToolsPath, "x64"), 65ProcessorArchitecture.IA64 => Path.Combine(sdkToolsPath, "ia64"), 68pathToTool = Path.Combine(processorSpecificToolDirectory, toolName); 75pathToTool = Path.Combine(sdkToolsPath, toolName);
SGen.cs (4)
173thisPath = Path.GetFullPath(_buildAssemblyPath); 246prunedAssemblyName = Path.GetFileNameWithoutExtension(BuildAssemblyName); 263return Path.Combine(BuildAssemblyPath, SerializationAssemblyName); 267private string AssemblyFullPath => Path.Combine(BuildAssemblyPath, BuildAssemblyName);
SystemState.cs (7)
459string filename = Path.GetFileName(path); 461foreach (AssemblyEntry a in redistList.FindAssemblyNameFromSimpleName(Path.GetFileNameWithoutExtension(path))) 463string pathFromRedistList = Path.Combine(a.FrameworkDirectory, filename); 583string fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(stateFile.ToString()), relativePath)); 607instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
TaskFactoryUtilities.cs (3)
138string? directory = Path.GetDirectoryName(assemblyPath); 253path = Path.Combine(directory, assemblyName.CultureName, assemblyName.Name + ".dll"); 261path = Path.Combine(directory, assemblyName.Name + ".dll");
TempFileUtilities.cs (7)
69path = Path.Combine(Path.GetTempPath(), $"{msbuildTempFolderPrefix}{Guid.NewGuid():N}"); 84string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 185string file = Path.Combine(directory, $"{fileName}{extension}"); 209string destFile = Path.Combine(dest, fileInfo.Name); 214string destDir = Path.Combine(dest, subdirInfo.Name); 231: System.IO.Path.Combine(TempFileDirectory, name);
TlbReference.cs (1)
180var fullPathToOutput = Path.GetFullPath(wrapperPath); // Current directory is the directory of the project file.
UnregisterAssembly.cs (1)
95cacheFile.AddEntry(Assemblies[i].ItemSpec, Path.ChangeExtension(Assemblies[i].ItemSpec, ".tlb"));
Unzip.cs (4)
163string fullDestinationDirectoryPath = Path.GetFullPath(FileUtilities.EnsureTrailingSlash(destinationDirectory.FullName)); 173string fullDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectory.FullName, zipArchiveEntry.FullName)); 180if (Path.GetFileName(destinationPath.FullName).Length == 0)
WindowsFileSystem.cs (3)
130var searchDirectoryPath = Path.Combine(directoryPath, "*"); 167result.Add(Path.Combine(directoryPath, findResult.CFileName)); 175Path.Combine(directoryPath, findResult.CFileName),
WinMDExp.cs (1)
217OutputWindowsMetadataFile = Path.ChangeExtension(WinMDModule, ".winmd");
WriteCodeFragment.cs (3)
109if (OutputFile != null && OutputDirectory != null && !Path.IsPathRooted(OutputFile.ItemSpec)) 111OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, OutputFile.ItemSpec)); 116FileUtilities.EnsureDirectoryExists(Path.GetDirectoryName(OutputFile.ItemSpec));
XamlTaskFactory\TaskParser.cs (2)
127isRootedPath = Path.IsPathRooted(contentOrFile); 130maybeFullPath = Path.GetFullPath(contentOrFile);
XamlTaskFactory\XamlTaskFactory.cs (3)
146Path.Combine(pathToMSBuildBinaries, "Microsoft.Build.Framework.dll"), 147Path.Combine(pathToMSBuildBinaries, "Microsoft.Build.Utilities.Core.dll"), 148Path.Combine(pathToMSBuildBinaries, "Microsoft.Build.Tasks.Core.dll")
Microsoft.Build.Tasks.UnitTests (1237)
AddToWin32Manifest_Tests.cs (8)
20private static string TestAssetsRootPath { get; } = Path.Combine( 21Path.GetDirectoryName(typeof(AddToWin32Manifest_Tests).Assembly.Location) ?? AppContext.BaseDirectory, 49task.ApplicationManifest = new TaskItem(Path.Combine(TestAssetsRootPath, manifestName)); 59string expectedManifest = Path.Combine(TestAssetsRootPath, $"{manifestName ?? "default.win32manifest"}_expected"); 109File.Copy(Path.Combine(TestAssetsRootPath, manifestName), Path.Combine(projectFolder.Path, manifestName)); 118byte[]? actualManifestBytes = AssemblyNativeResourceManager.GetResourceFromExecutable(Path.Combine(outputPath, "test.dll"), "#2", "#24"); 123string expectedManifest = Path.Combine(TestAssetsRootPath, $"{manifestName ?? "default.win32manifest"}_expected");
AssemblyDependency\Node\OutOfProcRarNode_Tests.cs (3)
39SearchPaths = [Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)], 78SearchPaths = [Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)], 104SearchPaths = [Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)],
AssemblyDependency\Node\RarNodeExecuteRequest_Tests.cs (2)
74Assert.Equal(Path.GetFullPath(AppConfigFileName), nodeRar.AppConfigFile); 75Assert.Equal(Path.GetFullPath(StateFileName), nodeRar.StateFile);
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (2)
27var tempPath = Path.GetTempPath(); 28_rarCacheFile = Path.Combine(tempPath, Guid.NewGuid() + ".UnitTest.RarCache");
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (228)
189protected static readonly string s_rootPathPrefix = NativeMethodsShared.IsWindows ? "C:\\" : Path.VolumeSeparatorChar.ToString(); 190protected static readonly string s_myProjectPath = Path.Combine(s_rootPathPrefix, "MyProject"); 192protected static readonly string s_myVersion20Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v2.0.MyVersion"); 193protected static readonly string s_myVersion40Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v4.0.MyVersion"); 194protected static readonly string s_myVersion90Path = Path.Combine(s_rootPathPrefix, "WINNT", "Microsoft.NET", "Framework", "v9.0.MyVersion"); 198protected static readonly string s_myMissingAssemblyAbsPath = Path.Combine(s_rootPathPrefix, "MyProject", "MyMissingAssembly.dll"); 199protected static readonly string s_myMissingAssemblyRelPath = Path.Combine("MyProject", "MyMissingAssembly.dll"); 200protected static readonly string s_myPrivateAssemblyRelPath = Path.Combine("MyProject", "MyPrivateAssembly.exe"); 202protected static readonly string s_frameworksPath = Path.Combine(s_rootPathPrefix, "Frameworks"); 204protected static readonly string s_myComponents2RootPath = Path.Combine(s_rootPathPrefix, "MyComponents2"); 205protected static readonly string s_myComponentsRootPath = Path.Combine(s_rootPathPrefix, "MyComponents"); 206protected static readonly string s_myComponents10Path = Path.Combine(s_myComponentsRootPath, "1.0"); 207protected static readonly string s_myComponents20Path = Path.Combine(s_myComponentsRootPath, "2.0"); 208protected static readonly string s_myComponentsMiscPath = Path.Combine(s_myComponentsRootPath, "misc"); 210protected static readonly string s_myComponentsV05Path = Path.Combine(s_myComponentsRootPath, "v0.5"); 211protected static readonly string s_myComponentsV10Path = Path.Combine(s_myComponentsRootPath, "v1.0"); 212protected static readonly string s_myComponentsV20Path = Path.Combine(s_myComponentsRootPath, "v2.0"); 213protected static readonly string s_myComponentsV30Path = Path.Combine(s_myComponentsRootPath, "v3.0"); 215protected static readonly string s_unifyMeDll_V05Path = Path.Combine(s_myComponentsV05Path, "UnifyMe.dll"); 216protected static readonly string s_unifyMeDll_V10Path = Path.Combine(s_myComponentsV10Path, "UnifyMe.dll"); 217protected static readonly string s_unifyMeDll_V20Path = Path.Combine(s_myComponentsV20Path, "UnifyMe.dll"); 218protected static readonly string s_unifyMeDll_V30Path = Path.Combine(s_myComponentsV30Path, "UnifyMe.dll"); 220protected static readonly string s_myComponents40ComponentPath = Path.Combine(s_myComponentsRootPath, "4.0Component"); 221protected static readonly string s_40ComponentDependsOnOnlyv4AssembliesDllPath = Path.Combine(s_myComponents40ComponentPath, "DependsOnOnlyv4Assemblies.dll"); 223protected static readonly string s_myLibrariesRootPath = Path.Combine(s_rootPathPrefix, "MyLibraries"); 224protected static readonly string s_myLibraries_V1Path = Path.Combine(s_myLibrariesRootPath, "v1"); 225protected static readonly string s_myLibraries_V2Path = Path.Combine(s_myLibrariesRootPath, "v2"); 226protected static readonly string s_myLibraries_V1_EPath = Path.Combine(s_myLibraries_V1Path, "E"); 228protected static readonly string s_myLibraries_ADllPath = Path.Combine(s_myLibrariesRootPath, "A.dll"); 229protected static readonly string s_myLibraries_BDllPath = Path.Combine(s_myLibrariesRootPath, "B.dll"); 230protected static readonly string s_myLibraries_CDllPath = Path.Combine(s_myLibrariesRootPath, "C.dll"); 231protected static readonly string s_myLibraries_TDllPath = Path.Combine(s_myLibrariesRootPath, "T.dll"); 233protected static readonly string s_myLibraries_V1_DDllPath = Path.Combine(s_myLibraries_V1Path, "D.dll"); 234protected static readonly string s_myLibraries_V1_E_EDllPath = Path.Combine(s_myLibraries_V1_EPath, "E.dll"); 235protected static readonly string s_myLibraries_V2_DDllPath = Path.Combine(s_myLibraries_V2Path, "D.dll"); 236protected static readonly string s_myLibraries_V1_GDllPath = Path.Combine(s_myLibraries_V1Path, "G.dll"); 237protected static readonly string s_myLibraries_V2_GDllPath = Path.Combine(s_myLibraries_V2Path, "G.dll"); 239protected static readonly string s_regress454863_ADllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "A.dll"); 240protected static readonly string s_regress454863_BDllPath = Path.Combine(s_rootPathPrefix, "Regress454863", "B.dll"); 242protected static readonly string s_regress444809RootPath = Path.Combine(s_rootPathPrefix, "Regress444809"); 243protected static readonly string s_regress444809_ADllPath = Path.Combine(s_regress444809RootPath, "A.dll"); 244protected static readonly string s_regress444809_BDllPath = Path.Combine(s_regress444809RootPath, "B.dll"); 245protected static readonly string s_regress444809_CDllPath = Path.Combine(s_regress444809RootPath, "C.dll"); 246protected static readonly string s_regress444809_DDllPath = Path.Combine(s_regress444809RootPath, "D.dll"); 248protected static readonly string s_regress444809_V2RootPath = Path.Combine(s_regress444809RootPath, "v2"); 249protected static readonly string s_regress444809_V2_ADllPath = Path.Combine(s_regress444809_V2RootPath, "A.dll"); 251protected static readonly string s_regress442570_RootPath = Path.Combine(s_rootPathPrefix, "Regress442570"); 252protected static readonly string s_regress442570_ADllPath = Path.Combine(s_regress442570_RootPath, "A.dll"); 253protected static readonly string s_regress442570_BDllPath = Path.Combine(s_regress442570_RootPath, "B.dll"); 255protected static readonly string s_myAppRootPath = Path.Combine(s_rootPathPrefix, "MyApp"); 256protected static readonly string s_myApp_V05Path = Path.Combine(s_myAppRootPath, "v0.5"); 257protected static readonly string s_myApp_V10Path = Path.Combine(s_myAppRootPath, "v1.0"); 258protected static readonly string s_myApp_V20Path = Path.Combine(s_myAppRootPath, "v2.0"); 259protected static readonly string s_myApp_V30Path = Path.Combine(s_myAppRootPath, "v3.0"); 261protected static readonly string s_netstandardLibraryDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandardlibrary.dll"); 262protected static readonly string s_netstandardDllPath = Path.Combine(s_rootPathPrefix, "NetStandard", "netstandard.dll"); 264protected static readonly string s_portableDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "Portable.dll"); 265protected static readonly string s_systemRuntimeDllPath = Path.Combine(s_rootPathPrefix, "SystemRuntime", "System.Runtime.dll"); 267protected static readonly string s_dependsOnNuGet_ADllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "A.dll"); 268protected static readonly string s_dependsOnNuGet_NDllPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.dll"); 269protected static readonly string s_dependsOnNuGet_NExePath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.exe"); 270protected static readonly string s_dependsOnNuGet_NWinMdPath = Path.Combine(s_rootPathPrefix, "DependsOnNuget", "N.winmd"); 272protected static readonly string s_nugetCache_N_Lib_NDllPath = Path.Combine(s_rootPathPrefix, "NugetCache", "N", "lib", "N.dll"); 274protected static readonly string s_assemblyFolder_RootPath = Path.Combine(s_rootPathPrefix, "AssemblyFolder"); 275protected static readonly string s_assemblyFolder_SomeAssemblyDllPath = Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.dll"); 376Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), 377Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), 378Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), 379Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), 380Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), 381Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), 382Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"), 383Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"), 384Path.Combine(s_myVersion20Path, "System.Data.dll"), 385Path.Combine(s_myVersion20Path, "System.Xml.dll"), 386Path.Combine(s_myVersion20Path, "System.Xml.pdb"), 387Path.Combine(s_myVersion20Path, "System.Xml.xml"), 388Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.dll"), 389Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.pdb"), 390Path.Combine(s_myVersion20Path, "en", "System.Xml.resources.config"), 391Path.Combine(s_myVersion20Path, "xx", "System.Xml.resources.dll"), 392Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.dll"), 393Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.pdb"), 394Path.Combine(s_myVersion20Path, "en-GB", "System.Xml.resources.config"), 395Path.Combine(s_rootPathPrefix, s_myPrivateAssemblyRelPath), 396Path.Combine(s_myProjectPath, "MyCopyLocalAssembly.dll"), 397Path.Combine(s_myProjectPath, "MyDontCopyLocalAssembly.dll"), 398Path.Combine(s_myVersion20Path, "BadImage.dll"), // An assembly that will give a BadImageFormatException from GetAssemblyName 399Path.Combine(s_myVersion20Path, "BadImage.pdb"), 400Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"), 401Path.Combine(s_myVersion20Path, "MyGacAssembly.pdb"), 402Path.Combine(s_myVersion20Path, "xx", "MyGacAssembly.resources.dll"), 403Path.Combine(s_myVersion20Path, "System.dll"), 404Path.Combine(s_myVersion40Path, "System.dll"), 405Path.Combine(s_myVersion90Path, "System.dll"), 406Path.Combine(s_myVersion20Path, "mscorlib.dll"), 407Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), 409Path.Combine(s_myProjectPath, "mscorlib.dll"), // This is an mscorlib.dll that has no metadata (i.e. GetAssemblyName returns null) 410Path.Combine(s_myProjectPath, "System.Data.dll"), // This is a System.Data.dll that has the wrong pkt, it shouldn't be matched. 411Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), // A vendor component that we should find in the registry. 429Path.Combine(s_myComponentsV30Path, "MyControlWithFutureTargetNDPVersion.dll"), // The future version of a component. 430Path.Combine(s_myComponentsV20Path, "MyControlWithFutureTargetNDPVersion.dll"), // The current version of a component. 431Path.Combine(s_myComponentsV10Path, "MyNDP1Control.dll"), // A control that only has an NDP 1.0 version 432Path.Combine(s_myComponentsV20Path, "MyControlWithPastTargetNDPVersion.dll"), // The current version of a component. 433Path.Combine(s_myComponentsV10Path, "MyControlWithPastTargetNDPVersion.dll"), // The past version of a component. 437Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), // A devices mscorlib. 454Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"), 502Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pdb"), 503Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.xml"), 504Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.pri"), 505Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.licenses"), 506Path.Combine(s_assemblyFolder_RootPath, "SomeAssembly.config"), 515Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), 516Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), 517Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), 518Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), 519Path.Combine(s_myAppRootPath, "DependsOnWeaklyNamedUnified.dll"), 520Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), 526Path.Combine(s_myComponentsMiscPath, "DependsOnOnlyv4Assemblies.dll"), // Only depends on 4.0.0 assemblies 527Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), // Is in redist list and is a 9.0 assembly 528Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), // Depends on 9.0 assemblies 529Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), // Depends on 9.0 assemblies 530Path.Combine(s_myComponents10Path, "DependsOn9.dll"), // Depends on 9.0 assemblies 531Path.Combine(s_myComponents20Path, "DependsOn9.dll"), // Depends on 9.0 assemblies 549Path.Combine(s_myComponentsRootPath, "V.dll"), 550Path.Combine(s_myComponents2RootPath, "W.dll"), 551Path.Combine(s_myComponentsRootPath, "X.dll"), 552Path.Combine(s_myComponentsRootPath, "X.pdb"), 553Path.Combine(s_myComponentsRootPath, "Y.dll"), 554Path.Combine(s_myComponentsRootPath, "Z.dll"), 556Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), 557Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), 652string baseDir = Path.GetDirectoryName(file); 656string fileExtension = Path.GetExtension(file); 762else if (fullPath.StartsWith(@"C:\DirectoryContains", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 766else if (fullPath.StartsWith(@"C:\WinMDArchVerification", StringComparison.OrdinalIgnoreCase) && Path.GetExtension(fullPath).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 858if (!Path.IsPathRooted(path)) 860path = Path.GetFullPath(path); 887Path.GetTempPath() 913Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx") 922Path.Combine(path, "en"), Path.Combine(path, "en-GB"), Path.Combine(path, "xx") 1052if (!Path.IsPathRooted(path)) 1054path = Path.GetFullPath(path); 1076String.Equals(path, Path.Combine(s_myVersion20Path, "BadImage.dll"), StringComparison.OrdinalIgnoreCase)) 1078throw new System.BadImageFormatException(@"The format of the file '" + Path.Combine(s_myVersion20Path, "BadImage.dll") + "' is invalid"); 1083String.Equals(path, Path.Combine(s_myProjectPath, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 1084|| String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 1085|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)) 1093String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 1094|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)) 1105if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1110if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1115if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1203if (String.Equals(path, Path.Combine(Path.GetTempPath(), @"RawFileNameRelative\System.Xml.dll"), StringComparison.OrdinalIgnoreCase)) 1208if (String.Equals(path, Path.Combine(Path.GetTempPath(), @"RelativeAssemblyFiles\System.Xml.dll"), StringComparison.OrdinalIgnoreCase)) 1213if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.XML.dll"), StringComparison.OrdinalIgnoreCase)) 1220if (String.Equals(path, Path.Combine(s_myProjectPath, "System.Xml.dll"), StringComparison.OrdinalIgnoreCase)) 1227if (String.Equals(path, Path.Combine(s_myProjectPath, "System.Data.dll"), StringComparison.OrdinalIgnoreCase)) 1233if (path.EndsWith(Path.Combine(s_myVersion20Path, "MyGacAssembly.dll"))) 1239if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 1245if (String.Equals(path, Path.Combine(s_myVersion40Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 1251if (String.Equals(path, Path.Combine(s_myVersion90Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 1259String.Equals(path, Path.Combine(s_myVersion20Path, "System.Data.dll"), StringComparison.OrdinalIgnoreCase)) 1300if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), StringComparison.OrdinalIgnoreCase)) 1305if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1320if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1325if (String.Equals(path, Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1330if (String.Equals(path, Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 1381if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), StringComparison.OrdinalIgnoreCase)) 1387if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 1393if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), StringComparison.OrdinalIgnoreCase)) 1398if (String.Equals(path, Path.Combine(s_myComponents10Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 1403if (String.Equals(path, Path.Combine(s_myComponents20Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 1438if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.pdb"), StringComparison.OrdinalIgnoreCase)) 1486if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "V.dll"), StringComparison.OrdinalIgnoreCase)) 1490if (String.Equals(path, Path.Combine(s_myComponents2RootPath, "W.dll"), StringComparison.OrdinalIgnoreCase)) 1494if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.dll"), StringComparison.OrdinalIgnoreCase)) 1499if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Z.dll"), StringComparison.OrdinalIgnoreCase)) 1504if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Y.dll"), StringComparison.OrdinalIgnoreCase)) 1509if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), StringComparison.OrdinalIgnoreCase)) 1514if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), StringComparison.OrdinalIgnoreCase)) 1781string defaultName = String.Format("{0}, Version=0.0.0.0, PublicKeyToken=null, Culture=Neutral", Path.GetFileNameWithoutExtension(path)); 1823if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1827else if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1831else if (String.Equals(path, Path.Combine(s_frameworksPath, "DependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1835else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1839else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1843else if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1858if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo4Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1866if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo45Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1874if (String.Equals(path, Path.Combine(s_frameworksPath, "IndirectDependsOnFoo35Framework.dll"), StringComparison.OrdinalIgnoreCase)) 1996if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2092String.Equals(path, Path.Combine(s_myVersion20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase) 2093|| String.Equals(path, Path.Combine(s_myVersionPocket20Path, "mscorlib.dll"), StringComparison.OrdinalIgnoreCase)) 2103if (String.Equals(path, Path.Combine(s_myAppRootPath, "DependsOnSimpleA.dll"), StringComparison.OrdinalIgnoreCase)) 2151if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "MyGrid.dll"), StringComparison.OrdinalIgnoreCase)) 2212if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnWeaklyNamedUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2220if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnEverettSystem.dll"), StringComparison.OrdinalIgnoreCase)) 2228if (String.Equals(path, Path.Combine(s_myApp_V05Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2236if (String.Equals(path, Path.Combine(s_myApp_V10Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2244if (String.Equals(path, Path.Combine(s_myApp_V20Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2252if (String.Equals(path, Path.Combine(s_myApp_V30Path, "DependsOnUnified.dll"), StringComparison.OrdinalIgnoreCase)) 2276if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "ReferenceVersion9.dll"), StringComparison.OrdinalIgnoreCase)) 2286if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 2296if (String.Equals(path, Path.Combine(s_myComponentsMiscPath, "DependsOn9Also.dll"), StringComparison.OrdinalIgnoreCase)) 2304if (String.Equals(path, Path.Combine(s_myComponents10Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 2312if (String.Equals(path, Path.Combine(s_myComponents20Path, "DependsOn9.dll"), StringComparison.OrdinalIgnoreCase)) 2345if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "V.dll"), StringComparison.OrdinalIgnoreCase)) 2353if (String.Equals(path, Path.Combine(s_myComponents2RootPath, "W.dll"), StringComparison.OrdinalIgnoreCase)) 2358if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "X.dll"), StringComparison.OrdinalIgnoreCase)) 2366if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Z.dll"), StringComparison.OrdinalIgnoreCase)) 2371if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Y.dll"), StringComparison.OrdinalIgnoreCase)) 2379if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "Microsoft.Build.dll"), StringComparison.OrdinalIgnoreCase)) 2384if (String.Equals(path, Path.Combine(s_myComponentsRootPath, "DependsOnMSBuild12.dll"), StringComparison.OrdinalIgnoreCase)) 2392if (String.Equals(path, Path.Combine(s_myVersion20Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2401if (String.Equals(path, Path.Combine(s_myVersion40Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2410if (String.Equals(path, Path.Combine(s_myVersion90Path, "System.dll"), StringComparison.OrdinalIgnoreCase)) 2989string tempPath = Path.GetTempPath(); 2990string redistListPath = Path.Combine(tempPath, Guid.NewGuid() + ".xml"); 2991string rarCacheFile = Path.Combine(tempPath, Guid.NewGuid() + ".RarCache");
AssemblyDependency\SuggestedRedirects.cs (2)
206warningMessage.ShouldContain(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.FourSpaceIndent", ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.ReferenceDependsOn", "D, Version=1.0.0.0, CulTUre=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa", Path.Combine(s_myLibraries_V1Path, "D.dll")))); 251warningMessage.ShouldContain(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.FourSpaceIndent", ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("ResolveAssemblyReference.ReferenceDependsOn", "D, Version=1.0.0.0, CulTUre=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa", Path.Combine(s_myLibraries_V1Path, "D.dll"))));
AssignLinkMetadata_Tests.cs (9)
20private readonly string _defaultItemSpec = Path.Combine(Path.GetTempPath(), "SubFolder", "a.cs"); 80Assert.Equal(Path.Combine("SubFolder", "a.cs"), t.OutputItems[0].GetMetadata("Link")); 107Assert.Equal(Path.Combine("SubFolder", "a.cs"), t.OutputItems[0].GetMetadata("Link")); 116ITaskItem item = GetParentedTaskItem(_defaultItemSpec, Path.Combine("SubFolder2", "SubSubFolder", "a.cs")); 137? Path.Combine("//subfolder/a.cs") 158ITaskItem item = new TaskItem(Path.Combine("SubFolder", "a.cs")); 179FullPath = Path.Combine(Path.GetTempPath(), "a.proj")
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (2)
65string projectImportsZipPath = Path.ChangeExtension(binlog.Path, ".ProjectImports.zip"); 117string projectImportsZipPath = Path.ChangeExtension(binlog.Path, ".ProjectImports.zip");
CombinePath_Tests.cs (9)
26t.BasePath = Path.Combine("abc", "def"); 28string fullPath1 = Path.Combine(t.BasePath, path1); 29string path2 = Path.Combine("jkl", "mno.txt"); 30string fullPath2 = Path.Combine(t.BasePath, path2); 46t.BasePath = Path.Combine("abc", "def"); 77string path1 = Path.DirectorySeparatorChar + Path.Combine("ghi", "jkl.txt"); 78string path2 = Path.Combine("mno", "qrs.txt"); 79string fullPath2 = Path.Combine(t.BasePath, path2);
Copy_Tests.cs (96)
223Directory.Exists(Path.Combine(destinationFolder.Path, "source0")).ShouldBeTrue(); 224Directory.Exists(Path.Combine(destinationFolder.Path, "source1")).ShouldBeTrue(); 952string destinationFolder = Path.Combine(Path.GetTempPath(), "2A333ED756AF4dc392E728D0F874A398"); 953string destination1 = Path.Combine(destinationFolder, Path.GetFileName(source1)); 954string destination2 = Path.Combine(destinationFolder, Path.GetFileName(source2)); 1304string sourceFile = Path.GetTempPath(); 1353string destinationFile = Path.GetTempFileName(); 1354string sourceFile = Path.GetTempFileName(); 1522string destinationFile = Path.GetTempPath(); 1568string temp = Path.GetTempPath(); 1569string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A392"); 1570string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A393"); 1572string validOutFile = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A394"); 1656string temp = Path.GetTempPath(); 1657string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395"); 1728string file = Path.Combine(currdir, filename); 1779string temp = Path.GetTempPath(); 1780string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395"); 1781string invalidFile = NativeMethodsShared.IsUnixLike ? Path.Combine(temp, "!@#$%^&*()|") : "!@#$%^&*()|"; 1844string temp = Path.GetTempPath(); 1845string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 1846string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 1914string sourceFileEscaped = Path.GetTempPath() + "a%253A_" + Guid.NewGuid().ToString("N") + ".txt"; 1916string temp = Path.GetTempPath(); 1917string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 1918string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 1976string tempPath = Path.GetTempPath(); 1980new TaskItem(Path.Combine(tempPath, "a.cs")), 1981new TaskItem(Path.Combine(tempPath, "b.cs")), 1982new TaskItem(Path.Combine(tempPath, "a.cs")), 1983new TaskItem(Path.Combine(tempPath, "a.cs")), 2001DestinationFolder = new TaskItem(Path.Combine(tempPath, "foo")), 2020filesActuallyCopied.Select(f => Path.GetFileName(f.Key.Name)).ShouldBe(new[] { "a.cs", "b.cs" }, ignoreOrder: true); 2033string tempPath = Path.GetTempPath(); 2037new TaskItem(Path.Combine(tempPath, "a.cs")), 2038new TaskItem(Path.Combine(tempPath, "b.cs")), 2039new TaskItem(Path.Combine(tempPath, "a.cs")), 2040new TaskItem(Path.Combine(tempPath, "a.cs")), 2041new TaskItem(Path.Combine(tempPath, "a.cs")), 2054new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs 2055new TaskItem(Path.Combine(tempPath, @"xa.cs")), // b.cs -> xa.cs should copy because it's a different source 2056new TaskItem(Path.Combine(tempPath, @"xb.cs")), // a.cs -> xb.cs should copy because it's a different destination 2057new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs should copy because it's a different source from the b.cs copy done previously 2058new TaskItem(Path.Combine(tempPath, @"xa.cs")), // a.cs -> xa.cs should not copy because it's the same source 2087string xaPath = Path.Combine(tempPath, "xa.cs"); 2090Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[0].Key.Name); 2091Assert.Equal(Path.Combine(tempPath, "b.cs"), xaCopies[1].Key.Name); 2092Assert.Equal(Path.Combine(tempPath, "a.cs"), xaCopies[2].Key.Name); 2094string xbPath = Path.Combine(tempPath, "xb.cs"); 2097Assert.Equal(Path.Combine(tempPath, "a.cs"), xbCopies[0].Key.Name); 2110string temp = Path.GetTempPath(); 2111string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2112string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A399"); 2113string outFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A400"); 2548string temp = Path.GetTempPath(); 2549string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2550string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2619string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2620string destFile1 = Path.Combine(destFolder, Path.GetFileName(sourceFile1)); 2621string destFile2 = Path.Combine(destFolder, Path.GetFileName(sourceFile2)); 2626string nothingFile = Path.Combine(destFolder, "nothing.txt"); 2722string temp = Path.GetTempPath(); 2723string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2724string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2751string destLink = Path.Combine(destFolder, Path.GetFileNameWithoutExtension(sourceFile) + "." + n); 2804string temp = Path.GetTempPath(); 2805string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2806string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2870string temp = Path.GetTempPath(); 2871string destFolder = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 2872string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 2940string destFile = Path.Combine(destFolder.Path, "The Destination"); 2984Path.Combine(Path.GetDirectoryName(sourceFile2.Path), ".", Path.GetFileName(sourceFile2.Path))) // sourceFile2.Path with a "." inserted before the file name 3098string tempPath = Path.GetTempPath(); 3099string tempDir = Path.Combine(tempPath, "CopyTestDir" + Guid.NewGuid().ToString("N")); 3106string outputDir = Path.Combine(tempDir, "bin", "Debug", "net10.0"); 3110string lowercaseDir = Path.Combine(outputDir, "cs"); 3114string sourceDir = Path.Combine(tempDir, "CS", "obj", "Debug", "net10.0"); 3117string sourceFile1 = Path.Combine(sourceDir, "apphost"); 3118string sourceFile2 = Path.Combine(sourceDir, "app.dll"); 3123string destFile1 = Path.Combine(outputDir, "CS"); 3124string destFile2 = Path.Combine(outputDir, "app.dll");
CreateCSharpManifestResourceName_Tests.cs (6)
424env.SetCurrentDirectory(Path.GetDirectoryName(resourceFile.Path)); 492ITaskItem i = new TaskItem(Path.GetFileName(resXFile.Path)); 498env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 557ITaskItem i = new TaskItem(Path.GetFileName(resXFile.Path)); 563env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path)); 599env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.Path));
CreateItem_Tests.cs (5)
173ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 178ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Foo.txt")); 179ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("Destination", "Subdir", "Bar.txt")); 203ObjectModelHelpers.CreateFileInTempProjectDirectory(Path.Combine("Subdir", "Bar.txt"), "bar"); 214result.ResultsByTarget["Repro"].Items[0].GetMetadata("RecursiveDir").ShouldBe("Subdir" + Path.DirectorySeparatorChar);
DirectoryBuildProjectImportTestBase.cs (2)
25private readonly string _projectRelativePath = Path.Combine("src", "foo", "foo.csproj"); 177Assert.Equal(Path.Combine(ObjectModelHelpers.TempProjectDir, DirectoryBuildProjectFile), project.GetPropertyValue(DirectoryBuildProjectPathPropertyName));
DownloadFile_Tests.cs (3)
77FileInfo file = new FileInfo(Path.Combine(folder.Path, "foo.txt")); 122FileInfo file = new FileInfo(Path.Combine(folder.Path, filename)); 156FileInfo file = new FileInfo(Path.Combine(folder.Path, filename));
Exec_Tests.cs (13)
63string tempPath = Path.GetTempPath(); 121string tempPath = Path.GetTempPath(); 335string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 372string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 410string newTmp = Path.Combine(FileUtilities.TempFileDirectory, directoryWithAmpersand); 447string newTmp = Path.Combine(Path.GetTempPath(), directoryWithAmpersand); 579string folder = Path.Combine(Path.GetTempPath(), includeNonAnsiInCommand ? nonAnsiCharacters : ansiCharacters); 580string command = Path.Combine(folder, "test.cmd"); 1006string tempPath = Path.GetTempPath();
FileStateTests.cs (12)
95var state = new FileState(Path.GetTempPath()); 333Assert.Equal(new FileInfo(Path.GetTempPath()).Exists, new FileState(Path.GetTempPath()).FileExists); 334Assert.True(new FileState(Path.GetTempPath()).IsDirectory); 340Assert.Equal(new FileInfo(Path.GetTempPath()).IsReadOnly, new FileState(Path.GetTempPath()).IsReadOnly); 346Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTime, new FileState(Path.GetTempPath()).LastWriteTime); 352Assert.Equal(new FileInfo(Path.GetTempPath()).LastWriteTimeUtc, new FileState(Path.GetTempPath()).LastWriteTimeUtcFast); 358Helpers.VerifyAssertThrowsSameWay(delegate () { var x = new FileInfo(Path.GetTempPath()).Length; }, delegate () { var x = new FileState(Path.GetTempPath()).Length; });
FormatUrl_Tests.cs (1)
77t.OutputUrl.ShouldBe(new Uri(Path.Combine(Environment.CurrentDirectory, t.InputUrl)).AbsoluteUri);
GenerateBindingRedirects_Tests.cs (1)
268TransientTestFolder testFolder = env.CreateFolder(Path.Combine(rootTestFolder.Path, "\uD873\uDD02\u9FA8\u82D8\u722B\u9EA4\u03C5\u33D1\uE038\u486B\u0033"));
GetFileHash_Tests.cs (1)
57Files = new[] { new TaskItem(Path.Combine(AppContext.BaseDirectory, "this_does_not_exist.txt")) },
GetInstalledSDKLocations_Tests.cs (52)
47string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory"); 52Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0" })); 54Path.Combine(new[] { tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0" })); 56Path.Combine(new[] { tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0" })); 58Path.Combine( 62Path.Combine( 66Path.Combine( 72Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "v1.1" })); 75Directory.CreateDirectory(Path.Combine(tempPath, "Windows", "v3.0") + Path.DirectorySeparatorChar); 79Path.Combine(tempPath, "Windows", "NotAVersion") + Path.DirectorySeparatorChar); 83Path.Combine( 90Path.Combine(new[] { tempPath, "Doors", "2.0", "ExtensionSDKs", "MyAssembly", "3.0" })); 92Path.Combine( 98Directory.CreateDirectory(Path.Combine(tempPath, "Walls" + Path.DirectorySeparatorChar + "1.0" + Path.DirectorySeparatorChar)); 99File.WriteAllText(Path.Combine(tempPath, "Walls", "1.0", "SDKManifest.xml"), "Hello"); 115string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory2"); 120Path.Combine(new[] { tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "4.0" })); 122Path.Combine(new[] { tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "5.0" })); 124Path.Combine(new[] { tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "6.0" })); 126Path.Combine( 130Path.Combine( 134Path.Combine( 343Path.Combine( 345+ Path.DirectorySeparatorChar, 349Path.Combine( 351+ Path.DirectorySeparatorChar, 355Path.Combine( 357+ Path.DirectorySeparatorChar, 362Path.Combine( 364+ Path.DirectorySeparatorChar, 368Path.Combine( 370+ Path.DirectorySeparatorChar, 374Path.Combine( 376+ Path.DirectorySeparatorChar, 417Path.Combine( 419+ Path.DirectorySeparatorChar, 423Path.Combine( 425+ Path.DirectorySeparatorChar, 429Path.Combine( 431+ Path.DirectorySeparatorChar, 436Path.Combine( 438+ Path.DirectorySeparatorChar, 442Path.Combine( 444+ Path.DirectorySeparatorChar, 448Path.Combine( 450+ Path.DirectorySeparatorChar,
GetSDKReference_Tests.cs (107)
50string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "FakeSDKForReferenceAssemblies"); 51sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 52string referenceAssemblyDirectoryConfigx86 = Path.Combine(sdkDirectory, "References\\Retail\\X86"); 53string referenceAssemblyDirectoryConfigx64 = Path.Combine(sdkDirectory, "References\\Retail\\X64"); 54string referenceAssemblyDirectoryConfigNeutral = Path.Combine(sdkDirectory, "References\\Retail\\Neutral"); 55string referenceAssemblyDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\Neutral"); 56string referenceAssemblyDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\X86"); 57string referenceAssemblyDirectoryCommonConfigX64 = Path.Combine(sdkDirectory, "References\\CommonConfiguration\\X64"); 59string redistDirectoryConfigx86 = Path.Combine(sdkDirectory, "Redist\\Retail\\X86"); 60string redistDirectoryConfigx64 = Path.Combine(sdkDirectory, "Redist\\Retail\\X64"); 61string redistDirectoryConfigNeutral = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 62string redistDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 63string redistDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\X86"); 64string redistDirectoryCommonConfigX64 = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\X64"); 66string designTimeDirectoryConfigx86 = Path.Combine(sdkDirectory, "DesignTime\\Retail\\X86"); 67string designTimeDirectoryConfigNeutral = Path.Combine(sdkDirectory, "DesignTime\\Retail\\Neutral"); 68string designTimeDirectoryCommonConfigNeutral = Path.Combine(sdkDirectory, "DesignTime\\CommonConfiguration\\Neutral"); 69string designTimeDirectoryCommonConfigX86 = Path.Combine(sdkDirectory, "DesignTime\\CommonConfiguration\\X86"); 84Directory.CreateDirectory(Path.Combine(redistDirectoryConfigNeutral, "ASubDirectory\\TwoDeep")); 94string testWinMD = Path.Combine(referenceAssemblyDirectoryConfigx86, "A.winmd"); 95string testWinMD64 = Path.Combine(referenceAssemblyDirectoryConfigx64, "A.winmd"); 96string testWinMDNeutral = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "B.winmd"); 97string testWinMDNeutralWinXML = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "B.xml"); 98string testWinMDCommonConfigurationx86 = Path.Combine(referenceAssemblyDirectoryCommonConfigX86, "C.winmd"); 99string testWinMDCommonConfigurationx64 = Path.Combine(referenceAssemblyDirectoryCommonConfigX64, "C.winmd"); 100string testWinMDCommonConfigurationNeutral = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "D.winmd"); 101string testWinMDCommonConfigurationNeutralDupe = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "A.winmd"); 103string testRA = Path.Combine(referenceAssemblyDirectoryConfigx86, "E.dll"); 104string testRA64 = Path.Combine(referenceAssemblyDirectoryConfigx64, "E.dll"); 105string testRANeutral = Path.Combine(referenceAssemblyDirectoryConfigNeutral, "F.dll"); 106string testRACommonConfigurationx86 = Path.Combine(referenceAssemblyDirectoryCommonConfigX86, "G.dll"); 107string testRACommonConfigurationx64 = Path.Combine(referenceAssemblyDirectoryCommonConfigX64, "G.dll"); 108string testRACommonConfigurationNeutral = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "H.dll"); 110string testRACommonConfigurationNeutralDupe = Path.Combine(referenceAssemblyDirectoryCommonConfigNeutral, "A.dll"); 112string redist = Path.Combine(redistDirectoryConfigx86, "A.dll"); 113string redist64 = Path.Combine(redistDirectoryConfigx64, "A.dll"); 114string redistNeutral = Path.Combine(redistDirectoryConfigNeutral, "ASubDirectory\\TwoDeep\\B.dll"); 115string redistNeutralPri = Path.Combine(redistDirectoryConfigNeutral, "B.pri"); 116string redistCommonConfigurationx86 = Path.Combine(redistDirectoryCommonConfigX86, "C.dll"); 117string redistCommonConfigurationx64 = Path.Combine(redistDirectoryCommonConfigX64, "C.dll"); 118string redistCommonConfigurationNeutral = Path.Combine(redistDirectoryCommonConfigNeutral, "D.dll"); 119string redistCommonConfigurationNeutralDupe = Path.Combine(redistDirectoryCommonConfigNeutral, "A.dll"); 154string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "FakeSDKForReferenceAssemblies"); 155sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\AnotherSDK\\2.0\\"); 156string referenceAssemblyDirectoryConfigx86 = Path.Combine(sdkDirectory, "References\\Retail\\X86"); 157string redistDirectoryConfigx86 = Path.Combine(sdkDirectory, "Redist\\Retail\\X86"); 165string testWinMD = Path.Combine(referenceAssemblyDirectoryConfigx86, "B.winmd"); 166string redist = Path.Combine(redistDirectoryConfigx86, "B.pri"); 167string redist2 = Path.Combine(redistDirectoryConfigx86, "B.dll"); 190private readonly string _cacheDirectory = Path.Combine(Path.GetTempPath(), "GetSDKReferenceFiles"); 299Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[0]); 300Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[1]); 305Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[0]); 306Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[1]); 311Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\X86\\"), sdkFolders[0]); 312Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\Retail\\Neutral\\"), sdkFolders[1]); 313Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\X86\\"), sdkFolders[2]); 314Assert.Equal(Path.Combine(sdkDirectory, folderName + "\\CommonConfiguration\\Neutral\\"), sdkFolders[3]); 433string winmd = Path.Combine(_sdkDirectory, "References\\Retail\\X86\\A.winmd"); 436Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true); 445Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true); 454Assert.Equal("A.winmd", Path.GetFileName(t.CopyLocalFiles[0].ItemSpec), true); 463Assert.Equal("E.dll", Path.GetFileName(t.CopyLocalFiles[5].ItemSpec), true); 472Assert.Equal("B.xml", Path.GetFileName(t.CopyLocalFiles[2].ItemSpec)); 557Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec), true); 566Assert.Equal("B.winmd", Path.GetFileName(t.References[1].ItemSpec), true); 575Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec), true); 684Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec)); 691Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec)); 730Assert.Equal("A.dll", Path.GetFileName(t.References[0].ItemSpec), true); 737Assert.Equal("h.dll", Path.GetFileName(t.References[4].ItemSpec), true); 826Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec)); 835Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec)); 878Assert.Equal("A.winmd", Path.GetFileName(t.References[0].ItemSpec)); 887Assert.Equal("E.dll", Path.GetFileName(t.References[4].ItemSpec)); 963Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec)); 969Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true); 975Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[2].ItemSpec), true); 981Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[3].ItemSpec), true); 987Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[4].ItemSpec), true); 1236string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\B.pri"); 1237string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.pri"); 1238string referenceWinner = Path.Combine(_sdkDirectory, "References\\Retail\\Neutral\\B.WinMD"); 1239string referenceVictim = Path.Combine(_sdkDirectory2, "References\\Retail\\X86\\B.WinMD"); 1282string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\ASubDirectory\\TwoDeep\\B.dll"); 1283string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.dll"); 1325string redistWinner = Path.Combine(_sdkDirectory, "Redist\\Retail\\Neutral\\B.pri"); 1326string redistVictim = Path.Combine(_sdkDirectory2, "Redist\\Retail\\X86\\B.pri"); 1327string referenceWinner = Path.Combine(_sdkDirectory, "References\\Retail\\Neutral\\B.WinMD"); 1328string referenceVictim = Path.Combine(_sdkDirectory2, "References\\Retail\\X86\\B.WinMD"); 1369Assert.Equal("A.dll", Path.GetFileName(t.RedistFiles[0].ItemSpec), true); 1375Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[1].ItemSpec), true); 1381Assert.Equal("B.dll", Path.GetFileName(t.RedistFiles[2].ItemSpec), true); 1387Assert.Equal("B.pri", Path.GetFileName(t.RedistFiles[3].ItemSpec), true); 1393Assert.Equal("B.PRI", Path.GetFileName(t.RedistFiles[4].ItemSpec), true); 1399Assert.Equal("C.dll", Path.GetFileName(t.RedistFiles[5].ItemSpec), true); 1405Assert.Equal("D.dll", Path.GetFileName(t.RedistFiles[6].ItemSpec), true); 1414if (Path.GetFileName(path).Equals("C.winmd", StringComparison.OrdinalIgnoreCase)) 1419if (Path.GetExtension(path).Equals(".winmd", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase)) 1421string fileName = Path.GetFileNameWithoutExtension(path); 1430if (Path.GetFileName(path).Equals("A.winmd", StringComparison.OrdinalIgnoreCase)) 1434if (Path.GetExtension(path).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 1439if (Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase))
MakeDir_Tests.cs (12)
24string temp = Path.GetTempPath(); 25string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A391"); 65string temp = Path.GetTempPath(); 66string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38e"); 67string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38f"); 69string dir2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A390"); 128string temp = Path.GetTempPath(); 129string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38C"); 174string temp = Path.GetTempPath(); 175string dir = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38C"); 233string temp = Path.GetTempPath(); 234string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A38d");
Move_Tests.cs (15)
419string temp = Path.GetTempPath(); 420string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A392"); 421string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A393"); 423string validOutFile = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A394"); 594string file = Path.Combine(currdir, filename); 635string temp = Path.GetTempPath(); 636string file = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A395"); 680string temp = Path.GetTempPath(); 681string destFolder = Path.Combine(temp, "2A333ED756AF4d1392E728D0F864A398"); 682string destFile = Path.Combine(destFolder, Path.GetFileName(sourceFile)); 734string temp = Path.GetTempPath(); 735string inFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A398"); 736string inFile2 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A399"); 737string outFile1 = Path.Combine(temp, "2A333ED756AF4dc392E728D0F864A400");
MSBuild_Tests.cs (8)
47Directory.SetCurrentDirectory(Path.GetTempPath()); 62string fileName = Path.GetFileName(tempProject); 70int rootLength = Path.GetPathRoot(tempProject).Length; 401Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "ConsoleApplication1.csproj"), $@" 441Path.Combine("bug'533'369", "Sub;Dir", "ConsoleApplication1", "Program.cs"), @" 464Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), @" 482ObjectModelHelpers.BuildTempProjectFileExpectSuccess(Path.Combine("bug'533'369", "Sub;Dir", "TeamBuild.proj"), logger); 484ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(Path.Combine("bug'533'369", "Sub;Dir", "binaries", "ConsoleApplication1.exe"));
MSBuildInternalMessage_Tests.cs (1)
157var targetPathParameter = expectedResourceName == "CommonSdk.DeploymentUnpublishable" ? "" : Path.Combine(project.DirectoryPath, "bin", "test.txt");
NativeMethodsShared_Tests.cs (2)
118string nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz"); 125nonexistentDirectory = $"{Path.Combine(currentDirectory, "foo", "bar", "baz")}{Guid.NewGuid()}";
NuGetPropsImportTests.cs (4)
39var projectRelativePath = Path.Combine("src", "foo1", "foo1.csproj"); 65var projectRelativePath = Path.Combine("src", "foo1", "foo1.csproj"); 66var nugetPropsRelativePath = Path.Combine(Path.GetDirectoryName(projectRelativePath), NuGetPropsProjectFile);
OutputPathTests.cs (5)
23private readonly string _projectRelativePath = Path.Combine("src", "test", "test.csproj"); 80var baseOutputPath = Path.Combine("build", "bin"); 118var baseOutputPath = Path.Combine("build", "bin"); 119var outputPath = Path.Combine("bin", "Debug"); 120var outputPathAlt = Path.Combine("bin", "Release");
PortableTasks_Tests.cs (5)
21private static readonly string PortableTaskFolderPath = Path.GetFullPath( 22Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, 51var projFile = Path.Combine(folder, ProjectFileName); 59File.Copy(file.FullName, Path.Combine(folder, file.Name)); 60_outputHelper.WriteLine($"Copied {file.FullName} to {Path.Combine(folder, file.Name)}");
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
ProjectExtensionsImportTestBase.cs (5)
18protected readonly string _projectRelativePath = Path.Combine("src", "foo", "foo.csproj"); 151string projectExtensionsDirectory = Path.Combine(ObjectModelHelpers.TempProjectDir, Path.GetDirectoryName(ImportProjectPath)); 156project.GetPropertyValue("MSBuildProjectExtensionsPath").ShouldBe($@"{projectExtensionsDirectory}{Path.DirectorySeparatorChar}"); 174<MSBuildProjectExtensionsPath>{Path.GetDirectoryName(CustomImportProjectPath)}</MSBuildProjectExtensionsPath>
ProjectExtensionsPropsImportTest.cs (5)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props"); 17protected override string ImportProjectPath => Path.Combine(Path.GetDirectoryName(_projectRelativePath), "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.props");
ProjectExtensionsTargetsImportTest.cs (5)
15protected override string CustomImportProjectPath => Path.Combine(ObjectModelHelpers.TempProjectDir, "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets"); 17protected override string ImportProjectPath => Path.Combine(Path.GetDirectoryName(_projectRelativePath), "obj", $"{Path.GetFileName(_projectRelativePath)}.custom.targets");
RARPrecomputedCache_Tests.cs (8)
31{ Path.Combine(standardCache.Path, "assembly1"), new SystemState.FileState(now) }, 32{ Path.Combine(standardCache.Path, "assembly2"), new SystemState.FileState(now) { Assembly = new Shared.AssemblyNameExtension("hi") } } }; 75string dllName = Path.Combine(Path.GetDirectoryName(standardCache.Path), "randomFolder", "dll.dll"); 116string dllName = Path.Combine(Path.GetDirectoryName(precomputedCache.Path), "randomFolder", "dll.dll"); 118{ Path.Combine(precomputedCache.Path, "..", "assembly1", "assembly1"), new SystemState.FileState(DateTime.Now) }, 119{ Path.Combine(precomputedCache.Path, "assembly2"), new SystemState.FileState(DateTime.Now) { Assembly = new Shared.AssemblyNameExtension("hi") } },
RegressionTests.cs (1)
57var expectedCompileItems = "a.cs;" + Path.Combine("obj", "Debug", ".NETFramework,Version=v4.8.AssemblyAttributes.cs");
ResolveAssemblyReference_CustomCultureTests.cs (9)
26private static string TestAssetsRootPath { get; } = Path.Combine( 27Path.GetDirectoryName(typeof(AddToWin32Manifest_Tests).Assembly.Location) ?? AppContext.BaseDirectory, 51var projectBFolder = Path.Combine(solutionPath, projectBName); 53var projBContent = File.ReadAllText(Path.Combine(testAssetsPath, projectBName)) 57env.CreateFile(Path.Combine(projectBFolder, projectBName), projBContent); 75var yueCultureResourceDll = Path.Combine(projBOutputPath, "yue", "ProjectA.resources.dll"); 78var euyCultureResourceDll = Path.Combine(projBOutputPath, "euy", "ProjectA.resources.dll"); 97var sourcePath = Path.Combine(sourceFolder, fileName); 99File.Copy(sourcePath, Path.Combine(destinationFolder, fileName));
ResolveCodeAnalysisRuleSet_Tests.cs (20)
78string codeAnalysisRuleSet = Path.Combine(Path.GetTempPath(), @"CodeAnalysis.ruleset"); 122string projectDirectory = Path.GetTempPath(); 128string ruleSetFullPath = Path.Combine(projectDirectory, codeAnalysisRuleSet); 150string projectDirectory = Path.GetTempPath(); 151string codeAnalysisRuleSet = Path.GetRandomFileName() + ".ruleset"; 173var directory = Path.GetTempPath(); 179string ruleSetFullPath = Path.Combine(directory, codeAnalysisRuleSet); 201string directory = Path.GetTempPath(); 203task.CodeAnalysisRuleSet = Path.GetRandomFileName() + ".ruleset"; 224string subdirectoryName = Path.GetRandomFileName(); 225string projectDirectory = Path.GetTempPath(); 227task.CodeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset"); 248string subdirectoryName = Path.GetRandomFileName(); 249string codeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset"); 250string projectDirectory = Path.GetTempPath(); 256string ruleSetFullPath = Path.Combine(projectDirectory, codeAnalysisRuleSet); 258using (new TemporaryDirectory(Path.GetDirectoryName(ruleSetFullPath))) 279string subdirectoryName = Path.GetRandomFileName(); 280task.CodeAnalysisRuleSet = Path.Combine(subdirectoryName, "CodeAnalysis.ruleset");
ResolveNonMSBuildProjectOutput_Tests.cs (44)
137projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 143projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 145projectOutputs, true, Path.Combine("obj", "correct.dll")); 149projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 150projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 151projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 157projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 158projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 159projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 160projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 162projectOutputs, true, Path.Combine("obj", "correct.dll")); 224projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-000000000000}", Path.Combine("obj", "managed.dll")); 225projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "unmanaged.dll")); 227TestUnresolvedReferencesHelper(projectRefs, projectOutputs, path => (path == Path.Combine("obj", "managed.dll")), out unresolvedOutputs, out resolvedOutputs); 230Assert.True(resolvedOutputs.Contains(Path.Combine("obj", "managed.dll"))); 231Assert.True(resolvedOutputs.Contains(Path.Combine("obj", "unmanaged.dll"))); 232Assert.Equal("true", ((ITaskItem)resolvedOutputs[Path.Combine("obj", "managed.dll")]).GetMetadata("ManagedAssembly")); 233Assert.NotEqual("true", ((ITaskItem)resolvedOutputs[Path.Combine("obj", "unmanaged.dll")]).GetMetadata("ManagedAssembly")); 250projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 251projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 252projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 265projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 266projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 267projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 268projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 273Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll"))); 279projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 280projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 281projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 282projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 283projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-000000000000}", Path.Combine("obj", "correct2.dll")); 288Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll"))); 289Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct2.dll"))); 294projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 295projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 296projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 307projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 308projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 309projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll")); 310projectOutputs.Add("{2F6BBCC3-7111-4116-A68B-34CFC76F37C5}", Path.Combine("obj", "correct.dll")); 316Assert.True(resolvedOutputs.ContainsKey(Path.Combine("obj", "correct.dll"))); 321projectOutputs.Add("{11111111-1111-1111-1111-111111111111}", Path.Combine("obj", "wrong.dll")); 322projectOutputs.Add("{11111111-1111-1111-1111-111111111112}", Path.Combine("obj", "wrong2.dll")); 323projectOutputs.Add("{11111111-1111-1111-1111-111111111113}", Path.Combine("obj", "wrong3.dll"));
ResolveSDKReference_Tests.cs (299)
123string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "TestMaxPlatformVersionWithTargetFrameworkVersion"); 124string testDirectory = Path.Combine(new[] { testDirectoryRoot, "MyPlatform", "8.0", "ExtensionSDKs", "SDkWithManifest", "2.0" }) + Path.DirectorySeparatorChar; 176string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 462string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyDependsOnWarningFromManifest"); 463string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 484string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 577string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit1"); 578string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 588string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 632string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit2"); 633string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 643string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 690string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit3"); 691string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 701string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 745string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit4"); 746string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 756string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 800string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit5"); 801string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 811string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 855string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit6"); 856string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 866string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 912string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit7"); 913string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 923string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 967string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit8"); 968string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 977string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1021string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "Prefer32bit9"); 1022string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1032string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1491string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SDKFoundButBadlyFormattedSDKManifestWarnings"); 1492string testDirectory = Path.Combine(testDirectoryRoot, "BadTestSDK", "2.0") + Path.DirectorySeparatorChar; 1498string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1550string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SDKFoundButBadlyFormattedSDKManifestErrors"); 1551string testDirectory = Path.Combine(testDirectoryRoot, "BadTestSDK\\2.0\\"); 1557string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1601string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "TestMaxPlatformVersionWithTargetFrameworkVersion"); 1602string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1654string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1707string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "EmptySDKManifestAttributes"); 1708string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1734string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1792string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestAttributes"); 1793string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1816string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1890string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigAndArch"); 1891string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1911string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 1963string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigOnly"); 1964string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 1982string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2032string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "NoCopyOnPlatformIdentityFound"); 2033string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2047string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2099string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GoodManifestMatchingConfigOnly"); 2100string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2120string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2173string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ManifestOnlyHasArmLocation"); 2174string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2189string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2241string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ManifestArmLocationWithOthers"); 2242string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2259string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2312string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MatchNoNamesButNamesExistWarning"); 2313string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2330string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2384string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MatchNoNamesButNamesExistError"); 2385string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2402string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2453string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SingleSupportedArchitectureMatchesProject"); 2454string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2472string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2526string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ProductFamilySetInManifest"); 2527string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2546string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2591string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ProductFamilySetInManifestAndMetadata"); 2592string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2611string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2658string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsNotInManifest"); 2659string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2678string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2722string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsBadMetadata"); 2723string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2743string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2790string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilySameName"); 2791string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 2792string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 2793string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "3.0") + Path.DirectorySeparatorChar; 2821string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2822string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 2823string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 2888string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilyDiffName"); 2889string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 2890string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK1", "2.0") + Path.DirectorySeparatorChar; 2891string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "3.0") + Path.DirectorySeparatorChar; 2919string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 2920string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 2921string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 2986string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameProductFamilyDiffName"); 2987string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 2988string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK2", "2.0") + Path.DirectorySeparatorChar; 2989string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "3.0") + Path.DirectorySeparatorChar; 2990string testDirectory4 = Path.Combine(testDirectoryRoot, "GoodTestSDK3", "4.0") + Path.DirectorySeparatorChar; 3024string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3025string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 3026string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 3027string sdkManifestFile4 = Path.Combine(testDirectory4, "SDKManifest.xml"); 3099string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "ConflictsBetweenSameSDKName"); 3100string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "1.0") + Path.DirectorySeparatorChar; 3101string testDirectory2 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3102string testDirectory3 = Path.Combine(testDirectoryRoot, "GoodTestSDK", "3.0") + Path.DirectorySeparatorChar; 3130string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3131string sdkManifestFile2 = Path.Combine(testDirectory2, "SDKManifest.xml"); 3132string sdkManifestFile3 = Path.Combine(testDirectory3, "SDKManifest.xml"); 3205string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SupportsMultipleVersionsVerifyManifestReading"); 3206string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3226string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3279string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadata"); 3280string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3300string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3356string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadataButMetadataDoesNotMatch"); 3357string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3376string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3422string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "OverrideManifestWithMetadata"); 3423string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3444string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3500string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "SingleSupportedArchitectureDoesNotMatchProject"); 3501string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3520string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3564string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MultipleSupportedArchitectureMatchesProject"); 3565string testDirectory = Path.Combine(testDirectoryRoot, "GoodTestSDK", "2.0") + Path.DirectorySeparatorChar; 3583string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3636string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "MultipleSupportedArchitectureMatchesProject"); 3638Path.Combine(new[] { testDirectoryRoot, "MyPlatform", "8.0", "ExtensionSDKs", "SDkWithManifest", "2.0" }) 3639+ Path.DirectorySeparatorChar; 3657string sdkManifestFile = Path.Combine(testDirectory, "SDKManifest.xml"); 3704string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsWithFramework"); 3705string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 3706string archRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86"); 3707string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 3708string archCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86"); 3709string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 3711string sdkDirectory3 = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\FrameworkSDkWithManifest\\2.0\\"); 3712string archRedist3 = Path.Combine(sdkDirectory3, "Redist\\Retail\\x64"); 3713string archRedist33 = Path.Combine(sdkDirectory3, "Redist\\Retail\\Neutral"); 3714string archCommonRedist3 = Path.Combine(sdkDirectory3, "Redist\\CommonConfiguration\\x64"); 3785string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 3786string sdkManifestFile2 = Path.Combine(sdkDirectory3, "SDKManifest.xml"); 3787string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3794string redist1 = Path.Combine(archRedist, "A.dll"); 3795string redist2 = Path.Combine(neutralRedist, "B.dll"); 3796string redist3 = Path.Combine(archCommonRedist, "C.dll"); 3797string redist4 = Path.Combine(neutralCommonRedist, "D.dll"); 3798string redist5 = Path.Combine(archRedist33, "A.dll"); 3799string redist6 = Path.Combine(archCommonRedist3, "B.dll"); 3847string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsWithFramework"); 3848string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 3849string archRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86"); 3850string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 3851string archCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86"); 3852string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 3854string sdkDirectory3 = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\FrameworkSDkWithManifest\\2.0\\"); 3855string archRedist3 = Path.Combine(sdkDirectory3, "Redist\\Retail\\x64"); 3856string archRedist33 = Path.Combine(sdkDirectory3, "Redist\\Retail\\Neutral"); 3857string archCommonRedist3 = Path.Combine(sdkDirectory3, "Redist\\CommonConfiguration\\x64"); 3926string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 3927string sdkManifestFile2 = Path.Combine(sdkDirectory3, "SDKManifest.xml"); 3928string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3935string redist1 = Path.Combine(archRedist, "A.dll"); 3936string redist2 = Path.Combine(neutralRedist, "B.dll"); 3937string redist3 = Path.Combine(archCommonRedist, "C.dll"); 3938string redist4 = Path.Combine(neutralCommonRedist, "D.dll"); 3939string redist5 = Path.Combine(archRedist3, "D.dll"); 3940string redist6 = Path.Combine(archRedist33, "A.dll"); 3941string redist7 = Path.Combine(archCommonRedist3, "B.dll"); 3991string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "GatherSDKOutputGroupsTargetArchitectureDoesNotExists"); 3992string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 3993string x86Redist = Path.Combine(sdkDirectory, "Redist\\Retail\\x86"); 3994string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 3995string x86CommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\x86"); 3996string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 4043string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 4044string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 4050string redist1 = Path.Combine(x86CommonRedist, "A.dll"); 4051string redist2 = Path.Combine(x86Redist, "B.dll"); 4052string redist3 = Path.Combine(neutralRedist, "C.dll"); 4053string redist4 = Path.Combine(neutralCommonRedist, "D.dll"); 4100string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "CheckDefaultingOfTargetConfigAndArchitecture"); 4101string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 4102string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 4103string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 4145string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml"); 4146string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 4151string redist1 = Path.Combine(neutralRedist, "B.dll"); 4152string redist2 = Path.Combine(neutralCommonRedist, "C.dll"); 4200new Dictionary<string, ITaskItem>() { { "sdkName, Version=1.0.2", new TaskItem(Path.GetTempFileName(), new Dictionary<string, string>() { { "PlatformVersion", "1.0.2" } }) } }, 4220string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "CheckDefaultingOfTargetConfigAndArchitecture"); 4221string sdkDirectory = Path.Combine(testDirectoryRoot, "MyPlatform\\v8.0\\ExtensionSDKs\\SDkWithManifest\\2.0\\"); 4222string neutralRedist = Path.Combine(sdkDirectory, "Redist\\Retail\\Neutral"); 4223string neutralCommonRedist = Path.Combine(sdkDirectory, "Redist\\CommonConfiguration\\Neutral"); 4284string redist1 = Path.Combine(neutralRedist, "B.dll"); 4285string redist2 = Path.Combine(neutralCommonRedist, "C.dll"); 4292string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 4295string sdkManifestFile = Path.Combine(sdkDirectory, "SDKManifest.xml");
ResourceHandling\GenerateResource_Tests.cs (126)
73Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 75Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 112string expectedOutFile0 = Path.Combine(Path.GetTempPath(), Path.ChangeExtension(resxFile0, ".resources")); 113string expectedOutFile1 = Path.Combine(Path.GetTempPath(), "resx1.foo.resources"); 114string expectedOutFile2 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources")); 115string expectedOutFile3 = Path.Combine(Path.GetTempPath(), Utilities.GetTempFileName(".resources")); 161Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 163Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 210Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 246t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".resx")) }; 248Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec)); 253t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".txt")) }; 255Assert.Equal(".txt", Path.GetExtension(t2a.FilesWritten[0].ItemSpec)); 262Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec)); 296string outputFile = Path.ChangeExtension(resourcesFile, ".txt"); 301Assert.Equal(".txt", Path.GetExtension(resourcesFile)); 333Path.GetExtension(resourceOutput).ShouldBe(".resources"); 334Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources"); 410Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources"); 411Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources"); 528string outputResource = Path.ChangeExtension(Path.GetFullPath(resxFile), ".resources"); 631Path.GetExtension(t.OutputResources[0].ItemSpec).ShouldBe(".resources"); 632Path.GetExtension(t.FilesWritten[0].ItemSpec).ShouldBe(".resources"); 746Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 748Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 798resourcesFile1 = Path.ChangeExtension(resxFile, ".resources"); 799resourcesFile2 = Path.ChangeExtension(txtFile, ".resources"); 1034t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(textFile, ".resx")) }; 1039Assert.Equal(".resx", Path.GetExtension(resourcesFile)); 1067t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resourcesFile, ".resx")) }; 1069Assert.Equal(".resx", Path.GetExtension(t.FilesWritten[0].ItemSpec)); 1074t2a.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(t.FilesWritten[0].ItemSpec, ".resources")) }; 1076Assert.Equal(".resources", Path.GetExtension(t2a.FilesWritten[0].ItemSpec)); 1084Assert.Equal(".resx", Path.GetExtension(t2b.FilesWritten[0].ItemSpec)); 1120Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1131Assert.Equal(".txt", Path.GetExtension(resourcesFile)); 1167string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec); 1169Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1171Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1174string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1230string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec); 1232Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1234Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1238string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1271Assert.Equal(t2.FilesWritten[2].ItemSpec, Path.ChangeExtension(t2.Sources[0].ItemSpec, ".cs")); 1309strFile = Path.ChangeExtension(resourcesFile, ".cs"); // STR filename should be generated from output not input filename 1321string stronglyTypedClassName = Path.GetFileNameWithoutExtension(resourcesFile); 1324Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1415Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1417Assert.Equal(".resources", Path.GetExtension(t.FilesWritten[0].ItemSpec)); 1474string stronglyTypedFileName = Path.ChangeExtension(t.Sources[0].ItemSpec, ".vb"); 1478Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1480Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1534Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1536Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1541string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1546Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec)); 1592Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1594Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 1599string STRfile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs"); 1604Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec)); 1763resourcesFile1 = Path.ChangeExtension(resxFile1, ".resources"); 1764resourcesFile2 = Path.ChangeExtension(resxFile2, ".resources"); 1840resourcesFile1 = Path.ChangeExtension(resxFile1, ".resources"); 1841resourcesFile2 = Path.ChangeExtension(resxFile2, ".resources"); 1939t.OutputResources = new ITaskItem[] { new TaskItem(Path.ChangeExtension(resxFile, ".txt")) }; 1975Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 2049string resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 2100string resourcesFile = Path.ChangeExtension(textFile, ".resources"); 2140string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2231string resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 2265string outputFile = Path.ChangeExtension(t.Sources[i].ItemSpec, ".resources"); 2342File.Delete(Path.ChangeExtension(taskItem.ItemSpec, ".resources")); 2351string outputFile = Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources"); 2354outputFile = Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources"); 2358outputFile = Path.ChangeExtension(t.Sources[2].ItemSpec, ".resources"); 2361outputFile = Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources"); 2366Assert.Equal(t.FilesWritten[0].ItemSpec, Path.ChangeExtension(t.Sources[0].ItemSpec, ".resources")); 2367Assert.Equal(t.FilesWritten[1].ItemSpec, Path.ChangeExtension(t.Sources[1].ItemSpec, ".resources")); 2379Assert.Equal(t.FilesWritten[2].ItemSpec, Path.ChangeExtension(t.Sources[3].ItemSpec, ".resources")); 2430Assert.Equal(t.StronglyTypedClassName, Path.GetFileNameWithoutExtension(t.StronglyTypedFileName)); 2464File.Delete(Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs")); 2473Assert.Equal(t.StronglyTypedFileName, Path.ChangeExtension(t.Sources[0].ItemSpec, ".cs")); 2557File.Delete(Path.ChangeExtension(textFile, ".resources")); 2575resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2651string newTextFile = Path.ChangeExtension(textFile, ".foo"); 2684string resxFile = Path.ChangeExtension(textFile, ".foo"); 2716string resxFile = Path.ChangeExtension(textFile, ".resources"); 2811File.Delete(Path.ChangeExtension(resxFile, ".resources")); 2816File.Delete(Path.ChangeExtension(resxFile2, ".resources")); 2873string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2910string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2947string resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2986resourcesFile = Path.ChangeExtension(txtFile, ".resources"); 2988string csFile = Path.ChangeExtension(txtFile, ".cs"); 2992dir = Path.Combine(Path.GetTempPath(), "directory"); 3118string p2pReference = Path.Combine(ObjectModelHelpers.TempProjectDir, "bin", "debug", "lib1.dll"); 3211t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) }; 3360t.Sources = new ITaskItem[] { new TaskItem(Path.Combine(ObjectModelHelpers.TempProjectDir, "MyStrings.resx")) }; 3409string resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 3445resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 3484File.Delete(Path.ChangeExtension(resxFile, ".cs")); 3488resourcesFile = Path.ChangeExtension(resxFile, ".resources"); 3531resourcesFile = Path.ChangeExtension(resxFile, ".myresources"); 3534string resourcesFile1 = Path.ChangeExtension(resxFile1, ".myresources"); 3630Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 3632Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 3673env.CreateFolder(Path.Combine(env.DefaultTestDirectory.Path, "tmp_dir")), 3688Path.GetExtension(outputResourceFile).ShouldBe(".resources"); 4140Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "System.dll"); 4185string filename = Path.ChangeExtension(f, extension); 4238Assert.Equal(Path.GetFileNameWithoutExtension(textFile), Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec)); 4241string stronglyTypedClassName = Path.GetFileNameWithoutExtension(t.OutputResources[0].ItemSpec); 4245Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 4249Assert.Equal(".resources", Path.GetExtension(resourcesFile)); 4254Assert.Equal(Path.ChangeExtension(t.Sources[0].ItemSpec, codeFileExtension), t.StronglyTypedFileName); 4261string STRFile = Path.ChangeExtension(textFile, codeFileExtension); 4265Assert.Contains("class " + Path.GetFileNameWithoutExtension(textFile).ToLower(), Utilities.ReadFileContent(STRFile).ToLower());
ResourceHandling\MSBuildResXReader_Tests.cs (2)
139File.Exists(Path.Combine("ResourceHandling", "TextFile1.txt")).ShouldBeTrue("Test deployment is missing None files"); 179Path.Combine(baseDir.Path, nameof(LoadsStringFromFileRefAsStringWithShiftJISEncoding) + ".resx"),
RoslynCodeTaskFactory_Tests.cs (4)
63<Reference Include=""" + Path.Combine(Path.GetDirectoryName(location), "..", "..", "..", "Samples", "Dependency", 129string output = RunnerUtilities.ExecMSBuild(assemblyProj.Path + $" /p:OutDir={Path.Combine(folder.Path, "subFolder")} /restore", out bool success); 137<Reference Include=""{Path.Combine(folder.Path, "subFolder", "5106.dll")}"" />
SecurityUtil_Tests.cs (3)
16private static string TestAssembliesPaths { get; } = Path.Combine(AppContext.BaseDirectory, "TestResources"); 25string clickOnceManifest = Path.Combine(TestAssembliesPaths, "ClickOnceProfile.pubxml"); 31string pathToCertificate = Path.Combine(TestAssembliesPaths, "mycert.pfx");
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
TestResources\TestBinary.cs (1)
16Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin");
Unzip_Tests.cs (18)
87_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 88_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 131_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 132_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 133_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "subdir", "F83E9633685494E53BEF3794EDEEE6A6.txt"), customMessage: _mockEngine.Log); 134_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "subdir", "21D6D4596067723B3AC5DF9A8B3CBFE7.txt"), customMessage: _mockEngine.Log); 135Directory.Exists(Path.Combine(destination.Path, "emptyDir")); 236SourceFiles = new ITaskItem[] { new TaskItem(Path.Combine(testEnvironment.DefaultTestDirectory.Path, "foo.zip")), } 269_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 270_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 298_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "BE78A17D30144B549D21F71D5C633F7D.txt"), customMessage: _mockEngine.Log); 299_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "A04FF4B88DF14860B7C73A8E75A4FB76.txt"), customMessage: _mockEngine.Log); 332_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "file1.js"), customMessage: _mockEngine.Log); 333_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "file1.js.map"), customMessage: _mockEngine.Log); 334_mockEngine.Log.ShouldContain(Path.Combine(destination.Path, "file2.js"), customMessage: _mockEngine.Log); 335_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "readme.txt"), customMessage: _mockEngine.Log); 336_mockEngine.Log.ShouldNotContain(Path.Combine(destination.Path, "sub", "subfile.js"), customMessage: _mockEngine.Log); 479string unzippedFilePath = Path.Combine(destination.Path, executableName);
VerifyFileHash_Tests.cs (4)
30File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"), 48File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"), 66File = Path.Combine(AppContext.BaseDirectory, "this_does_not_exist.txt"), 87File = Path.Combine(AppContext.BaseDirectory, "TestResources", "lorem.bin"),
WriteCodeFragment_Tests.cs (36)
84task.OutputDirectory = new TaskItem(Path.GetTempPath()); 89string file = Path.Combine(Path.GetTempPath(), "CombineFileDirectory.tmp"); 108string expectedFile = Path.Combine(folder.ItemSpec, file.ItemSpec); 127TaskItem file = new TaskItem(Path.Combine(env.CreateFolder(folderPath: null, createFolder: false).Path, "File.tmp")); 153string fileName = Path.GetFileName(file.Path); 175string folder = Path.Combine(Path.GetTempPath(), "foo" + Path.DirectorySeparatorChar); 176string file = Path.Combine(folder, "CombineFileDirectory.tmp"); 197string file = Path.Combine(Path.GetTempPath(), "NoAttributesShouldEmitNoFile.tmp"); 224string file = Path.Combine(Path.GetTempPath(), "NoAttributesShouldEmitNoFile.tmp"); 286string file = Path.Combine(Path.GetTempPath(), "OneAttribute.tmp"); 325task.OutputDirectory = new TaskItem(Path.GetTempPath()); 351task.OutputDirectory = new TaskItem(Path.GetTempPath()); 377task.OutputDirectory = new TaskItem(Path.GetTempPath()); 382Assert.Equal(Path.GetTempPath(), task.OutputFile.ItemSpec.Substring(0, Path.GetTempPath().Length)); 415string file = Path.Combine(Path.GetTempPath(), "OneAttribute.tmp"); 458task.OutputDirectory = new TaskItem(Path.GetTempPath()); 480task.OutputDirectory = new TaskItem(Path.GetTempPath()); 504task.OutputDirectory = new TaskItem(Path.GetTempPath()); 528task.OutputDirectory = new TaskItem(Path.GetTempPath()); 560task.OutputDirectory = new TaskItem(Path.GetTempPath()); 596task.OutputDirectory = new TaskItem(Path.GetTempPath()); 628task.OutputDirectory = new TaskItem(Path.GetTempPath()); 651task.OutputDirectory = new TaskItem(Path.GetTempPath()); 674task.OutputDirectory = new TaskItem(Path.GetTempPath()); 699task.OutputDirectory = new TaskItem(Path.GetTempPath()); 732task.OutputDirectory = new TaskItem(Path.GetTempPath()); 1071task.OutputDirectory = new TaskItem(Path.GetTempPath()); 1097return CreateTask(language, new TaskItem(Path.GetTempPath()), null, attributes);
WriteLinesToFile_Tests.cs (1)
301var file = Path.Combine(directory.Path, $"{Guid.NewGuid().ToString("N")}.tmp");
XmlPeek_Tests.cs (3)
363string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 365xmlInputPath = dir + Path.DirectorySeparatorChar + "doc.xml";
XmlPoke_Tests.cs (3)
333string dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 335xmlInputPath = dir + Path.DirectorySeparatorChar + "doc.xml";
XslTransformation_Tests.cs (14)
863var testingDocsDir = Path.Combine("TestDocuments", "Fdl2Proto"); 865xmlPaths = new TaskItem[] { new TaskItem(Path.Combine(testingDocsDir, "sila.xml")) }; 866xslPath = new TaskItem(Path.Combine(testingDocsDir, "fdl2proto.xsl")); 883using (StreamReader sr = new StreamReader(Path.Combine(testingDocsDir, "expected.proto"))) 950var otherXmlPath = new TaskItem(Path.Combine(dir, Guid.NewGuid().ToString())); 1051var otherXslPath = new TaskItem(Path.Combine(dir, Guid.NewGuid().ToString() + ".xslt")); 1058var myXmlPath1 = new TaskItem(Path.Combine(dir, "a.xml")); 1065var myXmlPath2 = new TaskItem(Path.Combine(dir, "b.xml")); 1108dir = Path.Combine(Path.GetTempPath(), DateTime.Now.Ticks.ToString()); 1112xmlPaths = new TaskItem[] { new TaskItem(Path.Combine(dir, "doc.xml")) }; 1113xslPath = new TaskItem(Path.Combine(dir, "doc.xslt")); 1114xslCompiledPath = new TaskItem(Path.Combine(dir, "doc.dll")); 1115outputPaths = new TaskItem[] { new TaskItem(Path.Combine(dir, "testout.xml")) };
ZipDirectory_Tests.cs (3)
47string zipFilePath = Path.Combine(testEnvironment.CreateFolder(createFolder: true).Path, "test.zip"); 164SourceDirectory = new TaskItem(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")))
Microsoft.Build.UnitTests.Shared (49)
DummyMappedDrive.cs (4)
22_mappedPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 30File.Create(Path.Combine(_mappedPath, "x")).Dispose();
EngineTestEnvironment.cs (6)
127var projectDir = Path.GetFullPath(Path.Combine(TestRoot, relativePathFromRootToProject)); 130ProjectFile = Path.GetFullPath(Path.Combine(projectDir, projectFileName)); 189string binaryLoggerFilePath = Path.GetFullPath(Path.Combine(TestRoot, Guid.NewGuid().ToString() + ".binlog"));
EnvironmentProvider.cs (5)
51.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 65.Where(p => !Path.GetInvalidPathChars().Any(p.Contains)) 66.Select(p => Path.Combine(p, commandNameWithExtension)) 82if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileNameWithoutExtension(dotnetExe) 108public static string? GetDotnetExePathFromFolder(string? netRootFolder) => Path.Combine(netRootFolder ?? string.Empty, Constants.DotNet + Constants.ExeSuffix);
ObjectModelHelpers.cs (24)
147expectedInclude = expectedInclude.Select(i => Path.Combine(testProject.TestRoot, i)).ToArray(); 197return path.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); 579Assert.True(FileSystems.Default.FileExists(Path.Combine(TempProjectDir, fileRelativePath)), message); 739project.FullPath = Path.Combine(TempProjectDir, "Temporary" + guid.ToString("N") + ".csproj"); 843s_tempProjectDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N")); 905string fullFilePath = Path.Combine(TempProjectDir, fileRelativePath); 906Directory.CreateDirectory(Path.GetDirectoryName(fullFilePath)); 982string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath); 1015if (string.Equals(Path.GetExtension(projectFileRelativePath), ".sln")) 1017string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath); 1629var projectDir = Path.Combine(root, relativePathFromRootToProject); 1632createdProjectFile = Path.Combine(projectDir, "build.proj"); 1642return Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 1680var fullPath = Path.Combine(pathFragments.ToArray()); 1682var directoryName = Path.GetDirectoryName(fullPath); 1853if (Path.IsPathRooted(path)) 1855splits[0] = Path.GetPathRoot(path); 1869var pathsSortedByDepth = paths.OrderByDescending(x => Path.GetDirectoryName(Path.GetFullPath(x)).Length); 1878string directory = Path.GetDirectoryName(path); 2041Path.IsPathRooted(path)
RunnerUtilities.cs (1)
78msbuildParameters = Path.Combine(BootstrapMsBuildBinaryLocation, "sdk", BootstrapLocationAttribute.BootstrapSdkVersion, Constants.MSBuildAssemblyName) + " " + msbuildParameters;
TestEnvironment.cs (9)
159WithInvariant(new StringInvariant("Path.GetTempPath()", Path.GetTempPath)); 523files.AddRange(Directory.GetFiles(Path.GetTempPath(), MSBuildLogFiles)); 738Path = System.IO.Path.Combine(rootPath, fileName); 780return new TransientTestFolder(System.IO.Path.Combine(Path, directoryName)); 797System.IO.Path.GetFullPath(Path).ShouldNotBe(System.IO.Path.GetFullPath(System.IO.Path.GetTempPath())); 798System.IO.Path.IsPathRooted(Path).ShouldBeTrue($"{Path} is not rooted"); 852string path = System.IO.Path.Combine(destination.Path, filename);
Microsoft.Build.Utilities.Core (186)
BuildEnvironmentHelper.cs (9)
201var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 202var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 335.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 358string directory = Path.GetDirectoryName(msBuildAssembly); 415var processFileName = Path.GetFileNameWithoutExtension(processName); 614MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 620MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 625? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 683defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommandLineBuilder.cs (1)
342AppendTextWithQuoting("." + Path.DirectorySeparatorChar + fileName);
DebugUtils.cs (6)
44debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 48debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 110var extension = Path.GetExtension(fileName); 111var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 113var fullPath = Path.Combine(DebugPath, fileName); 119fullPath = Path.Combine(DebugPath, fileName);
ErrorUtilities.cs (1)
178if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
378s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (38)
77string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}"); 131internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 144cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 195string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 237fileSpec += Path.DirectorySeparatorChar; 277path.Substring(start) + Path.DirectorySeparatorChar); 370return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 400while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 492return NormalizePath(Path.Combine(directory, file)); 498return NormalizePath(Path.Combine(paths)); 517Path.HasExtension(uncheckedFullPath); 521return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 524return Path.GetFullPath(path); 566return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 704return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 716string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 728directory += Path.DirectorySeparatorChar; 775if (Path.HasExtension(fileName)) 797internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 812string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 826fullPath += Path.DirectorySeparatorChar; 890var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1200string fullBase = Path.GetFullPath(basePath); 1201string fullPath = Path.GetFullPath(path); 1210while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1241sb.Append("..").Append(Path.DirectorySeparatorChar); 1245sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1248if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1292return Path.IsPathRooted(FixFilePath(path)); 1338return paths.Aggregate(root, Path.Combine); 1366var separator = Path.DirectorySeparatorChar; 1510string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1524lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1544if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
FrameworkLocationHelper.cs (31)
443? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 453? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 463? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30) 473? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35) 483? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40) 493? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45) 503? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 513? Path.Combine(NativeMethodsShared.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 590Path.DirectorySeparatorChar.ToString(), 594Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin"); 599s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar; 639s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools"); 814var frameworkPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, prefix ?? string.Empty); 824return Path.Combine(complusInstallRoot, complusVersion); 829string leaf = Path.GetFileName(currentRuntimePath); 837string baseLocation = Path.GetDirectoryName(currentRuntimePath); 957combinedPath = Path.GetFullPath(combinedPath); 965? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework") 966: Path.Combine(NativeMethodsShared.FrameworkBasePath, "xbuild-frameworks"); 968return Path.GetFullPath(combinedPath); 1016string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString()); 1019path = Path.Combine(path, "Profile", frameworkName.Profile); 1022return Path.GetFullPath(path); 1046var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 1048Path.AltDirectorySeparatorChar.ToString(), 1067fixedPath += Path.DirectorySeparatorChar; 1125string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 1423Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), 1435(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && 1436!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) 1468frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
InprocTrackingNativeMethods.cs (1)
208string fileTrackerPath = Path.Combine(buildToolsPath, fileTrackerDllName.Value);
Modifiers.cs (9)
214modifiedItemSpec = Path.GetPathRoot(fullPath); 223modifiedItemSpec += Path.DirectorySeparatorChar; 238modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 252modifiedItemSpec = Path.GetExtension(itemSpec); 367modifiedItemSpec = Path.Combine( 418if (!Path.IsPathRooted(path)) 451return Path.GetDirectoryName(path) == null; 464fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
PlatformManifest.cs (1)
94string platformManifestPath = Path.Combine(_pathToManifest, "Platform.xml");
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
SDKManifest.cs (1)
311string sdkManifestPath = Path.Combine(_pathToSdk, "SDKManifest.xml");
TempFileUtilities.cs (7)
69path = Path.Combine(Path.GetTempPath(), $"{msbuildTempFolderPrefix}{Guid.NewGuid():N}"); 84string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 185string file = Path.Combine(directory, $"{fileName}{extension}"); 209string destFile = Path.Combine(dest, fileInfo.Name); 214string destDir = Path.Combine(dest, subdirInfo.Name); 231: System.IO.Path.Combine(TempFileDirectory, name);
ToolLocationHelper.cs (48)
663string legacyWindowsMetadataLocation = Path.Combine(sdkRoot, "Windows Metadata"); 844propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName); 848propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName, targetPlatformIdentifier, targetPlatformVersion); 1038winmdLocation = Path.Combine(sdkRoot, referencesFolderName, commonConfigurationFolderName, neutralArchitectureName); 1131string referencesRoot = Path.Combine(targetPlatformSdkRoot, referencesFolderName, targetPlatformSdkVersion); 1136string contractPath = Path.Combine(referencesRoot, contract.Name, contract.Version); 1223return Path.Combine(sdkLocation, folderName); 1236? Path.Combine(matchingSdk.Path, folderName, targetPlatformVersion) 1237: Path.Combine(matchingSdk.Path, folderName); 1435var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder)); 1500string fullPath = Path.Combine(root, file); 1765if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 1839if (legacyMsCorlib20Path != null && FileSystems.Default.FileExists(Path.Combine(legacyMsCorlib20Path, "mscorlib.dll"))) 1856if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 2257Path.DirectorySeparatorChar.ToString(), 2260dotNetFrameworkReferenceAssemblies[i] += Path.DirectorySeparatorChar; 2425string referenceAssemblyPath = Path.Combine(sdkRoot, contentFolderName, targetConfiguration, targetArchitecture); 2552string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml"); 2627string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version); 2628string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 2651string sdkFolderPath = Path.Combine(platformSDKDirectory, "ExtensionSDKs"); 2746string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 2824string sdkManifestFileLocation = Path.Combine(directoryName, "SDKManifest.xml"); 2902string localAppdataFolder = Path.Combine(userLocalAppData, "Microsoft SDKs"); 2909string defaultProgramFilesLocation = Path.Combine( 3027string platformsRoot = Path.Combine(sdk.Path, platformsFolderName); 3055string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml"); 3093string path = Path.GetFullPath(targetFrameworkDirectory); 3114string redistListFolder = Path.Combine(path, "RedistList"); 3115string redistFilePath = Path.Combine(redistListFolder, "FrameworkList.xml"); 3199pathToReturn = Path.Combine(pathToReturn, includeFramework); 3200pathToReturn = Path.GetFullPath(pathToReturn); 3348pathToSdk = Path.Combine(pathToSdk, "x64"); 3351pathToSdk = Path.Combine(pathToSdk, "ia64"); 3359string filePath = Path.Combine(pathToSdk, fileName); 3475pathToSdk = Path.Combine(pathToSdk, "bin"); 3516pathToSdk = Path.Combine(pathToSdk, "x86"); 3519pathToSdk = Path.Combine(pathToSdk, "x64"); 3527string filePath = Path.Combine(pathToSdk, fileName); 3590toolPath = Path.Combine(toolPath, fileName); 3620return pathToFx == null ? null : Path.Combine(pathToFx, fileName); 3628public static string GetPathToSystemFile(string fileName) => Path.Combine(PathToSystem, fileName); 3860string frameworkIdentifierPath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 3918string frameworkProfilePath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 3919frameworkProfilePath = Path.Combine(frameworkProfilePath, frameworkVersion); 3920frameworkProfilePath = Path.Combine(frameworkProfilePath, "Profiles"); 3965string dotNextFx30RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV30); 3972string dotNextFx35RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV35);
ToolTask.cs (6)
515pathToTool = Path.Combine(ToolPath, ToolExe); 527string directory = Path.GetDirectoryName(pathToTool); 528pathToTool = Path.Combine(directory, ToolExe); 536bool isOnlyFileName = Path.GetFileName(pathToTool).Length == pathToTool.Length; 1333.Select(folderPath => Path.Combine(folderPath, filename)) 1656sb[i] = Path.DirectorySeparatorChar;
TrackedDependencies\FileTracker.cs (16)
82private static readonly string s_tempPath = FileUtilities.EnsureTrailingSlash(Path.GetTempPath()); 98private static readonly string s_localLowApplicationDataPath = FileUtilities.EnsureTrailingSlash(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData\\LocalLow").ToUpperInvariant()); 117private static readonly char[] pathSeparatorArray = { Path.PathSeparator }; 120private static readonly string pathSeparator = Path.PathSeparator.ToString(); 133string defaultRootDirectory = Path.GetPathRoot(defaultCommonApplicationDataPath); 134string alternativeCommonApplicationDataPath1 = FileUtilities.EnsureTrailingSlash(Path.Combine(defaultRootDirectory, @"Documents and Settings\All Users\Application Data").ToUpperInvariant()); 141string alternativeCommonApplicationDataPath2 = FileUtilities.EnsureTrailingSlash(Path.Combine(defaultRootDirectory, @"Users\All Users\Application Data").ToUpperInvariant()); 291Debug.Assert(path[pathLength - 1] == Path.DirectorySeparatorChar); 302if (fileName.Length < pathLength || fileName[pathLength - 1] != Path.DirectorySeparatorChar) 409Environment.SetEnvironmentVariable(pathEnvironmentVariableName, Path.GetDirectoryName(fileTrackerPath) + pathSeparator + oldPath); 428string trackerPath = !Path.IsPathRooted(path) 429? Path.GetFullPath(path) 432trackerPath = Path.Combine(trackerPath, s_TrackerFilename); 532trackerPath = Path.Combine(rootPath, filename); 578string progfilesPath = Path.Combine(FrameworkLocationHelper.GenerateProgramFiles32(), 620intermediateDirectory = Path.GetDirectoryName(intermediateDirectory);
TrackedDependencies\FlatTrackingData.cs (1)
645string markerDirectory = Path.GetDirectoryName(_tlogMarker);
TrackedDependencies\TrackedDependencies.cs (2)
39string? directoryName = Path.GetDirectoryName(item.ItemSpec); 40string searchPattern = Path.GetFileName(item.ItemSpec);
WindowsFileSystem.cs (3)
130var searchDirectoryPath = Path.Combine(directoryPath, "*"); 167result.Add(Path.Combine(directoryPath, findResult.CFileName)); 175Path.Combine(directoryPath, findResult.CFileName),
Microsoft.Build.Utilities.UnitTests (364)
CommandLineBuilder_Tests.cs (7)
144c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs .{Path.DirectorySeparatorChar}-Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs"); 157c.ShouldBe($".{Path.DirectorySeparatorChar}-Mercury.cs Venus.cs .{Path.DirectorySeparatorChar}-Earth.cs"); 259c.ShouldBe($"/something .{Path.DirectorySeparatorChar}-Mercury.cs Mercury.cs \"Mer cury.cs\""); 275c.ShouldBe($"/something .{Path.DirectorySeparatorChar}-Mercury.cs Mercury.cs \"Mer cury.cs\"");
NativeMethodsShared_Tests.cs (2)
118string nonexistentDirectory = Path.Combine(currentDirectory, "foo", "bar", "baz"); 125nonexistentDirectory = $"{Path.Combine(currentDirectory, "foo", "bar", "baz")}{Guid.NewGuid()}";
PlatformManifest_Tests.cs (2)
69File.WriteAllText(Path.Combine(manifestDirectory, "SomeOtherFile.xml"), "hello"); 326File.WriteAllText(Path.Combine(_manifestDirectory, "Platform.xml"), ObjectModelHelpers.CleanupFileContents(contents));
PrintLineDebugger_Tests.cs (2)
191artifactsDirectory.ShouldEndWith(Path.Combine("log", "Debug"), Case.Sensitive); 192Path.IsPathRooted(artifactsDirectory).ShouldBeTrue();
TaskItem_Tests.cs (2)
185Path.Combine( 195from.GetMetadata(FileUtilities.ItemSpecModifiers.RootDir).ShouldBe(Path.GetPathRoot(from.GetMetadata(FileUtilities.ItemSpecModifiers.FullPath)));
TestAssemblyInfo.cs (5)
79var subdirectory = Path.GetRandomFileName(); 81string newTempPath = Path.Combine(Path.GetTempPath(), subdirectory); 121string potentialVersionsPropsPath = Path.Combine(currentFolder, "build", "Versions.props"); 136string dotnetPath = Path.Combine(currentFolder, "artifacts", ".dotnet", cliVersion, "dotnet");
ToolLocationHelper_Tests.cs (334)
70string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 78string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 79string referenceDirectory = Path.Combine(tempDirectory, Path.Combine("References", "Foo", "Bar")); 84File.WriteAllText(Path.Combine(referenceDirectory, "One.winmd"), "First"); 85File.WriteAllText(Path.Combine(referenceDirectory, "Two.winmd"), "Second"); 86File.WriteAllText(Path.Combine(referenceDirectory, "Three.winmd"), "Third"); 102string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 104string referenceDirectory = Path.Combine(tempDirectory, @"References", tempVersion, @"Foo\Bar"); 109File.WriteAllText(Path.Combine(referenceDirectory, "One.winmd"), "First"); 137returnValue.ShouldBe(Path.Combine(sdkRootPath, @"DesignTime\CommonConfiguration\Neutral")); 163returnValue.ShouldBe(Path.Combine(sdkRootPath, "UnionMetadata")); 170string platformRootFolder = Path.Combine(Path.GetTempPath(), @"MockSDK"); 171string sdkRootFolder = Path.Combine(platformRootFolder, @"Windows Kits\10"); 172string platformFolder = Path.Combine(sdkRootFolder, @"Platforms\UAP\10.0.14944.0"); 173string platformFilePath = Path.Combine(platformFolder, "Platform.xml"); 174string sdkManifestFilePath = Path.Combine(sdkRootFolder, "SDKManifest.xml"); 215returnValue.ShouldBe(Path.Combine(sdkRootFolder, "UnionMetadata", "10.0.14944.0")); 231string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 232string sdkDirectory = Path.Combine(tempDirectory, "Foo", "Bar"); 256string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 257string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0"); 281string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 282string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0"); 287File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), ""); 307string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 308string sdkDirectory = Path.Combine(tempDirectory, "Foo", "1.0"); 313File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "Garbaggggge"); 335string tempDirectory = Path.Combine(Path.GetTempPath(), "VGPTDNFSFN40"); 336string temp35Directory = Path.Combine(tempDirectory, "bin"); 337string temp40Directory = Path.Combine(temp35Directory, "NETFX 4.0 Tools"); 338string toolPath = Path.Combine(temp35Directory, "MyTool.exe"); 339string toolPath40 = Path.Combine(temp40Directory, "MyTool.exe"); 402string tempPath = Path.GetTempPath(); 403string testPath = Path.Combine(tempPath, "HighestVersionOfTargetFrameworkIdentifierRootNoVersions"); 404string nonVersionFolder = Path.Combine(testPath, ".UnknownFramework", "NotAVersion"); 421string tempPath = Path.GetTempPath(); 422string testPath = Path.Combine(tempPath, "HighestVersionOfTargetFrameworkIdentifierRootMultipleVersions"); 423string folder10 = Path.Combine(testPath, ".UnknownFramework", "v1.0"); 424string folder20 = Path.Combine(testPath, ".UnknownFramework", "v2.0"); 425string folder40 = Path.Combine(testPath, ".UnknownFramework", "v4.0"); 454string tempDirectory = Path.Combine(Path.GetTempPath(), "VGPTDNFSF40"); 455string temp35Directory = Path.Combine(tempDirectory, "bin"); 456string temp40Directory = Path.Combine(temp35Directory, "NETFX 4.0 Tools"); 457string toolPath = Path.Combine(temp35Directory, "MyTool.exe"); 458string toolPath40 = Path.Combine(temp40Directory, "MyTool.exe"); 515Path.GetDirectoryName(typeof(object).GetTypeInfo().Module.FullyQualifiedName), 542path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86dbg")); 554Path.Combine("{runtime-base}", "v1.3.x86dbg"), // Simulate "Orcas" as the current runtime.} 559path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86fre")); 571Path.Combine("{runtime-base}", "v1.1.x86dbg"), // Simulate "Everett" as the current runtime. 577path.ShouldBe(Path.Combine("{runtime-base}", "v1.2.x86fre")); 589Path.Combine(@"{runtime-base}", "v1.1"), // Simulate "everett" as the current runtime 606string tempPath = Path.GetTempPath(); 607string fakeWhidbeyPath = Path.Combine(tempPath, "v2.0.50224"); 608string fakeEverettPath = Path.Combine(tempPath, "v1.1.43225"); 695string tv12path = Path.Combine(ProjectCollection.GlobalProjectCollection.GetToolset(ObjectModelHelpers.MSBuildDefaultToolsVersion).ToolsPath, MSBuildExeName); 718string tv12path = Path.Combine(Path.GetFullPath(toolsPath32.EvaluatedValue), "msbuild.exe"); 919string pathToSdk35InstallRoot = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\"); 920string pathToSdkV4InstallRootOnVS10 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v7.0A\"); 921string pathToSdkV4InstallRootOnVS11 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v8.0A\"); 925if (!Directory.Exists(Path.Combine(pathToSdkV4InstallRootOnVS11, "bin"))) 931string pathToSdkV4InstallRootOnVS12 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v8.1A\"); 939string pathToSdkV4InstallRootOnVS14 = Path.Combine(FrameworkLocationHelper.programFiles32, @"Microsoft SDKs\Windows\v10.0A\"); 1276string expectedPath = Path.Combine(targetFrameworkRootPath, targetFrameworkIdentifier); 1277expectedPath = Path.Combine(expectedPath, "v" + targetFrameworkVersion); 1278expectedPath = Path.Combine(expectedPath, "Profile"); 1279expectedPath = Path.Combine(expectedPath, targetFrameworkProfile); 1294string expectedPath = Path.Combine(targetFrameworkRootPath, targetFrameworkIdentifier); 1295expectedPath = Path.Combine(expectedPath, "v" + targetFrameworkVersion); 1315string targetFrameworkProfile = "PocketPC" + new string(Path.GetInvalidFileNameChars()); 1334string targetFrameworkIdentifier = "Compact Framework" + new string(Path.GetInvalidFileNameChars()); 1396string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsChain"); 1398string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1399string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1400string redist40Directory = Path.Combine(tempDirectory, "v4.0", "RedistList") + Path.DirectorySeparatorChar; 1401string redist40 = Path.Combine(redist40Directory, "FrameworkList.xml"); 1409string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1411string expectedChainedPath = Path.Combine(tempDirectory, "v4.0"); 1438string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoInclude"); 1440string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1441string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1446string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1468string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoInclude"); 1470string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1471string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1476string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1498string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsNoFileList"); 1500string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1501string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1506string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.1")); 1527string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistExistsBadFile"); 1529string redist40Directory = Path.Combine(tempDirectory, "v4.0", "RedistList") + Path.DirectorySeparatorChar; 1530string redist40 = Path.Combine(redist40Directory, "FrameworkList.xml"); 1536string path = ToolLocationHelper.ChainReferenceAssemblyPath(Path.Combine(tempDirectory, "v4.0")); 1558string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistPointsToInvalidInclude"); 1560string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1561string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1562string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1"); 1588char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); 1594string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistInvalidPathChars"); 1596string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1597string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1598string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1"); 1628string tempDirectory = Path.Combine(Path.GetTempPath(), "ChainReferenceAssembliesRedistPathTooLong"); 1630string redist41Directory = Path.Combine(tempDirectory, "v4.1", "RedistList") + Path.DirectorySeparatorChar; 1631string redist41 = Path.Combine(redist41Directory, "FrameworkList.xml"); 1632string tempDirectoryPath = Path.Combine(tempDirectory, "v4.1"); 1671string tempDirectory = Path.Combine(Path.GetTempPath(), "GetPathToReferenceAssembliesWithRootGoodWithChain"); 1673string framework41Directory = Path.Combine(tempDirectory, "MyFramework", "v4.1") + Path.DirectorySeparatorChar; 1674string framework41redistDirectory = Path.Combine(framework41Directory, "RedistList"); 1675string framework41RedistList = Path.Combine(framework41redistDirectory, "FrameworkList.xml"); 1677string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") + Path.DirectorySeparatorChar; 1678string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList"); 1679string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml"); 1681string framework39Directory = Path.Combine(tempDirectory, "MyFramework", "v3.9") + Path.DirectorySeparatorChar; 1682string framework39redistDirectory = Path.Combine(framework39Directory, "RedistList"); 1683string framework39RedistList = Path.Combine(framework39redistDirectory, "FrameworkList.xml"); 1736string tempDirectory = Path.Combine(Path.GetTempPath(), "DisplayNameGeneration"); 1738string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") 1739+ Path.DirectorySeparatorChar; 1740string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList"); 1741string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml"); 1744Path.Combine(tempDirectory, "MyFramework", "v3.9", "Profile", "Client"); 1745string framework39redistDirectory = Path.Combine(framework39Directory, "RedistList"); 1746string framework39RedistList = Path.Combine(framework39redistDirectory, "FrameworkList.xml"); 1793string tempDirectory = Path.Combine(Path.GetTempPath(), "GetPathToReferenceAssembliesWithRootCircularReference"); 1795string framework41Directory = Path.Combine(tempDirectory, "MyFramework", "v4.1") 1796+ Path.DirectorySeparatorChar; 1797string framework41redistDirectory = Path.Combine(framework41Directory, "RedistList"); 1798string framework41RedistList = Path.Combine(framework41redistDirectory, "FrameworkList.xml"); 1800string framework40Directory = Path.Combine(tempDirectory, "MyFramework", "v4.0") 1801+ Path.DirectorySeparatorChar; 1802string framework40redistDirectory = Path.Combine(framework40Directory, "RedistList"); 1803string framework40RedistList = Path.Combine(framework40redistDirectory, "FrameworkList.xml"); 1975string combinedPath = Path.Combine(programFiles32, pathToCombineWith); 1976string fullPath = Path.GetFullPath(combinedPath); 2507string rootDir = Path.Combine(env.DefaultTestDirectory.Path, "framework-root"); 2536string customFrameworkRootPath = Path.Combine(env.DefaultTestDirectory.Path, "framework-root"); 2559string rootDir = Path.Combine(env.CreateFolder().Path, "framework-root"); 2560string fallbackPath = Path.Combine(env.CreateFolder().Path, "framework-root"); 2590string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2603string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2620string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2637string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2652string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2669string customFrameworkDirToUse = Path.Combine(env.CreateFolder().Path, "framework-root"); 2690stdLibPaths[0].ShouldBe(Path.Combine(customFrameworkDir, frameworkName, frameworkVersionWithV) + Path.DirectorySeparatorChar, stdLibPaths[0]); 2726string redistPath = Path.Combine(rootDir, frameworkName, frameworkVersion, "RedistList"); 2727string asmPath = Path.Combine(rootDir, frameworkName, frameworkVersion); 2732File.WriteAllText(Path.Combine(redistPath, "FrameworkList.xml"), string.Format(frameworkListXml, frameworkName)); 2733File.WriteAllText(Path.Combine(asmPath, "mscorlib.dll"), string.Empty); 3004sdks["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3006sdks["AnotherAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3034Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") 3035+ Path.DirectorySeparatorChar; 3130string tmpRootDirectory = Path.GetTempPath(); 3134string frameworkPath = Path.Combine(tmpRootDirectory, frameworkPathPattern); 3135string manifestFile = Path.Combine(frameworkPath, "SDKManifest.xml"); 3137string frameworkPath2 = Path.Combine(tmpRootDirectory, frameworkPathPattern2); 3138string manifestFile2 = Path.Combine(frameworkPath, "SDKManifest.xml"); 3281string manifestPath = Path.Combine(Path.GetTempPath(), "ManifestTmp"); 3287string manifestFile = Path.Combine(manifestPath, "SDKManifest.xml"); 3416string manifestPath = Path.Combine(Path.GetTempPath(), "ManifestTmp"); 3422string manifestFile = Path.Combine(manifestPath, "SDKManifest.xml"); 3546string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyGetInstalledSDKLocations"); 3547string platformDirectory = Path.Combine(testDirectoryRoot, "MyPlatform", "8.0") 3548+ Path.DirectorySeparatorChar; 3549string sdkDirectory = Path.Combine(platformDirectory, "ExtensionSDKs", "SDkWithManifest", "2.0") 3550+ Path.DirectorySeparatorChar; 3578File.WriteAllText(Path.Combine(platformDirectory, "SDKManifest.xml"), "HI"); 3579File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "HI"); 3580string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3615string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyGetInstalledSDKLocations2"); 3616string platformDirectory = Path.Combine(testDirectoryRoot, "MyPlatform", "8.0") 3617+ Path.DirectorySeparatorChar; 3618string sdkDirectory = Path.Combine(platformDirectory, "ExtensionSDKs", "SDkWithManifest", "2.0") 3619+ Path.DirectorySeparatorChar; 3650File.WriteAllText(Path.Combine(platformDirectory, "SDKManifest.xml"), platformSDKManifestContents); 3651File.WriteAllText(Path.Combine(sdkDirectory, "SDKManifest.xml"), "HI"); 3652string testProjectFile = Path.Combine(testDirectoryRoot, "testproject.csproj"); 3795targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3796targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3798targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=2.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3802targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3804targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=3.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3806targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=4.0"].ShouldBe(Path.Combine(_fakeStructureRoot2, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3816targetPlatforms[key].ExtensionSDKs["AnotherAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3820targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3822targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3826targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3828targetPlatforms[key].ExtensionSDKs["MyAssembly, Version=1.0"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3831targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3835targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "8.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3839targetPlatforms[key].Platforms["PlatformAssembly, Version=0.1.2.3"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3844targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "9.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 3848targetPlatforms[key].Platforms["PlatformAssembly, Version=0.1.2.3"].ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4064targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4067targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "Windows", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4070targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "3.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4073targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "2.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4076targetPlatforms[key].Path.ShouldBe(Path.Combine(_fakeStructureRoot, "MyPlatform", "1.0") + Path.DirectorySeparatorChar, StringCompareShould.IgnoreCase); 4110string testDirectoryRoot = Path.Combine(Path.GetTempPath(), "VerifyFindRootFolderWhereAllFilesExist"); 4111string[] rootDirectories = new string[] { Path.Combine(testDirectoryRoot, "Root1"), Path.Combine(testDirectoryRoot, "Root2") }; 4116string subdir = Path.Combine(rootDirectories[i], "Subdir"); 4119File.Create(Path.Combine(rootDirectories[i], "file1.txt")).Close(); 4120File.Create(Path.Combine(subdir, fileInSubDir)).Close(); 4422string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory"); 4427Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4429Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0")); 4431Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0")); 4433Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4434Directory.CreateDirectory(Path.Combine(tempPath, "WindowsKits", "6.0")); 4435Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "5.0")); 4437Path.Combine(tempPath, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0")); 4439Path.Combine(tempPath, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4441Path.Combine(tempPath, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4442Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "1.0")); 4443Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "8.0")); 4445Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3")); 4447Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "1.2.3.0")); 4449Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "Sparkle", "3.3.3.3")); 4450Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "9.0")); 4452Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3")); 4453Directory.CreateDirectory(Path.Combine(tempPath, "MyPlatform", "9.0", "PlatformAssembly", "Sparkle")); 4455Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "Sparkle")); 4458Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4461Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0", "SDKManifest.xml"), 4464Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "3.0", "SDKManifest.xml"), 4468Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "SDKManifest.xml"), 4471Path.Combine(tempPath, "SomeOtherPlace", "MyPlatformOtherLocation", "4.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4473File.WriteAllText(Path.Combine(tempPath, "Windows", "1.0", "SDKManifest.xml"), manifestPlatformSDK1); 4474File.WriteAllText(Path.Combine(tempPath, "Windows", "2.0", "SDKManifest.xml"), manifestPlatformSDK2); 4476Path.Combine(tempPath, "MyPlatform", "4.0", "ExtensionSDKs", "AnotherAssembly", "1.0", "SDKManifest.xml"), 4478File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "3.0", "SDKManifest.xml"), manifestPlatformSDK3); 4479File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "2.0", "SDKManifest.xml"), manifestPlatformSDK4); 4481Path.Combine(tempPath, "MyPlatform", "3.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4484Path.Combine(tempPath, "MyPlatform", "2.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4486File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "1.0", "SDKManifest.xml"), manifestPlatformSDK5); 4490Path.Combine(tempPath, "MyPlatform", "8.0", "SDKManifest.xml"), 4493Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "0.1.2.3", "Platform.xml"), 4496Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "PlatformAssembly", "1.2.3.0", "Platform.xml"), 4499Path.Combine(tempPath, "MyPlatform", "8.0", "Platforms", "Sparkle", "3.3.3.3", "Platform.xml"), 4503File.WriteAllText(Path.Combine(tempPath, "MyPlatform", "9.0", "SDKManifest.xml"), manifestPlatformSDK7); 4505Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "0.1.2.3", "Platform.xml"), 4508Path.Combine(tempPath, "MyPlatform", "9.0", "PlatformAssembly", "Sparkle", "Platform.xml"), 4511Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "PlatformAssembly", "Sparkle", "Platform.xml"), 4514Path.Combine(tempPath, "MyPlatform", "9.0", "Platforms", "Sparkle", "3.3.3.3")); // no platform.xml 4518Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "AnotherAssembly", "v1.1")); 4521Directory.CreateDirectory(Path.Combine(tempPath, "Windows", "v3.0") + Path.DirectorySeparatorChar); 4525Path.Combine(tempPath, "Windows", "NotAVersion") + Path.DirectorySeparatorChar); 4529Path.Combine(tempPath, "Windows", "NotAVersion", "ExtensionSDKs", "Assembly", "1.0")); 4545string tempPath = Path.Combine(Path.GetTempPath(), "FakeSDKDirectory2"); 4550Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0")); 4552Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0")); 4554Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0")); 4557Path.Combine(tempPath, "Windows", "v1.0", "ExtensionSDKs", "MyAssembly", "1.0", "SDKManifest.xml"), 4560Path.Combine(tempPath, "Windows", "1.0", "ExtensionSDKs", "MyAssembly", "2.0", "SDKManifest.xml"), 4563Path.Combine(tempPath, "Windows", "2.0", "ExtensionSDKs", "MyAssembly", "4.0", "SDKManifest.xml"),
ToolTask_Tests.cs (10)
39_fullToolName = Path.Combine( 77protected override string ToolName => Path.GetFileName(_fullToolName); 166t.FullToolName = Path.Combine(systemPath, NativeMethodsShared.IsWindows ? "attrib.exe" : "ps"); 387t.PathToToolUsed.ShouldBe(Path.Combine(systemPath, shellName)); 393t.PathToToolUsed.ShouldBe(Path.Combine(systemPath, copyName)); 438Path.Combine(systemPath, toolName)); 661env.SetEnvironmentVariable("PATH", $"{tempDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 664string directoryNamedSameAsTool = Directory.CreateDirectory(Path.Combine(tempDirectory, toolName)).FullName; 695expectedCmdPath = new[] { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe").ToUpperInvariant() }; 1026protected override string ToolName => Path.GetFileName(_pathToShell);
Microsoft.Cci.Extensions (9)
HostEnvironment.cs (9)
99string fileName = Path.GetFileName(location); 152string combinedPath = Path.Combine(libPath, assemblyPath); 199path = Path.Combine(probeDir, referencedAssembly.Name.Value + extension); 395: Path.GetDirectoryName(Path.GetFullPath(referringUnit.Location)); 482var coreAssemblyFile = contractSet.FirstOrDefault(c => Path.GetFileNameWithoutExtension(c).EndsWith(coreAssemblySimpleName, StringComparison.OrdinalIgnoreCase) == true); 749else if (Path.GetFileName(resolvedPath).Contains('*')) 756files = Directory.EnumerateFiles(Path.GetDirectoryName(resolvedPath), Path.GetFileName(resolvedPath));
Microsoft.CodeAnalysis (77)
AssemblyUtilities.cs (4)
30string? directory = Path.GetDirectoryName(filePath); 32string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); 38string satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithExtension); 44satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithoutExtension, resourcesNameWithExtension);
CommandLine\AnalyzerConfig.cs (4)
167_hasGlobalFileName = Path.GetFileName(pathToFile).Equals(UserGlobalConfigName, StringComparison.OrdinalIgnoreCase); 170string directory = Path.GetDirectoryName(pathToFile) ?? pathToFile; 189if (pathToFile is null || !Path.IsPathRooted(pathToFile) || string.IsNullOrEmpty(Path.GetFileName(pathToFile)))
CommandLine\AnalyzerConfig.SectionNameMatching.cs (2)
192else if (Path.DirectorySeparatorChar == '/') 198else if (!sawStartChar && Path.DirectorySeparatorChar == '\\')
CommandLine\CommandLineArguments.cs (3)
345return Path.Combine(OutputDirectory, outputFileName); 365return PdbPath ?? Path.Combine(OutputDirectory, Path.ChangeExtension(outputFileName, ".pdb"));
CommandLine\CommandLineParser.cs (6)
297resolvedPath = Path.GetFullPath(resolvedPath); 301outputFileName = Path.GetFileName(resolvedPath); 302outputDirectory = Path.GetDirectoryName(resolvedPath); 469pdbPath = Path.ChangeExtension(Path.Combine(outputDirectory, outputFileName), ".pdb"); 494genericPath = Path.Combine(outputDirectory!, outputFileName);
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (3)
81var newFilePath = Path.Combine(Path.GetDirectoryName(_filePath)!, Guid.NewGuid().ToString() + "_" + Path.GetFileName(_filePath));
CommandLine\CommonCompiler.cs (4)
318var directory = Path.GetDirectoryName(normalizedPath) ?? normalizedPath; 1180Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1262emitOptions = emitOptions.WithPdbFilePath(Path.GetFileName(emitOptions.PdbFilePath)); 1753var filePath = Path.Combine(Arguments.OutputDirectory, Arguments.OutputFileName + ".key");
CommandLine\SarifErrorLogger.cs (2)
133if (Path.IsPathRooted(path)) 137var fullPath = Path.GetFullPath(path);
Compilation.EmitStream.cs (1)
147tempFilePath = Path.Combine(tempDir, Guid.NewGuid().ToString("N"));
Compilation\DeterministicKeyBuilder.cs (1)
52filePath = Path.GetFileName(filePath);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (5)
85var fullDirectoryPath = Path.GetDirectoryName(resolvedPath) ?? throw new ArgumentException(message: null, paramName: nameof(resolvedPath)); 118var assemblyPath = Path.Combine(directory, simpleName + ".dll"); 134var analyzerFileName = Path.ChangeExtension(simpleName, ".dll"); 135var analyzerFilePath = Path.Combine(directory, analyzerFileName); 204var assemblyPath = Path.Combine(Directory, unmanagedDllName + ".dll");
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (4)
307var assemblyFileName = Path.GetFileName(assemblyFilePath); 308var satelliteAssemblyName = Path.ChangeExtension(assemblyFileName, ".resources.dll"); 309var path = Path.GetDirectoryName(assemblyFilePath); 317var filePath = Path.Combine(path, cultureInfo.Name, satelliteAssemblyName);
DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (12)
81if (!Path.IsPathRooted(baseDirectory)) 92ShadowDirectory = Path.Combine(BaseDirectory, shadowDirectoryName); 124string name = Path.GetFileName(subDirectory).ToLowerInvariant(); 189var analyzerShadowPath = Path.Combine(analyzerShadowDir, Path.GetFileName(originalAnalyzerPath)); 203var satelliteFileName = Path.GetFileName(satelliteFilePath); 204var satelliteDirectoryName = Path.GetFileName(Path.GetDirectoryName(satelliteFilePath)); 205var shadowSatellitePath = Path.Combine(analyzerShadowDir, satelliteDirectoryName!, satelliteFileName); 215var originalDirName = Path.GetDirectoryName(analyzerFilePath)!; 217return Path.Combine(ShadowDirectory, shadowDirName); 258var directory = Path.GetDirectoryName(shadowCopyPath);
DiaSymReader\SymUnmanagedFactory.cs (1)
120var moduleHandle = LoadLibrary(Path.Combine(dir, DiaSymReaderModuleName));
FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
MetadataReference\AssemblyMetadata.cs (2)
169return new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.CreateFromFile(Path.Combine(Path.GetDirectoryName(path) ?? "", moduleName)));
RuleSet\RuleSetInclude.cs (4)
90return Path.GetFullPath(resolvedIncludePath); 98includePath = includePath.Replace('\\', Path.DirectorySeparatorChar); 110if (Path.IsPathRooted(includePath)) 120includePath = PathUtilities.CombinePathsUnchecked(Path.GetDirectoryName(parentRulesetPath) ?? "", includePath);
SourceGeneration\GeneratorDriver.cs (2)
375var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 443return Path.Combine(baseDirectory ?? "", type.Assembly.GetName().Name ?? string.Empty, type.FullName!);
src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
60var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Analyzers (37)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (4)
130string arg4 = Path.GetFileName(additionalText.Path); 184string arg2 = Path.GetFileName(additionalText.Path); 218string fileName = Path.GetFileName(textFile.Path); 336string arg2 = Path.GetFileName(additionalText.Path);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (4)
203string arg3 = Path.GetFileName(path); 234string arg1 = Path.GetFileName(path); 257string fileName = Path.GetFileName(text.Path); 466string arg1 = Path.GetFileName(releaseTrackingLine.Path);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (2)
27if (string.Equals(".resx", Path.GetExtension(file.Path), StringComparison.OrdinalIgnoreCase)) 59var fileName = Path.GetFileName(file.Path);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.AnalyzerUtilities (25)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.BannedApiAnalyzers (28)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
SymbolIsBannedAnalyzer.cs (1)
60let fileName = Path.GetFileName(additionalFile.Path)
Microsoft.CodeAnalysis.CodeStyle (20)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
151var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
77var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.Collections.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Contracts.Package (1)
Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.CSharp (3)
CommandLine\CSharpCommandLineParser.cs (1)
1440metadataReferences.Insert(0, new CommandLineReference(Path.Combine(sdkDirectory, "mscorlib.dll"), MetadataReferenceProperties.Assembly));
CommandLine\CSharpCompiler.cs (1)
263return Path.ChangeExtension(entryPointFileName, ".exe");
Utilities\InterceptableLocation.cs (1)
106var displayFileName = Path.GetFileName(_path);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (27)
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (27)
35=> Path.Combine(Directory, Path.Combine(folders)); 39var filePath = Path.Combine(directory ?? Directory, fileName); 385(Path.Combine(folder, "ABClass1.cs"), code1), 386(Path.Combine(folder, "ABClass2.cs"), code2), 399var folder = Path.Combine("B", "C"); 532(Path.Combine(folder, "Class1.cs"), code1), 538(Path.Combine(folder, "Class1.cs"), fixed1), 640(Path.Combine(folder, "Class1.cs"), code1), 646(Path.Combine(folder, "Class1.cs"), fixed1), 750(Path.Combine(folder1, "Class1.cs"), code1), 751(Path.Combine(folder2, "Class2.cs"), code2), 752(Path.Combine(folder3, "Class3.cs"), code3), 757(Path.Combine(folder1, "Class1.cs"), fixed1), 758(Path.Combine(folder2, "Class2.cs"), fixed2), 759(Path.Combine(folder3, "Class3.cs"), fixed3), 861var project2folder = Path.Combine(project2Directory, "A", "B", "C"); 901(Path.Combine(folder1, "Class1.cs"), code1), 902(Path.Combine(folder2, "Class2.cs"), code2), 903(Path.Combine(folder3, "Class3.cs"), code3), 910Sources = { (Path.Combine(project2folder, "P.cs"), project2Source) }, 911AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) }, 919(Path.Combine(folder1, "Class1.cs"), fixed1), 920(Path.Combine(folder2, "Class2.cs"), fixed2), 921(Path.Combine(folder3, "Class3.cs"), fixed3), 928Sources = { (Path.Combine(project2folder, "P.cs"), project2FixedSource) }, 929AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) },
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (277)
CommandLineIVTTests.cs (12)
44var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 121var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 200var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 285var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
CommandLineTestBase.cs (2)
32MscorlibFullPath = Path.Combine(SdkDirectory, "mscorlib.dll"); 41File.WriteAllBytes(Path.Combine(dir.Path, "mscorlib.dll"), Net461.ReferenceInfos.mscorlib.ImageBytes);
CommandLineTests.cs (239)
64var cscDllPath = Path.Combine( 65Path.GetDirectoryName(typeof(CommandLineTests).GetTypeInfo().Assembly.Location), 66Path.Combine("dependency", "csc.dll")); 70var netStandardDllDir = Path.GetDirectoryName(netStandardDllPath); 73var runtimeConfigPath = Path.ChangeExtension(Assembly.GetExecutingAssembly().Location, "runtimeconfig.json"); 77s_CSharpScriptExecutable = s_CSharpCompilerExecutable.Replace("csc.dll", Path.Combine("csi", "csi.dll")); 154string exePath = Path.Combine(dir.Path, "temp.exe"); 174var xmlPath = Path.Combine(dir.Path, docName); 410var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path); 412Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932))); 430var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path); 432Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932))); 462AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "a.cs"), Path.Combine(WorkingDirectory, "b.cs") }, cmd.Arguments.SourceFiles.Select(file => file.Path)); 479Func<string, string> prependBasePath = fileName => Path.Combine(basePath, fileName); 491{ Path.Combine(dirSubDir.Path, @"b.rsp"), @" 499{ Path.Combine(Path.GetPathRoot(basePath), @"d.rsp"), @" 1533Diagnostic(ErrorCode.ERR_OpenResponseFile).WithArguments(Path.Combine(WorkingDirectory, @"roslyn_test_non_existing_file"))); 2009Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2022Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2029Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2096Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.PdbPath); 2097Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2101Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.PdbPath); 2102Assert.Equal(Path.Combine(WorkingDirectory, "something.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2109Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2113Assert.Equal(Path.Combine(WorkingDirectory, "a.pdb"), parsedArgs.GetPdbFilePath("a.dll")); 2148Assert.Equal(Path.Combine(Path.GetPathRoot(WorkingDirectory), @"MyFolder\MyPdb.pdb"), parsedArgs.PdbPath); 2212Assert.Equal(Path.Combine(WorkingDirectory, "sl.json"), parsedArgs.SourceLink); 2216Assert.Equal(Path.Combine(WorkingDirectory, "sl.json"), parsedArgs.SourceLink); 2220Assert.Equal(Path.Combine(WorkingDirectory, "s l.json"), parsedArgs.SourceLink); 2254var peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe")); 2286var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")); 2315var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")); 2334new[] { "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2340new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2346new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2352new[] { "a.cs", "b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2358new[] { "a,b.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2364new[] { "a.txt", "a.cs", "b.cs", "c.cs" }.Select(f => Path.Combine(WorkingDirectory, f)), 2478using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe")))) 2485MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")))) 2513symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))); 2543var name = Path.GetFileName(file); 2884Diagnostic(ErrorCode.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah"), "File not found.")); 2885Assert.Equal(expected: Path.Combine(TempRoot.Root, "blah"), actual: parsedArgs.RuleSetPath); 2889Diagnostic(ErrorCode.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah;blah.ruleset"), "File not found.")); 2890Assert.Equal(expected: Path.Combine(TempRoot.Root, "blah;blah.ruleset"), actual: parsedArgs.RuleSetPath); 3592" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3593" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3615" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context 3619" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3620" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3627" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context 3795Assert.Equal(Path.Combine(baseDirectory, "MyBinary.dll"), parsedArgs.GetOutputFilePath(parsedArgs.OutputFileName)); 4106Assert.Equal(Path.Combine(baseDirectory, "MyBinary.xml"), parsedArgs.DocumentationPath); 4210Assert.Equal(Path.Combine(baseDirectory, "MyBinary.xml"), parsedArgs.ErrorLogOptions.Path); 4331var srcDirectory = Path.GetDirectoryName(srcFile.Path); 4364var srcDirectory = Path.GetDirectoryName(srcFile.Path); 4365string root = Path.GetPathRoot(srcDirectory); // Make sure we pick a drive that exists and is plugged in to avoid 'Drive not ready' 4501using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe")))) 5657Assert.Equal(Path.Combine(WorkingDirectory, "test.snk"), parsedArgs.CompilationOptions.CryptoKeyFile); 5907var baseDir = Path.GetDirectoryName(source); 5944var baseDir = Path.GetDirectoryName(source2); 5964var baseDir = Path.GetDirectoryName(source2); 5975Assert.Equal("error CS7041: Each linked resource and module must have a unique filename. Filename '" + Path.GetFileName(modfile) + "' is specified more than once in this assembly", outWriter.ToString().Trim()); 6057var assemblyName = AssemblyName.GetAssemblyName(Path.Combine(tempDir, name)); 6493baseDirectory: Path.DirectorySeparatorChar == '\\' ? @"c:\" : "/"); 7090using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName)))) 7808Path.GetFileName(sourceFile.Path), 7818string.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)), 7819Path.GetFileName(sourceFile.Path), 7828IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002); 8016outWriter.ToString().Replace(Path.GetFileName(src.Path), "{FILE}").Trim()); 8263Assert.True(File.Exists(Path.Combine(dir.ToString(), "a.xml"))); 8396var baseDir = Path.GetDirectoryName(source); 8397var fileName = Path.GetFileName(source); 8455CleanupAllGeneratedFiles(Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(source)), Path.GetFileName(source))); 8533var baseDir = Path.GetDirectoryName(source); 8534var fileName = Path.GetFileName(source); 8539Assert.Equal(Path.GetFileName(source) + "(7,17): warning CS1634: Expected 'disable' or 'restore'", outWriter.ToString().Trim()); 8547exitCode = CreateCSharpCompiler(null, baseDir, new[] { "/nologo", "/preferreduilang:en", Path.Combine(baseDir, "nonexistent.cs"), source.ToString() }).Run(outWriter); 8549Assert.Equal("error CS2001: Source file '" + Path.Combine(baseDir, "nonexistent.cs") + "' could not be found.", outWriter.ToString().Trim()); 8572var baseDir = Path.GetDirectoryName(source); 8573var fileName = Path.GetFileName(source); 8596var baseDir = Path.GetDirectoryName(source); 8597var fileName = Path.GetFileName(source); 8630var baseDir = Path.GetDirectoryName(source); 8631var fileName = Path.GetFileName(source); 8650var baseDir = Path.GetDirectoryName(source); 8651var fileName = Path.GetFileName(source); 8675var baseDir = Path.GetDirectoryName(source); 8676var fileName = Path.GetFileName(source); 8702var baseDir = Path.GetDirectoryName(source); 8703var fileName = Path.GetFileName(source); 8710System.IO.File.Delete(System.IO.Path.Combine(baseDir, "goo.dll")); 8857AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8914AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8955AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8989var exePath = Path.Combine(Path.GetDirectoryName(srcPath), "test.exe"); 9011var exePath = Path.Combine(Path.GetDirectoryName(srcPath), "test.exe"); 9012var pdbPath = Path.ChangeExtension(exePath, "pdb"); 9034var xmlPath = Path.Combine(Path.GetDirectoryName(srcPath), "test.xml"); 9058var sourceLinkPath = Path.Combine(Path.GetDirectoryName(srcPath), "test.json"); 9086string exePath = Path.Combine(Path.GetDirectoryName(sourcePath), "test.exe"); 9111string exePath = Path.Combine(Path.GetDirectoryName(sourcePath), "test.exe"); 9112string pdbPath = Path.ChangeExtension(exePath, ".pdb"); 9137string xmlPath = Path.Combine(WorkingDirectory, "Test.xml"); 9240string xmlPath = Path.Combine(WorkingDirectory, "Test.xml"); 9436var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9494var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9527var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9567workingDirectory: Path.GetDirectoryName(srcFile.Path), 9587var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9612var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9634var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9662var expectedPath = Path.GetDirectoryName(WorkingDirectory); 9883Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles.Single().Path); 9888Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9889Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9894Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9895Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[1].Path); 9899Assert.Equal(Path.Combine(WorkingDirectory, "..\\web.config"), args.AdditionalFiles.Single().Path); 9909Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path); 9910Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path); 9911Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path); 9916Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9917Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9922Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9923Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9928Assert.Equal(Path.Combine(WorkingDirectory, "web.config"), args.AdditionalFiles[0].Path); 9929Assert.Equal(Path.Combine(WorkingDirectory, "app.manifest"), args.AdditionalFiles[1].Path); 9934Assert.Equal(Path.Combine(WorkingDirectory, "web.config,app.manifest"), args.AdditionalFiles[0].Path); 9939Assert.Equal(Path.Combine(WorkingDirectory, "web.config:app.manifest"), args.AdditionalFiles[0].Path); 9955Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths.Single()); 9960Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]); 9961Assert.Equal(Path.Combine(WorkingDirectory, "subdir\\.editorconfig"), args.AnalyzerConfigPaths[1]); 9966Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]); 9967Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[1]); 9971Assert.Equal(Path.Combine(WorkingDirectory, "..\\.editorconfig"), args.AnalyzerConfigPaths.Single()); 9976Assert.Equal(Path.Combine(WorkingDirectory, ".editorconfig"), args.AnalyzerConfigPaths[0]); 9977Assert.Equal(Path.Combine(WorkingDirectory, "subdir\\.editorconfig"), args.AnalyzerConfigPaths[1]); 10057string fileName = Path.GetFileName(filePath); 11377Assert.True(File.Exists(Path.Combine(dir.ToString(), "doc.xml"))); 11392using (var reader = new StreamReader(Path.Combine(dir.ToString(), "doc.xml"))) 11398output = ProcessUtilities.RunAndGetOutput(Path.Combine(dir.ToString(), "out.exe"), startFolder: dir.ToString()); 11415Assert.Equal(Path.Combine(baseDirectory, @"a.pdb"), args.PdbPath); 11448AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11452AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "@script.csx") }, args.SourceFiles.Select(f => f.Path)); 11456AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "-script.csx") }, args.SourceFiles.Select(f => f.Path)); 11460AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11464AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11468AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11473AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11478AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "script.csx") }, args.SourceFiles.Select(f => f.Path)); 11483AssertEx.Equal(new[] { Path.Combine(WorkingDirectory, "--") }, args.SourceFiles.Select(f => f.Path)); 11602var dir = Path.Combine(WorkingDirectory, "a"); 11605Assert.Equal(Path.Combine(dir, @"data.pdb"), parsedArgs.PdbPath); 11628var exePath = Path.Combine(dir.Path, "a.exe"); 11640var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11647var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11654var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11662var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb"); 11669var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11676var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11683var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11746dir.CopyFile(Path.ChangeExtension(s_CSharpCompilerExecutable, ".exe.config"), "csc32.exe.config"); 11747dir.CopyFile(Path.Combine(Path.GetDirectoryName(s_CSharpCompilerExecutable), "csc.rsp")); 11808var exe = Path.Combine(dir.Path, "a.exe"); 11817var doc = Path.Combine(dir.Path, "doc.xml"); 11841var refDll = Path.Combine(refDir.Path, "a.dll"); 11872var dll = Path.Combine(dir.Path, "a.dll"); 11875var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")); 11924var refDll = Path.Combine(dir.Path, "a.dll"); 11935var pdb = Path.Combine(dir.Path, "a.pdb"); 11938var doc = Path.Combine(dir.Path, "doc.xml"); 12239var cscDir = Path.GetDirectoryName(s_CSharpCompilerExecutable); 12244var fileName = Path.GetFileName(filePath); 12256var cscCopy = Path.Combine(dir.Path, "csc.exe"); 12300var exePath = Path.Combine(dir.Path, "a.exe"); 13487string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13490string pdbPath = Path.Combine(dir.Path, pdbName); 13493string xmlDocFilePath = Path.Combine(dir.Path, docName); 13533string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13536string pdbPath = Path.Combine(dir.Path, pdbName); 13539string xmlDocFilePath = Path.Combine(dir.Path, docName); 13583string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13586string pdbPath = Path.Combine(dir.Path, pdbName); 13589string xmlDocFilePath = Path.Combine(dir.Path, docName); 13614string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13932ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true); 13973ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true); 14016{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1}, 14017{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2}, 14032var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 14033var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs"); 14052using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb"))) 14100{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } } 14124ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } }); 14131ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } }); 14194var generatedPath = Path.Combine(subdir, generatedFileName); 14202{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } } 14233var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll"); 14237options: TestOptions.DebugDll.WithCryptoKeyFile(Path.GetFileName(snk.Path)).WithStrongNameProvider(virtualSnProvider), 14255{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } } 14289var generatedDirPath = Path.Combine(dir.Path, "noexist"); 14317ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } }); 14328string baseDirectory = Path.Combine(root, "abc", "def"); 14344Assert.Equal(Path.Combine(baseDirectory, "outdir"), parsedArgs.GeneratedFilesOutputDirectory); 14348Assert.Equal(Path.Combine(baseDirectory, "outdir"), parsedArgs.GeneratedFilesOutputDirectory); 14352Assert.Equal(Path.Combine(baseDirectory, "out dir"), parsedArgs.GeneratedFilesOutputDirectory); 14356Assert.Equal(Path.Combine(baseDirectory, "out dir"), parsedArgs.GeneratedFilesOutputDirectory); 14358var absPath = Path.Combine(root, "outdir"); 14367absPath = Path.Combine(root, "generated files"); 14411string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write")); 15406var generatorPath = Path.Combine(directory.Path, "generator.dll"); 15442Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1))); 15443Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2))); 15449string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2);
SarifErrorLoggerTests.cs (10)
43var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 74var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 108var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 140var errorLogFile = Path.Combine(outputDir.Path, "ErrorLog.txt"); 141var outputFilePath = Path.Combine(outputDir.Path, "test.dll"); 177var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 212var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 247var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 282var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 315var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
SarifV2ErrorLoggerTests.cs (5)
447var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 529var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 599var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 669Assert.False(File.Exists(Path.Combine(mappedDir.Path, "otherfile.cs"))); 679var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
TouchedFileLoggingTests.cs (9)
40var touchedBase = Path.Combine(touchedDir.Path, "touched"); 49Path.ChangeExtension(hello, "exe"), 68var touchedBase = Path.Combine(touchedDir.Path, "touched"); 94Path.ChangeExtension(hello, "exe"), 115var touchedBase = Path.Combine(touchedDir.Path, "touched"); 127Path.ChangeExtension(hello, "exe"), 154var touchedBase = Path.Combine(touchedDir.Path, "touched"); 169Path.ChangeExtension(sourcePath, "dll"), 191</doc>", Path.GetFileNameWithoutExtension(sourcePath)).Trim(),
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (81)
Completion\CompletionProviders\AppDirectiveCompletionProviderTests.cs (2)
58var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 89var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs");
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (2)
85var systemDir = Path.GetFullPath(Environment.SystemDirectory); 91var windowsFolderName = Path.GetFileName(normalizedWindowsPath);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (5)
58var path = Path.Combine(Path.GetTempPath(), nameof(PdbSourceDocumentTests)); 324return Path.Combine(path, "reference.dll"); 329return Path.Combine(path, "source.cs"); 334return Path.Combine(path, "reference.pdb");
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (42)
34var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName; 35var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName; 36var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName; 46File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """ 68var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName; 69var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName; 70var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName; 80File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """ 104path = Path.Combine(path, "packs", "installed", "here"); 106var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName; 107var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName; 108var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName; 118File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """ 155var dllFilePath = Path.Combine(path, "implementation.dll"); 156var sourceCodePath = Path.Combine(path, "implementation.cs"); 157var pdbFilePath = Path.Combine(path, "implementation.pdb"); 163var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 203var dllFilePath = Path.Combine(path, "implementation.dll"); 204var sourceCodePath = Path.Combine(path, "implementation.cs"); 205var pdbFilePath = Path.Combine(path, "implementation.pdb"); 219var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 260var dllFilePath = Path.Combine(path, "implementation.dll"); 261var sourceCodePath = Path.Combine(path, "implementation.cs"); 262var pdbFilePath = Path.Combine(path, "implementation.pdb"); 276var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 311var dllFilePath = Path.Combine(path, "implementation.dll"); 312var sourceCodePath = Path.Combine(path, "implementation.cs"); 313var pdbFilePath = Path.Combine(path, "implementation.pdb"); 327var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 358var dllFilePath = Path.Combine(path, "implementation.dll"); 359var sourceCodePath = Path.Combine(path, "implementation.cs"); 360var pdbFilePath = Path.Combine(path, "implementation.pdb"); 374var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 416var dllFilePath = Path.Combine(path, "implementation.dll"); 417var sourceCodePath = Path.Combine(path, "implementation.cs"); 418var pdbFilePath = Path.Combine(path, "implementation.pdb"); 432var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 478var dllFilePath = Path.Combine(path, "implementation.dll"); 479var sourceCodePath = Path.Combine(path, "implementation.cs"); 480var pdbFilePath = Path.Combine(path, "implementation.pdb"); 494var typeForwardDllFilePath = Path.Combine(path, "typeforward.dll"); 502var realImplementationDllFilePath = Path.Combine(path, "realimplementation.dll");
PdbSourceDocument\PdbFileLocatorServiceTests.cs (3)
32var pdbFilePath = Path.Combine(path, "SourceLink.pdb"); 59var pdbFilePath = Path.Combine(path, "SourceLink.pdb"); 84var pdbFilePath = Path.Combine(path, "SourceLink.pdb");
PdbSourceDocument\PdbSourceDocumentLoaderServiceTests.cs (2)
35var sourceFilePath = Path.Combine(path, "SourceLink.cs"); 66var sourceFilePath = Path.Combine(path, "SourceLink.cs");
PdbSourceDocument\PdbSourceDocumentTests.cs (24)
323Directory.CreateDirectory(Path.Combine(path, "ref")); 324Directory.CreateDirectory(Path.Combine(path, "lib")); 328var (project, symbol) = await CompileAndFindSymbolAsync(Path.Combine(path, "ref"), Location.Embedded, Location.OnDisk, sourceText, c => c.GetMember("C.E"), buildReferenceAssembly: true); 331CompileTestSource(Path.Combine(path, "lib"), sourceText, project, Location.Embedded, Location.Embedded, buildReferenceAssembly: false, windowsPdb: false); 348var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName; 349var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName; 350var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName; 360File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """ 381var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName; 382var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName; 383var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName; 401File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """ 422var packDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "ref", "net6.0")).FullName; 423var dataDir = Directory.CreateDirectory(Path.Combine(path, "packs", "MyPack.Ref", "1.0", "data")).FullName; 424var sharedDir = Directory.CreateDirectory(Path.Combine(path, "shared", "MyPack", "1.0")).FullName; 439var implementationDllFilePath = Path.Combine(sharedDir, "implementation.dll"); 440var sourceCodePath = Path.Combine(sharedDir, "implementation.cs"); 441var pdbFilePath = Path.Combine(sharedDir, "implementation.pdb"); 447var typeForwardDllFilePath = Path.Combine(sharedDir, "reference.dll"); 448sourceCodePath = Path.Combine(sharedDir, "reference.cs"); 449pdbFilePath = Path.Combine(sharedDir, "reference.pdb"); 459File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), """ 841CompileTestSource(dllFilePath, [Path.Combine(path, "source1.cs"), Path.Combine(path, "source2.cs")], pdbFilePath, "reference", [sourceText1, sourceText2], project, Location.Embedded, Location.Embedded, buildReferenceAssembly: false, windowsPdb: false);
Rename\CSharpInlineRenameServiceTests.cs (1)
81var escapedPath = Path.Combine(TestWorkspace.RootDirectory, "test1.cs").Replace("\\", "\\\\");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
Emit\CompilationEmitTests.cs (2)
4635var dllPath = Path.Combine(tmpDir.Path, "assemblyname.dll"); 4636var pdbPath = Path.Combine(tmpDir.Path, "assemblyname.pdb");
Emit\EmitMetadataTests.cs (2)
237var netModule1 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule1).GetReference(filePath: Path.GetFullPath("netModule1.netmodule")); 238var netModule2 = ModuleMetadata.CreateFromImage(TestResources.SymbolsTests.netModule.netModule2).GetReference(filePath: Path.GetFullPath("netModule2.netmodule"));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (6)
Emit\EditAndContinue\EditAndContinueTestBase.cs (4)
259File.WriteAllBytes(Path.Combine(outputDirectory, baseName + ".dll" + extSuffix), baseline.EmittedAssemblyData.ToArray()); 260File.WriteAllBytes(Path.Combine(outputDirectory, baseName + ".pdb" + extSuffix), baseline.EmittedAssemblyPdb.ToArray()); 264File.WriteAllBytes(Path.Combine(outputDirectory, $"{baseName}.{i + 1}.metadata{extSuffix}"), diffs[i].MetadataDelta.ToArray()); 265File.WriteAllBytes(Path.Combine(outputDirectory, $"{baseName}.{i + 1}.pdb{extSuffix}"), diffs[i].PdbDelta.ToArray());
PDB\PDBTests.cs (2)
117var path1 = Path.Combine("Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 118var path2 = Path.Combine("Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (11)
Attributes\AttributeTests_Security.cs (1)
1606string filePath = Path.Combine(tempDir.Path, "pset_01.xml");
Attributes\InternalsVisibleToAndStrongNameTests.cs (10)
134string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 135string keyFileName = Path.GetFileName(s_keyPairFile); 163string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 164string keyFileName = Path.GetFileName(s_keyPairFile); 223string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 224string keyFileName = Path.GetFileName(s_keyPairFile); 291string keyFileDir = Path.GetDirectoryName(s_keyPairFile); 292string keyFileName = Path.GetFileName(s_keyPairFile); 333string publicKeyFileDir = Path.GetDirectoryName(s_publicKeyFile); 334string publicKeyFileName = Path.GetFileName(s_publicKeyFile);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (33)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (5)
41AddTestDocument(source, path: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution; 457AddTestDocument(source, path: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution; 661var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 707var newSolution = oldSolution.AddDocument(newDocId, "goo.cs", SourceText.From(source2), filePath: Path.Combine(TempRoot.Root, "goo.cs")); 734var filePath = Path.Combine(TempRoot.Root, "src.cs");
EditAndContinue\Helpers\EditingTestBase.cs (1)
139=> Path.Combine(TempRoot.Root, documentIndex.ToString() + ".cs");
src\Analyzers\CSharp\Tests\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceTests.cs (27)
35=> Path.Combine(Directory, Path.Combine(folders)); 39var filePath = Path.Combine(directory ?? Directory, fileName); 385(Path.Combine(folder, "ABClass1.cs"), code1), 386(Path.Combine(folder, "ABClass2.cs"), code2), 399var folder = Path.Combine("B", "C"); 532(Path.Combine(folder, "Class1.cs"), code1), 538(Path.Combine(folder, "Class1.cs"), fixed1), 640(Path.Combine(folder, "Class1.cs"), code1), 646(Path.Combine(folder, "Class1.cs"), fixed1), 750(Path.Combine(folder1, "Class1.cs"), code1), 751(Path.Combine(folder2, "Class2.cs"), code2), 752(Path.Combine(folder3, "Class3.cs"), code3), 757(Path.Combine(folder1, "Class1.cs"), fixed1), 758(Path.Combine(folder2, "Class2.cs"), fixed2), 759(Path.Combine(folder3, "Class3.cs"), fixed3), 861var project2folder = Path.Combine(project2Directory, "A", "B", "C"); 901(Path.Combine(folder1, "Class1.cs"), code1), 902(Path.Combine(folder2, "Class2.cs"), code2), 903(Path.Combine(folder3, "Class3.cs"), code3), 910Sources = { (Path.Combine(project2folder, "P.cs"), project2Source) }, 911AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) }, 919(Path.Combine(folder1, "Class1.cs"), fixed1), 920(Path.Combine(folder2, "Class2.cs"), fixed2), 921(Path.Combine(folder3, "Class3.cs"), fixed3), 928Sources = { (Path.Combine(project2folder, "P.cs"), project2FixedSource) }, 929AnalyzerConfigFiles = { (Path.Combine(project2Directory, ".editorconfig"), project2EditorConfig) },
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
CsiTests.cs (1)
158+ <Initialize>.MoveNext(){string.Format(ScriptingResources.AtFileLine, $"{cwd}{Path.DirectorySeparatorChar}a.csx", "2")}
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (11)
CommandLineRunnerTests.cs (2)
249var error = $@"error CS2001: {string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "@arg1"))}"; 396var error = $@"error CS2001: {string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "a + b"))}";
InteractiveSessionReferencesTests.cs (1)
143File.Move(libBFile.Path, Path.Combine(dir.Path, "libB.dll"));
InteractiveSessionTests.cs (8)
1238string dir = Path.Combine(Path.GetDirectoryName(file.Path), "subdir"); 1239string libFileName = Path.GetFileName(file.Path); 1240string scriptPath = Path.Combine(dir, "a.csx"); 1243$@"#r ""{Path.Combine("..", libFileName)}""", 1256string root = Path.GetPathRoot(file.Path); 1259string dir = Path.Combine(root, "goo", "bar", "baz"); 1260string scriptPath = Path.Combine(dir, "a.csx");
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
SourceGeneration\GeneratorDriverTests.cs (5)
537Path.Combine(generator.GetType().Assembly.GetName().Name!, generator.GetType().FullName!, "source.cs"), 538Path.Combine(generator2.GetType().Assembly.GetName().Name!, generator2.GetType().FullName!, "source.cs") 3444context.AddSource(Path.GetFileName(text.Path), ""); 4300""", Path.Combine(projectDir, "src", "Program.cs")); 4307driverOptions: new GeneratorDriverOptions(baseDirectory: Path.Combine(projectDir, "obj")));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (13)
Compilation\ReferenceManagerTests.cs (2)
839string[] parts = path.Split(Path.DirectorySeparatorChar); 846return newParts.Join(Path.DirectorySeparatorChar.ToString());
DocumentationComments\DocumentationCommentCompilerTests.cs (9)
8359string fileName = Path.GetFileName(fullPath); 8360string dirPath = Path.GetDirectoryName(fullPath); 8365/// <include file='" + Path.Combine(dirPath, "a/..", fileName) + @"' path='hello'/> 8366/// <include file='" + Path.Combine(dirPath, @"a\b/../..", fileName) + @"' path='hello'/> 8400string xmlFilePath = Path.GetFileName(xmlFile.Path); 8401string dirPath = Path.GetDirectoryName(xmlFile.Path); 8402string sourcePath = Path.Combine(dirPath, "test.cs"); 8658$@"/// <include file='{Path.Combine(path, "---.xml")}' path='//summary'/> 8672<!-- Badly formed XML file ""{Path.Combine(TestHelpers.AsXmlCommentText(path), "- - -.xml")}"" cannot be included -->
Symbols\Source\FileModifierTests.cs (2)
832var testSource1 = CSharpTestSource.Parse(source, Path.Combine(root1, "code.cs")); 833var testSource2 = CSharpTestSource.Parse(source, Path.Combine(root2, "code.cs"));
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (4)
Metadata\WinMdDumpTest.cs (4)
457string fileExpected = Path.Combine(Path.GetTempPath(), "roslyn_winmd_dump.expected.txt"); 458string fileActual = Path.Combine(Path.GetTempPath(), "roslyn_winmd_dump.actual.txt");
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CSharpCommandLineParserServiceTests.cs (1)
14private static readonly string s_directory = Path.GetTempPath();
Microsoft.CodeAnalysis.Debugging.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.EditorFeatures (11)
EditorConfigSettings\Extensions\SolutionExtensions.cs (1)
16var directoryPathToCheck = Path.GetDirectoryName(pathToEditorConfigFile);
Interactive\InteractiveEvaluator.cs (2)
74Debug.Assert(languageInfo.InteractiveResponseFileName.IndexOfAny([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]) == -1);
Interactive\InteractiveSession.cs (5)
99_hostDirectory = Path.Combine(Path.GetDirectoryName(typeof(InteractiveSession).Assembly.Location), "InteractiveHost"); 230var hostPathDirectory = Path.GetDirectoryName(_hostOptions.HostPath); 234var newSubmissionFilePath = Path.Combine(hostPathDirectory, $"Submission{SubmissionCount}{_languageInfo.Extension}"); 250Path.GetFileName(initializationScriptPath),
Peek\PeekHelpers.cs (1)
19var fileName = Path.GetFileName(filePath);
Preview\AbstractPreviewFactoryService.cs (2)
622buffer, Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString(), document.Name));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\EditorTestWorkspace.cs (1)
536ChangedSourceGeneratedDocumentFileNames.Add(Path.GetFileName(document.FilePath));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (11)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (2)
121Assert.True(Path.IsPathRooted(portableExecutable.FilePath), $"'{portableExecutable.FilePath}' is not a fully-qualified file name"); 126Assert.True(Path.IsPathRooted(reference.Display), $"'{reference.Display}' is not a fully-qualified file name");
UnusedReferences\ProjectAssets\ProjectAssetsReaderTests.cs (2)
69=> new(ReferenceType.Project, projectPath, treatAsUsed, [Path.ChangeExtension(projectPath, "dll")], [.. dependencies]); 73=> new(ReferenceType.Package, Path.GetFileNameWithoutExtension(assemblyPath), treatAsUsed, [assemblyPath], [.. dependencies]);
UnusedReferences\ProjectAssets\TestProjectAssetsFile.cs (4)
53libraries.Add(Path.GetFileNameWithoutExtension(library.Path), library); 68Compile = new Dictionary<string, ProjectAssetsTargetLibraryCompile>() { { Path.ChangeExtension(reference.ItemSpecification, "dll"), new ProjectAssetsTargetLibraryCompile() } }, 71libraries[Path.GetFileNameWithoutExtension(reference.ItemSpecification)] = library; 89return references.ToDictionary(reference => Path.GetFileNameWithoutExtension(reference.ItemSpecification), reference => string.Empty);
UnusedReferences\UnusedReferencesRemoverTests.cs (3)
183itemSpecification: Path.GetFileName(assemblyPath), 192itemSpecification: Path.GetFileName(assemblyPath), 201itemSpecification: Path.GetFileName(assemblyPath),
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Extensions.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExternalAccess.HotReload.UnitTests (1)
HotReloadServiceTests.cs (1)
173.AddAdditionalDocument("A.txt", "text", filePath: Path.Combine(TempRoot.Root, "A.txt"))
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Analyzers\OmnisharpAnalyzerLoaderFactory.cs (2)
13baseDirectory ??= Path.Combine(Path.GetTempPath(), "CodeAnalysis", "OmnisharpAnalyzerShadowCopies");
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (5)
RazorAnalyzerAssemblyResolver.cs (5)
65var onDiskName = Path.Combine(directory, $"{fileName}.dll"); 87if (!Path.GetFileName(directory.AsSpan().TrimEnd(Path.DirectorySeparatorChar)).Equals(ServiceHubCoreFolderName, StringComparison.OrdinalIgnoreCase)) 89var serviceHubCoreDirectory = Path.Combine(directory, ServiceHubCoreFolderName); 98var assemblyPath = Path.Combine(directory, assemblyFileName);
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (9)
RazorAnalyzerAssemblyResolverTests.cs (9)
70var result = compilation.Emit(Path.Combine(directory, $"{simpleName}.dll")); 106File.Move(Path.Combine(dir1, fileName), Path.Combine(dir2, fileName)); 115expectedAssembly = context.LoadFromAssemblyPath(Path.Combine(dir2, fileName)); 162var serviceHubFolder = Path.Combine(dir, RazorAnalyzerAssemblyResolver.ServiceHubCoreFolderName); 166coreTest(dir + Path.DirectorySeparatorChar, serviceHubFolder); 168coreTest(serviceHubFolder + Path.DirectorySeparatorChar, serviceHubFolder); 172var name = Path.GetFileName(loadDir.AsSpan()); 187Assert.Equal(serviceHubFolder, Path.GetDirectoryName(assembly1.Location));
Microsoft.CodeAnalysis.Features (64)
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)
270var fileName = filePath == null ? null : IOUtilities.PerformIO(() => Path.GetFileName(filePath)) ?? filePath;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
160var directoryToCreate = Path.GetDirectoryName(fileInfo.TemporaryFilePath)!; 362Path.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)
226var 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)
52var filePath = Path.Combine(tempFilePath, Path.GetFileName(sourceDocument.FilePath)); 133var relativePath = Path.GetFileName(sourceDocument.FilePath);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
104telemetryMessage.SetDll(Path.GetFileName(dllPath)); 227var tempFilePath = Path.Combine(tempPath, projectId.Id.ToString()); 348name: Path.GetFileName(info.FilePath),
SemanticSearch\SemanticSearchWorkspace.cs (2)
21public static readonly string ReferenceAssembliesDirectory = Path.Combine(Path.GetDirectoryName(typeof(SemanticSearchWorkspace).Assembly.Location)!, "SemanticSearchRefs");
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
151var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
77var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
StackTraceExplorer\StackTraceExplorerService.cs (2)
96var documentName = Path.GetFileName(fileName); 108var name = Path.GetFileName(document.Name);
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (5)
101private readonly DirectoryInfo _cacheDirectoryInfo = new(Path.Combine( 141var invalidChars = new HashSet<char>(Path.GetInvalidFileNameChars()); 183Path.Combine(_cacheDirectoryInfo.FullName, ConvertToFileName(_source) + ".txt")); 344var tempFilePath = Path.Combine(_cacheDirectoryInfo.FullName, guidString + ".tmp"); 386=> new(Path.ChangeExtension(databaseFileInfo.FullName, ".bin"));
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (3)
78? Path.GetFileNameWithoutExtension(referenceInfo.ItemSpecification) 150compilationAssemblies.Add(Path.GetFullPath(Path.Combine(packagesPath, library.Path ?? "", assemblyPath)));
UnusedReferences\UnusedReferencesRemover.cs (1)
149.SelectAsArray(assemblyPath => Path.GetFileName(assemblyPath));
Workspace\CompileTimeSolutionProvider.cs (2)
50.SelectAsArray(static assemblyName => Path.Combine(assemblyName, RazorSourceGeneratorTypeName)); 222return Path.Combine(prefix, GetIdentifierFromPath(relativeDocumentPath)) + ".g.cs";
Microsoft.CodeAnalysis.Features.Test.Utilities (10)
EditAndContinue\ActiveStatementsDescription.cs (1)
145var documentName = filePaths?[sourceIndex] ?? Path.Combine(TempRoot.Root, TestWorkspace.GetDefaultTestSourceDocumentName(sourceIndex, extension ?? ""));
EditAndContinue\EditAndContinueTestVerifier.cs (1)
502var name = Path.GetFileNameWithoutExtension(oldPath);
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
154=> projectDirectory?.CreateFile(fileName).WriteAllText(content, Encoding.UTF8).Path ?? Path.Combine(TempRoot.Root, fileName); 316[(source, sourceFilePath ?? Path.Combine(TempRoot.Root, "test1.cs"))],
EditAndContinue\Extensions.cs (4)
116path = Path.Combine(Path.GetDirectoryName(solution.GetRequiredProject(projectId).FilePath!)!, path); 160filePath: Path.Combine(TempRoot.Root, projectName, projectName + language switch 168assemblyPath: Path.Combine(TempRoot.Root, projectName + ".dll"),
Snippets\AbstractSnippetProviderTests.cs (2)
45filePath: Path.Combine(TempRoot.Root, "TestDocument")); 52filePath: Path.Combine(TempRoot.Root, ".editorconfig"));
Microsoft.CodeAnalysis.Features.UnitTests (28)
EditAndContinue\CompileTimeSolutionProviderTests.cs (6)
30var projectFilePath = Path.Combine(TempRoot.Root, "a.csproj"); 31var additionalFilePath = Path.Combine(TempRoot.Root, "a", $"X.{kind}"); 32var designTimeFilePath = Path.Combine(TempRoot.Root, "a", $"X.{kind}.g.cs"); 35var sourceGeneratedPathPrefix = Path.Combine(TempRoot.Root, typeof(TestSourceGenerator).Assembly.GetName().Name!, typeof(TestSourceGenerator).FullName); 44assemblyPath: Path.Combine(TempRoot.Root, "proj"), 111assemblyPath: Path.Combine(TempRoot.Root, "proj"),
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (17)
122AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.Path, "dt1.cs"))). 605var newRefOutPath = Path.Combine(TempRoot.Root, "newRef"); 907var designTimeOnlyFilePath = Path.Combine(dir.Path, designTimeOnlyFileName); 2128var pathA = Path.Combine(TempRoot.Root, "A.cs"); 2129var pathB = Path.Combine(TempRoot.Root, "B.cs"); 2130var pathC = Path.Combine(TempRoot.Root, "C.cs"); 2131var pathD = Path.Combine(TempRoot.Root, "D.cs"); 2132var pathX = Path.Combine(TempRoot.Root, "X"); 2133var pathY = Path.Combine(TempRoot.Root, "Y"); 2134var pathCommon = Path.Combine(TempRoot.Root, "Common.cs"); 2206var pathX = Path.Combine(TempRoot.Root, "X.cs"); 2207var pathA = Path.Combine(TempRoot.Root, "A.cs"); 2387var pathA = Path.Combine(TempRoot.Root, "A.txt"); 2465var sourcePath = Path.Combine(TempRoot.Root, "A.cs"); 3768var generatedFilePath = Path.Combine( 4140AddDocument("DocB", source1, filePath: Path.Combine(TempRoot.Root, "DocB.cs")).Project; 4641var filePath = withPath ? Path.Combine(TempRoot.Root, "test.cs") : null;
EditAndContinue\EditSessionActiveStatementsTests.cs (1)
82solution = solution.AddDocument(id, name, text, filePath: Path.Combine(TempRoot.Root, name));
EditAndContinue\EmitSolutionUpdateResultsTests.cs (4)
69var sourcePath = Path.Combine(TempRoot.Root, "x", "a.cs"); 70var razorPath1 = Path.Combine(TempRoot.Root, "x", "a.razor"); 71var razorPath2 = Path.Combine(TempRoot.Root, "a.razor"); 76AddDocument(sourcePath, SourceText.From("class C {}", Encoding.UTF8), filePath: Path.Combine(TempRoot.Root, sourcePath));
Microsoft.CodeAnalysis.InteractiveHost (23)
Interactive\Core\InteractiveHost.Service.cs (5)
167Path.Combine(Path.GetTempPath(), "InteractiveHostShadow"), 522Console.Out.WriteLine(string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(initializationFilePath))); 529var rspDirectory = Path.GetDirectoryName(initializationFilePath); 733var directories = attemptedFilePaths.Select(path => Path.GetDirectoryName(path)).ToArray();
Interactive\Core\InteractiveHostOptions.cs (2)
66var hostPath = Path.Combine(hostDirectory, hostSubdirectory, hostExecutableFileName); 67var initializationFilePath = (initializationFileName != null) ? Path.Combine(hostDirectory, hostSubdirectory, initializationFileName) : null;
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.LanguageServer (40)
DotnetCliHelper.cs (2)
119var vstestConsole = Path.Combine(dotnetSdkFolder, "vstest.console.dll"); 141var filePath = Path.Combine(item, fileName);
FileBasedPrograms\VirtualProjectXmlProvider.cs (5)
83var workingDirectory = Path.GetDirectoryName(documentFilePath); 150=> Path.ChangeExtension(documentFilePath, ".csproj"); 188? Path.GetTempPath() 192string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 196return Path.Join(directory, "dotnet", "runfile", directoryName);
HostWorkspace\BinLogPathProvider.cs (1)
44var binaryLogPath = Path.Combine(binaryLogDirectory, $"LanguageServerDesignTimeBuild-{_binaryLogGuidSuffix}-{numericSuffix}.binlog");
HostWorkspace\FileWatching\LspFileChangeWatcher.cs (2)
156BaseUri = ProtocolConversions.CreateAbsoluteDocumentUri(Path.GetDirectoryName(filePath)!), 157Pattern = Path.GetFileName(filePath)
HostWorkspace\FileWatching\SimpleFileChangeWatcher.cs (2)
102var directoryPath = Path.GetDirectoryName(filePath); 107_watcher = new FileSystemWatcher(directoryPath, Path.GetFileName(filePath));
HostWorkspace\LanguageServerProjectLoader.cs (2)
390var projectName = Path.GetFileName(projectPath); 403message = string.Format(LanguageServerResources.There_were_problems_loading_project_0_See_log_for_details, Path.GetFileName(projectPath));
HostWorkspace\LoadedProject.cs (3)
61_projectDirectory = Path.GetDirectoryName(_projectFilePath)!; 155: Path.GetFileNameWithoutExtension(newProjectInfo.FilePath) + targetFrameworkSuffix; 314var extension = Path.GetExtension(info.FilePath);
HostWorkspace\ProjectTelemetry\ProjectLoadTelemetryReporter.cs (3)
117var fileExtension = Path.GetExtension(file); 130var lowerCaseName = Path.GetFileNameWithoutExtension(reference.Reference).ToLower(); 153return VsReferenceHashingAlgorithm.HashInput($"Filename: {Path.GetFileName(projectToLoad.Path)}\n{content}");
HostWorkspace\WorkspaceProject.cs (2)
183fileDirectory ??= Path.GetDirectoryName(_project.FilePath); 187return Path.Combine(fileDirectory, propertyValue);
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (1)
64var projectFileName = Path.GetFileName(projectPath);
LanguageServer\Handler\Restore\RestoreHandler.cs (2)
69var workingDirectory = Path.GetDirectoryName(path); 70var stageName = string.Format(LanguageServerResources.Restoring_0, Path.GetFileName(path));
Program.cs (5)
104var cacheDirectory = Path.Combine(Path.GetDirectoryName(typeof(Program).Assembly.Location)!, "cache"); 130Microsoft.CodeAnalysis.EditAndContinue.EditAndContinueMethodDebugInfoReader.IgnoreCaseWhenComparingDocumentNames = Path.DirectorySeparatorChar == '\\'; 335return Path.Combine(Path.GetTempPath(), pipeName + ".sock");
Services\ExtensionAssemblyManager.cs (5)
93var directory = Path.GetDirectoryName(assemblyFilePath); 141var devKitDependencyDirectory = Path.GetDirectoryName(devKitDependencyPath); 148var assemblyPath = Path.Combine(devKitDependencyDirectory, simpleName + ".dll"); 165var directory = Path.GetDirectoryName(assemblyFilePath); 213var assemblyPath = Path.Combine(_extensionDirectory, simpleName + ".dll");
Services\StarredCompletions\StarredCompletionsAssemblyHelper.cs (1)
60return Path.Combine(starredCompletionComponentPath, CompletionsDllName);
Testing\RunTestsHandler.cs (4)
46var projectOutputDirectory = Path.GetDirectoryName(projectOutputPath); 57LogFilePath = Path.Combine(serverConfiguration.ExtensionLogDirectory, "testLogs", "vsTestLogs.txt"), 124var workingDirectory = Path.GetDirectoryName(document.Project.FilePath); 127var projectFileName = Path.GetFileName(document.Project.FilePath);
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Extensions\Extensions.cs (4)
43var directoryName = Path.GetDirectoryName(document.FilePath); 46var path = Path.Combine(directoryName, document.Name); 55var projectDirectoryName = Path.GetDirectoryName(document.Project.FilePath); 57var path = Path.Combine([projectDirectoryName, .. document.Folders, document.Name]);
Extensions\ProtocolConversions.cs (2)
236if (path[^1] == System.IO.Path.DirectorySeparatorChar) 241Debug.Assert(!path.Split(System.IO.Path.DirectorySeparatorChar).Any(p => p == "." || p == ".."));
Features\DecompiledSource\AssemblyResolver.cs (2)
156var baseDirectory = Path.GetDirectoryName(mainModule.FileName); 157var moduleFileName = Path.Combine(baseDirectory, moduleName);
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
106var extension = Path.GetExtension(filePath);
LanguageInfoProvider.cs (1)
54var extension = Path.GetExtension(localPath);
Protocol\Extensions\VSLocation.cs (1)
24/// This doesn't have to correspond to a real file path, but must be parsable by the <see cref="System.IO.Path.GetFileName(string)" /> method.
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (13)
CodeActions\CodeActionResolveTests.cs (6)
302var newDocumentUri = ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(Path.GetDirectoryName(project.FilePath)!, "ABC.cs")); 410DocumentFileContainingFolders = [Path.Combine("dir1", "dir2", "dir3")], 432Assert.Contains(Path.Combine("dir1", "dir2", "dir3"), existingDocument.FilePath); 434Path.Combine(Path.GetDirectoryName(existingDocument.FilePath)!, "BCD.cs"));
Diagnostics\PullDiagnosticTests.cs (1)
1623Assert.Equal(ProtocolConversions.CreateAbsoluteDocumentUri(Path.Combine(TestWorkspace.RootDirectory, "test1.cs")), results[0].TextDocument!.DocumentUri);
InlineCompletions\TestSnippetInfoService.cs (1)
28var snippetsFile = Path.Combine(Directory.GetCurrentDirectory(), "InlineCompletions", "TestSnippets.snippet");
Options\SolutionAnalyzerConfigOptionsUpdaterTests.cs (3)
125filePath: Path.Combine(TempRoot.Root, "proj_without_config", "test.cs"))); 141filePath: Path.Combine(TempRoot.Root, "proj_with_config", ".editorconfig"))); 146filePath: Path.Combine(TempRoot.Root, "proj_with_config", "test.cs")));
ProtocolConversionsTests.cs (2)
29var invalidFileNameChars = Path.GetInvalidFileNameChars(); 90Assert.Equal(Path.GetFullPath(filePath).Replace('/', '\\'), uri.LocalPath);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (11)
TelemetryReporterTests.cs (1)
24Environment.SetEnvironmentVariable("CommonPropertyBagPath", Path.GetTempFileName());
Utilities\AbstractLanguageServerClientTests.cs (2)
45var projectPath = Path.Combine(projectDirectory.Path, "Project.csproj"); 59var codePath = Path.Combine(projectDirectory.Path, "Code.cs");
Utilities\AbstractLanguageServerClientTests.TestLspClient.cs (2)
77: Path.Combine(Path.GetTempPath(), pipeName + ".sock");
Utilities\TestPaths.cs (3)
16=> Path.Combine(AppContext.BaseDirectory, DevKitExtensionSubdirectory, DevKitAssemblyFileName); 25=> Path.Combine(AppContext.BaseDirectory, LanguageServerSubdirectory); 27=> Path.Combine(GetLanguageServerDirectory(), LanguageServerAssemblyFileName);
VirtualProjectXmlProviderTests.cs (1)
153var content = await projectProvider.GetVirtualProjectContentAsync(Path.Combine(tempDir.Path, "BAD"), LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
WorkspaceProjectFactoryServiceTests.cs (2)
64return Path.Combine("Z:\\", relativePath); 66return Path.Combine("//", relativePath);
Microsoft.CodeAnalysis.NetAnalyzers.UnitTests (3)
MiscellaneousAnalyzerTests.cs (2)
32var directory = Path.GetDirectoryName(testsAssemblyPath); 36var path = Path.Combine(directory, assembly);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (27)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.PooledObjects.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.PublicApiAnalyzers (26)
PublicApiFile.cs (1)
16var fileName = Path.GetFileName(path);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (3)
DeclarePublicAPIAnalyzerTestsBase.cs (3)
920var tempPath = Path.GetTempPath(); 921var shippedFilePath = Path.Combine(tempPath, ShippedFileName); 922var unshippedFilePath = Path.Combine(tempPath, UnshippedFileName);
Microsoft.CodeAnalysis.Rebuild (2)
CSharpCompilationFactory.cs (1)
51Path.GetFileNameWithoutExtension(AssemblyFileName),
VisualBasicCompilationFactory.cs (1)
51Path.GetFileNameWithoutExtension(AssemblyFileName),
Microsoft.CodeAnalysis.Rebuild.UnitTests (14)
RebuildCommandLineTests.cs (14)
26internal static string OutputDirectory { get; } = Path.Combine(TestableCompiler.RootDirectory, "output"); 38FilePathToStreamMap.Add(Path.Combine(BuildPaths.WorkingDirectory, filePath), new TestableFile(content)); 45filePath = Path.Combine(OutputDirectory, filePath); 55PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "dll"), 60PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "netmodule"), 65PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "dll"), 74PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "exe"), 79PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "exe"), 84PeFileName = Path.ChangeExtension(commandInfo.PeFileName, "exe"), 111Path.GetFileName(peFilePath), 194AddSourceFile(Path.Combine("dir1", "lib1.cs"), @" 228Permutate(new CommandInfo($"lib4.cs {Path.Combine("dir1", "lib1.cs")} /target:library", "test.dll", null), 390AddSourceFile(Path.Combine("dir1", "lib1.vb"), @" 424new CommandInfo(@$"lib2.vb {Path.Combine("dir1", "lib1.vb")} /target:library /debug:embedded", "test.dll", null),
Microsoft.CodeAnalysis.Remote.ServiceHub (9)
Host\RemoteAnalyzerPathResolver.cs (3)
20=> Path.GetFullPath(Path.Combine(_baseDirectory, Path.GetFileName(analyzerPath)));
Host\RemoteExportProviderBuilder.cs (1)
73cacheDirectory: Path.Combine(localSettingsDirectory, "Roslyn", "RemoteHost", "Cache"),
src\VisualStudio\Core\Def\Watson\FaultReporter.cs (5)
271var logPath = Path.Combine(Path.GetTempPath(), "VSLogs"); 287var logPath = Path.Combine(Path.GetTempPath(), "servicehub", "logs"); 322var name = Path.GetFileNameWithoutExtension(path);
Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests (3)
RemoteAnalyzerAssemblyLoaderTests.cs (3)
31var loader = Create(Path.GetDirectoryName(remoteAssemblyLocation)!); 53var loader = Create(Path.GetDirectoryName(featuresAssemblyLocation)!); 69var loader = Create(Path.GetDirectoryName(compilerAssemblyLocation)!);
Microsoft.CodeAnalysis.Remote.Workspaces (4)
ExportProviderBuilder.cs (4)
112return Path.Combine(CacheDirectory, $"{CatalogPrefix}.{ComputeAssemblyHash(AssemblyPaths)}{CatalogSuffix}"); 155var directory = Path.GetDirectoryName(compositionCacheFile)!; 160var tempFilePath = Path.Combine(directory, Path.GetRandomFileName());
Microsoft.CodeAnalysis.ResxSourceGenerator (28)
AbstractResxGenerator.cs (3)
82var resourceHintName = Path.GetFileNameWithoutExtension(resourceFile.Path); 86resourceName = relativeDir.Replace(Path.DirectorySeparatorChar, '.').Replace(Path.AltDirectorySeparatorChar, '.') + resourceName;
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
Microsoft.CodeAnalysis.ResxSourceGenerator.UnitTests (10)
Verifiers\CSharpSourceGeneratorVerifier`1+Test.cs (5)
84var resourceDirectory = Path.Combine(Path.GetDirectoryName(_testFile)!, "Resources", ResourceName); 91expectedNames.Add(Path.GetFileName(tree.FilePath)); 138var name = Path.GetFileName(tree.FilePath); 139var filePath = Path.Combine(resourceDirectory, name);
Verifiers\VisualBasicSourceGeneratorVerifier`1+Test.cs (5)
69var resourceDirectory = Path.Combine(Path.GetDirectoryName(_testFile)!, "Resources", ResourceName); 76expectedNames.Add(Path.GetFileName(tree.FilePath)); 123var name = Path.GetFileName(tree.FilePath); 124var filePath = Path.Combine(resourceDirectory, name);
Microsoft.CodeAnalysis.Scripting (30)
Hosting\AssemblyLoader\CoreAssemblyLoaderImpl.cs (1)
33var assembly = new LoadContext(Loader, Path.GetDirectoryName(path)).LoadFromAssemblyPath(path);
Hosting\AssemblyLoader\InteractiveAssemblyLoader.cs (3)
235loadDirectory = Path.GetDirectoryName(loadedAssembly.OriginalPath); 329string pathWithoutExtension = Path.Combine(directory, simpleName); 344string pathWithoutExtension = Path.Combine(directory, identity.Name);
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (18)
87_baseDirectory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 385string directory = Path.GetDirectoryName(fullPath); 410string shadowCopyPath = Path.Combine(assemblyCopyDir, Path.GetFileName(originalPath)); 467originalDirectory = Path.GetDirectoryName(originalPath); 468shadowCopyDirectory = Path.GetDirectoryName(shadowCopyPath); 472originalPath: Path.Combine(originalDirectory, moduleName), 473shadowCopyPath: Path.Combine(shadowCopyDirectory, moduleName)); 512string dir = Path.Combine(basePath, Guid.NewGuid().ToString()); 545string assemblyDirectory = Path.GetDirectoryName(originalAssemblyPath); 546string assemblyFileName = Path.GetFileName(originalAssemblyPath); 560Directory.CreateDirectory(Path.Combine(assemblyCopyDirectory, xmlSubdirectory)); 568string xmlCopyPath = Path.Combine(assemblyCopyDirectory, xmlSubdirectory, xmlFileName); 569string xmlOriginalPath = Path.Combine(assemblyDirectory, xmlSubdirectory, xmlFileName); 588docFileName = Path.ChangeExtension(assemblyFileName, ".xml"); 593if (File.Exists(Path.Combine(assemblyDirectory, docSubdirectory, docFileName))) 603if (File.Exists(Path.Combine(assemblyDirectory, docFileName)))
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (1)
201=> ((AppContext.GetData("TRUSTED_PLATFORM_ASSEMBLIES") as string)?.Split(Path.PathSeparator)).ToImmutableArrayOrEmpty();
src\Compilers\Shared\GlobalAssemblyCacheHelpers\MonoGlobalAssemblyCache.cs (7)
31s_corlibDirectory = Path.GetDirectoryName(corlibAssemblyFile); 34s_gacDirectory = Directory.GetParent(Path.GetDirectoryName(systemAssemblyFile)).Parent.FullName; 45var corlibFriendPath = Path.Combine(s_corlibDirectory, fileName); 49corlibFriendPath = Path.Combine(s_corlibDirectory, "Facades", fileName); 65yield return Path.Combine(gacPath, name, version + "__" + publicKeyToken, fileName); 70var gacAssemblyRootDir = new DirectoryInfo(Path.Combine(gacPath, name)); 88var assemblyPath = Path.Combine(assemblyDir.ToString(), fileName);
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (8)
GlobalAssemblyCacheTests.cs (1)
116Assert.Equal(Path.GetFullPath(location), location);
MetadataShadowCopyProviderTests.cs (7)
151AssertEx.SetEqual(new[] { "MultiModule.dll", "mod2.netmodule", "mod3.netmodule" }, scFiles.Select(p => Path.GetFileName(p))); 230Assert.Equal(Path.Combine(Path.GetDirectoryName(sc.PrimaryModule.FullPath), @"a.xml"), sc.DocumentationFile.FullPath); 236Assert.Equal(Path.Combine(Path.GetDirectoryName(sc.PrimaryModule.FullPath), @"el-GR", "a.xml"), sc.DocumentationFile.FullPath); 242Assert.Equal(Path.Combine(Path.GetDirectoryName(sc.PrimaryModule.FullPath), @"a.xml"), sc.DocumentationFile.FullPath);
Microsoft.CodeAnalysis.Scripting.TestUtilities (7)
CSharpScriptTestBase.cs (2)
32var clientDir = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(CSharpScriptTestBase)))!; 37tempDir: Path.GetTempPath());
TestRuntimeMetadataReferenceResolver.cs (4)
30string testDir = Path.GetDirectoryName(GetType().GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 31string testDependencyAssemblyPath = Path.Combine(testDir, name + ".dll"); 37string fxDir = Path.GetDirectoryName(typeof(object).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 38string fxAssemblyPath = Path.Combine(fxDir, name + ".dll");
VisualBasicScriptTestBase.cs (1)
30tempDir: Path.GetTempPath());
Microsoft.CodeAnalysis.SemanticSearch.Extensions (1)
ProjectModel.cs (1)
48var projectDirectory = Path.GetDirectoryName(FilePath)!;
Microsoft.CodeAnalysis.Test.Utilities (62)
Assert\ArtifactUploadUtil.cs (8)
78uploadDir = Path.Combine(uploadDir, _baseDirectoryName); 84var fileName = Path.GetFileName(filePath); 85File.Copy(filePath, Path.Combine(uploadDir, fileName)); 91var destDirectory = Path.Combine(uploadDir, Path.GetFileName(directory)); 98if (destFilePath.Length > 0 && destFilePath[0] == Path.DirectorySeparatorChar) 103destFilePath = Path.Combine(destDirectory, destFilePath); 104Directory.CreateDirectory(Path.GetDirectoryName(destFilePath)!);
Assert\AssertEx.cs (4)
591string file1 = Path.GetTempFileName(); 594string file2 = Path.GetTempFileName(); 844var actualFile = Path.GetTempFileName(); 864var compareCmd = Path.GetTempFileName() + ".cmd";
Assert\ConditionalFactAttribute.cs (4)
154public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 173var tempDir = Path.GetTempPath(); 174var path = Path.GetFullPath(Path.Combine(tempDir, "aux.txt"));
Compilation\CompilationTestDataExtensions.cs (1)
36var moduleName = Path.GetFileNameWithoutExtension(module.Name);
Compilation\RuntimeUtilities.cs (1)
47tempDirectory ??= Path.GetTempPath();
CompilationVerifier.cs (5)
96string modulePath = Path.Combine(dumpDir, emitData.EmittedModule.SimpleName + extension); 171var dumpDirectory = Path.Combine(dumpBasePath is "" ? TempRoot.Root : dumpBasePath, "dumps", dumpCount.ToString()); 198string pePath = Path.Combine(dumpDirectory, fileName + module.Kind.GetDefaultExtension()); 215pdbPath = Path.Combine(dumpDirectory, fileName + ".pdb"); 247File.WriteAllText(Path.Combine(dumpDirectory, "log.txt"), sb.ToString());
DotNetCoreSdk.cs (4)
25var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe"); 29&& File.Exists(Path.Combine(directory, dotNetExeName)); 35.Split(Path.PathSeparator) 41ExePath = Path.Combine(dotNetInstallDir, dotNetExeName);
Metadata\IlasmUtilities.cs (9)
43return Path.Combine( 44Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(object))), 49var directory = Path.GetDirectoryName(RuntimeUtilities.GetAssemblyLocation(typeof(RuntimeUtilities))); 68return Path.Combine(directory, "runtimes", ridName, "native", ilasmExeName); 80string sourceFileName = Path.GetFileNameWithoutExtension(sourceFile.Path); 82assemblyPath = Path.Combine( 84Path.ChangeExtension(Path.GetFileName(sourceFile.Path), "dll")); 115pdbPath = Path.ChangeExtension(assemblyPath, "pdb");
Mocks\VirtualizedRelativePathResolver.cs (1)
28return _existingFullPaths.Contains(Path.GetFullPath(fullPath));
Platform\CoreClr\AssemblyLoadContextUtils.cs (2)
27_probingPath = probingPath ?? Path.GetDirectoryName(typeof(SimpleAssemblyLoadContext).Assembly.Location)!; 32var assemblyPath = Path.Combine(_probingPath, $"{assemblyName.Name}.dll");
Platform\Custom\SigningTestHelpers.cs (1)
21new DesktopStrongNameProvider(ImmutableArray<string>.Empty, new VirtualizedStrongNameFileSystem(Path.GetTempPath()));
SharedResourceHelpers.cs (4)
18string directory = System.IO.Path.GetDirectoryName(filename); 19string filenamewithoutextension = System.IO.Path.GetFileNameWithoutExtension(filename); 23if (System.IO.Path.GetFileName(f) != System.IO.Path.GetFileName(filename))
TempFiles\TempDirectory.cs (6)
36string dir = System.IO.Path.Combine(basePath, Guid.NewGuid().ToString()); 60string filePath = System.IO.Path.Combine(_path, name); 70string filePath = System.IO.Path.Combine(_path, name); 80string filePath = System.IO.Path.Combine(_path, name ?? System.IO.Path.GetFileName(originalPath)); 91string dirPath = System.IO.Path.Combine(_path, name);
TempFiles\TempFile.cs (2)
35prefix = System.IO.Path.GetFileName(callerSourcePath) + "_" + callerLineNumber.ToString() + "_"; 38_path = System.IO.Path.Combine(directory ?? TempRoot.Root, prefix + Guid.NewGuid() + (extension ?? ".tmp"));
TempFiles\TempRoot.cs (2)
22Root = Path.Combine(Path.GetTempPath(), "RoslynTests");
TestableCompiler.cs (8)
51clientDir: Path.Combine(RootDirectory, "compiler"), 52workingDir: Path.Combine(RootDirectory, "source"), 53sdkDir: Path.Combine(RootDirectory, "sdk"), 78filePath = Path.Combine(BuildPaths.WorkingDirectory, filePath); 86filePath = Path.Combine(BuildPaths.SdkDirectory!, filePath); 94filePath = Path.Combine(BuildPaths.WorkingDirectory, filePath); 174args.Add($@"-vbruntime:""{Path.Combine(buildPaths.SdkDirectory, "Microsoft.VisualBasic.dll")}"""); 217fileSystem.Map[Path.Combine(sdkPath, referenceInfo.FileName)] = new TestableFile(referenceInfo.ImageBytes);
Microsoft.CodeAnalysis.Threading.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.UnitTests (34)
AnalyzerAssemblyLoaderTests.cs (13)
276var path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".dll"); 341var analyzerPath = Path.Combine(tempDir.CreateDirectory("a").Path, "analyzer.dll"); 454var assemblyFileName = Path.ChangeExtension(Path.GetFileNameWithoutExtension(originalSatelliteFullPath), ".dll"); 456var assemblyDir = Path.GetDirectoryName(originalSatelliteFullPath)!; 457var cultureInfo = CultureInfo.GetCultureInfo(Path.GetFileName(assemblyDir)); 458assemblyDir = Path.GetDirectoryName(assemblyDir)!; 461var assemblyPath = Path.Combine(assemblyDir, assemblyFileName); 1786var name = Path.GetFileNameWithoutExtension(TestFixture.Delta1); 1809var name = Path.GetFileNameWithoutExtension(TestFixture.Delta1); 1822Assert.Equal([Path.GetFileNameWithoutExtension(TestFixture.Delta1)], resolver.CalledFor.Select(x => x.Name));
Analyzers\AnalyzerFileReferenceTests.cs (4)
66var path1 = Path.Combine(TempRoot.Root, "dir"); 67var path2 = Path.Combine(TempRoot.Root, "dir", "..", "dir"); 164AnalyzerFileReference reference = CreateAnalyzerFileReference(Path.Combine(TempRoot.Root, "random.dll")); 482var generatorPath = Path.Combine(directory.Path, $"generator_{targetFramework}.dll");
FileSystem\PathUtilitiesTests.cs (4)
22var dotnetName = Path.GetDirectoryName(fullPath); 364Assert.Equal(Path.Combine(path1, path2), PathUtilities.CombinePaths(path1, path2)); 381Assert.Equal(Path.Combine(path1, path2), PathUtilities.CombinePaths(path1, path2)); 393Assert.Equal(Path.Combine(path1, path2), PathUtilities.CombinePaths(path1, path2));
FileUtilitiesTests.cs (3)
209Assert.Equal(expected, Path.GetExtension(path)); 215Assert.Equal(expected, Path.GetFileNameWithoutExtension(path)); 221Assert.Equal(expected, Path.ChangeExtension(path, extension));
ShadowCopyAnalyzerPathResolverTests.cs (9)
55var analyzerPath = Path.Combine(TempRoot.CreateDirectory().Path, "analyzer.dll"); 63var analyzerPath = Path.Combine(TempRoot.CreateDirectory().Path, "analyzer.dll"); 78var analyzer1Path = Path.Combine(dir, "analyzer1.dll"); 80var analyzer2Path = Path.Combine(dir, "analyzer2.dll"); 84Assert.Equal(Path.GetDirectoryName(shadow1Path), Path.GetDirectoryName(shadow2Path)); 101var groupDir = Path.Combine(dir, groupName, "analyzers"); 103var filePath = Path.Combine(groupDir, name); 104File.WriteAllText(filePath, $"{Path.GetFileName(groupName)}-{name}");
SourceFileResolverTest.cs (1)
23if (Path.DirectorySeparatorChar == '/')
Microsoft.CodeAnalysis.Workspaces (89)
Diagnostics\DiagnosticDataLocation.cs (1)
90return Path.GetFullPath(combined);
Rename\ConflictEngine\MutableConflictResolution.cs (5)
95var extension = Path.GetExtension(document.Name); 96var newName = Path.ChangeExtension(ReplacementText, extension); 106var newDocumentFilePath = Path.Combine(directory, newName); 120newName = Path.ChangeExtension(nameWithoutExtension, extension); 121newDocumentFilePath = Path.Combine(directory, newName);
Serialization\AbstractOptionsSerializationService.cs (1)
162var strongNameProvider = new DesktopStrongNameProvider([], Path.GetTempPath());
Serialization\SerializationExtensions.cs (1)
39.WithStrongNameProvider(new DesktopStrongNameProvider(GetStrongNameKeyPaths(info), Path.GetTempPath()));
Shared\TestHooks\AsynchronousOperationListener+DiagnosticAsyncToken.cs (1)
32public override string ToString() => $"{Name} {Path.GetFileName(FilePath)} {LineNumber}";
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (5)
85var fullDirectoryPath = Path.GetDirectoryName(resolvedPath) ?? throw new ArgumentException(message: null, paramName: nameof(resolvedPath)); 118var assemblyPath = Path.Combine(directory, simpleName + ".dll"); 134var analyzerFileName = Path.ChangeExtension(simpleName, ".dll"); 135var analyzerFilePath = Path.Combine(directory, analyzerFileName); 204var assemblyPath = Path.Combine(Directory, unmanagedDllName + ".dll");
src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (4)
307var assemblyFileName = Path.GetFileName(assemblyFilePath); 308var satelliteAssemblyName = Path.ChangeExtension(assemblyFileName, ".resources.dll"); 309var path = Path.GetDirectoryName(assemblyFilePath); 317var filePath = Path.Combine(path, cultureInfo.Name, satelliteAssemblyName);
src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (12)
81if (!Path.IsPathRooted(baseDirectory)) 92ShadowDirectory = Path.Combine(BaseDirectory, shadowDirectoryName); 124string name = Path.GetFileName(subDirectory).ToLowerInvariant(); 189var analyzerShadowPath = Path.Combine(analyzerShadowDir, Path.GetFileName(originalAnalyzerPath)); 203var satelliteFileName = Path.GetFileName(satelliteFilePath); 204var satelliteDirectoryName = Path.GetFileName(Path.GetDirectoryName(satelliteFilePath)); 205var shadowSatellitePath = Path.Combine(analyzerShadowDir, satelliteDirectoryName!, satelliteFileName); 215var originalDirName = Path.GetDirectoryName(analyzerFilePath)!; 217return Path.Combine(ShadowDirectory, shadowDirName); 258var directory = Path.GetDirectoryName(shadowCopyPath);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Storage\AbstractPersistentStorageService.cs (1)
109IOUtilities.PerformIO(() => Directory.Delete(Path.GetDirectoryName(databaseFilePath)!, recursive: true));
Storage\SQLite\v2\SQLitePersistentStorage.cs (3)
148var directoryName = Path.GetDirectoryName(databaseFilePath); 152Path.Combine(directoryName, LockFile), 158var directory = Path.GetDirectoryName(databaseFilePath);
Storage\SQLite\v2\SQLitePersistentStorageService.cs (1)
64return Path.Combine(workingFolderPath, StorageExtension, nameof(v2), PersistentStorageFileName);
Utilities\WorkspacePathUtilities.cs (2)
35/// such that <see cref="Path.GetFileNameWithoutExtension(string?)"/> would throw. 44return IOUtilities.PerformIO(() => Path.GetFileNameWithoutExtension(document.Name));
Workspace\CommandLineProject.cs (10)
47var strongNameProvider = new DesktopStrongNameProvider(commandLineArguments.KeyFileSearchPaths, Path.GetTempPath()); 111Path.GetFileNameWithoutExtension(commandLineArguments.OutputFileName) : "<anonymous>"; 151var absolutePath = Path.IsPathRooted(fileArg.Path) || string.IsNullOrEmpty(projectDirectory) 152? Path.GetFullPath(fileArg.Path) 153: Path.GetFullPath(Path.Combine(projectDirectory, fileArg.Path)); 158var folderRoot = isWithinProject ? Path.GetDirectoryName(relativePath) : ""; 160var name = Path.GetFileName(relativePath); 189private static readonly char[] s_folderSplitters = [Path.DirectorySeparatorChar]; 193var directory = Path.GetDirectoryName(path);
Workspace\Host\Documentation\DocumentationProviderServiceFactory.cs (1)
36assemblyPath = Path.ChangeExtension(assemblyPath, "xml");
Workspace\Host\Metadata\IAnalyzerAssemblyLoaderProvider.cs (2)
55Path.Combine(Path.GetTempPath(), nameof(Roslyn), "AnalyzerAssemblyLoader"),
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (1)
21public string DatabaseDirectory => Path.GetDirectoryName(DatabaseFile) ?? throw ExceptionUtilities.UnexpectedValue(DatabaseFile);
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (4)
39private static readonly ImmutableArray<char> s_invalidPathChars = [.. Path.GetInvalidPathChars(), '/']; 51s_cacheDirectory = Path.Combine(appDataFolder, "Microsoft", "VisualStudio", "Roslyn", "Cache"); 73return Path.Combine( 81var fileName = Path.GetFileName(fullPath);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (4)
87referenceDirectories.Add(Path.Combine(dotnetRoot, "packs")); 92referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies", "Microsoft", "Framework")); 93referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "dotnet", "packs")); 110referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages"));
Workspace\ProjectSystem\IFileChangeWatcher.cs (2)
34if (!path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) 36path += System.IO.Path.DirectorySeparatorChar;
Workspace\ProjectSystem\ProjectSystemProject.cs (4)
207var rootPath = Path.GetDirectoryName(filePath); 1136fullPath = Path.GetFullPath(fullPath); 1193private static string CreateDirectoryPathFragment(params string[] paths) => Path.Combine([" ", .. paths, " "]).Trim(); 1196fullPath.LastIndexOf(Path.DirectorySeparatorChar);
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (3)
133_commandLineArgumentsForCommandLine = _commandLineParserService.Parse(arguments, Path.GetDirectoryName(_project.FilePath), isInteractive: false, sdkDirectory: null); 174.WithStrongNameProvider(new DesktopStrongNameProvider([.. _commandLineArgumentsForCommandLine.KeyFileSearchPaths.WhereNotNull()], Path.GetTempPath())); 192? Path.Combine(_commandLineArgumentsForCommandLine.OutputDirectory, _commandLineArgumentsForCommandLine.OutputFileName)
Microsoft.CodeAnalysis.Workspaces.MSBuild (48)
MSBuild\BuildHostProcessManager.cs (7)
33private static string MSBuildWorkspaceDirectory => Path.GetDirectoryName(typeof(BuildHostProcessManager).Assembly.Location) ?? AppContext.BaseDirectory; 34private static bool IsLoadedFromNuGetPackage => File.Exists(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "microsoft.codeanalysis.workspaces.msbuild.nuspec")); 145dotnetPath = Path.GetFullPath(Path.Combine(msbuildLocation.Path, $"../../{DotnetExecutable}")); 296buildHostPath = Path.GetFullPath(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "contentFiles", "any", "any", contentFolderName, assemblyName)); 301buildHostPath = Path.Combine(MSBuildWorkspaceDirectory, contentFolderName, assemblyName);
MSBuild\MSBuildProjectLoader.cs (7)
197baseDirectory: Path.GetDirectoryName(absoluteSolutionPath)!, 300_directory = Path.GetDirectoryName(logFilePath) ?? "."; 301_filename = Path.GetFileNameWithoutExtension(logFilePath) is { Length: > 0 } fileName 304_extension = Path.GetExtension(logFilePath) is { Length: > 0 } extension 314? Path.Combine(_directory, _filename + _extension) 315: Path.Combine(_directory, $"{_filename}-{suffix}{_extension}"); 317return Path.GetFullPath(newPath);
MSBuild\MSBuildProjectLoader.Worker.cs (6)
271var projectName = Path.GetFileNameWithoutExtension(projectPath) ?? string.Empty; 309var projectDirectory = Path.GetDirectoryName(projectPath); 349.WithStrongNameProvider(new DesktopStrongNameProvider(commandLineArgs.KeyFileSearchPaths, Path.GetTempPath())) 389var assemblyName = Path.GetFileNameWithoutExtension(projectFilePath); 452private static readonly char[] s_directorySplitChars = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (1)
197var projectDirectory = Path.GetDirectoryName(projectFileInfo.FilePath);
MSBuild\MSBuildWorkspace.cs (10)
164return Path.GetFullPath(FileUtilities.ResolveRelativePath(path, baseDirectoryPath) ?? path); 464var fileName = Path.ChangeExtension(info.Name, extension); 467? Path.Combine(Path.Combine([.. info.Folders]), fileName) 470var fullPath = GetAbsolutePath(relativePath, Path.GetDirectoryName(project.FilePath)!); 493var dir = Path.GetDirectoryName(fullPath); 560s_frameworkRoot = Path.GetDirectoryName(runtimeDir); // back out one directory level to be root path of all framework versions 594var fileName = identity != null ? identity.Name : Path.GetFileNameWithoutExtension(peRef.FilePath); 599var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(CurrentSolution.GetRequiredProject(projectId).FilePath)!, peRef.FilePath); 600var fileName = Path.GetFileNameWithoutExtension(peRef.FilePath);
MSBuild\ProjectFileExtensionRegistry.cs (2)
50var extension = Path.GetExtension(projectFilePath); 78_diagnosticReporter.Report(mode, string.Format(WorkspacesResources.Cannot_open_project_0_because_the_file_extension_1_is_not_associated_with_a_language, projectFilePath, Path.GetExtension(projectFilePath)));
MSBuild\SolutionFileReader.cs (1)
52var baseDirectory = Path.GetDirectoryName(solutionFilePath);
MSBuild\SolutionFileReader.SolutionFilterReader.cs (5)
20return Path.GetExtension(filename).Equals(".slnf", StringComparison.OrdinalIgnoreCase); 30var solutionPath = solution.GetProperty("path").GetString()?.Replace('\\', Path.DirectorySeparatorChar); 31if (solutionPath is null || Path.GetDirectoryName(filterFilename) is not string baseDirectory) 47baseDirectory = Path.GetDirectoryName(solutionFilename)!; 54var projectPath = project.GetString()?.Replace('\\', Path.DirectorySeparatorChar);
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Workspaces\MSBuild\BuildHost\Rpc\Contracts\MonoMSBuildDiscovery.cs (8)
34.Split(Path.PathSeparator) 78.Select(p => Path.Combine(p, "mono")) 116var monoDirPath = Path.GetDirectoryName(monoRuntimePath)!; 118var monoLibDirPath = Path.Combine(monoDirPath, "..", "lib", "mono"); 119monoLibDirPath = Path.GetFullPath(monoLibDirPath); 142var monoMSBuildDirPath = Path.Combine(monoLibDirPath, "msbuild"); 143var monoMSBuildDir = new DirectoryInfo(Path.GetFullPath(monoMSBuildDirPath)); 179var monoMSBuildPath = Path.Combine(monoMSBuildDirectory, "Microsoft.Build.dll");
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (28)
BuildHost.cs (1)
83WorkingDirectory = Path.GetDirectoryName(projectOrSolutionFilePath),
MSBuild\ProjectFile\ProjectFile.cs (2)
238=> !Path.GetFileName(item.ItemSpec).StartsWith("TemporaryGeneratedFile_", StringComparison.Ordinal); 435var fileName = Path.GetFileNameWithoutExtension(filePath);
Rpc\Contracts\MonoMSBuildDiscovery.cs (8)
34.Split(Path.PathSeparator) 78.Select(p => Path.Combine(p, "mono")) 116var monoDirPath = Path.GetDirectoryName(monoRuntimePath)!; 118var monoLibDirPath = Path.Combine(monoDirPath, "..", "lib", "mono"); 119monoLibDirPath = Path.GetFullPath(monoLibDirPath); 142var monoMSBuildDirPath = Path.Combine(monoLibDirPath, "msbuild"); 143var monoMSBuildDir = new DirectoryInfo(Path.GetFullPath(monoMSBuildDirPath)); 179var monoMSBuildPath = Path.Combine(monoMSBuildDirectory, "Microsoft.Build.dll");
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (55)
DefaultBinLogPathProviderTests.cs (8)
18private static string RelativeLogDirectory => $".{Path.DirectorySeparatorChar}logs"; 19private static string LogDirectory => Path.GetFullPath(RelativeLogDirectory); 26var logPath = Path.Combine(RelativeLogDirectory, LogFileName + LogExtension); 34var logPath = Path.Combine(LogDirectory, LogFileName); 42var provider = new BinLogPathProvider(LogDirectory + Path.DirectorySeparatorChar); 55var newLogDirectory = Path.GetDirectoryName(newLogPath); 56var newLogFileName = Path.GetFileNameWithoutExtension(newLogPath); 57var newLogExtension = Path.GetExtension(newLogPath);
MSBuildWorkspaceTestBase.cs (1)
132Assert.Equal("EmittedCSharpProject.dll", Path.GetFileName(p1.OutputFilePath));
NetCoreTests.cs (11)
43var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe"); 55RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.Path, "restore.binlog")}"); 60var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.Path, "build.binlog")}"; 78var projectDir = Path.GetDirectoryName(projectFilePath); 85Assert.Equal(Path.Combine(projectDir, "bin", "Debug", "netcoreapp3.1", "Project.dll"), project.OutputFilePath); 86Assert.Equal(Path.Combine(projectDir, "obj", "Debug", "netcoreapp3.1", "Project.dll"), project.CompilationOutputInfo.AssemblyPath); 107var projectDir = Path.GetDirectoryName(projectFilePath); 108var binLogPath = Path.Combine(projectDir, "build.binlog"); 132var projectDir = Path.GetDirectoryName(projectFilePath); 140Assert.Equal(Path.Combine(projectDir, "bin", "Debug", "netcoreapp3.1", "Project.dll"), projectFileInfo.OutputFilePath); 572var depsJsonFile = Path.ChangeExtension(BuildHostProcessManager.GetNetCoreBuildHostPath(), "deps.json");
NewlyCreatedProjectsFromDotNetNew.cs (4)
38var globalJsonPath = Path.Combine(GetSolutionFolder(), "global.json"); 171return Path.Combine(projectDirectory, $"{projectName}.{projectExtension}"); 216var tempGlobalJsonPath = Path.Combine(outputDirectory, "global.json"); 252var dotNetExeName = "dotnet" + (Path.DirectorySeparatorChar == '/' ? "" : ".exe");
ProjectGuardFiles.cs (10)
19File.WriteAllText(Path.Combine(Path.GetTempPath(), "global.json"), 26File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.props"), 44File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.rsp"), 49File.WriteAllText(Path.Combine(Path.GetTempPath(), "Directory.Build.targets"), 58File.WriteAllText(Path.Combine(Path.GetTempPath(), "NuGet.Config"),
SolutionGeneration.cs (1)
299AddXElement(xmlElement, "Name", Path.GetFileNameWithoutExtension(projectReference.ProjectName));
Utilities\DotNetSdkMSBuildInstalled.cs (1)
18var solution = Path.Combine(GetSolutionFolder(), "Roslyn.sln");
VisualStudioMSBuildWorkspaceTests.cs (16)
86var fileNames = new HashSet<string>(references.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath))); 252Assert.Equal("CSharpProject.dll", Path.GetFileName(p1.OutputFilePath)); 253Assert.Equal("VisualBasicProject.dll", Path.GetFileName(p2.OutputFilePath)); 267Assert.Equal("CSharpProject.dll", Path.GetFileName(p1.CompilationOutputInfo.AssemblyPath)); 268Assert.Equal("VisualBasicProject.dll", Path.GetFileName(p2.CompilationOutputInfo.AssemblyPath)); 322Assert.Equal("CSharpProject.dll", Path.GetFileName(p1.OutputFilePath)); 817var expectedOutputPath = Path.GetDirectoryName(project.FilePath); 818Assert.Equal(expectedOutputPath, Path.GetDirectoryName(project.OutputFilePath)); 835var expectedOutputPath = Path.Combine(Path.GetDirectoryName(project.FilePath), @"bin"); 836Assert.Equal(expectedOutputPath, Path.GetDirectoryName(Path.GetFullPath(project.OutputFilePath))); 1559await AssertCSCompilationOptionsAsync("snKey.snk", options => Path.GetFileName(options.CryptoKeyFile)); 3119var projectDirectory = Path.GetDirectoryName(projectFilePath); 3207project.MetadataReferences.Select(r => Path.GetFileName(((PortableExecutableReference)r).FilePath)).OrderBy(StringComparer.Ordinal)); 3294Assert.Equal("CSharpProject.csproj", Path.GetFileName(csharpProject.FilePath));
WorkspaceTestBase.cs (3)
35return Path.Combine(this.SolutionDirectory.Path, relativeFileName); 44var subdirectory = Path.GetDirectoryName(filePath); 45var fileName = Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (8)
GenerateFileForEachAdditionalFileWithContentsCommented.cs (1)
38private static string GetGeneratedFileName(string path) => $"{Path.GetFileNameWithoutExtension(path)}.generated";
Options\OptionsTestInfo.cs (1)
29var fileName = Path.GetFileNameWithoutExtension(file);
SolutionUtilities.cs (1)
116assemblyPath: Path.Combine(TempRoot.Root, name),
Workspaces\AbstractTestHostProject.cs (1)
25outputFilePath = Path.GetDirectoryName(projectFilePath);
Workspaces\TestHostProject`1.cs (1)
312return CompilationOptions == null ? "" : Path.Combine(GetTestOutputDirectory(projectFilePath), subdir, AssemblyName + GetDefaultExtension(CompilationOptions.OutputKind));
Workspaces\TestWorkspace_XmlConsumption.cs (2)
197var documentFilePath = Path.Combine(projectOutputDir, "obj", typeof(SingleFileTestGenerator).Assembly.GetName().Name, typeof(SingleFileTestGenerator).FullName, name); 675var filePath = Path.Combine(TestWorkspace.RootDirectory, fileName);
Workspaces\TestWorkspace_XmlCreation.cs (1)
43file, Path.Combine(folders, GetDefaultTestSourceDocumentName(index++, extension)), folders: folders, parseOptions: parseOptions, isMarkup: isMarkup));
Microsoft.CodeAnalysis.Workspaces.UnitTests (56)
CommandLineProject\CommandLineProjectTests.cs (7)
139Assert.Equal(Path.Combine(@"C:\ProjectDirectory", ".editorconfig"), document.FilePath); 146var assemblyBaseDir = Path.GetDirectoryName(pathToAssembly); 147var relativePath = Path.Combine(".", Path.GetFileName(pathToAssembly)); 161var assemblyBaseDir = Path.GetDirectoryName(pathToAssembly); 162var relativePath = Path.Combine(".", Path.GetFileName(pathToAssembly));
SolutionTests\SolutionTests.cs (44)
46private static readonly string s_projectDir = Path.GetDirectoryName(typeof(SolutionTests).Assembly.Location)!; 57.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))) 58.AddDocument(DocumentId.CreateNewId(projectId), "goo.cs", SourceText.From("public class Goo { }", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "goo.cs")) 60.AddAnalyzerConfigDocument(DocumentId.CreateNewId(projectId), "editorcfg", SourceText.From(editorConfig ?? "#empty", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg")))); 1089.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))) 1090.AddProject(ProjectInfo.Create(projectId2, VersionStamp.Default, "proj2", "proj2", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj2.dll"))) 1091.AddDocument(d1, "d1.cs", SourceText.From("class D1;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d1.cs")) 1092.AddDocument(d2, "d2.cs", SourceText.From("class D2;", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "d2.cs")) 1095.AddAnalyzerConfigDocument(c1, "c1", SourceText.From("#empty1", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg")) 1096.AddAnalyzerConfigDocument(c2, "c2", SourceText.From("#empty2", Encoding.UTF8, SourceHashAlgorithms.Default), filePath: Path.Combine(s_projectDir, "editorcfg")); 1106loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD1;", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1107filePath: Path.Combine(s_projectDir, "newD1.cs"), 1115loader: TextLoader.From(TextAndVersion.Create(SourceText.From("class NewD3;", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1116filePath: Path.Combine(s_projectDir, "newD3.cs"), 1125loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1126filePath: Path.Combine(s_projectDir, "newA1.txt"), 1134loader: TextLoader.From(TextAndVersion.Create(SourceText.From("new text3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1135filePath: Path.Combine(s_projectDir, "newA3.txt"), 1144loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty1", Encoding.UTF32, SourceHashAlgorithm.Sha256), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD1.cs"))), 1145filePath: Path.Combine(s_projectDir, "newC1"), 1153loader: TextLoader.From(TextAndVersion.Create(SourceText.From("#new empty3", Encoding.UTF8, SourceHashAlgorithms.Default), VersionStamp.Create(), filePath: Path.Combine(s_projectDir, "newD3.cs"))), 1154filePath: Path.Combine(s_projectDir, "newC3"), 1161var generatedOutputDir = Path.Combine(TempRoot.Root, "obj"); 1162var assemblyPath = Path.Combine(TempRoot.Root, "bin", "assemblyName.dll"); 1298.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1333.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1368.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1403.AddProject(ProjectInfo.Create(projectId, VersionStamp.Default, "proj1", "proj1", LanguageNames.CSharp, Path.Combine(s_projectDir, "proj1.dll"))); 1481var objDir = Path.Combine(TempRoot.Root, "obj"); 1482var binDir = Path.Combine(TempRoot.Root, "bin"); 1483var otherDir = Path.Combine(TempRoot.Root, "other"); 1492.WithOutputFilePath(Path.Combine(binDir, "output.dll")) 1494assemblyPath: Path.Combine(objDir, "output.dll"), 2312var solution4 = solution3.AddAnalyzerConfigDocument(editorConfigId, ".editorconfig", SourceText.From(editorConfigContent), filePath: Path.Combine(s_projectDir, "subfolder", ".editorconfig")); 2333var sourcePathOptions = project2.State.GetAnalyzerOptionsForPath(Path.Combine(s_projectDir, "x.cs"), CancellationToken.None); 2344sourcePathOptions = project2.State.GetAnalyzerOptionsForPath(Path.Combine(s_projectDir, "subfolder", "x.cs"), CancellationToken.None); 2393var filePath = Path.Combine(TempRoot.Root, "x.cs"); 2424var filePath = Path.Combine(TempRoot.Root, "x.cs"); 2475var filePath = Path.Combine(TempRoot.Root, "x.cs"); 2504var filePath = Path.Combine(TempRoot.Root, "x.cs"); 5544projectPath = string.IsNullOrEmpty(projectPath) ? projectPath : Path.Combine(TempRoot.Root, projectPath); 5545configPath = Path.Combine(TempRoot.Root, configPath); 5546sourcePath = string.IsNullOrEmpty(sourcePath) ? sourcePath : Path.Combine(TempRoot.Root, sourcePath); 5778.WithCompilationOutputInfo(new CompilationOutputInfo(assemblyPath: Path.Combine(TempRoot.Root, "assembly.dll"), generatedFilesOutputDirectory: null));
SolutionTests\SolutionWithSourceGeneratorTests.cs (4)
42var generatedFilesOutputDir = Path.Combine(TempRoot.Root, "gendir"); 43var assemblyPath = Path.Combine(TempRoot.Root, "assemblyDir", "assembly.dll"); 68Assert.Equal(Path.Combine(generatedFilesOutputDir, generatorType.Assembly.GetName().Name!, generatorType.FullName!, "Test.generated.cs"), generatedTree.FilePath); 1426var analyzerPath = Path.Combine(tempDirectory.Path, "Microsoft.CodeAnalysis.TestAnalyzerReference.dll");
UtilityTest\XmlDocumentationProviderTests.cs (1)
20var roslynCompilersXmlFilePath = Path.ChangeExtension(roslynCompilersLocation, ".xml");
Microsoft.CommonLanguageServerProtocol.Framework.Example (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CommonLanguageServerProtocol.Framework.Package (1)
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Data.Analysis.Tests (7)
DataFrame.IOTests.cs (1)
1338Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "/";
test\Microsoft.ML.TestFramework\BaseTestClass.cs (6)
39DataDir = Path.Combine(RootDir, "test", "data"); 57OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput"); 108return Path.GetFullPath(Path.Combine(DataDir, name)); 115return Path.GetFullPath(Path.Combine(DataDir, subDir, name));
Microsoft.DotNet.ApiCompat.IntegrationTests (43)
CompatibleFrameworkInPackageValidatorIntegrationTests.cs (6)
38string name = Path.GetFileNameWithoutExtension(Path.GetTempFileName()); 58PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name)); 75string name = Path.GetFileNameWithoutExtension(Path.GetTempFileName()); 99PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name));
Task\ValidatePackageTargetIntegrationTests.cs (37)
44var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 59var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 73var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 78string packageValidationBaselinePath = Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.1.0.0.nupkg"); 79result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 93var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 98result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 112var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 117string packageValidationBaselinePath = Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.1.0.0.nupkg"); 118result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 133string nonExistentPackageBaselinePath = Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.1.0.0.nupkg"); 134var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 141result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 163PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name)); 179{ NuGetFramework.ParseFolder("netstandard2.0"), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", "netstandard2.0") } }, 180{ NuGetFramework.ParseFolder(ToolsetInfo.CurrentTargetFramework), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", ToolsetInfo.CurrentTargetFramework) } } 205PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name)); 211{ NuGetFramework.ParseFolder("netstandard2.0"), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", "netstandard2.0") } }, 212{ NuGetFramework.ParseFolder(ToolsetInfo.CurrentTargetFramework), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", ToolsetInfo.CurrentTargetFramework) } } 216File.Delete(Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", ToolsetInfo.CurrentTargetFramework, $"{testDummyDependency.Name}.dll")); 246PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name)); 252{ NuGetFramework.ParseFolder("netstandard2.0"), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", "netstandard2.0") } }, 253{ NuGetFramework.ParseFolder(ToolsetInfo.CurrentTargetFramework), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", ToolsetInfo.CurrentTargetFramework) } } 258File.Delete(Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", ToolsetInfo.CurrentTargetFramework, $"{dependency.Name}.dll")); 275PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name)); 281{ NuGetFramework.ParseFolder("netstandard2.0"), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", "netstandard2.0") } } 299PackCommand packCommand = new(Log, Path.Combine(asset.TestRoot, testProject.Name)); 305{ NuGetFramework.Parse("netstandard2.0"), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", "netstandard2.0") } }, 306{ NuGetFramework.ParseComponents($".NETCoreApp,Version=v{ToolsetInfo.CurrentTargetFrameworkVersion}", "Windows,Version=7.0"), new string[] { Path.Combine(asset.TestRoot, asset.TestProject.Name, "bin", "Debug", $"net{ToolsetInfo.CurrentTargetFrameworkVersion}-windows") } } 323var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 328string packageValidationBaselinePath = Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.1.0.0.nupkg"); 329result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 344var result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 349string packageValidationBaselinePath = Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.1.0.0.nupkg"); 350result = new PackCommand(Log, Path.Combine(testAsset.TestRoot, "PackageValidationTestProject.csproj")) 358string name = Path.GetFileNameWithoutExtension(Path.GetTempFileName());
Microsoft.DotNet.ApiCompat.Task (6)
RoslynResolver.cs (3)
71Assembly asm = loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{name.Name}.dll")); 81loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisCSharpName}.dll")); 83loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisName}.dll"));
ValidateAssemblies.cs (3)
130assemblyName: Path.GetFileNameWithoutExtension(assembly), 148string filename = Path.GetFileName(path); 155string? directoryName = Path.GetDirectoryName(path);
Microsoft.DotNet.ApiCompat.Tests (6)
RoslynResolver.cs (3)
71Assembly asm = loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{name.Name}.dll")); 81loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisCSharpName}.dll")); 83loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisName}.dll"));
ValidateAssemblies.cs (3)
130assemblyName: Path.GetFileNameWithoutExtension(assembly), 148string filename = Path.GetFileName(path); 155string? directoryName = Path.GetDirectoryName(path);
Microsoft.DotNet.ApiCompat.Tool (8)
Program.cs (2)
175Path.Combine(AppContext.BaseDirectory, "codeanalysis"); 297Path.Combine(AppContext.BaseDirectory, "codeanalysis");
RoslynResolver.cs (3)
71Assembly asm = loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{name.Name}.dll")); 81loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisCSharpName}.dll")); 83loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisName}.dll"));
ValidateAssemblies.cs (3)
130assemblyName: Path.GetFileNameWithoutExtension(assembly), 148string filename = Path.GetFileName(path); 155string? directoryName = Path.GetDirectoryName(path);
Microsoft.DotNet.ApiCompatibility.Tests (25)
Logging\SuppressionEngineTests.cs (12)
64string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName(), "DummyFile.xml"); 102string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName(), "DummyFile.xml"); 135string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName(), "DummyFile.xml"); 201string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName(), "DummyFile.xml");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Rules\AttributesMustMatchTests.cs (4)
1327string filePath = Path.Combine(root.DirPath, "exclusions.txt"); 1344string filePath = Path.Combine(root.DirPath, "exclusions.txt"); 1360string filePath = Path.Combine(root.DirPath, "exclusions.txt"); 1409string filePath = Path.Combine(root.DirPath, "exclusions.txt");
SymbolFactory.cs (3)
25string assemblyDir = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString("D").Substring(0, 4)}-{assemblyName}"); 27string assemblyPath = Path.Combine(assemblyDir, $"{assemblyName}.dll");
TempDirectory.cs (5)
17: this(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())) 35public string GenerateRandomFilePath() => Path.Combine(DirPath, Path.GetRandomFileName());
Microsoft.DotNet.ApiDiff (2)
FileOutputDiffGenerator.cs (2)
145string filePath = Path.Combine(_outputFolderPath, fileName); 158string tableOfContentsFilePath = Path.Combine(_outputFolderPath, $"{_tableOfContentsTitle}.md");
Microsoft.DotNet.ApiDiff.Tests (25)
Diff.Base.Tests.cs (1)
88# {Path.GetFileNameWithoutExtension(expectedAssemblyName)}
Diff.Disk.Tests.cs (15)
269DirectoryInfo inputFolderPath = new(Path.Join(root.DirPath, "inputFolder")); 270DirectoryInfo outputFolderPath = new(Path.Join(root.DirPath, "outputFolder")); 403string tableOfContentsMarkdownFilePath = Path.Join(outputFolderPath.DirPath, $"{DefaultTableOfContentsTitle}.md"); 408string myAssemblyMarkdownFilePath = Path.Join(outputFolderPath.DirPath, $"{DefaultTableOfContentsTitle}_{DefaultAssemblyName}.md"); 423DirectoryInfo inputFolderPath = new(Path.Join(root.DirPath, "inputFolder")); 424DirectoryInfo outputFolderPath = new(Path.Join(root.DirPath, "outputFolder")); 442string tableOfContentsMarkdownFilePath = Path.Join(outputFolderPath.FullName, $"{DefaultTableOfContentsTitle}.md"); 447string myAssemblyMarkdownFilePath = Path.Join(outputFolderPath.FullName, $"{DefaultTableOfContentsTitle}_{DefaultAssemblyName}.md"); 464string beforeAssembliesFolderPath = Path.Join(inputFolderPath, DefaultBeforeFriendlyName); 465string afterAssembliesFolderPath = Path.Join(inputFolderPath, DefaultAfterFriendlyName); 513var assemblyPath = Path.Join(assemblyDirectoryPath, $"{assemblyName}.dll"); 527string tableOfContentsMarkdownFilePath = Path.Join(outputFolderPath, $"{tableOfContentsTitle}.md"); 535string myAssemblyMarkdownFilePath = Path.Join(outputFolderPath, $"{tableOfContentsTitle}_{expectedAssembly}.md"); 551FileInfo file = new(Path.Join(root.DirPath, Path.GetRandomFileName()));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
SymbolFactory.cs (3)
25string assemblyDir = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString("D").Substring(0, 4)}-{assemblyName}"); 27string assemblyPath = Path.Combine(assemblyDir, $"{assemblyName}.dll");
TempDirectory.cs (5)
17: this(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())) 35public string GenerateRandomFilePath() => Path.Combine(DirPath, Path.GetRandomFileName());
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.ApiSymbolExtensions.Tests (15)
AssemblySymbolLoaderTests.cs (6)
215IAssemblySymbol symbol = loader.LoadAssembly(Path.Combine(assetInfo.OutputDirectory, assetInfo.TestAsset.TestProject.Name + ".dll")); 268string assemblyPath = Path.Combine(assetInfo.OutputDirectory, assetInfo.TestAsset.TestProject.Name + ".dll"); 302loader.AddReferenceSearchPaths(Path.GetDirectoryName(typeof(string).Assembly.Location)); 303loader.AddReferenceSearchPaths(Path.GetFullPath(typeof(string).Assembly.Location)); 304loader.LoadAssembly(Path.Combine(assetInfo.OutputDirectory, assetInfo.TestAsset.TestProject.Name + ".dll")); 320using FileStream stream = File.OpenRead(Path.Combine(assetInfo.OutputDirectory, testProject.Name + ".dll"));
SymbolFactory.cs (3)
25string assemblyDir = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString("D").Substring(0, 4)}-{assemblyName}"); 27string assemblyPath = Path.Combine(assemblyDir, $"{assemblyName}.dll");
SymbolFilterFactoryTests.cs (1)
49string filePath = Path.Combine(root.DirPath, "exclusions.txt");
TempDirectory.cs (5)
17: this(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())) 35public string GenerateRandomFilePath() => Path.Combine(DirPath, Path.GetRandomFileName());
Microsoft.DotNet.Arcade.Sdk (15)
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\LocateDotNet.cs (6)
45var globalJsonPath = Path.Combine(RepositoryRoot, "global.json"); 70var fileName = (Path.DirectorySeparatorChar == '\\') ? "dotnet.exe" : "dotnet"; 71var dotNetDir = paths.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(p => File.Exists(Path.Combine(p, fileName))); 73if (dotNetDir == null || !Directory.Exists(Path.Combine(dotNetDir, "sdk", sdkVersion))) 79DotNetPath = Path.GetFullPath(Path.Combine(dotNetDir, fileName));
src\SaveItems.cs (1)
45string path = Path.GetDirectoryName(File);
Microsoft.DotNet.Arcade.Sdk.Tests (23)
GenerateResxSourceTests.cs (4)
28var resx = Path.Combine(AppContext.BaseDirectory, "testassets", "Resources", "TestStrings.resx"); 29var actualFile = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName()); 45var expectedFile = Path.Combine(AppContext.BaseDirectory, "testassets", "Resources", expectedFileName);
GenerateSourcePackageSourceLinkTargetsFileTests.cs (1)
19path.Replace('\\', Path.DirectorySeparatorChar);
GetLicenseFilePathTests.cs (3)
18var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 20var licensePath = Path.Combine(dir, licenseFileName);
RepoWithConditionalProjectsToBuildTests.cs (1)
44var nupkgFiles = Directory.GetFiles(Path.Combine(app.WorkingDirectory, "artifacts", "packages", "Debug", "Shipping"), "*.nupkg");
Utilities\TestApp.cs (7)
23_logOutputDir = Path.Combine(logOutputDir, Path.GetFileName(workDir)); 101CopyRecursive(Path.Combine(WorkingDirectory, "artifacts", "log"), _logOutputDir); 112var destFileName = Path.Combine(destDir, srcFileName.Substring(srcDir.Length).TrimStart(new[] { Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar })); 113Directory.CreateDirectory(Path.GetDirectoryName(destFileName));
Utilities\TestProjectFixture.cs (7)
35_testAssets = Path.Combine(AppContext.BaseDirectory, "testassets"); 36_boilerPlateDir = Path.Combine(_testAssets, "boilerplate"); 41var testAppFiles = Path.Combine(_testAssets, name); 42var instanceName = Path.GetRandomFileName(); 43var tempDir = Path.Combine(Path.GetTempPath(), "arcade", instanceName); 55var pkgRoot = Path.Combine(nugetRoot, package, pkgVersion);
Microsoft.DotNet.ArcadeAzureIntegration (2)
AzureCliCredentialWithAzNoUpdateWrapper.cs (1)
64fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
DefaultIdentityTokenCredential.cs (1)
134var tokenFileName = Path.GetTempFileName();
Microsoft.DotNet.ArcadeLogging (1)
PipelinesLogger.cs (1)
290projectFile = Path.GetFileName(projectFile);
Microsoft.DotNet.Baselines.Tasks (8)
CreateUpdatePR.cs (3)
90if (string.IsNullOrEmpty(TargetDirectory) || Path.IsPathRooted(TargetDirectory)) 107TargetDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar),
PRCreator.cs (5)
108string path = Path.Combine(relativePath, item.Path); 123Path = Path.GetRelativePath(targetDirectory, path), 249string originalFileName = Path.GetFileName(ParseUpdatedFileName(filePath)); 320var groups = items.GroupBy(item => Path.GetDirectoryName(item.Path)); 332Path = path == string.Empty ? item.Path : Path.GetRelativePath(path, item.Path),
Microsoft.DotNet.Build.Manifest.Tests (14)
BuildModelFactoryTests.cs (12)
99var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 102string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}"; 104string bopSnupkgExpectedId = $"assets/symbols/{Path.GetFileName(bopSnupkg)}"; 228var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 350var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.zip")); 387var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 433var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 436string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}"; 438string bopSnupkgExpectedId = $"assets/symbols/{Path.GetFileName(bopSnupkg)}"; 483string tempXmlFile = Path.GetTempFileName(); 582var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg")); 585string bobSymbolsExpectedId = $"assets/symbols/{Path.GetFileName(bopSymbolsNupkg)}";
TestInputs\TestInputs.cs (2)
12return Path.Combine( 13Path.GetDirectoryName(typeof(TestInputs).Assembly.Location),
Microsoft.DotNet.Build.Tasks.Feed (28)
src\BlobFeedAction.cs (1)
82string fileName = Path.GetFileName(item.ItemSpec);
src\common\AzureStorageUtils.cs (1)
173var fileExtension = Path.GetExtension(filePath).ToLowerInvariant();
src\common\GeneralUtils.cs (1)
195var extension = Path.GetExtension(assetId).ToUpper();
src\common\LatestLinksManager.cs (2)
153blobIdWithoutVersions = Path.GetFileName(blobIdWithoutVersions); 156return Path.Combine(latestLinkShortUrlPrefix, blobIdWithoutVersions).Replace("\\", "/");
src\ConfigureInputFeed.cs (1)
30string nugetConfigLocation = Path.Combine(RepoRoot, "NuGet.config");
src\PublishArtifactsInManifestBase.cs (17)
498string symbolPackageName = Path.GetFileName(symbolAsset.Id); 499string localSymbolPath = Path.Combine(temporarySymbolsDirectory, symbolPackageName); 558int result = await helper.AddPackagesToRequest(requestName, symbolPackages.Select(x => Path.Combine(BlobAssetsBasePath, x.Id))); 800FileInfo pdbStagingPath = new(Path.Combine(pdbStagePath, subPath)); 824string extension = Path.GetExtension(looseFile); 827string relativePath = Path.GetRelativePath(pdbArtifactsBasePath, looseFile); 828FileInfo looseFileStagePath = new(Path.Combine(pdbStagePath, relativePath)); 1230Path.Combine(PackageAssetsBasePath, $"{package.Id}.{package.Version}.nupkg"); 1273Path.GetFullPath(Path.Combine(ArtifactsBasePath, Guid.NewGuid().ToString())); 1275string localPackagePath = Path.Combine(temporaryPackageDirectory, packageFilename); 1585Path.GetFullPath(Path.Combine(ArtifactsBasePath, Guid.NewGuid().ToString())); 1667var fileName = Path.GetFileName(targetBlobPath); 1668var localBlobPath = Path.Combine(temporaryBlobDirectory, fileName); 1747var fileName = Path.GetFileName(asset.Id); 1748var localBlobPath = Path.Combine(BlobAssetsBasePath, fileName);
src\PublishBuildToMaestro.cs (3)
141string mergedManifestPath = Path.Combine(GetAzDevStagingDirectory(), MergedManifestFileName); 682string id = $"assets/manifests/{repoName}/{buildNumber}/{Path.GetFileName(manifestFileName)}"; 697mergedManifestAsset.PipelineArtifactPath = Path.GetFileName(manifestFileName);
src\PublishSignedAssets.cs (2)
81string packagesFolder = Path.Combine(assetsFolder, "packages"); 97string localPackagePath = Path.Combine(packagesFolder, $"{package.Id}.{package.Version}.nupkg");
Microsoft.DotNet.Build.Tasks.Feed.Tests (16)
DownloadFileTests.cs (8)
55var testFile = Path.Combine("Symbols", _testTextFile); 124var testFile = Path.Combine("Symbols", _testTextFile); 193var testFile = Path.Combine("Symbols", _testTextFile); 196Content = new ByteArrayContent(TestInputs.ReadAllBytes(Path.Combine("Symbols", _testTextFile))) 201Content = new ByteArrayContent(TestInputs.ReadAllBytes(Path.Combine("Symbols", _testSymbolPackage))) 272var testFile = Path.Combine("Symbols", _testTextFile); 328var testFile = Path.Combine("Symbols", _testTextFile); 402var testFile = Path.Combine("Symbols", _testTextFile);
GeneralTests.cs (3)
113var localPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.zip")); 121var content = TestInputs.ReadAllBytes(Path.Combine("Nupkgs", $"{feedResponseContentName}.zip")); 146var testPackageName = Path.Combine("Nupkgs", "test-package-a.zip");
PublishArtifactsInManifestTests.cs (3)
121var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV3.xml")); 147var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV4.xml")); 282var testPackagePath = TestInputs.GetFullPath(Path.Combine("Nupkgs", "test-package-a.1.0.0.nupkg"));
src\Microsoft.DotNet.Build.Manifest.Tests\TestInputs\TestInputs.cs (2)
12return Path.Combine( 13Path.GetDirectoryName(typeof(TestInputs).Assembly.Location),
Microsoft.DotNet.Build.Tasks.Installers (78)
src\CreateLightCommandPackageDrop.cs (8)
32string packageDropOutputFolder = Path.Combine(LightCommandWorkingDir, Path.GetFileName(InstallerFile)); 54var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(WixProjectFile)); 56commandString.Append($" -wixprojectfile {Path.GetFileName(WixProjectFile)}"); 60commandString.Append($" -contentsfile {Path.GetFileName(ContentsFile)}"); 64commandString.Append($" -outputsfile {Path.GetFileName(OutputsFile)}"); 68commandString.Append($" -builtoutputsfile {Path.GetFileName(BuiltOutputsFile)}");
src\CreateMD5SumsFile.cs (1)
41string relativePath = file.ItemSpec.Substring(RootDirectory.Length).TrimStart(Path.DirectorySeparatorChar).Replace('\\', '/');
src\CreateWixBuildWixpack.cs (49)
98WixpackWorkingDir = Path.Combine(Path.GetTempPath(), "WixpackTemp", Guid.NewGuid().ToString().Split('-')[0]); 101_installerFilename = Path.GetFileName(InstallerFile); 114string destPath = Path.Combine(WixpackWorkingDir, Path.GetFileName(projectPath)); 147OutputFile = Path.Combine(OutputFolder, $"{_installerFilename}{_packageExtension}"); 179var randomDirName = Path.GetRandomFileName(); 182CopyDirectoryRecursive(fullSourceDir, Path.Combine(WixpackWorkingDir, randomDirName)); 201var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 262_defineConstantsDictionary["ProjectPath"] = Path.GetFileName(projectPath); 280_defineConstantsDictionary["TargetPath"] = Path.Combine("%outputfolder%", Path.GetFileName(targetPath)); 284InstallerFile = Path.Combine("%outputfolder%", Path.GetFileName(InstallerFile)); 292PdbFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(PdbFile.ItemSpec)); 298BindTrackingFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(BindTrackingFile.ItemSpec)); 426commandLineArgs.Add($"{Path.GetFileName(sourceFile.ItemSpec)}"); 432File.WriteAllText(Path.Combine(WixpackWorkingDir, "create.rsp"), string.Join(System.Environment.NewLine, commandLineArgs)); 446File.WriteAllText(Path.Combine(WixpackWorkingDir, "create.cmd"), createCmdFileContents.ToString()); 518var copiedXmlPath = Path.Combine(WixpackWorkingDir, Path.GetFileName(xmlPath)); 520string sourceFileFolder = Path.GetDirectoryName(xmlPath); 597var filePath = Path.Combine(dir, Path.GetFileName(source)); 598CopySourceFile(Path.GetFileName(dir), filePath); 609id = Path.GetFileName(source); 615var newSourceValue = $"{id}\\{Path.GetFileName(source)}"; 653string id = Path.GetFileName(includeFilePath); 666var potentialPath = Path.Combine(WixpackWorkingDir, searchPath, Path.GetFileName(includeFilePath)); 1016var destDir = Path.Combine(WixpackWorkingDir, fileId); 1023var destPath = Path.Combine(destDir, Path.GetFileName(source)); 1038string filename = Path.GetFileName(extensionPath); 1042Extensions[i] = new TaskItem(Path.Combine(filename, filename)); 1054string wixpackSubfolder = Path.GetRandomFileName(); 1081string filename = Path.GetFileName(localizationPath); 1085LocalizationFiles[i] = new TaskItem(Path.Combine(filename, filename)); 1092if (!Path.IsPathRooted(source)) 1095Path.Combine(_wixprojDir, source) : 1096Path.Combine(relativeRoot, source); 1108File.Copy(file, Path.Combine(destDir, Path.GetFileName(file)), overwrite: true); 1113CopyDirectoryRecursive(dir, Path.Combine(destDir, Path.GetFileName(dir)));
src\CreateWixCommandPackageDropBase.cs (17)
67OutputFile = Path.Combine(OutputFolder, $"{Path.GetFileName(InstallerFile)}{_packageExtension}"); 81string commandFilename = Path.Combine(packageDropOutputFolder, $"create.cmd"); 97commandString.Append($" -out %outputfolder%{Path.GetFileName(InstallerFile)}"); 106commandString.Append($" -loc {Path.GetFileName(locItem.ItemSpec)}"); 120commandString.Append($" {Path.GetFileName(wixSrcFile.ItemSpec)}"); 144string newWixSrcFilePath = Path.Combine(packageDropOutputFolder, Path.GetFileName(wixSrcFile.ItemSpec)); 147string wixSrcFileExtension = Path.GetExtension(wixSrcFile.ItemSpec); 176var destinationPath = Path.Combine(packageDropOutputFolder, Path.GetFileName(locItem.ItemSpec)); 283else if (!Path.IsPathRooted(oldPath)) 292var possiblePath = Path.Combine(additionalBasePath.ItemSpec, oldPath); 310newRelativePath = Path.Combine(id, Path.GetFileName(oldPath)); 325string newFolder = Path.Combine(outputPath, id); 331File.Copy(oldPath, Path.Combine(outputPath, newRelativePath), true);
src\RpmBuilder.cs (3)
280baseNames.Add(Path.GetFileName(file.Name)); 281string dirName = Path.GetDirectoryName(file.Name)!; 340if (file.Name.StartsWith("usr/share/doc") && Path.GetFileName(file.Name) == "copyright")
Microsoft.DotNet.Build.Tasks.Packaging (63)
CreateTrimDependencyGroups.cs (2)
163string fileName = Path.GetFileName(compileAsset); 165if (!runtimeAssets.Any(r => Path.GetFileName(r).Equals(fileName, StringComparison.OrdinalIgnoreCase)))
GenerateNuSpec.cs (3)
119var directory = Path.GetDirectoryName(OutputFileName); 262Target = f.GetMetadata(Metadata.FileTarget).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar),
GenerateRuntimeDependencies.cs (1)
138string destRuntimeFileDir = Path.GetDirectoryName(destRuntimeFilePath);
GetApplicableAssetsFromPackages.cs (3)
207string pdbPath = Path.ChangeExtension(packageItem.SourcePath, ".pdb"); 210var pdbItem = new TaskItem(Path.ChangeExtension(packageItem.OriginalItem.ItemSpec, ".pdb")); 216pdbItem.SetMetadata("TargetPath", Path.ChangeExtension(packageItem.TargetPath, ".pdb"));
GetLayoutFiles.cs (5)
128var destination = Path.Combine(DestinationDirectory, subfolder, Path.GetFileName(source)); 137var symbolSource = Path.ChangeExtension(source, symbolExtension); 142var symbolDestination = Path.Combine(DestinationDirectory, subfolder, Path.GetFileName(symbolSource));
HarvestPackage.cs (11)
252version = VersionUtility.GetAssemblyVersion(Path.Combine(packagePath, refAssm))?.ToString() ?? version; 327harvestPackagePath = remappedTargetPath + '/' + Path.GetFileName(packageFile); 339targetPaths.Add(additionalTargetPath + '/' + Path.GetFileName(packageFile)); 406if (livePackageFiles.TryGetValue(Path.ChangeExtension(livePackagePath, ".pdb"), out livePdbFile)) 429var targetPath = Path.GetDirectoryName(livePackagePath).Replace('\\', '/'); 472var candidateFolder = Path.Combine(packageFolder, packageId, packageVersion); 480candidateFolder = Path.Combine(packageFolder, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant()); 544probePath = NormalizePath(Path.GetDirectoryName(probePath))) 561probePath = NormalizePath(Path.GetDirectoryName(probePath))) 580var parts = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
NuGetAssetResolver.cs (2)
105int dirLength = contentItem.Path.LastIndexOf(Path.AltDirectorySeparatorChar); 151return Path.GetFileName(path) == PlaceHolderFile;
NuGetPack.cs (13)
23@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar), 24@"src\**\*".Replace('\\', Path.DirectorySeparatorChar) 31@"content\**\*".Replace('\\', Path.DirectorySeparatorChar), 32@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar) 204string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 255return Path.Combine(nupkgOutputDirectory, $"{id}.{version}{nupkgExtension}"); 260bool creatingSymbolsPackage = packSymbols && (Path.GetExtension(nupkgPath) == _symbolsPackageExtension); 265string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 302var directory = Path.GetDirectoryName(nupkgPath); 359if(Path.GetFileName(fileName) == "runtime.json" && file.Target == "") 361string packedPackageSourcePath = Path.Combine(Path.GetDirectoryName(fileName), string.Join(".", _packageNamePrefix, Path.GetFileName(fileName)));
PackageIndex.cs (4)
71result.IndexSources.Add(Path.GetFullPath(packageIndexFile)); 78string directory = Path.GetDirectoryName(path); 194var assemblyName = Path.GetFileNameWithoutExtension(file); 205string targetFrameworkMoniker = Path.GetFileName(frameworkDir);
PackageItem.cs (5)
31IsDll = Path.GetExtension(SourcePath).Equals(".dll", StringComparison.OrdinalIgnoreCase); 48string sourceFile = Path.GetFileName(SourcePath); 49if (!Path.GetExtension(TargetPath).Equals(Path.GetExtension(sourceFile), StringComparison.OrdinalIgnoreCase) || 52TargetPath = Path.Combine(TargetPath, sourceFile);
PackageReport.cs (1)
34string directory = Path.GetDirectoryName(path);
UpdatePackageIndex.cs (7)
121.Select(nuspec => Path.GetDirectoryName(nuspec)); 210var version = NuGetVersion.Parse(Path.GetFileName(path)); 211var id = Path.GetFileName(Path.GetDirectoryName(path)); 221var dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct(); 244var dlls = reader.GetFiles().Where(f => Path.GetExtension(f).Equals(".dll", StringComparison.OrdinalIgnoreCase)); 257dllNames = dlls.Select(f => Path.GetFileNameWithoutExtension(f)).Distinct().ToArray();
ValidateFrameworkPackage.cs (2)
41var testAssetsByName = testAssets.Where(a => Path.GetExtension(a.PackagePath) == ".dll") 42.ToDictionary(a => Path.GetFileNameWithoutExtension(a.PackagePath), a => a);
ValidatePackage.cs (4)
328string fileName = Path.GetFileName(implementationAssembly.PackagePath); 344Path.GetFileName(i.PackagePath).Equals(fileName, StringComparison.OrdinalIgnoreCase) && 437var moduleNames = allDlls.Select(d => Path.GetFileNameWithoutExtension(d.LocalPath)); 450return !String.IsNullOrWhiteSpace(path) && Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase);
Microsoft.DotNet.Build.Tasks.Packaging.Tests (5)
HarvestPackageTests.cs (5)
65candidate != Path.GetPathRoot(candidate); 66candidate = Path.GetDirectoryName(candidate)) 68string packagesCandidate = Path.Combine(candidate, "packages"); 70string packageFolder = Path.Combine(packagesCandidate, packageId, packageVersion); 71string packageFolderLower = Path.Combine(packagesCandidate, packageId.ToLowerInvariant(), packageVersion.ToLowerInvariant());
Microsoft.DotNet.Build.Tasks.Templating (2)
GenerateFileFromTemplate.cs (2)
59ResolvedOutputPath = Path.GetFullPath(OutputPath.Replace('\\', '/')); 71Directory.CreateDirectory(Path.GetDirectoryName(ResolvedOutputPath));
Microsoft.DotNet.Build.Tasks.Templating.Tests (11)
GenerateFileFromTemplateTests.cs (11)
16string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 17string filePath = Path.Combine(tempDir, "Directory.Build.props"); 43string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 44string filePath = Path.Combine(tempDir, "Directory.Build.props"); 68string tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 69string filePath = Path.Combine(tempDir, "Directory.Build.props"); 90return Path.Combine( 91Path.GetDirectoryName(typeof(GenerateFileFromTemplateTests).Assembly.Location),
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
OptProf\GenerateTrainingInputFiles.cs (6)
81string vsixFilePath = Path.Combine(InsertionDirectory, product.Name); 118var configurationsDir = Path.Combine(OutputDirectory, test.Container, "Configurations"); 123WriteEntries(ibcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 133WriteEntries(filteredIbcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 147string basePath = Path.Combine(outDir, entry.RelativeDirectoryPath.Replace("\\", "") + Path.GetFileNameWithoutExtension(entry.RelativeInstallationPath));
OptProf\GenerateTrainingPropsFile.cs (1)
52var outputFilePath = Path.Combine(OutputDirectory, outputFileNameNoExt + ".props");
OptProf\IbcEntry.cs (4)
48ngenApplicationPath: Path.Combine(VSInstallationRootVar, args.InstrumentationExecutable.Replace("/", "\\"))); 59string ext = Path.GetExtension(filePath); 65=> Path.GetFileNameWithoutExtension(filePath).EndsWith(".resources"); 80select new IbcEntry(fileName, filePath, relativeDirectoryPath: Path.GetDirectoryName(fileName), DefaultNgenApplication);
Microsoft.DotNet.Build.Tasks.VisualStudio.Tests (34)
OptProf\GenerateTrainingInputFilesTests.cs (24)
136var temp = Path.GetTempPath(); 137var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 140var configPath = Path.Combine(dir, "OptProf.json"); 143var insertionDir = Path.Combine(dir, "Insertion"); 145CreateVsix(Path.Combine(insertionDir, "Setup.vsix"), manifestContent: s_manifestJson); 147var outputDir = Path.Combine(dir, "Output"); 161Path.Combine(outputDir, @"DDRIT.RPS.CSharp"), 162Path.Combine(outputDir, @"TeamEng"), 163Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations"), 164Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging"), 165Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner"), 166Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.0.IBC.json"), 167Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.1.IBC.json"), 168Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\xyzMicrosoft.CodeAnalysis.0.IBC.json"), 169Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"), 170Path.Combine(outputDir, @"TeamEng\Configurations"), 171Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble"), 172Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.0.IBC.json"), 173Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json"), 174Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.VisualBasic.0.IBC.json") 178var json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.0.IBC.json")); 189json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging\System.Collections.Immutable.1.IBC.json")); 200json = File.ReadAllText(Path.Combine(outputDir, @"DDRIT.RPS.CSharp\Configurations\DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner\xyzMicrosoft.CodeAnalysis.CSharp.0.IBC.json")); 210json = File.ReadAllText(Path.Combine(outputDir, @"TeamEng\Configurations\TeamEng.OptProfTest.vs_debugger_start_no_build_cs_scribble\xyzMicrosoft.CodeAnalysis.VisualBasic.0.IBC.json"));
OptProf\GenerateTrainingPropsFileTests.cs (6)
15var temp = Path.GetTempPath(); 16var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 27var actual = File.ReadAllText(Path.Combine(dir, "dotnet.roslyn.props")); 43var temp = Path.GetTempPath(); 44var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 55var actual = File.ReadAllText(Path.Combine(dir, "ProfilingInputs.props"));
OptProf\GetRunSettingsSessionConfigurationTests.cs (4)
415var temp = Path.GetTempPath(); 416var dir = Path.Combine(temp, Guid.NewGuid().ToString()); 419var configPath = Path.Combine(dir, "OptProf.json"); 422var bootstrapperPath = Path.Combine(dir, "BootstrapperInfo.json");
Microsoft.DotNet.Build.Tasks.Workloads (60)
CreateVisualStudioWorkload.wix.cs (1)
156Log.LogMessage(MessageImportance.Low, $"Setting {nameof(_supportsMachineArch)} to {manifestPackage.SupportsMachineArch} for {Path.GetFileName(manifestPackage.PackageFileName)}");
EmbeddedTemplates.cs (1)
41string destinationPath = Path.Combine(destinationFolder, destinationFilename);
Msi\MsiBase.wix.cs (4)
129CompilerOutputPath = Utils.EnsureTrailingSlash(Path.Combine(baseIntermediateOutputPath, "wixobj", metadata.Id, $"{metadata.PackageVersion}", platform)); 130WixSourceDirectory = Path.Combine(baseIntermediateOutputPath, "src", "wix", metadata.Id, $"{metadata.PackageVersion}", platform); 155string eulaRtf = Path.Combine(WixSourceDirectory, "eula.rtf"); 247NuGetPackageFiles[Path.GetFullPath(msiJsonPath)] = "\\data\\msi.json";
Msi\MsiPayloadPackageProject.wix.cs (1)
37ProjectSourceDirectory = Path.Combine(SourceDirectory, "msiPackage", platform, package.Id);
Msi\MsiProperties.wix.cs (2)
107Payload = Path.GetFileName(path), 115string msiJsonPath = Path.ChangeExtension(path, ".json");
Msi\WorkloadManifestMsi.wix.cs (11)
26protected override string BaseOutputName => Path.GetFileNameWithoutExtension(Package.PackagePath); 50string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 51string packageDataDirectory = Path.Combine(Package.DestinationDirectory, "data"); 66foreach (var file in Directory.GetFiles(packageDataDirectory).Select(f => Path.GetFullPath(f))) 68NuGetPackageFiles[file] = @"\data\extractedManifest\" + Path.GetFileName(file); 77jsonContentWxs = Path.Combine(WixSourceDirectory, "JsonContent.wxs"); 80jsonDirectory = Path.Combine(WixSourceDirectory, "json"); 83string jsonFullPath = Path.GetFullPath(Path.Combine(jsonDirectory, "WorkloadPackGroups.json")); 101NuGetPackageFiles[jsonFullPath] = @"\data\extractedManifest\" + Path.GetFileName(jsonFullPath); 157ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
Msi\WorkloadPackGroupMsi.wix.cs (2)
40string packageContentWxs = Path.Combine(WixSourceDirectory, $"PackageContent.{pack.Id}.wxs"); 143string msiFileName = Path.Combine(outputPath, OutputName);
Msi\WorkloadPackMsi.wix.cs (2)
31string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 77ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
Msi\WorkloadSetMsi.wix.cs (4)
20protected override string BaseOutputName => Path.GetFileNameWithoutExtension(_package.PackagePath); 32string packageContentWxs = Path.Combine(WixSourceDirectory, "PackageContent.wxs"); 33string packageDataDirectory = Path.Combine(_package.DestinationDirectory, "data"); 74ITaskItem msi = Link(candle.OutputPath, Path.Combine(outputPath, OutputName), iceSuppressions);
ProjectTemplateBase.cs (1)
62public string SourceDirectory => Path.Combine(BaseIntermediateOutputPath, "src");
Swix\ComponentSwixProject.cs (3)
39ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{component.SdkFeatureBand}", 40$"{Path.GetRandomFileName()}"); 79Path.Combine(base.GetRelativePackagePath(), "_package.json");
Swix\MsiSwixProject.wix.cs (4)
83ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{sdkFeatureBand}", Id, Platform); 104return Path.Combine(relativePath, Path.GetFileName(_msi.ItemSpec)); 115using StreamWriter msiWriter = File.CreateText(Path.Combine(ProjectSourceDirectory, "msi.swr"));
Swix\PackageGroupSwixProject.wix.cs (2)
41ProjectSourceDirectory = Path.Combine(SwixDirectory, $"{packageGroup.SdkFeatureBand}", 42$"{Path.GetRandomFileName()}");
Swix\SwixProjectBase.cs (1)
52protected string SwixDirectory => Path.Combine(SourceDirectory, "swix");
Utils.cs (2)
47return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
VisualStudioWorkloadTaskBase.wix.cs (2)
67protected string MsiOutputPath => Path.Combine(BaseOutputPath, "msi"); 72protected string PackageRootDirectory => Path.Combine(BaseIntermediateOutputPath, "pkg");
WorkloadManifestPackage.wix.cs (3)
110string primaryManifest = Path.Combine(DestinationDirectory, "data", ManifestFileName); 111string secondaryManifest = Path.Combine(DestinationDirectory, ManifestFileName); 128return WorkloadManifestReader.ReadWorkloadManifest(Path.GetFileNameWithoutExtension(workloadManifestFile), File.OpenRead(workloadManifestFile), workloadManifestFile);
WorkloadPackageBase.cs (9)
203DestinationDirectory = Path.Combine(destinationBaseDirectory, $"{Identity}"); 206PackageFileName = Path.GetFileNameWithoutExtension(packagePath); 239File.Copy(PackagePath, Path.Combine(DestinationDirectory, Path.GetFileName(PackagePath)), overwrite: true); 247Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "_rels")); 248Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "package")); 250Utils.DeleteFile(Path.Combine(DestinationDirectory, ".signature.p7s")); 251Utils.DeleteFile(Path.Combine(DestinationDirectory, "[Content_Types].xml")); 252Utils.DeleteFile(Path.Combine(DestinationDirectory, $"{Id}.nuspec"));
WorkloadPackPackage.wix.cs (2)
71string sourcePackage = Path.Combine(packageSource, $"{pack.AliasTo[rid]}.{pack.Version}.nupkg"); 99yield return (Path.Combine(packageSource, $"{pack.Id}.{pack.Version}.nupkg"), CreateVisualStudioWorkload.SupportedPlatforms);
WorkloadSetPackage.wix.cs (3)
100string dataDirectory = Path.Combine(DestinationDirectory, "data"); 118if (!Path.GetFileName(file).EndsWith("workloadset.json")) 120Log?.LogWarning(string.Format(Strings.WarnNonWorkloadSetFileFound, Path.GetFileName(file)));
Microsoft.DotNet.Build.Tasks.Workloads.Tests (83)
CreateVisualStudioWorkloadSetTests.cs (7)
22string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WLS"); 31new TaskItem(Path.Combine(TestAssetsPath, "microsoft.net.workloads.9.0.100.9.0.100-baseline.1.23464.1.nupkg")) 71string msiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(workloadSetSwixItem.ItemSpec), "msi.swr")); 82string packageGroupSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(workloadSetPackageGroupSwixItem.ItemSpec), "packageGroup.swr"));
CreateVisualStudioWorkloadTests.cs (17)
26string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WL"); 35new TaskItem(Path.Combine(TestBase.TestAssetsPath, "microsoft.net.workload.emscripten.manifest-6.0.200.6.0.4.nupkg")) 95Path.Combine(Path.GetDirectoryName( 100Path.Combine(Path.GetDirectoryName( 128string manifestMsiSwr = File.ReadAllText(Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200", "Emscripten.Manifest-6.0.200", "x64", "msi.swr")); 137string swixRootDirectory = Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200"); 144string packMsiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(pythonPackSwixItem.ItemSpec), "msi.swr")); 162string baseIntermediateOutputPath = Path.Combine(Path.GetTempPath(), "WLa64"); 171new TaskItem(Path.Combine(TestBase.TestAssetsPath, "microsoft.net.workload.emscripten.manifest-6.0.200.6.0.4.nupkg")) 230Path.Combine(Path.GetDirectoryName( 250string manifestMsiSwr = File.ReadAllText(Path.Combine(baseIntermediateOutputPath, "src", "swix", "6.0.200", "Emscripten.Manifest-6.0.200", "arm64", "msi.swr"));
MsiTests.cs (9)
34ITaskItem msi603 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg"), 35msiOutputPath: Path.Combine(MsiOutputPath, "mrec")); 46string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 49ITaskItem msi603 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg")); 53ITaskItem msi604 = BuildManifestMsi(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.4.nupkg")); 83string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 84TaskItem packageItem = new(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.200.6.0.3.nupkg")); 113string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 114string packagePath = Path.Combine(TestAssetsPath, "microsoft.ios.templates.15.2.302-preview.14.122.nupkg");
PackageTests.cs (4)
20string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg"); 22TaskItem manifestPackageItem = new(Path.Combine(TestAssetsPath, "microsoft.net.workload.mono.toolchain.manifest-6.0.300.6.0.22.nupkg")); 46string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "wls-pkg"); 48ITaskItem workloadSetPackageItem = new TaskItem(Path.Combine(TestAssetsPath, "microsoft.net.workloads.9.0.100.9.0.100-baseline.1.23464.1.nupkg"));
SwixComponentTests.cs (27)
19public string RandomPath => Path.Combine(AppContext.BaseDirectory, "obj", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 31string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 35string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 60string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 65string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 89string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 94string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 115string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 129string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 158string componentResSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.res.swr")); 174string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 189string componentSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "component.swr")); 198return WorkloadManifestReader.ReadWorkloadManifest(Path.GetFileNameWithoutExtension(filename), 199File.OpenRead(Path.Combine(TestAssetsPath, filename)), filename);
SwixPackageGroupTests.cs (4)
25string destinationBaseDirectory = Path.Combine(BaseIntermediateOutputPath, destinationDirectory); 26TaskItem manifestPackageItem = new(Path.Combine(TestAssetsPath, manifestPackageFilename)); 37string packageGroupSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(packageGroupItem.ItemSpec), "packageGroup.swr"));
SwixPackageTests.cs (5)
44string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, Path.GetRandomFileName()); 45string packagePath = Path.Combine(TestAssetsPath, $"microsoft.ios.templates.{packageVersion}.nupkg"); 62string msiSwr = File.ReadAllText(Path.Combine(Path.GetDirectoryName(swixProj), "msi.swr"));
TestBase.cs (10)
11public static readonly string BaseIntermediateOutputPath = Path.Combine(AppContext.BaseDirectory, "obj", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 12public static readonly string BaseOutputPath = Path.Combine(AppContext.BaseDirectory, "bin", Path.GetFileNameWithoutExtension(Path.GetTempFileName())); 14public static readonly string MsiOutputPath = Path.Combine(BaseOutputPath, "msi"); 15public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets"); 17public static readonly string WixToolsetPath = Path.Combine(TestAssetsPath, "wix"); 19public static readonly string PackageRootDirectory = Path.Combine(BaseIntermediateOutputPath, "pkg");
Microsoft.DotNet.Cli.Utils (51)
DangerousFileDetector.cs (1)
50internetSecurityManager?.MapUrlToZone(Path.GetFullPath(filename), out zone, 0);
DependencyProvider.cs (1)
127using RegistryKey dependentsKey = BaseKey.CreateSubKey(Path.Combine(DependentsKeyPath, dependent), writable: true);
DotnetFiles.cs (3)
10private static string SdkRootFolder => Path.Combine(typeof(DotnetFiles).GetTypeInfo().Assembly.Location, ".."); 18public static string VersionFile => Path.GetFullPath(Path.Combine(SdkRootFolder, ".version"));
EnvironmentProvider.cs (4)
12private static char[] s_pathSeparator = [Path.PathSeparator]; 62return Path.Combine(_userHomeDirectory.Value, path.Substring(tildeSlash.Length)); 80(p, s) => Path.Combine(p, commandName + s)) 93var commandPath = extensions.Select(e => Path.Combine(rootPath, commandName + e))
MSBuildForwardingAppWithoutLogging.cs (2)
198return Path.Combine( 212return Path.Combine(
Muxer.cs (6)
41string? rootPath = Path.GetDirectoryName(Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar))); 44string muxerPathMaybe = Path.Combine(rootPath, $"{MuxerName}{FileNameSuffixes.CurrentPlatform.Exe}"); 62if (processPath is not null && !Path.GetFileNameWithoutExtension(processPath).Equals("dotnet", StringComparison.OrdinalIgnoreCase)) 72processPath = Path.Combine(root, $"dotnet{Constants.ExeSuffix}");
PathUtility.cs (34)
19return string.Equals(Path.GetFileName(path), "_._", StringComparison.Ordinal); 32dir = Path.GetFullPath(dir); 34candidate = Path.GetFullPath(candidate); 40return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar); 69if (lastChar == Path.DirectorySeparatorChar) 80string? directory = Path.GetDirectoryName(filePath); 118var dir = Path.GetDirectoryName(path); 127dir = Path.GetDirectoryName(dir); 142return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); 150if (!Path.IsPathRooted(path1) || !Path.IsPathRooted(path2)) 155return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); 164return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, false); 187if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare)) 199var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 200var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 272path = path.TrimEnd(Path.DirectorySeparatorChar); 273return path.Substring(Path.GetDirectoryName(path)?.Length ?? 0).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 288if (Path.DirectorySeparatorChar == '/') 305var components = path.Split(Path.DirectorySeparatorChar); 322result += Path.DirectorySeparatorChar; 327result = Path.Combine(result, component); 331if (path[path.Length - 1] == Path.DirectorySeparatorChar) 333result += Path.DirectorySeparatorChar; 348return Path.GetExtension(filePath).Equals(extension, comparison); 362return Path.GetFullPath(path); 394return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 399return Regex.Escape(Path.DirectorySeparatorChar.ToString()); 408var filePath = Path.Combine(directory.FullName, relativeFilePath);
Microsoft.DotNet.Cli.Utils.Tests (136)
DangerousFileDetectorTests.cs (6)
26var testFile = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, Path.GetRandomFileName()); 48var testFile = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, Path.GetRandomFileName()); 56var testFile = Path.Combine(_testAssetsManager.CreateTestDirectory().Path, Path.GetRandomFileName());
DependencyProviderTests.cs (2)
97using RegistryKey providerKey = Registry.CurrentUser.CreateSubKey(Path.Combine(DependencyProvider.DependenciesKeyRelativePath, providerKeyName), writable: true); 114using RegistryKey providerKey = Registry.CurrentUser.CreateSubKey(Path.Combine(DependencyProvider.DependenciesKeyRelativePath, providerKeyName), writable: true);
GivenAppThrowingException.cs (3)
19var appRoot = Path.Combine(root, "App"); 39var appRoot = Path.Combine(root, "App"); 47var appWithToolDepRoot = Path.Combine(root, "AppDependingOnOtherAsTool");
MockFileSystemTests.cs (124)
18string nestedFilePath = Path.Combine(directory, "filename"); 46string nestedFilePath = Path.Combine(directory, "filename"); 60string nestedFilePath = Path.Combine(directory, "nonExits", "filename"); 77fileSystem.File.Exists(Path.Combine(directory, "file")).Should().BeTrue(); 90fileSystem.Directory.Exists(Path.Combine(directory, "dir")).Should().BeTrue(); 127string path = Path.Combine(directory, "sub"); 141string nestedFilePath = Path.Combine(directory, "subfolder", "filename"); 154string path = Path.Combine(directory, Path.GetRandomFileName()); 167string path = Path.Combine(directory, Path.GetRandomFileName()); 179string directory = Path.Combine( 181Path.GetRandomFileName()); 196string path = Path.Combine(directory, Path.GetRandomFileName()); 221string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 223string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 238string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 240string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 254string badSourceFile = Path.Combine(directory, Path.GetRandomFileName()); 257string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 271string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 274string destinationFile = Path.Combine(directory, Path.GetRandomFileName(), Path.GetRandomFileName()); 289string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 291string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 305string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 306string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 320string badSourceFile = Path.Combine(directory, Path.GetRandomFileName()); 322string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 336string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 338string destinationFile = Path.Combine(directory, Path.GetRandomFileName(), Path.GetRandomFileName()); 353string sourceFile = Path.Combine(directory, Path.GetRandomFileName()); 355string destinationFile = Path.Combine(directory, Path.GetRandomFileName()); 371string file = Path.Combine(directory, Path.GetRandomFileName()); 386string file = Path.Combine(directory, Path.GetRandomFileName()); 403string file = Path.Combine(directory, Path.GetRandomFileName(), Path.GetRandomFileName()); 417string nonExistDirectory = Path.Combine(directory, Path.GetRandomFileName(), Path.GetRandomFileName()); 432string wrongFilePath = Path.Combine(directory, Path.GetRandomFileName()); 450string emptyDirectory = Path.Combine(tempDirectory, Path.GetRandomFileName()); 463string testDirectory = Path.Combine(tempDirectory, Path.GetRandomFileName()); 464string file1 = Path.Combine(testDirectory, Path.GetRandomFileName()); 465string file2 = Path.Combine(testDirectory, Path.GetRandomFileName()); 483string nonExistDirectory = Path.Combine(directory, Path.GetRandomFileName(), Path.GetRandomFileName()); 498string wrongFilePath = Path.Combine(directory, Path.GetRandomFileName()); 516string emptyDirectory = Path.Combine(tempDirectory, Path.GetRandomFileName()); 529string testDirectory = Path.Combine(tempDirectory, Path.GetRandomFileName()); 530string file1 = Path.Combine(testDirectory, Path.GetRandomFileName()); 531string file2 = Path.Combine(testDirectory, Path.GetRandomFileName()); 532string nestedDirectoryPath = Path.Combine(testDirectory, Path.GetRandomFileName()); 553string testDirectory = Path.Combine(tempDirectory, Path.GetRandomFileName()); 569string nonExistsTestDirectory = Path.Combine(tempDirectory, Path.GetRandomFileName()); 585string actuallyAFilePath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 599string testDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 600string testDirectoryFilePath = Path.Combine(testDirectoryPath, Path.GetRandomFileName()); 618string testDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 619string testDirectoryFilePath = Path.Combine(testDirectoryPath, Path.GetRandomFileName()); 635string testSourceDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 636string nestedFilePath = Path.GetRandomFileName(); 637string testDirectoryFilePath = Path.Combine(testSourceDirectoryPath, nestedFilePath); 641string testDestinationDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 647fileSystem.File.Exists(Path.Combine(testDestinationDirectoryPath, nestedFilePath)).Should().BeTrue(); 657string testSourceDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 659string testDestinationDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 673string testSourceDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 676string testDestinationDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 690string testSourceDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 693string testDestinationDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 707string testSourceDirectoryPath = Path.Combine(tempDirectory, Path.GetRandomFileName()); 721TemporaryFolder = Path.GetTempPath()
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
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);
CliFolderPathCalculatorCore.cs (1)
19return Path.Combine(homePath, DotnetProfileDirectoryName);
FirstTimeUseNoticeSentinel.cs (1)
16private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL);
IFileExtensions.cs (1)
17var parentDirectory = Path.GetDirectoryName(filePath) ?? string.Empty;
ToolPackageFolderPathCalculator.cs (1)
11return Path.Combine(toolsShimPath, NestedToolPackageFolderName);
UserLevelCacheWriter.cs (1)
72return Path.Combine(_dotnetUserProfileFolderPath, $"{Product.Version}_{cacheKey}.dotnetUserLevelCache");
Microsoft.DotNet.GenAPI (1)
GenAPIApp.cs (1)
113return File.CreateText(Path.Combine(outputDirPath, fileName));
Microsoft.DotNet.GenAPI.Tests (9)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
SymbolFactory.cs (3)
25string assemblyDir = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString("D").Substring(0, 4)}-{assemblyName}"); 27string assemblyPath = Path.Combine(assemblyDir, $"{assemblyName}.dll");
TempDirectory.cs (5)
17: this(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())) 35public string GenerateRandomFilePath() => Path.Combine(DirPath, Path.GetRandomFileName());
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)
63Assembly asm = loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{name.Name}.dll")); 73loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisCsharpName}.dll")) : 74loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisName}.dll"));
Microsoft.DotNet.Helix.JobSender (3)
Payloads\AdhocPayload.cs (3)
21$"Names of files to upload have to be distinct. The following name repeats at least once: {Path.GetFileName(duplicateName)}", 38string name = Path.GetFileName(file); 55duplicateName = files.FirstOrDefault(file => !filesSeen.Add(Path.GetFileName(file).ToLowerInvariant()));
Microsoft.DotNet.Helix.JobSender.Tests (1)
Payloads\ArchivePayloadTests.cs (1)
19var archiveFile = Path.GetTempFileName();
Microsoft.DotNet.Helix.Sdk (15)
CommandPayload.cs (3)
23var dir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"))); 56var scriptFile = new FileInfo(Path.Combine(Directory.FullName, name));
CreateXHarnessAndroidWorkItems.cs (1)
107string apkName = Path.GetFileName(apkPath);
CreateXHarnessAppleWorkItems.cs (1)
102appFolderPath = appFolderPath.TrimEnd(Path.DirectorySeparatorChar);
CreateXUnitWorkItems.cs (1)
108string assemblyName = Path.GetFileName(targetPath);
DownloadFromResultsContainer.cs (6)
52DirectoryInfo directory = Directory.CreateDirectory(Path.Combine(OutputDirectory, JobId)); 53using (FileStream stream = File.Open(Path.Combine(directory.FullName, MetadataFile), FileMode.Create, FileAccess.Write)) 77DirectoryInfo destinationDir = Directory.CreateDirectory(Path.Combine(directoryPath, workItemName)); 82string destinationFile = Path.Combine(destinationDir.FullName, file); 86Directory.CreateDirectory(Path.Combine(destinationDir.FullName, Path.GetDirectoryName(file)));
InstallDotNetTool.cs (2)
99ToolPath = Path.Combine(DestinationPath, Name, Version); 106string versionInstallPath = Path.Combine(ToolPath, ".store", Name.ToLowerInvariant(), version);
ProvisioningProfileProvider.cs (1)
44private static readonly Regex s_topLevelAppPattern = new("^[^" + Regex.Escape(new string(Path.GetInvalidFileNameChars())) + "]+\\.app/.+");
Microsoft.DotNet.Helix.Sdk.Tests (4)
HelpersTests.cs (2)
48string target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") ?? Environment.GetEnvironmentVariable("TEMP") ?? Environment.GetEnvironmentVariable("TMPDIR"), "my-test-file-123456.snt"); 54target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_PAYLOAD"), "my-test-file-123456.snt");
InstallDotNetToolTests.cs (2)
25private static readonly string s_installedPath = Path.Combine(InstallPath, ToolName, ToolVersion); 172Path.Combine(InstallPath, ToolName, ToolVersion),
Microsoft.DotNet.HotReload.Agent.Package (3)
HotReloadAgent.cs (3)
252var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 255var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 258return string.Join(Path.PathSeparator, updatedValues);
Microsoft.DotNet.HotReload.Client.Package (4)
Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
DefaultHotReloadClient.cs (1)
113environmentBuilder.InsertListItem(AgentEnvironmentVariables.DotNetStartupHooks, startupHookPath, Path.PathSeparator);
Web\AbstractBrowserRefreshServer.cs (2)
91builder.InsertListItem(MiddlewareEnvironmentVariables.DotNetStartupHooks, middlewareAssemblyPath, Path.PathSeparator); 92builder.InsertListItem(MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssemblies, Path.GetFileNameWithoutExtension(middlewareAssemblyPath), MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssembliesSeparator);
Microsoft.DotNet.HotReload.Client.Tests (6)
AbstractBrowserRefreshServer.cs (2)
91builder.InsertListItem(MiddlewareEnvironmentVariables.DotNetStartupHooks, middlewareAssemblyPath, Path.PathSeparator); 92builder.InsertListItem(MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssemblies, Path.GetFileNameWithoutExtension(middlewareAssemblyPath), MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssembliesSeparator);
AssertEx.cs (1)
219var expected = expectedFiles.Select(p => Path.Combine(root, p));
Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
DefaultHotReloadClient.cs (1)
113environmentBuilder.InsertListItem(AgentEnvironmentVariables.DotNetStartupHooks, startupHookPath, Path.PathSeparator);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.DotNet.HotReload.WebAssembly.Browser (3)
HotReloadAgent.cs (3)
252var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 255var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 258return string.Join(Path.PathSeparator, updatedValues);
Microsoft.DotNet.Internal.SymbolHelper (21)
SymbolUploadHelper.cs (16)
83_workingDir = workingDir ?? Path.GetTempPath(); 186string packageName = Path.GetFileName(packagePath); 207string packageName = Path.GetFileName(package); 292string entryPath = Path.Combine(packageExtractDir, entry.FullName); 293_ = Directory.CreateDirectory(Path.GetDirectoryName(entryPath)!); 307manifest = Path.Combine(packageExtractDir, "correlatedSymKeysManifest.json"); 348string extension = Path.GetExtension(relativeFilePath); 368string pePath = Path.ChangeExtension(file, ".dll"); 372pePath = Path.ChangeExtension(file, ".exe"); 381string convertedPdbPath = Path.Combine(convertedPdbFolder, Path.GetFileName(file)); 399private static string GetConvertedPdbFolder(string filesDir) => Path.Combine(filesDir, ConversionFolderName); 403string tempDir = Path.Combine(_workingDir, Path.GetRandomFileName()); 406tempDir = Path.Combine(_workingDir, Path.GetRandomFileName());
SymbolUploadHelperFactory.cs (5)
46installDirectory ??= Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 158string zipFilePath = Path.Combine(installDirectory, "symbol.zip"); 170private static string GetSymbolToolPathFromInstallDir(string installDirectory) => Path.Combine(installDirectory, "symbol.exe");
Microsoft.DotNet.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(PathUtilities.CreateTempSubdirectory());
Microsoft.DotNet.MacOsPkg.Core (16)
AppBundle.cs (4)
26if (Path.GetExtension(path) == ".app") 28bool containsAppBundleContents = Directory.Exists(Path.Combine(path, "Contents")) && 29File.Exists(Path.Combine(path, "Contents", "Info.plist")); 41return Path.GetExtension(path) == ".app";
Package.cs (9)
63string packageName = Path.Combine(dstPath, package.Value.Substring(1)); 64string tempDest = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 183string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 195Path.GetFullPath(Utilities.FindInPath("Payload", searchPath, isDirectory, searchOption: SearchOption.TopDirectoryOnly) 207string full_path = Path.GetFullPath(inputPath);
Utilities.cs (3)
12Path.GetExtension(path).Equals(".pkg"); 15Path.GetExtension(path).Equals(".app"); 37string? parent = Path.GetDirectoryName(path);
Microsoft.DotNet.MacOsPkg.Tests (26)
UnpackPackTests.cs (26)
23private static readonly string pkgToolPath = Path.Combine( 24Path.GetDirectoryName(typeof(UnpackPackTests).Assembly.Location)!, 44(Path.Combine("Payload", "Sample.txt"), nonExecutableFileMode), 51(Path.Combine("Payload", "test.app"), nonExecutableFileMode), 56(Path.Combine("Contents", "Info.plist"), nonExecutableFileMode), 57(Path.Combine("Contents", "MacOS", "main"), executableFileMode), 58(Path.Combine("Contents", "Resources", "libexample.dylib"), executableFileMode) 78string unpackPath = Path.GetTempFileName(); 91string unpackPath = Path.GetTempFileName(); 104string unpackPkgPath = Path.GetTempFileName(); 105string unpackAppPath = Path.GetTempFileName(); 111Unpack(Path.Combine(unpackPkgPath, "Payload", "test.app"), unpackAppPath, appFiles); 119string unpackPath = Path.GetTempFileName(); 132string unpackInstallerPath = Path.GetTempFileName(); 133string unpackComponentPath = Path.GetTempFileName(); 136string componentPkgPath = Path.Combine(unpackInstallerPath, "Simple.pkg"); 150string unpackInstallerPath = Path.GetTempFileName(); 151string unpackComponentPath = Path.GetTempFileName(); 152string unpackAppPath = Path.GetTempFileName(); 155string componentPkgPath = Path.Combine(unpackInstallerPath, "WithApp.pkg"); 156string appPath = Path.Combine(unpackComponentPath, "Payload", "test.app"); 207string unpackPath = Path.GetTempFileName(); 235return Path.Combine( 236Path.GetDirectoryName(typeof(UnpackPackTests).Assembly.Location)!, 241private static string GetTempPkgPath() => $"{Path.GetTempFileName()}.pkg"; 243private static string GetTempAppPath() => $"{Path.GetTempFileName()}.app";
Microsoft.DotNet.MSBuildSdkResolver (81)
CachingWorkloadResolver.cs (6)
72string sentinelPath = Path.Combine(Path.GetDirectoryName(typeof(CachingWorkloadResolver).Assembly.Location) ?? string.Empty, "DisableWorkloadResolver.sentinel"); 124string sdkPackSdkFolder = Path.Combine(sdkPackInfo.Path, "Sdk"); 125string autoImportPath = Path.Combine(sdkPackSdkFolder, "AutoImport.props"); 142var workloadManifestTargetPath = Path.Combine(manifestDirectory, "WorkloadManifest.targets"); 158return new SinglePathResolutionResult(Path.Combine(packInfo.Path, "Sdk"));
CliFolderPathCalculatorCore.cs (1)
19return Path.Combine(homePath, DotnetProfileDirectoryName);
EnvironmentProvider.cs (4)
10private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 33.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 46.Select(p => Path.Combine(p, commandNameWithExtension)) 98var dotnetDirectory = Path.GetDirectoryName(dotnetExe);
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());
Interop.cs (2)
36string? basePath = Path.GetDirectoryName(typeof(Interop).Assembly.Location); 38string dllPath = Path.Combine(basePath ?? string.Empty, architecture, $"{dllFileName}.dll");
MSBuildSdkResolver.cs (12)
181msbuildSdksDir = Path.Combine(dotnetSdkDir, "Sdks"); 239?? Path.Combine(dotnetRoot, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? Constants.DotNetExe : Constants.DotNet); 323string msbuildSdkDir = Path.Combine(msbuildSdksDir, sdkReference.Name, "Sdk"); 354var expectedDotnetRoot = Path.GetDirectoryName(Path.GetDirectoryName(currentDir)); 355var expectedMuxerPath = Path.Combine(expectedDotnetRoot, expectedFileName); 366string runtimeConfigPath = Path.Combine(sdkDirectory, "MSBuild.runtimeconfig.json"); 381Directory.Exists(Path.Combine(dotnetRoot, "shared", runtimeName, runtimeVersion))) 424startDir = Path.GetDirectoryName(context.SolutionFilePath); 428startDir = Path.GetDirectoryName(context.ProjectFilePath); 437Path.GetDirectoryName(typeof(DotNetMSBuildSdkResolver).GetTypeInfo().Assembly.Location); 440Path.Combine(dotnetMSBuildSdkResolverDirectory ?? string.Empty, "minimumVSDefinedSDKVersion");
NETCoreSdkResolver.cs (1)
137string minimumVersionFilePath = Path.Combine(netcoreSdkDir, "minimumMSBuildVersion");
SdkDirectoryWorkloadManifestProvider.cs (28)
73string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 74string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 90var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 93knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 111_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 186_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 270var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 300var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 319AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 326var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], _sdkVersionBand.ToString()); 341var manifestVersionBandDirectory = Path.Combine(manifestRoot, _sdkVersionBand.ToString()); 346directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 398AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 426string manifestId = Path.GetFileName(manifestDirectory); 434.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 437return (directory: dir, version: Path.GetFileName(dir)); 446else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 448var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 472.Select(dir => Path.GetFileName(dir)) 478.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 503var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 505if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 536var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 553var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 563var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 568var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 597string globalJsonPath = Path.Combine(directory, "global.json"); 602directory = Path.GetDirectoryName(directory);
TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
VSSettings.cs (1)
53_settingsFilePath = Path.Combine(
WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
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)
105if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
Microsoft.DotNet.MSBuildSdkResolver.Tests (26)
GivenAnEnvironmentForResolution.cs (3)
11Func<string, string> getPathEnvVarFunc = (string var) => { return $"{Directory.GetCurrentDirectory()}Dir{Path.GetInvalidPathChars().First()}Name"; }; 20File.Create(Path.Combine(Directory.GetCurrentDirectory(), "dotnet.exe")).Close(); 21Func<string, string> getPathEnvVarFunc = (input) => input.Equals("PATH") ? $"fake{Path.PathSeparator}" : string.Empty;
GivenAnMSBuildSdkResolver.cs (23)
231var localSdkRoot = Path.Combine("some", "local", "dir"); 232var localSdkDotnetRoot = Path.Combine(environment.TestDirectory.FullName, localSdkRoot, "dotnet"); 233var ambientSdkDotnetRoot = Path.Combine(environment.GetProgramFilesDirectory(ProgramFiles.X64).FullName, "dotnet"); 663=> new(Path.Combine(TestDirectory.FullName, $"ProgramFiles{programFiles}")); 672var netSdkDirectory = Path.Combine(TestDirectory.FullName, 682var dotnetDllPath = Path.Combine(netSdkDirectory, "dotnet.dll"); 686var sdkDir = new DirectoryInfo(Path.Combine(netSdkDirectory, 709var netSdkDirectory = Path.Combine(TestDirectory.FullName, 719var dotnetDllPath = Path.Combine(netSdkDirectory, "dotnet.dll"); 723var sdkDir = new DirectoryInfo(Path.Combine(netSdkDirectory, 746PathEnvironmentVariable = $"{Path.GetDirectoryName(dotnetPath)}{Path.PathSeparator}{PathEnvironmentVariable}"; 753var muxerDirectory = new DirectoryInfo(Path.Combine(TestDirectory.FullName, localRootWithinEnvironment, "dotnet")); 754var dotnetPath = Path.Combine(muxerDirectory.FullName, Muxer); 769var cliDirectory = new DirectoryInfo(Path.Combine( 777Path.Combine(cliDirectory.FullName, "minimumMSBuildVersion"), 792var cliDirectory = new DirectoryInfo(Path.Combine( 800Path.Combine(cliDirectory.FullName, "minimumMSBuildVersion"), 833File.WriteAllText(Path.Combine(directory.FullName, "global.json"), globalJsonContent); 862return Path.Combine(baseDirectory, "minimumVSDefinedSDKVersion"); 867VSSettingsFile = new FileInfo(Path.Combine(TestDirectory.FullName, "sdk.txt")); 903get => new(Path.GetDirectoryName(ProjectFilePath)); 904set => ProjectFilePath = Path.Combine(value.FullName, "test.csproj");
Microsoft.DotNet.NativeWrapper (7)
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.GetFileNameWithoutExtension(dotnetExe) 98var dotnetDirectory = Path.GetDirectoryName(dotnetExe);
Interop.cs (2)
36string? basePath = Path.GetDirectoryName(typeof(Interop).Assembly.Location); 38string dllPath = Path.Combine(basePath ?? string.Empty, architecture, $"{dllFileName}.dll");
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)
123string tempPackagePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 237NewPackage = Path.Combine(DestinationFolder, packageId + "." + packageVersion + ".nupkg");
src\UpdatePackageVersionTask.cs (1)
91File.WriteAllLines(Path.Combine(OutputDirectory, "PreReleaseDependencies.txt"), preReleaseDependencies.Distinct());
Microsoft.DotNet.NuGetRepack.Tests (41)
ReplacePackagePartsTests.cs (4)
18var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 22File.WriteAllBytes(originalNupkgPath = Path.Combine(dir, TestResources.MiscPackages.NameSigned), TestResources.MiscPackages.Signed); 25File.WriteAllText(replacementFilePath = Path.Combine(dir, "Replacement.txt"), "<replacement>");
VersionUpdaterTests.cs (37)
59var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 63File.WriteAllBytes(a_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameA), TestResources.DailyBuildPackages.TestPackageA); 64File.WriteAllBytes(b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB); 65File.WriteAllBytes(c_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameC), TestResources.DailyBuildPackages.TestPackageC); 66File.WriteAllBytes(d_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameD), TestResources.DailyBuildPackages.TestPackageD); 67File.WriteAllBytes(g_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameG), TestResources.DailyBuildPackages.TestPackageG); 69var a_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameA); 70var b_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameB); 71var c_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameC); 72var d_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameD); 73var g_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameG); 75var a_rel = Path.Combine(dir, TestResources.ReleasePackages.NameA); 76var b_rel = Path.Combine(dir, TestResources.ReleasePackages.NameB); 77var c_rel = Path.Combine(dir, TestResources.ReleasePackages.NameC); 78var d_rel = Path.Combine(dir, TestResources.ReleasePackages.NameD); 79var g_rel = Path.Combine(dir, TestResources.ReleasePackages.NameG); 102var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 106File.WriteAllBytes(e_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameE), TestResources.DailyBuildPackages.TestPackageE); 107File.WriteAllBytes(f_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameF), TestResources.DailyBuildPackages.TestPackageF); 109var e_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameE); 110var f_pre = Path.Combine(dir, TestResources.PreReleasePackages.NameF); 112var e_rel = Path.Combine(dir, TestResources.ReleasePackages.NameE); 113var f_rel = Path.Combine(dir, TestResources.ReleasePackages.NameF); 130var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 134File.WriteAllBytes(a_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameA), TestResources.DailyBuildPackages.TestPackageA); 135File.WriteAllBytes(b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB); 136File.WriteAllBytes(c_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameC), TestResources.DailyBuildPackages.TestPackageC); 169var dir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 170var outputDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 174File.WriteAllBytes(dotnet_tool = Path.Combine(dir, TestResources.MiscPackages.NameDotnetTool), TestResources.MiscPackages.DotnetTool); 176File.WriteAllBytes(normal_package_b_daily = Path.Combine(dir, TestResources.DailyBuildPackages.NameB), TestResources.DailyBuildPackages.TestPackageB); 181Assert.Single(Directory.EnumerateFiles(outputDir), fullPath => Path.GetFileNameWithoutExtension(fullPath) == "TestPackageB.1.0.0");
Microsoft.DotNet.Open.Api.Tools.Tests (40)
OpenApiAddFileTests.cs (2)
46Assert.Contains($"The project '{Path.Combine(_tempDir.Root, csproj)}' does not exist.", _error.ToString()); 113var absolute = Path.GetFullPath(nswagJsonFile, project.Project.Dir().Root);
OpenApiAddProjectTests.cs (2)
71run = app.Execute(new[] { "add", "project", Path.Combine(csproj.Path, "..", "refProj.csproj") }); 96var refProjFile = Path.Join(refProj.Root, $"{refProjName}.csproj");
OpenApiAddURLTests.cs (16)
38var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 71var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 104var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 137var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 169var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName); 202var firstJsonFile = Path.Combine(_tempDir.Root, firstExpectedJsonName); 230var secondJsonFile = Path.Combine(_tempDir.Root, secondExpectedJsonName); 262var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 294var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 310var run = app.Execute(new[] { "add", "url", FakeOpenApiUrl, "--output-file", Path.Combine("outputdir", "file.yaml") }); 314var expectedJsonName = Path.Combine("outputdir", "file.yaml"); 326var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 343var outputFile = Path.Combine("outputdir", "file.yaml"); 348var expectedJsonName = Path.Combine("outputdir", "file.yaml"); 360var resultFile = Path.Combine(_tempDir.Root, expectedJsonName); 445var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName);
OpenApiRefreshTests.cs (3)
25var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json"); 55var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json"); 83var expectedJsonPath = Path.Combine(_tempDir.Root, "filename.json");
OpenApiRemoveTests.cs (10)
32var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 47csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 56Assert.False(File.Exists(Path.Combine(_tempDir.Root, nswagJsonFile))); 75var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 90csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 118var refProjFile = Path.Join(refProj.Root, $"{refProjName}.csproj"); 124using (var csprojStream = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")).OpenRead()) 138using (var csprojStream = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")).OpenRead()) 177var csproj = new FileInfo(Path.Join(_tempDir.Root, "testproj.csproj")); 186Assert.False(File.Exists(Path.Combine(_tempDir.Root, nswagJsonFile)));
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
Microsoft.DotNet.PackageInstall.Tests (86)
EndToEndToolTests.cs (13)
28var homeFolder = Path.Combine(testDirectory.Path, "home"); 36var toolsFolder = Path.Combine(homeFolder, ".dotnet", "tools"); 38var shimPath = Path.Combine(toolsFolder, toolSettings.ToolCommandName + EnvironmentInfo.ExecutableExtension); 61var homeFolder = Path.Combine(testDirectory.Path, "home"); 69var toolsFolder = Path.Combine(homeFolder, ".dotnet", "tools"); 71var shimPath = Path.Combine(toolsFolder, toolSettings.ToolCommandName + (OperatingSystem.IsWindows() ? ".cmd" : "")); 88var homeFolder = Path.Combine(testDirectory.Path, "home"); 122var homeFolder = Path.Combine(testDirectory.Path, "home"); 277var packages = Directory.GetFiles(toolPackagesPath, "*.nupkg").Select(p => Path.GetFileName(p)).ToArray(); 283var homeFolder = Path.Combine(testDirectory.Path, "home"); 305var packages = Directory.GetFiles(toolPackagesPath, "*.nupkg").Select(p => Path.GetFileName(p)).ToArray(); 311var homeFolder = Path.Combine(testDirectory.Path, "home"); 511$"The package {Path.GetFileName(packagePath)} should not contain a dependency on {dll}.");
NuGetPackageInstallerExtractTests.cs (5)
30string targetPath = Path.Combine(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()), 36extractedFiles.Should().Contain(Path.Combine(targetPath, $"{packageId}.nuspec"));
NuGetPackageInstallerTests.cs (18)
66new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName()); 113new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName()); 164string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, getTestLocalFeedPath); 178string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, getTestLocalFeedPath); 199string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, getTestLocalFeedPath); 220string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, getTestLocalFeedPath); 350new DirectoryPath(Path.GetTempPath()).WithSubDirectories(Path.GetRandomFileName()); 384Path.Combine(Path.GetTempPath(), 385Path.GetRandomFileName() + " " + Path.GetRandomFileName()); 388new(Path.GetFullPath(Path.Combine(tempPathForNugetConfigWithWhiteSpace, nugetConfigName))); 393Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestAssetLocalNugetFeed");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
TestToolBuilder.cs (9)
103var targetDirectory = Path.Combine(TestContext.Current.TestExecutionDirectory, "TestTools", toolSettings.GetIdentifier()); 154var testAssetProjectDirectory = Path.Combine(testAsset.Path, testProject.Name!); 165Directory.CreateDirectory(Path.GetDirectoryName(targetDirectory)!); 172string packageOutputPath = Path.Combine(targetDirectory, "bin", "Release"); 215var packagePathInGlobalPackages = Path.Combine(globalPackagesPath, packageId.ToLowerInvariant(), version); 240var fileNames1 = new HashSet<string>(Array.ConvertAll(files1, f => Path.GetFileName(f) ?? string.Empty), StringComparer.OrdinalIgnoreCase); 241var fileNames2 = new HashSet<string>(Array.ConvertAll(files2, f => Path.GetFileName(f) ?? string.Empty), StringComparer.OrdinalIgnoreCase); 248var filePath1 = Path.Combine(dir1, fileName); 249var filePath2 = Path.Combine(dir2, fileName);
ToolConfigurationDeserializerTests.cs (1)
73string.Join(", ", Path.GetInvalidFileNameChars().Select(c => $"'{c}'"))));
ToolPackageDownloaderTests.cs (24)
31Environment.SetEnvironmentVariable(_PATH_VAR_NAME, dotnetRootUnderTest + Path.PathSeparator + _originalPath); 185var emptySource = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 282var relativePath = Path.GetRelativePath(testDir.Value, source); 334var emptySource = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 454var localToolDownloadDir = Path.Combine(new DirectoryPath(SettingsUtility.GetGlobalPackagesFolder(settings)).ToString().Trim('"'), TestPackageId.ToString()); 455var localToolVersionDir = Path.Combine(localToolDownloadDir, TestPackageVersion.ToString()); 729var nugetConfigPath = new FilePath(Path.Combine(root.Path, "NuGet.config")); 733var testRuntimeJsonPath = Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "RuntimeIdentifierGraph.json"); 760var emptySource = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 788var emptySource = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 861.NotContain(e => Path.GetFileName(e) != ToolPackageStoreAndQuery.StagingDirectory); 886var nugetConfigPath = new FilePath(Path.Combine(root.Value, "NuGet.config")); 915var testRuntimeJsonPath = Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "RuntimeIdentifierGraph.json"); 920store.Root.Value.Should().Be(Path.GetFullPath(toolsRoot.Value)); 954Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestAssetLocalNugetFeed");
ToolPackageInstallerNugetCacheTests.cs (11)
40new DirectoryPath(testDirectory).WithSubDirectories(Path.GetRandomFileName()); 122var root = new DirectoryPath(Path.Combine(Directory.GetCurrentDirectory(), Path.GetRandomFileName())); 142var runtimeJsonPathForTests = Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "RuntimeIdentifierGraph.json"); 154Path.Combine(testDirectory, 155Path.GetRandomFileName() + " " + Path.GetRandomFileName()); 160return new FilePath(Path.GetFullPath(Path.Combine(tempPathForNugetConfigWithWhiteSpace, nugetConfigName))); 163private static string GetTestLocalFeedPath() => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestAssetLocalNugetFeed");
ToolPackageUninstallerTests.cs (4)
109var testRuntimeJsonPath = Path.Combine(TestContext.Current.ToolsetUnderTest.SdkFolderUnderTest, "RuntimeIdentifierGraph.json"); 114store.Root.Value.Should().Be(Path.GetFullPath(root.Value)); 120Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestAssetLocalNugetFeed");
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.PackageValidation.Tests (1)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.DotNet.RemoteExecutor (16)
Program.cs (1)
104Directory.SetCurrentDirectory(Path.GetTempPath());
RemoteExecutor.cs (10)
12using IOPath = System.IO.Path; 65if (!IOPath.GetFileName(HostRunner).Equals(hostName, StringComparison.OrdinalIgnoreCase)) 67string runtimePath = IOPath.GetDirectoryName(typeof(object).Assembly.Location); 76string dotnetExe = IOPath.Combine(directory, hostName); 89HostRunnerName = IOPath.GetFileName(HostRunner); 91static string GetDirectoryName(string path) => string.IsNullOrEmpty(path) ? string.Empty : IOPath.GetDirectoryName(path); 531string tempFile = System.IO.Path.GetTempFileName(); 533string devConfigFile = System.IO.Path.ChangeExtension(configFile, "dev.json"); 650.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".runtimeconfig.json")) 655.Select(asm => System.IO.Path.Combine(AppContext.BaseDirectory, asm.GetName().Name + ".deps.json"))
RemoteInvokeHandle.cs (2)
157string miniDmpPath = Path.Combine(uploadPath, $"{Process.Id}.{Path.GetRandomFileName()}.dmp");
RemoteInvokeOptions.cs (3)
37public string ExceptionFile { get; } = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Microsoft.DotNet.SdkResolver (1)
NETCoreSdkResolver.cs (1)
137string minimumVersionFilePath = Path.Combine(netcoreSdkDir, "minimumMSBuildVersion");
Microsoft.DotNet.SetupNugetSources.Tests (41)
BoundaryConditionTests.cs (8)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 44var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 72var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 101var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 119var nonExistentPath = Path.Combine(_testOutputDirectory, "nonexistent.config"); 141var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 170var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
CredentialHandlingTests.cs (7)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 48var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 86var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 128var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 160var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 198var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
FeedEnablingTests.cs (7)
19_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 53var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 93var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 127var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 160var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 193var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
InternalFeedAdditionTests.cs (5)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 54var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 87var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 124var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
NoChangeScenarioTests.cs (4)
20_testOutputDirectory = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTests", Guid.NewGuid().ToString()); 49var configPath = Path.Combine(_testOutputDirectory, "nuget.config"); 73var configPath = Path.Combine(_testOutputDirectory, "nuget.config");
ScriptRunner.cs (2)
30var scriptPath = Path.Combine(_repoRoot, "eng", "common", "SetupNugetSources.ps1"); 43var scriptPath = Path.Combine(_repoRoot, "eng", "common", "SetupNugetSources.sh");
SetupNugetSourcesFixture.cs (8)
21var scaffoldRoot = Path.Combine(AppContext.BaseDirectory, "RepoScaffold"); 27RepoRoot = Path.Combine(Path.GetTempPath(), "SetupNugetSourcesTestRepo", Guid.NewGuid().ToString()); 37var relative = Path.GetRelativePath(sourceDir, dir); 38Directory.CreateDirectory(Path.Combine(destinationDir, relative)); 43var relative = Path.GetRelativePath(sourceDir, file); 44var destPath = Path.Combine(destinationDir, relative); 45Directory.CreateDirectory(Path.GetDirectoryName(destPath)!);
Microsoft.DotNet.SharedFramework.Sdk (17)
src\CreateFrameworkListFile.cs (5)
84Filename = Path.GetFileName(item.ItemSpec), 119string path = Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/'); 171new XAttribute("Culture", Path.GetFileName(Path.GetDirectoryName(path)))); 260Directory.CreateDirectory(Path.GetDirectoryName(TargetFile));
src\FileUtilities.cs (1)
34if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
src\GeneratePlatformManifestEntriesFromTemplate.cs (2)
32var files = Files.ToLookup(file => Path.GetFileName(file.ItemSpec)).ToDictionary(l => l.Key, l=> l.First()); 50var entryTemplateExtension = Path.GetExtension(entryTemplate.ItemSpec);
src\GenerateSharedFrameworkDepsFile.cs (3)
62string fileName = Path.GetFileName(filePath); 68resourceAssemblies.Add(new ResourceAssembly(Path.Combine(cultureMaybe, fileName), cultureMaybe)); 115var depsFilePath = Path.Combine(IntermediateOutputPath, depsFileName);
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (3)
100otherFiles.Add(Path.GetFileName(file)); 107var fileName = Path.GetFileName(assemblyInfo.Path); 108var existingFileName = Path.GetFileName(existingInfo.Path);
src\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
105var fileName = Path.GetFileName(assemblyInfo.Path); 106var existingFileName = Path.GetFileName(existingInfo.Path);
src\ValidateFileVersions.cs (1)
30var fileName = Path.GetFileName(file.ItemSpec);
Microsoft.DotNet.SignCheckLibrary (52)
Logging\FileLogger.cs (6)
43Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(messageFile))); 52Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(errorFile))); 62Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(resultsFile)));
Utils.cs (2)
208string keyPath = Path.Combine(tempDir, Path.GetFileName(keyUrl));
Verification\ArchiveVerifier.cs (9)
96Path.Combine(svr.VirtualPath, archiveEntry.RelativePath)); 110CreateDirectory(Path.GetDirectoryName(aliasFullName)); 121Path.Combine(svr.VirtualPath, fullName), fullName); 132string parent = Path.GetDirectoryName(svr.FullPath) ?? SignCheckResources.NA; 166string directoryName = Path.GetDirectoryName(archiveEntry.RelativePath); 169string extension = Path.GetExtension(archiveEntry.RelativePath); 172string aliasFileName = String.Equals(extension.ToLowerInvariant(), ".cab") ? Path.GetFileName(archiveEntry.RelativePath) : 173Utils.GetHash(archiveEntry.RelativePath, HashAlgorithmName.SHA256.Name) + Path.GetExtension(archiveEntry.RelativePath); // lgtm [cs/zipslip] Archive from trusted source 175return Path.Combine(tempPath, hashedPath, aliasFileName);
Verification\DebVerifier.cs (2)
30signableContent = Path.Combine(tempDir, "signableContent"); 85string entryPath = Path.Combine(workingDir, archiveEntry.RelativePath);
Verification\Exclusions.cs (3)
151var values = new[] { path, containerPath, virtualPath, Path.GetFileName(path), Path.GetFileName(containerPath), Path.GetFileName(virtualPath) };
Verification\FileVerifier.cs (2)
124string extension = Path.GetExtension(path); 165Log.WriteMessage(LogVerbosity.Detailed, String.Format(SignCheckResources.ProcessingFile, Path.GetFileName(path), String.IsNullOrEmpty(parent) ? SignCheckResources.NA : parent));
Verification\LinuxPackageVerifier.cs (3)
36string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Verification\LZMAUtils.cs (1)
19string destinationDir = Path.GetDirectoryName(destinationFile);
Verification\LzmaVerifier.cs (3)
30string destinationFile = Path.Combine(tempPath, Path.GetFileNameWithoutExtension(path)); 35svr.NestedResults.Add(VerifyFile(destinationFile, parent, Path.Combine(svr.VirtualPath, destinationFile), containerPath: null));
Verification\MachOVerifier.cs (3)
149string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Verification\PkgVerifier.cs (4)
37string extractionPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 47var relativePath = path.Substring(extractionPath.Length + 1).Replace(Path.DirectorySeparatorChar, '/');
Verification\PortableExecutableVerifier.cs (1)
46svr.IsIgnoreStrongName = Exclusions.IsIgnoreStrongName(Path.GetFileName(svr.VirtualPath), parent, svr.VirtualPath, null);
Verification\RpmVerifier.cs (4)
27using var dataStream = File.Create(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())); 43string signatureDocument = Path.Combine(tempDir, "signableContent"); 44string signableContent = Path.Combine(tempDir, "pgpSignableContent");
Verification\SignatureVerificationManager.cs (4)
133result = fileVerifier.VerifySignature(file, parent: null, virtualPath: Path.GetFileName(file)); 188string extension = Path.GetExtension(path); 248if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "nuspec", StringComparison.OrdinalIgnoreCase))) 253else if (zipArchive.Entries.Any(z => String.Equals(Path.GetExtension(z.FullName), "vsixmanifest", StringComparison.OrdinalIgnoreCase)))
Verification\SignatureVerificationResult.cs (5)
189_tempPath = Path.Combine(Path.GetTempPath(), "SignCheck", Path.GetRandomFileName()); 203Filename = Path.GetFileName(path); 204FullPath = Path.GetFullPath(path);
Microsoft.DotNet.SignCheckTask (15)
src\SignCheck.cs (12)
21private static readonly string _appData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SignCheck"); 205string downloadPath = Path.Combine(_appData, Path.GetFileName(uriResult.LocalPath)); 212string fileSearchPath = Path.GetDirectoryName(inputFile); 213string fileSearchPattern = Path.GetFileName(inputFile); 271else if (File.Exists(Path.GetFullPath(inputFile))) 290inputFiles.Remove(Path.GetFullPath(Options.ErrorLogFile)); 295inputFiles.Remove(Path.GetFullPath(Options.LogFile)); 421Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(Options.ExclusionsOutput))); 477string downloadPath = Path.Combine(_appData, Path.GetFileName(uri.LocalPath));
src\SignCheckTask.cs (1)
148if (Path.IsPathRooted(checkFile))
src\Utils.cs (2)
17var directoryPath = Path.GetDirectoryName(path); 18var directory = Path.GetFileName(path);
Microsoft.DotNet.SignTool (96)
src\BatchSignUtil.cs (3)
158Path.GetExtension(fileInfo.FullPath) == ".exe").ToArray(); 168var workingDirectory = Path.Combine(_signTool.TempDir, "engines"); 173string engineFileName = $"{Path.Combine(workingDirectory, $"{engineContainer}", file.FileName)}{SignToolConstants.MsiEngineExtension}";
src\Configuration.cs (10)
131_pathToContainerUnpackingDirectory = Path.Combine(tempDir, "ContainerSigning"); 162var fileUniqueKey = new SignedFileContentKey(contentHash, Path.GetFileName(itemToSign.FullPath)); 310var extension = Path.GetExtension(file.FileName); 799Debug.Assert(Path.GetExtension(archivePath) == ".zip"); 820var fileUniqueKey = new SignedFileContentKey(entry.ContentHash, Path.GetFileName(entry.RelativePath)); 827packages.Add(Path.GetFileName(archivePath)); 832var fileName = Path.GetFileName(entry.RelativePath); 836string tempPath = Path.Combine(_pathToContainerUnpackingDirectory, extractPathRoot, entry.RelativePath); 839Directory.CreateDirectory(Path.GetDirectoryName(tempPath)); 880return _itemsToSkip3rdPartyCheck != null && _itemsToSkip3rdPartyCheck.Contains(Path.GetFileName(fileName));
src\FileSignInfo.cs (22)
29=> Path.GetExtension(path) == ".deb"; 32=> Path.GetExtension(path) == ".rpm"; 35=> Path.GetExtension(path) == ".exe" || Path.GetExtension(path) == ".dll"; 38=> Path.GetExtension(path).Equals(".vsix", StringComparison.OrdinalIgnoreCase); 41=> Path.GetExtension(path).Equals(".mpack", StringComparison.OrdinalIgnoreCase); 44=> Path.GetExtension(path).Equals(".nupkg", StringComparison.OrdinalIgnoreCase); 48=> Path.GetExtension(path).Equals(".pkg", StringComparison.OrdinalIgnoreCase); 52=> Path.GetExtension(path).Equals(".app", StringComparison.OrdinalIgnoreCase); 58=> Path.GetExtension(path).Equals(".zip", StringComparison.OrdinalIgnoreCase); 61=> Path.GetExtension(path).Equals(".tgz", StringComparison.OrdinalIgnoreCase) 62|| (Path.GetExtension(path).Equals(".gz", StringComparison.OrdinalIgnoreCase) 63&& Path.GetExtension(Path.GetFileNameWithoutExtension(path)).Equals(".tar", StringComparison.OrdinalIgnoreCase)); 66=> (Path.GetExtension(path).Equals(".msi", StringComparison.OrdinalIgnoreCase) 67|| Path.GetExtension(path).Equals(".wixlib", StringComparison.OrdinalIgnoreCase)); 70=> Path.GetExtension(path).Equals(".ps1", StringComparison.OrdinalIgnoreCase) 71|| Path.GetExtension(path).Equals(".psd1", StringComparison.OrdinalIgnoreCase) 72|| Path.GetExtension(path).Equals(".psm1", StringComparison.OrdinalIgnoreCase); 107|| Path.GetExtension(FileName).Equals(".exe", StringComparison.OrdinalIgnoreCase)); 111(Path.GetExtension(FileName).Equals(".exe", StringComparison.OrdinalIgnoreCase) || 112Path.GetExtension(FileName).Equals(".msi", StringComparison.OrdinalIgnoreCase));
src\PathWithHash.cs (1)
38FileName = Path.GetFileName(fullPath);
src\SignTool.cs (17)
103archive.CreateEntryFromFile(file.FullPath, Path.GetFileName(file.FullPath)); 120Arguments = $"-V -xk \"{item.Value}\" \"{Path.GetDirectoryName(item.Key)}\"", 140ZipFile.ExtractToDirectory(item.Value, Path.GetDirectoryName(item.Key), true); 150var dir = Path.Combine(_args.TempDir, "Signing"); 165var signProjectPath = Path.Combine(dir, $"Round{round}-Sign.proj"); 168status = RunMSBuild(buildEngine, signProjectPath, Path.Combine(_args.LogDir, $"{signingLogName}.binlog"), Path.Combine(_args.LogDir, $"{signingLogName}.log"), Path.Combine(_args.LogDir, $"{signingLogName}.error.log")); 197var notarizeProjectPath = Path.Combine(dir, $"Round{round}-Notarize.proj"); 200status = RunMSBuild(buildEngine, notarizeProjectPath, Path.Combine(_args.LogDir, $"{notarizeLogName}.binlog"), Path.Combine(_args.LogDir, $"{notarizeLogName}.log"), Path.Combine(_args.LogDir, $"{notarizeLogName}.error.log")); 261AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "Microsoft.VisualStudioEng.MicroBuild.Core.props")}"" />"); 290AppendLine(builder, depth: 1, text: $@"<Import Project=""{Path.Combine(MicroBuildCorePath, "build", "Microsoft.VisualStudioEng.MicroBuild.Core.targets")}"" />"); 298var zipFilePath = Path.Combine(Path.GetDirectoryName(fullPath), Path.GetFileName(fullPath) + ".zip");
src\SignToolTask.cs (6)
240if (!Path.IsPathRooted(TempDir)) 425if (!Path.IsPathRooted(itemToSign.ItemSpec)) 431var directoryParts = Path.GetFullPath(Path.GetDirectoryName(itemToSign.ItemSpec)).Split(separators); 447return string.Join(Path.DirectorySeparatorChar.ToString(), result); 483if (!extension.Equals(Path.GetExtension(extension)) && !specialExtensions.Contains(extension))
src\VerifySignatures.cs (11)
44string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 85string tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 92string signableContent = Path.Combine(tempDir, "signableContent"); 93string pgpSignableContent = Path.Combine(tempDir, "pgpSignableContent"); 271string keyPath = Path.Combine(tempDir, Path.GetFileName(keyUrl)); 298string entryPath = Path.Combine(workingDir, entry.RelativePath);
src\WixPackInfo.cs (2)
33string filename = Path.GetFileName(path); 42return Path.GetFileName(path).EndsWith(WixPackExtension, StringComparison.OrdinalIgnoreCase);
src\ZipData.cs (24)
258string workingDir = Path.Combine(tempDir, "extract", workingDirGuidSegment); 259string outputDir = Path.Combine(tempDir, "output", outputDirGuidSegment); 260string createFileName = Path.Combine(workingDir, "create.cmd"); 261string outputFileName = Path.Combine(outputDir, FileSignInfo.FileName); 347string extractDir = Path.Combine(tempDir, Guid.NewGuid().ToString()); 357var relativePath = path.Substring(extractDir.Length + 1).Replace(Path.DirectorySeparatorChar, '/'); 373string extractDir = Path.Combine(tempDir, Guid.NewGuid().ToString()); 383var relativePath = path.Substring(extractDir.Length + 1).Replace(Path.DirectorySeparatorChar, '/'); 588string workingDir = Path.Combine(tempDir, "work", workingDirGuidSegment); 589string controlLayout = Path.Combine(workingDir, "control"); 590string dataLayout = Path.Combine(workingDir, "data"); 597string controlArchive = Path.Combine(workingDir, entry.RelativePath); 603string sumsFile = Path.Combine(workingDir, "md5sums"); 617File.Copy(sumsFile, Path.Combine(controlLayout, "md5sums"), overwrite: true); 620string controlFile = Path.Combine(controlLayout, "control"); 651string outputPath = Path.Join(destination, tar.Name); 652Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!); 696string workingDir = Path.Combine(tempDir, Guid.NewGuid().ToString().Split('-')[0]); 698string layout = Path.Combine(workingDir, "layout"); 705File.Copy(signedPart.FileSignInfo.FullPath, Path.Combine(layout, signedPart.RelativeName), overwrite: true); 709string payload = Path.Combine(workingDir, "payload.cpio"); 733string file = Path.Combine(workingDir, kind); 779string outputPath = Path.Combine(layout, entry.RelativePath); 780Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!);
Microsoft.DotNet.SignTool.Tests (167)
Config.cs (10)
15public static string TarToolPath => Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "tar", "Microsoft.Dotnet.Tar.dll"); 16public static string PkgToolPath => Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "pkg", "Microsoft.Dotnet.MacOsPkg.dll"); 17public static string SNPath => Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "sn", "sn.exe"); 18public static string Wix3ToolPath => Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "wix3"); 19public static string WixToolPath => Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "tools", "wix", "net472", "x64");
SignToolTests.cs (157)
266_tmpDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 273var srcPath = Path.Combine(Path.GetDirectoryName(typeof(SignToolTests).Assembly.Location), "Resources", name); 279dstDir = Path.Combine(dstDir, relativePath); 283var dstPath = Path.Combine(dstDir, name); 295var dstPath = Path.Combine(_tmpDir, name); 434string tempDir = Path.Combine(_tmpDir, "verification"); 440string controlLayout = Path.Combine(tempDir, "control"); 441string dataLayout = Path.Combine(tempDir, "data"); 449string md5sumsContents = File.ReadAllText(Path.Combine(controlLayout, "md5sums")); 458string layoutFilePath = Path.Combine(dataLayout, targetSystemFilePath); 479string controlFileContents = File.ReadAllText(Path.Combine(controlLayout, "control")); 486string archive = Path.Combine(destinationFolder, entry.RelativePath); 497string tempDir = Path.Combine(_tmpDir, "verification"); 500string layout = Path.Combine(tempDir, "layout"); 510string layoutFilePath = Path.Combine(layout, targetSystemFilePath); 809<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, fileToTest))}""> 851$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 852$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 853$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''.", 854$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll")}' with Microsoft certificate 'OverriddenCertificate'. The library is considered 3rd party library due to its copyright: ''." 894$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerOne.dll")}' with Microsoft certificate 'ArcadeCertTest'. The library is considered 3rd party library due to its copyright: ''." 956$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "CoreLibCrossARM.dll"))}""> 959<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "AspNetCoreCrossLib.dll"))}""> 1030$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "EmptyPKT.dll")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''." 1088$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "ABCDEFG/MsiSetup.msi"))}""> 1091$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines\\0\\MsiBootstrapper.exe-engine.exe"))}""> 1094$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "MsiBootstrapper.exe"))}""> 1097$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithWix.nupkg"))}""> 1144$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/native/NativeLibrary.dll"))}""> 1147<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll"))}""> 1151<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerTwo.dll"))}""> 1155<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll"))}""> 1159<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll"))}""> 1163<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll"))}""> 1167<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netcoreapp2.0/ContainerOne.dll"))}""> 1173<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "ContainerOne.1.0.0.nupkg"))}""> 1227<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/native/NativeLibrary.dll"))}""> 1230<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "lib/net461/ProjectOne.dll"))}""> 1234<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "lib/netcoreapp2.0/ContainerTwo.dll"))}""> 1238<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "lib/netcoreapp2.0/ProjectOne.dll"))}""> 1242<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "lib/netcoreapp2.1/ProjectOne.dll"))}""> 1246<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/netstandard2.0/ProjectOne.dll"))}""> 1250<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netcoreapp2.0/ContainerOne.dll"))}""> 1256<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "ContainerOne.1.0.0.nupkg"))}""> 1303<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1306<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1309<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1312<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1366$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "InnerZipFile.zip")} -> {Path.Combine(_tmpDir, "InnerZipFile.zip")}", 1367$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "InnerZipFile.zip.sig")} -> {Path.Combine(_tmpDir, "InnerZipFile.zip.sig")}" 1373<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1376<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1379<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1382<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1385<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "Mid.SOS.NETCore.dll"))}""> 1388<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "MidNativeLibrary.dll"))}""> 1393<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.zip"))}""> 1396<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.tgz"))}""> 1399<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "InnerZipFile.zip"))}""> 1438<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1477<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "Payload/SOS.NETCore.dll"))}""> 1480<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Payload/NativeLibrary.dll"))}""> 1483<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1486<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1491<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "NestedPkg.pkg.zip"))}""> 1495<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1547<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "Payload/SOS.NETCore.dll"))}""> 1550<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Payload/NativeLibrary.dll"))}""> 1553<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1556<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1561<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "NestedPkg.pkg.zip"))}""> 1565<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1570<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.pkg.zip"))}""> 1609<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Payload/SOS.NETCore.dll"))}""> 1612<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "Payload/NativeLibrary.dll"))}""> 1615<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1618<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "5", "Payload/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1623<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "NestedPkg.pkg.zip"))}""> 1659<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "Contents/Resources/libexample.dylib"))}""> 1664<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Payload", "test.app.zip"))}""> 1669<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "WithApp.pkg.zip"))}""> 1711<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "test/NativeLibrary.dll"))}""> 1714<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "test/SOS.NETCore.dll"))}""> 1717<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "test/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1720<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "test/this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1763<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1766<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1769<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1772<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1816<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "NativeLibrary.dll"))}""> 1819<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "SOS.NETCore.dll"))}""> 1822<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.NativeLibrary.dll"))}""> 1825<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "3", "this_is_a_big_folder_name_look/this_is_an_even_more_longer_folder_name/but_this_one_is_ever_longer_than_the_previous_other_two/Nested.SOS.NETCore.dll"))}""> 1857$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "./usr/local/bin/mscorlib.dll"))}""> 1860$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.deb"))}""> 1874ValidateProducedDebContent(Path.Combine(_tmpDir, "test.deb"), expectedFilesOriginalHashes, signableFiles, expectedControlFileContent); 1899$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.rpm"))}""> 1928$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "./usr/local/bin/mscorlib.dll"))}""> 1931$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.rpm"))}""> 1944ValidateProducedRpmContent(Path.Combine(_tmpDir, "test.rpm"), expectedFilesOriginalHashes, signableFiles, originalUncompressedPayloadChecksum); 2110$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiSetup.msi"))}""> 2113$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines", "0", "MsiBootstrapper.exe-engine.exe"))}""> 2116$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiBootstrapper.exe"))}""> 2160$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiApplication.exe"))}""> 2163$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiSetup5.msi"))}""> 2166$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "engines", "0", "MsiBootstrapper5.exe-engine.exe"))}""> 2169$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiBootstrapper5.exe"))}""> 2206$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "0", "ABCDEFG/MsiApplication.exe"))}""> 2209$@"<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "MsiSetup.msi"))}""> 2223var badPath = Path.Combine(Config.WixToolPath, "badpath"); 2275<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "VisualStudio.Mac.Banana.dll"))}""> 2311$"{Path.Combine(_tmpDir, "ContainerSigning", "6", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "PackageWithRelationships.vsix")}" 2317<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "1", "lib/net461/ProjectOne.dll"))}""> 2321<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "lib/netstandard2.0/ProjectOne.dll"))}""> 2325<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2331<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "PackageWithRelationships.vsix"))}""> 2336<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 2372$"{Path.Combine(_tmpDir, "ContainerSigning", "4", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "PackageWithRelationships.vsix")}" 2378<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "6", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2382<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "10", "Team%20Tools/Dynamic Code Coverage/net461/ProjectOne.dll"))}""> 2386<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "11", "Team%20Tools/Dynamic Code Coverage/netstandard2.0/ProjectOne.dll"))}""> 2392<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "4", "PackageWithRelationships.vsix"))}""> 2397<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "TestSpaces.vsix"))}""> 2435<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2439<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/net461/ProjectOne.dll"))}""> 2443<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/netstandard2.0/ProjectOne.dll"))}""> 2449<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithRelationships.vsix"))}""> 2454<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 2491$"{Path.Combine(_tmpDir, "A", "PackageWithRelationships.vsix")} -> {Path.Combine(_tmpDir, "B", "PackageWithRelationships.vsix")}" 2497<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2501<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "7", "lib/net461/ProjectOne.dll"))}""> 2505<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/netstandard2.0/ProjectOne.dll"))}""> 2511<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "A", "PackageWithRelationships.vsix"))}""> 2516<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "test.vsix"))}""> 2550<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "ContainerSigning", "2", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll"))}""> 2556<FilesToSign Include=""{Uri.EscapeDataString(Path.Combine(_tmpDir, "PackageWithRelationships.vsix"))}""> 2693$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "0", "Simple1.exe")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''.", 2694$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "1", "Simple2.exe")}' with Microsoft certificate 'Microsoft400'. The library is considered 3rd party library due to its copyright: ''." 3052$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "EmptyPKT.dll")}' with Microsoft certificate 'DLLCertificate'. The library is considered 3rd party library due to its copyright: ''.", 3053$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "8", "lib/net461/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate3'. The library is considered 3rd party library due to its copyright: ''.", 3054$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "9", "lib/netstandard2.0/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate4'. The library is considered 3rd party library due to its copyright: ''.", 3055$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "15", "Contents/Common7/IDE/PrivateAssemblies/ProjectOne.dll")}' with Microsoft certificate 'DLLCertificate5'. The library is considered 3rd party library due to its copyright: ''.", 3056$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "ContainerSigning", "22", "Simple.dll")}' with Microsoft certificate 'DLLCertificate2'. The library is considered 3rd party library due to its copyright: ''.", 3057$@"SIGN004: Signing 3rd party library '{Path.Combine(_tmpDir, "Simple.exe")}' with Microsoft certificate 'MacDeveloperHarden'. The library is considered 3rd party library due to its copyright: ''." 3270var tempDir = Path.GetTempPath(); 3271string workingDir = Path.Combine(tempDir, "extract", Guid.NewGuid().ToString()); 3272string outputDir = Path.Combine(tempDir, "output", Guid.NewGuid().ToString()); 3273string createFileName = Path.Combine(workingDir, "create.cmd"); 3274string outputFileName = Path.Combine(outputDir, expectedExe); 3284File.Delete(Path.Combine(workingDir, "bundle.wxs"));
Microsoft.DotNet.SourceBuild.Tasks (9)
src\UsageReport\WritePackageUsageData.cs (5)
150Directory.CreateDirectory(Path.GetDirectoryName(ProjectAssetsJsonArchiveFile)); 163using (var stream = File.OpenRead(Path.Combine(RootDir, relativePath))) 184using (var file = File.OpenRead(Path.Combine(RootDir, assetFile))) 254Directory.CreateDirectory(Path.GetDirectoryName(DataFile)); 268return path.Substring(RootDir.Length).Replace(Path.DirectorySeparatorChar, '/');
src\UsageReport\WriteUsageReports.cs (3)
102poisonNupkgFilenames.Add(Path.GetFileNameWithoutExtension(segments[1])); 162Path.Combine(OutputDirectory, "annotated-usage.xml"), 204string filename = Path.GetFileName(snapshot.Path);
src\WriteBuildOutputProps.cs (1)
75Directory.CreateDirectory(Path.GetDirectoryName(OutputPath));
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
107string fullPath = Path.Combine(outputDirectory.FullName, path);
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (4)
Languages\Language.cs (4)
19public static string BasePath { get; set; } = Path.GetDirectoryName(typeof(Templates).Assembly.Location); 23string templateDirectory = Path.GetFullPath(Path.Combine( 30var relative = Path.GetFullPath(file);
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
85string fullPath = Path.Combine(outputDirectory.FullName, path);
Microsoft.DotNet.TemplateLocator (46)
SdkDirectoryWorkloadManifestProvider.cs (28)
73string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 74string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 90var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 93knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 111_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 186_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 270var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 300var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 319AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 326var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], _sdkVersionBand.ToString()); 341var manifestVersionBandDirectory = Path.Combine(manifestRoot, _sdkVersionBand.ToString()); 346directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 398AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 426string manifestId = Path.GetFileName(manifestDirectory); 434.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 437return (directory: dir, version: Path.GetFileName(dir)); 446else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 448var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 472.Select(dir => Path.GetFileName(dir)) 478.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 503var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 505if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 536var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 553var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 563var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 568var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 597string globalJsonPath = Path.Combine(directory, "global.json"); 602directory = Path.GetDirectoryName(directory);
TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
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)
105if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
Microsoft.DotNet.TemplateLocator.Tests (16)
GivenAnTemplateLocator.cs (15)
18Path.Combine(TestContext.Current.TestExecutionDirectory, Path.GetRandomFileName()); 20var fakeSdkDirectory = Path.Combine(_fakeDotnetRootDirectory, "sdk", "5.0.102"); 22var fakeRuntimeIdentifierChainPath = Path.Combine(fakeSdkDirectory, "NETCoreSdkRuntimeIdentifierChain.txt"); 26_manifestDirectory = Path.Combine(_fakeDotnetRootDirectory, "sdk-manifests", "5.0.100"); 34Directory.CreateDirectory(Path.Combine(_manifestDirectory, "Android")); 35File.Copy(Path.Combine("Manifests", "AndroidWorkloadManifest.json"), 36Path.Combine(_manifestDirectory, "Android", "WorkloadManifest.json")); 38string templatePacksDirectory = Path.Combine(_fakeDotnetRootDirectory, "template-packs"); 40string templateNupkgPath = Path.Combine(templatePacksDirectory, "xamarin.android.templates.1.0.3.nupkg"); 55Directory.CreateDirectory(Path.Combine(_manifestDirectory, "Android")); 56File.Copy(Path.Combine("Manifests", "AndroidWorkloadManifest.json"), 57Path.Combine(_manifestDirectory, "Android", "WorkloadManifest.json")); 67Path.Combine(TestContext.Current.TestExecutionDirectory, Path.GetRandomFileName());
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.DotNet.Tools.Tests.ComponentMocks (28)
MockNuGetPackageDownloader.cs (4)
35_downloadPath = dotnetRoot == null ? string.Empty : Path.Combine(dotnetRoot, "metadata", "temp"); 72var path = Path.Combine(_downloadPath, "mock.nupkg"); 94var dataFolder = Path.Combine(targetFolder.Value, "data"); 105File.WriteAllText(Path.Combine(dataFolder, "WorkloadManifest.json"), manifestContents);
ToolPackageDownloaderMock.cs (7)
63_localToolDownloadDir = new DirectoryPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "nuget", "package")); 134rollbackDirectory = isGlobalTool ? _toolDownloadDir.Value : Path.Combine(_toolDownloadDir.Value, packageId.ToString(), packageVersion.ToString()); 136var fakeExecutableSubDirectory = Path.Combine( 142var fakeExecutablePath = Path.Combine(fakeExecutableSubDirectory, FakeEntrypointName); 144_fileSystem.Directory.CreateDirectory(Path.Combine(_toolDownloadDir.Value, fakeExecutableSubDirectory)); 145_fileSystem.File.CreateEmptyFile(Path.Combine(_toolDownloadDir.Value, fakeExecutablePath)); 175rollbackDirectory = Path.Combine(packageDirectory.Value, packageVersion);
ToolPackageDownloaderMock2.cs (7)
67var entryPointSimple = Path.GetFileNameWithoutExtension(FakeEntrypointName); 129var fakeExecutableSubDirectory = Path.Combine( 135var fakeExecutablePath = Path.Combine(fakeExecutableSubDirectory, FakeEntrypointName); 141_fileSystem.File.WriteAllText(Path.Combine(fakeExecutableSubDirectory, "DotnetToolSettings.xml"), 152var resolvedPath = Path.Combine(nupkgDir, additionalFile.Key); 153if (!_fileSystem.Directory.Exists(Path.GetDirectoryName(resolvedPath)!)) 155_fileSystem.Directory.CreateDirectory(Path.GetDirectoryName(resolvedPath)!);
ToolPackageMock.cs (2)
77var executablePath = _fileSystem.File.ReadAllText(Path.Combine(PackageDirectory.Value, "project.assets.json")); 79var settingsFilePath = Path.Combine(PackageDirectory.Value, @$"{Id}\{Version}\tools\net6.0\any", "DotnetToolSettings.xml");
ToolPackageStoreMock.cs (5)
24Root = new DirectoryPath(Path.GetFullPath(root.Value)); 33return Root.WithSubDirectories(ToolPackageStoreAndQuery.StagingDirectory, Path.GetRandomFileName()); 39Path.GetFileName( 73var name = Path.GetFileName(subdirectory); 104NuGetVersion.Parse(Path.GetFileName(subdirectory)),
ToolPackageUninstallerMock.cs (3)
39string systemTempPath = Path.GetTempPath(); 41var tempPath = Path.Combine(systemTempPath, Path.GetRandomFileName());
Microsoft.DotNet.VersionTools.Cli (1)
VersionTrimmingOperation.cs (1)
45if (assets.Any(a => Path.GetExtension(a) != ".nupkg"))
Microsoft.DotNet.XliffTasks (48)
Model\Document.cs (3)
70string tempPath = Path.Combine(Path.GetDirectoryName(path), Path.GetRandomFileName());
Model\ResxDocument.cs (3)
65string resourceRelativePath = splitRelativePathAndSerializedType[0].Replace('\\', Path.DirectorySeparatorChar); 67string absolutePath = Path.Combine(Path.GetDirectoryName(sourceFullPath), resourceRelativePath);
Model\VsctDocument.cs (3)
85string resourceRelativePath = hrefAttribute.Value.Replace('\\', Path.DirectorySeparatorChar); 87string absolutePath = Path.Combine(Path.GetDirectoryName(sourceFullPath), resourceRelativePath);
Tasks\GatherTranslatedSource.cs (11)
52Path.DirectorySeparatorChar, 53Path.AltDirectorySeparatorChar 66string relativePath = Path.GetFileName(translatedFullPath); 69relativePath = Path.Combine(language, relativePath); 78string linkDirectory = Path.GetDirectoryName(link); 79link = Path.Combine(linkDirectory, relativePath); 100string logicalExtension = Path.GetExtension(logicalName); 101logicalName = Path.ChangeExtension(logicalName, $".{language}{logicalExtension}"); 111string sourceDirectory = Path.GetDirectoryName(xlf.GetMetadataOrThrow(MetadataKey.XlfSource)); 112dependentUpon = Path.GetFullPath(Path.Combine(sourceDirectory, dependentUpon));
Tasks\GatherXlf.cs (5)
58translatedFileName = Path.GetFileNameWithoutExtension(source.ItemSpec); 63string extension = Path.GetExtension(source.ItemSpec); 66Path.Combine(TranslatedOutputDirectory, language, $"{translatedFileName}{extension}") : 67Path.Combine(TranslatedOutputDirectory, $"{translatedFileName}.{language}{extension}"); 72$"Two or more source files to be translated in the same project are named {Path.GetFileName(sourceDocumentPath)}. " +
Tasks\SortXlf.cs (1)
45Directory.CreateDirectory(Path.GetDirectoryName(xlfPath));
Tasks\TransformTemplates.cs (14)
63string templateName = Path.GetFileNameWithoutExtension(template.ItemSpec); 65string templateDirectory = Path.GetDirectoryName(templatePath); 70? Path.Combine(TranslatedOutputDirectory, $"{templateName}.default.1033") 71: Path.Combine(TranslatedOutputDirectory, $"{templateName}.{language}"); 73string cultureSpecificTemplateFile = Path.Combine(localizedTemplateDirectory, Path.GetFileName(template.ItemSpec)); 79string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value); 80File.Copy(projectFileFullPath, Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value)), overwrite: true); 86string templateItemFullPath = Path.Combine(templateDirectory, templateItem.Value); 87string templateItemDestinationPath = Path.Combine(localizedTemplateDirectory, templateItem.Value); 104Path.GetFileNameWithoutExtension(unstructuredResource.ItemSpec), 107Path.GetExtension(unstructuredResource.ItemSpec)); 108File.Copy(Path.Combine(TranslatedOutputDirectory, localizedFileName), templateItemDestinationPath, overwrite: true);
Tasks\TranslateSource.cs (2)
39Directory.CreateDirectory(Path.GetDirectoryName(translatedFullPath)); 41sourceDocument.RewriteRelativePathsToAbsolute(Path.GetFullPath(sourcePath));
Tasks\UpdateXlf.cs (1)
71Directory.CreateDirectory(Path.GetDirectoryName(xlfPath));
Tasks\XlfTask.cs (5)
92string directory = Path.GetDirectoryName(sourcePath); 93string filename = Path.GetFileNameWithoutExtension(sourcePath); 94string extension = Path.GetExtension(sourcePath); 106return Path.Combine(directory, "xlf", filename + xlfExtension); 111return $"../{Path.GetFileName(sourcePath)}";
Microsoft.DotNet.XliffTasks.Tests (7)
ResxDocumentTests.cs (3)
55string expectedAbsoluteLocation = Path.Combine( 57@"Resources\Package.ico".Replace('\\', Path.DirectorySeparatorChar)); 76Path.Combine(sourceFolder, "Resources.resx"));
VsctDocumentTests.cs (4)
77string expectedAbsoluteLocation = Path.Combine( 79@"Resources\Images.png".Replace('\\', Path.DirectorySeparatorChar)); 99Path.Combine(sourceFolder, "Resources.resx")); 119Path.Combine(Directory.GetCurrentDirectory(), "Resources.resx"));
Microsoft.DotNet.XUnitAssert.Tests (3)
EquivalenceAssertsTests.cs (3)
1531 var assemblyPath = Path.GetDirectoryName(typeof(SpecialCases).Assembly.Location); 1543 var assemblyPath = Path.GetDirectoryName(typeof(SpecialCases).Assembly.Location); 1545 var assemblyParentPath = Path.GetDirectoryName(assemblyPath);
Microsoft.Extensions.AI.Abstractions (1)
Image\ImageGeneratorExtensions.cs (1)
206string extension = Path.GetExtension(fileName);
Microsoft.Extensions.AI.Evaluation.Console (1)
Commands\ReportCommand.cs (1)
80string? outputPath = Path.GetDirectoryName(outputFilePath);
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
ResultsTests.cs (3)
33Path.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 (2)
OpenAISpeechToTextClient.cs (2)
65Path.GetFileName(fileStream.Name) : // Use the file name if we can get one from the stream. 116Path.GetFileName(fileStream.Name) : // Use the file name if we can get one from the stream.
Microsoft.Extensions.AI.Templates.Tests (23)
AIChatWebSnapshotTests.cs (3)
80string templateLocation = Path.Combine(WellKnownPaths.TemplateFeedLocation, "Microsoft.Extensions.AI.Templates", "src", "ChatWithCustomData"); 82var verificationExcludePatterns = Path.DirectorySeparatorChar is '/' 84: _verificationExcludePatterns.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray();
Infrastructure\Project.cs (1)
28StartupProjectFullPath = Path.Combine(rootPath, field);
Infrastructure\TemplateExecutionTestClassFixtureBase.cs (6)
37_templateTestOutputPath = Path.Combine(WellKnownPaths.TemplateSandboxOutputRoot, outputFolderName); 38_customHivePath = Path.Combine(_templateTestOutputPath, "hive"); 52var installSandboxPath = Path.Combine(_templateTestOutputPath, "install"); 55var installNuGetConfigPath = Path.Combine(installSandboxPath, "nuget.config"); 71var outputFolderPath = Path.Combine(_templateTestOutputPath, outputFolderName); 87var templateNuGetConfigPath = Path.Combine(outputFolderPath, "nuget.config");
Infrastructure\WellKnownPaths.cs (9)
30TemplateFeedLocation = Path.Combine(RepoRoot, "src", "ProjectTemplates"); 31TemplateSandboxRoot = Path.Combine(ThisProjectRoot, "TemplateSandbox"); 32TemplateSandboxOutputRoot = Path.Combine(TemplateSandboxRoot, "output"); 33TemplateInstallNuGetConfigPath = Path.Combine(TemplateSandboxRoot, "nuget.template_install.config"); 34TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxRoot, "nuget.template_test.config"); 42LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping"); 43NuGetPackagesPath = Path.Combine(TemplateSandboxOutputRoot, "packages"); 52var gitPath = Path.Combine(directory, ".git"); 72var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
McpServerSnapshotTests.cs (3)
66string templateLocation = Path.Combine(WellKnownPaths.TemplateFeedLocation, "Microsoft.Extensions.AI.Templates", "src", "McpServer"); 68var verificationExcludePatterns = Path.DirectorySeparatorChar is '/' 70: _verificationExcludePatterns.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray();
ProjectRootHelper.cs (1)
28if (Path.GetDirectoryName(callerFilePath) is not { Length: > 0 } testProjectRoot)
Microsoft.Extensions.ApiDescription.Client (3)
GetOpenApiReferenceMetadata.cs (3)
95if (!Path.IsPathRooted(outputPath) && !string.IsNullOrEmpty(OutputDirectory)) 97outputPath = Path.Combine(OutputDirectory, outputPath); 113var outputFilename = Path.GetFileNameWithoutExtension(outputPath);
Microsoft.Extensions.ApiDescription.Client.Tests (80)
GetOpenApiReferenceMetadataTest.cs (22)
23var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 25var outputPath = Path.Combine("obj", "NSwagClient.cs"); 77var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 80var outputPath = Path.Combine("obj", $"NSwagClient.cs"); 138var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 140var outputPath = Path.Combine("obj", "NSwagClient.cs"); 197var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 200var outputPath = Path.Combine(Path.GetTempPath(), $"{className}.cs"); 258var identity1 = Path.Combine("TestProjects", "files", "NSwag.json"); 259var identity2 = Path.Combine("TestProjects", "files", "swashbuckle.json"); 304var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 306var error = Resources.FormatDuplicateFileOutputPaths(Path.Combine("obj", "NSwagClient.cs")); 349var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 353var expectedOutputPath = Path.Combine("bin", outputPath); 415var identity = Path.Combine("TestProjects", "files", "NSwag.json"); 417var expectedOutputPath = Path.Combine("bin", outputPath); 473var identity12 = Path.Combine("TestProjects", "files", "NSwag.json"); 474var identity3 = Path.Combine("TestProjects", "files", "swashbuckle.json"); 483var outputPath1 = Path.Combine("obj", $"{className12}.cs"); 484var outputPath2 = Path.Combine("obj", $"{className12}.ts"); 485var outputPath3 = Path.Combine("obj", $"{className3}.cs");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
TargetTest.cs (48)
19private static string _assemblyLocation = Path.GetDirectoryName(_assembly.Location); 38var directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "build")); 41file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true); 43directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "build")); 46file.CopyTo(Path.Combine(build.Root, file.Name), overwrite: true); 50directory = new DirectoryInfo(Path.Combine(_assemblyLocation, "TestProjects", "files")); 53file.CopyTo(Path.Combine(files.Root, file.Name), overwrite: true); 60file.CopyTo(Path.Combine(tasks.Root, file.Name), overwrite: true); 80Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "azureMonitorClient.cs")}", process.Output); 81Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output); 103Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output); 104Assert.Contains($"TypeScriptCompile: {Path.Combine("obj", "azureMonitorClient.ts")}", process.Output); 123Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "azureMonitorClient.cs")}", process.Output); 124Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "NSwagClient.cs")}", process.Output); 125Assert.Contains($"Compile: {Path.Combine(_temporaryDirectory.Root, "obj", "swashbuckleClient.cs")}", process.Output); 126Assert.Contains($"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs")}", process.Output); 127Assert.Contains($"FileWrites: {Path.Combine("obj", "NSwagClient.cs")}", process.Output); 128Assert.Contains($"FileWrites: {Path.Combine("obj", "swashbuckleClient.cs")}", process.Output); 149Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}", process.Output); 150Assert.Contains($"Compile: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}", process.Output); 152$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated1.cs")}", 155$"FileWrites: {Path.Combine("obj", "azureMonitorClient.cs", "Generated2.cs")}", 178$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 180$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 203$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 205$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 228$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 230$"Options: '' OutputPath: '{Path.Combine("generated", "azureMonitorClient.cs")}'", 255$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 257$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 280$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 282$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'", 305$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 307$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 330$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 332$"Options: '--an-option' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 357$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 359$"Options: '' OutputPath: '{Path.Combine("obj", "Custom.cs")}'", 381$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 383$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 387$"{Path.Combine(_temporaryDirectory.Root, "files", "NSwag.json")} " + 389$"Options: '' OutputPath: '{Path.Combine("obj", "NSwagClient.cs")}'", 393$"{Path.Combine(_temporaryDirectory.Root, "files", "swashbuckle.json")} " + 395$"Options: '' OutputPath: '{Path.Combine("obj", "swashbuckleClient.cs")}'", 422$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 424$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.cs")}'", 428$"{Path.Combine(_temporaryDirectory.Root, "files", "azureMonitor.json")} " + 430$"Options: '' OutputPath: '{Path.Combine("obj", "azureMonitorClient.ts")}'",
Microsoft.Extensions.ApiDescription.Tool.Tests (59)
GetDocumentTests.cs (52)
19private readonly string _toolsDirectory = Path.GetDirectoryName(typeof(Program).Assembly.Location); 25var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 35"--file-list", Path.Combine(outputPath.FullName, "file-list.cache") 39using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample.json"))); 51var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 61"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 66using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample.json"))); 77var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 87"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 93using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample.json"))); 104var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 114"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 119var expectedDocumentPath = Path.Combine(outputPath.FullName, "Sample_internal.json"); 126using var stream = new MemoryStream(File.ReadAllBytes(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 138var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 148"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 154Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 155Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 156Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_invalid.json"))); 167var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 177"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 182Assert.True(File.Exists(Path.Combine(outputPath.FullName, $"{fileName}.json"))); 183Assert.True(File.Exists(Path.Combine(outputPath.FullName, $"{fileName}_internal.json"))); 184Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 185Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 194var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 204"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 211Assert.False(File.Exists(Path.Combine(outputPath.FullName, $"{fileName}.json"))); 212Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 213Assert.False(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json"))); 220var outputPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 230"--file-list", Path.Combine(outputPath.FullName, "file-list.cache"), 235Assert.False(File.Exists(Path.Combine(outputPath.FullName, ".json"))); 236Assert.False(File.Exists(Path.Combine(outputPath.FullName, "_internal.json"))); 237Assert.True(File.Exists(Path.Combine(outputPath.FullName, "Sample.json"))); 238Assert.True(File.Exists(Path.Combine(outputPath.FullName, "Sample_internal.json")));
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
Infrastructure\RedisTestConfig.cs (4)
137return Path.Combine(configFilePath, UserProfileRedisNugetPackageServerPath, RedisServerExeName); 143return Path.Combine(configFilePath, CIMachineRedisNugetPackageServerPath, RedisServerExeName); 155var tempPath = Path.GetTempPath(); 157Path.Combine(tempPath, FunctionalTestsRedisServerExeName + ".exe");
Microsoft.Extensions.Configuration.FileExtensions (7)
FileConfigurationProvider.cs (1)
116/// Loads the contents of the file at <see cref="Path"/>.
FileConfigurationSource.cs (6)
77System.IO.Path.IsPathRooted(Path)) 79string? directory = System.IO.Path.GetDirectoryName(Path); 80string? pathToFile = System.IO.Path.GetFileName(Path); 83pathToFile = System.IO.Path.Combine(System.IO.Path.GetFileName(directory), pathToFile); 84directory = System.IO.Path.GetDirectoryName(directory);
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.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)
317FileInfo memoryUsageInBytesFile = new(Path.Combine(path, "memory.current"));
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Linux\OSFileSystemTests.cs (1)
22Path.Combine(Directory.GetCurrentDirectory(), "fixtures"), "*.slice");
Linux\Resources\HardcodedValueFileSystem.cs (1)
41.Select(x => Path.Combine(directory, x.Value))
Microsoft.Extensions.DotNetDeltaApplier (5)
HotReloadAgent.cs (3)
252var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 255var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 258return string.Join(Path.PathSeparator, updatedValues);
StartupHook.cs (2)
29var processDir = Path.GetDirectoryName(processPath)!; 46var path = Path.Combine(processDir, args.Name + ".dll");
Microsoft.Extensions.DotNetDeltaApplier.Tests (7)
AbstractBrowserRefreshServer.cs (2)
91builder.InsertListItem(MiddlewareEnvironmentVariables.DotNetStartupHooks, middlewareAssemblyPath, Path.PathSeparator); 92builder.InsertListItem(MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssemblies, Path.GetFileNameWithoutExtension(middlewareAssemblyPath), MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssembliesSeparator);
AssertEx.cs (1)
219var expected = expectedFiles.Select(p => Path.Combine(root, p));
DefaultHotReloadClient.cs (1)
113environmentBuilder.InsertListItem(AgentEnvironmentVariables.DotNetStartupHooks, startupHookPath, Path.PathSeparator);
HotReloadAgentTest.cs (2)
24HotReloadAgent.RemoveCurrentAssembly(typeof(StartupHook), typeof(StartupHook).Assembly.Location + Path.PathSeparator + customStartupHook)); 32HotReloadAgent.RemoveCurrentAssembly(typeof(StartupHook), customStartupHook + Path.PathSeparator + typeof(StartupHook).Assembly.Location.ToUpperInvariant()));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.Extensions.FileProviders.Embedded (9)
EmbeddedFileProvider.cs (4)
24private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars() 100var everettId = MakeValidEverettIdentifier(Path.GetDirectoryName(subpath)); 110builder.Append(Path.GetFileName(subpath)); 118var name = Path.GetFileName(subpath);
Manifest\EmbeddedFilesManifest.cs (5)
15private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars() 16.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 18private static readonly char[] _separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
Microsoft.Extensions.FileProviders.Embedded.Tests (6)
ManifestEmbeddedFileProviderTests.cs (6)
65var jqueryValidate = provider.GetFileInfo(Path.Combine("wwwroot", "jquery.validate.js")); 72var jqueryMin = provider.GetFileInfo(Path.Combine("wwwroot", "jquery.min.js")); 79var siteCss = provider.GetFileInfo(Path.Combine("wwwroot", "site.css")); 164var jqueryValidate = provider.GetFileInfo(Path.Combine(folder, file)); 187var jqueryValidate = provider.GetFileInfo(Path.Combine(".", "wwwroot", "jquery.validate.js")); 210var jqueryValidate = provider.GetFileInfo(Path.Combine("..", "wwwroot", "jquery.validate.js"));
Microsoft.Extensions.FileProviders.Physical (22)
Internal\PathUtils.cs (7)
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) 37return path + Path.DirectorySeparatorChar;
PhysicalFileProvider.cs (9)
27{Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}; 56if (!Path.IsPathRooted(root)) 61string fullRoot = Path.GetFullPath(root); 162string root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(Root)); 238fullPath = Path.GetFullPath(Path.Combine(Root, path)); 274if (Path.IsPathRooted(subpath)) 319if (Path.IsPathRooted(subpath))
PhysicalFilesWatcher.cs (5)
135if (Path.IsPathRooted(filter) || PathUtils.PathNavigatesAboveRoot(filter)) 189var pollingChangeToken = new PollingFileChangeToken(new FileInfo(Path.Combine(_root, filePath))); 293string oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1)); 449(path[path.Length - 1] == Path.DirectorySeparatorChar || 450path[path.Length - 1] == Path.AltDirectorySeparatorChar);
PollingWildCardChangeToken.cs (1)
171string filePath = Path.Combine(_directoryInfo.FullName, path);
Microsoft.Extensions.FileSystemGlobbing (27)
Abstractions\DirectoryInfoWrapper.cs (2)
77new DirectoryInfo(Path.Combine(_directoryInfo.FullName, name)), 103=> new FileInfoWrapper(new FileInfo(Path.Combine(_directoryInfo.FullName, name)));
InMemoryDirectoryInfo.cs (22)
18private static readonly char[] DirectorySeparators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 54Name = Path.GetFileName(rootDir); 63string normalizedRoot = Path.GetFullPath(rootDir.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 68string fileWithNormalSeparators = file.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 69if (Path.IsPathRooted(file)) 71fileList.Add(Path.GetFullPath(fileWithNormalSeparators)); 75fileList.Add(Path.GetFullPath(Path.Combine(normalizedRoot, fileWithNormalSeparators))); 93new InMemoryDirectoryInfo(Path.GetDirectoryName(FullName)!, _files, true, _comparisonType); 139(rootDir[rootDirLength - 1] == Path.DirectorySeparatorChar || 140filePath.IndexOf(Path.DirectorySeparatorChar, rootDirLength) == rootDirLength); 148return new InMemoryDirectoryInfo(Path.Combine(FullName, path), _files, true, _comparisonType); 152string normPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 164string normPath = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Internal\InMemoryFileInfo.cs (1)
16Name = Path.GetFileName(file);
MatcherExtensions.cs (2)
64result.Add(Path.GetFullPath(Path.Combine(directoryPath, match.Path)));
Microsoft.Extensions.Hosting (5)
HostBuilder.cs (3)
259if (Path.IsPathRooted(contentRootPath)) 263return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
HostingHostBuilderExtensions.cs (2)
247string sanitizedApplicationName = env.ApplicationName.Replace(Path.DirectorySeparatorChar, '_') 248.Replace(Path.AltDirectorySeparatorChar, '_');
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
NoRemoteCallHandler.cs (2)
23var assemblyFileLocation = Path.GetDirectoryName(typeof(NoRemoteCallHandler).Assembly.Location)!; 26var responseFilePath = Path.Combine(Directory.GetFiles(
NoRemoteCallNotSeekableHandler.cs (2)
26var assemblyFileLocation = Path.GetDirectoryName(typeof(NoRemoteCallHandler).Assembly.Location)!; 29var responseFilePath = Path.Combine(Directory.GetFiles(
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\Internal\NoRemoteCallHandler.cs (2)
19var assemblyFileLocation = Path.GetDirectoryName(typeof(NoRemoteCallHandler).Assembly.Location)!; 22var responseFilePath = Path.Combine(Directory.GetFiles(
Microsoft.Extensions.Localization (4)
ResourceManagerStringLocalizerFactory.cs (4)
48_resourcesRelativePath = _resourcesRelativePath.Replace(Path.AltDirectorySeparatorChar, '.') 49.Replace(Path.DirectorySeparatorChar, '.') + "."; 231.Replace(Path.DirectorySeparatorChar, '.') 232.Replace(Path.AltDirectorySeparatorChar, '.');
Microsoft.Extensions.Localization.Tests (5)
ResourceManagerStringLocalizerFactoryTest.cs (5)
67var resourceLocationAttribute = new ResourceLocationAttribute(Path.Combine("My", "Resources")); 136var resourcePath = Path.Combine("My", "Resources"); 164var resourcePath = Path.Combine("My", "Resources"); 189locOptions.ResourcesPath = Path.Combine("My", "Resources"); 269locOptions.ResourcesPath = Path.Combine("My", "Resources");
Microsoft.Extensions.Logging.AzureAppServices (4)
FileLoggerConfigureOptions.cs (1)
23options.LogDirectory = Path.Combine(_context.HomeFolder, "LogFiles", "Application");
FileLoggerProvider.cs (1)
66return Path.Combine(_path, $"{_fileName}{group.Year:0000}{group.Month:00}{group.Day:00}.txt");
SiteConfigurationProvider.cs (2)
13var settingsFolder = Path.Combine(context.HomeFolder, "site", "diagnostics"); 14var settingsFile = Path.Combine(settingsFolder, "settings.json");
Microsoft.Extensions.ML (2)
ModelLoaders\FileModelLoader.cs (2)
45var directory = Path.GetDirectoryName(filePath); 52var file = Path.GetFileName(filePath);
Microsoft.Extensions.ML.Tests (2)
FileLoaderTests.cs (1)
48loaderUnderTest.Start(Path.Combine("TestModels", "SentimentModel.zip"), false);
PredictionEnginePoolTests.cs (1)
34.FromFile(modelName: "model1", filePath: Path.Combine("TestModels", "SentimentModel.zip"), watchForChanges: false);
Microsoft.Extensions.SecretManager.Tools.Tests (41)
InitCommandTest.cs (3)
92var projectFile = Path.Combine(projectDir, "TestProject.csproj"); 104var projectFile = Path.Combine(projectDir, "TestProject.csproj"); 134string secretId = $"invalid{Path.GetInvalidPathChars()[0]}secret-id";
MsBuildProjectFinderTest.cs (1)
25Assert.Equal(Path.Combine(files.Root, filename), finder.FindMsBuildProject(null));
SecretManagerTests.cs (19)
44var project = Path.Combine(_fixture.CreateProject(id), "TestProject.csproj"); 54var project = Path.Combine(_fixture.CreateProject("<"), "TestProject.csproj"); 64var projectPath = Path.Combine(_fixture.GetTempSecretProject(), "does_not_exist", "TestProject.csproj"); 74var projectPath = Path.Combine(_fixture.GetTempSecretProject(), "does_not_exist", "TestProject.csproj"); 87secretManager.RunInternal("init", "--file", Path.Combine(dir, "app.cs")); 95var cwd = Path.Combine(projectPath, "nested1"); 99secretManager.RunInternal("list", "-p", ".." + Path.DirectorySeparatorChar, "--verbose"); 101Assert.Contains(Resources.FormatMessage_Project_File_Path(Path.Combine(cwd, "..", "TestProject.csproj")), _console.GetOutput()); 125: Path.GetTempPath(); 129? ["-f", Path.Join(projectPath, "app.cs")] 201Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput()); 208Assert.Contains(string.Format(CultureInfo.InvariantCulture, "Project file path {0}.", Path.Combine(projectPath, "TestProject.csproj")), _console.GetOutput()); 244Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 257Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 259var secretManager = new Program(_console, Path.GetDirectoryName(projectPath)); 273Directory.CreateDirectory(Path.GetDirectoryName(secretsFile)); 308: Path.GetTempPath(); 313? ["-f", Path.Join(projectPath, "app.cs")] 360var project = Path.Combine(projectPath, "TestProject.csproj");
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
30public string Path => System.IO.Path.Combine(_directory.Root, _filename);
src\Tools\Shared\TestHelpers\TemporaryDirectory.cs (6)
21Root = Path.Combine(ResolveLinks(Path.GetTempPath()), "dotnet-tool-tests", Guid.NewGuid().ToString("N")); 32var subdir = new TemporaryDirectory(Path.Combine(Root, name), this); 59using (var stream = File.OpenRead(Path.Combine("TestContent", $"{name}.txt"))) 98File.WriteAllText(Path.Combine(Root, filename), contents); 145return Path.Combine(segments.ToArray());
TemporaryFileProvider.cs (3)
14Root = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "tmpfiles", Guid.NewGuid().ToString())).FullName; 21File.WriteAllText(Path.Combine(Root, filename), contents, Encoding.UTF8);
UserSecretsTestFixture.cs (8)
19_disposables.Push(() => TryDelete(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(TestSecretsId)))); 63var projectPath = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "usersecretstest", Guid.NewGuid().ToString())); 69Path.Combine(projectPath.FullName, "TestProject.csproj"), 79var directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "usersecretstest", Guid.NewGuid().ToString())); 81File.WriteAllText(Path.Join(directory.FullName, "app.cs"), $""" 98var secretsDir = Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(userSecretsId));
Microsoft.Extensions.ServiceDiscovery.Dns (8)
DnsSrvServiceEndpointProviderFactory.cs (8)
17private static readonly string s_serviceAccountPath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount"); 18private static readonly string s_serviceAccountNamespacePath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount", "namespace"); 19private static readonly string s_resolveConfPath = Path.Combine($"{Path.DirectorySeparatorChar}etc", "resolv.conf"); 133var tokenPath = Path.Combine(s_serviceAccountPath, "token"); 139var certPath = Path.Combine(s_serviceAccountPath, "ca.crt");
Microsoft.Extensions.Validation.GeneratorTests (2)
ValidationsGeneratorTestBase.cs (2)
80? Path.Combine(workItemRoot, "snapshots") 122var symbolsName = Path.ChangeExtension(assemblyName, "pdb");
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)
159if (Path.IsPathRooted(compilationOutputPath)) 166? 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)
159if (Path.IsPathRooted(compilationOutputPath)) 166? 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)
159if (Path.IsPathRooted(compilationOutputPath)) 166? 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)
159if (Path.IsPathRooted(compilationOutputPath)) 166? 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)
159if (Path.IsPathRooted(compilationOutputPath)) 166? 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)
159if (Path.IsPathRooted(compilationOutputPath)) 166? 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.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)
232string ext = Path.GetExtension(imagePath);
Microsoft.ML.IntegrationTests (5)
DataIO.cs (2)
121var filePath = TestCommon.GetOutputPath(OutDir, Path.GetRandomFileName()); 130var filePath = TestCommon.GetOutputPath(OutDir, Path.GetRandomFileName());
IntegrationTestBaseClass.cs (2)
22DataDir = Path.Combine(RootDir, "test", "data"); 49OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput");
ModelFiles.cs (1)
60var versionFileName = @"TrainingInfo" + Path.DirectorySeparatorChar + "Version.txt";
Microsoft.ML.Maml (4)
MAML.cs (4)
57string currentDirectory = Path.GetDirectoryName(typeof(Maml).Module.FullyQualifiedName); 136var dumpFileDir = Path.Combine( 137Path.GetTempPath(), 139var dumpFilePath = Path.Combine(dumpFileDir,
Microsoft.ML.OneDal (1)
OneDalUtils.cs (1)
33var nativeLibs = Path.Combine(currentDir, "runtimes", "win-x64", "native");
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
103_name = Path.GetFileNameWithoutExtension(_outputModelPath);
Microsoft.ML.OnnxTransformer (4)
OnnxUtils.cs (4)
408var tempModelFile = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName()); 433var tempModelFile = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName());
Microsoft.ML.OnnxTransformerTest (21)
DnnImageFeaturizerTest.cs (2)
102var imageFolder = Path.GetDirectoryName(dataFile); 212var imageFolder = Path.GetDirectoryName(dataFile);
OnnxTransformTests.cs (19)
239var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 247var imageFolder = Path.GetDirectoryName(dataFile); 265var tempPath = Path.GetTempFileName(); 292var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 298var imageFolder = Path.GetDirectoryName(dataFile); 316var tempPath = Path.GetTempFileName(); 425var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 465var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 553var modelFile = Path.Combine(@"unknowndimensions/linear_regression.onnx"); 686var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 739var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx"); 790var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 809var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 882var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "unknowndimensions", "test_unknowndimensions_float.onnx"); 960var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 1052var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "unknowndimensions", "test_unknowndimensions_float.onnx"); 1079var tempPath = Path.GetTempFileName(); 1122var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 1127var imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.Parquet (6)
PartitionedFileLoader.cs (1)
712truncPath = String.Join(Path.DirectorySeparatorChar.ToString(), segments);
PartitionedPathUtils.cs (5)
55relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 68char[] separators = { Path.DirectorySeparatorChar }; 70var cleanPath = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
Microsoft.ML.PerformanceTests (35)
BenchmarkBase.cs (8)
19DataDir = Path.Combine(RootDir, "test", "data"); 38Path.GetFullPath(Path.Combine(DataDir, name)) : 39Path.GetFullPath(Path.Combine(DataDir, path, name)); 48Path.GetFullPath(DataDir) : 49Path.GetFullPath(Path.Combine(DataDir, path));
FeaturizeTextBench.cs (1)
29var path = Path.GetTempFileName();
Harness\ProjectGenerator.cs (2)
54<Compile Include=""{Path.GetFileName(artifactsPaths.ProgramCodePath)}"" Exclude=""bin\**;obj\**;**\*.xproj;packages\**"" /> 64=> Path.Combine(buildArtifactsDirectoryPath, "bin", configuration, TargetFrameworkMoniker, _runtimeIdentifier);
ImageClassificationBench.cs (16)
40var outputMlNetModelFilePath = Path.Combine(assetsPath, "outputs", 44string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 50string fullImagesetFolderPath = Path.Combine( 107if (Path.GetExtension(file) != ".jpg" && 108Path.GetExtension(file) != ".JPEG" && 109Path.GetExtension(file) != ".png") 112var label = Path.GetFileName(file); 145UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 147return Path.GetFileNameWithoutExtension(fileName); 154destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 156string relativeFilePath = Path.Combine(destDir, destFileName); 192var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 197if (File.Exists(Path.Combine(destFolder, flag))) return; 201File.Create(Path.Combine(destFolder, flag)); 213string fullPath = Path.Combine(assemblyFolderPath, relativePath); 232string pathname = Path.GetFullPath(filename);
Numeric\Ranking.cs (2)
88_modelPathMslr = Path.Combine(Path.GetDirectoryName(typeof(RankingTest).Assembly.Location), "FastTreeRankingModel.zip");
Text\MultiClassClassification.cs (4)
105_modelPathWiki = Path.Combine(Path.GetDirectoryName(typeof(MulticlassClassificationTest).Assembly.Location), @"WikiModel.zip"); 123string modelpath = Path.Combine(Path.GetDirectoryName(typeof(MulticlassClassificationTest).Assembly.Location), @"WikiModel.fold000.zip");
TextLoaderBench.cs (1)
32var path = Path.GetTempFileName();
TextPredictionEngineCreation.cs (1)
43_trainedModelOldFormat = _context.Model.Load(Path.Combine("TestModels", "SentimentModel.zip"), out inputSchema);
Microsoft.ML.Predictor.Tests (14)
CompareBaselines.cs (14)
58log.WriteLine("Comparison of baselines {0} to {1}", Path.GetFileName(root1), Path.GetFileName(root2)); 66string dir1 = Path.Combine(root1, rel); 67string dir2 = Path.Combine(root2, rel); 70.ToDictionary(s => Path.GetFileName(s).ToLowerInvariant(), s => false); 73string name = Path.GetFileName(path1); 74string relCur = Path.Combine(rel, name); 89log.WriteLine("*** Missing left file: '{0}'", Path.Combine(rel, kvp.Key)); 93.ToDictionary(s => Path.GetFileName(s).ToLowerInvariant(), s => false); 96string name = Path.GetFileName(path1); 97string relCur = Path.Combine(rel, name); 112log.WriteLine("*** Missing left directory: '{0}'", Path.Combine(rel, kvp.Key)); 167using (var rdr1 = OpenReader(Path.Combine(root1, rel))) 168using (var rdr2 = OpenReader(Path.Combine(root2, rel)))
Microsoft.ML.ResultProcessor (1)
ResultProcessor.cs (1)
1005string currentDirectory = Path.GetDirectoryName(typeof(ResultProcessor).Module.FullyQualifiedName);
Microsoft.ML.Samples (71)
Dynamic\DataOperations\LoadingSvmLight.cs (1)
18var fileName = Path.Combine(dataDirectoryName, $"SVM_Data.csv");
Dynamic\DataOperations\LoadingText.cs (3)
22var fileName = Path.Combine(dataDirectoryName, $"Data_{i}.csv"); 69loader.Load(Path.Combine(dataDirectoryName, "Data_*.csv")); 120var sparseDataFileName = Path.Combine(dataDirectoryName, "saved_data.tsv");
Dynamic\TensorFlow\ImageClassification.cs (1)
31Unzip(Path.Join(Directory.GetCurrentDirectory(), modelLocation),
Dynamic\TensorFlow\TextClassification.cs (1)
45var lookupMap = mlContext.Data.LoadFromTextFile(Path.Combine(
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (14)
25string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 176if (Path.GetExtension(file) != ".jpg") 179var label = Path.GetFileName(file); 212if (Path.GetExtension(file) != ".jpg") 215var label = Path.GetFileName(file); 249UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 251return Path.GetFileNameWithoutExtension(fileName); 258destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 262string relativeFilePath = Path.Combine(destDir, destFileName); 291var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 296if (File.Exists(Path.Combine(destFolder, flag))) return; 301File.Create(Path.Combine(destFolder, flag)); 314string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (19)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 34string fullImagesetFolderPathTrain = Path.Combine( 38string fullImagesetFolderPathTest = Path.Combine( 202if (Path.GetExtension(file) != ".jpg" && 203Path.GetExtension(file) != ".JPEG" && 204Path.GetExtension(file) != ".png") 207var label = Path.GetFileName(file); 240if (Path.GetExtension(file) != ".jpg" && 241Path.GetExtension(file) != ".JPEG" && 242Path.GetExtension(file) != ".png") 245var label = Path.GetFileName(file); 280UnZip(Path.Combine(imagesDownloadFolder, fileName), 283return Path.GetFileNameWithoutExtension(fileName); 290destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 294string relativeFilePath = Path.Combine(destDir, destFileName); 323var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 328if (File.Exists(Path.Combine(destFolder, flag))) return; 342File.Create(Path.Combine(destFolder, flag)); 355string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (13)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 170$"[{Path.GetFileName(imageToPredict.ImagePath)}], " + 200if (Path.GetExtension(file) != ".jpg") 203var label = Path.GetFileName(file); 237UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 239return Path.GetFileNameWithoutExtension(fileName); 246destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 250string relativeFilePath = Path.Combine(destDir, destFileName); 279var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 284if (File.Exists(Path.Combine(destFolder, flag))) return; 298File.Create(Path.Combine(destFolder, flag)); 311string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (14)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 185if (Path.GetExtension(file) != ".jpg") 188var label = Path.GetFileName(file); 221if (Path.GetExtension(file) != ".jpg") 224var label = Path.GetFileName(file); 258UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 260return Path.GetFileNameWithoutExtension(fileName); 267destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 271string relativeFilePath = Path.Combine(destDir, destFileName); 300var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 305if (File.Exists(Path.Combine(destFolder, flag))) return; 319File.Create(Path.Combine(destFolder, flag)); 332string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Dynamic\Transforms\ImageAnalytics\ConvertToGrayScale.cs (1)
43var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\DnnFeaturizeImage.cs (1)
42var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (1)
45var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\LoadImages.cs (1)
42var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Dynamic\Transforms\ImageAnalytics\ResizeImages.cs (1)
42var imagesFolder = Path.GetDirectoryName(imagesDataFile);
Microsoft.ML.Samples.GPU (62)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
31Unzip(Path.Join(Directory.GetCurrentDirectory(), modelLocation),
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
45var lookupMap = mlContext.Data.LoadFromTextFile(Path.Combine(
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (14)
25string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 176if (Path.GetExtension(file) != ".jpg") 179var label = Path.GetFileName(file); 212if (Path.GetExtension(file) != ".jpg") 215var label = Path.GetFileName(file); 249UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 251return Path.GetFileNameWithoutExtension(fileName); 258destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 262string relativeFilePath = Path.Combine(destDir, destFileName); 291var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 296if (File.Exists(Path.Combine(destFolder, flag))) return; 301File.Create(Path.Combine(destFolder, flag)); 314string fullPath = Path.Combine(assemblyFolderPath, relativePath);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (19)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 34string fullImagesetFolderPathTrain = Path.Combine( 38string fullImagesetFolderPathTest = Path.Combine( 202if (Path.GetExtension(file) != ".jpg" && 203Path.GetExtension(file) != ".JPEG" && 204Path.GetExtension(file) != ".png") 207var label = Path.GetFileName(file); 240if (Path.GetExtension(file) != ".jpg" && 241Path.GetExtension(file) != ".JPEG" && 242Path.GetExtension(file) != ".png") 245var label = Path.GetFileName(file); 280UnZip(Path.Combine(imagesDownloadFolder, fileName), 283return Path.GetFileNameWithoutExtension(fileName); 290destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 294string relativeFilePath = Path.Combine(destDir, destFileName); 323var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 328if (File.Exists(Path.Combine(destFolder, flag))) return; 342File.Create(Path.Combine(destFolder, flag)); 355string fullPath = Path.Combine(assemblyFolderPath, relativePath);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (13)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 170$"[{Path.GetFileName(imageToPredict.ImagePath)}], " + 200if (Path.GetExtension(file) != ".jpg") 203var label = Path.GetFileName(file); 237UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 239return Path.GetFileNameWithoutExtension(fileName); 246destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 250string relativeFilePath = Path.Combine(destDir, destFileName); 279var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 284if (File.Exists(Path.Combine(destFolder, flag))) return; 298File.Create(Path.Combine(destFolder, flag)); 311string fullPath = Path.Combine(assemblyFolderPath, relativePath);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (14)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 185if (Path.GetExtension(file) != ".jpg") 188var label = Path.GetFileName(file); 221if (Path.GetExtension(file) != ".jpg") 224var label = Path.GetFileName(file); 258UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 260return Path.GetFileNameWithoutExtension(fileName); 267destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 271string relativeFilePath = Path.Combine(destDir, destFileName); 300var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 305if (File.Exists(Path.Combine(destFolder, flag))) return; 319File.Create(Path.Combine(destFolder, flag)); 332string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Microsoft.ML.SamplesUtils (11)
SamplesDatasetUtils.cs (11)
27while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null) 36return Path.Combine(directory, "test", "data", fileName); 179string varPath = Path.Combine(path, "variables"); 183Download(Path.Combine(remotePath, "saved_model.pb"), Path.Combine(path, "saved_model.pb")).Wait(); 184Download(Path.Combine(remotePath, "imdb_word_index.csv"), Path.Combine(path, "imdb_word_index.csv")).Wait(); 185Download(Path.Combine(remotePath, "variables", "variables.data-00000-of-00001"), Path.Combine(varPath, "variables.data-00000-of-00001")).Wait(); 186Download(Path.Combine(remotePath, "variables", "variables.index"), Path.Combine(varPath, "variables.index")).Wait();
Microsoft.ML.SearchSpace.Tests (2)
TestBase.cs (2)
41return Path.Combine(testDataDir.FullName, fileName).Replace(cwd, "."); 53return Path.Combine(testDataDir.FullName, folderName).Replace(cwd, ".");
Microsoft.ML.Sweeper (5)
ConfigRunner.cs (4)
94return Path.Combine(SweepCommand.LocalExePath, "../Win/maml.exe"); 96return Path.Combine(SweepCommand.LocalExePath, "../Linux/maml"); 107string currentDirectory = Path.GetDirectoryName(typeof(ExeConfigRunnerBase).Module.FullyQualifiedName); 134var folderPath = Path.GetFullPath(folderName);
SweepCommand.cs (1)
49public static readonly string LocalExePath = Path.GetDirectoryName(typeof(SweepCommand).Module.FullyQualifiedName);
Microsoft.ML.TensorFlow (11)
TensorflowTransform.cs (7)
154var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(TensorFlowTransformer) + "_" + Guid.NewGuid())); 166string fullFilePath = Path.Combine(tempDirPath, relativeFile); 167string fullFileDir = Path.GetDirectoryName(fullFilePath); 472Path.Combine(_savedModelPath, DefaultModelFileNames.Graph), 473Path.Combine(_savedModelPath, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index) 475modelFilePaths.AddRange(Directory.GetFiles(Path.Combine(_savedModelPath, DefaultModelFileNames.VariablesFolder), DefaultModelFileNames.Data, SearchOption.TopDirectoryOnly));
TensorflowUtils.cs (4)
220var directory = Path.GetDirectoryName(errorResult.FileName); 221var name = Path.GetFileName(errorResult.FileName); 642string tempDirectory = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName());
Microsoft.ML.TensorFlow.Tests (53)
TensorFlowEstimatorTests.cs (3)
154var imageFolder = Path.GetDirectoryName(dataFile); 196var imageFolder = Path.GetDirectoryName(dataFile); 249var imageFolder = Path.GetDirectoryName(dataFile);
TensorflowTests.cs (50)
36tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 37assetsPath = Path.Combine(tempFolder, "assets"); 38parentWorkspacePath = Path.Combine(assetsPath, "cached"); 69string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs", 76_fullImagesetFolderPath = Path.Combine( 138var imageFolder = Path.GetDirectoryName(dataFile); 505var imageFolder = Path.GetDirectoryName(dataFile); 541var imageFolder = Path.GetDirectoryName(dataFile); 766var varDir = Path.Combine(modelLocation, "variables"); 1011var imageFolder = Path.GetDirectoryName(dataFile); 1070var imageFolder = Path.GetDirectoryName(dataFile); 1113var imageFolder = Path.GetDirectoryName(dataFile); 1148var imageFolder = Path.GetDirectoryName(dataFile); 1185var mlModelLocation = DeleteOutputPath(Path.ChangeExtension(modelLocation, ".zip")); 1225var imageFolder = Path.GetDirectoryName(dataFile); 1449if (Directory.Exists(workspacePath) && File.Exists(Path.Combine(workspacePath, trainSetBottleneckCachedValuesFileName)) 1450&& File.Exists(Path.Combine(workspacePath, validationSetBottleneckCachedValuesFileName))) 1465string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int)arch); 1565ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg") 1571ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg") 1724ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg") 1730ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg") 1750Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.TrainSetBottleneckCachedValuesFileName))); 1751Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.ValidationSetBottleneckCachedValuesFileName))); 1752Assert.True(File.Exists(Path.Combine(Path.GetTempPath(), "MLNET", ImageClassificationTrainer.ModelFileName[options.Arch]))); 1844string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs", 1850string fullImagesetFolderPath = Path.Combine( 1924if (Path.GetExtension(file) != ".jpg") 1927var label = Path.GetFileName(file); 1958UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 1960if (!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias))) 1961Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder, "FPTSUT")); 1971UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 1973return Path.GetFileNameWithoutExtension(fileName); 1979destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 1983string relativeFilePath = Path.Combine(destDir, destFileName); 1996var directory = Path.GetDirectoryName(errorResult.FileName); 1997var name = Path.GetFileName(errorResult.FileName); 2007var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 2012if (File.Exists(Path.Combine(destFolder, flag))) 2016File.Create(Path.Combine(destFolder, flag)); 2039string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 2054string imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.TestFramework (23)
BaseTestBaseline.cs (12)
37private readonly string _logRootRelPath = Path.Combine("Logs", BuildString); // Relative to OutDir. 94string baselineRootDir = Path.Combine(RootDir, TestDir, "BaselineOutput"); 97_baselineCommonDir = Path.Combine(baselineRootDir, "Common"); 100string logDir = Path.Combine(OutDir, _logRootRelPath); 103string logPath = Path.Combine(logDir, FullTestName + LogSuffix); 288baselinePath = Path.GetFullPath(Path.Combine(_baselineCommonDir, subDir, baselineConfigDir, name)); 297return Path.GetFullPath(Path.Combine(_baselineCommonDir, subDir, name)); 411Contracts.Assert(!Path.IsPathRooted(name), "file name should not be a full path"); 412Contracts.Assert(!Path.IsPathRooted(nameBase), "file nameBase should not be a full path"); 414string relPath = Path.Combine(dir, name);
BaseTestClass.cs (6)
39DataDir = Path.Combine(RootDir, "test", "data"); 57OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput"); 108return Path.GetFullPath(Path.Combine(DataDir, name)); 115return Path.GetFullPath(Path.Combine(DataDir, subDir, name));
CopyAction.cs (3)
50if (Path.PathSeparator == '/') copyfolder = "Linux"; 52var dir = new DirectoryInfo(Path.Combine(deploymentDirectory, copyfolder)); 54CopyAll(Path.Combine(deploymentDirectory, "AutoLoad"), testDirectory.FullName);
DataPipe\PartitionedFileLoaderTests.cs (2)
30string pathData = Path.Combine(basePath, "...", "*.csv"); 44string pathData = Path.Combine(basePath, "...", "*.csv");
Microsoft.ML.TestFrameworkCommon (18)
TestCommon.cs (8)
18return Path.Combine(outDir, name); 27return Path.Combine(outDir, subDir, name); // REVIEW: put the path in in braces in case the path has spaces 34return Path.GetFullPath(Path.Combine(dataDir, name)); 40return Path.GetFullPath(Path.Combine(dataDir, subDir, name)); 76while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null) 293Directory.CreateDirectory(Path.Combine(outDir, subDir));
Utility\LibraryLoader.cs (2)
91if (Path.IsPathRooted(name)) 99if (!Path.IsPathRooted(loadTarget) || File.Exists(loadTarget))
Utility\PathResolver.cs (8)
46yield return Path.Combine(AppContext.BaseDirectory, name); 95if (Path.GetFileName(nativeAsset) == name || Path.GetFileNameWithoutExtension(nativeAsset) == name) 97appLocalNativePath = Path.Combine( 100appLocalNativePath = Path.GetFullPath(appLocalNativePath); 102depsResolvedPath = Path.Combine( 107depsResolvedPath = Path.GetFullPath(depsResolvedPath); 151return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
Microsoft.ML.Tests (49)
DatabaseLoaderTests.cs (4)
295var databaseFile = Path.GetFullPath(Path.Combine("TestDatabases", $"{databaseName}.mdf")); 301var databaseFile = Path.GetFullPath(Path.Combine("TestDatabases", $"{databaseName}.sqlite"));
ImagesTests.cs (22)
33var imageFolder = Path.GetDirectoryName(dataFile); 64var imageFolder = Path.GetDirectoryName(dataFile); 82var tempPath = Path.GetTempFileName(); 108var correctImageFolder = Path.GetDirectoryName(dataFile); 140var imageFolder = Path.GetDirectoryName(dataFile); 163var fileToSave = GetOutputPath(Path.GetFileNameWithoutExtension(path.ToString()) + ".cropped.jpg"); 177var imageFolder = Path.GetDirectoryName(dataFile); 336var imageFolder = Path.GetDirectoryName(dataFile); 411var imageFolder = Path.GetDirectoryName(dataFile); 487var imageFolder = Path.GetDirectoryName(dataFile); 562var imageFolder = Path.GetDirectoryName(dataFile); 637var imageFolder = Path.GetDirectoryName(dataFile); 712var imageFolder = Path.GetDirectoryName(dataFile); 788var imageFolder = Path.GetDirectoryName(dataFile); 863var imageFolder = Path.GetDirectoryName(dataFile); 939var imageFolder = Path.GetDirectoryName(dataFile); 1011var imageFolder = Path.GetDirectoryName(dataFile); 1149var imagePath = Path.Combine(imageFolder, fileName); 1179var imageFolder = Path.GetDirectoryName(dataFile); 1281string extension = Path.GetExtension(imageName); 1282string imageTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + extension);
OnnxConversionTest.cs (14)
87var subDir = Path.Combine("Onnx", "Regression", "Adult"); 165var subDir = Path.Combine("Onnx", "Cluster", "BreastCancer"); 207var subDir = Path.Combine("Onnx", "Regression", "Adult"); 442var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer"); 584var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer"); 610var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer"); 635var subDir = Path.Combine("Onnx", "MultiClassClassification", "BreastCancer"); 647string modelPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.bin"; 648string onnxPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.onnx"; 649string onnxJsonPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.onnx.json"; 817var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer"); 856var subDir = Path.Combine("Onnx", "Transforms", "Sentiment"); 1172var subDir = Path.Combine("Onnx", "Transforms"); 1901var subDir = Path.Combine("Onnx", "Transforms");
OnnxSequenceTypeWithAttributesTest.cs (2)
59var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx"); 98var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx");
TextLoaderTests.cs (1)
595var combinedPath = Path.Combine(directoryName, "*");
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (2)
618var tempPath = Path.GetTempFileName(); 675var tempPath = Path.GetTempFileName();
Transformers\ConcatTests.cs (2)
85var subdir = Path.Combine("Transform", "Concat"); 149var subdir = Path.Combine("Transform", "Concat");
Transformers\NormalizerTests.cs (1)
1005var modelPath = Path.Combine("TestModels", "normalizer_verwrit-00010001.zip");
Transformers\TextFeaturizerTests.cs (1)
750var modelPath = Path.Combine("TestModels", "SentimentModel.zip");
Microsoft.ML.TimeSeries.Tests (4)
TimeSeries.cs (3)
31TestCore(GetDataPath(Path.Combine("Timeseries", "real_1.csv")), 47TestCore(GetDataPath(Path.Combine("Timeseries", "real_11.csv")), 63TestCore(GetDataPath(Path.Combine("Timeseries", "A4Benchmark-TS2.csv")),
TimeSeriesDirectApi.cs (1)
536var dataPath = GetDataPath(Path.Combine("Timeseries", "anomaly_detection.csv"));
Microsoft.ML.Tokenizers.Data.Tests (3)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (3)
53Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Guid.NewGuid().ToString(), extension));
Microsoft.ML.Tokenizers.Tests (28)
BpeTests.cs (9)
366using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json")); 367using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt")); 380string vocabFile = Path.Combine(@"Gpt-2", "vocab.json"); 381string mergesFile = Path.Combine(@"Gpt-2", "merges.txt"); 546using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json")); 547using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt")); 894BpeOptions options = new BpeOptions(Path.Combine(@"Gpt-2", "vocab.json"), Path.Combine(@"Gpt-2", "merges.txt")) 951using Stream jsonModelStream = File.OpenRead(Path.Combine(@"DeepSeek", "tokenizer-DeepSeek-R1.json"));
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"));
UnigramTests.cs (2)
26using Stream remoteStream = File.OpenRead(Path.Combine(@"Paraphrase-multilingual-MiniLM-L12-v2", "sentencepiece.bpe.model")); 58using Stream remoteStream = File.OpenRead(Path.Combine(@"Paraphrase-multilingual-MiniLM-L12-v2", "sentencepiece.bpe.model"));
Utils.cs (3)
53Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Guid.NewGuid().ToString(), extension));
WordPieceTests.cs (1)
20string vocabFile = Path.GetTempFileName();
Microsoft.ML.TorchSharp (12)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
261var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 266string relativeFilePath = Path.Combine(destDir, destFileName); 276var directory = Path.GetDirectoryName(errorResult.FileName); 277var name = Path.GetFileName(errorResult.FileName);
Roberta\QATrainer.cs (4)
245var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 250string relativeFilePath = Path.Combine(destDir, destFileName); 260var directory = Path.GetDirectoryName(errorResult.FileName); 261var name = Path.GetFileName(errorResult.FileName);
TorchSharpBaseTrainer.cs (4)
171var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 176string relativeFilePath = Path.Combine(destDir, destFileName); 186var directory = Path.GetDirectoryName(errorResult.FileName); 187var name = Path.GetFileName(errorResult.FileName);
Microsoft.ML.TorchSharp.Tests (1)
ObjectDetectionTests.cs (1)
31var imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.Transforms (5)
Text\StopWordsRemovingTransformer.cs (1)
790var ext = Path.GetExtension(dataFile);
Text\TextFeaturizingEstimator.cs (1)
754var mapperDirName = Path.Combine(dirName, "Mapper");
Text\WordEmbeddingsExtractor.cs (3)
632string dir = kind == WordEmbeddingEstimator.PretrainedModelKind.SentimentSpecificWordEmbedding ? Path.Combine("Text", "Sswe") : "WordVectors"; 639var directory = Path.GetDirectoryName(errorResult.FileName); 640var name = Path.GetFileName(errorResult.FileName);
Microsoft.ML.Vision (25)
DnnRetrainTransform.cs (16)
118var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(DnnRetrainTransformer) + "_" + Guid.NewGuid())); 130string fullFilePath = Path.Combine(tempDirPath, relativeFile); 131string fullFileDir = Path.GetDirectoryName(fullFilePath); 409var path = Path.Combine(modelDir, DefaultModelFileNames.TmpMlnetModel); 416var variablesPath = Path.Combine(modelDir, DefaultModelFileNames.VariablesFolder); 417var archivePath = Path.Combine(variablesPath + "-" + Guid.NewGuid().ToString()); 420File.Copy(f, Path.Combine(archivePath, Path.GetFileName(f))); 439var destination = Path.Combine(variablesPath, DefaultModelFileNames.Data); 446var destination = Path.Combine(variablesPath, DefaultModelFileNames.Index); 533_modelLocation = Path.IsPathRooted(modelLocation) ? modelLocation : Path.Combine(Directory.GetCurrentDirectory(), modelLocation); 705Path.Combine(_modelLocation, DefaultModelFileNames.Graph), 706Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Data), 707Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index),
ImageClassificationTrainer.cs (9)
537_resourcePath = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, "MLNET"); 570_checkpointPath = Path.Combine(_options.WorkspacePath, _options.FinalModelPrefix + 572_sizeFile = Path.Combine(_options.WorkspacePath, "TrainingSetSize.txt"); 668string trainSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath, 671string validationSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath, 856Path.Combine(_options.WorkspacePath, _options.ValidationSetBottleneckCachedValuesFileName), 954trainWriter = tf.summary.FileWriter(Path.Combine(_options.WorkspacePath, "train"), 1149var evalGraph = LoadMetaGraph(Path.Combine(_resourcePath, ModelFileName[_options.Arch])); 1313var modelFilePath = Path.Combine(_resourcePath, modelFileName);
Microsoft.NET.Build.Containers (7)
Tasks\CreateNewImageToolTask.cs (7)
30if (Path.IsPathRooted(path) && File.Exists(path)) 35if (Path.IsPathRooted(path) && Directory.Exists(path)) 37path = Path.Combine(path, ToolExe); 48path = Path.Combine(path, ToolExe); 118builder.AppendFileNameIfNotNull(Path.Combine(ContainerizeDirectory, "containerize.dll")); 119builder.AppendFileNameIfNotNull(PublishDirectory.TrimEnd(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }));
Microsoft.NET.Build.Containers.IntegrationTests (31)
FullFramework\CreateNewImageToolTaskTests.cs (31)
28DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 71DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 105DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 138DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 170DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 206DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 252DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 303DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 393DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 412DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 447DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 484DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 522DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 548DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 579DirectoryInfo publishDir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), DateTime.Now.ToString("yyyyMMddHHmmssfff"))); 599return Path.Combine(TestContext.Current.TestExecutionDirectory, "Container", "containerize");
Microsoft.NET.Build.Containers.UnitTests (2)
AuthHandshakeMessageHandlerTests.cs (1)
52string authFile = Path.GetTempFileName();
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.NET.Build.Extensions.Tasks (9)
ConflictItem.cs (1)
114_fileName = OriginalItem == null ? string.Empty : Path.GetFileName(OriginalItem.ItemSpec);
FileUtilities.cs (1)
28var extension = Path.GetExtension(sourcePath);
FrameworkListReader.cs (1)
26if (!Path.IsPathRooted(frameworkListPath))
ItemUtilities.cs (4)
74return Path.GetFileName(sourcePath); 104return targetPath != null ? Path.GetFileName(targetPath) : null; 141var fileName = Path.GetFileName(sourcePath); 148return Path.Combine(destinationSubDirectory, fileName);
ResolvePackageFileConflicts.cs (2)
72return frameworkListReader.GetConflictItems(Path.Combine(tfd.ItemSpec, "RedistList", "FrameworkList.xml"), log); 178compilePlatformWinners.Select(c => Path.GetFileNameWithoutExtension(c.FileName) ?? string.Empty)
Microsoft.NET.Build.Extensions.Tasks.UnitTests (3)
GivenAGetDependsOnNETStandardTask.cs (2)
39Path.GetFileNameWithoutExtension(thisAssemblyPath), 81var corelibFolder = Path.GetDirectoryName(corelibLocation);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.NET.Build.Tasks (210)
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)
26if (Path.GetExtension(referencePath.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 51if (!Path.GetExtension(referencePath.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase) && 56if (Path.GetFileName(referencePath.ItemSpec).Equals("System.Runtime.WindowsRuntime.dll", StringComparison.OrdinalIgnoreCase)) 63Log.LogError(Strings.WinMDTransitiveReferenceNotSupported, Path.GetFileName(referencePath.ItemSpec)); 73Log.LogError(Strings.WinMDReferenceNotSupportedOnTargetFramework, TargetFrameworkMoniker, Path.GetFileName(winMDReference.ItemSpec));
CliFolderPathCalculatorCore.cs (1)
19return Path.Combine(homePath, DotnetProfileDirectoryName);
ConflictItem.cs (1)
114_fileName = OriginalItem == null ? string.Empty : Path.GetFileName(OriginalItem.ItemSpec);
DependencyContextBuilder.cs (8)
248referenceAssembliesPath[referenceAssembliesPath.Length - 1] == Path.DirectorySeparatorChar) 254_referenceAssembliesPath = referenceAssembliesPath + Path.DirectorySeparatorChar; 440resolvedPath = Path.GetFileName(referenceAssembly.FullPath); 648var fileName = Path.GetFileNameWithoutExtension(library.Path); 649var assemblyPath = userRuntimeAssemblies?.FirstOrDefault(p => Path.GetFileNameWithoutExtension(p).Equals(fileName)); 852string mainProjectDirectory = Path.GetDirectoryName(_mainProjectInfo.ProjectPath); 853string fullProjectPath = Path.GetFullPath(Path.Combine(mainProjectDirectory, projectPath));
FileUtilities.cs (1)
28var extension = Path.GetExtension(sourcePath);
FrameworkListReader.cs (1)
26if (!Path.IsPathRooted(frameworkListPath))
FrameworkPackages\FrameworkPackages.cs (3)
124var packsFolder = Path.Combine(targetingPackRoot, frameworkName + ".Ref"); 132.Select(d => (Overrides: Path.Combine(d, "data", "PackageOverrides.txt"), Version: ParseVersion(Path.GetFileName(d))))
FrameworkReferenceResolver.cs (1)
45return Path.Combine(
GenerateRegFreeComManifest.cs (1)
44Path.GetFileNameWithoutExtension(IntermediateAssembly),
GenerateRuntimeConfigurationFiles.cs (1)
375if (lastChar == Path.DirectorySeparatorChar)
GenerateShims.cs (2)
83var packagedShimOutputDirectoryAndRid = Path.Combine( 87var appHostDestinationFilePath = Path.Combine(
GetAssemblyAttributes.cs (2)
22var fileVersionInfo = FileVersionInfo.GetVersionInfo(Path.GetFullPath(PathToTemplateFile)); 23Version assemblyVersion = FileUtilities.TryGetAssemblyVersion(Path.GetFullPath(PathToTemplateFile));
GetEmbeddedApphostPaths.cs (2)
39var packagedShimOutputDirectoryAndRid = Path.Combine( 43var appHostDestinationFilePath = Path.Combine(
GetPackagesToPrune.cs (1)
255string packageOverridesPath = Path.Combine(prunePackageDataRoot, targetFrameworkVersion, frameworkReference, "PackageOverrides.txt");
ItemUtilities.cs (4)
74return Path.GetFileName(sourcePath); 104return targetPath != null ? Path.GetFileName(targetPath) : null; 141var fileName = Path.GetFileName(sourcePath); 148return Path.Combine(destinationSubDirectory, fileName);
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 (18)
166var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath); 178outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb"); 179outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb"); 180crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\""; 201outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension); 202outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension); 203crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\""; 277MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec)); 280compositeR2RImageRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, "r2r" + Path.GetExtension(compositeR2RImageRelativePath)); 281var compositeR2RImage = Path.Combine(OutputPath, compositeR2RImageRelativePath); 299compositePDBImage = Path.ChangeExtension(compositeR2RImage, ".ni.pdb"); 300compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb"); 306compositePDBImage = Path.ChangeExtension(compositeR2RImage, perfmapExtension); 307compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension); 444bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec))); 445bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R; 449bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ProcessFrameworkReferences.cs (4)
1044foreach (var packRoot in packRootEnvironmentVariable.Split(Path.PathSeparator)) 1046yield return Path.Combine(packRoot, "packs"); 1055yield return Path.Combine(userProfileDir, "packs"); 1067string 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 (4)
16public string FileName => Path.GetFileName(FullPath); 80projectName = Path.GetFileNameWithoutExtension(projectFilePath); 85projectName = Path.GetFileNameWithoutExtension(referencePath.ItemSpec); 157string name = Path.GetFileNameWithoutExtension(fullPath);
ResolveAppHosts.cs (3)
286string hostRelativePathInPackage = Path.Combine("runtimes", bestAppHostRuntimeIdentifier, "native", 293appHostPackPath = Path.Combine(TargetingPackRoot, hostPackName, appHostPackVersion); 299appHostItem.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)
774Directory.CreateDirectory(Path.GetDirectoryName(_task.ProjectAssetsCacheFile)); 1204string xmlFilePath = Path.ChangeExtension(itemSpec, fileExtension); 1362WriteCopyLocalMetadataIfNeeded(package, Path.GetFileName(asset.Path)); 1685Path.GetFileName(asset.Path), 1686destinationSubDirectory: locale + Path.DirectorySeparatorChar); 1689WriteMetadata(MetadataKeys.DestinationSubDirectory, locale + Path.DirectorySeparatorChar); 1703WriteCopyLocalMetadataIfNeeded(package, Path.GetFileName(asset.Path)); 1720Path.GetFileName(asset.Path), 1721destinationSubDirectory: Path.GetDirectoryName(asset.Path) + Path.DirectorySeparatorChar); 1725WriteMetadata(MetadataKeys.DestinationSubDirectory, Path.GetDirectoryName(asset.Path) + Path.DirectorySeparatorChar); 1869Path.Combine(destinationSubDirectory, assetsFileName)); 2025if (Path.GetFileName(resolvedPackageAssetPath) == apphostName)
ResolvePackageDependencies.cs (8)
452if (Path.DirectorySeparatorChar != '/') 454relativePath = relativePath.Replace('/', Path.DirectorySeparatorChar); 457if (Path.DirectorySeparatorChar != '\\') 459relativePath = relativePath.Replace('\\', Path.DirectorySeparatorChar); 462return Path.Combine(resolvedPackagePath, relativePath); 467return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(ProjectPath), path));
ResolvePackageFileConflicts.cs (2)
72return frameworkListReader.GetConflictItems(Path.Combine(tfd.ItemSpec, "RedistList", "FrameworkList.xml"), log); 178compilePlatformWinners.Select(c => Path.GetFileNameWithoutExtension(c.FileName) ?? string.Empty)
ResolveReadyToRunCompilers.cs (26)
299_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 300_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 301_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 306_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 307_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 308_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 315_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 316_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 317_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 327_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 328_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 329_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 334_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 335_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 338_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 342_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 352_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 353_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 358_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 359_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 368_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 369_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 380_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 381_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 416_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 423_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
ResolveRuntimePackAssets.cs (7)
144var runtimeListPath = Path.Combine(runtimePackRoot, "data", "RuntimeList.xml"); 199string assetPath = Path.GetFullPath(Path.Combine(runtimePackRoot, fileElement.Attribute("Path").Value)); 269assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.GetFileName(assetPath)); 273assetItem.SetMetadata(MetadataKeys.DestinationSubDirectory, culture + Path.DirectorySeparatorChar); 274assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.Combine(culture, Path.GetFileName(assetPath)));
ResolveTargetingPackAssets.cs (10)
187string targetingPackDataPath = Path.Combine(targetingPackRoot, "data"); 189string targetingPackDllFolder = Path.Combine(targetingPackRoot, "ref", targetingPackTargetFramework); 196targetingPackDllFolder = Path.Combine(targetingPackRoot, "ref", targetingPackTargetFramework); 199string platformManifestPath = Path.Combine(targetingPackDataPath, "PlatformManifest.txt"); 201string packageOverridesPath = Path.Combine(targetingPackDataPath, "PackageOverrides.txt"); 203string frameworkListPath = Path.Combine(targetingPackDataPath, "FrameworkList.xml"); 279string targetingPackAssetPath = Path.Combine(targetingPackRoot, "build", targetingPackTargetFramework, "ref"); 289if (!Path.GetFileName(dll).Equals("netstandard.dll", StringComparison.OrdinalIgnoreCase)) 360Path.Combine(definition.TargetingPackRoot, fileElement.Attribute("Path").Value) : 440var 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)
230if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 322result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 327result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 397Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
RuntimeGraphCache.cs (1)
28if (!Path.IsPathRooted(runtimeJsonPath))
SdkDirectoryWorkloadManifestProvider.cs (28)
73string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 74string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 90var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 93knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 111_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 186_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 270var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 300var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 319AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 326var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], _sdkVersionBand.ToString()); 341var manifestVersionBandDirectory = Path.Combine(manifestRoot, _sdkVersionBand.ToString()); 346directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 398AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 426string manifestId = Path.GetFileName(manifestDirectory); 434.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 437return (directory: dir, version: Path.GetFileName(dir)); 446else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 448var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 472.Select(dir => Path.GetFileName(dir)) 478.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 503var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 505if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 536var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 553var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 563var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 568var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 597string globalJsonPath = Path.Combine(directory, "global.json"); 602directory = Path.GetDirectoryName(directory);
SingleProjectInfo.cs (2)
90string outputName = Path.GetFileName(projectReferencePath.ItemSpec); 91string name = Path.GetFileNameWithoutExtension(outputName);
TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
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)
105if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
Microsoft.NET.Build.Tasks.UnitTests (98)
GivenADependencyContextBuilder.cs (3)
230string mainProjectDirectory = Path.GetDirectoryName(mainProject.ProjectPath); 267var fullPath = Path.GetFullPath(Path.Combine(mainProjectDirectory, kvp.Key));
GivenAGenerateRuntimeConfigurationFiles.cs (4)
17string testTempDir = Path.Combine(Path.GetTempPath(), "dotnetSdkTests"); 20Path.Combine(testTempDir, nameof(ItCanGenerateWithoutAssetFile) + "runtimeconfig.json"); 22Path.Combine(testTempDir, nameof(ItCanGenerateWithoutAssetFile) + "runtimeconfig.dev.json");
GivenAnAssetsFileResolver.cs (5)
163return CreateNativeResolvedFile(packageId, version, filePath, Path.GetDirectoryName(filePath), preserveStoreLayout); 190string sourcepath = Path.Combine(packageDirectory, filePath); 191string sourcedir = Path.GetDirectoryName(sourcepath); 194if (!string.IsNullOrEmpty(destinationSubDirPath) && !destinationSubDirPath.EndsWith(Path.DirectorySeparatorChar)) 196destinationSubDirPath += Path.DirectorySeparatorChar;
GivenAPickBestRid.cs (5)
46var runtimeGraphPath = Path.GetTempFileName(); 71var runtimeGraphPath = Path.GetTempFileName(); 96var runtimeGraphPath = Path.GetTempFileName(); 141var runtimeGraphPath = Path.GetTempFileName(); 171var runtimeGraphPath = Path.GetTempFileName();
GivenAProduceContentsAssetsTask.cs (41)
18string sampleppTxt = Path.Combine("contentFiles", "any", "samplepp.txt"); 55.Should().Contain(Path.Combine(ContentOutputDirectory, "test", "LibA", "1.2.3", "samplepp.output.txt")); 66Path.Combine("contentFiles", "any", "samplepp.txt"), 67Path.Combine("contentFiles", "any", "image.png"), 68Path.Combine("contentFiles", "any", "plain.txt"), 108.Should().Contain(Path.Combine(ContentOutputDirectory, "test", "LibA", "1.2.3", "samplepp.output.txt")); 121Path.Combine("contentFiles", "any", "samplepp.txt"), 122Path.Combine("contentFiles", "any", "image.png"), 123Path.Combine("contentFiles", "any", "plain.txt"), 124Path.Combine("donotcopy", "README.md"), 148outputPath: Path.Combine("output", contentFiles[1])), 150outputPath: Path.Combine("output", contentFiles[2])), 166string assetWritePath = Path.Combine(ContentOutputDirectory, "test", "LibA", "1.2.3", "samplepp.output.txt"); 183item.GetMetadata("TargetPath").Should().Be(Path.Combine("output", contentFiles[i])); 200Path.Combine("contentFiles", "any", "samplepp.txt"), 201Path.Combine("contentFiles", "any", "image.png"), 202Path.Combine("contentFiles", "any", "plain.txt"), 203Path.Combine("donotcopy", "README.md"), 242string assetWritePath = Path.Combine(ContentOutputDirectory, "test", "LibA", "1.2.3", "samplepp.output.txt"); 278Path.Combine("contentFiles", "any", "samplepp1.txt"), 279Path.Combine("contentFiles", "any", "samplepp2.pp"), 280Path.Combine("contentFiles", "any", "image.png"), 281Path.Combine("contentFiles", "any", "plain.txt"), 307outputPath: Path.Combine("output", contentFiles[2])), 309outputPath: Path.Combine("output", contentFiles[3])), 326Path.Combine(ContentOutputDirectory, "test", "LibA", "1.2.3", "samplepp1.output.txt"), 327Path.Combine(ContentOutputDirectory, "test", "LibA", "1.2.3", "samplepp2.output.txt") 358Path.Combine("contentFiles", "any", "file1.md"), 359Path.Combine("contentFiles", "any", "file2.md"), 360Path.Combine("contentFiles", "any", "file3.md"), 397Path.Combine("contentFiles", "cs", "file1.md"), 398Path.Combine("contentFiles", "any", "file2.md"), 399Path.Combine("contentFiles", "any", "file3.md"), 427.Should().Be(Path.Combine(PackageRootDirectory, "LibA", "1.2.3", contentFiles[0])); 441Path.Combine("contentFiles", "vb", "file1.md"), 442Path.Combine("contentFiles", "any", "file2.md"), 443Path.Combine("contentFiles", "any", "file3.md"), 476Path.Combine(PackageRootDirectory, "LibA", "1.2.3", contentFiles[i + 1])); 485private static readonly string ContentOutputDirectory = Path.Combine("bin", "obj"); 486private static readonly string PackageRootDirectory = Path.Combine("root", "packages"); 497itemSpec: Path.Combine(PackageRootDirectory, packageId, packageVersion, path),
GivenAResolvePackageAssetsTask.cs (3)
85string projectAssetsJsonPath = Path.GetTempFileName(); 151string projectAssetsJsonPath = Path.GetTempFileName(); 174string projectAssetsJsonPath = Path.GetTempFileName();
GivenAResolvePackageDependenciesTask.cs (9)
17private static readonly string _packageRoot = "\\root\\packages".Replace('\\', Path.DirectorySeparatorChar); 18private static readonly string _projectPath = "\\root\\anypath\\solutiondirectory\\myprojectdir\\myproject.csproj".Replace('\\', Path.DirectorySeparatorChar); 301var projectDirectoryPath = Path.GetDirectoryName(Path.GetFullPath(_projectPath)); 302var resolvedPath = Path.GetFullPath(Path.Combine(projectDirectoryPath, "../ClassLibP/ClassLibP.csproj")); 309package.GetMetadata(MetadataKeys.ResolvedPath).Should().Be(Path.Combine(_packageRoot, name, "1.2.3", "path")); 398.Should().Be(Path.Combine(_packageRoot, "LibB", "1.2.3", "path", 399pair.Key.Replace('/', Path.DirectorySeparatorChar)));
GivenAResolveRuntimePackAssetsTask.cs (3)
43Directory.CreateDirectory(Path.Combine(testDirectory, "data")); 46Path.Combine(testDirectory, "data", "RuntimeList.xml"), 54string expectedResource = Path.Combine("runtimes", "de", "a.resources.dll");
GivenAResolveTargetingPackAssetsTask.cs (9)
32reference.ItemSpec.Should().Be(Path.Combine(mockPackageDirectory, "lib/Microsoft.Windows.SDK.NET.dll")); 40task.PlatformManifests[0].ItemSpec.Should().Be(Path.Combine(mockPackageDirectory, $"data{Path.DirectorySeparatorChar}PlatformManifest.txt")); 42task.AnalyzersToAdd[0].ItemSpec.Should().Be(Path.Combine(mockPackageDirectory, "analyzers/dotnet/anyAnalyzer.dll")); 43task.AnalyzersToAdd[1].ItemSpec.Should().Be(Path.Combine(mockPackageDirectory, "analyzers/dotnet/cs/csAnalyzer.dll")); 134string dataDir = Path.Combine(mockPackageDirectory, "data"); 137File.WriteAllText(Path.Combine(dataDir, "FrameworkList.xml"), _frameworkList); 138File.WriteAllText(Path.Combine(dataDir, "PlatformManifest.txt"), ""); 306resolvedTargetingPacks: DefaultTargetingPacks(Path.GetTempPath()),
GivenASelectRuntimeIdentifierSpecificItems.cs (1)
186var tempFile = Path.GetTempFileName();
GivenThatWeWantToGetDependenciesViaDesignTimeBuild.cs (8)
25string projectAssetsJsonPath = Path.Combine(testRoot, "project.assets.json"); 26string projectCacheAssetsJsonPath = Path.Combine(testRoot, "projectassets.cache"); 58string projectAssetsJsonPath = Path.Combine(testRoot, "project.assets.json"); 59string projectCacheAssetsJsonPath = Path.Combine(testRoot, "projectassets.cache"); 93string projectAssetsJsonPath = Path.Combine(testRoot, "project.assets.json"); 94string projectCacheAssetsJsonPath = Path.Combine(testRoot, "projectassets.cache"); 362string projectAssetsJsonPath = Path.Combine(testRoot, "project.assets.json"); 363string projectCacheAssetsJsonPath = Path.Combine(testRoot, "projectassets.cache");
Mocks\MockContentAssetPreprocessor.cs (2)
28_preprocessedOutputDirectory = Path.Combine(outputDirectoryBase, "test"); 35pathToFinalAsset = Path.Combine(_preprocessedOutputDirectory, relativeOutputPath);
Mocks\MockPackageResolver.cs (2)
27return Path.Combine(_root, packageId, version.ToNormalizedString().ToLowerInvariant(), "path"); 30public string ResolvePackageAssetPath(LockFileTargetLibrary package, string relativePath) => Path.Combine(GetPackageDirectory(package.Name, package.Version), relativePath);
ProcessFrameworkReferencesTests.cs (1)
132var path = Path.GetTempFileName();
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
TestLockFiles.cs (1)
13string filePath = Path.Combine("LockFiles", $"{lockFilePrefix}.project.lock.json");
Microsoft.NET.Build.Tests (567)
AppHostTests.cs (11)
71new RunExeCommand(Log, Path.Combine(outputDirectory.FullName, hostExecutable)) 74Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath)) 106var appHostFullPath = Path.Combine(outputDirectory.FullName, hostExecutable); 117var buildProjDir = Path.Combine(outputDirectory.FullName, "../.."); 157var appHostFullPath = Path.Combine(outputDirectory.FullName, testAssetName); 220var apphostPath = Path.Combine(buildCommand.GetOutputDirectory().FullName, "HelloWorld.exe"); 261string apphostPath = Path.Combine(outputDirectory.FullName, $"{testProject.Name}.exe"); 302ReadOnlySpan<byte> appBytes = File.ReadAllBytes(Path.Combine(outputDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}")); 343string apphostPath = Path.Combine(outputDirectory.FullName, testProject.Name + ".exe"); 428Path.Combine( 433var intermediateAppHost = Path.Combine(intermediateDirectory, "apphost" + Constants.ExeSuffix);
ArtifactsOutputPathTests.cs (52)
52File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), 64File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), 92OutputPathCalculator outputPathCalculator = OutputPathCalculator.FromProject(Path.Combine(testAsset.Path, testProject.Name), testProject); 93new FileInfo(Path.Combine(outputPathCalculator.GetOutputDirectory(), testProject.Name + ".dll")) 114OutputPathCalculator outputPathCalculator = OutputPathCalculator.FromProject(Path.Combine(testAsset.Path, testProject.Name), testProject); 115new FileInfo(Path.Combine(outputPathCalculator.GetOutputDirectory(configuration: "release"), testProject.Name + ".dll")) 118new FileInfo(Path.Combine(outputPathCalculator.GetPublishDirectory(configuration: "release"), testProject.Name + ".dll")) 139OutputPathCalculator outputPathCalculator = OutputPathCalculator.FromProject(Path.Combine(testAsset.Path, testProject.Name), testProject); 140new FileInfo(Path.Combine(outputPathCalculator.GetOutputDirectory(configuration: "release"), testProject.Name + ".dll")) 143new FileInfo(Path.Combine(outputPathCalculator.GetPackageDirectory(configuration: "release"), testProject.Name + ".1.0.0.nupkg")) 153new DirectoryInfo(Path.Combine(testAsset.TestRoot, testProject.Name)) 157new DirectoryInfo(Path.Combine(testAsset.TestRoot, "artifacts", "obj", testProject.Name, configuration)) 178outputPathCalculator.ArtifactsPath = Path.Combine(testAsset.Path, testProject.Name, "artifacts"); 184new FileInfo(Path.Combine(outputPathCalculator.GetOutputDirectory(), testProject.Name + ".dll")) 211File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), """ 229File.Delete(Path.Combine(testAsset.Path, "Directory.Build.props")); 248File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), """ 257File.WriteAllText(Path.Combine(testAsset.Path, "Directory.AfterTargetFrameworkInference.targets"), """ 271new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "NET8_Debug")).Should().Exist(); 272new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "NET7_Debug")).Should().Exist(); 273new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "debug_netstandard2.0")).Should().Exist(); 275new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "debug_net8.0")).Should().NotExist(); 276new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "bin", testProject.Name, "debug_net7.0")).Should().NotExist(); 278new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "NET8_Debug")).Should().Exist(); 279new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "NET7_Debug")).Should().Exist(); 280new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "debug_netstandard2.0")).Should().Exist(); 282new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "debug_net8.0")).Should().NotExist(); 283new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "obj", testProject.Name, "debug_net7.0")).Should().NotExist(); 288.WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name)) 295new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "publish", testProject.Name, "NET8_Release")).Should().Exist(); 296new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "publish", testProject.Name, "NET7_Debug")).Should().Exist(); 297new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "publish", testProject.Name, "debug_netstandard2.0")).Should().Exist(); 300.WithWorkingDirectory(Path.Combine(testAsset.Path, testProject.Name)) 305new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "package", "release")).Should().Exist(); 306new FileInfo(Path.Combine(testAsset.Path, "artifacts", "package", "release", testProject.Name + ".1.0.0.nupkg")).Should().Exist(); 319File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), 346new FileInfo(Path.Combine(artifactsFolder, "bin", "App", "debug", "App.dll")) 361new FileInfo(Path.Combine(testAsset.Path, "artifacts", "binaries", "App", "debug", "App.dll")) 377new FileInfo(Path.Combine(testAsset.Path, "artifacts", "published_app", "App", "release", "App.dll")) 393new FileInfo(Path.Combine(testAsset.Path, "artifacts", "package_output", "release", "App.1.0.0.nupkg")) 409new FileInfo(Path.Combine(testAsset.Path, "artifacts", "bin", "Apps", "MyApp", "debug", "App.dll")) 428File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), 438.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name)) 459new DirectoryInfo(Path.Combine(testAsset.TestRoot, "artifacts")) 479new DirectoryInfo(Path.Combine(testAsset.TestRoot, testProject.Name, "artifacts")) 511new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "MSBuildSdk", ToolsetInfo.CurrentTargetFramework)) 518new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "PackageReference", ToolsetInfo.CurrentTargetFramework)) 524new DirectoryInfo(Path.Combine(testAsset.Path, "artifacts", "PackageReference", ToolsetInfo.CurrentTargetFramework)) 530new FileInfo(Path.Combine(testAsset.Path, "MSBuildSdk", "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "MSBuildSdk.dll")).Should().Exist(); 531new FileInfo(Path.Combine(testAsset.Path, "MSBuildSdk", "obj", "Debug", ToolsetInfo.CurrentTargetFramework, "MSBuildSdk.dll")).Should().Exist(); 552File.WriteAllText(Path.Combine(testAsset.Path, "Directory.Build.props"), """ 560var projectDir = Path.Combine(testAsset.Path, testAsset.TestProject.Name);
AspNetCoreOnFullFramework.cs (1)
84string exePath = Path.Combine(outputPath, testProject.Name + ".exe");
DepsFileSkipTests.cs (3)
136string depsJsonPath = Path.Combine(outputFolder, $"{testProject.Name}.deps.json"); 176string depsJsonPath = Path.Combine(outputFolder, $"{testProject.Name}.deps.json"); 215string filenameToSkipWithCorrectSlash = filenameToSkip.Replace('/', Path.DirectorySeparatorChar);
DesignTimeBuildTests.cs (6)
44var projectDirectory = Path.Combine(testAsset.TestRoot, relativeProjectPath); 219string projectFolder = Path.Combine(testAsset.TestRoot, testProject.Name); 231string projectFilePath = Path.Combine(projectFolder, testProject.Name + ".csproj"); 270string csharpDesignTimeTargets = Path.Combine(vsInstallDir, @"MSBuild\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets"); 285"/p:NetCoreTargetingPackRoot=" + Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())
EvaluatorFastPathTests.cs (2)
28var logPath = Path.Combine(testAsset.Path, "PropertyFunctionsRequiringReflection"); 53var logPath = Path.Combine(testDir, "PropertyFunctionsRequiringReflection");
GenerateResourceTests.cs (1)
64var runCommand = new RunExeCommand(Log, Path.Combine(outputDirectory.FullName, "HelloWorld.exe"));
GivenFrameworkReferences.cs (16)
58string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 113string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 149string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 179string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 316testProject.AdditionalProperties["NetCoreTargetingPackRoot"] = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 324string nugetPackagesFolder = Path.Combine(testAsset.TestRoot, "packages"); 372string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 719string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 760string nugetPackagesFolder = Path.Combine(testAsset.TestRoot, "packages"); 772string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 842var projectFolder = Path.Combine(testAsset.TestRoot, testProject.Name); 999string projectFolder = Path.Combine(testAsset.TestRoot, testProject.Name); 1013var referenceNames = references.Select(Path.GetFileNameWithoutExtension); 1136var resolvedVersions = ResolvedVersionInfo.ParseFrom(Path.Combine(outputDirectory.FullName, "resolvedversions.txt")); 1160var command = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProject.Name), targetFramework,
GivenThatAProjectHasntBeenRestored.cs (2)
26var projectDirectory = Path.Combine(testAsset.TestRoot, relativeProjectPath); 35var assetsFile = Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "project.assets.json");
GivenThatWeHaveAPackageReferenceWithAliases.cs (4)
43var packagesPaths = packageReferences.Select(e => Path.GetDirectoryName(e.NupkgPath)); 90List<string> sources = new() { Path.GetDirectoryName(packageReferenceA.NupkgPath), Path.GetDirectoryName(packageReferenceB.NupkgPath) }; 127List<string> sources = new() { Path.GetDirectoryName(packageReferenceA.NupkgPath) };
GivenThatWeManifestSupportedFrameworks.cs (2)
26string testDirectory = Path.Combine(asset.TestRoot, project.Name); 68string testDirectory = Path.Combine(asset.TestRoot, project.Name);
GivenThatWeWantACustomTFM.cs (2)
27File.WriteAllText(Path.Combine(testAsset.TestRoot, testProject.Name, "CustomTargetFramework.targets"), $@" 46var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name),
GivenThatWeWantAllResourcesInSatellite.cs (2)
78command = new RunExeCommand(log, Path.Combine(outputDirectory.FullName, "AllResourcesInSatellite.exe")); 86command = new DotnetCommand(log, Path.Combine(outputDirectory.FullName, "AllResourcesInSatellite.dll"));
GivenThatWeWantBuildsToBeIncremental.cs (3)
24var runtimeConfigDevJsonPath = Path.Combine(outputDirectory, "HelloWorld.runtimeconfig.dev.json"); 50var assetsJsonPath = Path.Combine(baseIntermediateOutputDirectory, "project.assets.json"); 51var assetsCachePath = Path.Combine(intermediateDirectory, "HelloWorld.assets.cache");
GivenThatWeWantDiagnosticsWhenAssetsFileCannotBeRead.cs (3)
19var assetsFile = Path.Combine(build.GetBaseIntermediateDirectory().FullName, "project.assets.json"); 32var assetsFile = Path.Combine(build.GetBaseIntermediateDirectory().FullName, "project.assets.json"); 42var assetsFile = Path.Combine(build.GetBaseIntermediateDirectory().FullName, "project.assets.json");
GivenThatWeWantDiagnosticsWhenPackageCannotBeFound.cs (4)
28Path.GetDirectoryName(package.NupkgPath)); 58var shaFile = Path.Combine( 64var nupkgMetadataFile = Path.Combine( 87Path.Combine(asset.TestRoot, project.Name));
GivenThatWeWantMSBuildToRespectCustomCulture.cs (2)
26new FileInfo(Path.Combine(outputDirectory, "test-1", "MSBuildCultureResourceGeneration.resources.dll")).Should().Exist(); 27new FileInfo(Path.Combine(outputDirectory, "test-2", "MSBuildCultureResourceGeneration.resources.dll")).Should().Exist();
GivenThatWeWantRuntimeConfigInBuiltProjectOutputGroup.cs (2)
63var configFile = Path.Combine(buildCommand.GetOutputDirectory(configuration: "Release", runtimeIdentifier: testProject.RuntimeIdentifier).FullName, testProject.Name + ".runtimeconfig.json"); 124var configFile = Path.Combine(buildCommand.GetOutputDirectory(configuration: "Release", runtimeIdentifier: testProject.RuntimeIdentifier).FullName, testProject.Name + ".runtimeconfig.json");
GivenThatWeWantSatelliteAssembliesHaveassemblyVersion.cs (2)
41_mainAssemblyPath = Path.Combine(outputDirectory.FullName, "AllResourcesInSatellite.dll"); 42_satelliteAssemblyPath = Path.Combine(outputDirectory.FullName, "en", "AllResourcesInSatellite.resources.dll");
GivenThatWeWantToBuildAComServerLibrary.cs (1)
39string runtimeConfigFile = Path.Combine(outputDirectory.FullName, "ComServer.runtimeconfig.json");
GivenThatWeWantToBuildACppCliNonLibraryProject.cs (1)
38if (Path.GetExtension(projectPath) == ".vcxproj")
GivenThatWeWantToBuildACppCliProject.cs (9)
36var exe = Path.Combine( 38new DirectoryInfo(Path.Combine(testAsset.TestRoot, "CSConsoleApp", "bin")).GetDirectories().Single().FullName, 80var packagesFolder = Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest", "packages"); 122if (Path.GetExtension(projectPath) == ".vcxproj") 193if (Path.GetExtension(projectPath) == ".vcxproj") 212if (Path.GetExtension(projectPath) == ".vcxproj") 221if (Path.GetExtension(projectPath) == ".vcxproj") 254string intermediateOutputPath = Path.Combine(testRoot, project, "obj", configuration, targetFramework ?? "foo"); 256foreach (var line in File.ReadAllLines(Path.Combine(intermediateOutputPath, "PropertyValues.txt")))
GivenThatWeWantToBuildACppCliProjectWithTransitiveDeps.cs (3)
20string depsJsonContent = File.ReadAllText(Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest", "Debug", 30var outputDirectory = new DirectoryInfo(Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest", "Debug")); 42var outputDirectory = new DirectoryInfo(Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest", "Debug"));
GivenThatWeWantToBuildACrossTargetedLibrary.cs (6)
18.CopyTestAsset(Path.Combine("CrossTargeting", "NetStandardAndNetCoreApp")) 27var outputDirectory = new DirectoryInfo(Path.Combine(buildCommand.ProjectRootPath, "bin", "Debug")); 55var outputDirectory = new DirectoryInfo(Path.Combine(buildCommand.ProjectRootPath, "bin", "Debug")); 86.CopyTestAsset(Path.Combine("CrossTargeting", "NetStandardAndNetCoreApp"), identifier: identifier) 144string outputPathValue = File.ReadAllText(Path.Combine(testAsset.TestRoot, testProject.Name, "OutputPathValue.txt")); 185string outputPathValue = File.ReadAllText(Path.Combine(testAsset.TestRoot, testProject.Name, "OutputPathValue.txt"));
GivenThatWeWantToBuildADesktopExe.cs (12)
54var referenceAssemblies = getValues.GetValues().Select(p => Path.GetFileName(p)).Order().ToArray(); 79if (Path.GetFileName(f.FullName).Equals(file, StringComparison.OrdinalIgnoreCase)) 88var rootDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", ".."); 104var fileLocation = Path.GetTempFileName(); 164var getValueCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, "PlatformTarget"); 197.CopyTestAsset("DesktopMinusRid", identifier: Path.DirectorySeparatorChar + identifier + (multiTarget ? "Multi" : "")) 223var exe = Path.Combine(buildCommand.GetOutputDirectory("net46").FullName, "DesktopMinusRid.exe"); 270.CopyTestAsset("DesktopMinusRid", identifier: Path.DirectorySeparatorChar + identifier + (multiTarget ? "Multi" : "")) 323var exe = Path.Combine(directory.FullName, "DesktopMinusRid.exe"); 352.CopyTestAsset("DesktopMinusRid", identifier: Path.DirectorySeparatorChar + runtimeIdentifier) 844Path.Combine(testAsset.TestRoot, "App.Config")); 866Path.Combine(testAsset.TestRoot, "App.Config"));
GivenThatWeWantToBuildADesktopExeWtihNetStandardLib.cs (5)
71return Path.GetFileNameWithoutExtension(projectPath).Equals(AppName, StringComparison.OrdinalIgnoreCase); 76return Path.GetFileNameWithoutExtension(projectPath).Equals(LibraryName, StringComparison.OrdinalIgnoreCase); 143var getCommandLineCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, AppName), "", "CscCommandLineArgs", GetValuesCommand.ValueType.Item); 157var testLibraryDirectory = new DirectoryInfo(Path.Combine(testAsset.TestRoot, "TestLibrary")); 167references.Select(r => Path.GetFileName(r))
GivenThatWeWantToBuildADesktopLibrary.cs (10)
91if (Path.GetFileName(projectPath).Equals(netFrameworkLibrary.Name + ".csproj", StringComparison.OrdinalIgnoreCase)) 123using (var depsJsonFileStream = File.OpenRead(Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, exeName + ".deps.json"))) 160using (var depsJsonFileStream = File.OpenRead(Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework).FullName, $"{testProject.Name}.deps.json"))) 189using (var depsJsonFileStream = File.OpenRead(Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework).FullName, $"{testProject.Name}.deps.json"))) 326using (var depsJsonFileStream = File.OpenRead(Path.Combine(buildCommand.GetOutputDirectory("net46").FullName, "Library.deps.json"))) 408if (Path.GetFileNameWithoutExtension(path) == project.Name) 427string projectFolder = Path.Combine(testAsset.Path, project.Name); 441correctHttpReference = Path.Combine(microsoftNETBuildExtensionsPath, @"net461\lib\System.Net.Http.dll"); 445correctHttpReference = Path.Combine(TestContext.Current.NuGetCachePath, "system.net.http", "4.3.2", "ref", "net46", "System.Net.Http.dll"); 511return new FileInfo(Path.Combine(outputDirectory.FullName, referencedProject.Name + ".dll")).FullName;
GivenThatWeWantToBuildALibrary.cs (26)
88var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 111string docFileIdentifier = documentationFile == null ? "null" : Path.GetFileName(documentationFile); 112string identifier = $"-genDoc={genDocFileIdentifier}, docFile={Path.GetFileName(docFileIdentifier)}"; 149var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 183var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 227var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 259var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 261var oldProjectFile = Path.Combine(libraryProjectDirectory, "TestLibrary.csproj"); 262var newProjectFile = Path.Combine(libraryProjectDirectory, "TestLibrary.different_language_proj"); 285var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 365var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 460var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 542var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name)); 548var runCommand = new RunExeCommand(Log, Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, $"{testProj.Name}.exe")); 602var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), targetFramework, "TargetPlatformIdentifier"); 633var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), targetFramework, "TargetPlatformVersion"); 680var relativePathToProject = Path.Combine(testProject.Name, testProject.Name + ".csproj"); 687var relativePathToSln = Path.GetFileName(testAsset.Path) + ".sln"; 771var assetsFilePath = Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "project.assets.json"); 837Path.Combine(asset.Path, project.Name), 892string runtimeConfigFile = Path.Combine(outputDirectory.FullName, runtimeConfigName); 936string runtimeConfigFile = Path.Combine(outputDirectory.FullName, runtimeConfigName); 1003string runtimeConfigFile = Path.Combine(outputDirectory.FullName, runtimeConfigName); 1033File.WriteAllText(Path.Combine(testAsset.Path, testProject.Name, $"{testProject.Name}.cs"), @" 1045string projectFolder = Path.Combine(testAsset.Path, testProject.Name); 1134var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, "TestLibrary"), targetFramework, "PackageConflictPreferredPackages");
GivenThatWeWantToBuildALibraryWithFSharp.cs (6)
81var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 122var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 124var oldProjectFile = Path.Combine(libraryProjectDirectory, "TestLibrary.fsproj"); 125var newProjectFile = Path.Combine(libraryProjectDirectory, "TestLibrary.different_language_proj"); 148var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 212var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary");
GivenThatWeWantToBuildALibraryWithOSSupportedVersion.cs (11)
22WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 47WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 71WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 90WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 110WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 129WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 152var buildCommand = new DotnetBuildCommand(Log, Path.Combine(testAsset.Path, "Project", "Project.csproj")); 168WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 187WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 216WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name) 265WorkingDirectory = Path.Combine(testAsset.TestRoot, testProject.Name)
GivenThatWeWantToBuildALibraryWithVB.cs (6)
92var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 133var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 135var oldProjectFile = Path.Combine(libraryProjectDirectory, "TestLibrary.vbproj"); 136var newProjectFile = Path.Combine(libraryProjectDirectory, "TestLibrary.different_language_proj"); 159var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary"); 230var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "TestLibrary");
GivenThatWeWantToBuildAnAppWithLibrariesAndRid.cs (2)
51string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); 117new DotnetCommand(Log, Path.Combine(outputDirectory.FullName, "App.dll"))
GivenThatWeWantToBuildAnAppWithLibrary.cs (5)
59new DotnetCommand(Log, Path.Combine(outputDirectory.FullName, "TestApp.dll")) 66var appInfo = FileVersionInfo.GetVersionInfo(Path.Combine(outputDirectory.FullName, "TestApp.dll")); 74var libInfo = FileVersionInfo.GetVersionInfo(Path.Combine(outputDirectory.FullName, "TestLibrary.dll")); 98var commandResult = new DotnetCommand(Log, Path.Combine(outputDir.FullName, "TestApp.dll")) 118var cultureDir = new DirectoryInfo(Path.Combine(outputDir.FullName, culture));
GivenThatWeWantToBuildAnAppWithoutTransitiveProjectRefs.cs (5)
33Path.Combine(ciOutputRoot, "binlog", helixGuid, $"{nameof(It_cleans_the_project_successfully_with_static_graph_and_isolation)}.binlog") : 39Path.Combine(testAsset.TestRoot, "1", "1.csproj"), 120Path.Combine(testAsset.TestRoot, "1", "1.csproj")); 170new DotnetCommand(Log, Path.Combine(outputDirectory.FullName, "1.dll")) 188Path.Combine(ciOutputRoot, "binlog", helixGuid, $"{callingMethod}.binlog") :
GivenThatWeWantToBuildAnAppWithSharedProject.cs (6)
25string intermediateOutputPath = Path.Combine(command.GetBaseIntermediateDirectory().FullName, "Debug", ToolsetInfo.CurrentTargetFramework); 26string itemsFile = Path.Combine(intermediateOutputPath, "Items.txt"); 37itemDict["Compile"].Should().Contain((fullPath: Path.Combine(testAsset.TestRoot, "SharedProject", "Class1.cs"), link: "")); 40itemDict["Compile"].Should().Contain((fullPath: Path.Combine(testAsset.TestRoot, "Linked", "LinkedClass.cs"), link: "LinkedClass.cs")); 43itemDict["Content"].Should().Contain((fullPath: Path.Combine(testAsset.TestRoot, "SharedProject", "MyFolder", "TextFile1.txt"), 44link: Path.Combine("MyFolder", "TextFile1.txt")));
GivenThatWeWantToBuildAnAppWithTransitiveNonSdkProjectRefs.cs (3)
41string projectFileName = Path.GetFileNameWithoutExtension(projectName); 76using (var depsJsonFileStream = File.OpenRead(Path.Combine(outputDirectory, "TestApp.deps.json"))) 181new DotnetCommand(Log, Path.Combine(outputDirectory.FullName, "TestApp.dll"))
GivenThatWeWantToBuildAnAppWithTransitiveProjectRefs.cs (1)
48new DotnetCommand(Log, Path.Combine(outputDirectory.FullName, "TestApp.dll"))
GivenThatWeWantToBuildANetCoreApp.cs (26)
96LockFile lockFile = LockFileUtilities.GetLockFile(Path.Combine(buildCommand.ProjectRootPath, "obj", "project.assets.json"), NullLogger.Instance); 154string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json"); 166string devruntimeConfigContents = File.ReadAllText(Path.Combine(outputDirectory.FullName, runtimeconfigDevFileName)); 172var expectedPath = $"{Path.Combine(homePath, ".dotnet", "store")}{Path.DirectorySeparatorChar}|arch|{Path.DirectorySeparatorChar}|tfm|"; 176LockFile lockFile = LockFileUtilities.GetLockFile(Path.Combine(buildCommand.ProjectRootPath, "obj", "project.assets.json"), NullLogger.Instance); 365new DotnetCommand(Log, Path.Combine(outputFolder, project.Name + ".dll")) 392var runtimeconfigFile = Path.Combine( 420var runtimeconfigFile = Path.Combine( 487using (var depsJsonFileStream = File.OpenRead(Path.Combine(outputFolder, $"{project.Name}.deps.json"))) 526using var depsJsonFileStream = File.OpenRead(Path.Combine(outputFolder, $"{project.Name}.deps.json")); 607outputDirectory.Should().HaveFile(Path.Combine("fr", "Humanizer.resources.dll")); 643string outputFolderWithConfiguration = Path.Combine(buildCommand.ProjectRootPath, "bin", "Debug"); 646.Select(Path.GetFileName) 650string intermediateFolderWithConfiguration = Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "Debug"); 653.Select(Path.GetFileName) 779string testDirectory = Path.Combine(testAsset.TestRoot, testProject.Name); 869var depsFilePath = Path.Combine(outputPath, $"{testProject.Name}.deps.json"); 870var runtimeConfigPath = Path.Combine(outputPath, $"{testProject.Name}.runtimeconfig.json"); 930var refPath = Path.Combine(outputPath, "ref"); 938var refPath = Path.Combine( 1022testProject.AdditionalProperties["RestoreAdditionalProjectSources"] = Path.GetDirectoryName(package.NupkgPath); 1075testProject.AdditionalProperties["RestoreAdditionalProjectSources"] = Path.GetDirectoryName(package.NupkgPath); 1123var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name)); 1129var runCommand = new RunExeCommand(Log, Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework).FullName, $"{testProj.Name}{EnvironmentInfo.ExecutableExtension}"));
GivenThatWeWantToBuildAppsWithFrameworkRefs.cs (1)
44new RunExeCommand(Log, Path.Combine(outputDirectory.FullName, "EntityFrameworkApp.exe"))
GivenThatWeWantToBuildASelfContainedApp.cs (15)
52string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); 141string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); 211string oldCasing = Path.Combine(packageDownloadAsset.TestRoot, packageDownloadProject.Name, "packs", runtimePack.metadata["NuGetPackageId"].ToLowerInvariant()); 212string newCasing = Path.Combine(packageDownloadAsset.TestRoot, packageDownloadProject.Name, "packs", runtimePack.metadata["NuGetPackageId"]); 218.WithEnvironmentVariable(EnvironmentVariableNames.WORKLOAD_PACK_ROOTS, Path.Combine(packageDownloadAsset.TestRoot, packageDownloadProject.Name)); 226var packagesFolder = Path.Combine(testAsset.TestRoot, testProject.Name, "packages"); 229var path = Path.Combine(packagesFolder, runtimePack.metadata["NuGetPackageId"].ToLowerInvariant()); 285string manifestRoot = Path.Combine(testAsset.TestRoot, "manifests"); 286string manifestFolder = Path.Combine(manifestRoot, sdkVersionBand, "RuntimePackVersionTestWorkload"); 288string manifestPath = Path.Combine(manifestFolder, "WorkloadManifest.json"); 398.WithWorkingDirectory(Path.Combine(testAsset.Path, "MainProject")) 495Path.Combine(asset.Path, project.Name), 516string exePath = Path.Combine( 588string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); 631string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable);
GivenThatWeWantToBuildASolutionWithNonAnyCPUPlatform.cs (1)
25new DirectoryInfo(Path.Combine(testAsset.TestRoot, "bin", "x64", "Debug", ToolsetInfo.CurrentTargetFramework))
GivenThatWeWantToBuildAWindowsDesktopProject.cs (8)
157var projFile = Path.Combine(testDirectory, Path.GetFileName(testDirectory) + ".csproj"); 262var projectPath = Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj"); 281File.WriteAllText(Path.Combine(testDir.Path, "Directory.Build.targets"), DirectoryBuildTargetsContent); 310File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.targets"), DirectoryBuildTargetsContent); 342File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.targets"), DirectoryBuildTargetsContent); 792File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.targets"), """
GivenThatWeWantToBuildAWindowsRuntimeComponent.cs (7)
172File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.targets"), @"<Project> 191var exePath = Path.Combine(buildCommand.GetOutputDirectory(consoleApp.TargetFrameworks).FullName, consoleApp.Name + ".exe"); 252var cppWinMDSourceDirectory = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("CppWinMDComponent"), "SimpleMathComponent"); 253var cppWinTargetDirectory = Path.Combine(testAsset.TestRoot, "SimpleMathComponent"); 257File.Copy(file, Path.Combine(cppWinTargetDirectory, Path.GetFileName(file))); 262PackagesDirectory = Path.Combine(testAsset.Path, "packages")
GivenThatWeWantToBuildWithATargetPlatform.cs (5)
32var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProj.Name), targetFramework, valueName); 70var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.Path, testProj.Name), targetFramework, "TargetPlatformIdentifier"); 88var build = new BuildCommand(Log, Path.Combine(testAsset.Path, testProject.Name)); 121File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.targets"), DirectoryBuildTargetsContent); 159File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.targets"), DirectoryBuildTargetsContent);
GivenThatWeWantToBuildWithGlobalJson.cs (1)
27var globalJsonPath = Path.Combine(testAsset.Path, testProject.Name, "global.json");
GivenThatWeWantToCollectExceptionTelemetry.cs (1)
28var mSBuildCommand = new MSBuildCommand(Log, "GenerateToolsSettingsFileFromBuildProperty", Path.Combine(testAsset.TestRoot));
GivenThatWeWantToControlGeneratedAssemblyInfo.cs (25)
29.CopyTestAsset("HelloWorld", identifier: Path.DirectorySeparatorChar + attributeToOptOut) 79var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework, "Release").FullName, "HelloWorld.dll"); 96var command = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, valueName: "InformationalVersion"); 127var command = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, valueName: "InformationalVersion"); 159var command = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, valueName: "InformationalVersion"); 195var command = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, valueName: "InformationalVersion"); 232var command = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, valueName: "InformationalVersion"); 258var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll"); 286var assemblyPath = Path.Combine(incrementalBuildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll"); 309var assemblyPath = Path.Combine(firstBuildCommand.GetOutputDirectory(targetFramework).FullName, "TestLibrary.dll"); 359var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll"); 394var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll"); 453var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework).FullName, "HelloWorld.dll"); 507var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll"); 553var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll"); 579var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll"); 606var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll"); 632var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll"); 660var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll"); 698var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll"); 730File.WriteAllText(Path.Combine(testAsset.TestRoot, "Directory.Build.props"), @" 744var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testTestProject.TargetFrameworks).FullName, testTestProject.Name + ".dll"); 776var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll"); 803var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, testProject.Name + ".dll"); 860var exePath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll");
GivenThatWeWantToCopyPPFileToOutput.cs (7)
25testProject.AdditionalProperties.Add("RestoreAdditionalProjectSources", Path.GetDirectoryName(packageReference.NupkgPath)); 37File.Exists(Path.Combine(outputPath, packageReference.ID + ".dll")).Should().BeTrue(); 38File.Exists(Path.Combine(outputPath, "Nontransformed.ps1")).Should().BeTrue(); 39File.Exists(Path.Combine(outputPath, "Test.ps1")).Should().BeTrue(); 51WriteFile(Path.Combine(packageAsset.TestRoot, referencedPackage.Name, "Nontransformed.ps1"), "Content file"); 52WriteFile(Path.Combine(packageAsset.TestRoot, referencedPackage.Name, "Test.ps1.pp"), "Content file"); 76string folder = Path.GetDirectoryName(path);
GivenThatWeWantToExcludeTheMainProjectFromTheDepsFile.cs (1)
36if (Path.GetFileNameWithoutExtension(path) == testProject.Name)
GivenThatWeWantToFloatWarningLevels.cs (9)
52Path.Combine(testAsset.TestRoot, testProject.Name), 96Path.Combine(testAsset.TestRoot, testProject.Name), 141Path.Combine(testAsset.TestRoot, testProject.Name), 197Path.Combine(testAsset.TestRoot, testProject.Name), 244Path.Combine(testAsset.TestRoot, testProject.Name), 340Path.Combine(testAsset.TestRoot, testProject.Name), 357Path.Combine(testAsset.TestRoot, testProject.Name), 368var expectedAnalyzerConfigFiles = analyzerConfigFiles.Where(file => string.Equals(Path.GetFileName(file), expectedMappedAnalyzerConfig)); 463var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name));
GivenThatWeWantToGenerateADepsFileForATool.cs (14)
96DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, toolProject.Name.ToLowerInvariant())); 97DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, ".tools", toolProject.Name.ToLowerInvariant())); 106var packCommand = new PackCommand(Log, Path.Combine(toolProjectInstance.TestRoot, toolProject.Name)); 112string nupkgPath = Path.Combine(packCommand.ProjectRootPath, "bin", "Debug"); 138string toolAssetsFilePath = Path.Combine(TestContext.Current.NuGetCachePath, ".tools", toolProject.Name.ToLowerInvariant(), "1.0.0", toolProject.TargetFrameworks, "project.assets.json"); 146string generateDepsProjectDirectoryPath = Path.Combine(currentToolsetSdksPath, "Microsoft.NET.Sdk", "targets", "GenerateDeps"); 153string depsFilePath = Path.Combine(Path.GetDirectoryName(toolAssetsFilePath), toolProject.Name + ".deps.json"); 175buildRelativePath = Path.GetDirectoryName(buildRelativePath); 177string platformLibraryBuildFolderPath = Path.Combine(platformLibraryPath, buildRelativePath); 205.FirstOrDefault(r => Path.GetFileNameWithoutExtension(r.Path) == toolProject.Name); 209var toolAssemblyPath = Path.Combine( 225dotnetArgs.Add(Path.GetFullPath(toolAssemblyPath)); 252return lockFile.PackageFolders.Select(pf => pf.Path.TrimEnd(Path.DirectorySeparatorChar));
GivenThatWeWantToGenerateGlobalUsings_BlazorWasm.cs (1)
31File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be(
GivenThatWeWantToGenerateGlobalUsings_DotNet.cs (6)
31File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be( 83File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be( 127File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be( 173File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be( 211File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be( 243File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be(
GivenThatWeWantToGenerateGlobalUsings_WebApp.cs (1)
32File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be(
GivenThatWeWantToGenerateGlobalUsings_Worker.cs (1)
31File.ReadAllText(Path.Combine(outputDirectory.FullName, globalUsingsFileName)).Should().Be(
GivenThatWeWantToIncludeItemsOutsideTheProjectFolder.cs (8)
39string intermediateOutputPath = Path.Combine(command.GetBaseIntermediateDirectory().FullName, "Debug", "netstandard2.0"); 40string itemsFile = Path.Combine(intermediateOutputPath, "Items.txt"); 53string filename = Path.GetFileName(i.fullPath); 82var projectFolder = Path.Combine(testAsset.TestRoot, "LinkTest"); 88string fullPath = Path.GetFullPath(Path.Combine(projectFolder, item.Replace('\\', Path.DirectorySeparatorChar))); 100link = link.Replace('\\', Path.DirectorySeparatorChar);
GivenThatWeWantToPreserveCompilationContextForBuild.cs (1)
65using (var depsJsonFileStream = File.OpenRead(Path.Combine(outputDirectory.FullName, $"{testProject.Name}.deps.json")))
GivenThatWeWantToProduceReferenceAssembly.cs (1)
29var filePath = Path.Combine(testAsset.Path, testProject.Name, "obj", "Debug", targetFramework, "ref", $"{testProject.Name}.dll");
GivenThatWeWantToReferenceAnAssembly.cs (1)
919return Path.Combine(outputDirectory.FullName, testProject.Name + ".dll");
GivenThatWeWantToReferenceAProject.cs (17)
169File.WriteAllText(Path.Combine(childAsset.Path, childProject.Name, contentName), childProject.Name); 181.WithProjectChanges(project => AddProjectChanges(project, Path.Combine(childAsset.Path, childProject.Name, childProject.Name + ".csproj"))); 182File.WriteAllText(Path.Combine(parentAsset.Path, parentProject.Name, contentName), parentProject.Name); 187var getValuesCommand = new GetValuesCommand(Log, Path.Combine(parentAsset.Path, parentProject.Name), tfm, "ResultOutput") 193var valuesResult = getValuesCommand.GetValuesWithMetadata().Select(pair => Path.GetFullPath(pair.value)); 197valuesResult.Should().BeEquivalentTo(Path.GetFullPath(Path.Combine(parentAsset.Path, parentProject.Name, contentName)), 198Path.GetFullPath(Path.Combine(childAsset.Path, childProject.Name, contentName))); 203valuesResult.First().Should().Contain(Path.GetFullPath(Path.Combine(parentAsset.Path, parentProject.Name, contentName))); 262if (Path.GetFileNameWithoutExtension(path) == testProjectA.Name) 269File.WriteAllText(Path.Combine(testAsset.Path, testProjectA.Name, "a.txt"), "A"); 277var contentPath = Path.Combine(testProjectC.GetOutputDirectory(testAsset.Path), "a.txt"); 279var binDir = new DirectoryInfo(Path.GetDirectoryName(contentPath)); 325if (Path.GetFileName(path).Equals("ProjectC.csproj")) 331new XAttribute("Include", Path.Combine(path, "..", "..", testProjectA.Name, $"{testProjectA.Name}.csproj")));
GivenThatWeWantToResolveConflicts.cs (5)
70string projectFolder = Path.Combine(tempTestAsset.TestRoot, testProject.Name); 136string depsJsonPath = Path.Combine(outputFolder, $"{testProject.Name}.deps.json"); 301var assetsFilePath = Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "project.assets.json"); 366var prunePackageItemFile = Path.Combine(testAsset.TestRoot, "prunePackageItems.txt"); 479var assetsFilePath = Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "project.assets.json");
GivenThatWeWantToResolveRuntimePackAssets.cs (5)
31var projectDirectory = Path.Combine(testAsset.TestRoot, testProject.Name); 46Path.Combine(projectDirectory, "data", "RuntimeList.xml"))); 64var projectDirectory = Path.Combine(testAsset.TestRoot, testProject.Name); 66Directory.CreateDirectory(Path.Combine(projectDirectory, "data")); 69Path.Combine(projectDirectory, "data", "RuntimeList.xml"),
GivenThatWeWantToRunFromMSBuildTarget.cs (1)
30var runTargetCommand = new MSBuildCommand(Log, "run", Path.Combine(testAsset.TestRoot, testProject.Name));
GivenThatWeWantToSetPropertiesInDirectoryBuildProps.cs (2)
23string directoryBuildPropsPath = Path.Combine(testAsset.Path, "Directory.Build.props"); 42string projectFolder = Path.Combine(testAsset.Path, project.Name);
GivenThatWeWantToTargetNet471.cs (6)
307if (Path.GetFileNameWithoutExtension(projectPath) == testProject.Name) 440if (Path.GetFileNameWithoutExtension(projectPath) == testProject.Name) 442string folder = Path.GetDirectoryName(projectPath); 446File.WriteAllText(Path.Combine(folder, "app.config"), 480var exePath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".exe"); 552if (Path.GetFileNameWithoutExtension(projectPath) == testProject.Name)
GivenThatWeWantToUseAnalyzers.cs (8)
207Path.Combine(asset.Path, "NonWebAppWithAspNet"), 249Path.Combine(asset.Path, "TestApp"), 350Path.Combine(CliFolderPathCalculator.DotnetHomePath, ".dotnet", "NuGetFallbackFolder"), 351Path.Combine(TestContext.Current.ToolsetUnderTest.DotNetRoot, "packs") 356absolutePath = Path.GetFullPath(absolutePath); 361.Replace(Path.DirectorySeparatorChar, '/'); 370if (absolutePath.StartsWith(nugetRoot + Path.DirectorySeparatorChar)) 373.Replace(Path.DirectorySeparatorChar, '/');
GivenThatWeWantToUseContentFiles.cs (6)
59Path.Combine(outputDir, @"ContentFiles.deps.json"), 60Path.Combine(outputDir, @"ContentFiles.dll"), 61Path.Combine(outputDir, @"ContentFiles.pdb"), 62Path.Combine(outputDir, @"ContentFiles.runtimeconfig.json"), 63Path.Combine(outputDir, @"tools", "run.cmd"), 64Path.Combine(outputDir, @"tools", "run.sh"),
GivenThatWeWantToUsePlatformAnalyzers.cs (9)
50Path.Combine(testAsset.TestRoot, testProject.Name), 96Path.Combine(testAsset.TestRoot, testProject.Name), 142Path.Combine(testAsset.TestRoot, testProject.Name), 188Path.Combine(testAsset.TestRoot, testProject.Name), 234Path.Combine(testAsset.TestRoot, testProject.Name), 279var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 319Path.Combine(testAsset.TestRoot, testProject.Name), 365Path.Combine(testAsset.TestRoot, testProject.Name), 411Path.Combine(testAsset.TestRoot, testProject.Name),
GivenThatWeWantToUseVB.cs (2)
76Path.Combine(testAsset.TestRoot, testProject.Name), 169return Path.GetFileName(property) == "Microsoft.VisualBasic.dll"
GivenThatWeWantToVerifyNuGetReferenceCompat.cs (7)
72var dependencyProjectDirectory = Path.Combine( 111var source = Path.Combine(packageReference.NupkgPath, packageReference.ID, "bin", "Debug"); 150var source = Path.Combine(testPackageReference.NupkgPath, testPackageReference.ID, "bin", "Debug"); 169NuGetConfigWriter.Write(testProjectTestAsset.TestRoot, Path.GetDirectoryName(testPackageReference.NupkgPath)); 185NuGetConfigWriter.Write(testProjectTestAsset.TestRoot, Path.GetDirectoryName(testPackageReference.NupkgPath)); 201var source = Path.Combine(testPackageReference.NupkgPath, testPackageReference.ID, "bin", "Debug"); 274var dependencyProjectDirectory = Path.Combine(testAsset.TestRoot, project.Name);
GivenThereAreDefaultItems.cs (52)
25WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, folder, "source.cs"), 29WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 32WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Packages", "Package.cs"), 46.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 58WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Output", "CSharpInOutput.cs"), 61WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 84.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 97WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, folder, "source.cs"), 101WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 130.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 141string sharedCodePath = Path.Combine(Path.GetDirectoryName(getValuesCommand.ProjectRootPath), "Shared"); 142WriteFile(Path.Combine(sharedCodePath, "Shared.cs"), 145WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 168.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 179WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 181WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Excluded", "Excluded.cs"), 203.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 214WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 216WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "obj", "Class2.cs"), 218WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "obj", "Excluded.cs"), 241.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 252WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 254WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "CSharpAsResource.cs"), 277.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 289.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 300WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "Code", "Class1.cs"), 302WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "CSharpAsContent.cs"), 305WriteFile(Path.Combine(getValuesCommand.ProjectRootPath, "None.txt"), "Content file"); 328.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 340.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 351.Select(item => item.Replace('\\', Path.DirectorySeparatorChar)) 386var projectFolder = Path.Combine(testAsset.TestRoot, testProject.Name); 388File.WriteAllText(Path.Combine(projectFolder, "ShouldBeIgnored.cs"), "!InvalidCSharp!"); 389File.WriteAllText(Path.Combine(projectFolder, "Resources.resx"), "<Resource/>"); 390File.WriteAllText(Path.Combine(projectFolder, "ResourcesResw.resw"), "<root/>"); 391File.WriteAllText(Path.Combine(projectFolder, "TestImage.jpg"), ""); 464WriteFile(Path.Combine(buildCommand.ProjectRootPath, "ProjectRoot.txt"), "ProjectRoot"); 465WriteFile(Path.Combine(buildCommand.ProjectRootPath, "Subfolder", "ProjectSubfolder.txt"), "ProjectSubfolder"); 466WriteFile(Path.Combine(buildCommand.ProjectRootPath, "wwwroot", "wwwroot.txt"), "wwwroot"); 467WriteFile(Path.Combine(buildCommand.ProjectRootPath, "wwwroot", "wwwsubfolder", "wwwsubfolder.txt"), "wwwsubfolder"); 504WriteFile(Path.Combine(buildCommand.ProjectRootPath, "ShouldNotBeCompiled.cs"), 531WriteFile(Path.Combine(buildCommand.ProjectRootPath, "Class1.cs"), "public class Class1 {}"); 686LockFile lockFile = LockFileUtilities.GetLockFile(Path.Combine(buildCommand.ProjectRootPath, "obj", "project.assets.json"), NullLogger.Instance); 727var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), 765var projectFolder = Path.Combine(testAsset.TestRoot, testProject.Name); 767File.WriteAllText(Path.Combine(projectFolder, "ResourcesResw.resw"), "<root/>"); 771File.WriteAllText(Path.Combine(projectFolder, fileName), ""); 816var projectFolder = Path.Combine(testAsset.TestRoot, testProject.Name); 818File.WriteAllText(Path.Combine(projectFolder, "ResourcesResw.resw"), "<root/>"); 822File.WriteAllText(Path.Combine(projectFolder, fileName), ""); 876string folder = Path.GetDirectoryName(path);
GivenTransitiveFrameworkReferencesAreDisabled.cs (5)
62testProject.AdditionalProperties["NetCoreTargetingPackRoot"] = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 93.Select(Path.GetFileName) 133testProject.AdditionalProperties["NetCoreTargetingPackRoot"] = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
GiventThatWeWantDesignerSupport.cs (4)
69Path.Combine(asset.Path, project.Name), 94Path.IsPathFullyQualified(item.Identity).Should().BeTrue(); 95Path.GetFileName(item.Identity).Should().Be(item.TargetPath); 158.Select(p => Path.GetFileName(p));
GivenWeWantToRequireWindowsForDesktopApps.cs (15)
129var exePath = Path.Combine(testAsset.TestRoot, testAsset.TestProject.Name, 178var command = new BuildCommand(Log, Path.Combine(asset.Path, ProjectName)); 206var command = new BuildCommand(Log, Path.Combine(asset.Path, ProjectName)); 237var buildCommand = new BuildCommand(Log, Path.Combine(asset.Path, ProjectName)); 264Path.Combine(asset.Path, testProject.Name), 283.Should().Contain(i => i.RelativePath == "Microsoft.Windows.SDK.NET.dll" && Path.GetFileName(i.Identity) == "Microsoft.Windows.SDK.NET.dll", 287.Contain(i => i.RelativePath == "WinRT.Runtime.dll" && Path.GetFileName(i.Identity) == "WinRT.Runtime.dll", 292Path.Combine(asset.Path, testProject.Name), 306FullAssetPath = Path.GetFullPath(Path.Combine(asset.Path, testProject.Name, item.metadata["OutputPath"])) 310.Should().Contain(i => Path.GetFileName(Path.GetFullPath(i.FullAssetPath)) == "WinRT.Runtime.dll" && File.Exists(i.FullAssetPath), 314.Contain(i => Path.GetFileName(Path.GetFullPath(i.FullAssetPath)) == "WinRT.Runtime.dll" && File.Exists(i.FullAssetPath), 360Path.Combine(testAsset.Path, testProject.Name),
ImplicitAspNetVersions.cs (1)
225Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "project.assets.json"),
MetadataUpdaterSupportTest.cs (2)
28var runtimeConfigPath = Path.Combine(outputDirectory.FullName, "HelloWorld.runtimeconfig.json"); 52var runtimeConfigPath = Path.Combine(outputDirectory.FullName, "HelloWorld.runtimeconfig.json");
Net50Targeting.cs (1)
29var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), testProject.TargetFrameworks, "TargetFrameworkIdentifier");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
ProjectConfigurationDescriptionTest.cs (2)
26File.WriteAllText(Path.Combine(testAsset.Path, testProj.Name, $"{testProj.Name}.cs"), @" 41var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.Path, testProj.Name));
ReferenceExeTests.cs (13)
145var mainExePath = Path.Combine(outputDirectory, MainProject.Name + Constants.ExeSuffix); 147var referencedExePath = Path.Combine(outputDirectory, ReferencedProject.Name + Constants.ExeSuffix); 346var testProjectDirectory = Path.Combine(testAsset.TestRoot, "TestProject"); 356new DotnetCommand(Log, "add", "reference", ".." + Path.DirectorySeparatorChar + testConsoleProject.Name) 402var mtpProjectDirectory = Path.Combine(testAssetMTP.Path, "MTPTestProject"); 406File.WriteAllText(Path.Combine(mtpProjectDirectory, "Directory.Build.targets"), """ 453File.WriteAllText(Path.Combine(testAssetSelfContained.TestRoot, mtpNotSelfContained.Name, "Directory.Build.targets"), """ 462var consoleAppDirectory = Path.Combine(testAssetSelfContained.Path, testConsoleProjectSelfContained.Name); 490var testProjectDirectory = Path.Combine(testAsset.TestRoot, "TestProject"); 500string consoleProjectDirectory = Path.Combine(testAsset.Path, testConsoleProject.Name); 502new DotnetCommand(Log, "add", "reference", ".." + Path.DirectorySeparatorChar + "TestProject") 535var mtpProjectDirectory = Path.Combine(testAssetMTP.Path, mtpSelfContained.Name); 539File.WriteAllText(Path.Combine(mtpProjectDirectory, "Directory.Build.targets"), """
RoslynBuildTaskTests.cs (2)
162var binaryLogPath = Path.Join(buildCommand.WorkingDirectory, "msbuild.binlog"); 166Path.GetFileName(call.CompilerFilePath).Should().Be(compilerFileName);
RuntimeIdentifierGraphTests.cs (2)
60Path.GetFileName(runtimeIdentifierGraphPath).Should().Be("RuntimeIdentifierGraph.json"); 64Path.GetFileName(runtimeIdentifierGraphPath).Should().Be("PortableRuntimeIdentifierGraph.json");
SourceLinkTests.cs (20)
22var gitDir = Path.Combine(repoDir, ".git"); 23var headsDir = Path.Combine(gitDir, "refs", "heads"); 26File.WriteAllText(Path.Combine(gitDir, "HEAD"), "ref: refs/heads/master"); 31File.WriteAllText(Path.Combine(headsDir, "master"), commitSha); 36File.WriteAllText(Path.Combine(gitDir, "config"), $""" 42File.WriteAllText(Path.Combine(repoDir, ".gitignore"), """ 104.CopyTestAsset("SourceLinkTestApp", testDestinationDirectory: Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString())) 203var sourceLinkFilePath = Path.Combine(intermediateDir.FullName, "SourceLinkTestApp.sourcelink.json"); 205var expectedPattern = Path.Combine(testAsset.Path, "*").Replace("\\", "\\\\"); 209ValidatePdb(Path.Combine(intermediateDir.FullName, "SourceLinkTestApp.pdb"), expectedEmbeddedSources: true); 214using var nupkg = ZipFile.OpenRead(Path.Combine(binDir.FullName, "SourceLinkTestApp.1.0.0.nupkg")); 289ValidatePdb(Path.Combine(intermediateDir.FullName, "SourceLinkTestApp.pdb"), expectedEmbeddedSources: false); 300var intDir = Path.Combine(testAsset.Path, "NETCoreCppCliTest", "IntDir"); 315var sourceLinkFilePath = Path.Combine(intDir, "NETCoreCppCliTest.sourcelink.json"); 317var expectedPattern = Path.Combine(testAsset.Path, "*").Replace("\\", "\\\\"); 321var outputDir = Path.Combine(testAsset.Path, "NETCoreCppCliTest", "x64", "Debug"); 322var pdbText = File.ReadAllText(Path.Combine(outputDir, "NETCoreCppCliTest.pdb"), Encoding.UTF8); 337WorkingDirectory = Path.Combine(testAsset.Path, "FxWpf") 342Assert.True(File.Exists(Path.Combine(testAsset.Path, "obj", "net472", "MainWindow.g.cs")));
Microsoft.NET.Clean.Tests (3)
GivenThatWeWantToCleanAProject.cs (2)
23var lockFilePath = Path.Combine(testAsset.TestRoot, "obj", "project.assets.json"); 52var assetsFilePath = Path.Combine(testAsset.TestRoot, "obj", "project.assets.json");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.NET.Pack.Tests (19)
GivenThatWeWantToPackACppCliProject.cs (3)
23new PackCommand(Log, Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest", "NETCoreCppCliTest.vcxproj")) 32if (Path.GetExtension(projectPath) == ".vcxproj") 43if (Path.GetExtension(projectPath) == ".vcxproj")
GivenThatWeWantToPackACrossTargetedLibrary.cs (2)
19var libraryProjectDirectory = Path.Combine(testAsset.TestRoot, "NetStandardAndNetCoreApp"); 26var outputDirectory = new DirectoryInfo(Path.Combine(libraryProjectDirectory, "bin", "Debug"));
GivenThatWeWantToPackAHelloWorldProject.cs (8)
44}.Select(p => p.Replace('\\', Path.DirectorySeparatorChar)); 70new PackCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)) 87File.WriteAllText(Path.Combine(helloWorldAsset.Path, "Directory.Build.props"), "<Project><PropertyGroup><PackRelease>true</PackRelease></PropertyGroup></Project>"); 97var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", optedOut ? "Debug" : "Release", "HelloWorld.1.0.0.nupkg"); 123var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", valueOfPackRelease == "true" ? "Release" : "Debug", "HelloWorld.1.0.0.nupkg"); 155var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", expectedConfiguration, "HelloWorld.1.0.0.nupkg"); 177var unexpectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Debug", tfm, "HelloWorld.dll"); 179var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", tfm, "HelloWorld.dll");
GivenThatWeWantToPackAProjectTool.cs (2)
29var packCommand = new PackCommand(Log, Path.Combine(asset.TestRoot, toolProject.Name)); 48var result = new PackCommand(Log, Path.Combine(asset.TestRoot, toolProject.Name)).Execute();
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
SolutionPackTests.cs (3)
29string packageOutputPath = Path.Combine(testAsset.Path, "output", "packages"); 37new FileInfo(Path.Combine(packageOutputPath, testProject1.Name + ".1.0.0.nupkg")).Should().Exist(); 38new FileInfo(Path.Combine(packageOutputPath, testProject1.Name + ".1.0.0.nupkg")).Should().Exist();
Microsoft.NET.Publish.Tests (372)
FilesCopiedToPublishDirTests.cs (1)
56Path.Combine(testAsset.Path, testProject.Name),
GivenThatAPublishedDepsJsonShouldContainVersionInformation.cs (6)
52var depsFilePath = Path.Combine(publishDirectory.FullName, $"{testProject.Name}.deps.json"); 86var depsJsonPath = Path.Combine(publishFolder, "DepsJsonVersions.deps.json"); 142var exePath = Path.Combine(publishDirectory.FullName, testProject.Name + ".dll"); 157string coreDir = Path.GetDirectoryName(stdOutLines[0]); 158string immutableDir = Path.GetDirectoryName(stdOutLines[1]); 232var depsFilePath = Path.Combine(outputDirectory.FullName, $"{testProject.Name}.deps.json");
GivenThatWeWantToPreserveCompilationContext.cs (6)
75var refsDirectory = new DirectoryInfo(Path.Combine(publishDirectory.FullName, "refs")); 90using (var depsJsonFileStream = File.OpenRead(Path.Combine(publishDirectory.FullName, "TestApp.deps.json"))) 173if (Path.GetFileName(path).Equals("TestApp.csproj", StringComparison.OrdinalIgnoreCase)) 183var manifestFile = Path.Combine(testAsset.TestRoot, "manifest.xml"); 193var appProjectDirectory = Path.Combine(testAsset.TestRoot, "TestApp"); 211var refsDirectory = new DirectoryInfo(Path.Combine(publishDirectory.FullName, "refs"));
GivenThatWeWantToPublishACppCliAppProject.cs (1)
21new PublishCommand(Log, Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest.sln"))
GivenThatWeWantToPublishACppCliProject.cs (4)
21new PublishCommand(Log, Path.Combine(testAsset.TestRoot, "CSConsoleApp")) 26var exe = Path.Combine( //find the platform directory 27new DirectoryInfo(Path.Combine(testAsset.TestRoot, "CSConsoleApp", "bin")).GetDirectories().Single().FullName, 49new PublishCommand(Log, Path.Combine(testAsset.TestRoot, "NETCoreCppCliTest"))
GivenThatWeWantToPublishAFrameworkDependentApp.cs (2)
85new RunExeCommand(Log, Path.Combine(publishDirectory.FullName, appHostName)) 88Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath))
GivenThatWeWantToPublishAHelloWorldProject.cs (44)
55new DotnetCommand(Log, Path.Combine(publishDirectory.FullName, "HelloWorld.dll")) 121string selfContainedExecutableFullPath = Path.Combine(publishDirectory.FullName, selfContainedExecutable); 326using (var depsJsonFileStream = File.OpenRead(Path.Combine(publishDirectory.FullName, $"{testProject.Name}.deps.json"))) 344string selfContainedExecutableFullPath = Path.Combine(publishDirectory.FullName, selfContainedExecutable); 386runCommand = new DotnetCommand(Log, Path.Combine(publishDirectory.FullName, $"{testProject.Name}.dll")); 405var buildCommand = new BuildCommand(helloWorldAsset, Path.Combine("DeployProj", "Deploy.proj")); 435File.WriteAllText(Path.Combine(helloWorldAsset.Path, "Directory.Build.props"), "<Project><PropertyGroup><PublishRelease>true</PublishRelease></PropertyGroup></Project>"); 443var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", optedOut ? "Debug" : "Release", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll"); 465var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll"); 467var releaseAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll"); 486var expectedAssetPath = Path.Combine(slnDir, "App", "bin", "Release", ToolsetInfo.CurrentTargetFramework, "publish", "App.dll"); 505var expectedAssetPath = Path.Combine(slnDir, "App", "bin", "Release", ToolsetInfo.CurrentTargetFramework, "publish", "App.dll"); 566var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", ToolsetInfo.CurrentTargetFramework, "HelloWorld.dll"); 597var expectedAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Debug", tfm, "HelloWorld.dll"); 599var releaseAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", tfm, "HelloWorld.dll"); 620.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name)) 645.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name)) 675var publishProfilesDirectory = Path.Combine(helloWorldAsset.Path, "Properties", "PublishProfiles"); 678File.WriteAllText(Path.Combine(publishProfilesDirectory, "test.pubxml"), $@" 693var releaseAssetPath = Path.Combine(helloWorldAsset.Path, "bin", "Release", ToolsetInfo.CurrentTargetFramework, rid, "HelloWorld.dll"); 862var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name); 863var publishProfilesDirectory = Path.Combine(projectDirectory, "Properties", "PublishProfiles"); 866File.WriteAllText(Path.Combine(publishProfilesDirectory, "test.pubxml"), $@" 945var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name); 946var projectPath = Path.Combine(projectDirectory, $"{testProject.Name}.csproj"); 947var publishProfilesDirectory = Path.Combine(projectDirectory, "Properties", "PublishProfiles"); 948var publishProfilePath = Path.Combine(publishProfilesDirectory, "test.pubxml"); 992var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name); 993var publishProfilesDirectory = Path.Combine(projectDirectory, "Properties", "PublishProfiles"); 996File.WriteAllText(Path.Combine(publishProfilesDirectory, "testProfile.pubxml"), $@" 1049var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name); 1050var publishProfilesDirectory = Path.Combine(projectDirectory, "Properties", "PublishProfiles"); 1053File.WriteAllText(Path.Combine(publishProfilesDirectory, "testProfile.pubxml"), $@" 1096var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 1152TestCommand runCommand = new RunExeCommand(Log, Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}")); 1159expectedRoot = Path.Combine(publishDirectory, appRelativeDotNet); 1160CopyDirectory(Path.Combine(TestContext.Current.ToolsetUnderTest.DotNetRoot, "host"), Path.Combine(expectedRoot, "host")); 1161CopyDirectory(Path.Combine(TestContext.Current.ToolsetUnderTest.DotNetRoot, "shared", "Microsoft.NETCore.App"), Path.Combine(expectedRoot, "shared", "Microsoft.NETCore.App")); 1192File.Copy(file, Path.Combine(destinationDir, Path.GetFileName(file))); 1197CopyDirectory(directory, Path.Combine(destinationDir, Path.GetFileName(directory)));
GivenThatWeWantToPublishAnAotApp.cs (52)
47var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 60var publishedDll = Path.Combine(publishDirectory, $"{projectName}{sharedLibSuffix}"); 61var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 103var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 104var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 149var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 150var publishedRuntimeConfig = Path.Combine(publishDirectory, $"{testProject.Name}.runtimeconfig.json"); 151var publishedDeps = Path.Combine(publishDirectory, $"{testProject.Name}.deps.json"); 201var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 202var publishedRuntimeConfig = Path.Combine(publishDirectory, $"{testProject.Name}.runtimeconfig.json"); 203var publishedDeps = Path.Combine(publishDirectory, $"{testProject.Name}.deps.json"); 243var assemblyPath = Path.Combine(outputDirectory, $"{projectName}{Constants.ExeSuffix}"); 244var runtimeConfigPath = Path.Combine(outputDirectory, $"{projectName}.runtimeconfig.json"); 245var depsPath = Path.Combine(outputDirectory, $"{projectName}.deps.json"); 295var publishedDll = Path.Combine(publishDirectory, $"{projectName}{sharedLibSuffix}"); 296var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 338var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 339var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 368var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 369var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 414var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 415var publishedExe = Path.Combine(publishDirectory, $"{testProject.Name}{Constants.ExeSuffix}"); 447var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 464var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 488var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 512var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 535var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 565var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 584var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 594var assemblyPath = Path.Combine(outputDirectory, $"{projectName}.dll"); 599var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 699var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 743var publishedExe = Path.Combine(publishDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}"); 838var publishedExe = Path.Combine(publishDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}"); 873var publishedDll = Path.Combine(publishDirectory, $"{projectName}{staticLibSuffix}"); 896var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 926var publishedDll = Path.Combine(publishDirectory, $"{projectName}{sharedLibSuffix}"); 942var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 965string runtimeConfigFile = Path.Combine(outputDirectory, $"{projectName}.runtimeconfig.json"); 1068var ilcVersion = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(ilcToolsPath))); 1078var corelibReference = ilcReference.Where(r => Path.GetFileName(r).Equals("System.Private.CoreLib.dll")).Single(); 1083ilcReferenceVersion = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(corelibReference))))); 1088ilcReferenceVersion = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(corelibReference))); 1226var path = Path.Combine(baseDir, baseName + suffix);
GivenThatWeWantToPublishAnAppWithLibrariesAndRid.cs (2)
51new RunExeCommand(Log, Path.Combine(publishDirectory.FullName, selfContainedExecutable)) 81new DotnetCommand(Log, Path.Combine(publishDirectory.FullName, "App.dll"))
GivenThatWeWantToPublishAProjectWithAllFeatures.cs (5)
33using (var depsJsonFileStream = File.OpenRead(Path.Combine(publishDirectory.FullName, "TestApp.deps.json"))) 54var runtimeConfigJsonContents = File.ReadAllText(Path.Combine(publishDirectory.FullName, "TestApp.runtimeconfig.json")); 184Path.Combine(command.ProjectRootPath, ".."), // up one level from TestApp to also get TestLibrary P2P files 196if (Path.GetFileName(path).Equals("TestApp.csproj", StringComparison.OrdinalIgnoreCase)) 205var appProjectDirectory = Path.Combine(testAsset.TestRoot, "TestApp");
GivenThatWeWantToPublishAProjectWithDependencies.cs (8)
94var appProjectDirectory = Path.Combine(testAsset.TestRoot, "App"); 122string manifestFile1 = Path.Combine(filterProjDir, manifestFileName1); 123string manifestFile2 = Path.Combine(filterProjDir, manifestFileName2); 140var runtimeConfig = ReadJson(Path.Combine(publishDirectory.FullName, $"{project}.runtimeconfig.json")); 142var depsJson = ReadJson(Path.Combine(publishDirectory.FullName, $"{project}.deps.json")); 169string manifestFile = Path.Combine(filterProjDir, "NewtonsoftFilterProfile.xml"); 250var libPublishCommand = new PublishCommand(Log, Path.Combine(libAsset.TestRoot, "NetStdLib")); 253var publishedLibPath = Path.Combine(libPublishCommand.GetOutputDirectory("netstandard1.0").FullName, "NetStdLib.dll");
GivenThatWeWantToPublishASelfContainedApp.cs (1)
100byte[] fileContent = File.ReadAllBytes(Path.Combine(outputDirectory, TestProjectName + ".exe"));
GivenThatWeWantToPublishASingleFileApp.cs (21)
43private readonly string SmallNameDirWord = Path.Combine(SmallNameDir, "word").Replace('\\', '/'); // DirectoryInfoAssertions normalizes Path-Separator. 44private readonly string LargeNameDirWord = Path.Combine(SmallNameDir, LargeNameDir, ".word").Replace('\\', '/'); 69string longDirPath = Path.Combine(testAsset.TestRoot, SmallNameDir, LargeNameDir); 71using (var writer = File.CreateText(Path.Combine(longDirPath, ".word"))) 105var singleFilePath = Path.Combine(GetPublishDirectory(cmd).FullName, $"SingleFileTest{Constants.ExeSuffix}"); 328var singleFilePath = Path.Combine(publishDir, $"{testProject.Name}{Constants.ExeSuffix}"); 445var mainProjectDll = Path.Combine(intermediateDirectory.FullName, $"{TestProjectName}.dll"); 522var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand).FullName, SingleFile); 567string singleFilePath = Path.Combine( 583var appHostPath = Path.Combine(GetPublishDirectory(publishCommand).FullName, SingleFile); 607var appHostPath = Path.Combine(GetPublishDirectory(publishCommand).FullName, SingleFile); 636var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 656var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 672var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 827var singleFilePath = Path.Combine(publishDir, $"{testProject.Name}{Constants.ExeSuffix}"); 857Path.Combine(ciOutputRoot, "binlog", helixGuid, $"{nameof(It_can_disable_cetcompat)}_{cetCompat?.ToString() ?? "null"}.binlog") : 870string singleFilePath = Path.Combine(publishDir.FullName, $"{testProject.Name}.exe"); 960var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand, ToolsetInfo.CurrentTargetFramework).FullName, $"SingleFileTest{Constants.ExeSuffix}"); 991var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand, ToolsetInfo.CurrentTargetFramework).FullName, $"SingleFileTest{Constants.ExeSuffix}"); 1025var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand, ToolsetInfo.CurrentTargetFramework).FullName, $"SingleFileTest{Constants.ExeSuffix}"); 1169var singleFilePath = Path.Combine(publishDir, testProject.Name);
GivenThatWeWantToPublishAToolProject.cs (1)
56Path.Combine(ciOutputRoot, "binlog", $"{nameof(It_can_publish_selfcontained_and_has_apphost)}.binlog") :
GivenThatWeWantToPublishAWebApp.cs (4)
101new RunExeCommand(Log, Path.Combine(output.FullName, $"{testProject.Name}{Constants.ExeSuffix}")) 185var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name); 186var publishProfilesDirectory = Path.Combine(projectDirectory, "Properties", "PublishProfiles"); 189File.WriteAllText(Path.Combine(publishProfilesDirectory, "test.pubxml"), $@"
GivenThatWeWantToPublishIncrementally.cs (25)
43File.WriteAllText(Path.Combine(publishDir, "UserData.txt"), string.Empty); 66Path.Combine(ciOutputRoot, "binlog", helixGuid, $"{nameof(It_cleans_between_renames)}.binlog") : 81File.WriteAllText(Path.Combine(publishDir, "UserData.txt"), string.Empty); 82File.WriteAllText(Path.Combine(publishDir, testProject.Name + ".deps.json"), string.Empty); 86File.Move(Path.Combine(testAsset.TestRoot, testProject.Name, testProject.Name + ".csproj"), 87Path.Combine(testAsset.TestRoot, testProject.Name, newName + ".csproj")); 111Path.Combine(ciOutputRoot, "binlog", helixGuid, $"{nameof(It_cleans_between_single_file_publishes)}.binlog") : 127File.WriteAllText(Path.Combine(publishDir, testProject.Name + ".dll"), string.Empty); 167File.WriteAllText(Path.Combine(publishDir, "UserData.txt"), string.Empty); 197new PublishCommand(Log, Path.Combine(testDir.Path, assetName)) 201var publishDir = Path.Combine(Directory.GetDirectories(Path.Combine(testDir.Path, assetName, "bin", "Debug")).FirstOrDefault(), runtimeId, "publish"); 203Directory.Exists(Path.Combine(publishDir, "wwwroot")); 205File.WriteAllText(Path.Combine(publishDir, "UserData.txt"), string.Empty); 208new PublishCommand(Log, Path.Combine(testDir.Path, assetName)) 213Directory.Exists(Path.Combine(publishDir, "wwwroot")); 229var publishDir = Path.Combine(testAsset.TestRoot, testProject.Name, publishOutputFolder); 241File.WriteAllText(Path.Combine(publishDir, "UserData.txt"), string.Empty); 265var publishDir1 = Path.Combine(testAsset.TestRoot, testProject.Name, publishOutputFolder1); 266var publishDir2 = Path.Combine(testAsset.TestRoot, testProject.Name, publishOutputFolder2); 289File.Move(Path.Combine(testAsset.TestRoot, testProject.Name, testProject.Name + ".csproj"), 290Path.Combine(testAsset.TestRoot, testProject.Name, newName + ".csproj")); 318var depsJsonPath = Path.Combine(publishDir, testProject.Name + ".deps.json"); 337new FileInfo(Path.Combine(publishDir, expectedFile)).Should().Exist(); 344new FileInfo(Path.Combine(publishDir, unexpectedFile)).Should().NotExist();
GivenThatWeWantToPublishReadyToRun.cs (14)
50DoesImageHaveR2RInfo(Path.Combine(publishDirectory.FullName, $"{projectName}.dll")).Should().BeFalse(); 51DoesImageHaveR2RInfo(Path.Combine(publishDirectory.FullName, "ClassLib.dll")).Should().BeFalse(); 81var mainProjectDll = Path.Combine(publishDirectory.FullName, $"{projectName}.dll"); 82var classLibDll = Path.Combine(publishDirectory.FullName, $"ClassLib.dll"); 258var publishCommand = new PublishCommand(Log, Path.Combine(testProjectInstance.Path, testProject.Name)); 388var mainProjectDll = Path.Combine(publishDirectory.FullName, $"{projectName}.dll"); 389var classLibDll = Path.Combine(publishDirectory.FullName, $"ClassLib.dll"); 407pdbFiles = new[] { GetPDBFileName(Path.ChangeExtension(mainProjectDll, "r2r.dll"), framework, testProject.RuntimeIdentifier) }; 470return Path.GetFileName(Path.ChangeExtension(assemblyFile, "ni.pdb")); 476return Path.GetFileName(Path.ChangeExtension(assemblyFile, "ni.r2rmap")); 486return Path.GetFileName(Path.ChangeExtension(assemblyFile, "ni.{" + mvid + "}.map"));
GivenThatWeWantToPublishToClickOnce.cs (3)
35var projectDirectory = Path.Combine(testProjectInstance.Path, testProject.Name); 36var publishProfilesDirectory = Path.Combine(projectDirectory, "Properties", "PublishProfiles"); 50File.WriteAllText(Path.Combine(publishProfilesDirectory, "test.pubxml"), $@"
GivenThatWeWantToPublishTrimmedWindowsFormsAndWPFApps.cs (28)
126var project = XDocument.Load(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")); 134string mainWindowXamlCsPath = Path.Combine(testDir.Path, "Form1.cs"); 153var publishDirectory = OutputPathCalculator.FromProject(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")).GetPublishDirectory( 159var wpfPresentationCoreDll = Path.Combine(publishDirectory, "PresentationCore.dll"); 160var wpfPresentationFxDll = Path.Combine(publishDirectory, "PresentationFramework.dll"); 161var winFormsDll = Path.Combine(publishDirectory, "System.Windows.Forms.dll"); 162var accessibilitysDll = Path.Combine(publishDirectory, "Accessibility.dll"); 172FileName = Path.Combine(publishDirectory, Path.GetFileName(testDir.Path) + ".exe") 175runAppCommand.Environment["DOTNET_ROOT"] = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath); 198var project = XDocument.Load(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")); 206string mainWindowXamlCsPath = Path.Combine(testDir.Path, "MainWindow.xaml.cs"); 225var publishDirectory = OutputPathCalculator.FromProject(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")).GetPublishDirectory( 231var wpfPresentationCoreDll = Path.Combine(publishDirectory, "PresentationCore.dll"); 232var wpfPresentationFxDll = Path.Combine(publishDirectory, "PresentationFramework.dll"); 233var winFormsDll = Path.Combine(publishDirectory, "System.Windows.Forms.dll"); 234var accessibilitysDll = Path.Combine(publishDirectory, "Accessibility.dll"); 244FileName = Path.Combine(publishDirectory, Path.GetFileName(testDir.Path) + ".exe") 247runAppCommand.Environment["DOTNET_ROOT"] = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath); 278var wpfPresentationCoreDll = Path.Combine(publishDirectory, "PresentationCore.dll"); 279var wpfPresentationFxDll = Path.Combine(publishDirectory, "PresentationFramework.dll"); 280var winFormsDll = Path.Combine(publishDirectory, "System.Windows.Forms.dll"); 281var accessibilitysDll = Path.Combine(publishDirectory, "Accessibility.dll");
GivenThatWeWantToPublishWithoutConflicts.cs (2)
32var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), targetFramework, "ResolvedFileToPublish", GetValuesCommand.ValueType.Item) 71var getValuesCommand = new GetValuesCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name), targetFramework, "ResolvedFileToPublish", GetValuesCommand.ValueType.Item)
GivenThatWeWantToRunILLink.cs (94)
50var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 54var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 55var unusedDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 56var unusedFrameworkDll = Path.Combine(publishDirectory, $"{UnusedFrameworkAssembly}.dll"); 63var depsFile = Path.Combine(publishDirectory, $"{projectName}.deps.json"); 89var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 93var linkedDll = Path.Combine(linkedDirectory, $"{projectName}.dll"); 94var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 95var unusedDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 96var unusedFrameworkDll = Path.Combine(publishDirectory, $"{UnusedFrameworkAssembly}.dll"); 104var depsFile = Path.Combine(publishDirectory, $"{projectName}.deps.json"); 132var exe = Path.Combine(publishDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}"); 285var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 286var unusedIsTrimmableDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 311var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 312var unusedTrimModeLinkDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 350var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 351var isTrimmableDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 386var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 410var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 411var unusedTrimmableDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 440var unusedTrimmableDll = Path.Combine(publishDirectory, "UnusedTrimmableAssembly.dll"); 441var unusedNonTrimmableDll = Path.Combine(publishDirectory, "UnusedNonTrimmableAssembly.dll"); 475var unusedTrimmableDll = Path.Combine(publishDirectory, "UnusedTrimmableAssembly.dll"); 476var unusedNonTrimmableDll = Path.Combine(publishDirectory, "UnusedNonTrimmableAssembly.dll"); 499var trimmableDll = Path.Combine(publishDirectory, "TrimmableAssembly.dll"); 500var nonTrimmableDll = Path.Combine(publishDirectory, "NonTrimmableAssembly.dll"); 501var unusedTrimmableDll = Path.Combine(publishDirectory, "UnusedTrimmableAssembly.dll"); 502var unusedNonTrimmableDll = Path.Combine(publishDirectory, "UnusedNonTrimmableAssembly.dll"); 529var trimmableDll = Path.Combine(publishDirectory, "TrimmableAssembly.dll"); 530var nonTrimmableDll = Path.Combine(publishDirectory, "NonTrimmableAssembly.dll"); 531var unusedTrimmableDll = Path.Combine(publishDirectory, "UnusedTrimmableAssembly.dll"); 532var unusedNonTrimmableDll = Path.Combine(publishDirectory, "UnusedNonTrimmableAssembly.dll"); 569var trimmableDll = Path.Combine(publishDirectory, "TrimmableAssembly.dll"); 570var nonTrimmableDll = Path.Combine(publishDirectory, "NonTrimmableAssembly.dll"); 571var unusedTrimmableDll = Path.Combine(publishDirectory, "UnusedTrimmableAssembly.dll"); 572var unusedNonTrimmableDll = Path.Combine(publishDirectory, "UnusedNonTrimmableAssembly.dll"); 819var intermediateLinkDir = Path.Combine(intermediateDirectory, "linked"); 821var linkSemaphore = Path.Combine(intermediateLinkDir, "Link.semaphore"); 822var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 890var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 988var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 1008var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 1025var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 1048string runtimeConfigFile = Path.Combine(outputDirectory, $"{projectName}.runtimeconfig.json"); 1131var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 1132var unusedDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 1188var referenceDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 1222var referenceDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 1246var intermediateLinkDir = Path.Combine(intermediateDirectory, "linked"); 1248var linkSemaphore = Path.Combine(intermediateLinkDir, "Link.semaphore"); 1280var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1284var linkedDll = Path.Combine(linkedDirectory, $"{projectName}.dll"); 1285var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 1286var unusedDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 1287var unusedFrameworkDll = Path.Combine(publishDirectory, $"{UnusedFrameworkAssembly}.dll"); 1294var depsFile = Path.Combine(publishDirectory, $"{projectName}.deps.json"); 1317var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1321var linkedDll = Path.Combine(linkedDirectory, $"{projectName}.dll"); 1322var publishedDll = Path.Combine(publishDirectory, $"{projectName}.dll"); 1323var unusedDll = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 1324var unusedFrameworkDll = Path.Combine(publishDirectory, $"{UnusedFrameworkAssembly}.dll"); 1331var depsFile = Path.Combine(publishDirectory, $"{projectName}.deps.json"); 1355var intermediateLinkDir = Path.Combine(intermediateDirectory, "linked"); 1356var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1358var linkSemaphore = Path.Combine(intermediateLinkDir, "Link.semaphore"); 1364var publishedDllKeptFirstTimeOnly = Path.Combine(publishDirectory, $"{referenceProjectName}.dll"); 1365var linkedDllKeptFirstTimeOnly = Path.Combine(linkedDirectory, $"{referenceProjectName}.dll"); 1388Directory.Exists(Path.Combine(publishDirectory, "linked")).Should().BeFalse(); 1409var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1411var intermediatePdb = Path.Combine(intermediateDirectory, $"{projectName}.pdb"); 1412var linkedPdb = Path.Combine(linkedDirectory, $"{projectName}.pdb"); 1413var publishedPdb = Path.Combine(publishDirectory, $"{projectName}.pdb"); 1447var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1449var intermediatePdb = Path.Combine(intermediateDirectory, $"{projectName}.pdb"); 1450var linkedPdb = Path.Combine(linkedDirectory, $"{projectName}.pdb"); 1451var publishedPdb = Path.Combine(publishDirectory, $"{projectName}.pdb"); 1484var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1486var intermediatePdb = Path.Combine(intermediateDirectory, $"{projectName}.pdb"); 1487var linkedPdb = Path.Combine(linkedDirectory, $"{projectName}.pdb"); 1488var publishedPdb = Path.Combine(publishDirectory, $"{projectName}.pdb"); 1514var linkedDirectory = Path.Combine(intermediateDirectory, "linked"); 1516var intermediatePdb = Path.Combine(intermediateDirectory, $"{projectName}.pdb"); 1517var linkedPdb = Path.Combine(linkedDirectory, $"{projectName}.pdb"); 1518var publishedPdb = Path.Combine(publishDirectory, $"{projectName}.pdb"); 1785var assemblyPath = Path.Combine(outputDirectory, $"{projectName}.dll"); 1786var runtimeConfigPath = Path.Combine(outputDirectory, $"{projectName}.runtimeconfig.json"); 1819var assemblyPath = Path.Combine(outputDirectory, $"{projectName}.dll"); 1820var runtimeConfigPath = Path.Combine(outputDirectory, $"{projectName}.runtimeconfig.json"); 1868Path.GetFileName(f) == $"{assemblyName}.dll"))); 2312var illinkVersion = Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(illinkTargetsPath))); 2359Assembly assembly = mlc.LoadFromAssemblyPath(Path.Combine(publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName, "System.Private.CoreLib.dll"));
GivenThatWeWantToStoreAProjectWithDependencies.cs (20)
63var OutputFolder = Path.Combine(simpleDependenciesAsset.TestRoot, "outdir"); 64var WorkingDir = Path.Combine(simpleDependenciesAsset.TestRoot, "w"); 93var OutputFolder = Path.Combine(simpleDependenciesAsset.TestRoot, "outdir"); 94var WorkingDir = Path.Combine(simpleDependenciesAsset.TestRoot, "w"); 98binlogPath = Path.Combine(uploadRoot, "compose_dependencies_noopt().binlog"); 139var OutputFolder = Path.Combine(simpleDependenciesAsset.TestRoot, "o"); 140var WorkingDir = Path.Combine(simpleDependenciesAsset.TestRoot, "w"); 141var additionalproj1 = Path.Combine(simpleDependenciesAsset.TestRoot, "NewtonsoftMultipleVersions.xml"); 142var additionalproj2 = Path.Combine(simpleDependenciesAsset.TestRoot, "FluentAssertion.xml"); 170var artifact = Path.Combine(OutputFolder, "artifact.xml"); 188var outputFolder = Path.Combine(targetManifestsAsset.TestRoot, "o"); 189var workingDir = Path.Combine(targetManifestsAsset.TestRoot, "w"); 196var artifactFile = Path.Combine(outputFolder, "artifact.xml"); 222var outputFolder = Path.Combine(targetManifestsAsset.TestRoot, "o"); 223var workingDir = Path.Combine(targetManifestsAsset.TestRoot, "w"); 246var symbolsFolder = new DirectoryInfo(Path.Combine(outputFolder, "symbols")); 283var outputFolder = Path.Combine(testProjectInstance.TestRoot, "o"); 284var workingDir = Path.Combine(testProjectInstance.TestRoot, "w"); 314var outputFolder = Path.Combine(targetManifestsAsset.TestRoot, "o"); 315var workingDir = Path.Combine(targetManifestsAsset.TestRoot, "w");
GivenThatWeWantToTestAMultitargetedSolutionWithPublishReleaseOrPackRelease.cs (1)
363.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name))
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
PublishDepsFilePathTests.cs (2)
20var projectPath = Path.Combine(testAsset.Path, testProject.Name); 42var projectPath = Path.Combine(testAsset.Path, testProject.Name);
PublishItemsOutputGroupOutputsTests.cs (4)
56Path.Combine(testAsset.Path, testProject.Name), 70OutputPath = Path.GetFileName(Path.GetFullPath(Path.Combine(testAsset.Path, testProject.Name, item.metadata["OutputPath"])))
PublishItemsOutputGroupTests.cs (2)
40Path.Combine(testAsset.Path, testProject.Name), 110var publishDir = new DirectoryInfo(Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, "win-x86", "publish"));
PublishWebApp.cs (2)
51FileName = Path.Combine(publishDirectory.FullName, testProject.Name + EnvironmentInfo.ExecutableExtension) 54runAppCommand.Environment["DOTNET_ROOT"] = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath);
PublishWpfApp.cs (8)
26var project = XDocument.Load(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")); 34string mainWindowXamlCsPath = Path.Combine(testDir.Path, "MainWindow.xaml.cs"); 53var publishDirectory = OutputPathCalculator.FromProject(Path.Combine(testDir.Path, Path.GetFileName(testDir.Path) + ".csproj")).GetPublishDirectory( 59FileName = Path.Combine(publishDirectory, Path.GetFileName(testDir.Path) + ".exe") 62runAppCommand.Environment["DOTNET_ROOT"] = Path.GetDirectoryName(TestContext.Current.ToolsetUnderTest.DotNetHostPath);
RuntimeIdentifiersTests.cs (8)
64string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); 106string selfContainedExecutableFullPath = Path.Combine(buildCommand.GetOutputDirectory(runtimeIdentifier: runtimeIdentifier).FullName, selfContainedExecutable); 173string selfContainedExecutableFullPath = Path.Combine(outputDirectory.FullName, selfContainedExecutable); 217.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, testProject.Name)) 248.WithWorkingDirectory(Path.Combine(testAsset.TestRoot, MethodBase.GetCurrentMethod().Name)) 283var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 329var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 379var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name));
Microsoft.NET.Rebuild.Tests (2)
GivenThatWeWantToRebuildAProject.cs (1)
23var lockFilePath = Path.Combine(testAsset.TestRoot, "obj", "project.assets.json");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.NET.Restore.Tests (31)
GivenThatWeWantAutomaticTargetingPackReferences.cs (4)
36string projectAssetsJsonPath = Path.Combine( 89string projectAssetsJsonPath = Path.Combine( 156string projectAssetsJsonPath = Path.Combine( 198string projectAssetsJsonPath = Path.Combine(
GivenThatWeWantRestoreToUseImplicitPackages.cs (2)
31string projectAssetsJsonPath = Path.Combine( 65string projectAssetsJsonPath = Path.Combine(
GivenThatWeWantToIgnoreObsoleteDotNetCliToolPackages.cs (1)
47string toolAssetsFilePath = Path.Combine(TestContext.Current.NuGetCachePath, ".tools", toolProject.Name.ToLowerInvariant(), "99.99.99", toolProject.TargetFrameworks, "project.assets.json");
GivenThatWeWantToRestoreDotNetCliToolReference.cs (5)
34var packCommand = new PackCommand(Log, Path.Combine(toolProjectInstance.TestRoot, toolProject.Name)); 37string nupkgPath = Path.Combine(packCommand.ProjectRootPath, "bin", "Debug"); 53DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, toolProject.Name.ToLowerInvariant())); 54DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, ".tools", toolProject.Name.ToLowerInvariant())); 63var assetsJsonPath = Path.Combine(TestContext.Current.NuGetCachePath,
GivenThatWeWantToRestoreProjectsUsingNuGetConfigProperties.cs (5)
37var packagesFolder = Path.Combine(TestContext.Current.TestExecutionDirectory, "packages", testProjectName); 42File.Exists(Path.Combine( 144var dependencyProjectDirectory = Path.Combine( 153Path.Combine(TestContext.Current.NuGetFallbackFolder, $"{projectInNuGetFallbackFolder.Name}.1.0.0.nupkg")); 156DeleteFolder(Path.Combine(TestContext.Current.NuGetCachePath, projectInNuGetFallbackFolder.Name.ToLowerInvariant()));
GivenThatWeWantToRestoreProjectsWithPackageDowngrades.cs (2)
27var packagesFolder = Path.Combine(TestContext.Current.TestExecutionDirectory, "packages", testProjectName); 58var packagesFolder = Path.Combine(TestContext.Current.TestExecutionDirectory, "packages", testProjectName);
GivenThatWeWantToUseFrameworkRoslyn.cs (11)
31var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages"); 37var toolsetPackageDir = Path.Combine(customPackagesDir, "microsoft.net.sdk.compilers.toolset"); 46.HaveStdOutContaining(Path.Combine(toolsetPackageDir, toolsetPackageVersion, "csc.exe") + " /noconfig"); 70var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages"); 76var toolsetPackageDir = Path.Combine(customPackagesDir, "microsoft.net.sdk.compilers.toolset"); 85.HaveStdOutContaining(Path.Combine(toolsetPackageDir, toolsetPackageVersion, "csc.exe") + " /noconfig"); 125var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages"); 158var customPackagesDir = Path.Combine(testAsset.Path, "nuget-packages"); 168var toolsetPackageDir = Path.Combine(customPackagesDir, "microsoft.net.sdk.compilers.toolset"); 183WorkingDirectory = Path.Combine(testAsset.Path, "FxWpf") 191Assert.True(File.Exists(Path.Combine(testAsset.Path, "obj", "net472", "MainWindow.g.cs")));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.Net.Sdk.AnalyzerRedirecting (9)
SdkAnalyzerAssemblyRedirector.cs (9)
28: this(Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"..\..\DotNetRuntimeAnalyzers"))) { } 58string version = Path.GetFileName(versionDirectory); 59string analyzerName = Path.GetFileNameWithoutExtension(analyzerPath); 61pathSuffix = Path.GetDirectoryName(pathSuffix); 82if (_analyzerMap.TryGetValue(Path.GetFileNameWithoutExtension(fullPath), out var analyzers)) 86var directoryPath = Path.GetDirectoryName(fullPath); 115string directoryPathVersion = Path.GetFileName(Path.GetDirectoryName(directoryPath.Substring(0, index)));
Microsoft.Net.Sdk.AnalyzerRedirecting.Tests (5)
SdkAnalyzerAssemblyRedirectorTests.cs (5)
18var vsDir = Path.Combine(testDir.Path, "vs"); 32var vsDir = Path.Combine(testDir.Path, "vs"); 52var vsDir = Path.Combine(testDir.Path, "vs"); 63var dllPath = Path.Combine(root, subdir, $"{name}.dll"); 64Directory.CreateDirectory(Path.GetDirectoryName(dllPath));
Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests (23)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
ServiceWorkerAssert.cs (7)
21var serviceWorkerResolvedPath = Path.Combine(testAsset.TestRoot, outputDirectory, staticWebAssetsBasePath, serviceWorkerPath); 22var assetsManifestResolvedPath = Path.Combine(testAsset.TestRoot, outputDirectory, staticWebAssetsBasePath, assetsManifestPath); 32var resolvedPublishDirectory = Path.Combine(testAsset.TestRoot, outputDirectory); 37var relativePath = Path.GetRelativePath(resolvedPublishDirectory, filePath); 42|| string.Equals(relativePath, Path.Combine(staticWebAssetsBasePath, serviceWorkerPath), StringComparison.Ordinal) 43|| string.Equals(relativePath, Path.Combine(staticWebAssetsBasePath, assetsManifestPath), StringComparison.Ordinal) 65switch (Path.GetExtension(path))
WasmAoTPublishIntegrationTest.cs (11)
29File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 36var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 56new FileInfo(Path.Combine(blazorPublishDirectory, "css", "app.css")).Should().Contain(".publish"); 73File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "web.config"), webConfigContents); 95if (Path.GetFileName(p) == "blazorwasm.csproj") 103File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 114var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 117new FileInfo(Path.Combine(publishDirectory.ToString(), "blazorhosted.dll")).Should().Exist(); 169VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 182serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 195if (projectsToAoT.Contains(Path.GetFileNameWithoutExtension(project)))
WasmPublishIntegrationTestBase.cs (4)
16var bootManifestResolvedPath = Path.Combine(blazorPublishDirectory, "_framework", WasmBootConfigFileName); 55? Path.Combine(blazorPublishDirectory, "_framework", prefix, name) 56: Path.Combine(blazorPublishDirectory, "_framework", name); 57new FileInfo(Path.Combine(testAsset.TestRoot, relativePath)).Should().HashEquals(ParseWebFormattedHash(hash));
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (14)
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 (1)
35var outputRelativePath = Path.Combine(
StaticWebAsset.cs (7)
566return Path.Combine(normalizedPrefix, computedBasePath, route) 746RelatedAsset = !string.IsNullOrEmpty(RelatedAsset) ? Path.GetFullPath(RelatedAsset) : RelatedAsset; 754=> Path.GetFullPath(path) + 756(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch 760(false, false) => Path.DirectorySeparatorChar 1070var pathWithTokens = Path.Combine(prefix, computedBasePath, RelativePath)
UpgradeLegacyWasmStaticWebAssets.cs (1)
34if (string.Equals(Path.GetExtension(legacyAsset.RelativePath), ".gz", StringComparison.Ordinal))
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (436)
AspNetSdkBaselineTest.cs (15)
71Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.StaticWebAssets.Tests", "StaticWebAssetsBaselines"); 111var wwwRootFolder = Path.Combine(outputFolder, "wwwroot"); 128!a.HasContentRoot(Path.Combine(outputFolder, "wwwroot")) && 130!File.Exists(Path.Combine(a.ContentRoot, a.RelativePath)) && 134.Select(a => Path.GetFullPath(Path.Combine(outputFolder, "wwwroot", a.RelativePath))) 136.Select(a => Path.GetFullPath(Path.Combine(a.ContentRoot, a.RelativePath)))) 216string wwwRootFolder = Path.Combine(publishFolder, "wwwroot"); 234.Select(a => Path.Combine(wwwRootFolder, a.ComputeTargetPath("", Path.DirectorySeparatorChar))); 298if (!Directory.Exists(Path.Combine(BaselinesFolder))) 300Directory.CreateDirectory(Path.Combine(BaselinesFolder)); 308=> Path.Combine(BaselinesFolder, $"{name}{(!string.IsNullOrEmpty(suffix) ? $"_{suffix}" : "")}.{manifestType}.staticwebassets.json"); 315=> Path.Combine(BaselinesFolder, $"{name}{(!string.IsNullOrEmpty(suffix) ? $"_{suffix}" : "")}.{manifestType}.files.json");
BlazorLegacyIntegrationTest50.cs (16)
24var clientBuildOutputDirectory = Path.Combine(testInstance.Path, "Client", "bin", "Debug", targetFramework); 26new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json")).Should().Exist(); 27new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 28new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm")).Should().Exist(); 29new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "dotnet.timezones.blat")).Should().Exist(); 30new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm.gz")).Should().Exist(); 31new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", $"{testAsset}.Client.dll")).Should().Exist(); 33var serverBuildOutputDirectory = Path.Combine(testInstance.Path, "Server", "bin", "Debug", targetFramework); 34new FileInfo(Path.Combine(serverBuildOutputDirectory, $"{testAsset}.Server.dll")).Should().Exist(); 35new FileInfo(Path.Combine(serverBuildOutputDirectory, $"{testAsset}.Client.dll")).Should().Exist(); 36new FileInfo(Path.Combine(serverBuildOutputDirectory, $"{testAsset}.Shared.dll")).Should().Exist(); 39var serverIntermediateDirectory = Path.Combine(testInstance.Path, "Server", "obj", "Debug", targetFramework, "staticwebassets"); 40var fileInfo = new FileInfo(Path.Combine(serverIntermediateDirectory, $"{testAsset}.Server.StaticWebAssets.xml")); 43content.Should().Contain(Path.Combine("Client", "bin", "Debug", targetFramework, "wwwroot")); 44content.Should().Contain(Path.Combine("Client", "obj", "Debug", targetFramework, "scopedcss")); 45content.Should().Contain(Path.Combine("Client", "wwwroot"));
BlazorLegacyIntegrationTest60.cs (13)
17Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.BlazorWebAssembly.Tests", "StaticWebAssetsBaselines"); 32var clientBuildOutputDirectory = Path.Combine(testInstance.Path, "Client", "bin", "Debug", targetFramework); 34new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json")).Should().Exist(); 35new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 36new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm")).Should().Exist(); 37new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "dotnet.timezones.blat")).Should().Exist(); 38new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm.gz")).Should().Exist(); 39new FileInfo(Path.Combine(clientBuildOutputDirectory, "wwwroot", "_framework", $"{testAsset}.Client.dll")).Should().Exist(); 41var serverBuildOutputDirectory = Path.Combine(testInstance.Path, "Server", "bin", "Debug", targetFramework); 42new FileInfo(Path.Combine(serverBuildOutputDirectory, $"{testAsset}.Server.dll")).Should().Exist(); 43new FileInfo(Path.Combine(serverBuildOutputDirectory, $"{testAsset}.Client.dll")).Should().Exist(); 44new FileInfo(Path.Combine(serverBuildOutputDirectory, $"{testAsset}.Shared.dll")).Should().Exist(); 85var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json");
BlazorReadSatelliteAssemblyFileTest.cs (3)
16var tempFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
BlazorWasmBaselineTests.cs (1)
13Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.BlazorWebAssembly.Tests", "StaticWebAssetsBaselines");
BlazorWasmStaticWebAssetsIntegrationTest.cs (26)
27File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "App.razor.css"), "h1 { font-size: 16px; }"); 28File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "appsettings.development.json"), "{}"); 39var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 45var finalPath = Path.Combine(outputPath, "blazorwasm-minimal.staticwebassets.runtime.json"); 69File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "App.razor.css"), "h1 { font-size: 16px; }"); 70File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "appsettings.development.json"), "{}"); 80var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 99if (Path.GetFileName(p) == "blazorwasm.csproj") 116var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 122var finalPath = Path.Combine(outputPath, "blazorhosted.staticwebassets.runtime.json"); 139if (Path.GetFileName(p) == "blazorwasm.csproj") 150File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 160var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 179if (Path.GetFileName(p) == "blazorwasm.csproj") 190File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 200var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 220if (Path.GetFileNameWithoutExtension(project) == "blazorwasm") 224if (Path.GetFileNameWithoutExtension(project) == "RazorClassLibrary") 229if (Path.GetFileNameWithoutExtension(project) == "classlibrarywithsatelliteassemblies") 244var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 251var finalPath = Path.Combine(outputPath, "blazorhosted.staticwebassets.runtime.json"); 271if (Path.GetFileNameWithoutExtension(project) == "blazorwasm") 275if (Path.GetFileNameWithoutExtension(project) == "RazorClassLibrary") 280if (Path.GetFileNameWithoutExtension(project) == "classlibrarywithsatelliteassemblies") 289File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 299var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json");
IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs (2)
15_cachePath = Path.GetFullPath(Path.Combine(TestContext.Current.TestExecutionDirectory, Shorten(restoreNugetPackagePath)));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
ServiceWorkerAssert.cs (7)
21var serviceWorkerResolvedPath = Path.Combine(testAsset.TestRoot, outputDirectory, staticWebAssetsBasePath, serviceWorkerPath); 22var assetsManifestResolvedPath = Path.Combine(testAsset.TestRoot, outputDirectory, staticWebAssetsBasePath, assetsManifestPath); 32var resolvedPublishDirectory = Path.Combine(testAsset.TestRoot, outputDirectory); 37var relativePath = Path.GetRelativePath(resolvedPublishDirectory, filePath); 42|| string.Equals(relativePath, Path.Combine(staticWebAssetsBasePath, serviceWorkerPath), StringComparison.Ordinal) 43|| string.Equals(relativePath, Path.Combine(staticWebAssetsBasePath, assetsManifestPath), StringComparison.Ordinal) 65switch (Path.GetExtension(path))
StaticWebAssetsBaselineComparer.cs (2)
318return Path.GetExtension(asset.Identity.TrimEnd(']')); 506return Path.GetExtension(asset.AssetFile.TrimEnd(']'));
StaticWebAssetsBaselineFactory.cs (26)
90var basePath = asset.BasePath.Replace('/', Path.DirectorySeparatorChar).TrimStart(Path.DirectorySeparatorChar); 91var relativePath = asset.RelativePath.Replace('/', Path.DirectorySeparatorChar); 92var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 93var originalItemSpec = asset.OriginalItemSpec.Replace('\\', Path.DirectorySeparatorChar); 95asset.Identity = Path.Combine(Path.GetDirectoryName(identity), basePath, relativePath); 96asset.Identity = asset.Identity.Replace(Path.DirectorySeparatorChar, '\\'); 101asset.OriginalItemSpec = Path.Combine(Path.GetDirectoryName(originalItemSpec), basePath, relativePath); 102asset.OriginalItemSpec = asset.OriginalItemSpec.Replace(Path.DirectorySeparatorChar, '\\'); 108var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 109var originalItemSpec = asset.OriginalItemSpec.Replace('\\', Path.DirectorySeparatorChar); 111asset.Identity = Path.Combine(Path.GetDirectoryName(identity), Path.GetFileName(originalItemSpec) + Path.GetExtension(identity)) 112.Replace(Path.DirectorySeparatorChar, '\\'); 192discovery.ContentRoot = discovery.ContentRoot.Replace(Path.DirectorySeparatorChar, '\\'); 194discovery.Name = discovery.Name.Replace(Path.DirectorySeparatorChar, '\\'); 195discovery.Pattern = discovery.Pattern.Replace(Path.DirectorySeparatorChar, '\\'); 200relatedManifest.Identity = relatedManifest.Identity.Replace(projectRoot, "${ProjectPath}").Replace(Path.DirectorySeparatorChar, '\\'); 319var directory = Path.GetDirectoryName(path); 320var fileName = Path.GetFileName(path); 326return Path.Combine(directory, fileName); 437return string.Join(Path.DirectorySeparatorChar, newSegments);
VanillaWasmTests.cs (5)
29var buildOutputDirectory = Path.Combine(testInstance.Path, "bin", "Debug", targetFramework); 31new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.js")).Should().Exist(); 32new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 33new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().NotExist(); 34new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist();
WasmBuildIncrementalismTest.cs (18)
30Path.Combine(buildOutputDirectory, "blazorwasm.runtimeconfig.json"), 31Path.Combine(buildOutputDirectory, "RazorClassLibrary.staticwebassets.endpoints.json"), 32Path.Combine(buildOutputDirectory, "blazorwasm.staticwebassets.endpoints.json") 64if (Path.GetFileNameWithoutExtension(path) == "blazorwasm") 77var gzipCompressionDirectory = Path.Combine(projectDirectory.TestRoot, "blazorwasm", "obj", "Debug", DefaultTfm, "compressed"); 114File.Move(Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resources.ja.resx.txt"), Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx")); 121var satelliteAssemblyFile = Path.Combine(build.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", "ja", "blazorwasm.resources.wasm"); 122var bootJson = Path.Combine(build.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", WasmBootConfigFileName); 182var satelliteAssemblyFile = Path.Combine(build.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", "ja", "blazorwasm.resources.wasm"); 183var bootJson = Path.Combine(build.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", WasmBootConfigFileName); 196File.Move(Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resources.ja.resx.txt"), Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx")); 226File.Move(Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resources.ja.resx.txt"), Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx")); 233var satelliteAssemblyFile = Path.Combine(build.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", "ja", "blazorwasm.resources.wasm"); 234var bootJson = Path.Combine(build.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", WasmBootConfigFileName); 253File.Delete(Path.Combine(projectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx"));
WasmBuildIntegrationTest.cs (104)
37File.WriteAllText(Path.Combine(testInstance.TestRoot, "App.razor.css"), "h1 { font-size: 16px; }"); 46new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 47new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 48new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 49new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm.gz")).Should().Exist(); 50new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm-minimal.wasm")).Should().Exist(); 75new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 76new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 77new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 78new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm.gz")).Should().Exist(); 79new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); 80new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm")).Should().Exist(); 81new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm.gz")).Should().Exist(); 82new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.wasm")).Should().Exist(); 83new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.wasm.gz")).Should().Exist(); 85new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.pdb")).Should().Exist(); 86new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.pdb")).Should().Exist(); 87new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.wasm")).Should().Exist(); 99if (Path.GetFileNameWithoutExtension(project) == "blazorwasm") 113Path.Combine("..", "razorclasslibrary", "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "RazorClassLibrary.dll"))); 127new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 128new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 129new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 130new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm.gz")).Should().Exist(); 131new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); 132new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm")).Should().Exist(); 133new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm.gz")).Should().Exist(); 134new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.wasm")).Should().Exist(); 135new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.wasm.gz")).Should().Exist(); 137new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.pdb")).Should().Exist(); 138new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.pdb")).Should().Exist(); 139new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.wasm")).Should().Exist(); 150if (Path.GetFileName(p) == "blazorwasm.csproj") 165new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 166new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 167new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 168new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm.gz")).Should().Exist(); 169new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); 170new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm")).Should().Exist(); 171new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm.gz")).Should().Exist(); 172new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.wasm")).Should().Exist(); 173new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "System.wasm.gz")).Should().Exist(); 175new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.pdb")).Should().Exist(); 176new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.pdb")).Should().Exist(); 177new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.wasm")).Should().Exist(); 188if (Path.GetFileName(p) == "blazorwasm.csproj") 197var wwwroot = Path.Combine(testInstance.TestRoot, "blazorwasm", "wwwroot"); 198File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); 199File.WriteAllText(Path.Combine(wwwroot, "appsettings.development.json"), "Development settings"); 207var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 235if (Path.GetFileName(p) == "blazorwasm.csproj") 244var wwwroot = Path.Combine(testInstance.TestRoot, "blazorwasm", "wwwroot"); 245File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); 246File.WriteAllText(Path.Combine(wwwroot, "appsettings.development.json"), "Development settings"); 254var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 293var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 299new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 300new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.timezones.blat")).Should().NotExist(); 325var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 333new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 334new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", fullIcuFilename)).Should().NotExist(); 337new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", shardFilename)).Should().NotExist(); 363var bootJsonPath = Path.Combine(publishOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 371new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 372new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", fullIcuFilename)).Should().NotExist(); 375new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", shardFilename)).Should().NotExist(); 401var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 414new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 415new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", customIcuFilename)).Should().Exist(); 416new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", fullIcuFilename)).Should().NotExist(); 419new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", shardFilename)).Should().NotExist(); 444var bootJsonPath = Path.Combine(publishDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 457new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 458new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", customIcuFilename)).Should().Exist(); 459new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", fullIcuFilename)).Should().NotExist(); 462new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", shardFilename)).Should().NotExist(); 488var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 500new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 501new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", fullIcuFilename)).Should().Exist(); 504new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", shardFilename)).Should().NotExist(); 530var bootJsonPath = Path.Combine(publishDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 542new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 543new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", fullIcuFilename)).Should().Exist(); 546new FileInfo(Path.Combine(publishDirectory, "wwwroot", "_framework", shardFilename)).Should().NotExist(); 562new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "_bin", "blazorwasm.wasm")).Should().NotExist(); 587var resxfileInProject = Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "Resources.ja.resx.txt"); 588File.Move(resxfileInProject, Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "Resource.ja.resx")); 597var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 603var finalPath = Path.Combine(outputPath, "blazorwasm.staticwebassets.runtime.json"); 611new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); 612new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.wasm")).Should().Exist(); 613new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "Microsoft.CodeAnalysis.CSharp.wasm")).Should().Exist(); 614new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", "fr", "Microsoft.CodeAnalysis.CSharp.resources.wasm")).Should().Exist(); 616var bootJsonPath = new FileInfo(Path.Combine(outputPath, "wwwroot", "_framework", WasmBootConfigFileName)); 652var referenceAssemblyPath = new FileInfo(Path.Combine( 684File.WriteAllText(Path.Combine(testInstance.Path, "razorclasslibrary", "TestReference.cs"), 696var fileInWwwroot = new FileInfo(Path.Combine(outputDirectory, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.wasm")); 705var nugetRestorePath = Path.Combine(testInstance.TestRoot, ".nuget"); 708.WithWorkingDirectory(Path.Combine(testInstance.TestRoot, "blazorhosted")) 713new DirectoryInfo(Path.Combine(nugetRestorePath, "microsoft.netcore.app.runtime.mono.linux-x64")) 735var referenceAssemblyPath = new FileInfo(Path.Combine( 764File.WriteAllText(Path.Combine(testInstance.Path, "blazorwasm", "TestReference.cs"), 776var fileInWwwroot = new FileInfo(Path.Combine(outputDirectory, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.wasm")); 835var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName);
WasmBuildLazyLoadTest.cs (5)
51var bootJson = ReadBootJsonData(Path.Combine(outputDirectory.ToString(), "wwwroot", "_framework", WasmBootConfigFileName)); 103var bootJson = ReadBootJsonData(Path.Combine(outputDirectory.ToString(), "wwwroot", "_framework", WasmBootConfigFileName)); 155var bootJson = ReadBootJsonData(Path.Combine(outputDirectory.ToString(), "wwwroot", "_framework", WasmBootConfigFileName)); 207var bootJson = ReadBootJsonData(Path.Combine(outputDirectory.ToString(), "wwwroot", "_framework", WasmBootConfigFileName)); 261var publishCommand = new PublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorwasm"));
WasmCompressionTests.cs (18)
20if (Path.GetFileName(p) == "blazorwasm.csproj") 35var mainAppDll = Path.Combine(blazorHostedPublishDirectory, "wwwroot", "_framework", "blazorwasm.wasm"); 37var mainAppCompressedDll = Path.Combine(blazorHostedPublishDirectory, "wwwroot", "_framework", "blazorwasm.wasm.br"); 40var blazorBootJson = Path.Combine(testInstance.TestRoot, publishCommand.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", WasmBootConfigFileName); 42var blazorBootJsonCompressed = Path.Combine(testInstance.TestRoot, publishCommand.GetOutputDirectory(DefaultTfm).ToString(), "wwwroot", "_framework", $"{WasmBootConfigFileName}.br"); 45var programFile = Path.Combine(testInstance.TestRoot, "blazorwasm", "Program.cs"); 50publishCommand = new PublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); 73if (Path.GetFileName(p) == "blazorwasm.csproj") 88var mainAppDll = Path.Combine(publishDirectory, "wwwroot", "_framework", "blazorwasm.wasm"); 91var mainAppCompressedDll = Path.Combine(publishDirectory, "wwwroot", "_framework", "blazorwasm.wasm.br"); 94var programFile = Path.Combine(testInstance.TestRoot, "blazorwasm", "Program.cs"); 99publishCommand = new PublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); 116var publishCommand = new PublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); 123var compressedFilesFolder = Path.Combine(testInstance.TestRoot, "blazorwasm", "obj", "Debug", DefaultTfm, "compressed", "publish"); 148var publishCommand = new PublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); 155var compressedFilesFolder = Path.Combine(testInstance.TestRoot, "blazorwasm", "obj", "Debug", DefaultTfm, "compressed", "publish"); 188var frameworkFilesPath = Path.Combine(publishOutputDirectory, "wwwroot", "_framework"); 193var extension = Path.GetExtension(file);
WasmJsModulesIntegrationTests.cs (36)
28File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Hello initializer')"); 37var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 42var blazorBootJson = new FileInfo(Path.Combine(intermediateOutputPath, WasmBootConfigFileName)); 52new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.modules.json")).Should().NotExist(); 63if (Path.GetFileName(p) == "blazorwasm.csproj") 72File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "wwwroot", "blazorwasm.lib.module.js"), "console.log('Hello initializer')"); 73File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "razorclasslibrary", "wwwroot", "razorclasslibrary.lib.module.js"), "console.log('Hello RCL initializer')"); 82var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 87var blazorBootJson = new FileInfo(Path.Combine(intermediateOutputPath.Replace("blazorhosted", "blazorwasm"), WasmBootConfigFileName)); 100new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorhosted.modules.json")).Should().NotExist(); 117File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Hello initializer')"); 126var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 131var blazorBootJson = new FileInfo(Path.Combine(intermediateOutputPath, $"publish.{WasmBootConfigFileName}")); 141new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.modules.json")).Should().NotExist(); 143var lib = new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.lib.module.js")); 166File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Publish initializer')"); 167File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.build.js"), "console.log('Build initializer')"); 190var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 195new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.modules.json")).Should().NotExist(); 196var lib = new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.lib.module.js")); 211File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "blazorwasm-minimal.lib.module.js"), "console.log('Hello initializer')"); 246var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 251var publishExtension = GetPublishExtension(Path.Combine(intermediateOutputPath, $"publish.{WasmBootConfigFileName}")); 252GetPublishExtensionEntriesCount(Path.Combine(intermediateOutputPath, $"publish.{WasmBootConfigFileName}")).Should().Be(1); 254new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.modules.json")).Should().NotExist(); 255var lib = new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm-minimal.lib.module.js")); 258var wwwrootPublishExtension = GetPublishExtension(Path.Combine(outputPath, "wwwroot", "_framework", WasmBootConfigFileName)); 261var extension = new FileInfo(Path.Combine(outputPath, "wwwroot", "_bin", "publish.extension.txt")); 276File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "blazorwasm", "wwwroot", "blazorwasm.lib.module.js"), "console.log('Hello initializer')"); 280if (Path.GetFileNameWithoutExtension(path) == "blazorwasm") 317var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 322var publishExtension = GetPublishExtension(Path.Combine(intermediateOutputPath.Replace("blazorhosted", "blazorwasm"), $"publish.{WasmBootConfigFileName}")); 324new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorhosted.modules.json")).Should().Exist(); 325var lib = new FileInfo(Path.Combine(outputPath, "wwwroot", "blazorwasm.lib.module.js")); 328var wwwrootPublishExtension = GetPublishExtension(Path.Combine(outputPath, "wwwroot", "_framework", WasmBootConfigFileName)); 331var extension = new FileInfo(Path.Combine(outputPath, "wwwroot", "_bin", "publish.extension.txt"));
WasmPublishIntegrationTest.cs (112)
50var content = File.ReadAllText(Path.Combine(publishDirectory.ToString(), "web.config")); 53VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 92var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 93var cssFile = new FileInfo(Path.Combine(blazorPublishDirectory, "css", "app.css")); 97new FileInfo(Path.Combine(publishDirectory.ToString(), "dist", "Fake-License.txt")); 101serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 124if (Path.GetFileNameWithoutExtension(project) == "blazorwasm") 135Path.Combine("..", "razorclasslibrary", "bin", "Debug", ToolsetInfo.CurrentTargetFramework, "RazorClassLibrary.dll"))); 148new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 149new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js")).Should().Exist(); 150new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 151new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm.gz")).Should().Exist(); 152new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); 153new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm")).Should().Exist(); 154new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "System.Text.Json.wasm.gz")).Should().Exist(); 155new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "System.Private.CoreLib.wasm")).Should().Exist(); 156new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "System.Private.CoreLib.wasm.gz")).Should().Exist(); 158new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.wasm")).Should().Exist(); 174File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 181var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 201new FileInfo(Path.Combine(blazorPublishDirectory, "css", "app.css")).Should().Contain(".publish"); 205serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 224File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 231var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 251new FileInfo(Path.Combine(blazorPublishDirectory, "css", "app.css")).Should().Contain(".publish"); 262File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "web.config"), webConfigContents); 295var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 316serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 368new DirectoryInfo(Path.Combine(publishDirectory.ToString(), "wwwroot")).Should().HaveDirectory("different-path"); 370var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot", "different-path"); 373var content = File.ReadAllText(Path.Combine(publishDirectory.ToString(), "web.config")); 379Path.Combine(publishDirectory.ToString(), "wwwroot"), 380serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 435new DirectoryInfo(Path.Combine(publishDirectory.ToString(), "wwwroot")).Should().HaveDirectory("different-path"); 437var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot", "different-path"); 444var original = Path.Combine(blazorPublishDirectory, "_framework", WasmBootConfigFileName); 445var compressed = Path.Combine(blazorPublishDirectory, "_framework", $"{WasmBootConfigFileName}.br"); 477var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 516serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 521var loggingAssemblyPath = Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.Extensions.Logging.Abstractions.wasm"); 561var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 569var bootJsonData = new FileInfo(Path.Combine(blazorPublishDirectory, "_framework", WasmBootConfigFileName)); 607var blazorPublishDirectory = Path.Combine(publishOutputDirectory.ToString(), "wwwroot"); 663serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 687var wwwroot = Path.Combine(testInstance.TestRoot, "blazorwasm", "wwwroot"); 688File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); 689File.WriteAllText(Path.Combine(wwwroot, "appsettings.development.json"), "Development settings"); 696var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName); 748var resxfileInProject = Path.Combine(testInstance.TestRoot, "blazorwasm", "Resources.ja.resx.txt"); 749File.Move(resxfileInProject, Path.Combine(testInstance.TestRoot, "blazorwasm", "Resource.ja.resx")); 756var bootJsonData = new FileInfo(Path.Combine(publishOutputDirectory.ToString(), "wwwroot", "_framework", WasmBootConfigFileName)); 801new FileInfo(Path.Combine(publishDirectory.ToString(), "blazorhosted.dll")).Should().Exist(); 847VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 866VerifyServiceWorkerFiles(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot"), 867serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 897new FileInfo(Path.Combine(publishDirectory.ToString(), "blazorhosted.dll")).Should().Exist(); 927VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 928VerifyServiceWorkerFiles(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot"), 929serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 962new FileInfo(Path.Combine(publishDirectory.ToString(), "blazorhosted.dll")).Should().Exist(); 1008VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 1019var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 1023serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 1045File.WriteAllText(Path.Combine(testInstance.TestRoot, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); 1056var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 1059new FileInfo(Path.Combine(publishDirectory.ToString(), "blazorhosted.dll")).Should().Exist(); 1111VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 1124serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 1162var resxfileInProject = Path.Combine(testInstance.TestRoot, "blazorwasm", "Resources.ja.resx.txt"); 1163File.Move(resxfileInProject, Path.Combine(testInstance.TestRoot, "blazorwasm", "Resource.ja.resx")); 1172var blazorPublishDirectory = Path.Combine(publishDirectory.ToString(), "wwwroot"); 1181var bootJsonData = new FileInfo(Path.Combine(blazorPublishDirectory, "_framework", WasmBootConfigFileName)); 1223if (Path.GetFileName(project) == "blazorhosted-rid.csproj") 1235if (Path.GetFileName(project) == "blazorwasm.csproj") 1243var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); 1245publishCommand.WithWorkingDirectory(Path.Combine(testInstance.TestRoot, "blazorhosted")); 1268var publishCommand = new DotnetPublishCommand(Log, Path.Combine(testInstance.TestRoot, "blazorhosted")); 1270publishCommand.WithWorkingDirectory(Path.Combine(testInstance.TestRoot, "blazorhosted")); 1356VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 1374VerifyServiceWorkerFiles(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot"), 1375serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 1438VerifyBootManifestHashes(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot")); 1456VerifyServiceWorkerFiles(testInstance, Path.Combine(publishDirectory.ToString(), "wwwroot"), 1457serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 1483var bootJsonPath = Path.Combine(publishOutputDirectory.ToString(), "wwwroot", "_framework", WasmBootConfigFileName); 1491new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 1492new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "icudt.dat")).Should().NotExist(); 1493new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat")).Should().NotExist(); 1494new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat")).Should().NotExist(); 1495new FileInfo(Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat")).Should().NotExist(); 1518new FileInfo(Path.Combine(publishOutputDirectory, "BlazorMultipleApps.Server.dll")).Should().Exist(); 1519new FileInfo(Path.Combine(publishOutputDirectory, "BlazorMultipleApps.FirstClient.dll")).Should().Exist(); 1520new FileInfo(Path.Combine(publishOutputDirectory, "BlazorMultipleApps.SecondClient.dll")).Should().Exist(); 1522var firstAppPublishDirectory = Path.Combine(publishOutputDirectory, "wwwroot", "FirstApp"); 1524var firstCss = Path.Combine(firstAppPublishDirectory, "css", "app.css"); 1528var firstBootJsonPath = Path.Combine(firstAppPublishDirectory, "_framework", WasmBootConfigFileName); 1537new FileInfo(Path.Combine(firstAppPublishDirectory, "_framework", "dotnet.native.wasm.br")).Should().Exist(); 1538new FileInfo(Path.Combine(firstAppPublishDirectory, "_framework", "BlazorMultipleApps.FirstClient.wasm.br")).Should().Exist(); 1539new FileInfo(Path.Combine(firstAppPublishDirectory, "_framework", "Newtonsoft.Json.wasm.br")).Should().Exist(); 1541var secondAppPublishDirectory = Path.Combine(publishOutputDirectory, "wwwroot", "SecondApp"); 1543var secondCss = Path.Combine(secondAppPublishDirectory, "css", "app.css"); 1547var secondBootJsonPath = Path.Combine(secondAppPublishDirectory, "_framework", WasmBootConfigFileName); 1553new FileInfo(Path.Combine(secondAppPublishDirectory, "_framework", "dotnet.native.wasm.br")).Should().Exist(); 1554new FileInfo(Path.Combine(secondAppPublishDirectory, "_framework", "BlazorMultipleApps.SecondClient.wasm.br")).Should().Exist(); 1555new FileInfo(Path.Combine(secondAppPublishDirectory, "_framework", "System.Private.CoreLib.wasm.br")).Should().Exist(); 1556new FileInfo(Path.Combine(secondAppPublishDirectory, "_framework", "Newtonsoft.Json.wasm.br")).Should().NotExist(); 1567var referenceAssemblyPath = new FileInfo(Path.Combine( 1599File.WriteAllText(Path.Combine(testInstance.Path, "razorclasslibrary", "TestReference.cs"), 1611var fileInWwwroot = new FileInfo(Path.Combine(outputDirectory, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.wasm")); 1627VerifyAssemblyHasTypes(Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.AspNetCore.Components.wasm"), new[] { 1666string output = Path.Combine(command.WorkingDirectory, "bin", configuration, targetFramework, runtimeIdentifier); 1669return new DirectoryInfo(Path.Combine(baseDirectory.FullName, "publish"));
WasmPublishIntegrationTestBase.cs (4)
16var bootManifestResolvedPath = Path.Combine(blazorPublishDirectory, "_framework", WasmBootConfigFileName); 55? Path.Combine(blazorPublishDirectory, "_framework", prefix, name) 56: Path.Combine(blazorPublishDirectory, "_framework", name); 57new FileInfo(Path.Combine(testAsset.TestRoot, relativePath)).Should().HashEquals(ParseWebFormattedHash(hash));
WasmPwaManifestTests.cs (22)
24if (Path.GetFileName(p) == "blazorwasm.csproj") 41new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", WasmBootConfigFileName)).Should().Exist(); 42new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "dotnet.native.wasm")).Should().Exist(); 43new FileInfo(Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.wasm")).Should().Exist(); 45var serviceWorkerAssetsManifest = Path.Combine(buildOutputDirectory, "wwwroot", "service-worker-assets.js"); 54entries.Should().Contain(e => expectedExtensions.Contains(Path.GetExtension(e))); 57Path.Combine(buildOutputDirectory, "wwwroot"), 58serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), 75var buildOutputDirectory = OutputPathCalculator.FromProject(Path.Combine(testInstance.TestRoot, "blazorwasm")).GetOutputDirectory(); 77var serviceWorkerAssetsManifest = Path.Combine(buildOutputDirectory, "wwwroot", "custom-service-worker-assets.js"); 86entries.Should().Contain(e => expectedExtensions.Contains(Path.GetExtension(e))); 102var serviceWorkerAssetsManifest = Path.Combine(publishOutputDirectory, "wwwroot", "custom-service-worker-assets.js"); 111entries.Should().Contain(e => expectedExtensions.Contains(Path.GetExtension(e))); 113var serviceWorkerFile = Path.Combine(publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); 130var serviceWorkerAssetsManifest = Path.Combine(publishOutputDirectory, "wwwroot", "custom-service-worker-assets.js"); 139entries.Should().Contain(e => expectedExtensions.Contains(Path.GetExtension(e))); 141var serviceWorkerFile = Path.Combine(publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); 153if (Path.GetFileName(p) == "blazorwasm.csproj") 167var serviceWorkerFile = Path.Combine(publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); 177var cssFile = Path.Combine(testInstance.TestRoot, "blazorwasm", "LinkToWebRoot", "css", "app.css"); 203if (Path.GetFileName(p) == "blazorwasm.csproj") 217var serviceWorkerFile = Path.Combine(publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js");
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.Publish.Tasks.Tests (86)
AppSettingsTransformTests.cs (3)
132var appsettingsFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Tasks\GenerateEnvTransformTests.cs (15)
143string envTemplatePath = Path.GetTempFileName(); 144string webConfigPath = Path.GetTempFileName(); 145string tempDir = Path.GetDirectoryName(envTemplatePath); 177SourceRootPath = Path.GetTempPath(), 178TransformRootPath = Path.GetTempPath(), 209string envTemplatePath = Path.GetTempFileName(); 210string webConfigPath = Path.GetTempFileName(); 211string tempDir = Path.GetDirectoryName(envTemplatePath); 238SourceRootPath = Path.GetTempPath(), 239TransformRootPath = Path.GetTempPath(), 270string envTemplatePath = Path.GetTempFileName(); 271string webConfigPath = Path.GetTempFileName(); 272string tempDir = Path.GetDirectoryName(envTemplatePath); 307SourceRootPath = Path.GetTempPath(), 308TransformRootPath = Path.GetTempPath(),
Tasks\OneDeploy\CreatePackageFileTests.cs (3)
26var testPackageFilePath = Path.Combine(IntermediateTempPath, "uniqueFileName"); 49Assert.Equal(expectedFileDirectory, Path.GetDirectoryName(createPackageFileTask.CreatedPackageFilePath)); 50Assert.Equal(expectedFileExtension, Path.GetExtension(createPackageFileTask.CreatedPackageFilePath));
Tasks\OneDeploy\OneDeployTests.cs (3)
43string baseDirectory = Path.GetDirectoryName(assemblyPath); 44_fileToPublish = Path.Combine(baseDirectory, Path.Combine("Resources", "TestPublishContents.zip"));
Tasks\TransformAppSettingsTests.cs (19)
35string projectFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 36string publishDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 56string appSettingsProductionJson = (Path.Combine(publishDir, "appsettings.production.json")); 82string projectFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 83string publishDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 105string projectFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 106string publishDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 128string appSettingsProductionJson = (Path.Combine(publishDir, $"MyCustomAppSettings.production.json")); 153string projectFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 154string publishDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 177string appSettingsProductionJson = (Path.Combine(publishDir, $"NewDestinationAppSettings.json"));
Tasks\TransformWebConfigTests.cs (13)
18string projectFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 25var projectFile = Path.Combine(projectFolder, "Test.csproj"); 31Assert.Equal(Path.Combine(projectFolder, webConfigToSearchFor), webConfig); 35if (File.Exists(Path.Combine(projectFolder, webConfigToSearchFor))) 37File.Delete(Path.Combine(projectFolder, webConfigToSearchFor)); 45string projectFolder = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()); 53var projectFile = Path.Combine(projectFolder, "Test.csproj"); 59Assert.Equal(Path.Combine(projectFolder, "web.config"), webConfig); 63if (File.Exists(Path.Combine(projectFolder, fileName))) 65File.Delete(Path.Combine(projectFolder, fileName)); 73using var fs = File.Create(Path.Combine(path, name));
Tasks\TransformXmlTests.cs (22)
53string sourceFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); 54string transformFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); 55string outputFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); 68SourceRootPath = Path.GetTempPath(), 69TransformRootPath = Path.GetTempPath(), 98string sourceFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); 99string transformFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); 100string outputFile = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); 113SourceRootPath = Path.GetTempPath(), 114TransformRootPath = Path.GetTempPath(),
Tasks\ZipDeploy\ZipDeployerTaskTests.cs (3)
15private static string TestAssemblyToTestZipPath = Path.Combine("Resources", "TestPublishContents.zip"); 27string baseDirectory = Path.GetDirectoryName(assemblyPath); 28_testZippedPublishContentsPath = Path.Combine(baseDirectory, TestAssemblyToTestZipPath);
WebConfigTransformTests.cs (4)
92string projectPath = Path.Combine(Path.GetTempPath(), guid.ToString(), "sample.csproj"); 93string projectDirectory = Path.GetDirectoryName(projectPath); 98string webConfigPath = Path.Combine(projectDirectory, "web.config");
Microsoft.NET.Sdk.Razor.Tasks (21)
DotnetToolTask.cs (3)
154var clientDir = Path.GetFullPath(Path.GetDirectoryName(ToolAssembly)); 285var toolCommand = Path.GetFileNameWithoutExtension(ToolAssembly) + " " + Command;
PipeName.cs (1)
47baseDirectory = baseDirectory.TrimEnd(Path.DirectorySeparatorChar);
SdkRazorGenerate.cs (2)
118var outputPath = Path.Combine(ProjectRoot, input.GetMetadata(GeneratedOutput)); 197builder.AppendLine(Path.GetFullPath(Extensions[i].GetMetadata(AssemblyFilePath)));
SdkRazorTagHelper.cs (2)
65if (!Path.IsPathRooted(Assemblies[i])) 114builder.AppendLine(Path.GetFullPath(Extensions[i].GetMetadata(AssemblyFilePath)));
ServerConnection.cs (12)
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)) 293if ("dotnet".Equals(Path.GetFileNameWithoutExtension(expectedPath), StringComparison.Ordinal)) 299var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); 303var dotnetPath = Path.Combine(path, exeName); 319var expectedCompilerPath = Path.Combine(clientDir, ServerName); 418public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 419public static bool IsUnix => Path.DirectorySeparatorChar == '/';
ServerLogger.cs (1)
48loggingFileName = Path.Combine(loggingFileName, $"razorserver.{GetCurrentProcessId()}.log");
Microsoft.NET.Sdk.Razor.Tests (234)
ApplicationPartDiscoveryIntegrationTest.cs (9)
27new FileInfo(Path.Combine(intermediateOutputPath, "AppWithP2PReference.MvcApplicationPartsAssemblyInfo.cs")).Should().Exist(); 28new FileInfo(Path.Combine(intermediateOutputPath, "AppWithP2PReference.MvcApplicationPartsAssemblyInfo.cs")).Should().Contain("[assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute(\"ClassLibrary\")]"); 29new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).AssemblyShould().HaveAttribute("Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute"); 41string intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().FullName, "Debug", DefaultTfm); 43File.Exists(Path.Combine(intermediateOutputPath, "SimpleMvc.MvcApplicationPartsAssemblyInfo.cs")).Should().BeFalse(); ; 46File.Exists(Path.Combine(intermediateOutputPath, "SimpleMvc.MvcApplicationPartsAssemblyInfo.cache")).Should().BeTrue(); 62var generatedAttributeFile = Path.Combine(intermediateOutputPath, "AppWithP2PReference.MvcApplicationPartsAssemblyInfo.cs"); 69File.AppendAllText(Path.Combine(build.ProjectRootPath, "Program.cs"), " "); 76new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).AssemblyShould().HaveAttribute("Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute");
BuildIncrementalismTest.cs (15)
22var indexPage = Path.Combine(projectDirectory.Path, "Views", "Home", "Index.cshtml"); 41new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.dll")).Should().Exist(); 42new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.Views.dll")).Should().NotExist(); 45new FileInfo(Path.Combine(intermediateOutputPath, "Razor", "Views", "Home", "Index.cshtml.g.cs")).Should().NotExist(); 62var tagHelperOutputCache = Path.Combine(intermediateOutputPath, "MvcWithComponents.TagHelpers.output.cache"); 64var generatedFile = Path.Combine(intermediateOutputPath, "Razor", "Views", "Shared", "NavMenu.razor.g.cs"); 65var generatedDefinitionFile = Path.Combine(intermediateOutputPath, "RazorDeclaration", "Views", "Shared", "NavMenu.razor.g.cs"); 71var outputFile = Path.Combine(outputPath, "MvcWithComponents.dll"); 86var page = Path.Combine(projectDirectory.Path, "Views", "Shared", "NavMenu.razor"); 113Directory.Delete(Path.Combine(projectDirectory.Path, "Components"), recursive: true); 120string intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().FullName, "Debug", DefaultTfm); 122var classLibraryDll = Path.Combine(intermediateOutputPath, "ClassLibrary.dll"); 123var classLibraryViewsDll = Path.Combine(intermediateOutputPath, "ClassLibrary.Views.dll"); 124var markerFile = Path.Combine(intermediateOutputPath, "ClassLibrary.csproj.CopyComplete"); ; 148File.AppendAllText(Path.Combine(projectDirectory.Path, "Views", "_ViewImports.cshtml"), Environment.NewLine);
BuildIntegrationTest.cs (43)
33.And.NotHaveStdOutContaining($"SimpleMvc -> {Path.Combine(projectDirectory.Path, outputPath, "SimpleMvc.Views.dll")}"); 35new FileInfo(Path.Combine(outputPath, "SimpleMvc.dll")).Should().Exist(); 36new FileInfo(Path.Combine(outputPath, "SimpleMvc.pdb")).Should().Exist(); 37new FileInfo(Path.Combine(outputPath, "SimpleMvc.Views.dll")).Should().NotExist(); 38new FileInfo(Path.Combine(outputPath, "SimpleMvc.Views.pdb")).Should().NotExist(); 52new FileInfo(Path.Combine(outputPath, "SimpleMvc.dll")).Should().Exist(); 53new FileInfo(Path.Combine(outputPath, "SimpleMvc.pdb")).Should().Exist(); 54new FileInfo(Path.Combine(outputPath, "SimpleMvc.Views.dll")).Should().NotExist(); 55new FileInfo(Path.Combine(outputPath, "SimpleMvc.Views.pdb")).Should().NotExist(); 64var filePath = Path.Combine(projectDirectory.Path, "Views", "Home", "Index.cshtml"); 80var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 83new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.dll")).Should().NotExist(); 97new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().Exist(); 98new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.pdb")).Should().Exist(); 99new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.dll")).Should().NotExist(); 100new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.pdb")).Should().NotExist(); 101new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 102new FileInfo(Path.Combine(outputPath, "ClassLibrary.pdb")).Should().Exist(); 103new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().NotExist(); 104new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.pdb")).Should().NotExist(); 119new FileInfo(Path.Combine(outputPath, "SimpleMvc.deps.json")).Should().Exist(); 120var depsFilePath = Path.Combine(outputPath, "SimpleMvc.deps.json"); 128new DirectoryInfo(Path.Combine(outputPath, "publish", "refs")).Should().NotExist(); 149new FileInfo(Path.Combine(outputPath, "refs", "mscorlib.dll")).Should().Exist(); 163var assemblyPath = Path.Combine(intermediateOutputPath, "SimpleMvc.dll"); 180var razorAssemblyInfo = Path.Combine(intermediateOutputPath, "SimpleMvc.RazorAssemblyInfo.cs"); 183new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.RazorTargetAssemblyInfo.cs")).Should().NotExist(); 207new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().Exist(); 208new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.dll")).Should().NotExist(); 209new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 210new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().NotExist(); 211new FileInfo(Path.Combine(outputPath, "AnotherClassLib.dll")).Should().Exist(); 212new FileInfo(Path.Combine(outputPath, "AnotherClassLib.Views.dll")).Should().NotExist(); 215var class2Path = Path.Combine(projectDirectory.Path, "AnotherClassLib", "Class2.cs"); 246new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().Exist(); 247new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.dll")).Should().NotExist(); 248new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 249new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().NotExist(); 250new FileInfo(Path.Combine(outputPath, "ClassLibraryMvc21.dll")).Should().Exist(); 251new FileInfo(Path.Combine(outputPath, "ClassLibraryMvc21.Views.dll")).Should().Exist(); 265new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.dll")).Should().Exist(); 266new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.Views.dll")).Should().NotExist(); 267new FileInfo(Path.Combine(intermediateOutputPath, "SimpleMvc.Views.pdb")).Should().NotExist();
BuildIntrospectionTest.cs (4)
22.And.HaveStdOutContaining($"UpToDateCheckInput: {Path.Combine("Views", "Home", "Index.cshtml")}") 23.And.HaveStdOutContaining($"UpToDateCheckInput: {Path.Combine("Views", "_ViewStart.cshtml")}"); 113var expected1 = Path.Combine("Components", "App.razor"); 114var expected2 = Path.Combine("Components", "Shared", "MainLayout.razor");
BuildWithComponents31IntegrationTest.cs (8)
21new FileInfo(Path.Combine(outputPath, "blazor31.dll")).Should().Exist(); 22new FileInfo(Path.Combine(outputPath, "blazor31.pdb")).Should().Exist(); 23new FileInfo(Path.Combine(outputPath, "blazor31.Views.dll")).Should().Exist(); 24new FileInfo(Path.Combine(outputPath, "blazor31.Views.pdb")).Should().Exist(); 26new FileInfo(Path.Combine(outputPath, "blazor31.dll")).AssemblyShould().ContainType("blazor31.Pages.Index"); 27new FileInfo(Path.Combine(outputPath, "blazor31.dll")).AssemblyShould().ContainType("blazor31.Shared.NavMenu"); 30new FileInfo(Path.Combine(outputPath, "blazor31.dll")).AssemblyShould().NotContainType("blazor31.Pages.Pages__Host"); 31new FileInfo(Path.Combine(outputPath, "blazor31.Views.dll")).AssemblyShould().ContainType("blazor31.Pages.Pages__Host");
BuildWithComponentsIntegrationTest.cs (13)
30new FileInfo(Path.Combine(outputPath, "ComponentLibrary.dll")).Should().Exist(); 31new FileInfo(Path.Combine(outputPath, "ComponentLibrary.pdb")).Should().Exist(); 33new FileInfo(Path.Combine(outputPath, "ComponentLibrary.Views.dll")).Should().NotExist(); 34new FileInfo(Path.Combine(outputPath, "ComponentLibrary.Views.pdb")).Should().NotExist(); 47new FileInfo(Path.Combine(outputPath, "MvcWithComponents.dll")).Should().Exist(); 48new FileInfo(Path.Combine(outputPath, "MvcWithComponents.pdb")).Should().Exist(); 49new FileInfo(Path.Combine(outputPath, "MvcWithComponents.Views.dll")).Should().NotExist(); 50new FileInfo(Path.Combine(outputPath, "MvcWithComponents.Views.pdb")).Should().NotExist(); 52new FileInfo(Path.Combine(outputPath, "MvcWithComponents.dll")).AssemblyShould().ContainType("MvcWithComponents.TestComponent"); 53new FileInfo(Path.Combine(outputPath, "MvcWithComponents.dll")).AssemblyShould().ContainType("MvcWithComponents.Views.Shared.NavMenu"); 56new FileInfo(Path.Combine(outputPath, "MvcWithComponents.dll")).AssemblyShould().ContainType("MvcWithComponents.Components.Counter"); 58new FileInfo(Path.Combine(outputPath, "MvcWithComponents.dll")).AssemblyShould().ContainType("AspNetCoreGeneratedDocument.Views_Home_Index"); 68var projectFile = Path.Combine(projectDirectory.Path, "ComponentApp.csproj");
DesignTimeBuildIntegrationTest.cs (17)
30new FileInfo(Path.Combine(outputPath, "SimpleMvc.dll")).Should().NotExist(); 31new FileInfo(Path.Combine(outputPath, "SimpleMvc.pdb")).Should().NotExist(); 32new FileInfo(Path.Combine(outputPath, "SimpleMvc.Views.dll")).Should().NotExist(); 33new FileInfo(Path.Combine(outputPath, "SimpleMvc.Views.pdb")).Should().NotExist(); 48Path.Combine("Views", "Home", "About.cshtml"), 49Path.Combine("Views", "Home", "Contact.cshtml"), 50Path.Combine("Views", "Home", "Index.cshtml"), 51Path.Combine("Views", "Shared", "_Layout.cshtml"), 52Path.Combine("Views", "Shared", "_ValidationScriptsPartial.cshtml"), 53Path.Combine("Views", "_ViewImports.cshtml"), 54Path.Combine("Views", "_ViewStart.cshtml"), 57var razorIntermediateOutputPath = Path.Combine( 63$@"RazorGenerateWithTargetPath: {filePath} {filePath} {Path.Combine("obj", "Debug", DefaultTfm, "Razor", filePath + ".g.cs")}"); 79Path.Combine("GenericComponent.razor"), 80Path.Combine("MyComponent.razor"), 86$@"RazorComponentWithTargetPath: {filePath} {filePath} {Path.Combine("obj", "Debug", "netstandard2.0", "Razor", filePath + ".g.cs")} {Path.Combine("obj", "Debug", "netstandard2.0", "RazorDeclaration", filePath + ".g.cs")}");
MvcBuildIntegrationTest21NetFx.cs (17)
28new FileInfo(Path.Combine(outputPath, OutputFileName)).Should().Exist(); 29new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.pdb")).Should().Exist(); 30new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.dll")).Should().Exist(); 31new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.pdb")).Should().Exist(); 34new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.input.cache")).Should().Exist(); 35new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.output.cache")).Should().Exist(); 37Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.output.cache")).Should().Contain( 54new DirectoryInfo(Path.Combine(outputPath, "Views")).Should().NotExist(); 57new DirectoryInfo(Path.Combine(outputPath, "refs")).Should().Exist(); 71new FileInfo(Path.Combine(outputPath, OutputFileName)).Should().Exist(); 72new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.pdb")).Should().Exist(); 73new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.dll")).Should().Exist(); 74new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.pdb")).Should().Exist(); 77new DirectoryInfo(Path.Combine(outputPath, "refs")).Should().NotExist(); 78new DirectoryInfo(Path.Combine(outputPath, "Views")).Should().NotExist(); 92new FileInfo(Path.Combine(outputPath, "refs", "System.Threading.Tasks.Extensions.dll")).Should().Exist(); 107var depsFile = new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.deps.json"));
MvcBuildIntegrationTest22.cs (7)
31new FileInfo(Path.Combine(outputPath, OutputFileName)).Should().Exist(); 32new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.pdb")).Should().Exist(); 33new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.dll")).Should().Exist(); 34new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.pdb")).Should().Exist(); 37new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.input.cache")).Should().Exist(); 38new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.output.cache")).Should().Exist(); 39new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.output.cache")).Should().Contain(
MvcBuildIntegrationTest50.cs (21)
22var indexPage = Path.Combine(projectDirectory.Path, "Views", "Shared", "NavMenu.razor"); 41new FileInfo(Path.Combine(intermediateOutputPath, "MvcWithComponents.dll")).Should().NotExist(); 42new FileInfo(Path.Combine(intermediateOutputPath, "MvcWithComponents.Views.dll")).Should().NotExist(); 45new FileInfo(Path.Combine(intermediateOutputPath, "RazorComponents", "Views", "Shared", "NavMenu.razor.g.cs")).Should().NotExist(); 63new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().Exist(); 64new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.dll")).Should().Exist(); 65new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 66new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().Exist(); 67new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.pdb")).Should().Exist(); 72new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().NotExist(); 73new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.dll")).Should().NotExist(); 74new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().NotExist(); 75new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().NotExist(); 76new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.pdb")).Should().NotExist(); 82new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().Exist(); 83new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.Views.dll")).Should().Exist(); 84new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 85new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().Exist(); 86new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.pdb")).Should().Exist(); 95var scopedCssPath = Path.Combine(project.Path, "wwwroot", "Views", "Home", "Index.cshtml.css"); 96Directory.CreateDirectory(Path.GetDirectoryName(scopedCssPath));
MvcBuildIntegrationTestLegacy.cs (18)
33new FileInfo(Path.Combine(outputPath, OutputFileName)).Should().Exist(); 34new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.pdb")).Should().Exist(); 35new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.dll")).Should().Exist(); 36new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.pdb")).Should().Exist(); 39new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.input.cache")).Should().Exist(); 40new FileInfo(Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.output.cache")).Should().Exist(); 42Path.Combine(intermediateOutputPath, $"{TestProjectName}.TagHelpers.output.cache")).Should().Contain( 59new DirectoryInfo(Path.Combine(outputPath, "Views")).Should().NotExist(); 62new DirectoryInfo(Path.Combine(outputPath, "refs")).Should().NotExist(); 77new FileInfo(Path.Combine(outputPath, OutputFileName)).Should().Exist(); 78new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.pdb")).Should().Exist(); 79new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.dll")).Should().Exist(); 80new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.Views.pdb")).Should().Exist(); 83new DirectoryInfo(Path.Combine(outputPath, "refs")).Should().NotExist(); 84new DirectoryInfo(Path.Combine(outputPath, "Views")).Should().NotExist(); 99new FileInfo(Path.Combine(outputPath, "refs", "System.Threading.Tasks.Extensions.dll")).Should().Exist(); 114var depsFile = new FileInfo(Path.Combine(outputPath, $"{TestProjectName}.deps.json")); 128new DirectoryInfo(Path.Combine(outputPath, "publish", "refs")).Should().NotExist();
PackIntegrationTest.cs (14)
29new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 30new FileInfo(Path.Combine(outputPath, "ClassLibrary.Views.dll")).Should().NotExist(); 33Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"), 34$"<file src=\"{Path.Combine(outputPath, "ClassLibrary.dll")}\" " + 35$"target=\"{Path.Combine("lib", DefaultTfm, "ClassLibrary.dll")}\" />"); 38Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"), 39$"<file src=\"{Path.Combine(outputPath, "ClassLibrary.Views.dll")}\" " + 40$"target=\"{Path.Combine("lib", DefaultTfm, "ClassLibrary.Views.dll")}\" />"); 43Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"), 44$"<file src=\"{Path.Combine(outputPath, "ClassLibrary.Views.pdb")}\" " + 45$"target=\"{Path.Combine("lib", DefaultTfm, "ClassLibrary.Views.pdb")}\" />"); 48Path.Combine(projectDirectory.Path, "obj", "Debug", "ClassLibrary.1.0.0.nuspec"), 52Path.Combine(build.GetPackageDirectory().FullName, "ClassLibrary.1.0.0.nupkg"), 53Path.Combine("lib", DefaultTfm, "ClassLibrary.dll"));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
PublishIntegrationTest.cs (47)
24new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.dll")).Should().Exist(); 25new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.pdb")).Should().Exist(); 26new FileInfo(Path.Combine(publishOutputPath, "appsettings.json")).Should().Exist(); 27new FileInfo(Path.Combine(publishOutputPath, "appsettings.Development.json")).Should().Exist(); 29new FileInfo(Path.Combine(outputPath, "SimpleMvc.dll")).Should().Exist(); 30new FileInfo(Path.Combine(outputPath, "SimpleMvc.pdb")).Should().Exist(); 31new FileInfo(Path.Combine(outputPath, "appsettings.json")).Should().Exist(); 32new FileInfo(Path.Combine(outputPath, "appsettings.Development.json")).Should().Exist(); 35new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "js", "SimpleMvc.js")).Should().Exist(); 36new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "css", "site.css")).Should().Exist(); 37new FileInfo(Path.Combine(publishOutputPath, "wwwroot", ".well-known", "security.txt")).Should().Exist(); 40new DirectoryInfo(Path.Combine(publishOutputPath, "refs")).Should().NotExist(); 41new DirectoryInfo(Path.Combine(publishOutputPath, "Views")).Should().NotExist(); 42new FileInfo(Path.Combine(publishOutputPath, "wwwroot", ".not-copied", "test.txt")).Should().NotExist(); 54var outputPath = Path.Combine(projectDirectory.Path, "bin", "Debug", DefaultTfm); 57new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.dll")).Should().Exist(); 58new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.pdb")).Should().Exist(); 61new DirectoryInfo(Path.Combine(publishOutputPath, "refs")).Should().NotExist(); 62new DirectoryInfo(Path.Combine(publishOutputPath, "Views")).Should().NotExist(); 71Directory.Delete(Path.Combine(projectDirectory.Path, "Views"), recursive: true); 79new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.dll")).Should().Exist(); 80new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.pdb")).Should().Exist(); 93var intermediateOutputPath = Path.Combine(publish.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 95new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.dll")).Should().Exist(); 96new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.pdb")).Should().Exist(); 99new FileInfo(Path.Combine(publishOutputPath, "refs", "mscorlib.dll")).Should().Exist(); 100new DirectoryInfo(Path.Combine(publishOutputPath, "Views")).Should().NotBeEmpty(); 122new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.dll")).Should().Exist(); 123new FileInfo(Path.Combine(publishOutputPath, "SimpleMvc.pdb")).Should().Exist(); 126new FileInfo(Path.Combine(publishOutputPath, "refs", "mscorlib.dll")).Should().Exist(); 140new FileInfo(Path.Combine(publishOutputPath, "AppWithP2PReference.dll")).Should().Exist(); 141new FileInfo(Path.Combine(publishOutputPath, "AppWithP2PReference.pdb")).Should().Exist(); 142new FileInfo(Path.Combine(publishOutputPath, "ClassLibrary.dll")).Should().Exist(); 143new FileInfo(Path.Combine(publishOutputPath, "ClassLibrary.pdb")).Should().Exist(); 147new DirectoryInfo(Path.Combine(publishOutputPath, "refs")).Should().NotExist(); 148new DirectoryInfo(Path.Combine(publishOutputPath, "Views")).Should().NotExist(); 177new FileInfo(Path.Combine(outputPath, "AppWithP2PReference.dll")).Should().Exist(); 178new FileInfo(Path.Combine(outputPath, "ClassLibrary.dll")).Should().Exist(); 179new FileInfo(Path.Combine(outputPath, "AnotherClassLib.dll")).Should().Exist(); 188new FileInfo(Path.Combine(publishOutputPath, "AppWithP2PReference.dll")).Should().Exist(); 189new FileInfo(Path.Combine(publishOutputPath, "AppWithP2PReference.pdb")).Should().Exist(); 191new FileInfo(Path.Combine(publishOutputPath, "ClassLibrary.dll")).Should().Exist(); 192new FileInfo(Path.Combine(publishOutputPath, "ClassLibrary.pdb")).Should().Exist(); 194new FileInfo(Path.Combine(publishOutputPath, "AnotherClassLib.dll")).Should().Exist(); 195new FileInfo(Path.Combine(publishOutputPath, "AnotherClassLib.pdb")).Should().Exist(); 210var assemblyPath = Path.Combine(outputPath, "SimpleMvc.dll"); 220var publishAssemblyPath = Path.Combine(publishOutputPath, "SimpleMvc.dll");
Microsoft.NET.Sdk.Razor.Tool.Tests (15)
DefaultExtensionAssemblyLoaderTest.cs (5)
19var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 36var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 56var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 74var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 94var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow"));
DefaultExtensionDependencyCheckerTest.cs (3)
21var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 43var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); 67var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow"));
Infrastructure\ServerUtilities.cs (1)
13internal static string DefaultClientDirectory { get; } = Path.GetDirectoryName(typeof(ServerUtilities).Assembly.Location);
LoaderTestResources.cs (1)
136var filePath = Path.Combine(directoryPath, fileName);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
ServerCommandTest.cs (4)
22var directoryPath = Path.Combine(Path.GetTempPath(), "RazorTest", Guid.NewGuid().ToString()); 23var path = Path.Combine(directoryPath, expectedFileName); 61var expectedPath = Path.Combine(".dotnet", "pids", "build");
Microsoft.NET.Sdk.StaticWebAssets.Tasks (66)
CollectStaticWebAssetsToCopy.cs (3)
25var normalizedOutputPath = StaticWebAsset.NormalizeContentRootPath(Path.GetFullPath(OutputPath)); 45fileOutputPath = 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)
56Path.GetFileNameWithoutExtension(candidate.RelativePath));
Compression\GZipCompress.cs (1)
20.Select(f => Path.GetDirectoryName(f.ItemSpec))
Compression\ResolveCompressedAssets.cs (4)
119var outputPath = Path.GetFullPath(OutputPath); 192return Path.Combine(outputPath, $"{pathHash}-{{0}}-{asset.Fingerprint}"); 303var itemSpec = Path.GetFullPath(Path.Combine(OutputPath, fileName));
ComputeReferenceStaticWebAssetItems.cs (1)
61selected.OriginalItemSpec = Path.GetFullPath(selected.OriginalItemSpec);
ComputeStaticWebAssetsTargetPaths.cs (4)
37UseAlternatePathDirectorySeparator ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar, StaticWebAssetTokenResolver.Instance); 39if (AdjustPathsForPack && string.IsNullOrEmpty(Path.GetExtension(targetPath))) 41targetPath = Path.GetDirectoryName(targetPath);
Data\ContentTypeProvider.cs (4)
432var fileName = Path.GetFileName(relativePath); 483var extension = Path.GetExtension(fileName); 487var fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName); 488if (!Path.GetExtension(fileNameNoExtension).Equals("", StringComparison.Ordinal))
Data\StaticWebAsset.cs (7)
566return Path.Combine(normalizedPrefix, computedBasePath, route) 746RelatedAsset = !string.IsNullOrEmpty(RelatedAsset) ? Path.GetFullPath(RelatedAsset) : RelatedAsset; 754=> Path.GetFullPath(path) + 756(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch 760(false, false) => Path.DirectorySeparatorChar 1070var pathWithTokens = Path.Combine(prefix, computedBasePath, RelativePath)
DefineStaticWebAssetEndpoints.cs (2)
187var finalRoute = asset.IsProject() || asset.IsPackage() ? StaticWebAsset.Normalize(Path.Combine(asset.BasePath, route)) : route; 246var finalRoute = asset.IsProject() || asset.IsPackage() ? StaticWebAsset.Normalize(Path.Combine(asset.BasePath, route)) : route;
DefineStaticWebAssets.cs (17)
113if (Path.IsPathRooted(candidateMatchPath) && candidateMatchPath == candidate.ItemSpec) 115var normalizedAssetPath = Path.GetFullPath(candidate.GetMetadata("FullPath")); 116var normalizedDirectoryPath = Path.GetDirectoryName(BuildEngine.ProjectFileOfTaskNode); 124var withSeparator when withSeparator[withSeparator.Length - 1] == Path.DirectorySeparatorChar || withSeparator[withSeparator.Length - 1] == Path.AltDirectorySeparatorChar => normalizedDirectoryPath.Length, 216var identity = Path.GetFullPath(candidate.GetMetadata("FullPath")); 261var fileNamePattern = Path.GetFileName(identity); 265identity = Path.Combine(Path.GetDirectoryName(identity) ?? string.Empty, expanded); 341var candidateFullPath = Path.GetFullPath(candidate.GetMetadata("FullPath")); 371var identitySubPath = Path.GetDirectoryName(relativePath); 372var itemSpecFileName = Path.GetFileName(candidateFullPath); 373var relativeFileName = Path.GetFileName(relativePath); 379var finalIdentity = Path.Combine(normalizedContentRoot, identitySubPath ?? string.Empty, itemSpecFileName); 391var assetIdentity = Path.GetFullPath(Path.Combine(normalizedContentRoot, stem)); 459var normalizedAssetPath = Path.GetFullPath(candidate.GetMetadata("FullPath"));
FingerprintPatternMatcher.cs (6)
62var result = Path.Combine(directoryName, $"{fileNamePrefix}{DefaultFingerprintExpression}{extension}"); 79var simpleExtensionResult = Path.Combine(directoryName.ToString(), $"{stem}{expression}{matchExtension}"); 135var fileName = Path.GetFileName(relativePathCandidate).AsMemory(); 136var directoryName = Path.GetDirectoryName(relativePathCandidate); 137var stem = Path.GetFileNameWithoutExtension(relativePathCandidate).AsMemory(); 138var extension = Path.GetExtension(relativePathCandidate).AsMemory();
GenerateStaticWebAssetEndpointsManifest.cs (1)
163var directoryName = Path.GetDirectoryName(ExclusionPatternsCacheFilePath);
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)
113var projectReferenceFullPath = Path.GetFullPath(referenceMetadata);
OverrideHtmlAssetPlaceholders.cs (1)
95string outputPath = Path.Combine(OutputPath, FileHasher.HashString(item.ItemSpec) + item.GetMetadata("Extension"));
ScopedCss\ConcatenateCssFiles.cs (2)
67var importPath = NormalizePath(Path.Combine(prefix, ProjectBundles[i].ItemSpec)); 97Directory.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.StaticWebAssets.Tests (1367)
AspNetSdkBaselineTest.cs (15)
71Path.Combine(TestContext.GetRepoRoot() ?? AppContext.BaseDirectory, "test", "Microsoft.NET.Sdk.StaticWebAssets.Tests", "StaticWebAssetsBaselines"); 111var wwwRootFolder = Path.Combine(outputFolder, "wwwroot"); 128!a.HasContentRoot(Path.Combine(outputFolder, "wwwroot")) && 130!File.Exists(Path.Combine(a.ContentRoot, a.RelativePath)) && 134.Select(a => Path.GetFullPath(Path.Combine(outputFolder, "wwwroot", a.RelativePath))) 136.Select(a => Path.GetFullPath(Path.Combine(a.ContentRoot, a.RelativePath)))) 216string wwwRootFolder = Path.Combine(publishFolder, "wwwroot"); 234.Select(a => Path.Combine(wwwRootFolder, a.ComputeTargetPath("", Path.DirectorySeparatorChar))); 298if (!Directory.Exists(Path.Combine(BaselinesFolder))) 300Directory.CreateDirectory(Path.Combine(BaselinesFolder)); 308=> Path.Combine(BaselinesFolder, $"{name}{(!string.IsNullOrEmpty(suffix) ? $"_{suffix}" : "")}.{manifestType}.staticwebassets.json"); 315=> Path.Combine(BaselinesFolder, $"{name}{(!string.IsNullOrEmpty(suffix) ? $"_{suffix}" : "")}.{manifestType}.files.json");
ComputeStaticWebAssetsTargetPathsTest.cs (7)
31Assets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate#[.{fingerprint}]!.js", "All", "All", fingerprint: "1234asdf")], 43asset.GetMetadata("TargetPath").Should().Be(Path.Combine("wwwroot", "candidate.1234asdf.js")); 59Assets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate#[.{fingerprint}].js", "All", "All", fingerprint: "1234asdf")], 71asset.GetMetadata("TargetPath").Should().Be(Path.Combine("wwwroot", "candidate.1234asdf.js")); 87Assets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate#[.{fingerprint}]?.js", "All", "All", fingerprint: "1234asdf")], 99asset.GetMetadata("TargetPath").Should().Be(Path.Combine("wwwroot", "candidate.js")); 113Identity = Path.GetFullPath(itemSpec),
IsolatedNuGetPackageFolderAspNetSdkBaselineTest.cs (2)
15_cachePath = Path.GetFullPath(Path.Combine(TestContext.Current.TestExecutionDirectory, Shorten(restoreNugetPackagePath)));
JsModulesIntegrationTest.cs (33)
18Directory.CreateDirectory(Path.Combine(projectDirectory.TestRoot, "wwwroot")); 19File.WriteAllText(Path.Combine(projectDirectory.TestRoot, "wwwroot", "ComponentApp.lib.module.js"), "console.log('Hello world!');"); 24var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 26new FileInfo(Path.Combine(intermediateOutputPath, "jsmodules", "jsmodules.build.manifest.json")).Should().NotExist(); 40Directory.CreateDirectory(Path.Combine(projectDirectory.TestRoot, "wwwroot")); 41File.WriteAllText(Path.Combine(projectDirectory.TestRoot, "wwwroot", "ComponentApp.lib.module.js"), "console.log('Hello world!');"); 46var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 48var file = new FileInfo(Path.Combine(intermediateOutputPath, "jsmodules", "jsmodules.build.manifest.json")); 72var finalPath = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 97Directory.CreateDirectory(Path.Combine(ProjectDirectory.TestRoot, "wwwroot")); 98File.WriteAllText(Path.Combine(ProjectDirectory.TestRoot, "wwwroot", "ComponentApp.lib.module.js"), "console.log('Hello world!');"); 107var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 129new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "ComponentApp.lib.module.js")).Should().NotExist(); 130new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "ComponentApp.modules.json")).Should().NotExist(); 142var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 144var file = new FileInfo(Path.Combine(intermediateOutputPath, "jsmodules", "jsmodules.build.manifest.json")); 157Directory.CreateDirectory(Path.Combine(projectDirectory.TestRoot, "wwwroot")); 158File.WriteAllText(Path.Combine(projectDirectory.TestRoot, "wwwroot", "ComponentApp.lib.module.js"), "console.log('Hello world!');"); 164var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 165var directoryPath = Path.Combine(intermediateOutputPath, "jsmodules"); 190Directory.CreateDirectory(Path.Combine(path[..^1].Prepend(ProjectDirectory.TestRoot).ToArray())); 191File.WriteAllText(Path.Combine(path.Prepend(ProjectDirectory.TestRoot).ToArray()), content); 217var finalPath = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 228var file = new FileInfo(Path.Combine(intermediateOutputPath, "jsmodules", "jsmodules.build.manifest.json")); 256var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 262var finalPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 273var file = new FileInfo(Path.Combine(outputPath, "wwwroot", "AppWithPackageAndP2PReference.modules.json")); 309var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); ; 320var finalPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 331var modulesManifest = new FileInfo(Path.Combine(outputPath, "wwwroot", "AppWithPackageAndP2PReference.modules.json")); 336var moduleFile = new FileInfo(Path.Combine(outputPath, "wwwroot", "_content", "AnotherClassLib", "AnotherClassLib.lib.module.js")); 343Directory.CreateDirectory(Path.Combine(path[..^1].Prepend(ProjectDirectory.TestRoot).ToArray())); 344File.WriteAllText(Path.Combine(path.Prepend(ProjectDirectory.TestRoot).ToArray()), content);
LegacyStaticWebAssetsV1IntegrationTest.cs (16)
20if (Path.GetFileName(project) == "AnotherClassLib.csproj") 26if (Path.GetFileName(project) == "ClassLibrary.csproj") 36Directory.Delete(Path.Combine(ProjectDirectory.TestRoot, "AnotherClassLib", "Views"), recursive: true); 37Directory.Delete(Path.Combine(ProjectDirectory.TestRoot, "ClassLibrary", "Views"), recursive: true); 38Directory.Delete(Path.Combine(ProjectDirectory.TestRoot, "ClassLibrary", "Components"), recursive: true); 52var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 59var finalPath = Path.Combine(publishPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 63var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 83if (Path.GetFileName(project) == "AnotherClassLib.csproj") 89if (Path.GetFileName(project) == "ClassLibrary.csproj") 99Directory.Delete(Path.Combine(ProjectDirectory.TestRoot, "AnotherClassLib", "Views"), recursive: true); 100Directory.Delete(Path.Combine(ProjectDirectory.TestRoot, "ClassLibrary", "Views"), recursive: true); 101Directory.Delete(Path.Combine(ProjectDirectory.TestRoot, "ClassLibrary", "Components"), recursive: true); 115var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 117var manifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 123var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
ScopedCssIntegrationTests.cs (92)
23var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 25new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().NotExist(); 26new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist(); 27new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "ComponentApp.styles.css")).Should().NotExist(); 28new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "FetchData.razor.rz.scp.css")).Should().NotExist(); 40var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 42new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Index.cshtml.rz.scp.css")).Should().NotExist(); 43new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Contact.cshtml.rz.scp.css")).Should().NotExist(); 44new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "SimpleMvc.styles.css")).Should().NotExist(); 45new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "About.cshtml.rz.scp.css")).Should().NotExist(); 57var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 59new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().NotExist(); 60new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist(); 61new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "ComponentApp.styles.css")).Should().NotExist(); 62new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "FetchData.razor.rz.scp.css")).Should().NotExist(); 81var stylesFolder = Path.Combine(projectDirectory.Path, "Styles", "Pages"); 83var styles = Path.Combine(stylesFolder, "Counter.css"); 84File.Move(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css"), styles); 89var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 91var scoped = Path.Combine(intermediateOutputPath, "scopedcss", "Styles", "Pages", "Counter.rz.scp.css"); 94var generated = Path.Combine(intermediateOutputPath, "generated", "Microsoft.CodeAnalysis.Razor.Compiler", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Components_Pages_Counter_razor.g.cs"); 97new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist(); 109var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 111new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().Exist(); 112new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css")).Should().Exist(); 113new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "ComponentApp.styles.css")).Should().Exist(); 114new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "projectbundle", "ComponentApp.bundle.scp.css")).Should().Exist(); 115new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "FetchData.razor.rz.scp.css")).Should().NotExist(); 127var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 129new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Index.cshtml.rz.scp.css")).Should().Exist(); 130new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Contact.cshtml.rz.scp.css")).Should().Exist(); 131new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "SimpleMvc.styles.css")).Should().Exist(); 132new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "projectbundle", "SimpleMvc.bundle.scp.css")).Should().Exist(); 133new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "About.cshtml.rz.scp.css")).Should().Exist(); 145var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 147var generatedCounter = Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css"); 149var generatedIndex = Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css"); 174var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 176var generatedIndex = Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Index.cshtml.rz.scp.css"); 178var generatedAbout = Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "About.cshtml.rz.scp.css"); 180var generatedContact = Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Contact.cshtml.rz.scp.css"); 212var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 214var generatedIndex = Path.Combine(intermediateOutputPath, "scopedcss", "Views", "Home", "Index.cshtml.rz.scp.css"); 217var generatedCounter = Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Counter.razor.rz.scp.css"); 245new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "ComponentApp.styles.css")).Should().Exist(); 246new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "_content", "ComponentApp", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist(); 247new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "_content", "ComponentApp", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().NotExist(); 265new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "ComponentApp.styles.css")).Should().Exist(); 266new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "_content", "ComponentApp", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist(); 267new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "_content", "ComponentApp", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().NotExist(); 276File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css")); 277File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Index.razor.css")); 284new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "_content", "ComponentApp", "_framework", "scoped.styles.css")).Should().NotExist(); 298new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "_content", "ComponentApp", "ComponentApp.styles.css")).Should().NotExist(); 300new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "Components", "Pages", "Index.razor.rz.scp.css")).Should().Exist(); 301new FileInfo(Path.Combine(publishOutputPath, "wwwroot", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().Exist(); 313var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 315new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().Exist(); 316var generatedBundle = Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "ComponentApp.styles.css"); 318var generatedProjectBundle = Path.Combine(intermediateOutputPath, "scopedcss", "projectbundle", "ComponentApp.bundle.scp.css"); 320var generatedCounter = Path.Combine(intermediateOutputPath, "generated", "Microsoft.CodeAnalysis.Razor.Compiler", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Components_Pages_Counter_razor.g.cs"); 326File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css")); 331new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().NotExist(); 347File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Counter.razor.css")); 348File.Delete(Path.Combine(projectDirectory.Path, "Components", "Pages", "Index.razor.css")); 353var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 355new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Counter.razor.rz.scp.css")).Should().NotExist(); 356new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist(); 357new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "_framework", "scoped.styles.css")).Should().NotExist(); 373var intermediateOutputPath = Path.Combine(build.GetBaseIntermediateDirectory().ToString(), "Debug", DefaultTfm); 374var directoryPath = Path.Combine(intermediateOutputPath, "scopedcss"); 409var bundlePath = Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "ComponentApp.styles.css"); 414var scopedCssFile = Path.Combine(ProjectDirectory.TestRoot, "Components", "Pages", "Index.razor.css"); 425var collocatedJsFile = Path.Combine(ProjectDirectory.TestRoot, "Components", "Pages", "Index.razor.js"); 445: IsolatedNuGetPackageFolderAspNetSdkBaselineTest(log, Path.Combine(nameof(ScopedCssCompatibilityIntegrationTest), ".nuget")) 454if (Path.GetFileName(project) == "AnotherClassLib.csproj") 458if (Path.GetFileName(project) == "ClassLibrary.csproj") 476var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 478var manifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 488var appBundle = new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "AppWithPackageAndP2PReference.styles.css")); 502if (Path.GetFileName(project) == "AnotherClassLib.csproj") 506if (Path.GetFileName(project) == "ClassLibrary.csproj") 523var finalPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 525var publishManifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"))); 535var appBundle = new FileInfo(Path.Combine(outputPath, "wwwroot", "AppWithPackageAndP2PReference.styles.css")); 544: IsolatedNuGetPackageFolderAspNetSdkBaselineTest(log, Path.Combine(nameof(ScopedCssPackageReferences), ".nuget")) 564var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 566var buildManifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 576var appBundle = new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "AppWithPackageAndP2PReference.styles.css")); 590var scopedCssFile = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "Index.razor.css"); 592File.WriteAllText(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "Index.razor"), "This is a test razor component."); 603var bundlePath = Path.Combine(intermediateOutputPath, "scopedcss", "bundle", "AppWithPackageAndP2PReference.styles.css");
StaticWebAssetEndpointsIntegrationTest.cs (22)
29var dir = Directory.CreateDirectory(Path.Combine(root, "wwwroot")); 30File.WriteAllText(Path.Combine(dir.FullName, "app.js"), "console.log('hello world!');"); 39var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 179var dir = Directory.CreateDirectory(Path.Combine(root, "wwwroot")); 180File.WriteAllText(Path.Combine(dir.FullName, "app.js"), "console.log('hello world!');"); 189var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 309var dir = Directory.CreateDirectory(Path.Combine(root, "wwwroot")); 310File.WriteAllText(Path.Combine(dir.FullName, "app.js"), "console.log('hello world!');"); 311File.WriteAllText(Path.Combine(dir.FullName, "app.publish.js"), "console.log('publish hello world!');"); 320var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 325var publishManifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"))); 411if (Path.GetFileName(p) == "blazorwasm.csproj") 438if (Path.GetFileName(p) == "blazorwasm.csproj") 452var buildOutputDirectory = OutputPathCalculator.FromProject(Path.Combine(testInstance.TestRoot, "blazorhosted")).GetOutputDirectory(); 465if (Path.GetFileName(p) == "blazorwasm.csproj") 491if (Path.GetFileName(p) == "blazorwasm.csproj") 516var endpointsManifestFile = Path.Combine(outputDirectory, $"{projectName}.staticwebassets.endpoints.json"); 555return [.. Directory.GetFiles(Path.Combine(outputDirectory, "wwwroot"), "*", SearchOption.AllDirectories) 556.Select(a => StaticWebAsset.Normalize(Path.GetRelativePath(Path.Combine(outputDirectory, "wwwroot"), a)))]; 560var staticWebAssetDevelopmentManifest = JsonSerializer.Deserialize<StaticWebAssetsDevelopmentManifest>(File.ReadAllText(Path.Combine(outputDirectory, $"{projectName}.staticwebassets.runtime.json"))); 580Traverse(child.Value, Path.Combine(pathSoFar, child.Key), endpoints);
StaticWebAssets\ApplyCompressionNegotiationTest.cs (127)
31Path.Combine("wwwroot", "candidate.js"), 42Path.Combine("compressed", "candidate.js.gz"), 50Path.Combine("wwwroot", "candidate.js"), 60Path.Combine("wwwroot", "candidate.js"), 65Path.Combine("compressed", "candidate.js.gz"), 80AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 94AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 107AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 132Path.Combine("wwwroot", "candidate.js"), 163var expectedName = Path.GetFileNameWithoutExtension(compressedAssets[0].ItemSpec); 192AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), 258AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), 324AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"), 377AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), 435AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), 493AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), 549AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), 605AssetFile = Path.Combine(AppContext.BaseDirectory, "wwwroot", "candidate.js"), 648AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.br"), 696AssetFile = Path.Combine(AppContext.BaseDirectory, $"{expectedName}.gz"), 752Path.Combine("wwwroot", "candidate.js"), 763Path.Combine("compressed", "candidate.js.gz"), 771Path.Combine("wwwroot", "candidate.js"), 781Path.Combine("wwwroot", "candidate.js"), 786Path.Combine("wwwroot", "candidate.js"), 791Path.Combine("compressed", "candidate.js.gz"), 806AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 819AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 831AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 844AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 856AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 883Path.Combine("wwwroot", "candidate.js"), 893Path.Combine("compressed", "candidate.js.gz"), 901Path.Combine("wwwroot", "candidate.js"), 911AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 924AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 935AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 948AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 959AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 982AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 995AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1007AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1020AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1032AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1059Path.Combine("wwwroot", "candidate.js"), 1070Path.Combine("compressed", "candidate.js.gz"), 1078Path.Combine("wwwroot", "candidate.js"), 1084Path.Combine("compressed", "candidate.js.br"), 1092Path.Combine("wwwroot", "candidate.js"), 1103AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1116AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1127AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1140AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1151AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1164AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")), 1185AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1198AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")), 1211AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1223AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1236AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")), 1249AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1261AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1274AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.br")), 1301Path.Combine("wwwroot", "candidate.js"), 1312Path.Combine("compressed", "candidate.js.gz"), 1320Path.Combine("wwwroot", "candidate.js"), 1328Path.Combine("publish", "candidate.js"), 1343Path.Combine("wwwroot", "candidate.js"), 1348Path.Combine("compressed", "candidate.js.gz"), 1354Path.Combine("publish", "candidate.js"), 1369AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1383AssetFile = Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 1396AssetFile = Path.GetFullPath(Path.Combine("compressed", "candidate.js.gz")), 1410AssetFile = Path.GetFullPath(Path.Combine("publish", "candidate.js")), 1453Identity = Path.GetFullPath(itemSpec), 1491AssetFile = Path.GetFullPath(assetFile), 1513Path.Combine("wwwroot", "candidate.js"), 1524Path.Combine("compressed", "candidate.js.gz"), 1532Path.Combine("wwwroot", "candidate.js"), 1542Path.Combine("wwwroot", "candidate.js"), 1547Path.Combine("compressed", "candidate.js.gz"), 1580Path.Combine("wwwroot", "candidate.js"), 1591Path.Combine("compressed", "candidate.js.gz"), 1599Path.Combine("wwwroot", "candidate.js"), 1609Path.Combine("wwwroot", "candidate.js"), 1614Path.Combine("compressed", "candidate.js.gz"), 1647Path.Combine("wwwroot", "candidate.js"), 1658Path.Combine("compressed", "candidate.js.gz"), 1666Path.Combine("wwwroot", "candidate.js"), 1676Path.Combine("wwwroot", "candidate.js"), 1681Path.Combine("compressed", "candidate.js.gz"),
StaticWebAssets\ComputeEndpointsForReferenceStaticWebAssetsTest.cs (15)
26Assets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All")], 27CandidateEndpoints = [CreateCandidateEndpoint("candidate.js", Path.Combine("wwwroot", "candidate.js"))] 37task.Endpoints[0].GetMetadata("AssetFile").Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 51Assets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All")], 52CandidateEndpoints = [CreateCandidateEndpoint("candidate.js", Path.Combine("wwwroot", "candidate.js"), addLabel: true)] 62task.Endpoints[0].GetMetadata("AssetFile").Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 80Assets = [CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All")], 82CreateCandidateEndpoint("candidate.js", Path.Combine("wwwroot", "candidate.js")), 83CreateCandidateEndpoint("package.js", Path.Combine("..", "_content", "package-id", "package.js")) 94task.Endpoints[0].GetMetadata("AssetFile").Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 107Identity = Path.GetFullPath(itemSpec), 140AssetFile = Path.GetFullPath(assetFile),
StaticWebAssets\ComputeReferenceStaticWebAssetItemsTest.cs (20)
26Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All") }, 52Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All") }, 78Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All") }, 106CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All"), 107CreateCandidate(Path.Combine("wwwroot", "candidate.other.js"), "MyPackage", "Discovered", "candidate.js", "Build", "All") 120task.StaticWebAssets[0].ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.other.js"))); 137CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All"), 138CreateCandidate(Path.Combine("wwwroot", "candidate.other.js"), "MyPackage", "Discovered", "candidate.js", "Build", "All"), 139CreateCandidate(Path.Combine("wwwroot", "candidate.publish.js"), "MyPackage", "Discovered", "candidate.js", "Publish", "All") 152task.StaticWebAssets[0].ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.other.js"))); 169Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", assetKind, "All") }, 195Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "CurrentProject") }, 221Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "Reference") }, 247Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "CurrentProject") }, 273Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "Reference") }, 299Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "Other", "Project", "candidate.js", "All", "All") }, 325Assets = new[] { CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "Other", "Package", "candidate.js", "All", "All") }, 349Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ComputeStaticWebAssetsForCurrentProjectTest.cs (10)
54CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All"), 55CreateCandidate(Path.Combine("wwwroot", "candidate.other.js"), "MyPackage", "Discovered", "candidate.js", "Build", "All") 67task.StaticWebAssets[0].ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.other.js"))); 84CreateCandidate(Path.Combine("wwwroot", "candidate.js"), "MyPackage", "Discovered", "candidate.js", "All", "All"), 85CreateCandidate(Path.Combine("wwwroot", "candidate.other.js"), "MyPackage", "Discovered", "candidate.js", "Build", "All"), 86CreateCandidate(Path.Combine("wwwroot", "candidate.publish.js"), "MyPackage", "Discovered", "candidate.js", "Publish", "All") 98task.StaticWebAssets[0].ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.other.js"))); 288Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ConcatenateFilesTest.cs (10)
56var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css"); 77var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css"); 118["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "staticwebassets"), 126["Fingerprint"] = $"{Path.GetFileNameWithoutExtension(identity)}-fingerprint", 127["Integrity"] = $"{Path.GetFileNameWithoutExtension(identity)}-integrity", 136var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css"); 194var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css"); 231var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css"); 264var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css"); 302var expectedFile = Path.Combine(Directory.GetCurrentDirectory(), $"{Guid.NewGuid():N}.css");
StaticWebAssets\DefineStaticWebAssetEndpointsTest.cs (28)
36Path.Combine("wwwroot", "candidate.js"), 58endpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 103Path.Combine("wwwroot", "candidate.js"), 126endpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 175otherEndpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 220Path.Combine("wwwroot", "candidate.js"), 243endpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 292otherEndpoint.AssetFile.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 356Path.Combine("wwwroot", "candidate.js"), 366Path.GetFullPath(Path.Combine("wwwroot", "candidate.js")), 395Path.Combine(AppContext.BaseDirectory, "Client", "obj", "Debug", "net6.0", "compressed", "rdfmaxp4ta-43emfwee4b.gz"), 405["RelatedAsset"] = Path.Combine(AppContext.BaseDirectory, "Client", "bin", "Debug", "net6.0", "wwwroot", "_framework", "dotnet.timezones.blat"), 406["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "Client", "obj", "Debug", "net6.0", "compressed"), 412["OriginalItemSpec"] = Path.Combine("D:", "work", "dotnet-sdk", "artifacts", "tmp", "Release", "testing", "Publish60Host---0200F604", "Client", "bin", "Debug", "net6.0", "wwwroot", "_framework", "dotnet.timezones.blat"), 448Path.Combine(AppContext.BaseDirectory, "Client", "obj", "Debug", "net6.0", "compressed", "rdfmaxp4ta-43emfwee4b.gz"), 458["RelatedAsset"] = Path.Combine(AppContext.BaseDirectory, "Client", "obj", "Debug", "net6.0", "compressed", "RazorPackageLibraryDirectDependency.iiugt355ct.bundle.scp.css"), 459["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "Client", "obj", "Debug", "net6.0", "compressed"), 465["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, "Client", "obj", "Debug", "net6.0", "compressed", "RazorPackageLibraryDirectDependency.iiugt355ct.bundle.scp.css"), 494var assetIdentity = Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"); 510["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 600Identity = Path.GetFullPath(itemSpec), 647AssetFile = Path.GetFullPath(assetFile),
StaticWebAssets\DiscoverPrecompressedAssetsTest.cs (11)
22OutputBasePath = Path.Combine(TestContext.Current.TestExecutionDirectory, nameof(ResolveCompressedAssetsTest)); 23ItemSpec = Path.Combine(OutputBasePath, Guid.NewGuid().ToString("N") + ".tmp"); 24OriginalItemSpec = Path.Combine(OutputBasePath, Guid.NewGuid().ToString("N") + ".tmp"); 37Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js"), 47ContentRoot = Path.Combine(Environment.CurrentDirectory,"wwwroot"), 54OriginalItemSpec = Path.Combine("wwwroot", "js", "site.js"), 62Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js.gz"), 72ContentRoot = Path.Combine(Environment.CurrentDirectory, "wwwroot"), 79OriginalItemSpec = Path.Combine("wwwroot", "js", "site.js.gz"), 113asset.GetMetadata("ContentRoot").Should().Be(Path.Combine(Environment.CurrentDirectory, $"wwwroot{Path.DirectorySeparatorChar}"));
StaticWebAssets\DiscoverStaticWebAssetsTest.cs (114)
32CreateCandidate(Path.Combine("wwwroot", "candidate.js")) 48asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 51asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 62asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", "candidate.js")); 81CreateCandidate(Path.Combine("wwwroot", file)) 102asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", file))); 105asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 116asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", file)); 135CreateCandidate(Path.Combine("wwwroot", candidate.Replace('/', Path.DirectorySeparatorChar))) 152asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", candidate))); 155asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 166asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", Path.Combine(candidate.Split('/')))); 185CreateCandidate(Path.Combine("wwwroot", fileName)) 203asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", fileName))); 206asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 217asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", fileName)); 231var tempRoot = Path.Combine(Path.GetTempPath(), "swafp_identity_test"); 232var nugetPackagePath = Path.Combine(tempRoot, "microsoft.aspnetcore.components.webassembly", "10.0.0-rc.1.25451.107", "build", "net10.0"); 235var assetFullPath = Path.Combine(nugetPackagePath, assetFileName); 238var relativePath = Path.Combine("_framework", assetFileName).Replace('\\', '/'); 239var contentRoot = Path.Combine("bin", "Release", "net10.0", "wwwroot"); 279var expectedIdentity = Path.GetFullPath(Path.Combine(contentRoot, "_framework", $"blazor.webassembly.{actualFingerprint}.js")); 297CreateCandidate(Path.Combine("wwwroot", "candidate.js"), relativePath: "subdir/candidate.js") 313asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 316asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 327asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", "candidate.js")); 344CreateCandidate(Path.Combine("wwwroot", "candidate.js"), targetPath: Path.Combine("wwwroot", "subdir", "candidate.publish.js")) 360asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 363asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 374asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", "candidate.js")); 391CreateCandidate(Path.Combine("wwwroot", "candidate.js"), link: Path.Combine("wwwroot", "subdir", "candidate.link.js")) 407asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 410asset.GetMetadata(nameof(StaticWebAsset.ContentRoot)).Should().Be(Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar); 421asset.GetMetadata(nameof(StaticWebAsset.OriginalItemSpec)).Should().Be(Path.Combine("wwwroot", "candidate.js")); 438CreateCandidate(Path.Combine("wwwroot", "candidate.js"), copyToPublishDirectory: "Never"), 439CreateCandidate(Path.Combine("wwwroot", "candidate.publish.js"), relativePath: "candidate.js") 454var buildAsset = task.Assets.Single(a => a.ItemSpec == Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 455var publishAsset = task.Assets.Single(a => a.ItemSpec == Path.GetFullPath(Path.Combine("wwwroot", "candidate.publish.js"))); 456buildAsset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 461publishAsset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.publish.js"))); 493Path.Combine("wwwroot","candidate.js"), 498Path.Combine("wwwroot","candidate.publish.js"), 517'{Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))}' with kind '{firstKind}' 518'{Path.GetFullPath(Path.Combine("wwwroot", "candidate.publish.js"))}' with kind '{secondKind}' 563asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 571var currentPath = Path.GetFullPath("."); 574{ "wwwroot", Path.GetFullPath("wwwroot") + Path.DirectorySeparatorChar }, 575{ currentPath + Path.DirectorySeparatorChar + "wwwroot" + Path.DirectorySeparatorChar + "subdir", Path.GetFullPath("wwwroot/subdir") + Path.DirectorySeparatorChar }, 576{ currentPath + Path.DirectorySeparatorChar + "wwwroot" + Path.DirectorySeparatorChar + "subdir" + Path.DirectorySeparatorChar, Path.GetFullPath("wwwroot/subdir") + Path.DirectorySeparatorChar }, 577{ currentPath + Path.DirectorySeparatorChar + "wwwroot" + Path.DirectorySeparatorChar + "subdir" + Path.AltDirectorySeparatorChar, Path.GetFullPath("wwwroot/subdir") + Path.DirectorySeparatorChar }, 578{ currentPath + Path.AltDirectorySeparatorChar + "wwwroot" + Path.AltDirectorySeparatorChar + "subdir", Path.GetFullPath("wwwroot/subdir") + Path.DirectorySeparatorChar }, 579{ currentPath + Path.DirectorySeparatorChar + "wwwroot" + Path.AltDirectorySeparatorChar + "subdir", Path.GetFullPath("wwwroot/subdir") + Path.DirectorySeparatorChar }, 580{ currentPath + Path.AltDirectorySeparatorChar + "wwwroot" + Path.DirectorySeparatorChar + "subdir", Path.GetFullPath("wwwroot/subdir") + Path.DirectorySeparatorChar } 617asset.ItemSpec.Should().Be(Path.GetFullPath(Path.Combine("wwwroot", "candidate.js"))); 720var manifestPath = Path.Combine(Environment.CurrentDirectory, "CanRoundtripManifest.json"); 729var cachedAsset = CreateCandidate(Path.Combine(Environment.CurrentDirectory, "Input2.txt"), "Input2.txt"); 734var newAsset = CreateCandidate(Path.Combine(Environment.CurrentDirectory, "Input1.txt"), "Input1.txt"); 763.Returns(Path.Combine(Environment.CurrentDirectory, "Debug", "TestProject.csproj")); 765var debugDir = Path.Combine(Environment.CurrentDirectory, "Debug", "wwwroot"); 770new TaskItem(Path.Combine(debugDir, "Microsoft.AspNetCore.Components.CustomElements.lib.module.js"), 772new TaskItem(Path.Combine(debugDir, "Microsoft.AspNetCore.Components.CustomElements.lib.module.js.map"), 803.Returns(Path.Combine(Environment.CurrentDirectory, "Debug", "TestProject.csproj")); 805var debugDir = Path.Combine(Environment.CurrentDirectory, "Debug", "wwwroot"); 810new TaskItem(Path.Combine("wwwroot", "Microsoft.AspNetCore.Components.CustomElements.lib.module.js"), 812new TaskItem(Path.Combine("wwwroot", "Microsoft.AspNetCore.Components.CustomElements.lib.module.js.map"),
StaticWebAssets\FilterStaticWebAssetEndpointsTest.cs (1)
287Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\FingerprintPatternMatcherTest.cs (8)
32var relativePath = Path.Combine("folder", "test.txt"); 33var expected = Path.Combine("folder", "test#[.{fingerprint}]?.txt"); 46var relativePath = Path.Combine("folder", "test.v1.txt"); 47var expected = Path.Combine("folder", "test.v1#[.{fingerprint}]?.txt"); 58var relativePath = Path.Combine("folder", "README"); 59var expected = Path.Combine("folder", "README#[.{fingerprint}]?"); 70var relativePath = Path.Combine("folder", "test.bundle.scp.css"); 71var expected = Path.Combine("folder", "test#[.{fingerprint}]!.bundle.scp.css");
StaticWebAssets\GenerateStaticWebAssetEndpointsManifestTest.cs (10)
185var path = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + "endpoints.json"); 233var path = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + "endpoints.json"); 234var exclusionCachePath = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + "exclusions.cache"); 289var path = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + "endpoints.json"); 290var cachePath = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + ".cache"); 291var exclusionCachePath = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + "exclusions.cache"); 363var endpointsManifestPath = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + ".endpoints.json"); 364var manifestPath = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + ".cache"); 365var exclusionCachePath = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N") + ".exclusions.cache"); 465Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\GenerateStaticWebAssetEndpointsPropsFileTest.cs (15)
21var file = Path.GetTempFileName(); 46Path.Combine("wwwroot","js","sample.js"), 49Path.Combine("js", "sample.js"), 56Path.Combine("js", "sample.js"), 57Path.GetFullPath(Path.Combine("wwwroot","js","sample.js")), 126Path.Combine("js", "sample.js").Replace('\\', '/'), 127Path.GetFullPath(Path.Combine("wwwroot","js","sample.js")), 152TargetPropsFilePath = Path.GetTempFileName(), 160errorMessages[0].Should().Be($"""The asset file '{Path.GetFullPath(Path.Combine("wwwroot", "js", "sample.js"))}' specified in the endpoint '{Path.Combine("js","sample.js").Replace('\\', '/')}' does not exist."""); 173Identity = Path.GetFullPath(itemSpec), 211AssetFile = Path.GetFullPath(assetFile),
StaticWebAssets\GenerateStaticWebAssetsDevelopmentManifestTest.cs (26)
125var fileName = Path.Combine(Environment.CurrentDirectory, subPath); 165var fileName = Path.Combine(Environment.CurrentDirectory, "blob-hash.gz"); 212var fileName = Path.Combine(Environment.CurrentDirectory, "dotnet.native.js"); 337var fileName = Path.Combine(Environment.CurrentDirectory, "index.build.html"); 365var filePath = Path.Combine("some", "subfolder", "index.build.html"); 384Directory.CreateDirectory(Path.GetDirectoryName(filePath)); 414Path.GetFullPath(Path.Combine("bin", "debug", "wwwroot"))); 423CreateAsset(Path.Combine("some", "subfolder", "index.build.html"), "index.html", contentRoot: Path.Combine("bin", "debug", "wwwroot")), 446Path.GetFullPath("wwwroot")); 477Path.GetFullPath("wwwroot")); 510Path.GetFullPath("wwwroot")); 547Path.GetFullPath("wwwroot"), 548Path.GetFullPath("styles")); 560CreatePattern(basePath: "_other/_project", source: "OtherProject", pattern: "*.css", contentRoot: Path.GetFullPath("styles")) 593CreateAsset(Path.Combine(Environment.CurrentDirectory, "css", "site.css"), "css/site.css"), 594CreateAsset(Path.Combine(Environment.CurrentDirectory, "js", "index.js"), "js/index.js") 629CreateAsset(Path.Combine(Environment.CurrentDirectory, "css", "site.css"), "css/site.css"), 630CreateAsset(Path.Combine(Environment.CurrentDirectory, "CSS", "site.css"), "CSS/site.css"), 658Path.GetFullPath("otherProject")); 668CreateAsset(Path.Combine(Environment.CurrentDirectory, "css", "site.css"), "css/site.css"), 670Path.Combine(Environment.CurrentDirectory, "CSS", "site.css"), 674contentRoot: Path.GetFullPath("otherProject")), 698ContentRoot = StaticWebAsset.NormalizeContentRootPath(contentRoot ?? Path.Combine(Environment.CurrentDirectory, "wwwroot")) 732Identity = Path.GetFullPath(identity),
StaticWebAssets\GenerateStaticWebAssetsManifestTest.cs (18)
16Directory.CreateDirectory(Path.Combine(TestContext.Current.TestExecutionDirectory, nameof(GenerateStaticWebAssetsManifestTest))); 17TempFilePath = Path.Combine(TestContext.Current.TestExecutionDirectory, nameof(GenerateStaticWebAssetsManifestTest), Guid.NewGuid().ToString("N") + ".json"); 76var asset = CreateAsset(Path.Combine("wwwroot", "candidate.js"), "MyProject", "Computed", "candidate.js", "All", "All"); 185var asset = CreateAsset(Path.Combine("wwwroot", "candidate.js"), "MyProject", "Computed", "candidate.js", "All", "All"); 219CreateAsset(Path.Combine("wwwroot", "candidate.js"), "MyProject", "Computed", "candidate.js", "All", "All"), 220CreateAsset(Path.Combine("wwwroot", "candidate.js"), "MyProject", "Computed", "candidate.js", "All", "All") 225CreateAsset(Path.Combine("wwwroot", "candidate.js"), "Package", "Package", "candidate.js", "All", "Build"), 226CreateAsset(Path.Combine("wwwroot", "candidate.js"), "OtherProject", "Project", "candidate.js", "All", "Build") 231CreateAsset(Path.Combine("wwwroot", "candidate.js"), "Package", "Package", "candidate.js", "All", "Publish"), 232CreateAsset(Path.Combine("wwwroot", "candidate.js"), "OtherProject", "Project", "candidate.js", "All", "Publish") 237CreateAsset(Path.Combine("wwwroot", "candidate.js"), "Package", "Package", "candidate.js", "All", "All"), 238CreateAsset(Path.Combine("wwwroot", "candidate.js"), "OtherProject", "Project", "candidate.js", "All", "All") 243CreateAsset(Path.Combine("wwwroot", "candidate.js"), "MyProject", "Computed", "candidate.js", "All", "Build"), 244CreateAsset(Path.Combine("wwwroot", "candidate.js"), "Other", "Project", "candidate.js", "All", "Publish") 337var candidatePattern = CreatePatternCandidate(Path.Combine("MyProject", "wwwroot"), "base", "wwwroot/**", "MyProject"); 376Identity = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), $"{source}.csproj")), 407Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\GenerateStaticWebAssetsPropsFileTest.cs (35)
30CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 35["RelativePath"] = Path.Combine("js", "sample.js"), 45var expectedError = $"Missing required metadata 'SourceType' for '{Path.Combine("wwwroot", "js", "sample.js")}'."; 63CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 68["RelativePath"] = Path.Combine("js", "sample.js"), 78var expectedError = $"Missing required metadata 'SourceId' for '{Path.Combine("wwwroot", "js", "sample.js")}'."; 96CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 101["RelativePath"] = Path.Combine("js", "sample.js"), 111var expectedError = $"Missing required metadata 'ContentRoot' for '{Path.Combine("wwwroot", "js", "sample.js")}'."; 129CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 134["RelativePath"] = Path.Combine("js", "sample.js"), 144var expectedError = $"Missing required metadata 'BasePath' for '{Path.Combine("wwwroot", "js", "sample.js")}'."; 162CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 185var expectedError = $"Missing required metadata 'RelativePath' for '{Path.Combine("wwwroot", "js", "sample.js")}'."; 194var expectedError = $"Static web asset '{Path.Combine("wwwroot", "css", "site.css")}' has invalid source type 'Package'."; 206CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 212["RelativePath"] = Path.Combine("js", "sample.js"), 222CreateItem(Path.Combine("wwwroot","css","site.css"), new Dictionary<string,string> 228["RelativePath"] = Path.Combine("css", "site.css"), 255$"for '{Path.Combine("wwwroot", "js", "sample.js")}' and '{Path.Combine("wwwroot", "css", "site.css")}'."; 267CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 273["RelativePath"] = Path.Combine("js", "sample.js"), 283CreateItem(Path.Combine("wwwroot","css","site.css"), new Dictionary<string,string> 289["RelativePath"] = Path.Combine("css", "site.css"), 314var file = Path.GetTempFileName(); 350CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 356["RelativePath"] = Path.Combine("js", "sample.js").Replace("\\","/"), 365["OriginalItemSpec"] = Path.Combine("wwwroot","js","sample.js"), 395var file = Path.GetTempFileName(); 451CreateItem(Path.Combine("wwwroot","js","sample.js"), new Dictionary<string,string> 457["RelativePath"] = Path.Combine("js", "sample.js").Replace("\\","/"), 464["OriginalItemSpec"] = Path.Combine("wwwroot","js","sample.js"), 472CreateItem(Path.Combine("wwwroot","App.styles.css"), new Dictionary<string,string> 485["OriginalItemSpec"] = Path.Combine("wwwroot","App.styles.css"),
StaticWebAssets\GenerateV1StaticWebAssetsManifestTest.cs (26)
29CreateItem(Path.Combine("wwwroot", "sample.js"), new Dictionary<string,string> 41var expectedError = $"Missing required metadata 'BasePath' for '{Path.Combine("wwwroot", "sample.js")}'."; 59CreateItem(Path.Combine("wwwroot","sample.js"), new Dictionary<string,string> 71var expectedError = $"Missing required metadata 'ContentRoot' for '{Path.Combine("wwwroot", "sample.js")}'."; 79var file = Path.GetTempFileName(); 81<ContentRoot BasePath=""Blazor.Client"" Path=""{Path.Combine(".", "nuget", "bin", "debug", $"netstandard2.1{Path.DirectorySeparatorChar}")}"" /> 82<ContentRoot BasePath=""Blazor.Client"" Path=""{Path.Combine(".", "nuget", $"Blazor.Client{Path.DirectorySeparatorChar}")}"" /> 92CreateItem(Path.Combine("wwwroot","sample.js"), new Dictionary<string,string> 95["ContentRoot"] = Path.Combine(".", "nuget","Blazor.Client"), 98CreateItem(Path.Combine("wwwroot", "otherLib.js"), new Dictionary<string,string> 101["ContentRoot"] = Path.Combine(".", "nuget", "bin","debug","netstandard2.1"), 131var file = Path.GetTempFileName(); 166var file = Path.GetTempFileName(); 168<ContentRoot BasePath=""MyLibrary"" Path=""{Path.Combine(".", "nuget", "MyLibrary", $"razorContent{Path.DirectorySeparatorChar}")}"" /> 180CreateItem(Path.Combine("wwwroot","sample.js"), new Dictionary<string,string> 183["ContentRoot"] = Path.Combine(".", "nuget", "MyLibrary", "razorContent"), 211var file = Path.GetTempFileName(); 213<ContentRoot BasePath=""Base/MyLibrary"" Path=""{Path.Combine(".", "nuget", "MyLibrary", $"razorContent{Path.DirectorySeparatorChar}")}"" /> 225CreateItem(Path.Combine("wwwroot","sample.js"), new Dictionary<string,string> 230["ContentRoot"] = Path.Combine(".", "nuget", "MyLibrary", "razorContent") 233CreateItem(Path.Combine("wwwroot, site.css"), new Dictionary<string,string> 237["ContentRoot"] = Path.Combine(".", "nuget", "MyLIBRARY", "razorContent")
StaticWebAssets\MergeConfigurationPropertiesTest.cs (29)
23var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 27CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 30project: Path.Combine("..", "myRcl", "myRcl.csproj"), 31msBuildSourceProjectFile: Path.GetFullPath(referenceProjectFile), 32undefineProperties: Path.Combine(";TargetFramework;RuntimeIdentifier")) 62var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 66CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 70project: Path.Combine("..", "myRCL", "myRcl.csproj"), 71msBuildSourceProjectFile: Path.GetFullPath(referenceProjectFile).ToUpperInvariant(), 72undefineProperties: Path.Combine(";TargetFramework;RuntimeIdentifier")) 91var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 95CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 114var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 118CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 121project: Path.Combine("..", "myRcl", "myRcl.csproj"), 122msBuildSourceProjectFile: Path.GetFullPath(referenceProjectFile), 153var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 157CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 160project: Path.Combine("..", "myRcl", "myRcl.csproj"), 161msBuildSourceProjectFile: Path.GetFullPath(referenceProjectFile), 192var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 196CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 199project: Path.Combine("..", "myRcl", "myRcl.csproj"), 200msBuildSourceProjectFile: Path.GetFullPath(referenceProjectFile), 231var referenceProjectFile = Path.Combine("..", "reference", "myRcl.csproj"); 235CandidateConfigurations = new[] { CreateCandidateProjectConfiguration(Path.GetFullPath(referenceProjectFile)) }, 238project: Path.Combine("..", "myRcl", "myRcl.csproj"), 239msBuildSourceProjectFile: Path.GetFullPath(referenceProjectFile), 265return new TaskItem(Path.GetFullPath(project), new Dictionary<string, string>
StaticWebAssets\ReadStaticWebAssetsManifestFileTest.cs (9)
17Directory.CreateDirectory(Path.Combine(TestContext.Current.TestExecutionDirectory, nameof(ReadStaticWebAssetsManifestFileTest))); 18TempFilePath = Path.Combine(TestContext.Current.TestExecutionDirectory, nameof(ReadStaticWebAssetsManifestFileTest), Guid.NewGuid().ToString("N") + ".json"); 98var contentRoot = Path.GetFullPath("."); 100var identity = Path.Combine(contentRoot, "ComponentApp.styles.css"); 213var contentRoot = Path.GetFullPath("."); 214var identity = Path.Combine(contentRoot, "AnotherClassLib", "AnotherClassLib.csproj"); 277var contentRoot = Path.Combine(Path.GetFullPath("."), "AnotherClassLib", "wwwroot"); 318discoveryPattern.ItemSpec.Should().BeEquivalentTo(Path.Combine("AnotherClassLib", "wwwroot"));
StaticWebAssets\ResolveCompressedAssetsTest.cs (28)
26OutputBasePath = Path.Combine(TestContext.Current.TestExecutionDirectory, nameof(ResolveCompressedAssetsTest)); 27ItemSpec = Path.Combine(OutputBasePath, Guid.NewGuid().ToString("N") + ".tmp"); 28OriginalItemSpec = Path.Combine(OutputBasePath, Guid.NewGuid().ToString("N") + ".tmp"); 44RelativePath = Path.GetFileName(ItemSpec), 45ContentRoot = Path.GetDirectoryName(ItemSpec), 89Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js"), 99ContentRoot = Path.Combine(Environment.CurrentDirectory,"wwwroot"), 108OriginalItemSpec = Path.Combine("wwwroot", "js", "site.js"), 114Identity = Path.Combine(Environment.CurrentDirectory, "wwwroot", "js", "site.js.gz"), 124ContentRoot = Path.Combine(Environment.CurrentDirectory, "wwwroot"), 131OriginalItemSpec = Path.Combine("wwwroot", "js", "site.js.gz"), 164RelativePath = Path.GetFileName(ItemSpec), 165ContentRoot = Path.GetDirectoryName(ItemSpec), 209RelativePath = Path.GetFileNameWithoutExtension(ItemSpec)+"#[.{fingerprint}]" + Path.GetExtension(ItemSpec), 210ContentRoot = Path.GetDirectoryName(ItemSpec), 240relativePath = Path.GetFileNameWithoutExtension(relativePath); 242relativePath = Path.GetFileNameWithoutExtension(relativePath); 247relativePath = Path.GetFileNameWithoutExtension(relativePath); 249relativePath = Path.GetFileNameWithoutExtension(relativePath); 266RelativePath = Path.GetFileName(ItemSpec), 267ContentRoot = Path.GetDirectoryName(ItemSpec), 310RelativePath = Path.GetFileName(ItemSpec), 311ContentRoot = Path.GetDirectoryName(ItemSpec), 359RelativePath = Path.GetFileName(ItemSpec), 360ContentRoot = Path.GetDirectoryName(ItemSpec), 424RelativePath = Path.GetFileName(ItemSpec), 425ContentRoot = Path.GetDirectoryName(ItemSpec),
StaticWebAssets\ResolveFingerprintedStaticWebAssetEndpointsForAssetsTest.cs (7)
28Path.Combine("wwwroot", "candidate.js"), 71Path.Combine("wwwroot", "candidate.js"), 111Path.Combine("wwwroot", "candidate.js"), 154Path.Combine("wwwroot", "candidate.js"), 197Path.Combine("wwwroot", "candidate.js"), 210endpoints[0].AssetFile = Path.GetFullPath("other.js"); 240Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\StaticWebAssetsGeneratePackagePropsFileTest.cs (1)
16var file = Path.GetTempFileName();
StaticWebAssets\UpdateExternallyDefinedStaticWebAssetsTest.cs (29)
23Directory.CreateDirectory(Path.Combine(AppContext.BaseDirectory, "dist", "assets")); 24File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), "body { color: red; }"); 25File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), "<html><body></body></html>"); 28Path.Combine(AppContext.BaseDirectory, @"dist\assets\index-C5tBAdQX.css"), 38["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 43["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, @"dist\assets\index-C5tBAdQX.css"), 47Path.Combine(AppContext.BaseDirectory, @"dist\index.html"), 57["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 62["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, @"dist\index.html"), 97Directory.CreateDirectory(Path.Combine(AppContext.BaseDirectory, "dist", "assets")); 98File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), "body { color: red; }"); 99File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), "<html><body></body></html>"); 102Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), 112["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 117["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), 121Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), 131["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 136["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), 150["AssetFile"] = Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), 167task.AssetsWithoutEndpoints[0].ItemSpec.Should().Be(Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css")); 183Directory.CreateDirectory(Path.Combine(AppContext.BaseDirectory, "dist", "assets")); 184File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), "body { color: red; }"); 185File.WriteAllText(Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), "<html><body></body></html>"); 188Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), 198["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 203["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, "dist", "assets", "index-C5tBAdQX.css"), 207Path.Combine(AppContext.BaseDirectory, "dist", "index.html"), 217["ContentRoot"] = Path.Combine(AppContext.BaseDirectory, "dist"), 222["OriginalItemSpec"] = Path.Combine(AppContext.BaseDirectory, "dist", "index.html"),
StaticWebAssets\UpdateStaticWebAssetEndpointsTest.cs (1)
352Identity = Path.GetFullPath(itemSpec),
StaticWebAssets\ValidateStaticWebAssetsUniquePathsTest.cs (21)
29CreateItem(Path.Combine("wwroot", "js", "project-transitive-dep.js"), new Dictionary<string,string> 39CreateItem(Path.Combine("wwwroot", "_content", "ClassLibrary", "js", "project-transitive-dep.js"), new Dictionary<string,string> 43["OriginalItemSpec"] = Path.Combine("wwwroot", "_content", "ClassLibrary", "js", "project-transitive-dep.js"), 44["TargetPath"] = Path.Combine("wwwroot", "_content", "ClassLibrary", "js", "project-transitive-dep.js"), 49var expectedMessage = $"The static web asset '{Path.Combine("wwroot", "js", "project-transitive-dep.js")}' " + 51$"project file '{Path.Combine("wwwroot", "_content", "ClassLibrary", "js", "project-transitive-dep.js")}'."; 70CreateItem(Path.Combine("wwwroot","sample.js"), new Dictionary<string,string> 73["ContentRoot"] = Path.Combine("nuget", "MyLibrary"), 77CreateItem(Path.Combine("wwwroot", "otherLib.js"), new Dictionary<string,string> 80["ContentRoot"] = Path.Combine("nuget", "MyOtherLibrary"), 103CreateItem(Path.Combine("wwwroot","sample.js"), new Dictionary<string,string> 108["ContentRoot"] = Path.Combine(".", "MyLibrary") 110CreateItem(Path.Combine("wwwroot", "otherLib.js"), new Dictionary<string,string> 115["ContentRoot"] = Path.Combine(".", "MyLibrary") 142CreateItem(Path.Combine(".", "Library", "wwwroot", "sample.js"), new Dictionary<string,string> 147CreateItem(Path.Combine(".", "Library", "bin", "dist", "sample.js"), new Dictionary<string,string> 161errorMessages.Should().Contain($"Conflicting assets with the same path '/wwwroot/sample.js' for content root paths '{Path.Combine(".", "Library", "bin", "dist", "sample.js")}' and '{Path.Combine(".", "Library", "wwwroot", "sample.js")}'."); 176CreateItem(Path.Combine(".", "Library", "wwwroot", "sample.js"), new Dictionary<string,string> 181CreateItem(Path.Combine(".", "Library", "wwwroot", "sample.js"), new Dictionary<string,string> 189CreateItem(Path.Combine(".", "App", "wwwroot", "sample.js"), new Dictionary<string,string>
StaticWebAssetsBaselineComparer.cs (2)
318return Path.GetExtension(asset.Identity.TrimEnd(']')); 506return Path.GetExtension(asset.AssetFile.TrimEnd(']'));
StaticWebAssetsBaselineFactory.cs (26)
90var basePath = asset.BasePath.Replace('/', Path.DirectorySeparatorChar).TrimStart(Path.DirectorySeparatorChar); 91var relativePath = asset.RelativePath.Replace('/', Path.DirectorySeparatorChar); 92var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 93var originalItemSpec = asset.OriginalItemSpec.Replace('\\', Path.DirectorySeparatorChar); 95asset.Identity = Path.Combine(Path.GetDirectoryName(identity), basePath, relativePath); 96asset.Identity = asset.Identity.Replace(Path.DirectorySeparatorChar, '\\'); 101asset.OriginalItemSpec = Path.Combine(Path.GetDirectoryName(originalItemSpec), basePath, relativePath); 102asset.OriginalItemSpec = asset.OriginalItemSpec.Replace(Path.DirectorySeparatorChar, '\\'); 108var identity = asset.Identity.Replace('\\', Path.DirectorySeparatorChar); 109var originalItemSpec = asset.OriginalItemSpec.Replace('\\', Path.DirectorySeparatorChar); 111asset.Identity = Path.Combine(Path.GetDirectoryName(identity), Path.GetFileName(originalItemSpec) + Path.GetExtension(identity)) 112.Replace(Path.DirectorySeparatorChar, '\\'); 192discovery.ContentRoot = discovery.ContentRoot.Replace(Path.DirectorySeparatorChar, '\\'); 194discovery.Name = discovery.Name.Replace(Path.DirectorySeparatorChar, '\\'); 195discovery.Pattern = discovery.Pattern.Replace(Path.DirectorySeparatorChar, '\\'); 200relatedManifest.Identity = relatedManifest.Identity.Replace(projectRoot, "${ProjectPath}").Replace(Path.DirectorySeparatorChar, '\\'); 319var directory = Path.GetDirectoryName(path); 320var fileName = Path.GetFileName(path); 326return Path.Combine(directory, fileName); 437return string.Join(Path.DirectorySeparatorChar, newSegments);
StaticWebAssetsCompressionIntegrationTest.cs (15)
21var file = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js"); 22var gzipFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.gz"); 23var brotliFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.br"); 45var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 51var finalPath = Path.Combine(outputPath, "AppWithP2PReference.staticwebassets.runtime.json"); 54var manifest1 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 58var manifest2 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 119var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 125var finalPath = Path.Combine(outputPath, "AppWithP2PReference.staticwebassets.runtime.json"); 136var file = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js"); 137var gzipFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.gz"); 138var brotliFile = Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js.br"); 160var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 166var manifest1 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 170var manifest2 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.publish.json")));
StaticWebAssetsCrossTargetingTests.cs (7)
41var wwwroot = Directory.CreateDirectory(Path.Combine(ProjectDirectory.TestRoot, "wwwroot")); 42File.WriteAllText(Path.Combine(wwwroot.FullName, "test.js"), "console.log('hello')"); 51var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 58var finalPath = Path.Combine(outputPath, "RazorComponentAppMultitarget.staticwebassets.runtime.json"); 85var wwwroot = Directory.CreateDirectory(Path.Combine(ProjectDirectory.TestRoot, "wwwroot")); 86File.WriteAllText(Path.Combine(wwwroot.FullName, "test.js"), "console.log('hello')"); 98var path = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json");
StaticWebAssetsDesignTimeTest.cs (17)
33File.WriteAllText(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "file.js"), "New File"); 43var inputFilePath = Path.Combine(build.GetIntermediateDirectory().FullName, "StaticWebAssetsUTDCInput.txt"); 47inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "file.js")); 48inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js")); 49inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.v4.js")); 51var outputFilePath = Path.Combine(build.GetIntermediateDirectory().FullName, "StaticWebAssetsUTDCOutput.txt"); 55Path.GetFileName(outputFiles[0]).Should().Be("staticwebassets.build.json"); 69File.Delete(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.js")); 79var inputFilePath = Path.Combine(build.GetIntermediateDirectory().FullName, "StaticWebAssetsUTDCInput.txt"); 83inputFiles.Should().Contain(Path.Combine(build.GetIntermediateDirectory().FullName, "staticwebassets.removed.txt")); 84inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "wwwroot", "js", "project-transitive-dep.v4.js")); 86var outputFilePath = Path.Combine(build.GetIntermediateDirectory().FullName, "StaticWebAssetsUTDCOutput.txt"); 90Path.GetFileName(outputFiles[0]).Should().Be("staticwebassets.build.json"); 113var inputFilePath = Path.Combine(build.GetIntermediateDirectory().FullName, "StaticWebAssetsUTDCInput.txt"); 117inputFiles.Should().Contain(Path.Combine(ProjectDirectory.Path, "ClassLibrary", "obj", "Debug", DefaultTfm, "staticwebassets.build.json")); 119var outputFilePath = Path.Combine(build.GetIntermediateDirectory().FullName, "StaticWebAssetsUTDCOutput.txt"); 123Path.GetFileName(outputFiles[0]).Should().Be("staticwebassets.build.json");
StaticWebAssetsFingerprintingTest.cs (11)
26Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "wwwroot", "css")); 27File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "css", "fingerprint-site.css"), "body { color: red; }"); 36var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 42var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 45var manifest1 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 69var indexHtmlPath = Directory.EnumerateFiles(Path.Combine(intermediateOutputPath, "staticwebassets", "htmlassetplaceholders", "build"), "*.html").Single(); 70var endpointsManifestPath = Path.Combine(intermediateOutputPath, $"staticwebassets.build.endpoints.json"); 83var projectName = Path.GetFileNameWithoutExtension(Directory.EnumerateFiles(ProjectDirectory.TestRoot, "*.csproj").Single()); 89var indexHtmlOutputPath = Path.Combine(outputPath, "wwwroot", "index.html"); 90var endpointsManifestPath = Path.Combine(outputPath, $"{projectName}.staticwebassets.endpoints.json"); 119var indexHtmlPath = Path.Combine(testAsset.TestRoot, "wwwroot", "index.html");
StaticWebAssetsIntegrationTest.cs (90)
30var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 36var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 39var manifest1 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 58var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 64var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 69new FileInfo(Path.Combine(intermediateOutputPath, "rpswa.dswa.cache.json")).Should().NotExist(); 71new FileInfo(Path.Combine(intermediateOutputPath, "rbcswa.dswa.cache.json")).Should().NotExist(); 73new FileInfo(Path.Combine(intermediateOutputPath, "rjimswa.dswa.cache.json")).Should().NotExist(); 75new FileInfo(Path.Combine(intermediateOutputPath, "rjsmcshtml.dswa.cache.json")).Should().NotExist(); 76new FileInfo(Path.Combine(intermediateOutputPath, "rjsmrazor.dswa.cache.json")).Should().NotExist(); 78var manifest1 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 96var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 99var objManifestContents = File.ReadAllText(Path.Combine(intermediateOutputPath, "staticwebassets.build.json")); 105var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 113var secondPath = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 120var secondFinalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 142var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 145var objManifestContents = File.ReadAllText(Path.Combine(intermediateOutputPath, "staticwebassets.build.json")); 150var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 161Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "wwwroot")); 162File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "index.html"), "some html"); 167var secondPath = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 180var secondFinalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 210var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 213var objManifestContents = File.ReadAllText(Path.Combine(intermediateOutputPath, "staticwebassets.build.json")); 217var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 226var secondPath = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 241var secondFinalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 271var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 277var finalPath = Path.Combine(publishPath, "ComponentApp.staticwebassets.runtime.json"); 281var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 306var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 312var finalPath = Path.Combine(publishPath, "ComponentApp.staticwebassets.runtime.json"); 316var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 344var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 353var finalPath = Path.Combine(publishPath, "ComponentApp.staticwebassets.runtime.json"); 358var finalManifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 374var seconBinManifestPath = Path.Combine(publishPath, "ComponentApp.staticwebassets.runtime.json"); 380var secondBinManifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 384var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 411var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 417var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 421var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 428Path.Combine(outputPath, "publish"), 447var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 453var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 455var finalManifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 475if (Path.GetFileName(name).Equals("ClassLibrary.csproj", StringComparison.Ordinal)) 490using var destination = File.OpenWrite(Path.Combine(Path.GetDirectoryName(name), "ExternalStaticAssets.targets")); 502var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 508var finalPath = Path.Combine(publishPath, "ComponentApp.staticwebassets.runtime.json"); 512var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 530if (Path.GetFileName(name).Equals("ClassLibrary.csproj", StringComparison.Ordinal)) 545using var destination = File.OpenWrite(Path.Combine(Path.GetDirectoryName(name), "ExternalStaticAssets.targets")); 549if (Path.GetFileName(name).Equals("AppWithP2PReference.csproj", StringComparison.Ordinal)) 566var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 596Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "wwwroot")); 597File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "file.build.txt"), "file1"); 598File.WriteAllText(Path.Combine(ProjectDirectory.Path, "wwwroot", "file.publish.txt"), "file1"); 607var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 613var finalPath = Path.Combine(outputPath, "ComponentApp.staticwebassets.runtime.json"); 616var manifest1 = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 631Directory.CreateDirectory(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "wwwroot", "_content", "ClassLibrary", "js")); 632File.WriteAllText(Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "wwwroot", "_content", "ClassLibrary", "js", "project-transitive-dep.js"), "console.log('transitive-dep');"); 661var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 669var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 673var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 680Path.Combine(outputPath, "publish"), 702var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 710var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 737var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 744var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 766var manifest = StaticWebAssetsManifest.FromJsonBytes(File.ReadAllBytes(Path.Combine(intermediateOutputPath, "staticwebassets.build.json"))); 800var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 807var finalPath = Path.Combine(publishPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 811var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 842var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 850var finalPath = Path.Combine(publishPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 854var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 883var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 893var finalPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 915var seconBinManifestPath = Path.Combine(outputPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 922var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json"); 948var intermediateOutputPath = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "obj", "Debug"); 949var publishPath = Path.Combine(ProjectDirectory.Path, "AppWithPackageAndP2PReference", "bin", "Debug", "publish"); 952var path = Path.Combine(intermediateOutputPath, "staticwebassets.build.json"); 959var finalPath = Path.Combine(publishPath, "AppWithPackageAndP2PReference.staticwebassets.runtime.json"); 963var intermediatePublishManifestPath = Path.Combine(intermediateOutputPath, "staticwebassets.publish.json");
StaticWebAssetsPackIntegrationTest.cs (412)
30Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "bundle", "js")); 31File.WriteAllText(Path.Combine(projectDirectory.Path, "bundle", "js", "pkg-direct-dep.js"), "console.log('bundle');"); 51new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 54Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 57Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 58Path.Combine("staticwebassets", "css", "site.css"), 59Path.Combine("staticwebassets", "PackageLibraryDirectDependency.*.bundle.scp.css"), 60Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 61Path.Combine("build", "PackageLibraryDirectDependency.props"), 62Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 63Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 80new FileInfo(Path.Combine(outputPath, "PackageLibraryNoStaticAssets.dll")).Should().Exist(); 83Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryNoStaticAssets.1.0.0.nupkg"), 86Path.Combine("staticwebassets"), 87Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 88Path.Combine("build", "PackageLibraryNoStaticAssets.props"), 89Path.Combine("buildMultiTargeting", "PackageLibraryNoStaticAssets.props"), 90Path.Combine("buildTransitive", "PackageLibraryNoStaticAssets.props") 114new FileInfo(Path.Combine(outputPath, "PackageLibraryNoStaticAssets.dll")).Should().Exist(); 117Path.Combine(projectDirectory.Path, "bin", "Debug", "PackageLibraryNoStaticAssets.1.0.0.nupkg"), 120Path.Combine("staticwebassets"), 121Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 122Path.Combine("build", "PackageLibraryNoStaticAssets.props"), 123Path.Combine("buildMultiTargeting", "PackageLibraryNoStaticAssets.props"), 124Path.Combine("buildTransitive", "PackageLibraryNoStaticAssets.props") 146new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 149Path.Combine(pack2.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 152Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 153Path.Combine("staticwebassets", "css", "site.css"), 154Path.Combine("staticwebassets", "PackageLibraryDirectDependency.*.bundle.scp.css"), 155Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 156Path.Combine("build", "PackageLibraryDirectDependency.props"), 157Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 158Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 168File.WriteAllText(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "wwwroot", "LICENSE"), "license file contents"); 177new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 180Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 183Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 184Path.Combine("staticwebassets", "css", "site.css"), 185Path.Combine("staticwebassets", "LICENSE"), 186Path.Combine("staticwebassets", "PackageLibraryDirectDependency.*.bundle.scp.css"), 187Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 188Path.Combine("build", "PackageLibraryDirectDependency.props"), 189Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 190Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 210Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true); 219new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 222Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"), 225Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 226Path.Combine("staticwebassets", "css", "site.css"), 227Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 228Path.Combine("build", "PackageLibraryDirectDependency.props"), 229Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 230Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 250Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true); 262new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 265Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"), 268Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 269Path.Combine("staticwebassets", "css", "site.css"), 270Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 271Path.Combine("build", "PackageLibraryDirectDependency.props"), 272Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 273Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 293Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true); 305new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 308Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"), 311Path.Combine("content", "wwwroot", "js", "pkg-direct-dep.js"), 312Path.Combine("content", "wwwroot", "css", "site.css"), 313Path.Combine("contentFiles", "wwwroot", "js", "pkg-direct-dep.js"), 314Path.Combine("contentFiles", "wwwroot", "css", "site.css"), 334Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true); 343new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 346Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"), 349Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 350Path.Combine("staticwebassets", "css", "site.css"), 351Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 352Path.Combine("build", "PackageLibraryDirectDependency.props"), 353Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 354Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 374Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true); 383new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 386Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"), 389Path.Combine("content", "wwwroot", "js", "pkg-direct-dep.js"), 390Path.Combine("content", "wwwroot", "css", "site.css"), 391Path.Combine("contentFiles", "wwwroot", "js", "pkg-direct-dep.js"), 392Path.Combine("contentFiles", "wwwroot", "css", "site.css"), 421Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 428Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 429File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 430File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 431File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 432File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 433File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 434File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 443new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 445var packagePath = Path.Combine( 455Path.Combine("staticwebassets", "exampleJsInterop.js"), 456Path.Combine("staticwebassets", "background.png"), 457Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.bundle.scp.css"), 458Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 459Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 460Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 461Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 490Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 497Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 498File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 499File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 500File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 501File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 502File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 503File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 512new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 514var packagePath = Path.Combine( 524Path.Combine("content", "exampleJsInterop.js"), 525Path.Combine("content", "background.png"), 526Path.Combine("content", "PackageLibraryTransitiveDependency.bundle.scp.css"), 527Path.Combine("contentFiles", "exampleJsInterop.js"), 528Path.Combine("contentFiles", "background.png"), 529Path.Combine("contentFiles", "PackageLibraryTransitiveDependency.bundle.scp.css"), 558Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 565Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 566File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 567File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 568File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 569File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 570File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 571File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 585new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 587var packagePath = Path.Combine( 597Path.Combine("staticwebassets", "exampleJsInterop.js"), 598Path.Combine("staticwebassets", "background.png"), 599Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.bundle.scp.css"), 600Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 601Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 602Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 603Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 632Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 639Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 640File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 641File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 642File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 643File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 644File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 645File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 659new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 661var packagePath = Path.Combine( 671Path.Combine("content", "exampleJsInterop.js"), 672Path.Combine("content", "background.png"), 673Path.Combine("content", "PackageLibraryTransitiveDependency.bundle.scp.css"), 674Path.Combine("contentFiles", "exampleJsInterop.js"), 675Path.Combine("contentFiles", "background.png"), 676Path.Combine("contentFiles", "PackageLibraryTransitiveDependency.bundle.scp.css"), 705Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 712Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 713File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 714File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 715File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 716File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 717File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 718File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 727new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 729var packagePath = Path.Combine( 739Path.Combine("staticwebassets", "exampleJsInterop.js"), 740Path.Combine("staticwebassets", "background.png"), 741Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.bundle.scp.css"), 742Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 743Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 744Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 745Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 774Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 781Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 782File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 783File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 784File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 785File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 786File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 787File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 796new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 798var packagePath = Path.Combine( 808Path.Combine("content", "exampleJsInterop.js"), 809Path.Combine("content", "background.png"), 810Path.Combine("content", "PackageLibraryTransitiveDependency.bundle.scp.css"), 811Path.Combine("contentFiles", "exampleJsInterop.js"), 812Path.Combine("contentFiles", "background.png"), 813Path.Combine("contentFiles", "PackageLibraryTransitiveDependency.bundle.scp.css"), 840Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 847Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 848File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 849File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 850File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 851File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 852File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 853File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 862new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 864var packagePath = Path.Combine( 874Path.Combine("staticwebassets", "exampleJsInterop.js"), 875Path.Combine("staticwebassets", "background.png"), 876Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.bundle.scp.css"), 877Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 878Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 879Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 880Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 907Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 914Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 915File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 916File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 917File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 918File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 919File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 920File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 929new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 931var packagePath = Path.Combine( 941Path.Combine("content", "exampleJsInterop.js"), 942Path.Combine("content", "background.png"), 943Path.Combine("content", "PackageLibraryTransitiveDependency.bundle.scp.css"), 944Path.Combine("contentFiles", "exampleJsInterop.js"), 945Path.Combine("contentFiles", "background.png"), 946Path.Combine("contentFiles", "PackageLibraryTransitiveDependency.bundle.scp.css"), 973Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 980Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 981File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 982File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 983File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 984File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 985File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 986File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1000new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1002var packagePath = Path.Combine( 1012Path.Combine("staticwebassets", "exampleJsInterop.js"), 1013Path.Combine("staticwebassets", "background.png"), 1014Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.bundle.scp.css"), 1015Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1016Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 1017Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 1018Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 1045Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 1052Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 1053File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 1054File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 1055File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 1056File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 1057File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 1058File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1072new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1074var packagePath = Path.Combine( 1084Path.Combine("content", "exampleJsInterop.js"), 1085Path.Combine("content", "background.png"), 1086Path.Combine("content", "PackageLibraryTransitiveDependency.bundle.scp.css"), 1087Path.Combine("contentFiles", "exampleJsInterop.js"), 1088Path.Combine("contentFiles", "background.png"), 1089Path.Combine("contentFiles", "PackageLibraryTransitiveDependency.bundle.scp.css"), 1116Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 1123Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 1124File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 1125File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 1126File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 1127File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 1128File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 1129File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1138new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1140var packagePath = Path.Combine( 1150Path.Combine("staticwebassets", "exampleJsInterop.js"), 1151Path.Combine("staticwebassets", "background.png"), 1152Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.bundle.scp.css"), 1153Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1154Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 1155Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 1156Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 1183Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 1190Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 1191File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 1192File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 1193File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 1194File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 1195File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 1196File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1205new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1207var packagePath = Path.Combine( 1217Path.Combine("content", "exampleJsInterop.js"), 1218Path.Combine("content", "background.png"), 1219Path.Combine("content", "PackageLibraryTransitiveDependency.bundle.scp.css"), 1220Path.Combine("contentFiles", "exampleJsInterop.js"), 1221Path.Combine("contentFiles", "background.png"), 1222Path.Combine("contentFiles", "PackageLibraryTransitiveDependency.bundle.scp.css"), 1253Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 1260Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 1261File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 1262File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 1263File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 1264File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.js"), ""); 1265File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 1266File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 1267File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "PackageLibraryTransitiveDependency.lib.module.js"), ""); 1268File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1277new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1279var packagePath = Path.Combine( 1289Path.Combine("staticwebassets", "exampleJsInterop.js"), 1290Path.Combine("staticwebassets", "background.png"), 1291Path.Combine("staticwebassets", "Component1.razor.js"), 1292Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.*.bundle.scp.css"), 1293Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.*.lib.module.js"), 1294Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1295Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 1296Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 1297Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 1328Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 1335Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 1336File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 1337File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 1338File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 1339File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.js"), ""); 1340File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 1341File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 1342File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "PackageLibraryTransitiveDependency.lib.module.js"), ""); 1343File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1354new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1356var packagePath = Path.Combine( 1366Path.Combine("staticwebassets", "exampleJsInterop.js"), 1367Path.Combine("staticwebassets", "background.png"), 1368Path.Combine("staticwebassets", "Component1.razor.js"), 1369Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.*.bundle.scp.css"), 1370Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.*.lib.module.js"), 1371Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1372Path.Combine("build", "PackageLibraryTransitiveDependency.props"), 1373Path.Combine("buildMultiTargeting", "PackageLibraryTransitiveDependency.props"), 1374Path.Combine("buildTransitive", "PackageLibraryTransitiveDependency.props") 1405Directory.Delete(Path.Combine(projectDirectory.Path, "wwwroot"), recursive: true); 1412Directory.CreateDirectory(Path.Combine(projectDirectory.Path, "wwwroot")); 1413File.WriteAllText(Path.Combine(projectDirectory.Path, "_Imports.razor"), "@using Microsoft.AspNetCore.Components.Web" + Environment.NewLine); 1414File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor"), componentText); 1415File.WriteAllText(Path.Combine(projectDirectory.Path, "Component1.razor.css"), ""); 1416File.WriteAllText(Path.Combine(projectDirectory.Path, "ExampleJsInterop.cs"), ""); 1417File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "background.png"), ""); 1418File.WriteAllText(Path.Combine(projectDirectory.Path, "wwwroot", "exampleJsInterop.js"), ""); 1427new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1429var packagePath = Path.Combine( 1439Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.styles.css"), 1440Path.Combine("staticwebassets", "PackageLibraryTransitiveDependency.modules.json"), 1460Directory.Delete(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "Components"), recursive: true); 1469new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1472Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "bin", "Debug", "PackageLibraryDirectDependency.1.0.0.nupkg"), 1475Path.Combine("content", "wwwroot", "js", "pkg-direct-dep.js"), 1476Path.Combine("content", "wwwroot", "css", "site.css"), 1477Path.Combine("contentFiles", "wwwroot", "js", "pkg-direct-dep.js"), 1478Path.Combine("contentFiles", "wwwroot", "css", "site.css"), 1495new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1498Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 1502Path.Combine("staticwebassets", "Components", "App.razor.rz.scp.css"), 1503Path.Combine("staticwebassets", "PackageLibraryDirectDependency.styles.css"), 1520new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1523Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 1526Path.Combine("content", "wwwroot", "js", "pkg-direct-dep.js"), 1527Path.Combine("content", "wwwroot", "css", "site.css"), 1528Path.Combine("content", "Components", "App.razor.css"), 1530Path.Combine("content", "Components", "App.razor.css"), 1531Path.Combine("content", "Components", "App.razor.rz.scp.css"), 1532Path.Combine("contentFiles", "wwwroot", "js", "pkg-direct-dep.js"), 1533Path.Combine("contentFiles", "wwwroot", "css", "site.css"), 1534Path.Combine("contentFiles", "Components", "App.razor.css"), 1535Path.Combine("contentFiles", "Components", "App.razor.rz.scp.css"), 1553new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1556Path.Combine(build.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 1559Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 1560Path.Combine("staticwebassets", "PackageLibraryDirectDependency.*.bundle.scp.css"), 1561Path.Combine("staticwebassets", "css", "site.css"), 1562Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1563Path.Combine("build", "PackageLibraryDirectDependency.props"), 1564Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 1565Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 1583new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1586Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 1589Path.Combine("content", "wwwroot", "js", "pkg-direct-dep.js"), 1590Path.Combine("content", "PackageLibraryDirectDependency.bundle.scp.css"), 1591Path.Combine("content", "wwwroot", "css", "site.css"), 1592Path.Combine("contentFiles", "wwwroot", "js", "pkg-direct-dep.js"), 1593Path.Combine("contentFiles", "PackageLibraryDirectDependency.bundle.scp.css"), 1594Path.Combine("contentFiles", "wwwroot", "css", "site.css"), 1609new FileInfo(Path.Combine(outputPath, "ComponentLibrary.dll")).Should().Exist(); 1612Path.Combine(projectDirectory.Path, "bin", "Debug", "ComponentLibrary.1.0.0.nupkg"), 1615Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1616Path.Combine("build", "ComponentLibrary.props"), 1617Path.Combine("buildMultiTargeting", "ComponentLibrary.props"), 1618Path.Combine("buildTransitive", "ComponentLibrary.props") 1636new FileInfo(Path.Combine(outputPath, "PackageLibraryTransitiveDependency.dll")).Should().Exist(); 1638new FileInfo(Path.Combine(intermediateOutputPath, "staticwebassets", "msbuild.PackageLibraryTransitiveDependency.Microsoft.AspNetCore.StaticWebAssets.props")).Should().Exist(); 1639new FileInfo(Path.Combine(intermediateOutputPath, "staticwebassets", "msbuild.build.PackageLibraryTransitiveDependency.props")).Should().Exist(); 1640new FileInfo(Path.Combine(intermediateOutputPath, "staticwebassets", "msbuild.buildMultiTargeting.PackageLibraryTransitiveDependency.props")).Should().Exist(); 1641new FileInfo(Path.Combine(intermediateOutputPath, "staticwebassets", "msbuild.buildTransitive.PackageLibraryTransitiveDependency.props")).Should().Exist(); 1643var directoryPath = Path.Combine(intermediateOutputPath, "staticwebassets"); 1647Path.Combine(directoryPath, "msbuild.PackageLibraryTransitiveDependency.Microsoft.AspNetCore.StaticWebAssets.props"), 1648Path.Combine(directoryPath, "msbuild.build.PackageLibraryTransitiveDependency.props"), 1649Path.Combine(directoryPath, "msbuild.buildMultiTargeting.PackageLibraryTransitiveDependency.props"), 1650Path.Combine(directoryPath, "msbuild.buildTransitive.PackageLibraryTransitiveDependency.props"), 1675File.WriteAllText(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "wwwroot", "LICENSE"), "license file contents"); 1684new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1687Path.Combine(buildCommand.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 1690Path.Combine("staticwebassets", "js", "pkg-direct-dep.js"), 1691Path.Combine("staticwebassets", "css", "site.css"), 1692Path.Combine("staticwebassets", "PackageLibraryDirectDependency.*.bundle.scp.css"), 1693Path.Combine("build", "Microsoft.AspNetCore.StaticWebAssets.props"), 1694Path.Combine("build", "PackageLibraryDirectDependency.props"), 1695Path.Combine("buildMultiTargeting", "PackageLibraryDirectDependency.props"), 1696Path.Combine("buildTransitive", "PackageLibraryDirectDependency.props") 1706File.WriteAllText(Path.Combine(projectDirectory.Path, "PackageLibraryDirectDependency", "wwwroot", "LICENSE"), "license file contents"); 1715new FileInfo(Path.Combine(outputPath, "PackageLibraryDirectDependency.dll")).Should().Exist(); 1718Path.Combine(buildCommand.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"), 1721Path.Combine("content", "js", "pkg-direct-dep.js"), 1722Path.Combine("content", "css", "site.css"), 1723Path.Combine("content", "PackageLibraryDirectDependency.*.bundle.scp.css"), 1724Path.Combine("contentFiles", "js", "pkg-direct-dep.js"), 1725Path.Combine("contentFiles", "css", "site.css"), 1726Path.Combine("contentFiles", "PackageLibraryDirectDependency.bundle.scp.css"),
Microsoft.NET.Sdk.Web.Tests (5)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
PublishTests.cs (4)
38string runtimeConfigFile = Path.Combine(outputDirectory, $"{projectName}.runtimeconfig.json"); 91var publishCommand = new PublishCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name)); 101string responseFile = Path.Combine(outputDirectory, "native", $"{projectName}.ilc.rsp"); 109File.Exists(Path.Combine(outputDirectory, "web.config")).Should().BeFalse();
Microsoft.NET.Sdk.WorkloadManifestReader (46)
SdkDirectoryWorkloadManifestProvider.cs (28)
73string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 74string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 90var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 93knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 111_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 186_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 270var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 300var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 319AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 326var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], _sdkVersionBand.ToString()); 341var manifestVersionBandDirectory = Path.Combine(manifestRoot, _sdkVersionBand.ToString()); 346directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 398AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 426string manifestId = Path.GetFileName(manifestDirectory); 434.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 437return (directory: dir, version: Path.GetFileName(dir)); 446else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 448var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 472.Select(dir => Path.GetFileName(dir)) 478.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 503var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 505if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 536var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 553var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 563var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 568var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 597string globalJsonPath = Path.Combine(directory, "global.json"); 602directory = Path.GetDirectoryName(directory);
TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
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)
105if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
Microsoft.NET.Sdk.WorkloadManifestReader.Tests (116)
FakeManifestProvider.cs (2)
30Path.GetFileNameWithoutExtension(filePath.manifest), 31Path.GetDirectoryName(filePath.manifest)!,
ManifestReaderFunctionalTests.cs (4)
14ManifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 28.Be(Path.Combine("fakepath", "template-packs", "xamarin.android.templates.1.0.3.nupkg")); 42androidWorkloads.Path.Should().Be(Path.Combine("fakepath", "packs", "Xamarin.Android.Sdk", "8.4.7")); 89var manifestPath = Path.Combine(testFolder, "manifest.json");
ManifestTests.cs (10)
21string GetSampleManifestPath(string name) => Path.Combine(SampleProjectPath, name); 52buildToolsPack.Path.Should().Be(Path.Combine(fakeRootPath, "packs", "Xamarin.Android.BuildTools.Win64Host", "8.4.7")); 95var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 97var additionalRoot = Path.Combine(testDirectory, "additionalPackRoot"); 100var defaultPackPath = Path.Combine(dotnetRoot, "packs", "Xamarin.Android.Sdk", "8.4.7"); 101var additionalPackPath = Path.Combine(additionalRoot, "packs", "Xamarin.Android.Sdk", "8.4.7"); 127var dotnetRoot = Path.Combine(testDirectory, "dotnet"); 129var additionalRoot = Path.Combine(testDirectory, "additionalPackRoot"); 131var defaultPackPath = Path.Combine(dotnetRoot, "packs", "Xamarin.Android.Sdk", "8.4.7"); 238static string MakePathNative(string path) => path.Replace('/', Path.DirectorySeparatorChar);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
SdkDirectoryWorkloadManifestProviderTests.cs (90)
28_fakeDotnetRootDirectory = Path.Combine(_testDirectory, "dotnet"); 29_manifestRoot = Path.Combine(_fakeDotnetRootDirectory, "sdk-manifests"); 30_manifestVersionBandDirectory = Path.Combine(_manifestRoot, featureBand); 49var installStateLocation = WorkloadInstallType.GetInstallStateFolder(new SdkFeatureBand("8.0.400"), Path.GetDirectoryName(_manifestRoot)); 50var installStateFilePath = Path.Combine(installStateLocation, "default.json"); 65Directory.Delete(Path.Combine(_manifestRoot, "8.0.400"), recursive: true); 105Directory.Delete(Path.Combine(_manifestRoot, "8.0.100"), recursive: true); 106Directory.Delete(Path.Combine(_manifestRoot, "8.0.200"), recursive: true); 107Directory.Delete(Path.Combine(_manifestRoot, "8.0.200-rc.2"), recursive: true); 117Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Android")); 118File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "Android", "WorkloadManifest.json"), androidManifestFileContent); 119Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "iOS")); 120File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "iOS", "WorkloadManifest.json"), iosManifestFileContent); 136Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Android")); 137File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "Android", "WorkloadManifest.json"), androidManifestFileContent); 162Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Android")); 222var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", "8.0.100", "IncludedWorkloadManifests.txt"); 223Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 313globalJsonPath = Path.Combine(_testDirectory, "global.json"); 393var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", "8.0.201", "IncludedWorkloadManifests.txt"); 394Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 456var installStateLocation = WorkloadInstallType.GetInstallStateFolder(new SdkFeatureBand("8.0.200"), Path.GetDirectoryName(_manifestRoot)); 457var installStateFilePath = Path.Combine(installStateLocation, "default.json"); 463var workloadSetDirectory = Path.Combine(_manifestRoot, "8.0.200", "workloadsets", "8.0.200"); 465File.WriteAllText(Path.Combine(workloadSetDirectory, "1.workloadset.json"), """ 470File.WriteAllText(Path.Combine(workloadSetDirectory, "2.workloadset.json"), """ 498var workloadSetDirectory = Path.Combine(_manifestRoot, "8.0.200", "workloadsets", "8.0.200"); 500File.WriteAllText(Path.Combine(workloadSetDirectory, "1.workloadset.json"), """ 505File.WriteAllText(Path.Combine(workloadSetDirectory, "2.workloadset.json"), """ 521string? globalJsonPath = Path.Combine(_testDirectory, "global.json"); 563string? globalJsonPath = Path.Combine(_testDirectory, "global.json"); 594string? globalJsonPath = Path.Combine(_testDirectory, "global.json"); 881var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", "8.0.201", "IncludedWorkloadManifests.txt"); 882Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 915string? globalJsonPath = Path.Combine(_testDirectory, "global.json"); 964string? globalJsonPath = Path.Combine(_testDirectory, "global.json"); 1011var additionalManifestDirectory = Path.Combine(_testDirectory, "AdditionalManifests"); 1018Directory.CreateDirectory(Path.Combine(additionalManifestDirectory, sdkVersion, "Android")); 1019File.WriteAllText(Path.Combine(additionalManifestDirectory, sdkVersion, "Android", "WorkloadManifest.json"), "Android: AndroidContent"); 1022Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "iOS")); 1023File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "iOS", "WorkloadManifest.json"), "iOS: iOSContent"); 1041var additionalManifestDirectory = Path.Combine(_testDirectory, "AdditionalManifests"); 1048Directory.CreateDirectory(Path.Combine(additionalManifestDirectory, sdkVersion, "Android")); 1049File.WriteAllText(Path.Combine(additionalManifestDirectory, sdkVersion, "Android", "WorkloadManifest.json"), "Android: OverridingAndroidContent"); 1052Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Android")); 1053File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "Android", "WorkloadManifest.json"), "Android: OverriddenAndroidContent"); 1071var additionalManifestDirectory1 = Path.Combine(_testDirectory, "AdditionalManifests1"); 1073var additionalManifestDirectory2 = Path.Combine(_testDirectory, "AdditionalManifests2"); 1077environmentMock.Add(EnvironmentVariableNames.WORKLOAD_MANIFEST_ROOTS, additionalManifestDirectory1 + Path.PathSeparator + additionalManifestDirectory2); 1081Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "iOS")); 1082File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "iOS", "WorkloadManifest.json"), "iOS: iOSContent"); 1084Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Android")); 1085File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "Android", "WorkloadManifest.json"), "Android: DefaultAndroidContent"); 1088Directory.CreateDirectory(Path.Combine(additionalManifestDirectory1, sdkVersion, "Android")); 1089File.WriteAllText(Path.Combine(additionalManifestDirectory1, sdkVersion, "Android", "WorkloadManifest.json"), "Android: AndroidContent1"); 1092Directory.CreateDirectory(Path.Combine(additionalManifestDirectory2, sdkVersion, "Android")); 1093File.WriteAllText(Path.Combine(additionalManifestDirectory2, sdkVersion, "Android", "WorkloadManifest.json"), "Android: AndroidContent2"); 1095Directory.CreateDirectory(Path.Combine(additionalManifestDirectory2, sdkVersion, "Test")); 1096File.WriteAllText(Path.Combine(additionalManifestDirectory2, sdkVersion, "Test", "WorkloadManifest.json"), "Test: TestContent2"); 1112var additionalManifestDirectory = Path.Combine(_testDirectory, "AdditionalManifests"); 1118Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Android")); 1119File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "Android", "WorkloadManifest.json"), "Android: AndroidContent"); 1135Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "iOS")); 1136File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "iOS", "WorkloadManifest.json"), "iOS: iOSContent"); 1137Directory.CreateDirectory(Path.Combine(_manifestVersionBandDirectory, "Microsoft.NET.Workload.Android")); 1138File.WriteAllText(Path.Combine(_manifestVersionBandDirectory, "Microsoft.NET.Workload.Android", "WorkloadManifest.json"), "Microsoft.NET.Workload.Android: AndroidContent"); 1167var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", "6.0.100", "IncludedWorkloadManifests.txt"); 1168Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 1198var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", prev4Version, "IncludedWorkloadManifests.txt"); 1199Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 1229var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", prev4Version, "IncludedWorkloadManifests.txt"); 1230Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 1257var knownWorkloadsFilePath = Path.Combine(_fakeDotnetRootDirectory, "sdk", currentSdkVersion, "IncludedWorkloadManifests.txt"); 1258Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 1279var manifestDirectory = Path.Combine(manifestRoot, featureBand, manifestId); 1282manifestDirectory = Path.Combine(manifestDirectory, manifestVersion); 1295File.WriteAllText(Path.Combine(manifestDirectory, "WorkloadManifest.json"), manifestContents); 1301var installStateLocation = WorkloadInstallType.GetInstallStateFolder(new SdkFeatureBand(featureBand), Path.GetDirectoryName(manifestRoot)); 1302var installStateFilePath = Path.Combine(installStateLocation, "default.json"); 1308var workloadSetDirectory = Path.Combine(manifestRoot, featureBand, "workloadsets", workloadSetVersion); 1313File.WriteAllText(Path.Combine(workloadSetDirectory, "workloadset.workloadset.json"), workloadSetContents); 1318var installStateFolder = Path.Combine(_fakeDotnetRootDirectory ?? string.Empty, "metadata", "workloads", RuntimeInformation.ProcessArchitecture.ToString(), featureBand, "InstallState"); 1321string installStatePath = Path.Combine(installStateFolder, "default.json"); 1332var fakeDotnetRootDirectory = Path.Combine(testDirectory, "dotnet"); 1335var manifestDirectory6 = Path.Combine(fakeDotnetRootDirectory, "sdk-manifests", "6.0.100"); 1337Directory.CreateDirectory(Path.Combine(manifestDirectory6, "iOS")); 1338File.WriteAllText(Path.Combine(manifestDirectory6, "iOS", "WorkloadManifest.json"), "iOS: iOS-6.0.100"); 1340var knownWorkloadsFilePath = Path.Combine(fakeDotnetRootDirectory, "sdk", "6.0.100", "KnownWorkloadManifests.txt"); 1341Directory.CreateDirectory(Path.GetDirectoryName(knownWorkloadsFilePath) ?? string.Empty); 1442manifestInfo.ManifestDirectory.Should().Be(Path.Combine(_manifestRoot, "8.0.100", "ios", "11.0.2"));
WorkloadResolverTests.cs (3)
19var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 46var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 57var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json");
WorkloadSuggestionFinderTests.cs (6)
16ManifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "Sample.json"); 204var versionDir = Path.GetDirectoryName(fileName); 205var idDir = Path.GetDirectoryName(versionDir)!; 206return installedPacks.Contains(Path.GetFileName(idDir)); 210var idDir = Path.GetDirectoryName(dirName)!; 211return installedPacks.Contains(Path.GetFileName(idDir));
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (21)
CachingWorkloadResolver.cs (6)
72string sentinelPath = Path.Combine(Path.GetDirectoryName(typeof(CachingWorkloadResolver).Assembly.Location) ?? string.Empty, "DisableWorkloadResolver.sentinel"); 124string sdkPackSdkFolder = Path.Combine(sdkPackInfo.Path, "Sdk"); 125string autoImportPath = Path.Combine(sdkPackSdkFolder, "AutoImport.props"); 142var workloadManifestTargetPath = Path.Combine(manifestDirectory, "WorkloadManifest.targets"); 158return new SinglePathResolutionResult(Path.Combine(packInfo.Path, "Sdk"));
CliFolderPathCalculatorCore.cs (1)
19return Path.Combine(homePath, DotnetProfileDirectoryName);
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());
WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
WorkloadSdkResolver.cs (4)
50var sdkVersion = Path.GetFileName(sdkDirectory); 78var sdkDirectory = Path.GetDirectoryName(typeof(DotnetFiles).Assembly.Location); 109startDir = Path.GetDirectoryName(context.SolutionFilePath); 113startDir = Path.GetDirectoryName(context.ProjectFilePath);
Microsoft.NET.TestFramework (185)
AspNetSdkTest.cs (5)
64foreach (string assetPath in Directory.EnumerateFiles(Path.Combine(_testAssetsManager.TestAssetsRoot, "WasmOverride"))) 65File.Copy(assetPath, Path.Combine(projectDirectory.Path, Path.GetFileName(assetPath))); 141for (i = 0; command.WorkingDirectory is not null && File.Exists(Path.Combine(command.WorkingDirectory, $"msbuild{i}.binlog")) && i < 20; i++) { } 159for (i = 0; command.WorkingDirectory is not null && File.Exists(Path.Combine(command.WorkingDirectory, $"msbuild{i}.binlog")) && i < 20; i++) { }
Assertions\CommandResultAssertions.cs (10)
200File.Exists(Path.Combine(unzipped, filePath)).Should().BeTrue(AppendDiagnosticsTo($"NuGet Package did not contain file {filePath}.")); 212var directory = Path.GetDirectoryName(pattern); 213var path = Path.Combine(unzipped, directory ?? string.Empty); 214var searchPattern = Path.GetFileName(pattern); 229var directory = Path.GetDirectoryName(pattern); 230var path = Path.Combine(unzipped, directory ?? string.Empty); 231var searchPattern = Path.GetFileName(pattern); 246File.Exists(Path.Combine(unzipped, filePath)).Should().BeFalse(AppendDiagnosticsTo($"NuGet Package contained file: {filePath}.")); 267var unzipped = Path.Combine(nupkgPath, "..", Path.GetFileNameWithoutExtension(nupkgPath));
Assertions\DependencyContextAssertions.cs (6)
31var nativeFilenames = nativeAssets.Select(n => Path.GetFileName(n)); 53var assemblyFiles = assemblyNames.Select(an => Path.Combine(folder, an.Name + ".dll")); 68if (Path.GetFileNameWithoutExtension(f) == "apphost") 70return Path.Combine(folder, appName + Constants.ExeSuffix); 74return Path.Combine(folder, Path.GetFileName(f));
Assertions\DirectoryInfoAssertions.cs (2)
31var file = _dirInfo.EnumerateFiles(expectedFile, SearchOption.TopDirectoryOnly).SingleOrDefault() ?? new FileInfo(Path.Combine(_dirInfo.FullName, expectedFile)); 38var file = _dirInfo.EnumerateFiles(expectedFile, SearchOption.TopDirectoryOnly).SingleOrDefault() ?? new FileInfo(Path.Combine(_dirInfo.FullName, expectedFile));
Assertions\DirectoryInfoExtensions.cs (2)
15return new DirectoryInfo(Path.Combine(dir.FullName, name)); 20return new FileInfo(Path.Combine(dir.FullName, name));
Commands\ComposeStoreCommand.cs (3)
24string output = Path.Combine(ProjectRootPath, "bin", BuildRelativeOutputPath(targetFramework, configuration, runtimeIdentifier, platformIdentifier)); 30return Path.Combine(GetOutputDirectory().FullName, $"{appName}.dll"); 41return Path.Combine(platformIdentifier ?? string.Empty, configuration ?? string.Empty, arch, targetFramework ?? string.Empty, PublishSubfolderName);
Commands\DotnetBuildCommand.cs (2)
24WorkingDirectory = Path.Combine(testAsset.TestRoot, testAsset.TestProject.Name); 35var projectPath = Path.Combine(TestAsset.Path, TestAsset.TestProject.Name);
Commands\GetValuesCommand.cs (3)
64string customAfterDirectoryBuildTargetsPath = Path.Combine( 154string fullFileName = Path.Combine(outputDirectory.FullName, outputFilename); 195string output = Path.Combine(ProjectRootPath, "bin", configuration, targetFramework);
Commands\MSBuildCommand.cs (7)
21public string FullPathProjectFile => Path.Combine(ProjectRootPath, ProjectFile); 49string fullPathToProject = Path.Combine(projectRootPath, relativePathToProject); 85string output = Path.Combine(ProjectRootPath, "bin", platform, configuration, targetFramework, runtimeIdentifier); 100string output = Path.Combine(ProjectRootPath, "obj", configuration, targetFramework, runtimeIdentifier); 111string output = Path.Combine(ProjectRootPath, "bin", configuration); 119string output = Path.Combine(ProjectRootPath, "bin", configuration); 125string output = Path.Combine(ProjectRootPath, "obj");
Commands\NuGetExeRestoreCommand.cs (4)
15public string FullPathProjectFile => Path.Combine(ProjectRootPath, ProjectFile); 35nugetExePath = Path.Combine(Path.GetDirectoryName(nugetExePath) ?? string.Empty, NuGetExeVersion, "nuget.exe"); 40string directory = Path.GetDirectoryName(nugetExePath) ?? string.Empty;
Commands\PackCommand.cs (4)
22packageId = Path.GetFileNameWithoutExtension(ProjectFile); 25return Path.Combine(GetBaseIntermediateDirectory().FullName, configuration, $"{packageId}.{packageVersion}.nuspec"); 32packageId = Path.GetFileNameWithoutExtension(ProjectFile); 35return Path.Combine(GetPackageDirectory(configuration).FullName, $"{packageId}.{packageVersion}.nupkg");
Commands\PublishCommand.cs (2)
37return new DirectoryInfo(Path.Combine(baseDirectory.FullName, PublishSubfolderName)); 42return Path.Combine(GetOutputDirectory(targetFramework).FullName, $"{appName}.dll");
Commands\TestCommand.cs (3)
170string fileToShow = Path.GetFileNameWithoutExtension(spec.FileName!).Equals("dotnet", StringComparison.OrdinalIgnoreCase) ? 184File.Copy(binlogFile, Path.Combine(uploadRoot, Path.GetFileName(binlogFile)), true);
Mock\FileSystemMockBuilder.cs (10)
27_actions.Add(() => _mockFileSystemModel?.CreateDirectory(Path.GetDirectoryName(name) ?? string.Empty)); 38_actions.Add(() => _mockFileSystemModel?.CreateFile(Path.Combine(basePath, file), "")); 51TemporaryFolder = Path.GetTempPath(); 88temporaryFolder ?? Path.Combine(fileSystemMockWorkingDirectory, "mockTemporaryFolder"); 163if (!Path.IsPathRooted(path)) 165path = Path.Combine(WorkingDirectory, path); 268if (Path.IsPathRooted(path)) 548.Select(s => Path.Combine(path, s.Key))) ?? Enumerable.Empty<string>(); 557.Select(s => Path.Combine(path, s.Key))) ?? Enumerable.Empty<string>(); 565subs => subs.Select(s => Path.Combine(path, s.Key))) ?? Enumerable.Empty<string>();
NuGetConfigWriter.cs (1)
16string configFilePath = Path.Combine(folder, "NuGet.Config");
OutputPathCalculator.cs (32)
36projectPath = Path.Combine(originalProjectPath, testProject.Name); 78calculator.ArtifactsPath = Path.Combine(Path.GetDirectoryName(directoryBuildPropsFile) ?? string.Empty, "artifacts"); 82calculator.ArtifactsPath = Path.Combine(Path.GetDirectoryName(projectPath) ?? string.Empty, "artifacts"); 103calculator.ArtifactsPath = Path.Combine(Path.GetDirectoryName(projectPath) ?? string.Empty, "artifacts"); 143calculator.ArtifactsPath = Path.Combine(Path.GetDirectoryName(directoryBuildPropsFile) ?? string.Empty, "artifacts"); 154string? folder = Path.GetDirectoryName(projectPath); 157string directoryBuildPropsFile = Path.Combine(folder, "Directory.Build.props"); 162folder = Path.GetDirectoryName(folder); 192return Path.Combine(ArtifactsPath ?? string.Empty, "bin", Path.GetFileNameWithoutExtension(ProjectPath) ?? string.Empty, pivot); 196return Path.Combine(ArtifactsPath ?? string.Empty, "bin", pivot); 208string output = Path.Combine(Path.GetDirectoryName(ProjectPath) ?? string.Empty, "bin", platform, configuration, targetFramework, runtimeIdentifier); 213string output = Path.Combine(Path.GetDirectoryName(ProjectPath) ?? string.Empty, "bin", platform, configuration); 239return Path.Combine(ArtifactsPath ?? string.Empty, "publish", Path.GetFileNameWithoutExtension(ProjectPath) ?? string.Empty, pivot); 243return Path.Combine(ArtifactsPath ?? string.Empty, "publish", pivot); 253string output = Path.Combine(Path.GetDirectoryName(ProjectPath) ?? string.Empty, "bin", platform, configuration, targetFramework, runtimeIdentifier, "publish"); 278return Path.Combine(ArtifactsPath ?? string.Empty, "obj", Path.GetFileNameWithoutExtension(ProjectPath) ?? string.Empty, pivot); 282return Path.Combine(ArtifactsPath ?? string.Empty, "obj", pivot); 291string output = Path.Combine(Path.GetDirectoryName(ProjectPath) ?? string.Empty, "obj", configuration, targetFramework, runtimeIdentifier); 299return Path.Combine(ArtifactsPath ?? string.Empty, "package", configuration.ToLowerInvariant()); 303return Path.Combine(Path.GetDirectoryName(ProjectPath) ?? string.Empty, "bin", configuration);
ProjectConstruction\TestProject.cs (17)
131string targetFolder = Path.Combine(targetTestAsset.Path, Name ?? string.Empty); 134string targetProjectPath = Path.Combine(targetFolder, Name + TargetExtension); 137string sourceProjectBase = Path.Combine(testProjectsSourceFolder, "ProjectConstruction"); 140sourceProject = Path.Combine(sourceProjectBase, "SdkProject", "SdkProject.csproj"); 144sourceProject = Path.Combine(sourceProjectBase, "NetFrameworkProjectVB", "NetFrameworkProject.vbproj"); 148sourceProject = Path.Combine(sourceProjectBase, "NetFrameworkProject", "NetFrameworkProject.csproj"); 152foreach (var file in Directory.GetFiles(Path.GetDirectoryName(sourceProject) ?? string.Empty)) 156File.Copy(file, Path.Combine(targetFolder, Path.GetFileName(file))); 373var customAfterDirectoryBuildTargetsPath = new FileInfo(Path.Combine(targetFolder, "obj", "Custom.After.Directory.Build.targets")); 437string sourcePath = Path.Combine(targetFolder, Name + "Program.cs"); 466string sourcePath = Path.Combine(targetFolder, Name + ".cs"); 473var targetPath = Path.Combine(targetFolder, kvp.Key); 474Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!); 502string intermediateOutputPath = Path.Combine(testRoot, Name ?? string.Empty, "obj", configuration, targetFramework ?? TargetFrameworks); 504foreach (var line in File.ReadAllLines(Path.Combine(intermediateOutputPath, "PropertyValues.txt"))) 520return OutputPathCalculator.FromProject(Path.Combine(testRoot, Name ?? string.Empty, Name + ".csproj"), this);
TestAsset.cs (11)
56if (System.IO.Path.GetFileName(file).EndsWith("proj")) 89if (System.IO.Path.GetFileName(srcFile).EndsWith("proj") || System.IO.Path.GetFileName(srcFile).EndsWith("xml")) 236if (projectName is not null && !projectName.Equals(System.IO.Path.GetFileNameWithoutExtension(path), StringComparison.OrdinalIgnoreCase)) 278return new RestoreCommand(log, System.IO.Path.Combine(TestRoot, relativePath)); 319var binFolder = $"{System.IO.Path.DirectorySeparatorChar}bin"; 320var objFolder = $"{System.IO.Path.DirectorySeparatorChar}obj"; 331$"{System.IO.Path.DirectorySeparatorChar}obj{System.IO.Path.DirectorySeparatorChar}"; 333$"{System.IO.Path.DirectorySeparatorChar}bin{System.IO.Path.DirectorySeparatorChar}";
TestAssetsManager.cs (3)
45var fileName = Path.GetFileNameWithoutExtension(callerFilePath); 163string testProjectDirectory = Path.Combine(TestAssetsRoot, testAssetSubdirectory, testProjectName); 203var directoryPath = Path.Combine(baseDirectory, directoryName.ToString());
TestContext.cs (31)
106DirectoryInfo sdksDir = new(Path.Combine(dotnetRoot, "sdk")); 153if (Directory.Exists(Path.Combine(AppContext.BaseDirectory, "TestAssets"))) 156testContext.TestAssetsDirectory = Path.Combine(AppContext.BaseDirectory, "TestAssets"); 164string? FindFolder = FindFolderInTree(Path.Combine("test", "TestAssets"), AppContext.BaseDirectory); 201testContext.TestExecutionDirectory = Path.Combine(Path.GetTempPath(), "dotnetSdkTests", Path.GetRandomFileName()); 206string? FindFolder2 = FindFolderInTree(Path.Combine("test", "TestAssets"), AppContext.BaseDirectory); 209testContext.TestExecutionDirectory = Path.Combine(FindFolder1, "tmp", repoConfiguration, "testing"); 222artifactsDir = Path.Combine(repoRoot, "artifacts"); 227testContext.TestGlobalPackagesFolder = Path.Combine(artifactsDir, ".nuget", "packages"); 231testContext.TestGlobalPackagesFolder = Path.Combine(testContext.TestExecutionDirectory, ".nuget", "packages"); 236testContext.NuGetFallbackFolder = Path.Combine(artifactsDir, ".nuget", "NuGetFallbackFolder"); 237testContext.NuGetExePath = Path.Combine(artifactsDir, ".nuget", $"nuget{Constants.ExeSuffix}"); 238testContext.NuGetCachePath = Path.Combine(artifactsDir, ".nuget", "packages"); 240testContext.TestPackages = Path.Combine(artifactsDir, "tmp", repoConfiguration, "testing", "testpackages"); 244testContext.NuGetFallbackFolder = Path.Combine(testContext.TestExecutionDirectory, ".nuget", "NuGetFallbackFolder"); 245testContext.NuGetExePath = Path.Combine(testContext.TestExecutionDirectory, ".nuget", $"nuget{Constants.ExeSuffix}"); 246testContext.NuGetCachePath = Path.Combine(testContext.TestExecutionDirectory, ".nuget", "packages"); 248var testPackages = Path.Combine(testContext.TestExecutionDirectory, "Testpackages"); 257?? Path.Combine(testContext.TestExecutionDirectory, ".nuget"); 259testContext.NuGetFallbackFolder = Path.Combine(nugetFolder, "NuGetFallbackFolder"); 260testContext.NuGetExePath = Path.Combine(nugetFolder, $"nuget{Constants.ExeSuffix}"); 261testContext.NuGetCachePath = Path.Combine(nugetFolder, "packages"); 263var testPackages = Path.Combine(testContext.TestExecutionDirectory, "Testpackages"); 284Path.Combine(testContext.ToolsetUnderTest.SdkFolderUnderTest, "MSBuild.dll")); 288Path.Combine(testContext.ToolsetUnderTest.SdksPath)); 302var gitPath = Path.Combine(directory, ".git"); 322ret = Path.Combine(startPath, relativePath); 331string path = Path.Combine(currentPath, relativePath); 361string globalJsonPath = Path.Combine(path, "global.json");
TestPackageReference.cs (1)
28return File.Exists(Path.Combine(NupkgPath ?? string.Empty, string.Concat(ID + "." + Version + ".nupkg")));
ToolsetInfo.cs (24)
78DotNetHostPath = Path.Combine(dotNetRoot, $"dotnet{Constants.ExeSuffix}"); 80_sdkFolderUnderTest = new Lazy<string>(() => Path.Combine(DotNetRoot, "sdk", SdkVersion)); 81_sdksPath = new Lazy<string>(() => Path.Combine(SdkFolderUnderTest, "Sdks")); 143var msbuildBinPath = Path.GetDirectoryName(FullFrameworkMSBuildPath); 148return Path.Combine(msbuildRoot ?? string.Empty, @"Microsoft\Microsoft.NET.Build.Extensions"); 152return Path.Combine(DotNetRoot, "sdk", SdkVersion, @"Microsoft\Microsoft.NET.Build.Extensions"); 161string sdksPath = Path.Combine(DotNetRoot, "sdk", SdkVersion, "Sdks"); 180environment["MicrosoftNETBuildExtensionsTargets"] = Path.Combine(microsoftNETBuildExtensionsPath, "Microsoft.NET.Build.Extensions.targets"); 185environment["CustomAfterMicrosoftCommonTargets"] = Path.Combine(sdksPath, "Microsoft.NET.Build.Extensions", 251=> Path.Combine(dotnetRoot ?? string.Empty, "dotnet" + Constants.ExeSuffix); 265dotnetRoot = Path.GetDirectoryName(commandLine.DotnetHostPath); 270dotnetRoot = Path.Combine(repoArtifactsDir, "bin", "redist", configuration, "dotnet"); 282dotnetRoot = Path.GetDirectoryName(pathToDotnet); 321ret.MicrosoftNETBuildExtensionsPathOverride = Path.GetDirectoryName(microsoftNETBuildExtensionsTargetsFromEnvironment); 326string sdksPath = Path.Combine(repoArtifactsDir, "bin", configuration, "Sdks"); 327var buildExtensionsSdkPath = Path.Combine(sdksPath, "Microsoft.NET.Build.Extensions"); 328ret.MicrosoftNETBuildExtensionsPathOverride = Path.Combine(buildExtensionsSdkPath, "msbuildExtensions", "Microsoft", "Microsoft.NET.Build.Extensions"); 336ret.SdkResolverPath = Path.Combine(repoArtifactsDir, "bin", "Microsoft.DotNet.MSBuildSdkResolver", configuration, "net472", "SdkResolvers"); 340ret.SdkResolverPath = Path.Combine(commandLine.MsbuildAdditionalSdkResolverFolder, configuration, "net472", "SdkResolvers"); 344ret.SdkResolverPath = Path.Combine(Environment.GetEnvironmentVariable("DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER")!, configuration, "net472", "SdkResolvers"); 354ret.CliHomePath = Path.Combine(repoArtifactsDir, "tmp", configuration, "testing"); 384string? result = extensions.SelectMany(ext => paths?.Select(p => Path.Combine(p, command + ext)) ?? Array.Empty<string>()) 402string? fullMSBuildDirectory = Path.GetDirectoryName(FullFrameworkMSBuildPath); 403string extensionsImportAfterPath = Path.Combine(fullMSBuildDirectory ?? string.Empty, "..", "Microsoft.Common.targets", "ImportAfter", "Microsoft.NET.Build.Extensions.targets");
Utilities\FileThumbPrint.cs (1)
43directoryPath = System.IO.Path.Combine(testAsset.TestRoot, directoryPath);
Utilities\TestPathUtility.cs (1)
21return Path.Combine(linkTarget.FullName, path[tmpPath.Length..]);
Microsoft.NET.ToolPack.Tests (31)
GivenThatWeWantToPackAToolProject.cs (2)
107var tmpfilePath = Path.Combine(_testRoot, "temp", Path.GetRandomFileName());
GivenThatWeWantToPackAToolProjectWithExplicitConfig.cs (6)
40var tmpfilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 75var tmpfilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
GivenThatWeWantToPackAToolProjectWithGeneratePackageOnBuild.cs (2)
96var appProjectDirectory = Path.Combine(testAsset.TestRoot); 107return Path.GetFileNameWithoutExtension(projectPath).Equals(AppName, StringComparison.OrdinalIgnoreCase);
GivenThatWeWantToPackAToolProjectWithPackagedShim.cs (19)
42_packageId = Path.GetFileNameWithoutExtension(packCommand.ProjectFile); 142string shimoutputPath = Path.Combine(TestContext.Current.TestExecutionDirectory, "shimoutput"); 160string windowShimPath = Path.Combine(shimoutputPath, $"shims/{targetFramework}/win-x64/{_customToolCommandName}.exe"); 162string osxShimPath = Path.Combine(shimoutputPath, $"shims/{targetFramework}/{ToolsetInfo.LatestMacRuntimeIdentifier}-x64/{_customToolCommandName}"); 186string windowShimPath = Path.Combine(outputDirectory.FullName, $"shims/{targetFramework}/win-x64/{_customToolCommandName}.exe"); 188string osxShimPath = Path.Combine(outputDirectory.FullName, $"shims/{targetFramework}/{ToolsetInfo.LatestMacRuntimeIdentifier}-x64/{_customToolCommandName}"); 215string windowShimPath = Path.Combine(outputDirectory.FullName, $"shims/netcoreapp2.1/win-x64/{_customToolCommandName}.exe"); 217string osxShimPath = Path.Combine(outputDirectory.FullName, $"shims/netcoreapp2.1/{ToolsetInfo.LatestMacRuntimeIdentifier}-x64/{_customToolCommandName}"); 241string windowShimPath = Path.Combine(outputDirectory.FullName, $"shims/{targetFramework}.1/win-x64/{_customToolCommandName}.exe"); 266Path.Combine(ciOutputRoot, "binlog", $"{nameof(It_contains_shim_with_no_build)}_{multiTarget}_{targetFramework}.binlog") : 331_packageId = Path.GetFileNameWithoutExtension(packCommand.ProjectFile); 400var packCommand = new PackCommand(Log, Path.Combine(asset.Path, testProject.Name)); 414var tmpfilePath = Path.Combine(asset.TestRoot, "temp", Path.GetRandomFileName()); 429var simulateToolPathRoot = Path.Combine(testRoot, "temp", Path.GetRandomFileName()); 440string shimPath = Path.Combine(simulateToolPathRoot, $"{_customToolCommandName}.exe"); 465Path.Combine( 479Path.Combine(toolLayoutDirectory, nupkgAssetName);
GivenThatWeWantToTestPackAToolProject.cs (1)
19var appProjectDirectory = Path.Combine(testAsset.TestRoot, "Test");
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.TemplateEngine.Cli (20)
Alias\AliasRegistry.cs (1)
19_aliasesFilePath = Path.Combine(_environmentSettings.Paths.HostVersionSettingsDir, "aliases.json");
CliTemplateEngineHost.cs (3)
39OutputPath = outputPath != null ? Path.Combine(workingPath, outputPath) : workingPath; 55string checkPath = Path.Combine(workingPath, fileName); 59workingPath = 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)
46if (fileSystem.FileExists(Path.Combine(currentDirectory, "global.json")) || 47fileSystem.FileExists(Path.Combine(currentDirectory, ".git")) || 48fileSystem.DirectoryExists(Path.Combine(currentDirectory, ".git"))) 112string newJsonFilePath = Path.Combine(detectRepoRoot ? GetRootDirectory(environment.Host.FileSystem, outputBasePath) : outputBasePath, jsonFileName); 221string? directory = fileSystem.DirectoryExists(startPath) ? startPath : Path.GetDirectoryName(startPath); 240directory = Path.GetPathRoot(directory) != directory ? Directory.GetParent(directory)?.FullName : null;
PostActionProcessors\PostActionProcessorBase.cs (3)
25outputBasePath = Path.GetFullPath(outputBasePath); 43results.Add(Path.GetFullPath(change.TargetRelativePath, outputBasePath)); 108.Select(p => Path.GetFullPath(p, outputBasePath))
PostActionProcessors\ProcessStartPostActionProcessor.cs (2)
100string executableCombinedFileName = Path.Combine(Path.GetFullPath(outputBasePath), executableFileName);
TemplateInvoker.cs (2)
124Path.Combine(_cliTemplateEngineHost.OutputPath, targetPath), 131char[] invalidChars = Path.GetInvalidFileNameChars();
Microsoft.TemplateEngine.Cli.UnitTests (49)
BaseTest.cs (10)
11public static string DotnetNewTestAssets { get; } = VerifyExists(Path.Combine(TestContext.Current.TestAssetsDirectory, "TestPackages", "dotnet-new")); 16public static string DotnetNewTestPackagesBasePath { get; } = VerifyExists(Path.Combine(DotnetNewTestAssets, "nupkg_templates")); 21public static string DotnetNewTestTemplatesBasePath { get; } = VerifyExists(Path.Combine(DotnetNewTestAssets, "test_templates")); 31public static string RepoTemplatePackages { get; } = VerifyExists(Path.Combine(CodeBaseRoot, "template_feed")); 38string templateLocation = Path.GetFullPath(Path.Combine(DotnetNewTestTemplatesBasePath, templateName)); 48folder = Path.GetFullPath(folder); 58string repoRoot = Path.GetFullPath(Path.Combine(TestContext.Current.TestAssetsDirectory, "..", "..")); 63if (!File.Exists(Path.Combine(repoRoot, "sdk.slnx")))
ParserTests\MiscTests.cs (1)
205expected = expected?.Replace("$filePath", Path.GetFileName(existingFilePath));
PostActionDispatcherTests.cs (7)
305Path.GetTempPath(), 337Path.GetTempPath(), 368Path.GetTempPath(), 401Path.GetTempPath(), 432Path.GetTempPath(), 478Path.GetTempPath(), 521Path.GetTempPath(),
PostActionTests\AddJsonPropertyPostActionTests.cs (26)
199string jsonFilePath = Path.Combine(targetBasePath, jsonFileName); 309string jsonFilePath = Path.Combine(targetBasePath, jsonFileName); 344string jsonFilePath = Path.Combine(targetBasePath, jsonFileName); 353var dirWithGlobalJson = Path.Combine(tempPath, nameof(RepoRootDetectionShouldPreferGlobalJson_NoSlnInvolved)); 355physicalFileSystem.WriteAllText(Path.Combine(dirWithGlobalJson, "global.json"), "{}"); 356var subDir = Path.Combine(dirWithGlobalJson, "subdir"); 366var dirWithGlobalJson = Path.Combine(tempPath, nameof(RepoRootDetectionShouldPreferGlobalJson_SlnInSubDirectory)); 368physicalFileSystem.WriteAllText(Path.Combine(dirWithGlobalJson, "global.json"), "{}"); 369var subDir = Path.Combine(dirWithGlobalJson, "subdir"); 371physicalFileSystem.WriteAllText(Path.Combine(subDir, "MySolution.sln"), "{}"); 380var dirWithGlobalJson = Path.Combine(tempPath, nameof(RepoRootDetectionShouldPreferGlobalJson_SlnInParent)); 382physicalFileSystem.WriteAllText(Path.Combine(dirWithGlobalJson, "global.json"), "{}"); 383var subDir = Path.Combine(dirWithGlobalJson, "subdir"); 385physicalFileSystem.WriteAllText(Path.Combine(tempPath, "MySolution.sln"), "{}"); 394var dirWithGitDirectory = Path.Combine(tempPath, nameof(RepoRootDetectionShouldPreferGitDirectory_NoSlnInvolved)); 396physicalFileSystem.CreateDirectory(Path.Combine(dirWithGitDirectory, ".git")); 397var subDir = Path.Combine(dirWithGitDirectory, "subdir"); 407var dirWithGitDirectory = Path.Combine(tempPath, nameof(RepoRootDetectionShouldPreferGitDirectory_SlnInSubDirectory)); 409physicalFileSystem.CreateDirectory(Path.Combine(dirWithGitDirectory, ".git")); 410var subDir = Path.Combine(dirWithGitDirectory, "subdir"); 412physicalFileSystem.WriteAllText(Path.Combine(subDir, "MySolution.sln"), ""); 421var dirWithGitDirectory = Path.Combine(tempPath, nameof(RepoRootDetectionShouldPreferGitDirectory_SlnInParent)); 423physicalFileSystem.CreateDirectory(Path.Combine(dirWithGitDirectory, ".git")); 424var subDir = Path.Combine(dirWithGitDirectory, "subdir"); 426physicalFileSystem.WriteAllText(Path.Combine(tempPath, "MySolution.sln"), ""); 432string jsonFileFullPath = Path.Combine(targetBasePath, fileName);
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
TemplateSearchCoordinatorTests.cs (4)
559string targetPath = Path.Combine(fileLocation, "searchCacheV1.json"); 561return Path.Combine(fileLocation, "searchCacheV1.json"); 604string targetPath = Path.Combine(fileLocation, "searchCacheV2.json"); 615string targetPath = Path.Combine(fileLocation, "searchCacheV2.json");
Microsoft.VisualBasic.Core (78)
Microsoft\VisualBasic\CompilerServices\IOUtils.vb (10)
26If PathName.Length > 0 AndAlso PathName.Chars(PathName.Length - 1) = Path.DirectorySeparatorChar Then 27DirName = Path.GetFullPath(PathName) 33FileName = Path.GetFileName(PathName) 34DirName = Path.GetDirectoryName(PathName) 42If Path.IsPathRooted(PathName) Then 43DirName = Path.GetPathRoot(PathName) 46If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 47DirName = DirName & Path.DirectorySeparatorChar 51If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 52DirName = DirName & Path.DirectorySeparatorChar
Microsoft\VisualBasic\FileIO\FileSystem.vb (60)
71baseDirectory = IO.Path.GetFullPath(baseDirectory) ' Throw exceptions if BaseDirectoryPath is invalid. 73Return NormalizePath(IO.Path.Combine(baseDirectory, relativePath)) 92(file.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) Or 93file.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) Then 223Return IO.Path.GetFileName(path) 234''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath: If path is an invalid path.</exception> 241IO.Path.GetFullPath(path) 246Return IO.Path.GetDirectoryName(path.TrimEnd( 247IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar)) 476directory = IO.Path.GetFullPath(directory) 545''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath() exceptions: if FilePath is invalid.</exception> 656''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If directory is invalid.</exception> 663directory = IO.Path.GetFullPath(directory) 699''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If file is invalid.</exception> 837''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath for possible exceptions.</exception> 840Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(Path))) 852If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or 853path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then 883''' <exception cref="IO.Path.GetFullPath">IO.Path.GetFullPath exceptions: If SourceDirectoryPath or TargetDirectoryPath is invalid. 938If TargetDirectoryFullPath.Chars(SourceDirectoryFullPath.Length) = IO.Path.DirectorySeparatorChar Then 965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source") 966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target") 1041CopyOrMoveFile(Operation, SubFilePath, IO.Path.Combine(SourceDirectoryNode.TargetPath, IO.Path.GetFileName(SubFilePath)), 1083''' <exception cref="IO.Path.GetFullPath"> 1186Dim directoryFullPath As String = IO.Path.GetFullPath(directory) 1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath) 1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path) 1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path) 1464Dim FullPath As String = RemoveEndingSeparator(IO.Path.GetFullPath(IO.Path.Combine(Path, NewName))) 1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1498Return DInfo.GetFiles(IO.Path.GetFileName(FullPath))(0).FullName 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 1502Return DInfo.GetDirectories(IO.Path.GetFileName(FullPath))(0).FullName 1538Path1 = Path1.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1539Path2 = Path2.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1540Return String.Equals(IO.Path.GetPathRoot(Path1), IO.Path.GetPathRoot(Path2), StringComparison.OrdinalIgnoreCase) 1556If Not IO.Path.IsPathRooted(Path) Then 1560Path = Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1561Return String.Equals(Path, IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) 1571If IO.Path.IsPathRooted(Path) Then 1576If Path.Equals(IO.Path.GetPathRoot(Path), StringComparison.OrdinalIgnoreCase) Then 1582Return Path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath") 1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath") 1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path") 2056IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar, IO.Path.VolumeSeparatorChar} 2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath") 2103Dim SubTargetDirPath As String = IO.Path.Combine(m_TargetPath, IO.Path.GetFileName(SubDirPath))
Microsoft\VisualBasic\FileIO\SpecialDirectories.vb (1)
100Return GetDirectoryPath(IO.Path.GetTempPath(), SR.IO_SpecialDirectory_Temp)
Microsoft\VisualBasic\FileSystem.vb (7)
90IO.Directory.SetCurrentDirectory(Drive & Path.VolumeSeparatorChar) 123Dim CurrentPath As String = Path.GetFullPath(Drive & Path.VolumeSeparatorChar & ".") 366If Path.GetFileName(PathName).Length = 0 Then 386DirName = Path.GetDirectoryName(PathName) 392FileName = Path.GetFileName(PathName) 397DirName = DirName & Path.PathSeparator
Microsoft.VisualBasic.Forms.Tests (20)
System\Windows\Forms\FileLogTraceListenerTests.vb (5)
27Dim expectedBaseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) 48listener.FullLogFileName.Should.BeEquivalentTo(Path.Join(testDirectory, $"{expectedBaseFileName}.log")) 218fullLogFileName.Should.StartWith(Path.GetDirectoryName(Application.ExecutablePath)) 225If DirectoryIsAccessible(Path.GetDirectoryName(Application.ExecutablePath)) Then 260fullLogFileName.Should.StartWith(Path.GetTempPath)
System\Windows\Forms\FileSystemProxyTests.vb (5)
181Dim expected As String = Path.GetTempPath.TrimEnd(Path.DirectorySeparatorChar) 182FileSystemUtils.NormalizePath(Path.GetTempPath).Should.Be(expected) 410temp &= Path.DirectorySeparatorChar 411temp.Should.Be(Path.GetTempPath)
System\Windows\Forms\VbFileCleanupTestBaseTests.vb (4)
15CreateTempDirectory().Should.StartWith(Path.GetTempPath) 28CreateTempFile(tempDirectory).Should.StartWith(Path.GetTempPath) 35Dim directoryPath As String = Path.Join(CreateTempDirectory(), GetUniqueFileName) 50testDirectory.Should.Be(Path.GetDirectoryName(testFile1))
System\Windows\TestUtilities\VbFileCleanupTestBase.vb (6)
12Private Shared ReadOnly s_baseTempPath As String = Path.Join(Path.GetTempPath, "DownLoadTest9d9e3a8-7a46-4333-a0eb-4faf76994801") 49Dim filenameWithPath As String = Path.Join(sourceDirectoryName, filename) 85Return Path.Join(testDirectory, GetUniqueFileName()) 99folder = Path.Join(BaseTempPath, $"{memberName}{lineNumber}") 101folder = Path.Join(BaseTempPath, memberName)
Microsoft.VisualBasic.IntegrationTests (2)
InteractionTests.cs (2)
107string path = Path.Join(Path.GetTempPath(), GetUniqueName());
Microsoft.VisualBasic.Tests (51)
Microsoft\VisualBasic\ApplicationServices\AssemblyInfoTests.cs (1)
24assemblyInfo.DirectoryPath.Should().Be(Path.GetDirectoryName(assembly.Location));
Microsoft\VisualBasic\Devices\AudioTests.cs (2)
52string location = Path.Join(Path.GetTempPath(), GetUniqueName());
Microsoft\VisualBasic\MyServices\FileSystemProxyTests.cs (48)
40Assert.Equal(_fileSystem.CombinePath(Root, "Test2"), Path.Join(Root, "Test2")); 48Assert.Equal(_fileSystem.CombinePath(TestDirectory, "Test"), Path.Join(TestDirectory, "Test")); 54string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory"); 61string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory"); 79string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory"); 80string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory"); 109string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory"); 110string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory"); 182string FullPathToNewDirectory = Path.Join(TestDirectory, "NewDirectory"); 208string FullPathToNewDirectory = Path.Join(TestDirectory, "NewDirectory"); 220string FullPathToNewDirectory = Path.Join(TestDirectory, "NewDirectory"); 245Assert.False(_fileSystem.DirectoryExists(Path.Join(TestDirectory, "NewDirectory"))); 272Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_DirectoryNewSubDirectory{i}")); 279Assert.Contains(Path.Join(TestDirectory, $"GetDirectories_DirectoryNewSubDirectory{i}"), DirectoryList); 282Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_DirectoryNewSubDirectory0", $"NewSubSubDirectory")); 294Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_Directory_SearchOptionNewSubDirectory{i}")); 301Assert.Contains(Path.Join(TestDirectory, $"GetDirectories_Directory_SearchOptionNewSubDirectory{i}"), DirectoryList); 304Directory.CreateDirectory(Path.Join(TestDirectory, $"GetDirectories_Directory_SearchOptionNewSubDirectory0", $"NewSubSubDirectory")); 319CreatedDirectories.Add(Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory00{i}")).Name); 326string DirectoryName = Path.Join(TestDirectory, $"NewSubDirectory00{i}"); 330Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory000", $"NewSubSubDirectory000")); 342Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory{i}")); 345Directory.CreateDirectory(Path.Join(TestDirectory, $"NewSubDirectory0", $"NewSubSubDirectory")); 403Assert.Contains(Path.Join(TestDirectory, $"NewFile{i}"), FileList); 406Directory.CreateDirectory(Path.Join(TestDirectory, "GetFiles_DirectoryNewSubDirectory")); 415string NewSubDirectoryPath = Path.Join(TestDirectory, "GetFiles_Directory_SearchOptionNewSubDirectory"); 430Assert.Contains(Path.Join(TestDirectory, $"NewFile{i}"), FileList); 459string NewSubDirectoryPath = Path.Join(TestDirectory, "GetFiles_Directory_SearchOption_WildcardsNewSubDirectory"); 470Assert.Equal(_fileSystem.GetName(TestDirectory), Path.GetFileName(TestDirectory)); 476Assert.Equal(_fileSystem.GetParentPath(TestDirectory), Path.GetDirectoryName(TestDirectory)); 491string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory"); 492string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory"); 517string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory"); 518string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory"); 555string FullPathToSourceDirectory = Path.Join(TestDirectory, "SourceDirectory"); 556string FullPathToTargetDirectory = Path.Join(TestDirectory, "TargetDirectory"); 578string DestinationFileNameWithPath = Path.Join(TestDirectory, "NewName"); 596string DestinationFileNameWithPath = Path.Join(TestDirectory, "NewName"); 613string DestinationFileNameWithPath = Path.Join(TestDirectory, "NewName"); 641Assert.Throws<DirectoryNotFoundException>(() => _fileSystem.RenameDirectory(Path.Join(TestDirectory, "DoesNotExistDirectory"), "NewDirectory")); 642string OrigDirectoryWithPath = Path.Join(TestDirectory, "OriginalDirectory"); 646string DirectoryNameWithPath = Path.Join(TestDirectory, "DoesNotExist"); 650string NewFDirectoryPath = Path.Join(TestDirectory, "NewFDirectory"); 665Assert.Throws<FileNotFoundException>(() => _fileSystem.RenameFile(Path.Join(TestDirectory, "DoesNotExistFile"), "NewFile")); 673string NewFileWithPath = Path.Join(TestDirectory, "NewFile"); 678Directory.CreateDirectory(Path.Join(TestDirectory, "NewFDirectory")); 701TempFileNameWithPath = Path.Join(TempFileNameWithPath, PathFromBase); 704TempFileNameWithPath = Path.Join(TempFileNameWithPath, TestFileName);
Microsoft.VisualStudio.LanguageServices (55)
CommonControls\NewTypeDestinationSelectionViewModel.cs (2)
132if (!Path.GetExtension(trimmedFileName).Equals(_fileExtension, StringComparison.OrdinalIgnoreCase)) 138if (trimmedFileName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
EditAndContinue\EditAndContinueFeedbackDiagnosticFileProvider.cs (7)
62_tempDir = Path.GetTempPath(); 63var vsFeedbackTempDir = Path.Combine(_tempDir, VSFeedbackSemaphoreDir); 64_vsFeedbackSemaphoreFullPath = Path.Combine(vsFeedbackTempDir, VSFeedbackSemaphoreFileName); 94=> Path.Combine(Path.Combine(_tempDir, $"EnC_{_vsProcessId}", "Log")); 97=> Path.Combine(Path.Combine(_tempDir, $"EnC_{_vsProcessId}", ZipFileName));
GenerateType\GenerateTypeDialogViewModel.cs (2)
240if (trimmedFileName.IndexOfAny(Path.GetInvalidPathChars()) >= 0) 273this.FullFilePath = Path.GetFullPath(this.FullFilePath);
Implementation\AbstractEditorFactory.cs (3)
314projectToAddTo = AddEditorConfigFiles(projectToAddTo, Path.GetDirectoryName(filePath)); 385projectFolder = Path.GetDirectoryName(projectFolder); 397var editorConfigFile = Path.Combine(folder, EditorConfigFileName);
Interactive\VsResetInteractive.cs (2)
128var scriptsDir = Path.Combine(projectDir, "Scripts"); 129var outputDir = Path.Combine(projectDir, relativeOutputPath);
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (1)
65var newFileName = Path.ChangeExtension(typeName, language == LanguageNames.CSharp ? ".cs" : ".vb");
PdbSourceDocument\AbstractSourceLinkService.cs (1)
43Path.GetFileName(codeViewEntry.Path),
ProjectSystem\Legacy\AbstractLegacyProject.cs (6)
54private static readonly char[] PathSeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 84_projectDirectory = Path.GetDirectoryName(projectFilePath); 208var linkFolderPath = Path.GetDirectoryName(linkMetadata); 270outputDirectory = FileUtilities.ResolveRelativePath(outputDirectory, Path.GetDirectoryName(ProjectSystemProject.FilePath)); 278ProjectSystemProject.OutputFilePath = FileUtilities.NormalizeAbsolutePath(Path.Combine(outputDirectory, targetFileName));
ProjectSystem\Legacy\AbstractLegacyProject_IAnalyzerHost.cs (1)
27ruleSetFileFullPath = Path.GetFullPath(ruleSetFileFullPath);
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (3)
139yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5"); 140yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"); 351assemblyDir ??= Path.GetDirectoryName(fullPath);
ProjectSystem\RuleSets\RuleSetEventHandler.cs (4)
92if (Path.GetExtension(oldFileFullPath).Equals(".ruleset", StringComparison.OrdinalIgnoreCase)) 171Path.GetExtension(fileFullPath).Equals(".ruleset", StringComparison.OrdinalIgnoreCase)) 191Path.GetExtension(fileFullPath).Equals(".ruleset", StringComparison.OrdinalIgnoreCase)) 226var projectDirectoryFullPath = Path.GetDirectoryName(project.FullName);
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
59Path.GetFileName(_filePath));
ProjectSystem\VisualStudioWorkspaceImpl.cs (5)
953var baseName = Path.GetFileNameWithoutExtension(documentName); 954var extension = documentKind == TextDocumentKind.Document ? GetPreferredExtension(documentId) : Path.GetExtension(documentName); 956filePath = Path.Combine(folderPath, uniqueName); 1274Path.GetFileNameWithoutExtension(updatedInfo.Name), 1275Path.GetExtension(updatedInfo.Name));
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
48Path.GetFileName(_filePath));
Snippets\SnippetExpansionClient.cs (1)
1084var existingReferenceNames = originalProject.MetadataReferences.Select(r => Path.GetFileNameWithoutExtension(r.Display));
Telemetry\FileLogger.cs (2)
39_logFilePath = Path.Combine(Path.GetTempPath(), "Roslyn", "Telemetry", GetLogFileName());
UnusedReferences\Dialog\UnusedReferencesTableProvider.DataSource.cs (2)
35var solutionName = Path.GetFileName(solution.FilePath); 127? Path.GetFileName(ReferenceUpdate.ReferenceInfo.ItemSpecification)
Watson\FaultReporter.cs (5)
271var logPath = Path.Combine(Path.GetTempPath(), "VSLogs"); 287var logPath = Path.Combine(Path.GetTempPath(), "servicehub", "logs"); 322var name = Path.GetFileNameWithoutExtension(path);
Workspace\SourceGeneratedFileManager.cs (6)
94_temporaryDirectory = PathUtilities.EnsureTrailingSeparator(Path.Combine(Path.GetTempPath(), "VSGeneratedDocuments")); 120var temporaryFilePath = Path.Combine( 124document.HintName.Replace('/', Path.DirectorySeparatorChar)); 126Directory.CreateDirectory(Path.GetDirectoryName(temporaryFilePath)); 178var separatorIndex = slice.IndexOf(Path.DirectorySeparatorChar);
Microsoft.VisualStudio.LanguageServices.CSharp (5)
LanguageService\CSharpLanguageService_ICSharpProjectHost.cs (1)
19var projectName = Path.GetFileName(projectRoot.GetFullProjectName()); // GetFullProjectName returns the path to the project file w/o the extension?
ProjectSystemShim\CSharpProjectShim.ICSInputSet.cs (1)
53ProjectSystemProject.AssemblyName = Path.GetFileNameWithoutExtension(filename);
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
191var directory = Path.GetDirectoryName(_projectSystemProject.FilePath);
ProjectSystemShim\TempPECompilerService.cs (2)
34var baseDirectory = Path.GetDirectoryName(pszOutputFileName); 55Path.GetFileName(pszOutputFileName),
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (26)
PersistentStorage\AbstractPersistentStorageTests.cs (2)
873solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs")); 893solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs"));
ProjectSystemShim\CPS\AdditionalPropertiesTests.cs (3)
167Path.Combine(Path.GetDirectoryName(project.ProjectFilePath), "generated"), 170var path = Path.Combine(TempRoot.Root, "generated");
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (8)
94var expectedNewBinPath = Path.Combine(Path.GetTempPath(), newBinPath); 101var absoluteObjPath = Path.GetFullPath(Path.Combine(Path.GetTempPath(), relativeObjPath)); 198var path = Path.Combine(TempRoot.Root, "generated"); 206Path.Combine(Path.GetDirectoryName(cpsProject.ProjectFilePath), "gen2"),
ProjectSystemShim\CSharpHelpers.cs (5)
33var projectBinPath = Path.GetTempPath(); 56var projectFilePath = Path.GetTempPath(); 57var binOutputPath = GetOutputPathFromArguments(commandLineArguments) ?? Path.Combine(projectFilePath, projectName + ".dll"); 64var projectFilePath = Path.GetTempPath(); 136baseDirectory = Path.GetTempPath();
ProjectSystemShim\LegacyProject\SourceFileHandlingTests.cs (4)
66var projectFolder = Path.GetDirectoryName(environment.Workspace.CurrentSolution.Projects.Single().FilePath); 68project.AddFileEx(Path.Combine(projectFolder, "Cat.cs"), null); 80var projectFolder = Path.GetDirectoryName(environment.Workspace.CurrentSolution.Projects.Single().FilePath); 82project.AddFileEx(Path.Combine(projectFolder, "RelativeFolder", "Cat.cs"), null);
ProjectSystemShim\TempPECompilerServiceTests.cs (2)
31pszOutputFileName: Path.Combine(directory.Path, "Output.dll"), 37optionValues: [Path.Combine(directory.Path, "MissingReference.dll")]);
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (2)
72var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.Path, "nonexistent.dll")); 87var debugDirPdbPath = Path.Combine(dir.Path, "nonexistent.pdb");
Microsoft.VisualStudio.LanguageServices.DevKit (1)
src\VisualStudio\Core\Def\PdbSourceDocument\AbstractSourceLinkService.cs (1)
43Path.GetFileName(codeViewEntry.Path),
Microsoft.VisualStudio.LanguageServices.Implementation (20)
CodeModel\RootCodeModel.cs (3)
58var projectDirectory = Path.GetDirectoryName(project.FilePath); 59var absoluteFilePath = Path.GetFullPath(Path.Combine(projectDirectory, locationString));
Options\GridOptionPreviewControl.xaml.cs (1)
133return Path.GetDirectoryName(solutionFilePath);
ProjectSystem\CPS\CPSProject_IWorkspaceProjectContext.cs (6)
116? Path.GetDirectoryName(_projectSystemProject.FilePath) 117: Path.GetTempPath(); 119_projectSystemProject.OutputFilePath = Path.Combine(rootDirectory, value); 193? Path.GetDirectoryName(_projectSystemProject.FilePath) 194: Path.GetTempPath(); 196return Path.Combine(rootDirectory, value);
ProjectSystem\CPS\CPSProjectFactory.cs (1)
169path = Path.Combine(PathUtilities.GetDirectoryName(projectFilePath), path);
ProjectSystem\CPS\TempPECompiler.cs (2)
82compilation = compilation.WithAssemblyName(Path.GetFileName(outputFileName)); 86var outputPath = Path.GetDirectoryName(outputFileName);
SolutionExplorer\AnalyzersCommandHandler.cs (5)
240Path.GetExtension(itemName).Equals(".ruleset", StringComparison.OrdinalIgnoreCase); 495string.Format(SolutionExplorerShim.Checking_out_0_for_editing, Path.GetFileName(pathToRuleSet))); 528var projectDirectoryFullPath = Path.GetDirectoryName(project.FullName); 538var projectDirectory = Path.GetDirectoryName(envDteProject.FullName); 539var fullFilePath = Path.Combine(projectDirectory, fileName);
SolutionExplorer\DiagnosticItem\CpsDiagnosticItemSource.cs (1)
39_projectDirectoryPath = Path.GetDirectoryName(projectPath);
SolutionExplorer\SymbolTree\RootSymbolTreeItemCollectionSource.cs (1)
45=> Path.GetExtension(hierarchyItem.CanonicalName).ToLowerInvariant() is ".cs" or ".vb"
Microsoft.VisualStudio.LanguageServices.LiveShare (7)
Client\Projects\RoslynRemoteProjectInfoProvider.cs (1)
95name: Path.GetFileNameWithoutExtension(path),
Client\RemoteLanguageServiceWorkspace.cs (6)
265return AddDocumentToProject(filePath, language, Path.GetFileName(Path.GetDirectoryName(remoteWorkspaceRoot))); 269return AddDocumentToProject(filePath, language, Path.GetFileName(Path.GetDirectoryName(remoteExternalRoot))); 336name: Path.GetFileName(filePath), 346var fileExtension = Path.GetExtension(filePath).ToLower();
Microsoft.Web.Xdt.Extensions.Tests (4)
InsertOrAppendAttributeTests.cs (4)
16var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 40var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 64var transform = new XmlTransformation(Path.GetFullPath("transform.xdt")); 88var transform = new XmlTransformation(Path.GetFullPath("transform.xdt"));
Microsoft.WebTools.AspireService.Tests (2)
AssertEx.cs (1)
219var expected = expectedFiles.Select(p => Path.Combine(root, p));
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Microsoft.Win32.Msi.Tests (1)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
MSBuild (110)
AssemblyLoadInfo.cs (1)
196ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
BuildEnvironmentHelper.cs (9)
201var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 202var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 335.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 358string directory = Path.GetDirectoryName(msBuildAssembly); 415var processFileName = Path.GetFileNameWithoutExtension(processName); 614MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 618MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 625? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 683defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommunicationsUtilities.cs (1)
1091string.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), EnvironmentUtilities.CurrentProcessId, nodeId), append: true))
CoreCLRAssemblyLoader.cs (2)
51Debug.Assert(Path.IsPathRooted(fullPath)); 159var candidatePath = Path.Combine(searchPath,
DebugUtils.cs (6)
44debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), "MSBuild_Logs"); 48debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 110var extension = Path.GetExtension(fileName); 111var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 113var fullPath = Path.Combine(DebugPath, fileName); 119fullPath = Path.Combine(DebugPath, fileName);
ErrorUtilities.cs (1)
178if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
378s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (36)
77string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}"); 131internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 144cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 195string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 237fileSpec += Path.DirectorySeparatorChar; 275string.Concat(path.AsSpan(start), new(in Path.DirectorySeparatorChar))); 370return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 400while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 492return NormalizePath(Path.Combine(directory, file)); 498return NormalizePath(Path.Combine(paths)); 524return Path.GetFullPath(path); 566return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 704return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 716string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 728directory += Path.DirectorySeparatorChar; 775if (Path.HasExtension(fileName)) 797internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 812string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 826fullPath += Path.DirectorySeparatorChar; 890var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1200string fullBase = Path.GetFullPath(basePath); 1201string fullPath = Path.GetFullPath(path); 1210while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1241sb.Append("..").Append(Path.DirectorySeparatorChar); 1245sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1248if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1292return Path.IsPathRooted(FixFilePath(path)); 1338return paths.Aggregate(root, Path.Combine); 1366var separator = Path.DirectorySeparatorChar; 1510string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1524lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1544if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Modifiers.cs (9)
214modifiedItemSpec = Path.GetPathRoot(fullPath); 223modifiedItemSpec += Path.DirectorySeparatorChar; 238modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 252modifiedItemSpec = Path.GetExtension(itemSpec); 367modifiedItemSpec = Path.Combine( 418if (!Path.IsPathRooted(path)) 451return Path.GetDirectoryName(path) == null; 464fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
MSBuildLoadContext.cs (3)
43_resolver = FileSystems.Default.FileExists(assemblyPath) && FileSystems.Default.FileExists(Path.ChangeExtension(assemblyPath, ".deps.json")) 76var candidatePath = Path.Combine(_directory, 98var assemblyNameInExecutableDirectory = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory,
NamedPipeUtil.cs (1)
34return Path.Combine("/tmp", pipeName);
OutOfProcTaskHostNode.cs (1)
837? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(FileUtilities.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), EnvironmentUtilities.CurrentProcessId))
PerformanceLogEventListener.cs (1)
84string logFilePath = Path.Combine(logDirectory, $"perf-{_processIDStr}-{Guid.NewGuid():N}.log");
PrintLineDebugger.cs (1)
157return $"@{Path.GetFileNameWithoutExtension(sourceFilePath)}.{memberName}({sourceLineNumber})";
PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
TaskFactoryUtilities.cs (3)
138string? directory = Path.GetDirectoryName(assemblyPath); 253path = Path.Combine(directory, assemblyName.CultureName, assemblyName.Name + ".dll"); 261path = Path.Combine(directory, assemblyName.Name + ".dll");
TempFileUtilities.cs (5)
84string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 185string file = Path.Combine(directory, $"{fileName}{extension}"); 209string destFile = Path.Combine(dest, fileInfo.Name); 214string destDir = Path.Combine(dest, subdirInfo.Name); 231: System.IO.Path.Combine(TempFileDirectory, name);
TypeLoader.cs (6)
54string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 55microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 176string baseDir = Path.GetDirectoryName(assemblyLoadInfo.AssemblyFile); 194string[] localAssemblies = Directory.GetFiles(Path.GetDirectoryName(path), "*.dll"); 200assembliesDictionary.Add(Path.GetFileName(localPath), localPath); 205assembliesDictionary[Path.GetFileName(runtimeAssembly)] = runtimeAssembly;
WindowsFileSystem.cs (3)
130var searchDirectoryPath = Path.Combine(directoryPath, "*"); 167result.Add(Path.Combine(directoryPath, findResult.CFileName)); 175Path.Combine(directoryPath, findResult.CFileName),
XMake.cs (17)
160s_exePath = Path.GetDirectoryName(FileUtilities.ExecutingAssemblyPath); 2153responseFile = Path.GetFullPath(responseFile); 2170var responseFileDirectory = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(responseFile)); 2370string autoResponseFile = Path.Combine(path, autoResponseFileName); 2712Console.WriteLine($"{Path.Combine(s_exePath, s_exeName)} {equivalentCommandLine} {projectFile}"); 3017projectDirectory = Path.GetDirectoryName(Path.GetFullPath(projectFile)); 3538if (!extensionsToIgnore.Contains(Path.GetExtension(s)) && !s.EndsWith("~", StringComparison.CurrentCultureIgnoreCase)) 3553if (!extensionsToIgnore.Contains(Path.GetExtension(s))) 3571string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]); 3572string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]); 3591string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]); 3592string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]); 3647InitializationException.VerifyThrow(string.Equals(extension, Path.GetExtension(extension), StringComparison.OrdinalIgnoreCase), "InvalidExtensionToIgnore", extension, null, false); 4119if (!string.IsNullOrEmpty(logFileName) && !Path.IsPathRooted(logFileName)) 4122$"logFile={Path.Combine(Directory.GetCurrentDirectory(), logFileName)}"); 4139fileParameters += $"logFile={Path.Combine(Directory.GetCurrentDirectory(), msbuildLogFileName)}";
msbuild.Integration.Tests (1)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
Msbuild.Tests.Utilities (8)
ProjDir.cs (1)
20public string CsProjPath => System.IO.Path.Combine(Path, CsProjName);
TestSetup.cs (7)
14public string ValidRefDir => Path.Combine(TestRoot, ValidRef); 16public string ValidRefCsprojRelPath => Path.Combine(ValidRef, ValidRefCsprojName); 17public string ValidRefCsprojPath => Path.Combine(TestRoot, ValidRefCsprojRelPath); 18public string ValidRefCsprojRelToOtherProjPath => Path.Combine("..", ValidRefCsprojRelPath); 21public string LibDir => Path.Combine(TestRoot, Lib); 23public string LibCsprojPath => Path.Combine(TestRoot, Lib, LibCsprojName); 24public string LibCsprojRelPath => Path.Combine("..", Lib, LibCsprojName);
MSBuildTaskHost (67)
AssemblyLoadInfo.cs (1)
196ErrorUtilities.VerifyThrow(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
BuildEnvironmentHelper.cs (9)
201var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 202var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 335.Select((name) => TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, name))) 358string directory = Path.GetDirectoryName(msBuildAssembly); 415var processFileName = Path.GetFileNameWithoutExtension(processName); 614MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 620MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : null; 625? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 683defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
CommunicationsUtilities.cs (1)
1091string.Format(CultureInfo.CurrentCulture, Path.Combine(s_debugDumpPath, fileName), EnvironmentUtilities.CurrentProcessId, nodeId), append: true))
Constants.cs (3)
132internal static readonly char[] DirectorySeparatorChar = [Path.DirectorySeparatorChar]; 136internal static readonly char[] PathSeparatorChar = [Path.PathSeparator]; 141internal static readonly char[] InvalidPathChars = Path.GetInvalidPathChars();
D\a\_work\1\s\bin\repo\msbuild\src\Shared\ErrorUtilities.cs\ErrorUtilities.cs (1)
178if (!Path.IsPathRooted(value))
ExceptionHandling.cs (1)
378s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
FileUtilities.cs (37)
52internal static string TempFileDirectory => Path.GetTempPath(); 77string pathWithUpperCase = Path.Combine(Path.GetTempPath(), $"CASESENSITIVETEST{Guid.NewGuid():N}"); 131internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 144cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 195string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 237fileSpec += Path.DirectorySeparatorChar; 277path.Substring(start) + Path.DirectorySeparatorChar); 370return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 400while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 492return NormalizePath(Path.Combine(directory, file)); 517Path.HasExtension(uncheckedFullPath); 521return IsUNCPath(uncheckedFullPath) ? Path.GetFullPath(uncheckedFullPath) : uncheckedFullPath; 524return Path.GetFullPath(path); 566return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 716string directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 728directory += Path.DirectorySeparatorChar; 775if (Path.HasExtension(fileName)) 797internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly)); 812string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 826fullPath += Path.DirectorySeparatorChar; 890var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1200string fullBase = Path.GetFullPath(basePath); 1201string fullPath = Path.GetFullPath(path); 1210while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1241sb.Append("..").Append(Path.DirectorySeparatorChar); 1245sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1248if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1292return Path.IsPathRooted(FixFilePath(path)); 1338return paths.Aggregate(root, Path.Combine); 1366var separator = Path.DirectorySeparatorChar; 1510string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1524lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1544if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
InterningWriteTranslator.cs (2)
28private static readonly char[] DirectorySeparatorChars = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
Modifiers.cs (9)
214modifiedItemSpec = Path.GetPathRoot(fullPath); 223modifiedItemSpec += Path.DirectorySeparatorChar; 238modifiedItemSpec = Path.GetFileNameWithoutExtension(FixFilePath(itemSpec)); 252modifiedItemSpec = Path.GetExtension(itemSpec); 367modifiedItemSpec = Path.Combine( 418if (!Path.IsPathRooted(path)) 451return Path.GetDirectoryName(path) == null; 464fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
NativeMethods.cs (2)
890Path.GetDirectoryName(baseTypeLocation) 910dir = Path.GetDirectoryName(dir);
OutOfProcTaskHostNode.cs (1)
837? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(FileUtilities.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), EnvironmentUtilities.CurrentProcessId))
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
338[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
Mvc.Analyzers.Test (1)
src\Shared\AnalyzerTesting\TestReferences.cs (1)
44var name = Path.GetFileNameWithoutExtension(assemblyPath);
Mvc.Api.Analyzers.Test (3)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (2)
37if (!project.MetadataReferences.Any(c => string.Equals(Path.GetFileNameWithoutExtension(c.Display), Path.GetFileNameWithoutExtension(assembly), StringComparison.OrdinalIgnoreCase)))
Infrastructure\MvcTestSource.cs (1)
15var filePath = Path.Combine(ProjectDirectory, "TestFiles", testClassName, testMethod + ".cs");
netstandard (1)
netstandard.cs (1)
948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
NonDISample (1)
Program.cs (1)
13var keysFolder = Path.Combine(Directory.GetCurrentDirectory(), "temp-keys");
Pipelines.AppHost (6)
AppHost.cs (6)
267.CreateTaskAsync($"Uploading {Path.GetFileName(sourcePath)} to {fileShareName}", deployingContext.CancellationToken) 296var relativePath = Path.GetRelativePath(sourcePath, filePath); 297var directoryPath = Path.GetDirectoryName(relativePath) ?? string.Empty; 303var parts = directoryPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 311var fileName = Path.GetFileName(filePath);
Pipelines.Library (4)
DistributedApplicationPipelineExtensions.cs (4)
71var publishDir = Path.Combine(Path.GetTempPath(), $"aspire-publish-{Guid.NewGuid()}"); 115var zipPath = Path.Combine(Path.GetTempPath(), $"aspire-deploy-{Guid.NewGuid()}.zip");
PrepareTests (41)
MinimizeUtil.cs (28)
27var duplicateDirectory = Path.Combine(destinationDirectory, duplicateDirectoryName); 38var outputPath = Path.Combine(destinationDirectory, individualFile); 39var outputDirectory = Path.GetDirectoryName(outputPath)!; 40CreateHardLink(outputPath, Path.Combine(sourceDirectory, individualFile)); 53var artifactsDir = Path.Combine(sourceDirectory, "artifacts/bin"); 56Path.Combine(sourceDirectory, "eng"), 57Path.Combine(sourceDirectory, "artifacts", "VSSetup"), 80var currentDirName = Path.GetDirectoryName(sourceFilePath)!; 81var currentRelativeDirectory = Path.GetRelativePath(sourceDirectory, currentDirName); 82var currentOutputDirectory = Path.Combine(destinationDirectory, currentRelativeDirectory); 88var fileName = Path.GetFileName(sourceFilePath); 95RelativePath: Path.Combine(currentRelativeDirectory, fileName), 101var destFilePath = Path.Combine(currentOutputDirectory, fileName); 109RelativePath: Path.Combine(currentRelativeDirectory, fileName), 133var destFilePath = Path.Combine(destinationDirectory, item.RelativePath); 141string getPeFilePath(Guid mvid) => Path.Combine(duplicateDirectory, getPeFileName(mvid)); 172rehydrateAllBuilder.AppendLine(@"bash """ + Path.Combine("$scriptroot", group.Key, "rehydrate.sh") + @""""); 177rehydrateAllBuilder.AppendLine("call " + Path.Combine("%~dp0", group.Key, "rehydrate.cmd")); 180File.WriteAllText(Path.Combine(destinationDirectory, group.Key, fileName), builder.ToString()); 192var file = Path.Combine(destinationDirectory, noDuplicate.Key, fileName); 199File.WriteAllText(Path.Combine(destinationDirectory, rehydrateAllFilename), rehydrateAllBuilder.ToString()); 213var destFileName = Path.GetRelativePath(group.Key, tuple.FilePath.RelativePath); 214if (Path.GetDirectoryName(destFileName) is { Length: not 0 } directory) 264var destFilePath = Path.GetRelativePath(group.Key, tuple.FilePath.RelativePath); 276if (Path.GetDirectoryName(destFilePath) is { Length: not 0 } directory) 298while (Path.GetFileName(Path.GetDirectoryName(groupDirectory)) is not (null or "Debug" or "Release")) 299groupDirectory = Path.GetDirectoryName(groupDirectory);
TestDiscovery.cs (13)
21var binDirectory = Path.Combine(repoRootDirectory, "artifacts", "bin"); 23var testDiscoveryWorkerFolder = Path.Combine(binDirectory, "TestDiscoveryWorker"); 60var dir = Path.GetDirectoryName(typeof(TestDiscovery).Assembly.Location); 61var tfm = Path.GetFileName(dir)!; 62var configuration = Path.GetFileName(Path.GetDirectoryName(dir))!; 69var testDiscoveryWorkerFolder = Path.Combine(binDirectory, "TestDiscoveryWorker"); 70return (Path.Combine(testDiscoveryWorkerFolder, configuration, tfm, "TestDiscoveryWorker.dll"), 71Path.Combine(testDiscoveryWorkerFolder, configuration, "net472", "TestDiscoveryWorker.exe")); 88var pathToOutput = Path.Combine(Path.GetDirectoryName(pathToAssembly)!, "testlist.json"); 118return Path.GetFileName(Path.GetDirectoryName(path)) != "net472";
PresentationBuildTasks (71)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (6)
139string currentProjectName = Path.GetFileNameWithoutExtension(CurrentProject); 140string currentProjectExtension = Path.GetExtension(CurrentProject); 149string randomFileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); 277( "_TargetAssemblyProjectName", Path.GetFileNameWithoutExtension(CurrentProject) ), 313foreach (FileInfo temporaryProjectFile in intermediateOutputPath.EnumerateFiles($"{Path.GetFileNameWithoutExtension(TemporaryTargetAssemblyProjectName)}*"))
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (10)
63_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 264if (!_outputDir.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 266_outputDir += Path.DirectorySeparatorChar; 712string buildCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, buildExtension); 713string intelCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, intellisenseExtension); 721bamlFile = OutputPath + Path.ChangeExtension(relativeFilePath, SharedStrings.BamlExtension); 861return Path.Combine(OutputPath, fileName); 1077int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1125asmname = Path.GetFileNameWithoutExtension(refpath); 1672locFile = Path.ChangeExtension(xamlRelativeFilePath, SharedStrings.LocExtension);
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (6)
49_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 243if (!_outputPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 245_outputPath += Path.DirectorySeparatorChar; 540int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 605asmname = Path.GetFileNameWithoutExtension(refpath); 774string bamlFileName = Path.ChangeExtension(resolvedXamlfile, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
55string absoluteFilePath = Path.Combine(
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (10)
38_sourcePath = Path.GetFullPath(path); 124SourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 249_outputPath = Path.GetFullPath(value); 251if (!_outputPath.EndsWith((Path.DirectorySeparatorChar).ToString(), StringComparison.Ordinal)) 252_outputPath += Path.DirectorySeparatorChar; 354string fullFilePath = Path.GetFullPath(filePath); 373relPath = Path.GetFileName(fullFilePath); 390Path.GetExtension(sourceFilePath).Equals(SharedStrings.BamlExtension) && 391Path.GetExtension(path).Equals(SharedStrings.XamlExtension)) 394path = Path.ChangeExtension(path, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\UidManager.cs (7)
155string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 358return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidtemp")); 363return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidbackup"));
MS\Internal\MarkupCompiler\MarkupCompiler.cs (12)
472if (!TargetPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 474TargetPath += Path.DirectorySeparatorChar; 478int pathEndIndex = SourceFileInfo.RelativeSourceFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1586string pathOfRelativeSourceFilePath = System.IO.Path.GetDirectoryName(SourceFileInfo.RelativeSourceFilePath); 1593string path = Path.GetRelativePath(TargetPath + pathOfRelativeSourceFilePath, SourceFileInfo.SourcePath); 1596return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar; 1605string[] dirs = relPath.Split(Path.DirectorySeparatorChar); 2635Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, 3327string fullFilePath = Path.GetFullPath(_splashImage); 3340relPath = TaskHelper.GetRootRelativePath(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, fullFilePath); 3349resourceId = Path.GetFileName(fullFilePath);
MS\Internal\MarkupCompiler\PathInternal.cs (6)
42relativeTo = Path.GetFullPath(relativeTo); 43path = Path.GetFullPath(path); 89sb.Append(Path.DirectorySeparatorChar); 110sb.Append(Path.DirectorySeparatorChar); 125return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
MS\Internal\Tasks\CompilerWrapper.cs (4)
38_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 390if (!Path.IsPathRooted(filePath)) 396string fullFilePath = Path.GetFullPath(filePath); 419int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar);
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (5)
208string filepath = Path.GetFullPath(fileName); 463Path.GetFullPath(taskItem.ItemSpec), 486string curDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 494string fullPath = Path.GetFullPath(_mcPass1.ContentFiles[i].ItemSpec); 500relContentFilePath = Path.GetFileName(fullPath);
MS\Internal\Tasks\TaskHelper.cs (3)
68if (!Path.IsPathRooted(thePath) ) 74thePath = Path.GetFullPath(thePath); 94string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar;
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
564_cachedMetadataLoadContextAssembliesByNameNoExtension.Add(Path.GetFileNameWithoutExtension(fullPathToAssembly), assembly);
PresentationCore (21)
MS\Internal\FontCache\DWriteFactory.cs (3)
63localPath = Directory.GetParent(fontCollectionUri.LocalPath).FullName + Path.DirectorySeparatorChar; 71if (string.Equals((localPath.Length > 0 && localPath[localPath.Length - 1] != Path.DirectorySeparatorChar) ? localPath + Path.DirectorySeparatorChar : localPath, Util.WindowsFontsUriObject.LocalPath, StringComparison.OrdinalIgnoreCase))
MS\Internal\FontCache\FamilyCollection.cs (2)
45internal static string SxSFontsResourcePrefix { get; } = $"/{Path.GetFileNameWithoutExtension(ExternDll.PresentationCore)};component/fonts/"; 238FontSource fontSource = new FontSource(new Uri(Path.Combine(FamilyCollection.SxSFontsResourcePrefix, _systemCompositeFontsFileNames[index] + Util.CompositeFontExtension), UriKind.RelativeOrAbsolute),
MS\Internal\FontCache\FontCacheUtil.cs (2)
288private static readonly char[] InvalidFileNameChars = Path.GetInvalidFileNameChars(); 585return Path.GetExtension(unescapedPath);
MS\Internal\FontCache\FontResourceCache.cs (1)
126string extension = Path.GetExtension(fileName);
MS\Internal\FontCache\FontSourceCollection.cs (4)
74_isFileSystemFolder = localPath[localPath.Length - 1] == Path.DirectorySeparatorChar; 120if (Util.IsSupportedFontExtension(Path.GetExtension(file), out isComposite)) 144isComposite = Util.IsCompositeFont(Path.GetExtension(_uri.AbsoluteUri)); 149isComposite = Util.IsCompositeFont(Path.GetExtension(resourceName));
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (1)
210String guid = Path.GetFileNameWithoutExtension(
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
135string extensionWithDot = Path.GetExtension(docString);
src\Microsoft.DotNet.Wpf\src\Shared\System\IO\FileHelper.cs (5)
97string folderPath = Path.GetTempPath(); 101string subFolderPath = Path.Combine(folderPath, subFolder); 115string path = Path.Combine(folderPath, Path.GetRandomFileName()); 118path = Path.ChangeExtension(path, extension);
System\Windows\Input\Cursor.cs (1)
214string filePath = Path.GetTempFileName();
System\Windows\Media\ColorContext.cs (1)
567profilePath = new Uri(Path.Combine(buffer.ToString(), profilePathString));
PresentationCore.Tests (2)
System\Windows\Media\Imaging\BitmapImage.Tests.cs (2)
61string tempFile = Path.GetTempFileName(); 87string tempFile = Path.GetTempFileName();
PresentationFramework (20)
Microsoft\Win32\FileDialog.cs (5)
112string safeFN = Path.GetFileName(CriticalItemName); 143safeFileNames[i] = Path.GetFileName(unsafeFileNames[i]); 458string tempPath = Path.GetFullPath(fileName); 564if (AddExtension && !Path.HasExtension(fileName)) 572string currentExtension = Path.GetExtension(fileName);
Microsoft\Win32\OpenFolderDialog.cs (2)
99string safeFN = Path.GetFileName(CriticalItemName); 130safeFolderNames[i] = Path.GetFileName(unsafeFolderNames[i]);
MS\Internal\AppModel\ContentFilePart.cs (2)
68_fullPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), filePath);
MS\Internal\AppModel\ResourcePart.cs (3)
116if (string.Equals(Path.GetExtension(_name), ResourceContainer.BamlExt, StringComparison.OrdinalIgnoreCase)) 121if (string.Equals(Path.GetExtension(_name), ResourceContainer.XamlExt, StringComparison.OrdinalIgnoreCase)) 124string newName = Path.ChangeExtension(_name, ResourceContainer.BamlExt);
MS\Internal\IO\Packaging\PackageFilter.cs (1)
594string extension = Path.GetExtension(path);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (2)
100private static readonly string _currentModuleDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 123_moduleHandle = Platform.LoadLibraryExW(System.IO.Path.Combine(_currentModuleDirectory, fileName), IntPtr.Zero, /* LOAD_WITH_ALTERED_SEARCH_PATH */ 8);
MS\Win32\UxThemeWrapper.cs (1)
263themeName = Path.GetFileNameWithoutExtension(themeName);
System\Windows\Documents\Speller.cs (1)
1557tempFolder = System.IO.Path.GetTempPath();
System\Windows\Shell\JumpList.cs (2)
129itemPath = Path.GetFullPath(itemPath); 990return ShellUtil.GetShellItemForPath(Path.GetFullPath(jumpPath.Path));
System\Windows\SystemParameters.cs (1)
5533_uxThemeName = System.IO.Path.GetFileNameWithoutExtension(name);
PresentationUI (11)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
98_filename = Path.GetFileName(_uri.LocalPath);
MS\Internal\Documents\Application\DocumentStream.cs (4)
808file = Path.GetFileNameWithoutExtension(path); 819Path.GetDirectoryName(path), 820Path.DirectorySeparatorChar, 955if (!Path.GetExtension(location.LocalPath).Equals(
MS\Internal\Documents\Application\FilePresentation.cs (1)
86Path.GetExtension(filePath),
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
365Path.GetFileNameWithoutExtension(DocumentProperties.Current.Filename),
MS\Internal\Documents\RightsManagementManager.cs (1)
860string msdrmdllPath = Path.Combine(systemPath, msdrmDLLName);
MS\Internal\Documents\RightsManagementProvider.cs (2)
1353string applicationManifestFileLocation = Path.Combine( Path.GetDirectoryName(fileName),
MS\Internal\Documents\RMPublishingDialog.cs (1)
1001return Path.GetFileNameWithoutExtension(_template.LocalPath);
ReachFramework (4)
Packaging\XpsFixedPageReaderWriter.cs (3)
1852ReadOnlySpan<char> extension = Path.GetExtension(path).Slice(1); 1897String extension = Path.GetExtension(path); 1898String fileName = Path.GetFileNameWithoutExtension(path);
Serialization\XpsFontSubsetter.cs (1)
657string fileName = System.IO.Path.GetFileNameWithoutExtension(
Replay (25)
Replay.cs (11)
54outputDirectory = Path.Combine(Path.GetTempPath(), "replay"); 132using var compilerServerLogger = new CompilerServerLogger("replay", Path.Combine(options.OutputDirectory, "server.log")); 254var outputDirectory = Path.Combine(options.OutputDirectory, outputName); 299if (Path.IsPathRooted(argValue)) 301fileName = Path.GetFileName(argValue); 310fileName = Path.Combine(hashSet.Count.ToString(), fileName); 313var filePath = Path.Combine(outputDirectory, fileName); 314Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 321var generatedDir = Path.Combine(outputDirectory, "generated"); 342internal string TempDirectory { get; } = Path.Combine(outputDirectory, "temp");
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Compilers\Shared\BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
ResultsOfTGenerator (2)
Program.cs (2)
17var classTargetFilePath = Path.Combine(pwd, "..", "..", "src", "ResultsOfT.Generated.cs"); 18var testsTargetFilePath = Path.Combine(pwd, "..", "..", "test", "ResultsOfTTests.Generated.cs");
Roslyn.Compilers.Extension (4)
CompilerPackage.cs (4)
37var packagePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 118var parentDirectory = new DirectoryInfo(Path.GetDirectoryName(fileAndContents.Key)); 176return Path.Combine(localAppData, $@"Microsoft\MSBuild\{version}"); 181return Path.Combine(await GetMSBuildPathAsync(cancellationToken).ConfigureAwait(true), relativePath);
Roslyn.Diagnostics.Analyzers (27)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Roslyn.Test.Performance.Utilities (36)
Benchview.cs (15)
18private static readonly string s_scriptDirectory = Path.Combine( 81var consumptionXml = Path.Combine(GetCPCDirectoryPath(), "consumptionTempResults.xml"); 87var consumptionXml = Path.Combine(GetCPCDirectoryPath(), "consumptionTempResults.xml"); 92var submissionJson = CreateSubmissionJson(s_submissionType, submissionName, s_branch, Path.Combine(s_outputDirectory, "measurement.json")); 95var uploadPy = Path.Combine(s_scriptDirectory, "upload.py"); 115var measurementPy = Path.Combine(s_scriptDirectory, "measurement.py"); 116var measurementJson = Path.Combine(s_outputDirectory, "measurement.json"); 127var submissionMetadataPy = Path.Combine(s_scriptDirectory, "submission-metadata.py"); 128var buildPy = Path.Combine(s_scriptDirectory, "build.py"); 129var machinedataPy = Path.Combine(s_scriptDirectory, "machinedata.py"); 130var submissionPy = Path.Combine(s_scriptDirectory, "submission.py"); 132var submissionMetadataJson = Path.Combine(s_outputDirectory, "submission-metadata.json"); 133var buildJson = Path.Combine(s_outputDirectory, "build.json"); 134var machinedataJson = Path.Combine(s_outputDirectory, "machinedata.json"); 153string submissionJson = Path.Combine(s_outputDirectory, "submission.json");
Logger.cs (1)
48_file = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "perf-log.txt");
RelativeDirectory.cs (2)
93public string TaoPath => Path.Combine(MyBinaries(), "exes", "EditorTestApp", "Tao"); 104var zipPath = Path.Combine(TempDirectory, zipFileName);
ScenarioGenerator.cs (1)
21_fullPath = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "scenarios.xml");
TestUtilities.cs (1)
54return Path.Combine(GetCPCDirectoryPath(), "ViBenchToJson.exe");
TraceManager.cs (3)
19var cpcFullPath = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "CPC.exe"); 66var scenariosXmlPath = Path.Combine(GetCPCDirectoryPath(), "scenarios.xml"); 67var consumptionTempResultsPath = Path.Combine(GetCPCDirectoryPath(), "ConsumptionTempResults.xml");
VsPerfTest.cs (13)
25Path.Combine(System.Environment.GetEnvironmentVariable("UserProfile"), ".nuget", "packages"); 26private static readonly string _installerPath = Path.Combine(_nugetPackagesPath, "roslyntools.vsixexpinstaller", "1.0.0-beta2-63222-01", "tools", "vsixexpinstaller.exe"); 50var dir = Path.Combine(Path.GetDirectoryName(MyWorkingDirectory), "csharp"); 54var logDirectory = Path.Combine(TempDirectory, _testName); 56Directory.CreateDirectory(Path.Combine(logDirectory, "PerfResults")); 59var taoTestFileTemplatePath = Path.Combine(dir, _testTemplateName); 61var finalTest = template.Replace("ReplaceWithActualSolutionPath", Path.Combine(TempDirectory, _zipFileToDownload, _solutionToTest)); 68File.WriteAllText(Path.Combine(TempDirectory, _testTemplateName), finalTest); 79var vsix = Path.Combine(MyBinaries(), "Vsix", "VisualStudioSetup", "Roslyn.VisualStudio.Setup.vsix"); 92ShellOutVital(TaoPath, $"{Path.Combine(TempDirectory, _testTemplateName)} -perf -host:vs -roslynonly -rootsuffix:{_rootSuffix}", TempDirectory); 94var logDirectory = Path.Combine(TempDirectory, _testName, "PerfResults"); 95ShellOutVital("xcopy", $"{logDirectory} {Path.Combine(MyBinaries(), "..", "..", "ToArchive")} /s /i /y");
Roslyn.VisualStudio.Next.UnitTests (28)
Options\VisualStudioOptionStorageTests.cs (11)
22return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 31return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 41return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 51return OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)) 74var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 101var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 149var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 166var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 178var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 200var infos = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location)); 281var allOptionGroups = OptionsTestInfo.CollectOptions(Path.GetDirectoryName(typeof(VisualStudioOptionStorage).Assembly.Location))
Remote\RemoteHostClientServiceFactoryTests.cs (1)
80(service, cancellationToken) => service.UpdateContinuouslyAsync("emptySource", Path.GetTempPath(), cancellationToken),
Remote\SnapshotSerializationTests.cs (7)
59.AddAnalyzerReference(new AnalyzerFileReference(Path.Combine(TempRoot.Root, "path1"), new TestAnalyzerAssemblyLoader())) 63.WithAnalyzerReferences([new AnalyzerFileReference(Path.Combine(TempRoot.Root, "path2"), new TestAnalyzerAssemblyLoader())]) 392var reference = new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing_reference"), new MissingAnalyzerLoader()); 406var reference = new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing_reference"), new MissingAnalyzerLoader()); 504var analyzer = new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing_reference"), new MissingAnalyzerLoader()); 538var analyzer = serializer.CreateChecksum(new AnalyzerFileReference(Path.Combine(TempRoot.Root, "missing"), new MissingAnalyzerLoader()), CancellationToken.None); 567var tempCorlibXml = tempDir.CreateFile(Path.ChangeExtension(tempCorlib.Path, "xml"));
Services\ServiceHubServicesTests.cs (6)
451assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"), 774assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"), 1511assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"), 1596assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"), 1675assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"), 1759assemblyPath: Path.Combine(TempRoot.Root, "Test.dll"),
Services\SolutionServiceTests.cs (3)
247var dir = Path.GetDirectoryName(typeof(SolutionServiceTests).Assembly.Location); 349var configPath = Path.Combine(Path.GetTempPath(), ".editorconfig");
RulesetToEditorconfigConverter (4)
Program.cs (1)
18Path.Combine(Environment.CurrentDirectory, ".editorconfig");
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
RulesetToEditorconfigConverter.UnitTests (6)
RulesetToEditorconfigConverterTests.cs (6)
18var directory = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())); 22var ruleset = Path.Combine(directory.FullName, PrimaryRulesetName); 28var includedRuleset = Path.Combine(directory.FullName, IncludedRulesetName); 32var editorconfigPath = Path.Combine(directory.FullName, ".editorconfig");
RunTests (49)
AssemblyInfo.cs (1)
13public string AssemblyName => Path.GetFileName(AssemblyPath);
AssemblyScheduler.cs (3)
46ConsoleUtil.WriteLine($"\tAssembly: {Path.GetFileName(kvp.Key)}, Test Type Count: {typeCount}, Test Count: {testCount}"); 250var assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 251var testListPath = Path.Combine(assemblyDirectory!, "testlist.json");
HelixTestRunner.cs (23)
65var payloadsDir = Path.Combine(options.ArtifactsDirectory, "payloads"); 66var logsDir = Path.Combine(options.ArtifactsDirectory, "log", options.Configuration); 80var helixFilePath = Path.Combine(options.ArtifactsDirectory, "helix.proj"); 83var arguments = $"build -bl:{Path.Combine(logsDir, "helix.binlog")} {helixFilePath}"; 98File.Copy(helixFilePath, Path.Combine(logsDir, "helix.proj")); 150var duplicateDir = Path.Combine(Path.GetDirectoryName(artifactsDir)!, ".duplicate"); 196var workItemPayloadDir = Path.Combine(payloadsDir, helixWorkItem.DisplayName); 199var binDir = Path.Combine(artifactsDir, "bin"); 201.Select(x => Path.GetRelativePath(binDir, x)) 206var name = Path.GetDirectoryName(assemblyRelativePath)!; 207var targetDir = Path.Combine(workItemPayloadDir, name); 208var sourceDir = Path.Combine(binDir, name); 209_ = Directory.CreateDirectory(Path.GetDirectoryName(targetDir)!); 215Path.Combine(workItemPayloadDir, rspFileName), 219File.WriteAllText(Path.Combine(workItemPayloadDir, commandFileName), commandContent); 222File.WriteAllText(Path.Combine(workItemPayloadDir, postCommandFileName), postCommandContent); 288var directoryName = Path.GetDirectoryName(assemblyRelativeFilePath); 390var globalJsonPath = Path.Join(path, "global.json"); 395path = Path.GetDirectoryName(path); 478var relativePath = Path.GetRelativePath(payloadsDir, filePath); 479var destinationPath = Path.Combine(logsDir, relativePath); 480_ = Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)!);
Options.cs (6)
217: Path.Combine(artifactsPath, "TestResults", configuration); 264while (path is object && Path.GetFileName(path) != "artifacts") 266path = Path.GetDirectoryName(path); 277while (dir != null && !File.Exists(Path.Combine(dir, programName))) 279dir = Path.GetDirectoryName(dir); 282return dir == null ? null : Path.Combine(dir, programName);
ProcessTestExecutor.cs (6)
97var dotnetDir = Path.GetDirectoryName(dotnetPath)!; 98var sdkDir = Path.Combine(dotnetDir, "sdk"); 106return Path.Combine(options.TestResultsDirectory, fileName); 116var rspFilePath = Path.Combine(getRspDirectory(), $"vstest_{workItemInfo.PartitionIndex}.rsp"); 123var resultsDir = Path.GetDirectoryName(resultsFilePath); 205var dirPath = Path.Combine(options.ArtifactsDirectory, "tmp", options.Configuration, "vstest-rsp");
Program.cs (8)
198var logFilePath = Path.Combine(options.LogFilesDirectory, "runtests.log"); 264var screenshotPath = Path.Combine(options.LogFilesDirectory, $"timeout.png"); 279var dumpFilePath = Path.Combine(dumpDir, $"{proc.ProcessName}-{counter}.dmp"); 291var binDirectory = Path.Combine(options.ArtifactsDirectory, "bin"); 294var name = Path.GetFileName(project); 303var configDirectory = Path.Combine(project, options.Configuration); 312var tfm = Path.GetFileName(targetFrameworkDirectory); 319var filePath = Path.Combine(targetFrameworkDirectory, fileName);
TestRunner.cs (2)
23var assembliesString = string.Join("_", Filters.Keys.Select(a => Path.GetFileNameWithoutExtension(a.AssemblyName))); 200var outputLogPath = Path.Combine(_options.LogFilesDirectory, $"xUnitFailure-{testResult.DisplayName}.log");
rzc (49)
CliFolderPathCalculatorCore.cs (1)
19return Path.Combine(homePath, DotnetProfileDirectoryName);
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 (5)
87if (!Path.IsPathRooted(filePath)) 125if (!string.Equals(expectedOriginalPath, Path.GetFileNameWithoutExtension(extensionFilePath), StringComparison.OrdinalIgnoreCase)) 131currentDirectory ??= Path.GetDirectoryName(typeof(Application).Assembly.Location); 132extensionFilePaths.Values[i] = Path.Combine(currentDirectory, RazorCompilerFileName); 160outputFilePath = Path.Combine(projectDirectory, outputFilePath);
GenerateCommand.cs (3)
158if (!Path.IsPathRooted(filePath)) 176tagHelperManifest = Path.Combine(projectDirectory, tagHelperManifest); 413.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 (12)
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)) 293if ("dotnet".Equals(Path.GetFileNameWithoutExtension(expectedPath), StringComparison.Ordinal)) 299var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); 303var dotnetPath = Path.Combine(path, exeName); 319var expectedCompilerPath = Path.Combine(clientDir, ServerName); 418public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 419public static bool IsUnix => Path.DirectorySeparatorChar == '/';
ServerProtocol\ServerLogger.cs (1)
48loggingFileName = Path.Combine(loggingFileName, $"razorserver.{GetCurrentProcessId()}.log");
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))
SDDLTests (11)
Program.cs (11)
29private static readonly string s_installStateDirectory = Path.Combine(s_programData, "SDDLTest", "workloads", "8.0.100", "InstallState"); 39private static readonly string s_installStateFileAssetPath = Path.Combine(s_installStateDirectory, s_installStateFile); 44private static readonly string s_userTestDirectory = Path.Combine(Path.GetTempPath(), "SDDLTest"); 59private static readonly string s_cacheRootDirectory = Path.Combine(s_programData, "SDDLTest"); 64private static readonly string s_workloadsCacheDirectory = Path.Combine(s_cacheRootDirectory, "workloads"); 70private static readonly string s_workloadPackCacheDirectory = Path.Combine(s_workloadsCacheDirectory, "test.workload.pack", "1.2.3-preview5"); 75private static readonly string s_userTestAssetPath = Path.Combine(s_userTestDirectory, s_testAsset); 80private static readonly string s_cachedTestAssetPath = Path.Combine(s_workloadPackCacheDirectory, s_testAsset); 150string testAssetPath = Path.Combine(s_userTestDirectory, "test.txt"); 162return Path.GetFullPath(testAssetPath);
sdk-tasks (53)
Crossgen.cs (10)
52string tempDirPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 54TempOutputPath = Path.Combine(tempDirPath, Path.GetFileName(DestinationPath)); 60var files = Directory.GetFiles(Path.GetDirectoryName(TempOutputPath)); 61var destination = Path.GetDirectoryName(DestinationPath); 65File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), overwrite: true); 131platformAssemblyPaths += $"-r {excludeTaskItem.ItemSpec}{Path.DirectorySeparatorChar}*.dll ";
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)
61string sourceFolder = Path.Combine(RuntimeAnalyzersLayoutDirectory, relativeSourcePath); 68var path = Path.Combine(sourceFolder, file); 80var extension = Path.GetExtension(f); 83!Path.GetFileName(f).Equals("_._"); 94var fileName = Path.GetFileName(file); 97sb.Append(Path.Combine(relativeSourcePath, fileName)); 119string subfolderName = Path.GetFileName(subfolder); 120string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); 121string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
GetRuntimePackRids.cs (1)
20string runtimeJsonPath = Path.Combine(MetapackagePath, "runtime.json");
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)
SemanticSearch.BuildTask (5)
GenerateFilteredReferenceAssembliesTask.cs (4)
95var referencesByName = References.ToDictionary(r => Path.GetFileNameWithoutExtension(r.ItemSpec), r => r.ItemSpec); 99var assemblyName = Path.GetFileNameWithoutExtension(specPath); 106var filteredReferencePath = Path.Combine(OutputDir, assemblyName + ".dll"); 137string outputFilePath = Path.Combine(ApisDir, assemblyName + ".txt");
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
ServerComparison.FunctionalTests (4)
Helpers.cs (4)
19var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "FunctionalTests.slnf")); 22return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "..", "..", "testassets", "ServerComparison.TestSites")); 35var content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig));
SignalR.Client.FunctionalTestApp (4)
src\SignalR\common\Shared\TestCertificates.cs (4)
35var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCert.pfx"); 41var certPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "TestCertificates", "testCertECC.pfx");
Sockets.BindTests (3)
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
Sockets.FunctionalTests (5)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
38var path = Path.GetTempFileName(); 136var path = Path.GetTempFileName();
src\Shared\TestResources.cs (3)
10private static readonly string _baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 12public static string TestCertificatePath { get; } = Path.Combine(_baseDir, "testCert.pfx"); 13public static string GetCertPath(string name) => Path.Combine(_baseDir, name);
StaticFilesAuth (8)
Startup.cs (8)
30var basePath = Path.Combine(HostingEnvironment.ContentRootPath, "PrivateFiles"); 31var usersPath = Path.Combine(basePath, "Users"); 47var userPath = Path.Combine(usersPath, userName); 55|| directory.FullName.StartsWith(userPath + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase); 86var files = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "PrivateFiles")); 128new DirectoryInfo(Path.GetDirectoryName(fileSystemPath)), 146return Path.Join(files.Root, path); 154return Path.Join(files.Root, path);
Stress.ApiService (2)
Program.cs (2)
294var xmlLarge = File.ReadAllText(Path.Combine("content", "books.xml")); 301var jsonLarge = File.ReadAllText(Path.Combine("content", "example.json"));
Swaggatherer (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
System.CodeDom (5)
src\libraries\Common\src\System\IO\TempFileCollection.cs (4)
132_basePath = Path.Combine( 134Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); 221Directory.Delete(Path.GetDirectoryName(BasePath));
System\CodeDom\Compiler\CodeValidator.cs (1)
17private static readonly SearchValues<char> s_invalidPathChars = SearchValues.Create(Path.GetInvalidPathChars());
System.CommandLine.StaticCompletions (1)
CompletionsCommand.cs (1)
70var shellName = Path.GetFileName(shellPath);
System.CommandLine.StaticCompletions.Tests (4)
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
VerifyConfiguration.cs (1)
20directory: Path.Combine(Environment.CurrentDirectory, "snapshots"),
VerifyExtensions.cs (2)
20var runtimeSnapshotDir = new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "snapshots", provider.ArgumentName)); 32settings.UseDirectory(Path.Combine("snapshots", provider.ArgumentName));
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
50return ExtensionsParsed.Contains(Path.GetExtension(fileName).ToLowerInvariant());
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (1)
90var path = Path.Combine(location, probingPath);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
17using IOPath = System.IO.Path; 741var fullPath = IOPath.GetFullPath(path);
System.ComponentModel.TypeConverter (3)
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
98string fileName = Path.GetFileName(location);
System\ComponentModel\LicFileLicenseProvider.cs (1)
81string? moduleDir = Path.GetDirectoryName(modulePath);
System\ComponentModel\SyntaxCheck.cs (1)
61return Path.IsPathRooted(value);
System.Configuration.ConfigurationManager (41)
src\libraries\Common\src\System\IO\TempFileCollection.cs (4)
132_basePath = Path.Combine( 134Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); 221Directory.Delete(Path.GetDirectoryName(BasePath));
System\Configuration\AppSettingsSection.cs (2)
102: Path.Combine(Path.GetDirectoryName(configFile), File);
System\Configuration\BaseConfigurationRecord.cs (1)
3201if (string.IsNullOrEmpty(configSource) || Path.IsPathRooted(configSource))
System\Configuration\ClientConfigPaths.cs (11)
46ApplicationUri = Path.GetFullPath(exePath); 67ApplicationUri = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, exeAssembly.ManifestModule.Name); 100if (!Path.IsPathRooted(externalConfigPath)) 102externalConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, externalConfigPath); 105ApplicationConfigUri = Path.GetFullPath(externalConfigPath); 116Path.ChangeExtension(ApplicationUri, ".dll") : ApplicationUri + ".dll"; 156if (Path.IsPathRooted(roamingFolderPath)) 163if (Path.IsPathRooted(localFolderPath)) 226return Path.Combine(path1, path2); 263else if (Uri.TryCreate(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, assembly.ManifestModule.Name), UriKind.Absolute, out Uri codeBase)) 379foreach (char c in Path.GetInvalidFileNameChars()) validated = validated.Replace(c, '_');
System\Configuration\ClientConfigurationHost.cs (6)
49s_machineConfigFilePath = Path.Combine(Path.Combine(directory, MachineConfigSubdirectory), 154_fileMap.MachineConfigFilename = Path.GetFullPath(fileMap.MachineConfigFilename); 160_fileMap.ExeConfigFilename = Path.GetFullPath(exeFileMap.ExeConfigFilename); 163_fileMap.RoamingUserConfigFilename = Path.GetFullPath(exeFileMap.RoamingUserConfigFilename); 166_fileMap.LocalUserConfigFilename = Path.GetFullPath(exeFileMap.LocalUserConfigFilename);
System\Configuration\Configuration.cs (1)
213filename = string.IsNullOrEmpty(filename) ? null : Path.GetFullPath(filename);
System\Configuration\Internal\InternalConfigHost.cs (6)
194if (!Path.IsPathRooted(streamName)) throw ExceptionUtil.ParameterInvalid(nameof(streamName)); 197streamName = Path.GetFullPath(streamName); 201string result = Path.Combine(dirStream, configSource); 202result = Path.GetFullPath(result); 241string dir = Path.GetDirectoryName(streamName); 298return Path.IsPathRooted(streamName);
System\Configuration\LocalFileSettingsProvider.cs (1)
327file = Path.Combine(previousDirectory.FullName, ConfigurationManagerInternalFactory.Instance.UserConfigFilename);
System\Configuration\NameValueFileSectionHandler.cs (2)
40string directory = Path.GetDirectoryName(configFile); 41string sourceFileFullPath = Path.Combine(directory, filename);
System\Configuration\UrlPath.cs (2)
15return Path.GetDirectoryName(path) ?? Path.GetPathRoot(path);
System\Diagnostics\TraceUtils.cs (5)
74if ((initializeData[0] != Path.DirectorySeparatorChar) && (initializeData[0] != Path.AltDirectorySeparatorChar) && !Path.IsPathRooted(initializeData)) 80string dirPath = Path.GetDirectoryName(filePath); 83initializeData = Path.Combine(dirPath, initializeData);
System.Console (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
System.Data.Common (3)
System\Data\xmlsaver.cs (3)
1094_filePath = Path.GetDirectoryName(fs.Name); 1095_fileName = Path.GetFileNameWithoutExtension(fs.Name); 1096_fileExt = Path.GetExtension(fs.Name);
System.Data.Odbc (1)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
651return Path.GetFullPath(filename);
System.Diagnostics.FileVersionInfo (2)
System\Diagnostics\FileVersionInfo.cs (2)
269if (!Path.IsPathFullyQualified(fileName)) 271fileName = Path.GetFullPath(fileName);
System.Diagnostics.Process (12)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
138currentCGroupMemoryPath = Path.GetDirectoryName(currentCGroupMemoryPath);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
66module = new ProcessModule(parsedLine.Path, Path.GetFileName(parsedLine.Path))
System\Diagnostics\Process.Unix.cs (8)
635if (Path.IsPathRooted(filename)) 655workingDirectory = workingDirectory != null ? Path.GetFullPath(workingDirectory) : 657string filenameInWorkingDirectory = Path.Combine(workingDirectory, filename); 699if (Path.IsPathRooted(filename)) 712path = Path.Combine(Path.GetDirectoryName(path)!, filename); 722path = Path.Combine(Directory.GetCurrentDirectory(), filename); 747path = Path.Combine(subPath, program);
System\Diagnostics\ProcessManager.Linux.cs (2)
120string dirName = Path.GetFileName(taskDir); 162string dirName = Path.GetFileName(procDir);
System.Diagnostics.TextWriterTraceListener (4)
System\Diagnostics\TextWriterTraceListener.cs (4)
227string fullPath = Path.GetFullPath(_fileName); 228string dirPath = Path.GetDirectoryName(fullPath)!; 229string fileNameOnly = Path.GetFileName(fullPath); 242fullPath = Path.Combine(dirPath, fileNameOnly);
System.Drawing.Common (14)
System\Drawing\Bitmap.cs (1)
34filename = Path.GetFullPath(filename);
System\Drawing\Icon.cs (1)
157filePath = Path.GetFullPath(filePath);
System\Drawing\Image.cs (3)
92filename = Path.GetFullPath(filename); 98filename = Path.GetFullPath(filename); 395string? directoryPart = Path.GetDirectoryName(filename);
System\Drawing\Imaging\ImageAttributes.cs (1)
290Path.GetFullPath(colorProfileFilename);
System\Drawing\Imaging\Metafile.cs (5)
62Path.GetFullPath(filename); 210Path.GetFullPath(fileName); 402Path.GetFullPath(fileName); 427Path.GetFullPath(fileName); 586Path.GetFullPath(fileName);
System\Drawing\ToolboxBitmapAttribute.cs (3)
153string? ext = Path.GetExtension(imageFile); 250if (string.Equals(Path.GetExtension(imageName), ".ico", StringComparison.CurrentCultureIgnoreCase)) 254else if (string.Equals(Path.GetExtension(imageName), ".bmp", StringComparison.CurrentCultureIgnoreCase))
System.Drawing.Common.Tests (19)
Helpers.cs (1)
69private static string GetTestPath(string directoryName, string fileName) => Path.Join(AppContext.BaseDirectory, directoryName, fileName);
mono\System.Drawing\BitmapTests.cs (2)
297sRslt = Path.GetFullPath(sSub); 780string filename = Path.GetTempFileName();
System\Drawing\IconConverterTests.cs (1)
21_icon = new Icon(Path.Join("bitmaps", "TestIcon.ico"));
System\Drawing\IconTests.cs (3)
358string bitmapPathRoot = Path.GetPathRoot(bitmapPath); 812Icon.ExtractIcon(Path.GetRandomFileName() + ".ico", 0, 16); 817Icon.ExtractIcon(Path.GetRandomFileName() + ".ico", 0);
System\Drawing\ImageAnimator.ManualTests.cs (4)
10public static string OutputFolder { get; } = Path.Join(Environment.CurrentDirectory, "ImageAnimatorManualTests", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); 47string testOutputFolder = Path.Join(OutputFolder, Path.GetFileNameWithoutExtension(imageName)); 60animation.Save(Path.Join(testOutputFolder, $"{++frameIndexes[imageName]}_{timestamp}.jpg"), ImageFormat.Jpeg);
System\Drawing\ImageConverterTests.cs (2)
19_image = Image.FromFile(Path.Join("bitmaps", "TestImage.bmp")); 49string path = Path.Join("bitmaps", "TestImageWithOleHeader.bmp");
System\Drawing\ImageTests.cs (1)
665string badTarget = Path.Join("NoSuchDirectory", "NoSuchFile");
System\Drawing\Imaging\ImageFormatTests.cs (4)
74yield return new object[] { Path.Join("bitmaps", "nature24bits.gif"), "Gif" }; 75yield return new object[] { Path.Join("bitmaps", "nature24bits.jpg"), "Jpeg" }; 76yield return new object[] { Path.Join("bitmaps", "VisualPng.ico"), "Icon" }; 77yield return new object[] { Path.Join("bitmaps", "almogaver32bits.tif"), "Tiff" };
System\Drawing\Text\PrivateFontCollectionTests.cs (1)
44string relativePath = Path.Join("fonts", "CodeNewRoman.ttf");
System.Formats.Tar (47)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
246Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\Formats\Tar\TarEntry.cs (17)
315TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 339TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes); 348Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 353Path.IsPathFullyQualified(name) ? name : Path.Join(destinationDirectoryPath, name)); 367Path.IsPathFullyQualified(linkName) ? linkName : Path.Join(Path.GetDirectoryName(fileDestinationPath), linkName)); 382Path.Join(destinationDirectoryPath, linkName)); 397Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 400string fullPath = Path.GetFullPath(qualifiedPath); // Removes relative segments 450Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 505string? directoryPath = Path.GetDirectoryName(filePath); 507if (!string.IsNullOrEmpty(directoryPath) && !Path.Exists(directoryPath)) 512if (!Path.Exists(filePath)) 535Debug.Assert(!Path.Exists(destinationFileName)); 551Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarFile.cs (14)
47sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 86sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 107sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 108destinationFileName = Path.GetFullPath(destinationFileName); 143sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 144destinationFileName = Path.GetFullPath(destinationFileName); 187destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 232destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 260sourceFileName = Path.GetFullPath(sourceFileName); 261destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 307sourceFileName = Path.GetFullPath(sourceFileName); 308destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 525Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 534Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath));
System\Formats\Tar\TarHeader.Write.cs (5)
1228ReadOnlySpan<char> dirName = Path.GetDirectoryName(_name.AsSpan()); 1231ReadOnlySpan<char> fileName = Path.GetFileName(_name.AsSpan()); 1235$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}{Path.DirectorySeparatorChar}" : 1250ReadOnlySpan<char> tmp = Path.TrimEndingDirectorySeparator(Path.GetTempPath());
System\Formats\Tar\TarHelpers.cs (1)
450=> c == Path.DirectorySeparatorChar;
System\Formats\Tar\TarHelpers.Unix.cs (3)
25string filename = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
System\Formats\Tar\TarWriter.cs (2)
388string fullPath = Path.GetFullPath(fileName); 389string? actualEntryName = string.IsNullOrEmpty(entryName) ? Path.GetFileName(fileName) : entryName;
System.IO.Compression (2)
System\IO\Compression\ZipArchiveEntry.cs (2)
130_externalFileAttr = entryName.EndsWith(Path.DirectorySeparatorChar) || entryName.EndsWith(Path.AltDirectorySeparatorChar)
System.IO.Compression.ZipFile (12)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\Compression\ZipFile.Create.cs (3)
483sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 484destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName); 503return Path.GetFullPath(sourceDirectoryName);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs (1)
97Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.cs (6)
116if (!destinationDirectoryFullPath.EndsWith(Path.DirectorySeparatorChar)) 118char sep = Path.DirectorySeparatorChar; 122fileDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectoryFullPath, ArchivingUtils.SanitizeEntryFilePath(source.FullName))); 127if (Path.GetFileName(fileDestinationPath).Length == 0) 146Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System.IO.FileSystem.DriveInfo (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.IO.FileSystem.Watcher (10)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
246Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\IO\FileSystemWatcher.cs (1)
376ReadOnlySpan<char> name = IO.Path.GetFileName(relativePath);
System\IO\FileSystemWatcher.Linux.cs (4)
468AddDirectoryWatchUnlocked(directoryEntry, System.IO.Path.GetFileName(subDir)); 987if (c != System.IO.Path.DirectorySeparatorChar && c != System.IO.Path.AltDirectorySeparatorChar) 989builder.Append(System.IO.Path.DirectorySeparatorChar);
System.IO.IsolatedStorage (18)
System\IO\IsolatedStorage\Helper.cs (2)
71if (Path.GetFileName(directory)?.Length == 12) 75if (Path.GetFileName(subdirectory)?.Length == 12)
System\IO\IsolatedStorage\Helper.NonMobile.cs (4)
26dataDirectory = Path.Combine(dataDirectory, IsolatedStorageDirectoryName); 49randomDirectory = Path.Combine(rootDirectory, Path.GetRandomFileName(), Path.GetRandomFileName());
System\IO\IsolatedStorage\IsolatedStorage.cs (1)
115get { return Path.DirectorySeparatorChar; }
System\IO\IsolatedStorage\IsolatedStorageFile.cs (8)
177return Directory.EnumerateFiles(RootDirectory, searchPattern).Select(f => Path.GetFileName(f)).ToArray(); 201return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m)!.Length + 1)).ToArray(); 548if (partialPath[i] != Path.DirectorySeparatorChar && partialPath[i] != Path.AltDirectorySeparatorChar) 556return Path.Combine(RootDirectory, partialPath); 627parentDirectory = Path.GetDirectoryName(parentDirectory); 716private static bool IsIdFile(string file) => string.Equals(Path.GetFileName(file), "identity.dat"); 718private static bool IsInfoFile(string file) => string.Equals(Path.GetFileName(file), "info.dat");
System\IO\IsolatedStorage\IsolatedStorageFile.NonMobile.cs (3)
64string directoryName = Path.GetFileName(directory); 74return Path.GetDirectoryName(RootDirectory.TrimEnd(Path.DirectorySeparatorChar));
System.IO.MemoryMappedFiles (4)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (2)
316string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
System.IO.Packaging (6)
System\IO\Packaging\PackUriHelper.cs (6)
206string file = Path.GetFileName(partName); 214partName = Path.Combine(partName, RelationshipPartSegmentName, file); // Adding the "_rels" segment and the last segment back 262string partNameWithoutExtension = Path.GetFileNameWithoutExtension(path); 274path = Path.Combine(path, partNameWithoutExtension); // Adding the last segment without ".rels" extension 693string partUriExtension = Path.GetExtension(_partUriString); 800Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension);
System.IO.Pipes (8)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System\IO\Pipes\PipeStream.Unix.cs (6)
27private static readonly char[] s_invalidFileNameChars = Path.GetInvalidFileNameChars(); 30private static readonly char[] s_invalidPathNameChars = Path.GetInvalidPathChars(); 33private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_"); 203if (Path.IsPathRooted(pipeName)) 205if (pipeName.AsSpan().ContainsAny(s_invalidPathNameChars) || pipeName.EndsWith(Path.DirectorySeparatorChar))
System.IO.Ports (2)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
System.Net.Mail (5)
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.NetworkInformation (3)
System\Net\NetworkInformation\LinuxIPGlobalStatistics.cs (1)
36string forwardingConfigFile = Path.Combine(NetworkFiles.Ipv6ConfigFolder,
System\Net\NetworkInformation\LinuxIPInterfaceStatistics.cs (1)
26string transmitQueueLengthFilePath = Path.Combine(NetworkFiles.SysClassNetFolder, name, NetworkFiles.TransmitQueueLengthFileName);
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
41Path.Join(NetworkFiles.Ipv4ConfigFolder, _linuxNetworkInterface.Name, NetworkFiles.ForwardingFileName),
System.Net.Ping (2)
src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (2)
30string pathv4v6 = Path.Combine(folder, s_ipv4v6PingFile); 31string path = Path.Combine(folder, fileName);
System.Net.Quic (2)
System\Net\Quic\Internal\MsQuicApi.cs (2)
100? System.IO.Path.GetDirectoryName(assemblyLocation)! 103path = System.IO.Path.Combine(path, Interop.Libraries.MsQuic);
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (1)
277string? dirname = Path.GetDirectoryName(fnfe.FileName);
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
153return new UnixDomainSocketEndPoint(_path, Path.GetFullPath(_path));
System.Net.WebClient (4)
System\Net\WebClient.cs (4)
478fileName = Path.GetFullPath(fileName); 507"Content-Disposition: form-data; name=\"file\"; filename=\"" + Path.GetFileName(fileName) + "\"\r\n" + // TODO: Should the filename path be encoded? 787return new Uri(Path.GetFullPath(address)); 792return new Uri(Path.GetFullPath(address));
System.Private.CoreLib (149)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
172string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(fullPath));
src\libraries\Common\src\System\IO\PathInternal.cs (2)
246Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (2)
27string? directory = Path.GetDirectoryName(path); 32if (!Path.EndsInDirectorySeparator(directory))
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
122string fullPath = Path.GetFullPath(assemblyFile);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (6)
130data = Path.Combine(home, ".local", "share"); 142return Path.Combine(home, ".fonts"); 160config = Path.Combine(home, ".config"); 184string userDirsPath = Path.Combine(GetXdgConfig(homeDir), "user-dirs.dirs"); 236Path.Join(homeDir, line.AsSpan(pos, endPos - pos)) : 248return Path.Combine(homeDir, fallback);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (18)
20string fullPath = Path.GetFullPath(path); 22string? s = Path.GetDirectoryName(fullPath); 32string fullPath = Path.GetFullPath(path); 89string fullPath = Path.GetFullPath(path); 102string fullPath = Path.GetFullPath(path); 108string fullPath = Path.GetFullPath(path); 124string fullPath = Path.GetFullPath(path); 130string fullPath = Path.GetFullPath(path); 146string fullPath = Path.GetFullPath(path); 152string fullPath = Path.GetFullPath(path); 254string fullPath = Path.GetFullPath(path); 255string root = Path.GetPathRoot(fullPath)!; 266Environment.CurrentDirectory = Path.GetFullPath(path); 274FileSystem.MoveDirectory(Path.GetFullPath(sourceDirName), Path.GetFullPath(destDirName)); 279string fullPath = Path.GetFullPath(path); 285string fullPath = Path.GetFullPath(path); 311string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
20string fullPath = Path.GetFullPath(path); 31string tempPath = Path.GetTempPath();
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (13)
20fullPath: Path.GetFullPath(path), 34fullPath = isNormalized ? fullPath : Path.GetFullPath(fullPath); 53Path.GetFileName(Path.TrimEndingDirectorySeparator(fullPath))).ToString(); 67string? parentName = Path.GetDirectoryName(PathInternal.IsRoot(FullPath.AsSpan()) ? FullPath : Path.TrimEndingDirectorySeparator(FullPath)); 80if (Path.IsPathRooted(path)) 83string newPath = Path.GetFullPath(Path.Combine(FullPath, path)); 85ReadOnlySpan<char> trimmedNewPath = Path.TrimEndingDirectorySeparator(newPath.AsSpan()); 86ReadOnlySpan<char> trimmedCurrentPath = Path.TrimEndingDirectorySeparator(FullPath.AsSpan()); 204public DirectoryInfo Root => new DirectoryInfo(Path.GetPathRoot(FullPath)!); 210string destination = Path.GetFullPath(destDirName);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.cs (1)
39if (Path.EndsInDirectorySeparator(OriginalRootDirectory) && PathInternal.StartsWithDirectorySeparator(relativePath))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (2)
88Path.TryJoin(Directory, FileName, _pathBuffer, out int charsWritten); 182Path.Join(originalRootDirectory, relativePath, fileName);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerableFactory.cs (4)
29if (Path.IsPathRooted(expression)) 45ReadOnlySpan<char> directoryName = Path.GetDirectoryName(expression.AsSpan()); 52directory = Path.Join(directory.AsSpan(), directoryName); 77if (Path.DirectorySeparatorChar != '\\' && expression.AsSpan().ContainsAny(@"\""<>"))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.cs (2)
37string path = isNormalized ? directory : Path.GetFullPath(directory); 38_rootDirectory = Path.TrimEndingDirectorySeparator(path);
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
145_pending.Enqueue((Path.Join(_currentPath, entry.FileName), _remainingRecursionDepth - 1));
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (26)
55FileSystem.CopyFile(Path.GetFullPath(sourceFileName), Path.GetFullPath(destFileName), overwrite); 84FileSystem.DeleteFile(Path.GetFullPath(path)); 100path = Path.GetFullPath(path); 170return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize); 184=> FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false); 215=> FileSystem.SetCreationTime(Path.GetFullPath(path), GetUtcDateTimeOffset(creationTimeUtc), asDirectory: false); 247=> FileSystem.GetCreationTime(Path.GetFullPath(path)).LocalDateTime; 272=> FileSystem.GetCreationTime(Path.GetFullPath(path)).UtcDateTime; 297=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), lastAccessTime, false); 328=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastAccessTimeUtc), false); 359=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).LocalDateTime; 384=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).UtcDateTime; 409=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), lastWriteTime, false); 440=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastWriteTimeUtc), false); 471=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).LocalDateTime; 496=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).UtcDateTime; 521=> FileSystem.GetAttributes(Path.GetFullPath(path)); 545=> FileSystem.SetAttributes(Path.GetFullPath(path), fileAttributes); 1029Path.GetFullPath(sourceFileName), 1030Path.GetFullPath(destinationFileName), 1031destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null, 1051string fullSourceFileName = Path.GetFullPath(sourceFileName); 1052string fullDestFileName = Path.GetFullPath(destFileName); 1429string fullPath = Path.GetFullPath(path); 1451string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\IO\File.Unix.cs (2)
11=> FileSystem.GetUnixFileMode(Path.GetFullPath(path)); 17=> FileSystem.SetUnixFileMode(Path.GetFullPath(path), mode);
src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (9)
28FullPath = isNormalized ? fullPath ?? originalPath : Path.GetFullPath(fullPath); 32public override string Name => _name ??= Path.GetFileName(OriginalPath); 46public string? DirectoryName => Path.GetDirectoryName(FullPath); 95string destinationPath = Path.GetFullPath(destFileName); 157string fullDestFileName = Path.GetFullPath(destFileName); 163if (!new DirectoryInfo(Path.GetDirectoryName(FullName)!).Exists) 173_name = Path.GetFileName(fullDestFileName); 188Path.GetFullPath(destinationFileName), 189destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null,
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (2)
191=> GetAttributes(handle, handle.Path, Path.GetFileName(handle.Path), continueOnError); 507Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.cs (4)
33ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 34ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 41Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator)))
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (1)
47fullPath = Path.TrimEndingDirectorySeparator(fullPath);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (9)
103if (!Directory.Exists(Path.GetDirectoryName(destFullPath))) 248string? directoryName = Path.GetDirectoryName(fullPath); 402ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 403ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 407if (OperatingSystem.IsBrowser() && Path.EndsInDirectorySeparator(sourceFullPath) && FileExists(sourceFullPath)) 432Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator))) // same names. 439&& Path.EndsInDirectorySeparator(sourceFullPath)) 732sb.Length = Path.GetDirectoryNameOffset(sb.AsSpan());
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
57if (PathInternal.IsDirectorySeparator(ch) || ch == Path.VolumeSeparatorChar)
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
102string tempPath = Path.GetTempPath();
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
42string fullPath = Path.GetFullPath(path);
src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (5)
281string normalizedPath = Path.GetFullPath(path); 324requestorPath = Path.GetFullPath(requestorPath); 345string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath)!, requestedAssemblyName.Name + ".dll"); 379string fullPath = Path.GetFullPath(assemblyFile);
src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (1)
71string path = Path.Combine(_mediator.ModuleDir, fileName);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyDependencyResolver.cs (7)
101_assemblyPaths.TryAdd(Path.GetFileNameWithoutExtension(assemblyPath), assemblyPath); 107_assemblyDirectorySearchPaths = [Path.GetDirectoryName(componentAssemblyPath)!]; 130string assemblyPath = Path.Combine( 163if (unmanagedDllName.Contains(Path.DirectorySeparatorChar)) 175bool isRelativePath = !Path.IsPathFullyQualified(unmanagedDllName); 181string libraryPath = Path.Combine(searchPath, libraryName); 200return pathsList.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries);
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
762string? parentDirectory = Path.GetDirectoryName(parentAssembly.Location); 766string assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!, $"{assemblyName.Name}.dll"); 777assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!.ToLowerInvariant(), $"{assemblyName.Name}.dll");
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\LibraryNameVariation.Unix.cs (1)
36bool containsDelim = libName.Contains(Path.DirectorySeparatorChar);
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (6)
45startupHookParts.AddRange(diagnosticStartupHooks.Split(Path.PathSeparator)); 50startupHookParts.AddRange(startupHooksVariable.Split(Path.PathSeparator)); 91Path.DirectorySeparatorChar, 92Path.AltDirectorySeparatorChar, 102if (Path.IsPathFullyQualified(startupHookPart)) 147Debug.Assert(Path.IsPathFullyQualified(startupHook.Path));
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (10)
80if (Path.IsPathRooted(id) || IdContainsAnyDisallowedChars(id)) 88string timeZoneFilePath = Path.Combine(timeZoneDirectory, id); 162var fileName = Path.Combine(GetTimeZoneDirectory(), TimeZoneFileName); 251symlinkPath = Path.GetFullPath(symlinkPath, Path.GetDirectoryName(tzFilePath)!); 314string localtimeFilePath = Path.Combine(timeZoneDirectory, "localtime"); 315string posixrulesFilePath = Path.Combine(timeZoneDirectory, "posixrules"); 436TryLoadTzFile(Path.Combine(GetTimeZoneDirectory(), "localtime"), ref rawData, ref id); 453tzFilePath = Path.Combine(GetTimeZoneDirectory(), tzVariable); 513else if (!tzDirectory.EndsWith(Path.DirectorySeparatorChar))
src\System\Reflection\RuntimeModule.cs (1)
500int i = s.LastIndexOf(IO.Path.DirectorySeparatorChar);
System.Private.Windows.Core.TestUtilities (6)
FileCleanupTestBase.cs (3)
19_testDirectory = Path.Join(Path.GetTempPath(), GetUniqueName()); 46public string GetTestFilePath() => Path.Join(TestDirectory, GetTestFileName());
TempFile.cs (3)
83string file = $"{IO.Path.GetRandomFileName()}_{memberName}_{lineNumber}"; 84return IO.Path.Join(IO.Path.GetTempPath(), file);
System.Private.Xml (7)
System\Xml\Serialization\Compilation.cs (6)
236path = Path.Combine(Path.GetDirectoryName(type.Assembly.Location)!, $"{assemblyName}.dll"); 241path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, $"{assemblyName}.dll"); 246path = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory)!, $"{assemblyName}.dll");
System\Xml\XmlResolver.cs (1)
48uri = new Uri(Path.GetFullPath(relativeUri!));
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\PathUtilities.cs (2)
20(Array.IndexOf(Path.GetInvalidFileNameChars(), '*') >= 0 ? DirectorySeparatorChar : AltDirectorySeparatorChar).ToString(); 48/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> this method doesn't check for invalid path characters.</remarks>
System\Reflection\PortableExecutable\PEReader.cs (1)
727peImageDirectory = Path.GetDirectoryName(peImagePath);
System.Reflection.MetadataLoadContext (4)
System\Reflection\PathAssemblyResolver.cs (1)
41string file = Path.GetFileNameWithoutExtension(path);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.Modules.cs (2)
44string? directoryPath = Path.GetDirectoryName(location); 45string modulePath = Path.Combine(directoryPath!, moduleName);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
53int i = s.LastIndexOf(Path.DirectorySeparatorChar);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
319[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.Caching (2)
System\Runtime\Caching\FileChangeNotificationSystem.cs (2)
102string dir = Path.GetDirectoryName(filePath); 151string dir = Path.GetDirectoryName(filePath);
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
44[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\RuntimeEnvironment.cs (3)
22if (!Path.IsPathRooted(runtimeDirectory)) 27char sep = Path.DirectorySeparatorChar; 28return string.Concat(Path.GetDirectoryName(runtimeDirectory), new ReadOnlySpan<char>(in sep));
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
123string assemblyName = System.IO.Path.GetFileName(assembly.Location);
System.Security.Cryptography (11)
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (3)
330return Path.GetFullPath(rootFile); 340string[] directories = rootDirectory.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); 344directories[i] = Path.GetFullPath(directories[i]);
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
307return Path.Combine(s_crlDir, localFileName);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (4)
207destinationFilename = Path.Combine(_storePath, thumbprint + PfxExtension); 308string builtPath = Path.Combine(_storePath, pathBuilder.ToString()); 330return Path.Combine(s_userStoreRoot, directoryName); 339string fileName = Path.GetFileName(storeName);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
425_ = Path.GetFullPath(fileName);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
27using StreamWriter sw = new StreamWriter($"{Path.Combine(path, classname)}.cs");
System.Windows.Forms (24)
System\Resources\AssemblyNamesTypeResolutionService.cs (1)
16private static readonly string s_dotNetPath = Path.Join(
System\Resources\ResXDataNode.cs (2)
133_fileRefFullPath = !Path.IsPathRooted(fileRefDetails[0]) && basePath is not null 134? Path.Join(basePath, fileRefDetails[0])
System\Resources\ResXFileRef.cs (3)
67if (path1[i] == Path.DirectorySeparatorChar) 87if (path1[i] == Path.DirectorySeparatorChar) 89relPath.Append($"..{Path.DirectorySeparatorChar}");
System\Resources\ResXResourceWriter.cs (2)
311string modifiedBasePath = Path.EndsInDirectorySeparator(BasePath) 313: $"{BasePath}{Path.DirectorySeparatorChar}";
System\Windows\Forms\Application.cs (1)
1184string path = Path.Join(basePath, CompanyName, ProductName, ProductVersion);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
407string themeFilename = Path.GetFileName(VisualStyles.VisualStyleInformation.ThemeFilename);
System\Windows\Forms\Controls\ListView\ListView.cs (1)
5170_backgroundImageFileName = Path.GetTempFileName();
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
161path = Path.GetFullPath(path);
System\Windows\Forms\Controls\ToolStrips\ProfessionalColorTable.cs (1)
1373string themeFileName = Path.GetFileName(VisualStyleInformation.ThemeFilename);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
612string mshtmlPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.System), "mshtml.dll");
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (4)
472names.Add(Path.IsPathFullyQualified(fileName) 474: Path.Join(directory, fileName)); 624if (AddExtension && !Path.HasExtension(fileName)) 630var currentExtension = Path.GetExtension(fileName.AsSpan());
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (2)
370string? parent = Path.GetDirectoryName(selectedPath); 377string folder = Path.GetFileName(selectedPath);
System\Windows\Forms\Dialogs\CommonDialogs\OpenFileDialog.cs (2)
180public string SafeFileName => Path.GetFileName(FileName) ?? string.Empty; 197safePaths[i] = Path.GetFileName(fullPaths[i]);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (1)
902caption = Path.GetFileName(PInvoke.GetModuleFileNameLongPath(HINSTANCE.Null));
System\Windows\Forms\Help\Help.cs (1)
301string ext = Path.GetExtension(file is null ? url : file.LocalPath + file.Fragment).ToLower(CultureInfo.InvariantCulture);
System.Windows.Forms.Analyzers.Tests (27)
CurrentReferences.cs (13)
59WinFormsRefPath = Path.Join(RepoRootPath, "artifacts", "obj", "System.Windows.Forms", configuration, tfm, "ref", "System.Windows.Forms.dll"); 62string netCoreAppRefPath = Path.Join(RepoRootPath, ".dotnet", "packs", RefPackageName); 63if (!Directory.Exists(Path.Join(netCoreAppRefPath, netCoreRefsVersion))) 74Path.Join("ref", tfm)) 75.WithNuGetConfigFilePath(Path.Join(RepoRootPath, "NuGet.Config")); 82Path.GetFileName(v).StartsWith(major, StringComparison.InvariantCultureIgnoreCase)); 101string sdkFolderPath = Path.Join(rootFolderPath, ".dotnet", "sdk", version); 116string? testPath = Path.GetDirectoryName(typeof(CurrentReferences).Assembly.Location); 119string? currentFolderPath = Path.GetDirectoryName(testPath); 123string globalJsonPath = Path.Join(currentFolderPath, "global.json"); 131currentFolderPath = Path.GetDirectoryName(currentFolderPath); 140string globalJsonPath = Path.Join(rootFolderPath, "global.json"); 153string configJsonPath = Path.Join(sdkFolderPath, "dotnet.runtimeconfig.json");
TestFileLoader.cs (14)
25builder.Append(Path.DirectorySeparatorChar); 27builder.Append(Path.DirectorySeparatorChar); 56string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 57return await LoadTestFileAsync(Path.Join("Analyzers", toolName), testName, SourceLanguage.None).ConfigureAwait(false); 64string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 65return await LoadTestFileAsync(Path.Join("Generators", toolName), testName, SourceLanguage.None).ConfigureAwait(false); 72string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 73return await LoadTestFileAsync(Path.Join("Analyzers", toolName), testName).ConfigureAwait(false); 80string toolName = Path.GetFileName(Path.GetDirectoryName(filePath))!; 81return await LoadTestFileAsync(Path.Join("Analyzers", toolName), testName, SourceLanguage.VisualBasic).ConfigureAwait(false);
System.Windows.Forms.Design (3)
System\Drawing\BitmapSelector.cs (2)
37=> string.IsNullOrEmpty(Suffix) ? filePath : Path.ChangeExtension(filePath, Suffix + Path.GetExtension(filePath));
System\Windows\Forms\Design\ImageListImageEditor.cs (1)
76image.Name = Path.GetFileName(name);
System.Windows.Forms.Design.Tests (4)
System\Resources\Tools\CodeDomCompileHelper.cs (2)
29MetadataReference.CreateFromFile(Path.Join(Path.GetDirectoryName(corelibPath), "System.Runtime.dll")),
System\Resources\Tools\StronglyTypedResourceBuilderTests.cs (2)
619string expectedUrl = $"{Path.GetTempPath()}testurl1"; 643string changedUrl = $"{Path.GetTempPath()}testurl2";
System.Windows.Forms.IntegrationTests.Common (6)
TestHelpers.cs (6)
58string exePath = Path.Join( 91startInfo.WorkingDirectory = Path.GetDirectoryName(path); 185string jsonFile = Path.Join(repoRoot, "global.json"); 208string sdkPath = Path.Join(defaultSdkRoot, dotnetVersion); 244string currentDirectory = Path.GetDirectoryName(codeBasePath); 250string ret = Path.Join(currentDirectory, seek);
System.Windows.Forms.Primitives (6)
System\Windows\Forms\Internals\ThemingScope.cs (3)
84string tempFilePath = Path.Join(Path.GetTempPath(), Path.GetRandomFileName());
Windows\Win32\PInvoke.LoadLibrary.cs (3)
17string customPath = Path.Join(startupPath, Libraries.Comctl32); 18Debug.Assert(Path.IsPathFullyQualified(customPath)); 20if (Path.IsPathFullyQualified(customPath))
System.Windows.Forms.Primitives.Tests (1)
Interop\Shell32\ShellItemTests.cs (1)
14string path = Path.GetTempPath();
System.Windows.Forms.Primitives.TestUtilities (1)
PlatformDetection.Windows.cs (1)
55File.Exists(Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "System32", "httpapi.dll"));
System.Windows.Forms.Primitives.TestUtilities.Tests (1)
PathLengthTests.cs (1)
15currentPath = Path.GetFullPath(@"..\..\..\..\..\..\src", currentPath);
System.Windows.Forms.Tests (60)
System\Resources\ResXResourceReaderTests.cs (2)
19string resxPath = Path.GetFullPath(@".\Resources\AxHosts.resx"); 48string resxPath = Path.GetFullPath(@".\Resources\AxHosts.resx");
System\Windows\Forms\CursorConverterTests.cs (3)
39byte[] data = File.ReadAllBytes(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 129byte[] data = File.ReadAllBytes(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 139string fileName = Path.Join("bitmaps", "10x16_one_entry_32bit.ico");
System\Windows\Forms\CursorTests.cs (15)
60yield return new object[] { Path.Join("bitmaps", "cursor.cur"), Point.Empty }; 61yield return new object[] { Path.Join("bitmaps", "10x16_one_entry_32bit.ico"), new Point(5, 8) }; 79using MemoryStream stream = new(File.ReadAllBytes(Path.Join("bitmaps", "cursor.cur"))); 99yield return new object[] { Path.Join("bitmaps", "nature24bits.jpg") }; 100yield return new object[] { Path.Join("bitmaps", "nature24bits.gif") }; 101yield return new object[] { Path.Join("bitmaps", "1bit.png") }; 102yield return new object[] { Path.Join("bitmaps", "almogaver24bits.bmp") }; 103yield return new object[] { Path.Join("bitmaps", "telescope_01.wmf") }; 104yield return new object[] { Path.Join("bitmaps", "milkmateya01.emf") }; 105yield return new object[] { Path.Join("bitmaps", "EmptyFile") }; 329using Cursor sourceCursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 344Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 380using Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 417using Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")); 502using Cursor cursor = new(Path.Join("bitmaps", "10x16_one_entry_32bit.ico"));
System\Windows\Forms\InputLanguageTests.cs (4)
225string file = Path.Join(Path.GetTempPath(), $"install-language-{languageTag}.ps1"); 238string file = Path.Join(Path.GetTempPath(), $"uninstall-language-{languageTag}.ps1");
System\Windows\Forms\RichTextBoxTests.cs (3)
10681string projectDirectory = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", ".."); 10711string projectDirectory = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", ".."); 10712string filePath = Path.Join(projectDirectory, "/src/test/unit/System.Windows.Forms/TestResources/Files/Test");
System\Windows\Forms\ToolStripControlHostTests.cs (6)
402yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 403yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 1213yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 1214yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 1339yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), color }; 1340yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), color };
System\Windows\Forms\ToolStripItemTests.cs (20)
1771yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 1772yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 1867yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), 1 }; 1868yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), 1 }; 3787yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 3788yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 3817yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), -1 }; 3818yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), -1 }; 3891yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), 1 }; 3892yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), 1 }; 5605yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), color }; 5606yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), color }; 5672yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Empty, 0 }; 5673yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Red, 1 }; 5674yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Empty, 0 }; 5675yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Red, 1 }; 5739yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Empty, 0 }; 5740yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), Color.Red, 1 }; 5741yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Empty, 0 }; 5742yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), Color.Red, 1 };
System\Windows\Forms\ToolStripSeparatorTests.cs (6)
116yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 117yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 423yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")) }; 424yield return new object[] { imageTransparentColor, Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")) }; 533yield return new object[] { Image.FromFile(Path.Join("bitmaps", "nature24bits.gif")), color }; 534yield return new object[] { Image.FromFile(Path.Join("bitmaps", "10x16_one_entry_32bit.ico")), color };
TestResources\ComClasses.cs (1)
15Path.GetFullPath(@"TestResources\VB6\SimpleControl.vb6"),
System.Windows.Forms.UI.IntegrationTests (20)
DragDropTests.cs (7)
130string dragDropDirectory = Path.Join(Directory.GetCurrentDirectory(), DragDrop); 140string dragAcceptRtfSourcePath = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 147dragAcceptRtfDestPath = Path.Join(dragDropDirectory, DragAcceptRtf); 425string dragAcceptRtfPath = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 455string dragAcceptRtfPath = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 1084string dragAcceptRtf = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf); 1144string dragAcceptRtf = Path.Join(Directory.GetCurrentDirectory(), Resources, DragAcceptRtf);
Infra\DataCollectionService.cs (9)
230return Path.Join(Path.GetFullPath(logDirectory), $"{timestamp:HH.mm.ss}-{testName}-{errorId}{logId}.{extension}"); 236return Path.Join(GetBaseLogDirectory(), "Screenshots"); 243return Path.GetFullPath(baseLogDirectory); 253string configuration = Path.GetFileName(Path.GetDirectoryName(assemblyDirectory))!; 254return Path.Join(assemblyDirectory[..binPathSeparator], "log", configuration); 257return Path.Join(assemblyDirectory, "xUnitResults"); 263return Path.GetDirectoryName(assemblyPath)!;
Infra\ScreenshotService.cs (1)
33string directory = Path.GetDirectoryName(fullPath)!;
OpenFileDialogTests.cs (3)
28dialog.InitialDirectory = Path.GetTempPath(); 40dialog.InitialDirectory = Path.GetDirectoryName(tempFile.Path); 53dialog.InitialDirectory = Path.GetDirectoryName(tempFile.Path);
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
443Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
TaskUsageLogger (2)
TaskUsageLogger.cs (2)
256evaluatedTaskAssemblyPath = Path.GetFullPath(evaluatedTaskAssemblyPath); 405string projectExtension = Path.GetExtension(projectPath);
Templates.Blazor.Tests (67)
BlazorTemplateTest.cs (1)
62var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory);
BlazorWasmTemplateTest.cs (9)
29var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 30Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 105var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 109Assert.False(File.Exists(Path.Combine(publishDir, "service-worker.published.js")), "service-worker.published.js should not be published"); 110Assert.True(File.Exists(Path.Combine(publishDir, "service-worker.js")), "service-worker.js should be published"); 111Assert.True(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "service-worker-assets.js should be published"); 127var fullPath = Path.Combine(basePath, path); 131return File.ReadAllText(Path.Combine(basePath, path)); 166var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot");
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 208var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 223var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 270var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 299var fullPath = Path.Combine(TemplateOutputDir, path); 411return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 533var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 535var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
43public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 47: Path.Combine("Hives", ".templateEngine")); 92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 131var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
Templates.Blazor.WebAssembly.Auth.Tests (63)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 208var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 223var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 270var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 299var fullPath = Path.Combine(TemplateOutputDir, path); 411return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 533var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 535var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
43public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 47: Path.Combine("Hives", ".templateEngine")); 92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 131var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
191opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 259return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
130var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Blazor.WebAssembly.Tests (71)
BlazorWasmTemplateTest.cs (8)
35var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 36Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 45var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 46Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 55var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 56Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js"); 65var publishDir = Path.Combine(project.TemplatePublishDir, "wwwroot"); 66Assert.False(File.Exists(Path.Combine(publishDir, "service-worker-assets.js")), "Non-PWA templates should not produce service-worker-assets.js");
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 208var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 223var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 270var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 299var fullPath = Path.Combine(TemplateOutputDir, path); 411return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 533var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 535var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
43public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 47: Path.Combine("Hives", ".templateEngine")); 92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 131var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
191opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 259return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
130var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Mvc.Tests (69)
BlazorTemplateTest.cs (4)
176var singleProjectPath = Path.Combine(project.TemplateOutputDir, $"{project.ProjectName}.csproj"); 182var multiProjectPath = Path.Combine(project.TemplateOutputDir, project.ProjectName, $"{project.ProjectName}.csproj"); 186project.TemplateOutputDir = Path.GetDirectoryName(multiProjectPath); 195var appRazorPath = Path.Combine(project.TemplateOutputDir, "Components", "App.razor");
RazorPagesTemplateTest.cs (2)
310var fullPath = Path.Combine(basePath, path); 314return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 208var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 223var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 270var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 299var fullPath = Path.Combine(TemplateOutputDir, path); 411return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 533var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 535var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
43public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 47: Path.Combine("Hives", ".templateEngine")); 92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 131var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
191opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 259return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
130var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Templates.Tests (71)
BaselineTest.cs (1)
123var fullPath = Path.Combine(basePath, path);
ByteOrderMarkTest.cs (5)
48var filePath = Path.GetFullPath(file); 86var filePath = Path.GetFullPath(file); 107var AssetsDir = Path.Combine(currentDirectory, "Assets"); 108var path = Path.Combine(projectName, "content"); 109var templateDirectoryPath = Path.Combine(AssetsDir, path);
IdentityUIPackageTest.cs (2)
161var fullPath = Path.Combine(basePath, path); 165return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
61process = Path.ChangeExtension(dllPath, OperatingSystem.IsWindows() ? ".exe" : null);
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (3)
88var subProjectDirectory = Path.Combine(project.TemplateOutputDir, projectDirectory); 107var fullPath = Path.Combine(basePath, path); 111return File.ReadAllText(Path.Combine(basePath, path));
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (4)
18Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 20Path.Combine(AppContext.BaseDirectory, "aspnetcore-https.json"), 30var path = Path.ChangeExtension(json, ".pfx");
src\ProjectTemplates\Shared\Project.cs (9)
56public string TemplateBuildDir => Path.Combine(TemplateOutputDir, "bin", "Debug", TargetFramework, RuntimeIdentifier); 57public string TemplatePublishDir => Path.Combine(TemplateOutputDir, "bin", "Release", TargetFramework, RuntimeIdentifier, "publish"); 208var projectDll = Path.Combine(TemplateBuildDir, $"{ProjectName}.dll"); 223var projectDll = Path.Combine(TemplatePublishDir, $"{ProjectName}.dll"); 270var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations"); 299var fullPath = Path.Combine(TemplateOutputDir, path); 411return File.ReadAllText(Path.Combine(TemplateOutputDir, path)); 533var sourceFile = Path.Combine(TemplateOutputDir, "msbuild.binlog"); 535var destination = Path.Combine(ArtifactsLogDir, ProjectName + ".binlog");
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (3)
50ProjectGuid = GetRandomLetter() + Path.GetRandomFileName().Replace(".", string.Empty) 56project.TemplateOutputDir = Path.Combine(basePath, project.ProjectName); 68: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (5)
43public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 47: Path.Combine("Hives", ".templateEngine")); 92.Where(p => _templatePackages.Any(t => Path.GetFileName(p).StartsWith(t, StringComparison.OrdinalIgnoreCase))) 131var tempDir = Path.Combine(AppContext.BaseDirectory, Path.GetRandomFileName(), Guid.NewGuid().ToString("D"));
src\Shared\CertificateGeneration\CertificateManager.cs (5)
369var exportDir = Path.GetDirectoryName(path); 555var targetDirectoryPath = Path.GetDirectoryName(path); 641var tempFilename = Path.GetTempFileName(); 663var keyPath = Path.ChangeExtension(path, ".key"); 669var tempFilename = Path.GetTempFileName();
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 95var tmpFile = Path.GetTempFileName(); 153var tmpFile = Path.GetTempFileName(); 201var certificatePath = Path.GetTempFileName(); 342var certificatePath = Path.GetTempFileName(); 374Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\Shared\CertificateGeneration\UnixCertificateManager.cs (18)
105var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 108var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 236var certPath = Path.Combine(certDir, nickname) + ".pem"; 350var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 352: homeDirectory + Path.DirectorySeparatorChar; 355? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 360Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 400var certPath = Path.Combine(certDir, nickname) + ".pem"; 490return Path.Combine(homeDirectory, ".pki", "nssdb"); 495return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 500return Path.Combine(homeDirectory, ".mozilla", "firefox"); 505return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 529var searchFolders = searchPath.Split(Path.PathSeparator); 539if (File.Exists(Path.Combine(searchFolder, command))) 684return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 716var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 719var nssDb = Path.GetFullPath(path); 925var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\Shared\E2ETesting\BrowserFixture.cs (3)
191opts.AddUserProfilePreference("download.default_directory", Path.Combine(userProfileDirectory, "Downloads")); 259return Path.Combine(Path.GetTempPath(), "BrowserFixtureUserProfiles", context);
src\Shared\E2ETesting\SauceConnectServer.cs (1)
235var pidFile = Path.Combine(trackingFolder, $"{process.Id}.{Guid.NewGuid()}.pid");
src\Shared\E2ETesting\WaitAssert.cs (2)
130var screenShotPath = Path.Combine(Path.GetFullPath(E2ETestOptions.Instance.ScreenShotsPath), fileId);
Test.Utilities (7)
AdditionalFileProvider.cs (2)
41=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 49=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
PathHelper.cs (2)
12private static readonly char[] DirectorySeparatorCharacters = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
RulesetToEditorconfigConverter.cs (3)
33editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 50var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 51var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
TestDiscoveryWorker (3)
Program.cs (3)
47outputFilePath = Path.Combine(Path.GetDirectoryName(assemblyFilePath)!, "testlist.json"); 64string assemblyFileName = Path.GetFileName(assemblyFilePath);
TestPassApp (2)
CommonControl2.cs (2)
15string executablePath = Path.GetDirectoryName(executable); 16string page = Path.Join(executablePath, "HTMLPage1.html");
TestProject.AppHost (1)
TestProgram.cs (1)
71var serviceAPath = Path.Combine(Projects.TestProject_AppHost.ProjectPath, @"..\TestProject.ServiceA\TestProject.ServiceA.csproj");
TestTasks (3)
InjectRequestHandler.cs (3)
59var outputFolder = Path.GetDirectoryName(depsFile); 61File.Copy(Path.Combine(outputFolder, bitnessString, aspnetcoreV2Name), Path.Combine(outputFolder, aspnetcoreV2Name), overwrite: true);
Text.Analyzers (27)
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
203return Path.GetDirectoryName(resolvedBasePath); 211private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 254return Path.GetFullPath(path); 272return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 284return Path.GetFullPath(path);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (4)
25internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 124/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 450/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 459/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs (2)
23public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 25public static bool IsUnix => Path.DirectorySeparatorChar == '/';
src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\LanguageExtensions.cs (1)
16var fileExtension = Path.GetExtension(filePath);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\Section.cs (1)
39var containingDirectory = Path.GetDirectoryName(FilePath);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
trustedroots.Tests (2)
CtlFileTests.cs (1)
15_filePath = Path.Combine(
Program.cs (1)
70var testDirectory = TestDirectory.Create(Path.Combine(TestContext.Current.TestExecutionDirectory, "sdkinfo"));
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
317return System.IO.Path.GetFileName(sb.ToString().ToLower(CultureInfo.InvariantCulture));
vbc (14)
src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 114var tempDir = Path.GetTempPath();
src\Compilers\Shared\BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
src\Compilers\Shared\Vbc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, VisualBasicCompiler.ResponseFileName);
VBCSCompiler (18)
src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (2)
75AnalyzerAssemblyLoader = Microsoft.CodeAnalysis.AnalyzerAssemblyLoader.CreateNonLockingLoader(Path.Combine(Path.GetTempPath(), "VBCSCompiler", "AnalyzerAssemblyLoader"));
src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (1)
20: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache)
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
79var allModules = GetAllModules(primaryModule, Path.GetDirectoryName(fullPath)!);
src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (1)
22: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache)
src\Compilers\Shared\BuildClient.cs (2)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\'; 114var tempDir = Path.GetTempPath();
src\Compilers\Shared\BuildServerConnection.cs (7)
436var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 442commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 668clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 756var tempPath = Path.GetTempPath(); 757var result = Path.Combine(tempPath!, ".roslyn"); 765FilePath = Path.Combine(mutexDirectory, name); 766GuardPath = Path.Combine(mutexDirectory, ".guard");
src\Compilers\Shared\CompilerServerLogger.cs (1)
127loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\Compilers\Shared\RuntimeHostInfo.cs (2)
39return Path.GetDirectoryName(dotNetHostPath); 81var filePath = Path.Combine(item, fileName);
VBCSCompiler.UnitTests (41)
AnalyzerConsistencyCheckerTests.cs (1)
105var result = AnalyzerConsistencyChecker.Check(Path.GetDirectoryName(TestFixture.Alpha)!, analyzerReferences, assemblyLoader, Logger);
BuildClientTests.cs (7)
332var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); 335Assert.Equal(name, BuildServerConnection.GetPipeName(path + Path.DirectorySeparatorChar)); 336Assert.Equal(name, BuildServerConnection.GetPipeName(path + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar)); 342var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); 351var path1 = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar); 352var path2 = string.Format(@"Q:{0}The{0}Path", Path.DirectorySeparatorChar);
CompilerServerApiTest.cs (1)
145var vbcsFilePath = Path.Combine(toolDir, "VBCSCompiler.dll");
CompilerServerTests.cs (21)
101var filePath = Path.Combine(currentDirectory.Path, "netstandard.dll"); 200clientDir: Path.GetDirectoryName(typeof(CommonCompiler).Assembly.Location), 203tempDir: Path.GetTempPath()); 257return new DisposableFile(Path.Combine(directory.Path, resultFileName)); 264var result = ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path)); 450var basePath = Path.GetDirectoryName(typeof(CompilerServerUnitTests).Assembly.Location); 451var compilerServerExecutable = Path.Combine(basePath, "VBCSCompiler.exe"); 559Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe"))); 589Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe"))); 606Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "missingfile.exe"))); 624Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe"))); 649Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "app.exe"))); 667Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "missingfile.exe"))); 696Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hellovb.exe"))); 725Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "app.exe"))); 1063$"src1.cs /shared:{serverData.PipeName} /nologo /t:library /out:" + Path.Combine(libDirectory.Path, "lib.dll"), 1114$"src1.vb /shared:{serverData.PipeName} /vbruntime* /nologo /t:library /out:" + Path.Combine(libDirectory.Path, "lib.dll"), 1397var tmp = Path.Combine(_tempDirectory.Path, "Temp"); 1431var tmp = Path.Combine(_tempDirectory.Path, "Temp"); 1460var basePath = Path.GetDirectoryName(typeof(CompilerServerUnitTests).Assembly.Location); 1461var compilerServerExecutable = Path.Combine(basePath, "VBCSCompiler.exe");
ServerUtil.cs (3)
45tempDirectory ?? Path.GetTempPath(), 52tempDirectory ?? Path.GetTempPath(), 159internal static string DefaultClientDirectory { get; } = Path.GetDirectoryName(typeof(BuildClientTests).Assembly.Location);
TouchedFileLoggingTests.cs (6)
60var touchedBase = Path.Combine(touchedDir.Path, "touched"); 69new BuildPaths(clientDirectory, _baseDirectory, RuntimeEnvironment.GetRuntimeDirectory(), Path.GetTempPath()), 77Path.ChangeExtension(source1, "exe"), 111var touchedBase = Path.Combine(touchedDir.Path, "touched"); 120new BuildPaths(clientDirectory, _baseDirectory, RuntimeEnvironment.GetRuntimeDirectory(), Path.GetTempPath()), 128Path.ChangeExtension(source1, "exe"),
VBCSCompilerServerTests.cs (2)
40var baseDirectory = Path.Combine(Path.GetTempPath(), TestBase.GetUniqueName());
Wasm.Performance.ConsoleHost (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
WindowsBase.Tests (2)
Helpers.cs (2)
14public static string GetResourcePath(string name) => Path.GetFullPath(Path.Combine("Resources", name));
WinFormsControlsTest (11)
DragDrop.cs (9)
134e.Message = $"{Path.GetFileNameWithoutExtension(files[0])}%1"; 135e.MessageReplacementToken = Path.GetExtension(files[0]); 260e.Message = $"{Path.GetFileNameWithoutExtension(files[0])}%1"; 261e.MessageReplacementToken = Path.GetExtension(files[0]); 302e.Message = $"{Path.GetFileNameWithoutExtension(files[0])}%1"; 303e.MessageReplacementToken = Path.GetExtension(files[0]); 385string dragDropDataDirectory = Path.Join( 403string nyanCatAsciiPath = Path.Join( 540Path.Join(Directory.GetCurrentDirectory(),
ListViewTest.cs (1)
254Text = Path.GetFileName(file),
MediaPlayer.cs (1)
12axWindowsMediaPlayer1.URL = Path.GetFullPath(@".\resources\media.mpg");
xunit.console (39)
CommandLine.cs (2)
83return Path.GetFullPath(fileName); 511var directory = Path.GetDirectoryName(path);
common\AssemblyResolution\AssemblyHelper.cs (1)
54var assemblyFolder = Path.GetDirectoryName(assemblyFileName);
common\AssemblyResolution\DependencyContextAssemblyCache.cs (8)
72.Select(path => Tuple.Create(Path.GetFileNameWithoutExtension(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 86.Select(path => Tuple.Create(Path.GetFileName(path), Tuple.Create(tuple.Item1, tuple.Item2)))) 211var assemblyPath = Path.Combine(Path.GetFullPath(assemblyFolder), assemblyName); 238var resolvedAssemblyPath = assemblies.FirstOrDefault(a => string.Equals(assemblyName, Path.GetFileNameWithoutExtension(a), StringComparison.OrdinalIgnoreCase)); 241resolvedAssemblyPath = Path.GetFullPath(resolvedAssemblyPath); 281var resolvedAssemblyPath = assemblies.FirstOrDefault(a => string.Equals(formattedUnmanagedDllName, Path.GetFileName(a), StringComparison.OrdinalIgnoreCase)); 283return Path.GetFullPath(resolvedAssemblyPath);
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\ApplicationEnvironment.cs (1)
16return Path.GetFullPath(basePath);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (2)
402groupRuntimeAssemblies.Where(a => Path.GetFileName(a) != "_._"))); 414groupNativeLibraries.Where(a => Path.GetFileName(a) != "_._")));
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
116var depsJsonFile = Path.ChangeExtension(assembly.Location, DepsJsonExtension);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\AppBaseCompilationAssemblyResolver.cs (4)
50var refsPath = Path.Combine(_basePath, RefsDirectoryName); 73var sharedDirectory = Path.GetDirectoryName(sharedPath); 74var sharedRefs = Path.Combine(sharedDirectory, RefsDirectoryName); 87var assemblyFile = Path.GetFileName(assembly);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\PackageCompilationAssemblyResolver.cs (2)
49return listOfDirectories.Split(new char [] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries ); 74return new string[] { Path.Combine(basePath, ".nuget", "packages") };
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\ReferenceAssemblyPathResolver.cs (5)
65var relativeToReferenceAssemblies = Path.Combine(_defaultReferenceAssembliesPath, path); 73var name = Path.GetFileName(path); 76var fallbackFile = Path.Combine(fallbackPath, name); 94var net20Dir = Path.Combine(environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v2.0.50727"); 135return Path.Combine(
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\ResolverUtils.cs (4)
15path = Path.Combine(library.Name.ToLowerInvariant(), library.Version.ToLowerInvariant()); 18packagePath = Path.Combine(basePath, path); 29fullName = Path.GetFullPath(Path.Combine(basePath, assemblyPath));
common\AssemblyResolution\XunitPackageCompilationAssemblyResolver.cs (2)
36results = probeDirectories.Split(new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries).ToList(); 54results.Add(Path.Combine(basePath, ".nuget", "packages"));
ConsoleRunner.cs (7)
61if (!defaultDirectory.EndsWith(new string(new[] { Path.DirectorySeparatorChar }), StringComparison.Ordinal)) 62defaultDirectory += Path.DirectorySeparatorChar; 131var runnerPath = Path.GetDirectoryName(typeof(Program).GetTypeInfo().Assembly.Location); 138foreach (var dllFile in Directory.GetFiles(runnerPath, "*.dll").Select(f => Path.Combine(runnerPath, f))) 144var assembly = Assembly.Load(new AssemblyName(Path.GetFileNameWithoutExtension(dllFile))); 359var assemblyDisplayName = Path.GetFileNameWithoutExtension(assembly.AssemblyFilename); 384completionMessages.TryAdd(Path.GetFileName(assembly.AssemblyFilename), new ExecutionSummary());
Yarp.AppHost (1)
Program.cs (1)
21.WithStaticFiles(Path.Combine("..", "static-content"))