24570 references to Path
AnalyzeCiFailure (92)
AnalysisCommands.cs (12)
197return baseDirectory is null ? Path.GetFullPath(path) : Path.GetFullPath(path, baseDirectory); 217var relative = Path.GetRelativePath(ResolvePhysicalPath(input), destination); 218if (!Path.IsPathRooted(relative) && relative != ".." && !relative.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 233var full = Path.GetFullPath(currentPath); 234var root = Path.GetPathRoot(full)!; 236foreach (var part in Path.GetRelativePath(root, full).Split(Path.DirectorySeparatorChar)) 238resolved = Path.Combine(resolved, part); 256return Path.GetFullPath(resolved); 318Path.GetFullPath(result.GetValue(analysisDirectory)!, directory),
AnalysisDiagnostics.cs (2)
44_progressFile = Path.Combine(directory, "progress.log"); 211await File.WriteAllTextAsync(Path.Combine(directory, "summary.json"), text);
AnalysisInvocation.cs (5)
17internal string DiagnosticsDirectory => Path.Combine(RootDirectory, "diagnostics"); 21Scratch = new AnalysisScratchWorkspace(Path.Combine(RootDirectory, "scratch")); 22Evidence = new EvidencePaths(Path.Combine(RootDirectory, "evidence")); 23Replay = new EvidencePaths(Path.Combine(RootDirectory, "replay")); 27internal string RecoveryDirectory(string stage) => Path.Combine(RootDirectory, "recovery", stage);
AnalysisPublisher.cs (3)
264var bodyPath = Path.Combine(_requestDirectory, $"{cause.Id}.issue-body.md"); 521var file = Path.Combine(_requestDirectory, "analysis-comment.md"); 522var request = Path.Combine(_requestDirectory, "analysis-comment-request.json");
AnalysisRerunner.cs (1)
25var outputPath = Path.GetFullPath(RequiredEnvironment("GH_AW_AGENT_OUTPUT", "for rerun authorization"), directory);
AnalysisScratch.cs (4)
22internal string HistoryCheckout => Path.Combine(RootDirectory, "history-checkout"); 23internal string Archives => Path.Combine(RootDirectory, "archives"); 24internal string Results => Path.Combine(RootDirectory, "extracted-results"); 25internal string Requests => Path.Combine(RootDirectory, "requests");
CauseHistoryStore.cs (7)
71internal string CausePath(string fileName) => Path.Combine(directory, "causes", fileName); 73internal string RunPath(string runId) => Path.Combine(directory, "runs", runId + ".json"); 76=> Directory.Exists(Path.Combine(directory, "causes")) 77? Directory.EnumerateFiles(Path.Combine(directory, "causes"), "*.json") : []; 81Directory.CreateDirectory(Path.Combine(directory, "runs")); 82Directory.CreateDirectory(Path.Combine(directory, "causes")); 88var files = paths.Select(p => Path.GetRelativePath(directory, p)).ToArray();
EvidencePackageStore.cs (7)
15TransientJson.ReadUtf8<AnalysisProposal>(File.ReadAllBytes(Path.Combine(analysisDirectory, "proposal.json"))), 22Directory.CreateDirectory(Path.GetDirectoryName(paths.PriorCauseIndex)!); 26var path = Path.Combine(paths.RootDirectory, name); 27Directory.CreateDirectory(Path.GetDirectoryName(path)!); 32var path = Path.Combine(paths.RootDirectory, name); 33Directory.CreateDirectory(Path.GetDirectoryName(path)!); 49if (Directory.Exists(Path.GetDirectoryName(path)))
EvidencePreparation.cs (5)
177.Concat(Directory.Exists(Path.Combine(paths.RootDirectory, "diagnostics")) 178? Directory.GetFiles(Path.Combine(paths.RootDirectory, "diagnostics")) : []); 181var name = Path.GetRelativePath(paths.RootDirectory, path).Replace(Path.DirectorySeparatorChar, '/'); 322await File.WriteAllTextAsync(Path.Combine(invocation.Evidence.RootDirectory, "limited-analysis.md"), report, ct);
Models\EvidencePaths.cs (21)
13public string Bundle { get; } = Path.Combine(rootDirectory, "evidence.json"); 14public string Outcome { get; } = Path.Combine(rootDirectory, "collection-outcome.json"); 15public string Run { get; } = Path.Combine(rootDirectory, "diagnostics", "run.json"); 16public string AllJobs { get; } = Path.Combine(rootDirectory, "diagnostics", "all-jobs.json"); 17public string FailedJobs { get; } = Path.Combine(rootDirectory, "diagnostics", "failed-jobs.json"); 18public string RetryPatterns { get; } = Path.Combine(rootDirectory, "diagnostics", "retry-patterns.json"); 19public string TriggeringMerge { get; } = Path.Combine(rootDirectory, "diagnostics", "triggering-merge-pr.json"); 20public string LastSuccessfulMainRun { get; } = Path.Combine(rootDirectory, "diagnostics", "last-successful-main-run.json"); 21public string CandidateMerges { get; } = Path.Combine(rootDirectory, "diagnostics", "candidate-merges.json"); 22public string CandidateHistoryStatus { get; } = Path.Combine(rootDirectory, "diagnostics", "candidate-merge-history-status.json"); 23public string PullRequestFiles { get; } = Path.Combine(rootDirectory, "diagnostics", "pr-files.json"); 24public string PullRequestMetadata { get; } = Path.Combine(rootDirectory, "diagnostics", "pr-metadata.json"); 25public string Artifacts { get; } = Path.Combine(rootDirectory, "diagnostics", "artifacts.json"); 26public string SelectedTestArtifacts { get; } = Path.Combine(rootDirectory, "diagnostics", "selected-test-result-artifacts.json"); 27public string PriorCauseIndex { get; } = Path.Combine(rootDirectory, "history", "cause-index.json"); 28public string Summary { get; } = Path.Combine(rootDirectory, "analysis-summary.md"); 29public string PriorCausesDirectory { get; } = Path.Combine(rootDirectory, "history", "causes"); 30public string Manifest { get; } = Path.Combine(rootDirectory, "manifest.json"); 32public string JobLog(string jobId) => Path.Combine(RootDirectory, "diagnostics", $"job-{jobId}.log"); 33public string JobAnnotations(string jobId) => Path.Combine(RootDirectory, "diagnostics", $"annotations-{jobId}.json"); 34public string PriorCause(string fileName) => Path.Combine(PriorCausesDirectory, fileName); internal static bool IsDiagnosisContextJson(string name)
PriorCauseCatalogue.cs (1)
32id + ".json" != Path.GetFileName(pair.Key))
RecoveryCaptureWriter.cs (7)
26await File.WriteAllTextAsync(Path.Combine(directory, "collection-outcome.json"), TransientJson.Write(progress.CreateOutcome(status))); 82var name = "extracted-results/" + Path.GetRelativePath(scratch.Results, file).Replace(Path.DirectorySeparatorChar, '/'); 103var name = "requests/" + Path.GetFileName(file); 117Path.Combine(directory, "manifest.json"), 154var path = Path.Combine(directory, name); 155Directory.CreateDirectory(Path.GetDirectoryName(path)!);
TestFailureReader.cs (4)
65var directory = Path.Combine(resultsDirectory, artifactId.ToString(System.Globalization.CultureInfo.InvariantCulture)); 124$"job={job.Id} artifact={artifactId} result={relativeDirectory}/{Path.GetFileName(file)}\n" + 151ResultFile = Path.GetFileName(file), 160$"Cannot parse test result '{CiFailureJson.Display(relativeDirectory + "/" + Path.GetFileName(file))}' from artifact {artifactId}: " +
TestResultArchiveExtractor.cs (5)
68var parent = Path.GetDirectoryName(Path.GetFullPath(outputDirectory))!; 70var staging = Path.Combine(parent, "." + Path.GetFileName(outputDirectory) + "-" + Guid.NewGuid().ToString("N")); 110var destination = Path.Combine(staging, $"{++index:D5}.{(format == "trx" ? "trx" : "json")}");
tools\Aspire.TestTools\ProcessRunner.cs (4)
18if (!Path.IsPathRooted(executable) && environment is not null && environment.TryGetValue("PATH", out var searchPath)) 23var searchName = OperatingSystem.IsWindows() && !Path.HasExtension(executable) ? executable + ".exe" : executable; 24fileName = searchPath.Split(Path.PathSeparator).Select(path => Path.Combine(path, searchName))
WorkflowRunEvidenceCollector.cs (4)
199var retryPatternsPath = Path.Combine(_workingDirectory, "eng", "test-retry-patterns.json"); 331_attachments["history/causes/" + Path.GetFileName(causePath)] = 718var zipPath = Path.Combine(zipDirectory, artifactId + ".zip"); 746Path.Combine(_scratch.Results, artifactId),
AnalyzeCiFailure.TestHost (8)
tests\AnalyzeCiFailure.Tests\TestServices\GitHubFixtureHandler.cs (8)
26Path.Combine(workingDirectory, "http-calls.log"), 42Path.Combine(workingDirectory, "http-requests.jsonl"), 60if (File.Exists(Path.Combine(workingDirectory, "existing-main-label"))) 228var paths = (environment?.GetValueOrDefault("PATH") ?? Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator); 233var candidate = Path.Combine(workingDirectory, Path.GetFileName(directory), "gh"); 247var directory = Directory.CreateDirectory(Path.Combine(workingDirectory, "http-fixture-requests")); 248var file = Path.Combine(directory.FullName, $"{++_sequence}.request");
AnalyzeCiFailure.Tests (1040)
AnalyzeCiFailureAlternateWorkflowTests.cs (21)
298Assert.Single(await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"))); 311await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 336var responses = Directory.CreateDirectory(Path.Combine(_workspace.Path, "responses")).FullName; 337var zip = Path.Combine(responses, "alternate.zip"); 365Path.Combine(responses, "run.json"), 375Path.Combine(responses, "jobs.json"), 384Path.Combine(responses, "artifacts.json"), 407var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "artifacts.json")))!; 411var secondZip = Path.Combine(responses, "secondary.zip"); 438var finalZip = Path.Combine(responses, "final.zip"); 450await File.WriteAllTextAsync(Path.Combine(responses, "artifacts.json"), pages.ToJsonString()); 454var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "artifacts.json")))!; 456await File.WriteAllTextAsync(Path.Combine(responses, "artifacts.json"), pages.ToJsonString()); 465var jobs = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "jobs.json")))!; 473await File.WriteAllTextAsync(Path.Combine(responses, "jobs.json"), jobs.ToJsonString()); 476var secondaryZip = Path.Combine(responses, "secondary.zip"); 481var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "artifacts.json")))!; 490await File.WriteAllTextAsync(Path.Combine(responses, "artifacts.json"), pages.ToJsonString()); 517_alternateEnvironment["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"; 520Assert.Equal(0, (await RunProcessAsync("git", ["--no-pager", "remote", "add", "origin", Path.Combine(_workspace.Path, "remote.git")])).ExitCode);
AnalyzeCiFailureArtifactSelectionTests.cs (2)
195var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 196var jobsPath = Path.Combine(_workspace.Path, "jobs.json");
AnalyzeCiFailureBestEffortTests.cs (8)
48var root = Path.Combine(_workspace.Path, "partial-results"); 49var directory = Directory.CreateDirectory(Path.Combine(root, "10")).FullName; 50await File.WriteAllTextAsync(Path.Combine(directory, "00001.trx"), FrameworkResult("Tests.First", "first", "first")); 51await File.WriteAllTextAsync(Path.Combine(directory, "00002.trx"), "malformed"); 52await File.WriteAllTextAsync(Path.Combine(directory, "00003.trx"), FrameworkResult("Tests.Last", "last", "last")); 77var archivePath = Path.Combine(_workspace.Path, "failed-expansion.zip"); 87Path.Combine(_workspace.Path, "first"), 95Path.Combine(_workspace.Path, "second"),
AnalyzeCiFailureBootstrapTests.cs (26)
16var seed = Directory.CreateDirectory(Path.Combine(_workspace.Path, "seed")).FullName; 17var analyzerDirectory = Path.Combine(RepoRoot.Path, "tools", "AnalyzeCiFailure"); 19.Concat(Directory.GetFiles(Path.Combine(RepoRoot.Path, "tools", "Aspire.TestTools"), "*.cs") 20.Select(file => Path.GetRelativePath(RepoRoot.Path, file))) 22.Where(file => Path.GetRelativePath(analyzerDirectory, file).Split(Path.DirectorySeparatorChar)[0] is not ("bin" or "obj")) 23.Select(file => Path.GetRelativePath(RepoRoot.Path, file)))) 25var target = Path.Combine(seed, relative); 26Directory.CreateDirectory(Path.GetDirectoryName(target)!); 27File.Copy(Path.Combine(RepoRoot.Path, relative), target); 41var hostile = Directory.CreateDirectory(Path.Combine(_workspace.Path, "hostile")).FullName; 43Path.Combine(hostile, "Directory.Build.props"), 46Path.Combine(hostile, "Directory.Build.targets"), 49Path.Combine(hostile, "Directory.Packages.props"), 51var checkout = Path.Combine(hostile, "checkout"); 64var project = Path.Combine(checkout, "tools", "AnalyzeCiFailure", "AnalyzeCiFailure.csproj"); 72[Path.Combine(checkout, "tools", "AnalyzeCiFailure", "bin", "Release", "net11.0", "AnalyzeCiFailure.dll")], 80await File.WriteAllTextAsync(Path.Combine(results, "00001.trx"), "<TestRun><Results/></TestRun>"); 86var target = Path.Combine(checkout, "ci-failure-analysis/evidence", Path.GetRelativePath(evidenceDirectory, source)); 87Directory.CreateDirectory(Path.GetDirectoryName(target)!); 91Path.Combine(checkout, "ci-failure-analysis/evidence", "analysis-summary.md"), 95[Path.Combine(checkout, "tools", "AnalyzeCiFailure", "bin", "Release", "net11.0", "AnalyzeCiFailure.dll"), 96"replay", "--evidence-dir", Path.Combine(checkout, "ci-failure-analysis/evidence"), "--working-dir", checkout], 102await File.ReadAllTextAsync(Path.Combine(replayDirectory, "analysis-summary.md")), 106await File.ReadAllTextAsync(Path.Combine(checkout, "ci-failure-analysis/evidence", "analysis-summary.md")));
AnalyzeCiFailureBranchHistoryTests.cs (3)
34["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 46Path.Combine(_workspace.Path, "history-branch-calls.log"))),
AnalyzeCiFailureCohesionTests.cs (5)
20var output = Path.Combine(_workspace.Path, "workflow-output"); 39Assert.True(File.Exists(Path.Combine(invocation.RecoveryDirectory("collection"), "manifest.json"))); 46var input = new EvidencePaths(Path.Combine(_workspace.Path, "input")); 135var summary = Path.Combine(_workspace.Path, "summary.md"); 162Assert.Equal(bytes, await File.ReadAllBytesAsync(Path.Combine(EvidenceDirectory, "limited-analysis.md")));
AnalyzeCiFailureCollectionTests.cs (95)
24var evidence = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "evidence.json")))!; 28Assert.Contains("analysis_ready=false", await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output"))); 42Assert.Contains("analysis_ready=false", await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output"))); 43var evidence = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "evidence.json")))!; 55var outputs = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output")); 57var json = await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "evidence.json")); 78Path.Combine(EvidenceDirectory, "collection-outcome.json")))!; 80Assert.False(File.Exists(Path.Combine(EvidenceDirectory, "evidence.json"))); 115Path.Combine(EvidenceDirectory, "collection-outcome.json")))!; 119var pathOutputs = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "invocation-paths")); 137var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 148await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "require-final-outputs"), ""); 153var outputs = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output")); 171var outputs = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output")); 178await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"))); 183Path.Combine(EvidenceDirectory, "evidence.json")))!; 198Path.Combine(directory, "collection-outcome.json"), 200await File.WriteAllTextAsync(Path.Combine(directory, "analysis-summary.md"), "Previous run"); 201await File.WriteAllTextAsync(Path.Combine(directory, "evidence.json"), """{"test_evidence":{"state":"unavailable"}}"""); 208Path.Combine(EvidenceDirectory, "collection-outcome.json")))!; 210var pathOutputs = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output")); 228Path.Combine(_workspace.Path, "workflow-output"), 232await Verifier.Verify(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "workflow-output")), "txt") 250Assert.False(File.Exists(Path.Combine(_workspace.Path, "gh-calls.log"))); 264Assert.True(File.Exists(Path.Combine(EvidenceDirectory, "evidence.json"))); 265Assert.False(File.Exists(Path.Combine(_workspace.Path, "workflow-output"))); 272var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "output-is-directory")).FullName; 283Assert.False(File.Exists(Path.Combine(_workspace.Path, "gh-calls.log"))); 296["GITHUB_OUTPUT"] = Path.Combine(_workspace.Path, "missing-parent", "workflow-output"), 302Assert.False(File.Exists(Path.Combine(_workspace.Path, "gh-calls.log"))); 311await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "fail-outcome-write"), ""); 335var paths = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output")); 359var job = Assert.Single(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/failed-jobs.json")))!.AsArray())!; 369Assert.True(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 370var state = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!; 373Assert.True(File.Exists(Path.Combine(data, "analysis-summary.md"))); 374var annotations = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/annotations-77.json")))!.AsArray(); 379Assert.Contains("Failed to fetch complete logs for job 77", await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/job-77.log")), StringComparison.Ordinal); 396Assert.False(File.Exists(Path.Combine(EvidenceDirectory, "evidence.json"))); 397Assert.False(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 406var jobs = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics/failed-jobs.json")))!.AsArray(); 409Assert.True(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 420var job = Assert.Single(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/failed-jobs.json")))!.AsArray())!; 423Assert.True(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 424Assert.Equal("not-applicable", JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!["state"]!.GetValue<string>()); 425Assert.Empty(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!["failures"]!.AsArray()); 436var job = Assert.Single(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/failed-jobs.json")))!.AsArray())!; 439Assert.True(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 440Assert.Equal("not-applicable", JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!["state"]!.GetValue<string>()); 441Assert.Empty(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!["failures"]!.AsArray()); 452var bundle = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!; 462var jobs = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/failed-jobs.json")))!.AsArray(); 464var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 469Assert.True(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 470Assert.Contains("Error: token=[REDACTED]", await File.ReadAllTextAsync(Path.Combine(data, "diagnostics/job-77.log")), StringComparison.Ordinal); 486Assert.True(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json")))!["has_work"]!.GetValue<bool>()); 510var state = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!; 513Assert.True(File.Exists(Path.Combine(data, "analysis-summary.md"))); 526var state = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!["test_evidence"]!; 548Assert.False(File.Exists(Path.Combine(_workspace.Path, "gh-calls.log"))); 560await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"))); 573var bundle = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json")))!; 585var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 597var log = await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics/job-77.log")); 614var bundle = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "evidence.json")))!; 618var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 631var index = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "history/cause-index.json")))!.AsArray(); 635await File.ReadAllTextAsync(Path.Combine(data, "history/causes", "keyless-infra.json"))); 638await File.ReadAllTextAsync(Path.Combine(data, "history/causes", "opaque-test.json"))); 648var responses = Directory.CreateDirectory(Path.Combine(_workspace.Path, "responses")).FullName; 673await File.WriteAllTextAsync(Path.Combine(responses, "run.json"), run.ToJsonString()); 675Path.Combine(responses, "jobs.json"), 682var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "jobs.json")))!; 698await File.WriteAllTextAsync(Path.Combine(responses, "jobs.json"), pages.ToJsonString()); 702var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "jobs.json")))!; 740await File.WriteAllTextAsync(Path.Combine(responses, "jobs.json"), pages.ToJsonString()); 744var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "jobs.json")))!.AsArray(); 753await File.WriteAllTextAsync(Path.Combine(responses, "jobs.json"), pages.ToJsonString()); 757await File.WriteAllTextAsync(Path.Combine(responses, "jobs.json"), """[{"jobs":[null,5]}]"""); 759var zip = Path.Combine(responses, "results.zip"); 828var otherZip = Path.Combine(responses, "other.zip"); 839var pages = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(responses, "jobs.json")))!; 852await File.WriteAllTextAsync(Path.Combine(responses, "jobs.json"), pages.ToJsonString()); 855Path.Combine(responses, "artifacts.json"), 936Path.Combine(_workspace.Path, scenario == "history-transport" ? "missing.git" : "remote.git")])).ExitCode); 940var causes = Directory.CreateDirectory(Path.Combine(_workspace.Path, "history-seed", "causes")).FullName; 942Path.Combine(causes, "keyless-infra.json"), 945Path.Combine(causes, "opaque-test.json"), 950await File.WriteAllBytesAsync(Path.Combine(causes, name), HistoricalAttachmentBytes(scenario == "stored-history-utf16")); 984["GITHUB_OUTPUT"] = Path.Combine(_workspace.Path, "workflow-output"), 985["INVOCATION_PATHS"] = useWorkflowAdapter ? Path.Combine(_workspace.Path, "workflow-output") : Path.Combine(_workspace.Path, "invocation-paths"), 986["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 996"exec", "--runtimeconfig", Path.ChangeExtension(typeof(AnalyzeCiFailureWorkflowTests).Assembly.Location, ".runtimeconfig.json"),
AnalyzeCiFailureCSharpRerunTests.cs (9)
87var analysis = Directory.CreateDirectory(Path.Combine(_workspace.Path, "proposal")).FullName; 88await File.WriteAllTextAsync(Path.Combine(data, "evidence.json"), TransientJson.Write(evidence)); 89await File.WriteAllTextAsync(Path.Combine(analysis, "proposal.json"), TransientJson.Write(proposal)); 92Path.Combine(analysis, "accepted.json"), 100var output = Path.Combine(_workspace.Path, "agent-output.json"); 144["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 159var calls = File.Exists(Path.Combine(_workspace.Path, "rerun-calls.log")) 160? await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "rerun-calls.log")) : [];
AnalyzeCiFailureDiagnosticsTests.cs (26)
13private string DiagnosticSummary => Path.Combine(_invocationDirectory!, "diagnostics", "summary.json"); 22var outcome = TransientJson.Read<AnalysisOutcome>(File.ReadAllText(Path.Combine(EvidenceDirectory, "collection-outcome.json"))); 34Assert.True(File.Exists(Path.Combine(RecoveryDirectory("collection"), "manifest.json"))); 35Assert.Contains("response body could not be read completely", File.ReadAllText(Path.Combine(EvidenceDirectory, "diagnostics", "job-77.log")), StringComparison.Ordinal); 51Assert.False(File.Exists(Path.Combine(EvidenceDirectory, "evidence.json"))); 53"diagnostics_dir=" + Path.GetDirectoryName(DiagnosticSummary), 54File.ReadAllLines(Path.Combine(_workspace.Path, "workflow-output"))); 75File.Delete(Path.Combine(_workspace.Path, "first-issue-published")); 79"--analysis-dir", Path.Combine(_workspace.Path, "ci-analysis-output")], 80new Dictionary<string, string> { ["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}" }); 94var recovery = JsonNode.Parse(File.ReadAllText(Path.Combine(RecoveryDirectory("publication"), "manifest.json")))!; 100Assert.False(Directory.Exists(Path.Combine(_invocationDirectory!, "scratch"))); 108Directory.CreateDirectory(Path.Combine(invocation.RootDirectory, "recovery")); 123var summary = JsonNode.Parse(File.ReadAllText(Path.Combine(invocation.RootDirectory, "diagnostics", "summary.json")))!; 131var input = Directory.CreateDirectory(Path.Combine(_workspace.Path, "invalid-replay")).FullName; 132await File.WriteAllTextAsync(Path.Combine(input, "evidence.json"), "{}"); 136Assert.Equal("{}", File.ReadAllText(Path.Combine(input, "evidence.json"))); 137var manifest = JsonNode.Parse(File.ReadAllText(Path.Combine(RecoveryDirectory("replay"), "manifest.json")))!; 145Directory.CreateDirectory(Path.Combine(_workspace.Path, "eng")); 146await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "eng", "test-retry-patterns.json"), "not JSON"); 194var text = File.ReadAllText(Path.Combine(invocation.DiagnosticsDirectory, "summary.json")); 217var text = File.ReadAllText(Path.Combine(invocation.DiagnosticsDirectory, "summary.json")); 231await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "comment-response"), response); 252var output = Directory.CreateDirectory(Path.Combine(_workspace.Path, "not-an-output-file")).FullName; 261var summary = JsonNode.Parse(File.ReadAllText(Path.Combine(invocation.DiagnosticsDirectory, "summary.json")))!;
AnalyzeCiFailureEvidenceTests.cs (25)
53var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 54var file = Path.Combine(directory, "analysis-result.json"); 122var file = Path.Combine(_workspace.Path, "typed-test-failures.json"); 144var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 145var proposalPath = Path.Combine(directory, "proposal.json"); 150var output = Path.Combine(_workspace.Path, "accepted.json"); 226await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics/pr-metadata.json"), "not JSON"); 239await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics/pr-metadata.json"), "not JSON"); 241Path.Combine(_workspace.Path, "issue-details.json"), 255Assert.False(File.Exists(Path.Combine(_workspace.Path, "memory-repo", "runs", "123.json"))); 268var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output"); 269var summaryPath = Path.Combine(analysisDirectory, "analysis-result.json"); 279File.Delete(Path.Combine(analysisDirectory, "causes", "debugger-timeout.json")); 283await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, name), "not JSON"); 291await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "pr-comment.md")), 293Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "memory-repo", "runs"))); 306await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "invalidate-evidence-on-lookup"), ""); 319["issue"] = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")), 320["comment"] = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "pr-comment.md")), 346var output = Path.Combine(_workspace.Path, "summary.json"); 373var capture = Path.Combine(EvidenceDirectory, "diagnostics/run.json"); 375var output = Path.Combine(_workspace.Path, "summary.json"); 387var file = Path.Combine(_workspace.Path, "jobs.json"); 410var output = Path.Combine(_workspace.Path, "summary.json"); 432var output = Path.Combine(_workspace.Path, "summary.json");
AnalyzeCiFailureFixtures.cs (12)
79var root = Path.Combine(workingDirectory, "ci-failure-analysis/evidence"); 80var output = Path.Combine(workingDirectory, "ci-analysis-output"); 83var path = Path.Combine( 91var report = CiFailureJson.Read(Path.Combine(output, "analysis-result.json"))!; 121var prior = Directory.Exists(Path.Combine(root, "history/causes")) 122? Directory.GetFiles(Path.Combine(root, "history/causes"), "*.json").ToImmutableDictionary( 123path => "history/causes/" + Path.GetFileName(path), 183var causesDirectory = Path.Combine(output, "causes"); 198File.Exists(Path.Combine(workingDirectory, "memory-repo", "causes", Path.GetFileName(path)))) 243File.WriteAllText(Path.Combine(workingDirectory, "ci-failure-analysis/evidence", "evidence.json"), TransientJson.Write(evidence)); 244File.WriteAllText(Path.Combine(workingDirectory, "ci-analysis-output", "proposal.json"), TransientJson.Write(proposal));
AnalyzeCiFailureGitTests.cs (22)
17var bin = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-git")).FullName; 18var started = Path.Combine(_workspace.Path, "head-started"); 19var released = Path.Combine(_workspace.Path, "head-released"); 21Path.Combine(bin, "git"), 40["PATH"] = $"{bin}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 44var commit = store.CommitAndPushAsync("123", [Path.Combine(_workspace.Path, "causes/test.json")]); 64await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "git-operations"))); 72var directory = Path.Combine(_workspace.Path, "memory checkout"); 77Assert.Equal("second", await File.ReadAllTextAsync(Path.Combine(directory, "stored-history.json"))); 87var directory = Path.Combine(_workspace.Path, "memory checkout"); 101Assert.Equal("second", await File.ReadAllTextAsync(Path.Combine(directory, "stored-history.json"))); 126var directory = Path.Combine(_workspace.Path, "memory checkout"); 151await File.WriteAllTextAsync(Path.Combine(directory, "--cause.json"), "history"); 152await File.WriteAllTextAsync(Path.Combine(directory, "operator-notes.txt"), "unstaged notes"); 170Assert.Equal("unstaged notes", await File.ReadAllTextAsync(Path.Combine(directory, "operator-notes.txt"))); 179var fakeBin = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName; 181Path.Combine(fakeBin, "git"), 203["PATH"] = $"{fakeBin}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 206var directory = Path.Combine(_workspace.Path, "history-checkout"); 207var notes = Path.Combine(_workspace.Path, "operator-notes.txt"); 220var remoteDirectory = Path.Combine(_workspace.Path, "remote repository.git"); 237await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "stored-history.json"), contents);
AnalyzeCiFailureIdentifierPrecisionTests.cs (1)
29var outputPath = Path.Combine(_workspace.Path, "last-success.json");
AnalyzeCiFailureInvocationTests.cs (34)
19var evidence = Directory.CreateDirectory(Path.Combine(_workspace.Path, "saved-evidence")).FullName; 20var proposal = Directory.CreateDirectory(Path.Combine(_workspace.Path, "saved-proposal")).FullName; 21var alias = Path.Combine(_workspace.Path, "evidence-alias"); 24var checkout = Path.Combine(historyThroughLink ? alias : evidence, "history-checkout"); 49var outputs = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "workflow-output")); 55Assert.True(File.Exists(Path.Combine(evidence, "collection-outcome.json"))); 56Assert.True(File.Exists(Path.Combine(diagnostics, "summary.json"))); 57Assert.False(Directory.Exists(Path.Combine(workspace, "scratch"))); 58Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "ci-failure-data"))); 61Assert.True(File.Exists(Path.Combine(evidence, "evidence.json"))); 62Assert.True(File.Exists(Path.Combine(evidence, "analysis-summary.md"))); 63Assert.True(File.Exists(Path.Combine(evidence, "diagnostics", "job-77.log"))); 65Assert.Equal(recoveryExpected, File.Exists(Path.Combine(recovery, "manifest.json"))); 68Assert.True(File.Exists(Path.Combine(recovery, "diagnostics", "job-77.log"))); 79var json = await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics", "run.json")); 108["exec", "--runtimeconfig", Path.ChangeExtension(typeof(AnalyzeCiFailureWorkflowTests).Assembly.Location, ".runtimeconfig.json"), 151var firstOutcome = Path.Combine(firstRoot, "evidence", "collection-outcome.json"); 153await File.WriteAllTextAsync(Path.Combine(firstRoot, "operator-note.txt"), "keep"); 161Assert.Equal("keep", await File.ReadAllTextAsync(Path.Combine(firstRoot, "operator-note.txt"))); 162Assert.True(File.Exists(Path.Combine(secondRoot, "recovery", "collection", "manifest.json"))); 163Assert.False(Directory.Exists(Path.Combine(firstRoot, "scratch"))); 164Assert.False(Directory.Exists(Path.Combine(secondRoot, "scratch"))); 173var saved = Directory.CreateDirectory(Path.Combine(_workspace.Path, "earlier-replay")).FullName; 175await File.WriteAllTextAsync(Path.Combine(saved, "evidence.json"), original); 176var linkedInput = Path.Combine(_workspace.Path, "linked-evidence"); 183Assert.Equal(original, await File.ReadAllTextAsync(Path.Combine(saved, "evidence.json"))); 184Assert.Equal(!invalid, File.Exists(Path.Combine(output, "analysis-summary.md"))); 195await File.WriteAllTextAsync(Path.Combine(invocation.Scratch.Requests, "request.json"), "discard"); 208var output = Path.Combine(_workspace.Path, "workflow-output"); 211await File.WriteAllTextAsync(Path.Combine(invocation.Scratch.Results, "failed.trx"), "current report"); 222var report = Path.Combine(invocation.RecoveryDirectory("collection"), "extracted-results", "failed.trx"); 234var evidence = Directory.CreateDirectory(Path.Combine(_workspace.Path, "input-evidence")).FullName; 235var proposal = Directory.CreateDirectory(Path.Combine(_workspace.Path, "input-proposal")).FullName; 239"--history-dir", Path.Combine(input == "evidence" ? evidence : proposal, "history-checkout")]);
AnalyzeCiFailureMigrationTests.cs (62)
74var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json"))); 78Assert.False(File.Exists(Path.Combine(root, "evidence.json"))); 88var path = Path.Combine(_workspace.Path, "ci-analysis-output", "proposal.json"); 95"--analysis-dir", Path.Combine(_workspace.Path, "ci-analysis-output")]); 110var path = Path.Combine(root, "history/causes", name); 112var index = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root, "history/cause-index.json")))!.AsArray(); 122var bundle = TransientJson.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(root, "evidence.json"))); 129var regeneratedIndex = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root, "history/cause-index.json")))!.AsArray(); 196Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(root, name))!); 197await File.WriteAllTextAsync(Path.Combine(root, name), "previous invocation"); 201Assert.All(stale, name => Assert.Equal("previous invocation", File.ReadAllText(Path.Combine(root, name)))); 203var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json"))); 216var bundle = TransientJson.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(root, "evidence.json"))); 219var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json"))); 242var file = Path.Combine(_workspace.Path, "job-123.log"); 326Path.Combine(_workspace.Path, "issue.json"), 336var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 339var history = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!; 351Path.Combine(_workspace.Path, "issue.json"), 362await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 364Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "memory-repo", "runs"))); 404Assert.False(File.Exists(Path.Combine(_workspace.Path, "gh-calls.log"))); 405Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "memory-repo", "runs"))); 417await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "fail-issue-create-once"), ""); 418await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "seed-unselected-malformed"), ""); 435await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "evidence.json"), TransientJson.Write(evidence)); 436await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "proposal.json"), TransientJson.Write(proposal)); 440var stored = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!; 451var summary = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "runs", "123.json")))!; 455Assert.True(File.Exists(Path.Combine(_workspace.Path, "pr-comment.md"))); 467var agent = Path.Combine(_workspace.Path, "ci-analysis-output"); 468await File.WriteAllTextAsync(Path.Combine(agent, "evidence.json"), "not trusted evidence"); 469await File.WriteAllTextAsync(Path.Combine(agent, "ci-validation-result.json"), """{"verdict":"transient-infra"}"""); 476Path.Combine(EvidenceDirectory, "evidence.json"), 481await File.WriteAllTextAsync(Path.Combine(agent, "proposal.json"), rejectedText); 484Assert.Equal(rejectedText, await File.ReadAllTextAsync(Path.Combine(agent, "proposal.json"))); 492var agent = Path.Combine(_workspace.Path, "ci-analysis-output"); 493var inside = Path.Combine(agent, "planted-result.json"); 507var transferred = Directory.CreateDirectory(Path.Combine(_workspace.Path, "transferred")).FullName; 508var data = Directory.CreateDirectory(Path.Combine(transferred, "ci-failure-analysis/evidence")).FullName; 512Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(data, name))!); 513File.Copy(Path.Combine(source, name), Path.Combine(data, name)); 515var evidence = TransientJson.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(data, "evidence.json"))); 533var agent = Directory.CreateDirectory(Path.Combine(_workspace.Path, "agent-artifact")).FullName; 534await File.WriteAllTextAsync(Path.Combine(agent, "proposal.json"), TransientJson.Write(proposal)); 537var remote = Path.Combine(transferred, "remote.git"); 538var memory = Path.Combine(transferred, "history-checkout"); 567["exec", "--runtimeconfig", Path.ChangeExtension(typeof(AnalyzeCiFailureWorkflowTests).Assembly.Location, ".runtimeconfig.json"), 570new Dictionary<string, string> { ["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}" }); 572var stored = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(memory, "causes", "transferred-timeout.json")))!; 576Assert.False(Directory.Exists(Path.Combine(data, "test-results"))); 594var markdown = await File.ReadAllTextAsync(Path.Combine(RepoRoot.Path, ".github", "workflows", "analyze-ci-failure.md")); 619var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json"))); 685var outcome = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root, "collection-outcome.json")))!; 690var bundle = TransientJson.Read<EvidenceBundle>(await File.ReadAllTextAsync(Path.Combine(root, "evidence.json"))); 694Assert.True(File.Exists(Path.Combine(root, "analysis-summary.md"))); 695Assert.False(File.Exists(Path.Combine(root, "run-context.json"))); 696Assert.False(File.Exists(Path.Combine(root, "test-failures.json")));
AnalyzeCiFailureOccurrenceTests.cs (8)
150var path = Path.Combine(_workspace.Path, "issue-body.md"); 166var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 175Path.Combine(_workspace.Path, "issue.json"), 185Path.Combine(EvidenceDirectory, "diagnostics/failed-jobs.json"), 187var trustedPath = Path.Combine(EvidenceDirectory, "test-failures.json"); 195var summaryPath = Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"); 207Path.Combine(EvidenceDirectory, "run-context.json"), 209var fakeGh = Path.Combine(Assert.Single(Directory.GetDirectories(_workspace.Path, "fake-bin-*")), "gh");
AnalyzeCiFailureOverflowTests.cs (16)
42var record = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo/runs/123.json")))!; 46Assert.True(File.Exists(Path.Combine(_workspace.Path, "memory-repo/causes", id + ".json"))); 50var body = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 64await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "fail-overflow-comment-once"), ""); 67var fakeGh = Path.Combine(Assert.Single(Directory.GetDirectories(_workspace.Path, "fake-bin-*")), "gh"); 72var issuePath = Path.Combine(_workspace.Path, "issue.json"); 76var pagesPath = Path.Combine(_workspace.Path, "overflow-comments.json"); 85File.Delete(Path.Combine(_workspace.Path, "ci-analysis-output/causes", $"cause-{index}.json")); 95Assert.Contains("Operator issue notes.", await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")), StringComparison.Ordinal); 112var path = Path.Combine(_workspace.Path, "issue.json"); 136var fakeGh = Path.Combine(Assert.Single(Directory.GetDirectories(_workspace.Path, "fake-bin-*")), "gh"); 151await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics/failed-jobs.json"), """[{"id":456,"name":"Replacement job"}]"""); 152var path = Path.Combine(_workspace.Path, "ci-analysis-output/analysis-result.json"); 156foreach (var file in Directory.GetFiles(Path.Combine(_workspace.Path, "ci-analysis-output/causes"), "*.json")) 162var fakeGh = Path.Combine(Assert.Single(Directory.GetDirectories(_workspace.Path, "fake-bin-*")), "gh"); 167var body = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md"));
AnalyzeCiFailurePathsTests.cs (4)
17var workingDirectory = Path.Combine(_workspace.Path, "working directory"); 18var root = Path.Combine(workingDirectory, "ci-failure-analysis/evidence"); 20string Relative(string path) => Path.GetRelativePath(root, path).Replace(Path.DirectorySeparatorChar, '/');
AnalyzeCiFailurePreparationTests.cs (88)
25await File.WriteAllTextAsync(Path.Combine(directory, "00001.trx"), "<TestRun><Results/></TestRun>"); 35Path.Combine(directory, "00001.trx"), 105Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "memory-repo"))); 109var resultFile = Path.Combine(results, "00001.trx"); 164Assert.Equal("unavailable", JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(paths.RootDirectory, "test-evidence.json")))!["state"]!.GetValue<string>()); 165Assert.False(File.Exists(Path.Combine(paths.RootDirectory, "test-failures.json"))); 189Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "memory-repo"))); 199await File.WriteAllTextAsync(Path.Combine(results, "00001.trx"), "<TestRun><Results/></TestRun>"); 218var state = AnalyzeCiFailure.CiFailureJson.ReadContract<AnalyzeCiFailureFixtures.TestEvidenceState>(Path.Combine(paths.RootDirectory, "test-evidence.json"))?.State 240failures = AnalyzeCiFailure.TestFailureReader.ConsolidateFailures(AnalyzeCiFailure.TestFailureReader.Read(Path.Combine(paths.RootDirectory, "test-results"), jobs, artifacts)); 246AnalyzeCiFailure.CiFailureJson.WriteContract(Path.Combine(paths.RootDirectory, "test-failures.json"), projection); 251File.Delete(Path.Combine(paths.RootDirectory, "test-failures.json")); 255AnalyzeCiFailure.CiFailureJson.WriteContract(Path.Combine(paths.RootDirectory, "test-evidence.json"), new AnalyzeCiFailureFixtures.TestEvidenceState(state)); 257.Where(file => file.StartsWith(paths.PriorCausesDirectory + Path.DirectorySeparatorChar, StringComparison.Ordinal) || file.EndsWith(".log", StringComparison.Ordinal)) 259file => Path.GetRelativePath(paths.RootDirectory, file).Replace(Path.DirectorySeparatorChar, '/'), 276Path.Combine(data, "diagnostics/selected-test-result-artifacts.json"), 278return Directory.CreateDirectory(Path.Combine(data, "test-results", "8")).FullName; 290Path.Combine(EvidenceDirectory, "diagnostics/failed-jobs.json"), 294File.Copy(file, Path.Combine(selected, Path.GetFileName(file))); 297var prepared = Path.Combine(EvidenceDirectory, "test-failures.json"); 310await File.WriteAllTextAsync(Path.Combine(results, "00001.trx"), "<TestRun><Results/></TestRun>"); 312var prior = Directory.CreateDirectory(Path.Combine(data, "history/causes")).FullName; 322Path.Combine(prior, id + ".json"), 336var index = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "history/cause-index.json")))!.AsArray(); 342var original = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, item["file"]!.GetValue<string>())))!; 357await File.WriteAllTextAsync(Path.Combine(results, "00001.trx"), "<TestRun><Results/></TestRun>"); 359var prior = Directory.CreateDirectory(Path.Combine(data, "history/causes")).FullName; 361Path.Combine(prior, "stored-cause.json"), 367var entry = Assert.Single(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "history/cause-index.json")))!.AsArray())!; 379Path.Combine(results, "00001.trx"), 382await File.WriteAllTextAsync(Path.Combine(data, "diagnostics/job-123.log"), "Download failed: HTTP 503 from package feed"); 383var prior = Directory.CreateDirectory(Path.Combine(data, "history/causes")).FullName; 387Path.Combine(prior, $"cause-{i:D3}.json"), 400await File.WriteAllTextAsync(Path.Combine(prior, "z-late.json"), lateCause); 402Path.Combine(prior, "z-keyless.json"), 405Path.Combine(prior, "z-opaque.json"), 408Path.Combine(prior, "z-other-mechanism.json"), 414var index = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "history/cause-index.json")))!.AsArray(); 416Assert.True(new FileInfo(Path.Combine(data, "history/cause-index.json")).Length > 65536); 420Assert.Equal(lateCause, await File.ReadAllTextAsync(Path.Combine(data, late["file"]!.GetValue<string>()))); 426var summary = await File.ReadAllTextAsync(Path.Combine(data, "analysis-summary.md")); 441Path.Combine(directory, "00001.trx"), 456var unselected = Directory.CreateDirectory(Path.Combine(EvidenceDirectory, "test-results", "999")).FullName; 458Path.Combine(unselected, "00001.trx"), 464var failures = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "test-failures.json")))!; 481Path.Combine(directory, "00001.trx"), 483var secret = Path.Combine(_workspace.Path, "external.xml"); 488Path.Combine(directory, "00002.trx"), 500File.Delete(Path.Combine(directory, "00001.trx")); 507Assert.False(File.Exists(Path.Combine(data, "test-failures.json"))); 508Assert.Equal("unavailable", JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(data, "test-evidence.json")))!["state"]!.GetValue<string>()); 509Assert.Contains("Some required test evidence is unavailable", await File.ReadAllTextAsync(Path.Combine(data, "analysis-summary.md")), StringComparison.Ordinal); 522await File.WriteAllTextAsync(Path.Combine(directory, "00001.trx"), trx); 523await File.WriteAllTextAsync(Path.Combine(directory, "00002.trx"), trx); 529var failures = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "test-failures.json")))!.AsArray(); 555var history = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!; 558var summary = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "runs", "123.json")))!; 559var body = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 674Assert.False(Directory.Exists(Path.Combine(_workspace.Path, "memory-repo"))); 687var jobsPath = Path.Combine(data, "diagnostics/failed-jobs.json"); 692var trustedPath = Path.Combine(data, "test-failures.json"); 696var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 697var analysisPath = Path.Combine(directory, "analysis-result.json"); 712Path.Combine(directory, "causes", "legacy-timeout.json"), 735await File.WriteAllTextAsync(Path.Combine(directory, "00001.trx"), trx); 736var second = Directory.CreateDirectory(Path.Combine(EvidenceDirectory, "test-results", "9")).FullName; 737await File.WriteAllTextAsync(Path.Combine(second, "00001.trx"), trx); 739Path.Combine(EvidenceDirectory, "diagnostics/failed-jobs.json"), 742Path.Combine(EvidenceDirectory, "diagnostics/selected-test-result-artifacts.json"), 748var failures = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "test-failures.json")))!.AsArray(); 766await File.WriteAllTextAsync(Path.Combine(directory, "00001.trx"), $"<TestRun><Results>{FrameworkTrx("same-execution", "first")}</Results></TestRun>"); 769await File.WriteAllTextAsync(Path.Combine(directory, "00002.trx"), $"<TestRun><Results>{second}</Results></TestRun>"); 775Assert.Equal("unavailable", JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "test-evidence.json")))!["state"]!.GetValue<string>()); 776Assert.False(File.Exists(Path.Combine(EvidenceDirectory, "test-failures.json"))); 791await File.WriteAllTextAsync(Path.Combine(directory, "00001.trx"), $"<TestRun><Results>{first}</Results></TestRun>"); 792await File.WriteAllTextAsync(Path.Combine(directory, "00002.trx"), $"<TestRun><Results>{second}</Results></TestRun>"); 795await File.WriteAllTextAsync(Path.Combine(directory, "00003.trx"), $"<TestRun><Results>{first}{second}</Results></TestRun>"); 799var failures = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "test-failures.json")))!.AsArray(); 800var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output"); 801var summaryPath = Path.Combine(analysisDirectory, "analysis-result.json"); 814var causePath = Path.Combine(analysisDirectory, "causes", "debugger-timeout.json"); 833Path.Combine(directory, "00001.json"), 839var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output"); 840var summaryPath = Path.Combine(analysisDirectory, "analysis-result.json"); 851var causePath = Path.Combine(analysisDirectory, "causes", "debugger-timeout.json"); 867var history = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!;
AnalyzeCiFailureProgressTests.cs (10)
21var path = Path.Combine(invocation.DiagnosticsDirectory, "progress.log"); 32Assert.False(File.Exists(Path.Combine(invocation.DiagnosticsDirectory, "summary.json"))); 54await File.ReadAllTextAsync(Path.Combine(Path.GetDirectoryName(DiagnosticSummary)!, "progress.log"))); 62var path = Path.Combine(invocation.DiagnosticsDirectory, "progress.log"); 72var summary = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(invocation.DiagnosticsDirectory, "summary.json")))!; 92var path = Path.Combine(invocation.DiagnosticsDirectory, "progress.log"); 97var summary = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(invocation.DiagnosticsDirectory, "summary.json")))!; 118var text = await File.ReadAllTextAsync(Path.Combine(Path.GetDirectoryName(DiagnosticSummary)!, "progress.log"));
AnalyzeCiFailurePublicationTests.cs (147)
23await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "existing-main-label"), ""); 50await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "issue.json"), "[null,5]"); 56var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 58Assert.False(File.Exists(Path.Combine(_workspace.Path, "memory-repo", "runs", "123.json"))); 71var memoryDirectory = Path.Combine(_workspace.Path, "memory-repo"); 76Path.Combine(_workspace.Path, "analysis"), 118var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 119var path = Path.Combine(directory, "analysis-result.json"); 144await File.WriteAllTextAsync(Path.Combine(directory, "causes", "other-failure.json"), other.ToJsonString()); 153await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "test-failures.json"), collected.ToJsonString()); 165Path.Combine(directory, "causes", "flaky-failure.json"), 218await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "issue-details.json"), issue.ToJsonString()); 221await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "issue-lookup-failure"), ""); 224? JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "debugger-timeout.json")))!.AsObject() 245var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 253Assert.False(File.Exists(Path.Combine(_workspace.Path, "memory-repo", "runs", "123.json"))); 268Path.Combine(_workspace.Path, "comments.json"), 273await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "close-after-lookup"), ""); 277var summaryPath = Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"); 287File.Delete(Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "debugger-timeout.json")); 293var calls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 307var request = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "published-comment-request.json")))!; 315await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "pr-comment.md")), 332await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "pr-comment.md")), 359var calls = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 361Assert.False(File.Exists(Path.Combine(_workspace.Path, "issue-body.md"))); 382Path.Combine(_workspace.Path, "issue-details.json"), 397Assert.Contains("new operator note.", await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")), StringComparison.Ordinal); 398var calls = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 415Path.Combine(data, "run-context.json"), 417await File.WriteAllTextAsync(Path.Combine(data, "test-failures.json"), "[]"); 418await File.WriteAllTextAsync(Path.Combine(data, "diagnostics/last-successful-main-run.json"), """{"id":100,"head_sha":"last-successful-sha","created_at":""}"""); 419var analysis = Path.Combine(_workspace.Path, "ci-analysis-output"); 420var summaryPath = Path.Combine(analysis, "analysis-result.json"); 428var causePath = Path.Combine(analysis, "causes", "debugger-timeout.json"); 459var calls = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 477var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 503Path.Combine(data, "diagnostics/failed-jobs.json"), 505var trustedPath = Path.Combine(data, "test-failures.json"); 510var analysis = Path.Combine(_workspace.Path, "ci-analysis-output"); 511var summaryPath = Path.Combine(analysis, "analysis-result.json"); 517var causePath = Path.Combine(analysis, "causes", "debugger-timeout.json"); 526var body = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 535var path = Path.Combine(EvidenceDirectory, "test-failures.json"); 540var summaryPath = Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"); 544var causePath = Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "debugger-timeout.json"); 564var dataPath = Path.Combine(EvidenceDirectory, "test-failures.json"); 568var summaryPath = Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"); 572var causePath = Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "debugger-timeout.json"); 581var history = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!; 587Assert.InRange(System.Text.Encoding.UTF8.GetByteCount(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md"))), 1, 65000); 635var updated = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 640history = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!.AsObject(); 666Assert.False(File.Exists(Path.Combine(_workspace.Path, "issue-body.md"))); 667var calls = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 674var original = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue.json")))!; 687var data = Path.Combine(EvidenceDirectory, "test-failures.json"); 694var analysis = Path.Combine(_workspace.Path, "ci-analysis-output"); 695var summaryPath = Path.Combine(analysis, "analysis-result.json"); 702var causePath = Path.Combine(analysis, "causes", "debugger-timeout.json"); 710await File.WriteAllTextAsync(Path.Combine(analysis, "causes", "legacy-timeout.json"), cause.ToJsonString()); 734var analysis = Path.Combine(_workspace.Path, "ci-analysis-output"); 735var summaryPath = Path.Combine(analysis, "analysis-result.json"); 736var causePath = Path.Combine(analysis, "causes", "debugger-timeout.json"); 737var trustedPath = Path.Combine(data, "test-failures.json"); 744Path.Combine(data, "diagnostics/failed-jobs.json"), 768var body = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 774Path.Combine(_workspace.Path, "issue.json"), 782foreach (var file in new[] { Path.Combine(data, "run-context.json"), Path.Combine(data, "diagnostics/run.json"), summaryPath }) 785run[Path.GetFileName(file) == "run.json" ? "id" : "run_id"] = 124; 786if (Path.GetFileName(file) == "run.json") 792var fakeGh = Path.Combine(Assert.Single(Directory.GetDirectories(_workspace.Path, "fake-bin-*")), "gh"); 797var updated = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 824Assert.False(File.Exists(Path.Combine(_workspace.Path, "issue-body.md"))); 825var calls = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 827var original = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue.json")))!; 838var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 847Path.Combine(_workspace.Path, "issue.json"), 856var fakeGh = Path.Combine(Assert.Single(Directory.GetDirectories(_workspace.Path, "fake-bin-*")), "gh"); 890var causes = Directory.CreateDirectory(Path.Combine(_workspace.Path, "memory-repo", "causes")).FullName; 891await File.WriteAllTextAsync(Path.Combine(causes, "debugger-timeout.json"), history.ToJsonString()); 893if (File.Exists(Path.Combine(_workspace.Path, "seed-unselected-malformed"))) 895var causes = Directory.CreateDirectory(Path.Combine(_workspace.Path, "memory-repo", "causes")).FullName; 896await File.WriteAllTextAsync(Path.Combine(causes, "unselected.json"), "not JSON"); 901Path.Combine(_workspace.Path, "issue.json"), 1013["exec", "--runtimeconfig", Path.ChangeExtension(typeof(AnalyzeCiFailureWorkflowTests).Assembly.Location, ".runtimeconfig.json"), 1015"--evidence-dir", EvidenceDirectory, "--analysis-dir", Path.Combine(_workspace.Path, "ci-analysis-output"), 1016"--history-dir", Path.Combine(_workspace.Path, "memory-repo"), "--repo", "microsoft/aspire", 1020["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 1026var checkout = Path.Combine(_workspace.Path, "memory-repo"); 1027var remote = Path.Combine(_workspace.Path, "remote.git"); 1041var files = new[] { "causes", "runs" }.SelectMany(name => Directory.Exists(Path.Combine(checkout, name)) 1042? Directory.GetFiles(Path.Combine(checkout, name), "*.json") : []).ToArray(); 1050.. files.Select(file => Path.GetRelativePath(checkout, file))]); 1094var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output"); 1096Path.Combine(analysisDirectory, "causes", "debugger-timeout.json")))!; 1099await File.WriteAllTextAsync(Path.Combine(analysisDirectory, "causes", "second-timeout.json"), cause.ToJsonString()); 1100var summaryPath = Path.Combine(analysisDirectory, "analysis-result.json"); 1104await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "fail-second-issue"), ""); 1111Assert.True(File.Exists(Path.Combine(recovery, "manifest.json"))); 1113await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json"))); 1118Assert.True(File.Exists(Path.Combine(recovery, "requests", $"{id}.issue-body.md"))); 1119var path = Path.Combine(_workspace.Path, "memory-repo", "causes", $"{id}.json"); 1134Assert.False(File.Exists(Path.Combine(analysisDirectory, $"{id}.issue-body.md"))); 1136Assert.False(File.Exists(Path.Combine(_workspace.Path, "pr-comment.md"))); 1148Path.Combine(EvidenceDirectory, "test-failures.json"), 1152await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, name), "{}"); 1154await File.WriteAllTextAsync(Path.Combine(EvidenceDirectory, "diagnostics/candidate-merges.json"), "[]"); 1206var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 1207var path = Path.Combine(directory, "causes", "debugger-timeout.json"); 1216await File.WriteAllTextAsync(Path.Combine(directory, "causes", "assertion-failure.json"), other.ToJsonString()); 1217var summaryPath = Path.Combine(directory, "analysis-result.json"); 1222await File.WriteAllTextAsync(Path.Combine(directory, "causes", "assertion-failure.json"), other.ToJsonString()); 1224var evidencePath = Path.Combine(EvidenceDirectory, "test-failures.json"); 1240var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 1241var other = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(directory, "causes", "debugger-timeout.json")))!; 1243await File.WriteAllTextAsync(Path.Combine(directory, "causes", "other-mechanism.json"), other.ToJsonString()); 1244var path = Path.Combine(directory, "analysis-result.json"); 1259var path = Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"); 1268var evidencePath = Path.Combine(EvidenceDirectory, "test-failures.json"); 1280var history = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "causes", "debugger-timeout.json")))!; 1282var run = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "memory-repo", "runs", "123.json")))!; 1292var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 1293var summaryPath = Path.Combine(directory, "analysis-result.json"); 1299var path = Path.Combine(directory, "causes", "debugger-timeout.json"); 1306await File.WriteAllTextAsync(Path.Combine(data, "diagnostics/failed-jobs.json"), """[{"id":123,"name":"Tests"},{"id":456,"name":"Tests"}]"""); 1307var evidencePath = Path.Combine(data, "test-failures.json"); 1323var prior = Directory.CreateDirectory(Path.Combine(EvidenceDirectory, "history/causes")).FullName; 1325Path.Combine(prior, "debugger-timeout.json"), 1353var directory = Path.Combine(_workspace.Path, "ci-analysis-output"); 1354var summaryPath = Path.Combine(directory, "analysis-result.json"); 1358var causePath = Path.Combine(directory, "causes", "debugger-timeout.json"); 1362var evidencePath = Path.Combine(EvidenceDirectory, "test-failures.json"); 1401var storedDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "memory-repo", "causes")).FullName; 1403Path.Combine(storedDirectory, "debugger-timeout.json"), 1431["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "obsolete-analysis-directory"), 1432["PATH"] = $"{Path.GetDirectoryName(fakeGh)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 1434string[] args = ["exec", "--runtimeconfig", Path.ChangeExtension(typeof(AnalyzeCiFailureWorkflowTests).Assembly.Location, ".runtimeconfig.json"), 1437"--history-dir", Path.Combine(_workspace.Path, "memory-repo"), "--repo", "microsoft/aspire", 1447await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 1449var storedPath = Path.Combine(storedDirectory, "debugger-timeout.json"); 1461var body = await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")); 1464Path.Combine(_workspace.Path, "issue.json"), 1481Assert.Contains("Operator notes: keep this.", await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "issue-body.md")), StringComparison.Ordinal);
AnalyzeCiFailureStorageTests.cs (37)
45var capturedRun = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(recovery, "diagnostics", "run.json"))); 47var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json"))); 50Assert.False(File.Exists(Path.Combine(EvidenceDirectory, "evidence.json"))); 51using var manifest = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(recovery, "manifest.json"))); 67using var rejected = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(recovery, "rejected-or-degraded-evidence.json"))); 69Assert.True(File.Exists(Path.Combine(recovery, "manifest.json"))); 82await File.WriteAllTextAsync(Path.Combine(scratch.Results, $"{i:D5}.trx"), "malformed"); 88using var manifest = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(directory, "manifest.json"))); 91Assert.Equal(1024, Directory.GetFiles(Path.Combine(directory, "extracted-results")).Length); 101var report = Assert.Single(Directory.GetFiles(Path.Combine(recovery, "extracted-results"), "*.trx", SearchOption.AllDirectories)); 103var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json"))); 105Assert.True(File.Exists(Path.Combine(recovery, "diagnostics", "selected-test-result-artifacts.json"))); 115var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(recovery, "collection-outcome.json"))); 118Assert.True(File.Exists(Path.Combine(recovery, "diagnostics", "all-jobs.json"))); 129using var run = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(recovery, "diagnostics", "run.json"))); 139await File.WriteAllTextAsync(Path.Combine(scratch.Results, "failed.trx"), "<error>token=private-value</error>"); 140await File.WriteAllTextAsync(Path.Combine(scratch.Results, "oversized.trx"), new string('x', AnalysisDiagnostics.MaximumFileBytes + 1)); 155.Where(file => Path.GetFileName(file) is not ("manifest.json" or "collection-outcome.json")) 157using var manifest = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(directory, "manifest.json"))); 161Assert.Equal("<error>token=private-value</error>", await File.ReadAllTextAsync(Path.Combine(scratch.Results, "failed.trx"))); 171await File.WriteAllTextAsync(Path.Combine(paths.RootDirectory, "unexpected.json"), "not JSON"); 181entry => Assert.True(File.Exists(Path.Combine(output.RootDirectory, entry.GetProperty("file").GetString()!)))); 182Assert.False(File.Exists(Path.Combine(output.RootDirectory, "unexpected.json"))); 193var target = collection ? Path.Combine(_workspace.Path, "saved-evidence") : paths.RootDirectory; 194Directory.CreateDirectory(Path.Combine(target, "history")); 196Path.Combine(target, "evidence.json"), 198await File.WriteAllTextAsync(Path.Combine(target, "analysis-summary.md"), "original summary"); 199await File.WriteAllTextAsync(Path.Combine(target, "collection-outcome.json"), "original outcome"); 200await File.WriteAllTextAsync(Path.Combine(target, "history", "cause-index.json"), "original catalogue"); 202.ToDictionary(file => Path.GetRelativePath(target, file), File.ReadAllText); 205Directory.CreateDirectory(Path.GetDirectoryName(destination)!); 227Assert.All(before, pair => Assert.Equal(pair.Value, File.ReadAllText(Path.Combine(target, pair.Key)))); 231.Select(file => Path.GetRelativePath(target, file)).Order()); 244var before = Directory.GetFiles(paths.RootDirectory).ToDictionary(path => Path.GetFileName(path), File.ReadAllText); 249Assert.All(before, pair => Assert.Equal(pair.Value, File.ReadAllText(Path.Combine(paths.RootDirectory, pair.Key!)))); 250Assert.Equal(before.Keys.Order(), Directory.GetFiles(paths.RootDirectory).Select(Path.GetFileName).Order()); 251Assert.True(File.Exists(Path.Combine(ReplayDirectory, "collection-outcome.json")));
AnalyzeCiFailureWorkflowCommandsTests.cs (15)
24var report = await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "limited-analysis.md")); 25Assert.Equal(report, await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "step-summary"))); 32var summary = Path.Combine(_workspace.Path, "step-summary"); 39var outputs = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "workflow-output")); 43var report = await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "limited-analysis.md")); 74var summary = Directory.CreateDirectory(Path.Combine(_workspace.Path, "step-summary")).FullName; 81var outcome = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "collection-outcome.json"))); 88var path = Path.Combine(_workspace.Path, "workflow-output"); 119var output = Path.Combine(_workspace.Path, "workflow-output"); 129var recovery = TransientJson.Read<AnalysisOutcome>(await File.ReadAllTextAsync(Path.Combine( 139var output = Path.Combine(_workspace.Path, "workflow-output"); 205["GITHUB_OUTPUT"] = Path.Combine(_workspace.Path, "workflow-output"), 213Assert.False(File.Exists(Path.Combine(_workspace.Path, "workflow-output"))); 221var output = Path.Combine(_workspace.Path, "agent-output.json"); 240var output = Path.Combine(_workspace.Path, "agent-output.json");
AnalyzeCiFailureWorkflowTests.cs (343)
25private string EvidenceDirectory => _collectedEvidenceDirectory ?? Path.Combine(_workspace.Path, "ci-failure-analysis", "evidence"); 26private string ReplayDirectory => _replayDirectory ?? Path.Combine(_workspace.Path, "ci-failure-analysis", "replay"); 27private string RecoveryDirectory(string stage) => Path.Combine(_invocationDirectory ?? Path.Combine(_workspace.Path, "ci-failure-analysis"), "recovery", stage); 58var path = Path.Combine(EvidenceDirectory, file); 59Directory.CreateDirectory(Path.GetDirectoryName(path)!); 112Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "ghost.json")); 114var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 117Assert.True(Directory.Exists(Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "ghost.json"))); 152var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 173var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 191var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 333Assert.True(File.Exists(Path.Combine(ReplayDirectory, "analysis-summary.md"))); 357Assert.True(File.Exists(Path.Combine(EvidenceDirectory, "collection-outcome.json"))); 363await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "arguments.rsp"), "collect"); 369Assert.Equal(["arguments.rsp"], Directory.GetFileSystemEntries(_workspace.Path).Select(Path.GetFileName)); 389new Dictionary<string, string> { ["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ambient-analysis") }); 406new Dictionary<string, string> { ["ANALYSIS_DIR"] = Path.Combine(_workspace.Path, "ambient-analysis") }); 436var workingDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "working directory")).FullName; 437Directory.CreateDirectory(Path.Combine(workingDirectory, "ci-failure-analysis")); 438Directory.Move(EvidenceDirectory, Path.Combine(workingDirectory, "ci-failure-analysis/evidence")); 439var analysisDirectory = Path.Combine(workingDirectory, "downloaded proposal"); 440Directory.Move(Path.Combine(_workspace.Path, "ci-analysis-output"), analysisDirectory); 441var ambientDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ambient-analysis")).FullName; 442var ambientFile = Path.Combine(ambientDirectory, "analysis-result.json"); 458var path = Path.Combine(_workspace.Path, "not-a-directory"); 468Directory.GetFileSystemEntries(_workspace.Path).Select(Path.GetFileName).Order(StringComparer.Ordinal)); 494Assert.Equal(text, await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "proposal.json"))); 506var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 521var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 535var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 550var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 570var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 618var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 684var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 701Path.Combine(EvidenceDirectory, "history/causes")).FullName; 703Path.Combine(priorCausesDirectory, "nuget-timeout.json"), 729Path.Combine(EvidenceDirectory, "history/causes")).FullName; 731Path.Combine(priorCausesDirectory, "flaky-failure.json"), 734var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 739await File.ReadAllTextAsync(Path.Combine(priorCausesDirectory, "flaky-failure.json"))); 754var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 786var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 813var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 845Path.Combine(EvidenceDirectory, "test-failures.json"), 848var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 864Path.Combine(EvidenceDirectory, "test-failures.json"), 867var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 896Path.Combine(EvidenceDirectory, "test-failures.json"), 899var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 926Path.Combine(EvidenceDirectory, "test-failures.json"), 934var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 961var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 982var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1003var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1019Path.Combine(EvidenceDirectory, "test-failures.json"), 1022var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1042var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1062var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1082Path.Combine(EvidenceDirectory, "test-failures.json"), 1085var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1101Path.Combine(EvidenceDirectory, "test-failures.json"), 1104var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1124Path.Combine(EvidenceDirectory, "test-failures.json"), 1127var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1159var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1187await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "unreferenced.json"), "not-json"); 1189"--analysis-dir", Path.Combine(_workspace.Path, "ci-analysis-output")]); 1220var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1238File.Delete(Path.Combine(EvidenceDirectory, "evidence.json")); 1241"--analysis-dir", Path.Combine(_workspace.Path, "ci-analysis-output")]); 1259Path.Combine(EvidenceDirectory, "diagnostics/run.json"), 1262var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1448var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1477var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1497var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1556var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1572var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1637var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1672var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1718Path.Combine(EvidenceDirectory, "history/causes")).FullName; 1721Path.Combine(priorCausesDirectory, "nuget-timeout.json"), 1730var causePath = Path.Combine(_workspace.Path, "ci-analysis-output", "causes", "nuget-timeout.json"); 1731var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1750var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1770var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 1836var analysisPath = Path.Combine(_workspace.Path, "analysis.json"); 1837var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json"); 1861var analysisPath = Path.Combine(_workspace.Path, "analysis.json"); 1862var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json"); 1905var analysisPath = Path.Combine(_workspace.Path, "analysis.json"); 1906var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json"); 2102var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 2153var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 2176var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 2195var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 2223var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 2244var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 2257var causePath = Path.Combine(_workspace.Path, "main-build-break.json"); 2258var runContextPath = Path.Combine(_workspace.Path, "run-context.json"); 2259var lastSuccessfulRunPath = Path.Combine(_workspace.Path, "last-successful-main-run.json"); 2260var triggeringMergePath = Path.Combine(_workspace.Path, "triggering-merge-pr.json"); 2261var candidateHistoryStatusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 2262var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 2263var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json"); 2338var causePath = Path.Combine(_workspace.Path, "main-build-break.json"); 2339var runContextPath = Path.Combine(_workspace.Path, "run-context.json"); 2340var lastSuccessfulRunPath = Path.Combine(_workspace.Path, "last-successful-main-run.json"); 2341var triggeringMergePath = Path.Combine(_workspace.Path, "triggering-merge-pr.json"); 2342var candidateHistoryStatusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 2343var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 2344var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json"); 2416var causePath = Path.Combine(_workspace.Path, "flaky-failure.json"); 2417var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 2418var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json"); 2459var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2465var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2471Assert.Equal("00001.trx", Path.GetFileName(extractedFile)); 2479var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2485var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2498Assert.Equal("00001.json", Path.GetFileName(extractedFile)); 2506var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2511var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2524var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2529var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2542var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2547var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2570var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2582var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2595var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2600var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2613var archivePath = Path.Combine(_workspace.Path, "test-results.zip"); 2622var outputDirectory = Path.Combine(_workspace.Path, "extracted"); 2635var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2649var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2681var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2702var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2737var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2739var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2764var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2776var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2805var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2833var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2876var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2878var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2908var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2910var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2940var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2942var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 2972var artifactsPath = Path.Combine(_workspace.Path, "artifacts.json"); 2986var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3021var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3023Path.Combine(testResultsDirectory.FullName, "00001.trx"), 3040var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3046var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3062var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3064Path.Combine(testResultsDirectory.FullName, "00001.json"), 3075var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3079var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3091var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3093Path.Combine(testResultsDirectory.FullName, "00001.json"), 3104var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3108var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3120var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3122Path.Combine(testResultsDirectory.FullName, "00001.json"), 3139var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3143var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3156var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3158var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3162var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3174var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3176Path.Combine(testResultsDirectory.FullName, "00001.json"), 3179var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3183var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3199var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3201Path.Combine(testResultsDirectory.FullName, "00001.trx"), 3210Path.Combine(testResultsDirectory.FullName, "00002.trx"), 3212var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3216var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3236var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3238Path.Combine(testResultsDirectory.FullName, "00001.trx"), 3240var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3244var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3264var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3265await File.WriteAllTextAsync(Path.Combine(testResultsDirectory.FullName, "results.xml"), "<TestRun />"); 3266var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3270var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3290var testResultsDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "test-results")); 3292Path.Combine(testResultsDirectory.FullName, "00001.trx"), 3300var jobsPath = Path.Combine(_workspace.Path, "all-jobs.json"); 3304var outputPath = Path.Combine(_workspace.Path, "test-failures.json"); 3335var openIssuesPath = Path.Combine(_workspace.Path, "open-issues.json"); 3336var closedIssuesPath = Path.Combine(_workspace.Path, "closed-issues.json"); 3345["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 3382["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 3407["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 3418var responses = Path.Combine(_workspace.Path, "comments.json"); 3441["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 3452var callLogPath = Path.Combine(_workspace.Path, "gh-calls.log"); 3463var openIssuesPath = Path.Combine(_workspace.Path, "open-issues.json"); 3464var closedIssuesPath = Path.Combine(_workspace.Path, "closed-issues.json"); 3471["PATH"] = $"{Path.GetDirectoryName(fakeGhPath)}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 3505Path.Combine(_workspace.Path, "last-success.json")); 3508using var output = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "last-success.json"))); 3511Assert.Contains("per_page=100", await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-calls.log")), StringComparison.Ordinal); 3513await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 3539var outputPath = Path.Combine(_workspace.Path, "last-success.json"); 3574var outputPath = Path.Combine(_workspace.Path, "last-success.json"); 3581await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 3609var outputPath = Path.Combine(_workspace.Path, "last-success.json"); 3617await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 3639Path.Combine(_workspace.Path, "last-success.json")); 3657Path.Combine(_workspace.Path, "last-success.json")); 3684Path.Combine(_workspace.Path, "last-success.json")); 3687using var output = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "last-success.json"))); 3689Assert.True(int.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-call-count"))) >= 2); 3691(await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"))) 3718Path.Combine(_workspace.Path, "last-success.json")); 3721using var output = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "last-success.json"))); 3723Assert.Equal(2, int.Parse(await File.ReadAllTextAsync(Path.Combine(_workspace.Path, "gh-call-count")))); 3726(await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log"))) 3739Path.Combine(_workspace.Path, "last-success.json")); 3752var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 3753var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 3773var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 3774var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 3817var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 3818var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 3866var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 3867var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 3878var ghCalls = await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")); 3926var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 3927var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 3938await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "gh-calls.log")), 3967var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 3968var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 4011var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 4012var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 4051var candidatesPath = Path.Combine(_workspace.Path, "candidate-merges.json"); 4052var statusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 4094var outputPath = Path.Combine(_workspace.Path, "persisted-main.json"); 4152var outputPath = Path.Combine(_workspace.Path, $"persisted-{historyState}.json"); 4193var outputPath = Path.Combine(_workspace.Path, "persisted-pr.json"); 4246var outputPath = Path.Combine(_workspace.Path, "persisted-pr.json"); 4278var outputPath = Path.Combine(_workspace.Path, "persisted-pr.json"); 4321var causePath = Path.Combine(_workspace.Path, "prior-cause.json"); 4338var priorDirectory = Directory.CreateDirectory(Path.Combine(EvidenceDirectory, "history/causes")).FullName; 4339File.Move(causePath, Path.Combine(priorDirectory, "same-id.json")); 4343var index = await File.ReadAllTextAsync(Path.Combine(EvidenceDirectory, "history/cause-index.json")); 4359var metadataPath = Path.Combine(_workspace.Path, "metadata.json"); 4389var diagnosticsPath = Path.Combine(_workspace.Path, "diagnostics.json"); 4410var logPath = Path.Combine(_workspace.Path, "job.log"); 4461var inputPath = Path.Combine(_workspace.Path, "job.log"); 4462var outputPath = Path.Combine(_workspace.Path, "sanitized.log"); 4475var inputPath = Path.Combine(_workspace.Path, "job.log"); 4476var outputPath = Path.Combine(_workspace.Path, "sanitized.log"); 4493var causePath = Path.Combine(_workspace.Path, "cause.json"); 4494var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 4495var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json"); 4557var analysisPath = Path.Combine(_workspace.Path, "analysis.json"); 4558var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json"); 4614var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md"); 4615var outputPath = Path.Combine(_workspace.Path, "updated-body.md"); 4656var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md"); 4657var canonicalBodyPath = Path.Combine(_workspace.Path, "canonical-body.md"); 4658var outputPath = Path.Combine(_workspace.Path, "updated-body.md"); 4775var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md"); 4776var outputPath = Path.Combine(_workspace.Path, "updated-body.md"); 4824var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md"); 4825var outputPath = Path.Combine(_workspace.Path, "updated-body.md"); 4859var currentBodyPath = Path.Combine(_workspace.Path, "current-body.md"); 4860var firstOutputPath = Path.Combine(_workspace.Path, "first-output.md"); 4861var secondOutputPath = Path.Combine(_workspace.Path, "second-output.md"); 4917var causePath = Path.Combine(_workspace.Path, "cause.json"); 4918var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 4919var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json"); 4953var causePath = Path.Combine(_workspace.Path, "cause.json"); 4954var runContextPath = Path.Combine(_workspace.Path, "run-context.json"); 4955var lastSuccessfulPath = Path.Combine(_workspace.Path, "last-successful.json"); 4956var triggeringMergePath = Path.Combine(_workspace.Path, "triggering-merge.json"); 4957var candidateHistoryStatusPath = Path.Combine(_workspace.Path, "candidate-merge-history-status.json"); 4958var bodyPath = Path.Combine(_workspace.Path, "issue-body.md"); 4959var metadataPath = Path.Combine(_workspace.Path, "issue-metadata.json"); 5000var trustedJobsPath = Path.Combine(_workspace.Path, "failed-jobs.json"); 5001var buildCausePath = Path.Combine(_workspace.Path, "build-cause.json"); 5002var testCausePath = Path.Combine(_workspace.Path, "test-cause.json"); 5003var multiJobCausePath = Path.Combine(_workspace.Path, "multi-job-cause.json"); 5016Path.Combine(failureDataDirectory, "run-context.json"), 5043var buildBodyPath = Path.Combine(_workspace.Path, "build-body.md"); 5044var buildMetadataPath = Path.Combine(_workspace.Path, "build-metadata.json"); 5045var testBodyPath = Path.Combine(_workspace.Path, "test-body.md"); 5046var testMetadataPath = Path.Combine(_workspace.Path, "test-metadata.json"); 5113"--analysis-dir", Path.Combine(_workspace.Path, "ci-analysis-output")]); 5121["exec", "--runtimeconfig", Path.ChangeExtension(typeof(AnalyzeCiFailureWorkflowTests).Assembly.Location, ".runtimeconfig.json"), 5132var analysis = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output")).FullName; 5133await File.WriteAllTextAsync(Path.Combine(data, "evidence.json"), evidence); 5134await File.WriteAllTextAsync(Path.Combine(analysis, "proposal.json"), proposal); 5144var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName; 5145var fakeGhPath = Path.Combine(fakeBinDirectory, "gh"); 5150["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 5151["GH_CALL_LOG"] = Path.Combine(_workspace.Path, "gh-calls.log"), 5152["GH_CALL_COUNT_FILE"] = Path.Combine(_workspace.Path, "gh-call-count"), 5166var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "fake-bin")).FullName; 5167var fakeGhPath = Path.Combine(fakeBinDirectory, "gh"); 5172["PATH"] = $"{fakeBinDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}", 5173["GH_CALL_LOG"] = Path.Combine(_workspace.Path, "gh-calls.log"), 5188var fakeBinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, $"fake-bin-{Guid.NewGuid():N}")).FullName; 5189var fakeGhPath = Path.Combine(fakeBinDirectory, "gh"); 5217var analysisDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output")).FullName; 5219Directory.CreateDirectory(Path.Combine(failureDataDirectory, "diagnostics")); 5220Directory.CreateDirectory(Path.Combine(failureDataDirectory, "history")); 5221await File.WriteAllTextAsync(Path.Combine(analysisDirectory, "analysis-result.json"), analysis); 5222await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "run-context.json"), runContext); 5223await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/run.json"), run); 5224await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/failed-jobs.json"), trustedFailedJobs); 5225await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/triggering-merge-pr.json"), triggeringMerge); 5226await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/last-successful-main-run.json"), lastSuccessfulRun); 5227await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/candidate-merges.json"), candidateMerges); 5228await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/candidate-merge-history-status.json"), candidateHistoryStatus); 5229await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/pr-metadata.json"), prMetadata); 5236Path.Combine(_workspace.Path, "ci-analysis-output", "analysis-result.json"))!; 5238var context = AnalyzeCiFailure.CiFailureJson.ReadContract<AnalyzeCiFailure.RunContext>(Path.Combine(paths.RootDirectory, "run-context.json"))!; 5258=> new((await File.ReadAllLinesAsync(Path.Combine(_workspace.Path, "http-requests.jsonl"))) 5291process.StartInfo.Environment["GITHUB_STEP_SUMMARY"] = Path.Combine(_workspace.Path, "step-summary"); 5342return [.. arguments, "--evidence-dir", directory == _workspace.Path ? EvidenceDirectory : Path.Combine(directory, "ci-failure-analysis", "evidence")]; 5354var analysisDirectory = Path.Combine(_workspace.Path, "ci-analysis-output"); 5358Directory.CreateDirectory(Path.Combine(failureDataDirectory, "diagnostics")); 5359Directory.CreateDirectory(Path.Combine(failureDataDirectory, "history")); 5361await File.WriteAllTextAsync(Path.Combine(analysisDirectory, "analysis-result.json"), analysis); 5362await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "run-context.json"), runContext); 5363await File.WriteAllTextAsync(Path.Combine(failureDataDirectory, "diagnostics/failed-jobs.json"), trustedFailedJobs); 5365Path.Combine(failureDataDirectory, "diagnostics/run.json"), 5368Path.Combine(failureDataDirectory, "test-evidence.json"), 5402Path.Combine(failureDataDirectory, "test-failures.json"), 5423var causesDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "ci-analysis-output", "causes")).FullName; 5426await File.WriteAllTextAsync(Path.Combine(causesDirectory, fileName), cause); 5432var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json")); 5443var result = await RunValidationScriptAsync(Path.Combine(_workspace.Path, "output.json"));
GitHubApiClientTests.cs (6)
727var directory = Directory.CreateDirectory(Path.Combine(RepoRoot.Path, "artifacts", "github-http-tests", Guid.NewGuid().ToString("N"))); 728var path = Path.Combine(directory.FullName, "artifact.zip"); 750var directory = Directory.CreateDirectory(Path.Combine(RepoRoot.Path, "artifacts", "github-http-tests", Guid.NewGuid().ToString("N"))); 751var path = Path.Combine(directory.FullName, "artifact.zip"); 772var directory = Directory.CreateDirectory(Path.Combine(RepoRoot.Path, "artifacts", "github-http-tests", Guid.NewGuid().ToString("N"))); 773var path = Path.Combine(directory.FullName, "artifact.zip");
tests\Infrastructure.Tests\Shared\RepoRoot.cs (1)
27if (File.Exists(System.IO.Path.Combine(directory.FullName, "Aspire.slnx")))
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
TestServices\GitHubFixtureHandler.cs (8)
26Path.Combine(workingDirectory, "http-calls.log"), 42Path.Combine(workingDirectory, "http-requests.jsonl"), 60if (File.Exists(Path.Combine(workingDirectory, "existing-main-label"))) 228var paths = (environment?.GetValueOrDefault("PATH") ?? Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator); 233var candidate = Path.Combine(workingDirectory, Path.GetFileName(directory), "gh"); 247var directory = Directory.CreateDirectory(Path.Combine(workingDirectory, "http-fixture-requests")); 248var file = Path.Combine(directory.FullName, $"{++_sequence}.request");
aspire (1210)
Acquisition\IInstallSidecarReader.cs (1)
74/// <see cref="Path.GetDirectoryName(string?)"/> returned null/empty for the
Acquisition\InstallationCandidateSources.cs (6)
59var releaseDir = Path.Combine(context.AspireHome, "bin"); 60var releaseBinary = Path.Combine(releaseDir, context.AspireBinaryName); 85var dogfoodRoot = Path.Combine(context.AspireHome, InstallationDiscoveryLayout.DogfoodDirectoryName); 92var binDir = Path.Combine(prDir, "bin"); 93var binary = Path.Combine(binDir, context.AspireBinaryName); 143var toolStore = Path.Combine(context.HomeDirectory.FullName, ".dotnet", "tools", ".store", "aspire.cli");
Acquisition\InstallationDiscovery.cs (7)
78var binaryDir = !string.IsNullOrEmpty(canonicalPath) ? Path.GetDirectoryName(canonicalPath) : null; 203var binaryDir = Path.GetDirectoryName(canonical); 320var bin = Path.GetDirectoryName(canonicalBinaryPath); 326var prDir = Path.GetDirectoryName(bin); 332var dogfoodDir = Path.GetDirectoryName(prDir); 334!string.Equals(Path.GetFileName(dogfoodDir), InstallationDiscoveryLayout.DogfoodDirectoryName, StringComparison.Ordinal)) 339var label = Path.GetFileName(prDir);
Acquisition\InstallSidecarReader.cs (1)
51var sidecarPath = Path.Combine(binaryDir, SidecarFileName);
Acquisition\InstallSidecarWriter.cs (1)
29var sidecarPath = Path.Combine(binaryDirectory, InstallSidecarReader.SidecarFileName);
Acquisition\InstallSourceDetector.cs (6)
25if (string.IsNullOrEmpty(processPath) || !Path.IsPathFullyQualified(processPath)) 37var binaryDirectory = Path.GetDirectoryName(resolvedPath); 40!string.Equals(Path.GetFileName(resolvedPath), environment.IsWindows() ? "aspire.exe" : "aspire", comparison)) 119Path.IsPathFullyQualified(configuredDirectory) && 120CliPathHelper.ResolveSymlinkToFullPath(Path.TrimEndingDirectorySeparator(configuredDirectory), logger) is { } resolvedDirectory && 123Path.TrimEndingDirectorySeparator(resolvedDirectory),
Acquisition\IWindowsRegistryReader.cs (2)
50canonicalProcessPath = Path.GetFullPath(processPath); 98canonicalTarget = Path.GetFullPath(portableTarget);
Acquisition\WingetFirstRunProbe.cs (2)
41var sidecarPath = Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName); 63var tempPath = Path.Combine(binaryDir, $"{InstallSidecarReader.SidecarFileName}.{Guid.NewGuid():N}.tmp");
Agents\AgentConfiguration.cs (10)
25foreach (var targets in clients.Distinct().GroupBy(client => Path.GetFullPath(client.GetIntegrationConfigPath(scope, workspaceRoot)), StringComparers.FileSystemPath)) 83stream = File.OpenRead(Path.GetFullPath(path)); 115=> ReadDirectory(Path.GetFullPath(directory)).Files; 119path = Path.GetFullPath(path); 134directory = Path.GetFullPath(directory); 146path = Path.GetFullPath(path); 159Path.Combine(Path.GetDirectoryName(path)!, $".{Path.GetFileName(path)}.aspire.lock"), 241.Where(file => !Path.GetFileName(file).StartsWith('.'))
Agents\AgentEnvironmentScanContext.cs (1)
29var path = Path.Combine(currentDirectory.FullName, directoryName);
Agents\AgentInstructionsFile.cs (9)
99return PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(directory.FullName, path)); 213var filePath = Path.Combine(directory.FullName, FileName); 336var displayPath = Path.Combine(directory.FullName, FileName).EscapeMarkup(); 345externalLinkTarget = File.ResolveLinkTarget(Path.Combine(directory.FullName, FileName), returnFinalTarget: true)?.FullName; 458var lexical = Path.GetRelativePath(directory, appHostPath); 464return Path.GetRelativePath(PathNormalizer.ResolveSymlinks(directory), PathNormalizer.ResolveSymlinks(appHostPath)); 475!IsOutsideDirectory(Path.GetRelativePath(PathNormalizer.ResolveSymlinks(directory.FullName), PathNormalizer.ResolveSymlinks(path))); 480Path.IsPathRooted(relativePath) || 482relativePath.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal);
Agents\AgentPath.cs (23)
11public static string UniversalSkillsDirectory { get; } = Path.Combine(".agents", "skills"); 17return Path.Combine(GetOverride("ProgramFiles", context, environment) ?? 18Path.Combine(Path.GetPathRoot(context.HomeDirectory.FullName)!, "Program Files"), productName); 23return Path.Combine(Path.DirectorySeparatorChar.ToString(), "Library", "Application Support", productName); 26return Path.Combine(Path.DirectorySeparatorChar.ToString(), "etc", unixName); 31var relativePath = Path.GetRelativePath(workspaceRoot.FullName, workingDirectory.FullName); 32if (Path.IsPathRooted(relativePath) || relativePath == ".." || 33relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal)) 42if (Path.GetRelativePath(workspaceRoot.FullName, directory.FullName) == ".") 53return Path.IsPathRooted(displayPath) 61var relativePath = Path.GetRelativePath(root.FullName, path); 62if (Path.IsPathRooted(relativePath) || relativePath == ".." || 63relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal)) 69.Replace(Path.DirectorySeparatorChar, '/') 70.Replace(Path.AltDirectorySeparatorChar, '/'); 92var relative = path[2..].Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 93return Path.Join(homeDirectory, relative); 96return Path.IsPathFullyQualified(path) ? path : Path.Combine(executionContext.WorkingDirectory.FullName, path);
Agents\AspireSkills\LocalAspireSkills.cs (7)
31(Path.Combine(".claude", "skills"), [ClaudeCodeAgentClient.ClientId]), 32(Path.Combine(".github", "skills"), [CopilotAgentClient.ClientId]), 33(Path.Combine(".opencode", "skill"), [OpenCodeAgentClient.ClientId]) 49(Path: Path.Combine(root.FullName, location.Directory), Scope: AgentConfigurationScope.Project, location.Owners))) 50.Append((Path: Path.Combine(homeDirectory.FullName, AgentPath.UniversalSkillsDirectory), Scope: AgentConfigurationScope.Global, Owners: s_universalSkillOwners)); 62var path = Path.GetFullPath(Path.Combine(skillsDirectory, name));
Agents\ClaudeCode\ClaudeCodeAgentClient.cs (15)
59=> Path.Combine(scope is AgentConfigurationScope.Project 60? Path.Combine(workspaceRoot.FullName, ClaudeCodePaths.ConfigDirectoryName) 67AgentConfiguration.EnumerateJsonFiles(Path.Combine(ManagedSettingsDirectory, "managed-settings.d"))), sources); 72? Path.Combine(workspaceRoot.FullName, ClaudeCodePaths.ConfigDirectoryName) 75return Path.Combine(directory, "settings.json"); 83edit.GetJsonFilesForEdit(Path.Combine(ManagedSettingsDirectory, "managed-settings.d"))), 87=> scope is AgentConfigurationScope.Project ? Path.Combine(workspaceRoot.FullName, ".mcp.json") 119=> Path.Combine(ClaudeCodePaths.GetConfigDirectory(context, environment), "settings.json"); 126var claudeDirectory = Path.GetDirectoryName(settingsPath)!; 287var executableName = Path.GetFileNameWithoutExtension(executable); 294&& string.Equals(Path.GetFileName(assemblyPath), "aspire.dll", StringComparison.OrdinalIgnoreCase); 308yield return Path.Combine(ClaudeCodePaths.GetConfigDirectory(context, environment), "settings.json"); 311yield return Path.Combine(workspaceRoot.FullName, ".claude", "settings.json"); 312yield return Path.Combine(workspaceRoot.FullName, ".claude", "settings.local.json"); 314yield return Path.Combine(ManagedSettingsDirectory, "managed-settings.json");
Agents\ClaudeCode\ClaudeCodePaths.cs (3)
12?? Path.Combine(executionContext.HomeDirectory.FullName, ConfigDirectoryName); 20return Path.Combine(directory, ".claude.json"); 25? Path.GetFullPath(AgentPath.Expand(value, executionContext))
Agents\Copilot\CopilotAgentClient.cs (23)
48=> Path.Combine(scope is AgentConfigurationScope.Project ? workspaceRoot.FullName : context.HomeDirectory.FullName, 58? Path.Combine(workspaceRoot.FullName, ".github", "copilot") : GetSettingsDirectory(); 60return Path.Combine(directory, "settings.json"); 70=> scope is AgentConfigurationScope.Project ? Path.Combine(workspaceRoot.FullName, ".mcp.json") 71: Path.Combine(GetSettingsDirectory(), "mcp-config.json"); 80foreach (var path in new[] { Path.Combine(".vscode", "mcp.json"), Path.Combine(".github", "copilot", "mcp.json") }) 82yield return (Path.Combine(workspaceRoot.FullName, path), false); 99? AgentPath.GetOverride("APPDATA", context, environment) ?? Path.Combine(home, "AppData", "Roaming") 101? Path.Combine(home, "Library", "Application Support") 102: AgentPath.GetOverride("XDG_CONFIG_HOME", context, environment) ?? Path.Combine(home, ".config"); 105var userDirectory = Path.Combine(userDataRoot, product, "User"); 106yield return Path.Combine(userDirectory, "mcp.json"); 108var profilesDirectory = new DirectoryInfo(Path.Combine(userDirectory, "profiles")); 113yield return Path.Combine(profile.FullName, "mcp.json"); 149=> Path.Combine(GetSettingsDirectory(), "hooks", "aspire-telemetry.json"); 160Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 204yield return Path.Combine(GetSettingsDirectory(), "settings.json"); 207yield return Path.Combine(workspaceRoot.FullName, ".claude", "settings.json"); 208yield return Path.Combine(workspaceRoot.FullName, ".claude", "settings.local.json"); 209yield return Path.Combine(workspaceRoot.FullName, ".github", "copilot", "settings.json"); 210yield return Path.Combine(workspaceRoot.FullName, ".github", "copilot", "settings.local.json"); 212yield return Path.Combine(AgentPath.GetManagedSettingsDirectory(context, environment, "GitHubCopilot", "github-copilot"),
Agents\Copilot\CopilotAppInstallationDetector.cs (18)
59Path.Combine(executionContext.HomeDirectory.FullName, "AppData", "Local"), 73Path.Combine(executionContext.HomeDirectory.FullName, "Applications", MacOSAppBundleName), 74Path.Combine(Path.DirectorySeparatorChar.ToString(), "Applications", MacOSAppBundleName), 105var dataHome = !string.IsNullOrEmpty(configuredDataHome) && Path.IsPathFullyQualified(configuredDataHome) 107: Path.Combine(executionContext.HomeDirectory.FullName, ".local", "share"); 108applicationsDirectories.Add(Path.Combine(dataHome, LinuxApplicationsDirectoryName)); 113var rootDirectory = Path.DirectorySeparatorChar.ToString(); 114applicationsDirectories.Add(Path.Combine(rootDirectory, "usr", "local", "share", LinuxApplicationsDirectoryName)); 115applicationsDirectories.Add(Path.Combine(rootDirectory, "usr", "share", LinuxApplicationsDirectoryName)); 119foreach (var dataDirectory in configuredDataDirectories.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 121if (Path.IsPathFullyQualified(dataDirectory)) 123applicationsDirectories.Add(Path.Combine(dataDirectory, LinuxApplicationsDirectoryName)); 138Path.Combine(executionContext.HomeDirectory.FullName, "Applications"), 141directories.AddRange(path.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 142.Where(Path.IsPathFullyQualified)); 148var candidate = Path.Combine(directory, fileName); 217candidatePaths.Add(Path.Combine(
Agents\Copilot\CopilotPaths.cs (1)
25: Path.Combine(homeDirectory.FullName, DefaultCopilotDirectoryName);
Agents\Hooks\AgentTelemetryHook.cs (2)
34if (Path.GetFileNameWithoutExtension(command).Equals("dotnet", StringComparison.OrdinalIgnoreCase)) 36args = [Path.Combine(AppContext.BaseDirectory, "aspire.dll"), .. args];
Agents\Hooks\LegacyTelemetryHook.cs (2)
41Path.Combine(context.HomeDirectory.FullName, ".aspire"), 45.SelectMany(home => s_scriptNames.Select(name => Path.Combine(home, "hooks", name)))
Agents\OpenCode\OpenCodeAgentClient.cs (2)
48=> Path.Combine(scope is AgentConfigurationScope.Project ? workspaceRoot.FullName : context.HomeDirectory.FullName, 71? OpenCodePaths.GetConfigPaths(Path.GetDirectoryName(configFilePath)!)
Agents\OpenCode\OpenCodePaths.cs (14)
19=> GetConfigPaths(directory.FullName).Concat(GetConfigPaths(Path.Combine(directory.FullName, ".opencode"))); 25yield return Path.Combine(directory, "opencode.json"); 26yield return Path.Combine(directory, "opencode.jsonc"); 30=> Path.Combine(GetOverride("XDG_CONFIG_HOME", context, environment) ?? 31Path.Combine(context.HomeDirectory.FullName, ".config"), "opencode"); 36? Path.Combine(AgentPath.GetOverride("ProgramData", context, environment) ?? 37Path.Combine(Path.GetPathRoot(context.HomeDirectory.FullName)!, "ProgramData"), "opencode") 39? Path.Combine(Path.DirectorySeparatorChar.ToString(), "Library", "Application Support", "opencode") 40: Path.Combine(Path.DirectorySeparatorChar.ToString(), "etc", "opencode"); 58? Path.GetFullPath(value, executionContext.WorkingDirectory.FullName) 62=> candidates.LastOrDefault(File.Exists) ?? Path.Combine(directory.FullName, "opencode.jsonc");
Agents\Playwright\PlaywrightCliInstaller.cs (17)
324var dir = Path.Combine(repoRoot, skillBaseDirectory, PlaywrightCliSkillName); 339.. clients.Select(client => Path.GetRelativePath(repoRoot, 343Path.Combine(".github", "skills"), 344Path.Combine(".opencode", "skill") 357var primarySkillBaseDirectory = Path.GetRelativePath(repoRoot, clients.Single(client => string.Equals(client.Id, ClaudeCodeAgentClient.ClientId, StringComparisons.AgentClientId)) 359var primarySkillDir = Path.Combine(repoRoot, primarySkillBaseDirectory, PlaywrightCliSkillName); 377var targetSkillDir = Path.Combine(repoRoot, skillBaseDir, PlaywrightCliSkillName); 406var skillDir = Path.Combine(repoRoot, skillBaseDirectory, PlaywrightCliSkillName); 443var maxDepth = relativeSkillDirectory.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Length + 1; 445var parent = Path.GetDirectoryName(startDir); 454parent = Path.GetDirectoryName(parent); 469var relativePath = Path.GetRelativePath(sourceDir, sourceFile); 470var targetFile = Path.Combine(targetDir, relativePath); 472var targetFileDir = Path.GetDirectoryName(targetFile); 486var relativePath = Path.GetRelativePath(targetDir, targetFile); 487var sourceFile = Path.Combine(sourceDir, relativePath);
Agents\Playwright\PlaywrightCliRunner.cs (1)
117var playwrightDir = Path.Combine(workingDirectory, ".playwright");
Backchannel\AppHostConnectionResolver.cs (2)
234var displayPath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName); 307path => Path.GetRelativePath(workingDirectory, path),
Backchannel\AuxiliaryBackchannelMonitor.cs (2)
261var relativePath = Path.GetRelativePath(normalizedWorkingDirectory, normalizedAppHostPath); 262if (relativePath.StartsWith("..", StringComparison.Ordinal) || Path.IsPathRooted(relativePath))
Bundles\BundleService.cs (44)
112var lockPath = Path.Combine(extractDir, ".aspire-bundle-lock"); 157var lockPath = Path.Combine(destinationPath, ".aspire-bundle-lock"); 214var binaryDir = Path.GetDirectoryName(realBinaryPath); 236var versionsRoot = Path.Combine(destinationPath, VersionsDirectoryName); 241var activeVersionDir = Path.Combine(versionsRoot, versionId); 320var tempDir = Path.Combine(versionsRoot, $"{versionId}{TempSuffixPrefix}{Guid.NewGuid():N}"); 462var binaryDir = Path.GetDirectoryName(realBinaryPath); 472var sidecarPath = Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName); 485or InstallSourceExtensions.LocalHiveWire => Path.GetDirectoryName(binaryDir) ?? binaryDir, 504var linkPath = Path.Combine(layoutPath, dir); 519var linkPath = Path.Combine(layoutPath, dir); 570var linkPath = Path.Combine(layoutPath, dir); 602var managedDir = Path.Combine(versionDir, BundleDiscovery.ManagedDirectoryName); 603var managedExe = Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)); 610var dashboardDir = Path.Combine(versionDir, BundleDiscovery.DashboardDirectoryName); 611var dashboardExe = Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 612var blazorScript = Path.Combine(dashboardDir, "wwwroot", "_framework", "blazor.web.js"); 614var sqliteLibrary = Path.Combine(dashboardDir, sqliteLibraryName); 620var dcpDir = Path.Combine(versionDir, BundleDiscovery.DcpDirectoryName); 627if (!TerminalHostPayload.IsValid(Path.Combine(versionDir, BundleDiscovery.TerminalHostDirectoryName))) 661var name = Path.GetFileName(entry); 688var bundlePath = Path.Combine(extractDir, BundleDiscovery.BundleDirectoryName); 699var markerVersionDir = Path.Combine(extractDir, VersionsDirectoryName, versionId); 722return Path.GetFullPath(Path.IsPathRooted(target) 724: Path.Combine(layoutPath, target)); 729return Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 760var legacyPath = Path.Combine(layoutPath, dir); 791var dashboardExe = Path.Combine(dashboardPath, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 799if (Directory.Exists(Path.Combine(dashboardPath, dataDirectoryName))) 887var markerPath = Path.Combine(extractDir, VersionMarkerFileName); 897var markerPath = Path.Combine(extractDir, VersionMarkerFileName); 942var fullPath = Path.GetFullPath(Path.Combine(destinationPath, relativePath)); 943var normalizedDestination = Path.GetFullPath(destinationPath); 946if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 959var dir = Path.GetDirectoryName(fullPath); 979var linkTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, entry.LinkName)); 980if (!linkTarget.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 985var linkDir = Path.GetDirectoryName(fullPath);
Caching\AppHostInfoDiskCache.cs (9)
116_cacheDirectory = new DirectoryInfo(Path.Combine(executionContext.CacheDirectory.FullName, SubDirectoryName)); 139var path = Path.Combine(_cacheDirectory.FullName, $"{key}.json"); 212var path = Path.Combine(_cacheDirectory.FullName, $"{key}.json"); 218tempPath = Path.Combine(_cacheDirectory.FullName, $"{Path.GetRandomFileName()}.tmp"); 318AppendMtime(sb, Path.Combine(projectDir, "obj", "project.assets.json"), "assets"); 359AppendMtime(sb, Path.Combine(dir.FullName, siblingName), siblingName); 361AppendMtime(sb, Path.Combine(dir.FullName, "global.json"), "globaljson"); 366AppendMtime(sb, Path.Combine(dir.FullName, customName), customName);
Caching\DiskCache.cs (4)
24_cacheDirectory = new DirectoryInfo(Path.Combine(executionContext.CacheDirectory.FullName, "nuget-search")); 97var fullPath = Path.Combine(_cacheDirectory.FullName, fileName); 183var nameNoExt = Path.GetFileNameWithoutExtension(file.Name); 231var nameNoExt = Path.GetFileNameWithoutExtension(file.Name);
Certificates\CertificateCacheWriter.cs (4)
17EnsureDirectory(Path.GetDirectoryName(outputPath)!); 20var temporaryPath = Path.Combine( 21Path.GetDirectoryName(outputPath)!, 22$".{Path.GetFileName(outputPath)}.{Guid.NewGuid():N}.tmp");
Certificates\CertificateGeneration\CertificateManager.cs (3)
446var exportDir = Path.GetDirectoryName(path); 664var targetDirectoryPath = Path.GetDirectoryName(path); 772var keyPath = Path.ChangeExtension(path, ".key");
Certificates\CertificateGeneration\MacOSCertificateManager.cs (5)
36private static readonly string s_macOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 351ExportCertificate(certificate, Path.Combine(s_aspireDevCertsCacheDirectory, $"{aspireLookup}.pfx"), includePrivateKey: true, null, CertificateKeyExportFormat.Pfx); 399Path.Combine(s_macOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx"); 427ExportCertificate(diskCert, Path.Combine(s_aspireDevCertsCacheDirectory, $"{aspireLookup}.pfx"), includePrivateKey: true, null, CertificateKeyExportFormat.Pfx); 437var keyPath = Path.Combine(s_aspireDevCertsCacheDirectory, $"{aspireLookup}.key");
Certificates\CertificateGeneration\UnixCertificateManager.cs (26)
131var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 134var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 271var certPath = Path.Combine(certDir, nickname) + ".pem"; 385var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 387: homeDirectory + Path.DirectorySeparatorChar; 390? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 399var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 400var certDirFullPath = Path.GetFullPath(certDir); 410return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 434Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 500var certPath = Path.Combine(certDir, nickname) + ".pem"; 788return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 955var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}"); 1087var paths = nssDbOverride.Split(System.IO.Path.PathSeparator); 1127var nssDbPath = System.IO.Path.GetFullPath(path); 1155var chromiumNssDb = System.IO.Path.Combine(homeDirectory, ".pki", "nssdb"); 1162var chromiumSnapNssDb = System.IO.Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 1211var separator = System.IO.Path.DirectorySeparatorChar; 1217=> System.IO.Path.Combine(homeDirectory, ".mozilla", "firefox"); 1221var configDirectory = !string.IsNullOrEmpty(xdgConfigHome) && System.IO.Path.IsPathFullyQualified(xdgConfigHome) 1223: System.IO.Path.Combine(homeDirectory, ".config"); 1225return System.IO.Path.Combine(configDirectory, "mozilla", "firefox"); 1229=> System.IO.Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 1269var directoryPrefix = System.IO.Path.TrimEndingDirectorySeparator(System.IO.Path.GetFullPath(directory)) + System.IO.Path.DirectorySeparatorChar;
Certificates\CertificateHelpers.cs (3)
32internal static string AspireDevCertsHttpsCacheDirectory { get; } = Path.Combine( 38private static readonly string s_defaultDevCertsTrustPath = Path.Combine( 69var openSslCertsDir = Path.Combine(openSslDir, "certs");
Certificates\CertificateService.cs (6)
60internal string DevCertDirectory => Path.Combine( 188var paths = currentSslCertDir.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries); 189if (paths.Any(p => string.Equals(p.TrimEnd(Path.DirectorySeparatorChar), devCertsTrustPath.TrimEnd(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase))) 196environmentVariables[SslCertDirEnvVar] = $"{currentSslCertDir}{Path.PathSeparator}{devCertsTrustPath}"; 204environmentVariables[SslCertDirEnvVar] = string.Join(Path.PathSeparator, systemCertDirs);
Certificates\NativeCertificateToolRunner.cs (1)
247var outputPath = Path.Combine(outputDirectory, $"aspire-dev-cert-{hash}.pem");
CliExecutionContext.cs (1)
184? Path.Combine(homeDirectory.FullName, ".aspire")
Commands\AddCommand.cs (2)
396var nugetConfigPath = Path.Combine(projectDir.FullName, "nuget.config"); 667Path.Combine(projectDirectory.FullName, "nuget.config"));
Commands\AgentInitCommand.cs (9)
293file => $"{file.Name.EscapeMarkup()} ({Path.GetRelativePath(searchDirectory.FullName, file.FullName).EscapeMarkup()})", 1130var fullSkillDirectoryPath = Path.Combine(skillBaseDirectory, skill.Name); 1136var fullPath = Path.Combine(fullSkillDirectoryPath, "SKILL.md"); 1137var directory = Path.GetDirectoryName(fullPath); 1338.Select(file => Path.GetRelativePath(skillDirectory, file) 1339.Replace(Path.DirectorySeparatorChar, '/') 1340.Replace(Path.AltDirectorySeparatorChar, '/')) 1477StringComparers.FileSystemPath.Equals(Path.TrimEndingDirectorySeparator(left), Path.TrimEndingDirectorySeparator(right));
Commands\AgentMcpCommand.cs (1)
144var selectedPath = Path.GetFullPath(selectedProjectFile.FullName);
Commands\AgentTelemetryCommand.cs (1)
285Path.IsPathRooted(value))
Commands\AppHostLauncher.cs (2)
996var appHostRelativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, effectiveAppHostFile.FullName); 1034return Path.Combine(logsDirectory, fileName);
Commands\ConfigCommand.cs (1)
241if (Path.Exists(settingsFilePath))
Commands\ExportCommand.cs (3)
97var directory = Path.GetDirectoryName(Path.GetFullPath(outputPath)); 224var fullPath = Path.GetFullPath(outputPath);
Commands\InitCommand.cs (7)
330=> new(Path.Combine(solutionFile.Directory!.FullName, $"{Path.GetFileNameWithoutExtension(solutionFile.Name)}.AppHost")); 355var appHostPath = Path.Combine(workingDirectory.FullName, "apphost.cs"); 559.FirstOrDefault(pattern => File.Exists(Path.Combine(workingDirectory.FullName, pattern))); 567var displayPath = PathNormalizer.NormalizePathForStorage(Path.GetRelativePath(workingDirectory.FullName, appHostPath)); 605var configPath = Path.Combine(directory.FullName, AspireConfigFile.FileName); 865var path = Path.Combine(directory.FullName, fileName);
Commands\InstallationInfoOutput.cs (1)
123var binaryDir = Path.GetDirectoryName(processPath);
Commands\PipelineCommandBase.cs (9)
284var fullyQualifiedOutputPath = outputPath != null ? Path.GetFullPath(outputPath) : null; 1311fullPath = Path.GetFullPath(value); 1328return ValidationResult.Error($"'{Path.GetFileName(fullPath)}' exceeds the maximum size of {FormatHelpers.FormatFileSize(maxSize)}."); 1334var fileName = Path.GetFileName(fullPath); 1340return ValidationResult.Error($"'{Path.GetFileName(fullPath)}' does not match the accepted file types ({input.FileFilter})."); 1369filePaths.Add(Path.GetFullPath(value)); 1387return await UploadFilesAsync([Path.GetFullPath(singleValue)], backchannel, interactionId, inputName, cancellationToken); 1405var fullPath = Path.GetFullPath(filePath); 1406var fileName = Path.GetFileName(fullPath);
Commands\RenderCommand.cs (1)
450var filePath = Path.Combine(tempDirectory.FullName, "safe file link sample.txt");
Commands\RunCommand.cs (1)
498var appHostRelativePath = Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, effectiveAppHostFile.FullName);
Commands\Sdk\IntegrationAssemblyNameResolver.cs (1)
17var fallbackName = Path.GetFileNameWithoutExtension(projectFile.Name);
Commands\Sdk\SdkDumpCommand.cs (1)
361var outputPath = Path.Combine(outputDirectory.FullName, $"{integration.Name}.ats.txt");
Commands\Sdk\SdkGenerateCommand.cs (4)
170var outputDirFullPath = Path.GetFullPath(outputDir.FullName); 173var filePath = Path.GetFullPath(Path.Combine(outputDir.FullName, fileName)); 182var fileDirectory = Path.GetDirectoryName(filePath);
Commands\SetupCommand.cs (2)
108var binaryDir = Path.GetDirectoryName(processPath); 109return string.IsNullOrEmpty(binaryDir) ? null : Path.GetDirectoryName(binaryDir);
Commands\StopCommand.cs (2)
476var displayPath = Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, appHostFile.FullName); 923? Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, appHostPath)
Commands\StopCommand.TrayProtocol.cs (1)
57appHostFile is null || appHostArgument is null || !Path.IsPathFullyQualified(appHostArgument) ||
Commands\TerminalTapePlayCommand.cs (1)
93file = new FileInfo(Path.GetFullPath(tapePath, ExecutionContext.WorkingDirectory.FullName));
Commands\TestCommand.cs (1)
326Path.GetRelativePath(ExecutionContext.WorkingDirectory.FullName, appHostFile.FullName),
Commands\TrayLifecycleService.cs (16)
48!Path.IsPathFullyQualified(processPath) || !File.Exists(processPath)) 54cliPath = Path.GetFullPath(CliPathHelper.ResolveSymlinkOrOriginalPath(processPath, logger)); 67if (lease is null || layout?.GetDcpPath() is not { } dcpPath || Path.GetDirectoryName(dcpPath) is not { } bundleRoot || 68!Path.IsPathFullyQualified(bundleRoot)) 74if (trayPath is null || !Path.IsPathFullyQualified(trayPath) || !File.Exists(trayPath)) 81if (!string.Equals(trayPath, Path.Combine(bundleRoot, WindowsTrayPayload.ExecutablePath), StringComparison.OrdinalIgnoreCase)) 85WindowsTrayPayload.Validate(Path.GetDirectoryName(trayPath)!, 90if (!string.Equals(trayPath, Path.Combine(bundleRoot, LinuxTrayPayload.ExecutablePath), StringComparison.Ordinal)) 94LinuxTrayPayload.Validate(Path.GetDirectoryName(trayPath)!, 156var directory = Path.GetDirectoryName(resolvedPath)!; 157var source = InstallSidecarReader.ReadSourceField(Path.Combine(directory, InstallSidecarReader.SidecarFileName)); 165|| !string.Equals(Path.GetFileName(directory), "bin", StringComparison.OrdinalIgnoreCase) 172return Path.GetFullPath(invokingPath); 176=> Path.GetFullPath(path).Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar],
Commands\UpdateCommand.cs (10)
192var binaryDir = Path.GetDirectoryName(resolvedProcessPath); 198var sidecarPath = Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName); 957var installDir = Path.GetDirectoryName(currentExePath); 964var targetExePath = Path.Combine(installDir, exeName); 982var newExePath = Path.Combine(tempExtractDir, exeName); 995var exeDir = Path.GetDirectoryName(targetExePath)!; 1075CleanupDirectory(Path.GetDirectoryName(archivePath)!); 1087var pathSeparator = Path.PathSeparator; 1091string.Equals(Path.GetFullPath(p.Trim()), Path.GetFullPath(directory),
Completions\CompletionScripts.cs (1)
12var shell = Path.GetFileNameWithoutExtension(environment.GetEnvironmentVariable("SHELL"));
Configuration\AspireConfigFile.cs (12)
201var filePath = Path.Combine(directory, FileName); 229var filePath = Path.Combine(directory, FileName); 258var profiles = ReadApphostRunProfiles(Path.Combine(directory, "apphost.run.json")); 266if (config.AppHost?.Path is { Length: > 0 } migratedPath && !Path.IsPathRooted(migratedPath)) 268var legacySettingsDir = Path.Combine(directory, AspireJsonConfiguration.SettingsFolder); 270Path.Combine(legacySettingsDir, migratedPath)); 272Path.GetRelativePath(directory, absolutePath)); 444Path.GetFullPath(Path.Combine(configDirectory, entry.Path!))), 448Path.GetFullPath(Path.Combine(configDirectory, entry.Path!))), 461return File.Exists(Path.Combine(directory, FileName));
Configuration\AspireJsonConfiguration.cs (5)
107return Path.Combine(directory, SettingsFolder, FileName); 153var folderPath = Path.Combine(directory, SettingsFolder); 156var filePath = Path.Combine(folderPath, FileName); 234var absolutePath = Path.GetFullPath(Path.Combine(settingsDirectory, trimmedValue));
Configuration\ConfigSourceService.cs (19)
296var path = Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName); 311await ApplySourceAsync(source, Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), cancellationToken); 323?? Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName); 562DisplayConfigSourceDetails(source, Path.GetRelativePath(executionContext.WorkingDirectory.FullName, configPath)); 665return Path.Combine(executionContext.AspireHomeDirectory.FullName, "configsources", key); 689DirectoryHelper.CreateWithOwnerOnlyPermissions(Path.GetDirectoryName(cacheDirectory)!); 691using var cacheLock = await FileLock.AcquireAsync(Path.Combine(cacheDirectory, "cache.lock"), cancellationToken); 692var pointer = Path.Combine(cacheDirectory, "current"); 694var snapshotDirectory = Path.Combine(cacheDirectory, snapshotName); 695var temporaryPointer = Path.Combine(cacheDirectory, $"{snapshotName}.tmp"); 714await File.WriteAllTextAsync(Path.Combine(snapshotDirectory, AspireConfigFile.FileName), configuration.ToJsonString(), cancellationToken); 715await File.WriteAllTextAsync(Path.Combine(snapshotDirectory, "metadata.json"), 737if (directory != snapshotDirectory && Guid.TryParseExact(Path.GetFileName(directory), "N", out _)) 776DirectoryHelper.CreateWithOwnerOnlyPermissions(Path.GetDirectoryName(cacheDirectory)!); 778using var cacheLock = await FileLock.AcquireAsync(Path.Combine(cacheDirectory, "cache.lock"), cancellationToken); 779var path = Path.Combine(cacheDirectory, "check.json"); 939var repositoryDirectory = new GitRepositoryLocation(new DirectoryInfo(Path.Combine(directory, "repository.git")), IsBare: true); 972return ConfigurationHelper.WriteSettingsFileAtomicallyAsync(Path.Combine(directory, "check.json"), json, cancellationToken); 989var path = Path.TrimEndingDirectorySeparator(directory.FullName);
Configuration\ConfigurationService.cs (4)
132var newSettingsPath = Path.Combine(searchDirectory.FullName, AspireConfigFile.FileName); 153var defaultPath = Path.Combine(executionContext.WorkingDirectory.FullName, AspireConfigFile.FileName); 167var aspireConfigPath = Path.Combine(legacySettingsRootDirectory.FullName, AspireConfigFile.FileName); 404var configFilePath = Path.Combine(searchDirectory.FullName, AspireConfigFile.FileName);
Diagnostics\FileLoggerProvider.cs (3)
56return Path.Combine(logsDirectory, name); 89var directory = Path.GetDirectoryName(logFilePath); 94if (logsDirectory is not null && Path.GetRelativePath(logsDirectory, directory) == ".")
Documentation\DocumentationCacheKey.cs (2)
27var fallback = Path.GetFileNameWithoutExtension(trimmedUrl); 36? Path.GetFileNameWithoutExtension(rawSegments[i])
Documentation\FileBackedDocumentContentCache.cs (4)
22private readonly DirectoryInfo _diskCacheDirectory = new(Path.Combine(executionContext.CacheDirectory.FullName, subdirectory)); 252private string GetTextFilePath(string key) => Path.Combine(_diskCacheDirectory.FullName, $"{SanitizeFileName(key)}.txt"); 254private string GetETagFilePath(string key) => Path.Combine(_diskCacheDirectory.FullName, $"{SanitizeFileName(key)}.etag.txt"); 256private string GetJsonFilePath(string key) => Path.Combine(_diskCacheDirectory.FullName, $"{SanitizeFileName(key)}.json");
DotNet\DotNetAppHostNuGetConfigMerger.cs (4)
69targetFile ??= new FileInfo(Path.Combine(targetDirectory.FullName, "nuget.config")); 132targetFile.DirectoryName!, Path.GetDirectoryName(path)!)).ToArray(); 356? new DirectoryInfo(Path.GetDirectoryName(configPaths[0])!) 384var globalNuGetFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget");
DotNet\DotNetAppHostRestorePreview.cs (8)
92new XAttribute("Project", MSBuildEscaping.Escape(Path.GetFullPath(restoreTargets, Path.GetDirectoryName(path)!))), 103if (!BundleNuGetService.IsAncestorDirectory(candidate!.TargetFile.DirectoryName!, Path.GetDirectoryName(path)!)) 108new DirectoryInfo(Path.GetDirectoryName(path)!), 124preview._targetsFile = new FileInfo(Path.Combine( 159MSBuildEscaping.Escape(Path.TrimEndingDirectorySeparator(outputDirectory.FullName)) + Path.DirectorySeparatorChar 160+ "$([MSBuild]::StableStringHash('$(MSBuildProjectFullPath)'))" + Path.DirectorySeparatorChar),
DotNet\DotNetCliRunner.cs (23)
256: Path.GetFileNameWithoutExtension(CommandPathResolver.NormalizeRunCommand(commandOverride)); 370=> string.Equals(Path.GetFileNameWithoutExtension(CommandPathResolver.NormalizeRunCommand(command)), "dotnet", StringComparison.OrdinalIgnoreCase); 392var fullBinlogDirectory = Path.IsPathFullyQualified(binlogDirectory) 394: Path.GetFullPath(Path.Combine(workingDirectory.FullName, binlogDirectory)); 398var binlogPath = Path.Combine(fullBinlogDirectory, CreateBinlogFileName(dotnetCommand, projectFile, workingDirectory)); 413var scope = projectFile is not null ? Path.GetFileNameWithoutExtension(projectFile.Name) : workingDirectory.Name; 533var sdkInstallPath = Path.Combine(sdksDirectory, "dotnet", sdkVersion); 534var dotnetExecutablePath = Path.Combine( 548env["PATH"] = $"{sdkInstallPath}{Path.PathSeparator}{currentPath}"; 682var cliDirectory = Path.GetDirectoryName(processPath); 700var resolvedCliDirectory = Path.GetDirectoryName(resolvedProcessPath); 712return string.Equals(Path.GetFileNameWithoutExtension(processPath), "dotnet", StringComparison.OrdinalIgnoreCase); 717var cliAssemblyPath = Path.Combine(cliDirectory, "aspire.dll"); 732return File.Exists(Path.Combine(cliDirectory, ".aspire-install.json")); 737return HasBundleRoot(cliDirectory) || HasBundleRoot(Path.Combine(cliDirectory, "bundle")); 1204sourcePath = Path.GetFullPath(nugetSource, workingDirectory.FullName); 1207if (File.Exists(sourcePath) && string.Equals(Path.GetExtension(sourcePath), ".nupkg", StringComparison.OrdinalIgnoreCase)) 1219.FirstOrDefault(path => string.Equals(Path.GetFileName(path), expectedFileName, StringComparison.OrdinalIgnoreCase)); 1462var filePath = Path.IsPathRooted(configPath) 1464: Path.Combine(workingDirectory.FullName, configPath); 1789var projectPath = Path.IsPathRooted(line) 1791: Path.Combine(solutionFile.Directory!.FullName, line);
DotNet\DotNetRestoreConfiguration.cs (3)
82var defaultTargets = Path.Combine(GetProperty(properties, "MSBuildToolsPath"), "NuGet.targets"); 84!string.Equals(Path.GetFullPath(restoreTargets, projectFile.DirectoryName!), 85Path.GetFullPath(defaultTargets), StringComparisons.FileSystemPath))
Git\GitCommandRunner.cs (7)
214if (string.IsNullOrWhiteSpace(executable) || executable.IndexOfAny(Path.GetInvalidPathChars()) >= 0) 218var name = Path.GetFileName(executable); 236? $"!'{Path.Combine(Environment.SystemDirectory, "cmd.exe").Replace("\\", "/", StringComparison.Ordinal).Replace("'", "'\\''", StringComparison.Ordinal)}' /d /c set PATH" 277executable = Path.GetFullPath(resolved, gitStartInfo.WorkingDirectory); 312foreach (var directory in path.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 318directories.Add(Path.GetFullPath(directory, workingDirectory)); 327return string.Join(Path.PathSeparator, directories);
Git\GitHelpers.cs (1)
20var isLocal = Path.IsPathFullyQualified(repository);
Git\GitRepository.cs (4)
108var relativePath = Path.DirectorySeparatorChar == '/' 110: rawPath.Replace('/', Path.DirectorySeparatorChar); 112var absolutePath = Path.GetFullPath(Path.Combine(rootFullName, relativePath));
Git\GitWorktree.cs (18)
61var gitPath = Path.Combine(current, GitDirectoryName); 146var gitPath = Path.Combine(current, GitDirectoryName); 193var fullPath = Path.GetFullPath(startPath); 199var directory = Path.GetDirectoryName(fullPath); 212var adminParent = Directory.GetParent(Path.TrimEndingDirectorySeparator(canonicalAdminDirectory)); 221Path.Combine(canonicalAdminDirectory, GitDirFileName), 238Path.Combine(current.FullName, GitDirFileName), 244return Path.GetDirectoryName(CanonicalizePath(checkoutGitFile)); 267var metadataDirectory = Path.GetDirectoryName(canonicalGitFilePath); 329resolvedPath = Path.IsPathRooted(value) 330? Path.GetFullPath(value) 331: Path.GetFullPath(Path.Combine(relativeTo, value)); 360var root = Path.GetPathRoot(resolvedPath); 367[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 373var candidate = Path.Combine(current, segment); 385var entryName = Path.GetFileName(entry);
Layout\LayoutConfiguration.cs (5)
83return relativePath is not null ? Path.Combine(LayoutPath, relativePath) : null; 102return directory is null ? null : Path.Combine(directory, 118return Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)); 133return Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 143return directory is null ? null : Path.Combine(directory, BundleDiscovery.GetExecutableFileName(BundleDiscovery.TerminalHostExecutableName));
Layout\LayoutDiscovery.cs (26)
173var entries = Directory.GetFileSystemEntries(layoutPath).Select(Path.GetFileName).ToArray(); 213var cliDir = Path.GetDirectoryName(cliPath); 233var parentDir = Path.GetDirectoryName(cliDir); 250var bundlePath = Path.Combine(layoutPath, BundleDiscovery.BundleDirectoryName); 251var bundleManagedPath = Path.Combine(bundlePath, BundleDiscovery.ManagedDirectoryName); 252var bundleDashboardPath = Path.Combine(bundlePath, BundleDiscovery.DashboardDirectoryName); 253var bundleDcpPath = Path.Combine(bundlePath, BundleDiscovery.DcpDirectoryName); 265var bundleManagedExe = Path.Combine(bundleManagedPath, managedExeName); 266var bundleDashboardExe = Path.Combine(bundleDashboardPath, dashboardExeName); 269_logger.LogDebug(" {Dir}/{Dcp}/{Exe}: {Exists}", BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName, Path.GetFileName(bundleDcpExe), File.Exists(bundleDcpExe) ? "exists" : "MISSING"); 272TerminalHostPayload.IsValid(Path.Combine(bundlePath, BundleDiscovery.TerminalHostDirectoryName))) 280Dcp = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName), 281Dashboard = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DashboardDirectoryName), 282Managed = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.ManagedDirectoryName), 283AppHostServer = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.AppHostServerDirectoryName), 284TerminalHost = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.TerminalHostDirectoryName), 292var managedPath = Path.Combine(layoutPath, BundleDiscovery.ManagedDirectoryName); 293var dashboardPath = Path.Combine(layoutPath, BundleDiscovery.DashboardDirectoryName); 294var dcpPath = Path.Combine(layoutPath, BundleDiscovery.DcpDirectoryName); 308var managedExePath = Path.Combine(managedPath, managedExeName); 309var dashboardExePath = Path.Combine(dashboardPath, dashboardExeName); 312_logger.LogDebug(" dcp/{DcpExe}: {Exists}", Path.GetFileName(dcpExePath), File.Exists(dcpExePath) ? "exists" : "MISSING"); 315!TerminalHostPayload.IsValid(Path.Combine(layoutPath, BundleDiscovery.TerminalHostDirectoryName))) 339var relativePath = Path.Combine(bundleDirectory, OperatingSystem.IsWindows() 342return File.Exists(Path.Combine(layoutPath, relativePath)) ? relativePath : null; 380if (terminalHostPath is null || !TerminalHostPayload.IsValid(Path.GetDirectoryName(terminalHostPath)!))
Mcp\Tools\ListIntegrationsTool.cs (1)
158var appHostDirectory = Path.GetDirectoryName(appHostPath);
Mcp\Tools\SelectAppHostTool.cs (3)
66var displayPath = Path.GetFullPath( 67Path.IsPathRooted(appHostPath) 69: Path.Combine(executionContext.WorkingDirectory.FullName, appHostPath));
Migrations\TypeScriptAppHostMigration.cs (6)
101var modernAppHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, LegacyTypeScriptAppHost.ModernAppHostFileName)); 182var legacyModulesDir = Path.Combine(appHostDirectory.FullName, LanguageInfo.LegacyGeneratedFolderName); 192var configPath = Path.Combine(configDirectory.FullName, AspireConfigFile.FileName); 232var tsConfigPath = Path.Combine(appHostDirectory.FullName, TsConfigFileName); 280var packageJsonPath = Path.Combine(appHostDirectory.FullName, PackageJsonFileName); 325var configPath = Path.Combine(appHostDirectory.FullName, configFileName);
Npm\NpmRunner.cs (1)
121var tarballPath = Path.Combine(outputDirectory, filename);
NuGet\BundleNuGetService.cs (16)
147var restoreDirectory = Path.Combine( 150var objectDirectory = Path.Combine(restoreDirectory, "obj"); 151var manifestPath = Path.Combine(restoreDirectory, IntegrationPackageProbeManifest.FileName); 152var lockPath = Path.Combine(restoreDirectory, "restore.lock"); 194Path.Combine(objectDirectory, LockFileFormat.AssetsFileName), 360new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire")), 385? DirectoryHelper.CreateWithOwnerOnlyPermissions(Path.Combine( 439IsAncestorDirectory(Path.GetDirectoryName(path)!, targetFile.DirectoryName!) || 440!IsAncestorDirectory(Path.GetDirectoryName(path)!, workingDirectory.FullName)); 445new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire")), 453var relativePath = Path.GetRelativePath( 455return !Path.IsPathRooted(relativePath) && relativePath != ".." && 456!relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparisons.FileSystemPath); 613var assemblyPath = Path.Combine(AppContext.BaseDirectory, $"{typeof(BundleNuGetService).Assembly.GetName().Name}.dll"); 696new DirectoryInfo(Path.GetFullPath(workingDirectory))); 697return Path.Combine(integrationCacheDirectory.FullName, "package-restore");
NuGet\NuGetClient.cs (9)
315var projectPath = Path.Combine(outputPath, "project.json"); 394var graphPath = Path.Combine(outputPath, "RuntimeIdentifierGraph.json"); 441Name = Path.GetFileNameWithoutExtension(asset.RelativePath), 451FileName = Path.GetFileName(asset.RelativePath), 457var outputDirectory = Path.GetDirectoryName(outputPath); 827? Settings.LoadSpecificSettings(Path.GetDirectoryName(nugetConfigPath)!, Path.GetFileName(nugetConfigPath)) 1517Path.Combine(rootDirectory.FullName, "trustedroots")); 1547using var fileStream = File.Create(Path.Combine(destinationDirectory, resourceName));
NuGet\NuGetPackageAssetResolver.cs (23)
125return Path.Combine( 146var packagePath = Path.Combine(packagesPath, libraryName.ToLowerInvariant(), libraryVersion); 200var sourcePath = Path.Combine(packagePath, relativePath.Replace('/', Path.DirectorySeparatorChar)); 206var fileName = Path.GetFileName(sourcePath); 214var xmlSourcePath = Path.ChangeExtension(sourcePath, ".xml"); 217AddAsset(assets, packageId, packageVersion, xmlSourcePath, Path.ChangeExtension(fileName, ".xml"), isManagedAssembly: false, isNativeLibrary: false); 299return Path.IsPathRooted(runtimeIdentifierGraphPath) 301: Path.GetFullPath(runtimeIdentifierGraphPath, Path.GetDirectoryName(Path.GetFullPath(assetsPath))!); 332var sourcePath = Path.Combine(packagePath, runtimeTarget.Path.Replace('/', Path.DirectorySeparatorChar)); 363var sourcePath = Path.Combine(packagePath, resourceAssembly.Path.Replace('/', Path.DirectorySeparatorChar)); 371: Path.GetFileName(Path.GetDirectoryName(resourceAssembly.Path)); 383Path.Combine(locale, Path.GetFileName(sourcePath)), 404var sourcePath = Path.Combine(packagePath, nativeLib.Path.Replace('/', Path.DirectorySeparatorChar)); 410AddAsset(assets, packageId, packageVersion, sourcePath, Path.GetFileName(sourcePath), isManagedAssembly: false, isNativeLibrary: true); 449return string.Equals(Path.GetFileName(path), "_._", StringComparison.OrdinalIgnoreCase);
NuGet\TemporaryNuGetConfigFile.cs (5)
46directory = new DirectoryInfo(Path.Combine( 48$".aspire-nuget-config-{Path.GetRandomFileName()}")); 59var file = new FileInfo(Path.Combine( 60targetFile.DirectoryName!, $".aspire-nuget-candidate-{Path.GetRandomFileName()}.config")); 96var configFile = new FileInfo(Path.Combine(directory.FullName, "NuGet.Config"));
Packaging\NuGetSourceIdentity.cs (4)
40if (Path.IsPathFullyQualified(trimmed)) 70var normalized = Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Packaging\PackageChannel.cs (1)
1101var packageFileName = Path.GetFileNameWithoutExtension(packageFile);
Packaging\PackageSourceIdentity.cs (1)
14!Path.IsPathFullyQualified(trimmed);
Packaging\PackageSourceOverrideMappings.cs (4)
23if (Path.IsPathFullyQualified(source) || 29return Path.GetFullPath(source, workingDirectory.FullName); 175return uri.IsFile ? Path.GetFullPath(uri.LocalPath) : null; 178return Path.GetFullPath(trimmedSource);
Packaging\PackagingService.cs (4)
163prPackageChannels.Add(CreateLocalHiveChannel(prHive.Name, new DirectoryInfo(Path.Combine(prHive.FullName, "packages")))); 297var binaryDirectoryPath = Path.GetDirectoryName(Path.GetFullPath(processPath)); 324var packagesDirectory = new DirectoryInfo(Path.Combine(installPrefix.FullName, "hives", identityChannel, "packages"));
Profiling\ProfileCaptureOptions.cs (6)
71outputPath = Path.Combine(workingDirectory.FullName, CreateDefaultOutputFileName(timeProvider, sessionId)); 75if (!Path.IsPathRooted(outputPath)) 77outputPath = Path.Combine(workingDirectory.FullName, outputPath); 83if (Directory.Exists(outputPath) || Path.EndsInDirectorySeparator(outputPath)) 85outputPath = Path.Combine(outputPath, CreateDefaultOutputFileName(timeProvider, sessionId)); 90Path.GetFullPath(outputPath),
Profiling\ProfileCaptureService.cs (3)
190var managedExecutable = Path.Combine(managedPath, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)); 210var dashboardPath = Path.Combine( 337var outputDirectory = Path.GetDirectoryName(_options.OutputPath);
Program.cs (9)
137var logsDirectory = Path.Combine(GetUsersAspirePath(processPath), "logs"); 173var newPath = Path.Combine(usersAspirePath, Configuration.AspireConfigFile.FileName); 178var legacyPath = Path.Combine(usersAspirePath, "globalsettings.json"); 437? Path.GetDirectoryName(p) 607: new FileSystemTufCache(Path.Combine(executionContext.CacheDirectory.FullName, "tuf")); 790var hivesDirectory = Path.Combine(homeDirectory, "hives"); 797var sdksPath = Path.Combine(homeDirectory, "sdks"); 877var cacheDirectoryPath = Path.Combine(homeDirectory, "cache"); 884var packagesDirectoryPath = Path.Combine(homeDirectory, "packages");
Projects\AppHostCandidateFinder.cs (29)
76".agents", ".claude", Path.Combine(".github", "skills"), Path.Combine(".opencode", "skill"), 96name.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries) 226var relativeNative = Path.GetRelativePath(rootFullName, absolutePath); 235var relativeForwardSlash = Path.DirectorySeparatorChar == '/' 237: relativeNative.Replace(Path.DirectorySeparatorChar, '/'); 263var candidate = Path.GetFullPath(candidatePath); 264var ancestor = Path.GetFullPath(ancestorPath); 266|| candidate.StartsWith(ancestor + Path.DirectorySeparatorChar, pathComparison); 274if (Path.GetDirectoryName(includedPath) is { } directory) 276directories.Add(Path.GetFullPath(directory)); 285if (Path.GetDirectoryName(absolutePath) is not { Length: > 0 } absoluteDirectory) 294var relative = Path.GetRelativePath(rootFullName, absoluteDirectory); 303var segments = relative.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries); 413.Select(path => new FileInfo(Path.Combine(searchDirectory.FullName, path.Replace('/', Path.DirectorySeparatorChar)))) 442var normalizedPattern = pattern.Replace(Path.DirectorySeparatorChar, '/'); 443if (Path.AltDirectorySeparatorChar != Path.DirectorySeparatorChar) 445normalizedPattern = normalizedPattern.Replace(Path.AltDirectorySeparatorChar, '/'); 464var relativeDirectory = Path.GetDirectoryName(relativePath); 470var depth = relativeDirectory.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries).Length; 569return new MatcherDirectoryInfo(new DirectoryInfo(Path.Combine(_directory.FullName, path)), _options, _excludePath, _applyDirectoryExclusions, _pathComparison, _counters, _onDirectoryEnumerated, _depth + 1, _maxDepth, _cancellationToken); 574return new MatcherFileInfo(new FileInfo(Path.Combine(_directory.FullName, path)), _options, _excludePath, _applyDirectoryExclusions, _pathComparison, _counters, _onDirectoryEnumerated, _depth, _maxDepth, _cancellationToken); 590var directoryPath = Path.GetFullPath(directory.FullName); 592|| directoryPath.StartsWith(_excludePath + Path.DirectorySeparatorChar, _pathComparison);
Projects\AppHostServerClosureSnapshots.cs (22)
20public string IntegrationLibsPath => Path.Combine(LayoutPath, "libs"); 116var normalizedSourcePath = Path.GetFullPath(sourceFile.SourcePath); 159FileName = Path.GetFileName(entry.RelativePath), 172Name = Path.GetFileNameWithoutExtension(entry.RelativePath), 214var assemblyFileName = Path.GetFileName(normalizedPath); 220var culture = Path.GetFileName(Path.GetDirectoryName(normalizedPath)); 338var layoutsDirectory = Path.Combine(Path.GetFullPath(rootPath), LayoutRootFolderName); 339_itemsDirectory = Path.Combine(layoutsDirectory, LayoutItemsFolderName); 340_stagingDirectory = Path.Combine(layoutsDirectory, LayoutStagingFolderName); 381var libsPath = Path.Combine(layoutPath, "libs"); 382var manifestPath = Path.Combine(layoutPath, LayoutManifestFileName); 422var stagingPath = Path.Combine(_stagingDirectory, Guid.NewGuid().ToString("n")); 423var libsPath = Path.Combine(stagingPath, "libs"); 433var destinationPath = Path.Combine(libsPath, entry.RelativePath.Replace('/', Path.DirectorySeparatorChar)); 434var destinationDirectory = Path.GetDirectoryName(destinationPath); 443await WriteManifestFileAsync(Path.Combine(stagingPath, LayoutManifestFileName), manifest, cancellationToken).ConfigureAwait(false); 479return Path.Combine(_itemsDirectory, fingerprint); 497var copiedPath = Path.Combine(libsPath, entry.RelativePath.Replace('/', Path.DirectorySeparatorChar));
Projects\AppHostServerProject.cs (1)
118projectModelPath: temporary ? Path.Combine(appPath, "server") : null,
Projects\CSharpProjectFile.cs (1)
159var candidatePath = Path.Combine(repoRoot, "src", projectName, $"{projectName}.csproj");
Projects\DotNetAppHostProject.cs (18)
300var filePath = Path.Combine(current.FullName, fileName); 510if (Path.IsPathRooted(relativePath)) 728var filePath = Path.Combine(current.FullName, fileName); 906var normalized = importPath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 907fullPath = Path.GetFullPath(Path.Combine(containingDirectory, normalized)); 1324if (Path.GetFileNameWithoutExtension(projectFile.Name).EndsWith("AppHost", StringComparison.OrdinalIgnoreCase)) 2043var runtimeConfigPath = Path.ChangeExtension(resolvedTargetPath, ".runtimeconfig.json"); 2082=> Path.IsPathFullyQualified(path) ? path : Path.GetFullPath(Path.Combine(baseDirectory.FullName, path)); 2085=> string.Equals(Path.GetFileNameWithoutExtension(CommandPathResolver.NormalizeRunCommand(command)), "dotnet", StringComparison.OrdinalIgnoreCase); 2202var propertiesLaunchSettingsPath = Path.Combine(directory, propertiesDirectoryName, "launchSettings.json"); 2209var runJsonPath = Path.Combine(directory, $"{Path.GetFileNameWithoutExtension(projectFile.Name)}.run.json"); 2421Path.GetFullPath(Path.Combine(directoryName, config.AppHost.Path)));
Projects\DotNetBasedAppHostServerProject.cs (27)
69_repoRoot = Path.GetFullPath(repoRoot) + Path.DirectorySeparatorChar; 76_restoreRootConfigDirectory = restoreRootConfigDirectory is not null ? Path.GetFullPath(restoreRootConfigDirectory) : null; 91public string BuildPath => Path.Combine(_projectModelPath, BuildFolder); 98public string GetProjectFilePath() => Path.Combine(_projectModelPath, ProjectFileName); 104return Path.Combine(GetDefaultProjectModelPath(pathHash), ProjectFileName); 109appPath = new Uri(Path.GetFullPath(appPath)).LocalPath; 120return Path.Combine(CliPathHelper.GetAspireHomeDirectory(), AppsFolder, pathDir); 125var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName); 137var hashFilePath = Path.Combine(_projectModelPath, ProjectHashFileName); 199var appHostInTargets = Path.Combine(_repoRoot, "src", "Aspire.Hosting.AppHost", "build", "Aspire.Hosting.AppHost.in.targets"); 200var sdkInTargets = Path.Combine(_repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets"); 336var repoDirectoryPackagesProps = Path.Combine(_repoRoot, "Directory.Packages.props"); 348var projectFileName = Path.Combine(_projectModelPath, ProjectFileName); 416if (!File.Exists(Path.Combine(_projectModelPath, fileName))) 425if (!File.Exists(Path.Combine(_projectModelPath, "obj", "project.assets.json"))) 436var objPath = Path.Combine(_projectModelPath, "obj"); 458File.WriteAllText(Path.Combine(_projectModelPath, fileName), content); 461projectDocument.Save(Path.Combine(_projectModelPath, ProjectFileName)); 467var staleNugetConfig = Path.Combine(_projectModelPath, "nuget.config"); 498var projectFile = new FileInfo(Path.Combine(_projectModelPath, ProjectFileName)); 557var assemblyPath = Path.Combine(BuildPath, ProjectDllName); 698var workingDirFullPath = Path.GetFullPath(workingDirectory); 700var globalNuGetPath = Path.Combine(userProfile, ".nuget"); 706var configFullPath = Path.GetFullPath(configPath); 707var configDir = Path.GetDirectoryName(configFullPath); 750var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props");
Projects\FallbackProjectParser.cs (1)
333var fullPath = Path.GetFullPath(PathNormalizer.NormalizePathForStorage(include), projectFile.DirectoryName!);
Projects\GuestAppHostProject.cs (18)
176return new FileInfo(Path.Combine(directory.FullName, appHostFileName)); 1101var hostDir = Path.GetDirectoryName(integration.Path!)!; 1136var exitCodePath = Path.Combine(resultDirectory.FullName, "exit-code"); 1307var apphostRunPath = Path.Combine(directory.FullName, "apphost.run.json"); 1308var launchSettingsPath = Path.Combine(directory.FullName, "Properties", "launchSettings.json"); 2139var outputPath = Path.Combine(appPath, LanguageInfo.GeneratedFolderName); 2147outputPath = Path.Combine(appPath, LanguageInfo.LegacyGeneratedFolderName); 2163var filePath = Path.Combine(outputPath, fileName); 2164var directory = Path.GetDirectoryName(filePath); 2405var manifestPath = Path.Combine(outputPath, GeneratedManifestFileName); 2453var fullPath = Path.GetFullPath(Path.Combine(outputPath, recordedRelativePath)); 2457var root = Path.GetFullPath(outputPath); 2458if (!fullPath.StartsWith(root + Path.DirectorySeparatorChar, PathComparison)) 2478var hashPath = Path.Combine(generatedPath, ".codegen-hash"); 2729var existingBundlePath = Path.GetFullPath(existingCertificateBundle, workingDirectory.FullName); 2744var bundleDirectory = Path.Combine( 2748var bundlePath = Path.Combine(bundleDirectory, $"{cacheFilePrefix}-{bundleHash}.pem");
Projects\GuestRuntime.cs (8)
330return new FileInfo(Path.Combine(directory.FullName, resolved)); 352var path = Path.IsPathRooted(output) ? output : Path.Combine(directory.FullName, output); 369var path = Path.IsPathRooted(trimmed) ? trimmed : Path.Combine(directory.FullName, trimmed); 518var name = Path.GetFileName(directory.AsSpan()); 546var extension = Path.GetExtension(path); 637var filePath = Path.Combine(directory.FullName, fileName);
Projects\ILanguageDiscovery.cs (1)
81internal static string GeneratedFolderName { get; } = Path.Combine(".aspire", "modules");
Projects\IntegrationClosureBuilder.cs (11)
58projectFile.AddProperty("AspireClosureMetadataFile", Path.Combine(restoreDir, ClosureMetadataFileName)); 59projectFile.AddProperty("AspireClosureSourcesFile", Path.Combine(restoreDir, ClosureSourcesFileName)); 60projectFile.AddProperty("AspireClosureTargetsFile", Path.Combine(restoreDir, ClosureTargetsFileName)); 61projectFile.AddProperty("AspireProjectRefAssemblyNamesFile", Path.Combine(restoreDir, ProjectRefAssemblyNamesFileName)); 151new XElement("BaseOutputPath", CliPathHelper.EnsureTrailingSlash(Path.Combine(restoreDir, "bin"))), 179var path = Path.Combine(integrationCacheFullPath, "apphosts", hashFragment); 191return new DirectoryInfo(Path.Combine( 220var sourcesPath = Path.Combine(restoreDir, ClosureSourcesFileName); 221var metadataPath = Path.Combine(restoreDir, ClosureMetadataFileName); 222var targetsPath = Path.Combine(restoreDir, ClosureTargetsFileName); 283var path = Path.Combine(restoreDir, ProjectRefAssemblyNamesFileName);
Projects\IntegrationRestorePlan.cs (1)
426FileInfo? restoreOverlayFile = new(Path.Combine(policyDirectory.FullName, "NuGet.Config"));
Projects\JavaAppHostToolchainResolver.cs (40)
98private static string GradleInitScriptPath => GradleInitScriptRelativePath.Replace('/', Path.DirectorySeparatorChar); 133if (File.Exists(Path.Combine(candidate.FullName, MavenPomFileName))) 140if (File.Exists(Path.Combine(candidate.FullName, gradleBuildFileName))) 191var candidate = Path.Combine(directory.FullName, wrapperName); 206var gitPath = Path.Combine(directory.FullName, ".git"); 223JavaAppHostToolchain.Gradle => File.Exists(Path.Combine(directory, GradleSettingsFileName)) 224|| File.Exists(Path.Combine(directory, GradleKotlinSettingsFileName)), 227JavaAppHostToolchain.Maven => File.Exists(Path.Combine(directory, MavenPomFileName)), 318var wrapperDirectory = new DirectoryInfo(Path.GetDirectoryName(wrapperPath)!); 345var relativeWrapperPath = Path.GetRelativePath(appHostDirectory.FullName, wrapperPath); 350if (!Path.IsPathRooted(relativeWrapperPath)) 352relativeWrapperPath = Path.Combine(".", relativeWrapperPath); 444var scriptPath = Path.Combine(resolution.ProjectDirectory.FullName, GradleInitScriptPath); 446Directory.CreateDirectory(Path.GetDirectoryName(scriptPath)!); 503var dependencyDirectory = Path.Combine( 535var relativePath = Path.GetRelativePath(appHostDirectory.FullName, projectDirectory.FullName); 542return projectPath is null ? path : Path.Combine(projectPath, path); 559JavaAppHostToolchain.Maven => ["-f", Path.Combine(projectPath, MavenPomFileName)], 579var reactorPath = Path.GetRelativePath(appHostDirectory.FullName, invocation.WrapperDirectory.FullName); 580var modulePath = Path.GetRelativePath(invocation.WrapperDirectory.FullName, projectDirectory.FullName); 584"-f", Path.Combine(reactorPath, MavenPomFileName), 610var document = XDocument.Load(Path.Combine(aggregatorDirectory.FullName, MavenPomFileName)); 626var moduleDirectory = new DirectoryInfo(Path.GetFullPath(Path.Combine(aggregatorDirectory.FullName, modulePath))); 628|| (File.Exists(Path.Combine(moduleDirectory.FullName, MavenPomFileName)) 650JavaAppHostToolchain.Maven => Path.Combine("target", "classes"), 651JavaAppHostToolchain.Gradle => Path.Combine("build", "classes", "java", "main"), 660JavaAppHostToolchain.Maven => Path.Combine("target", DependencyDirectoryName), 661JavaAppHostToolchain.Gradle => Path.Combine("build", DependencyDirectoryName), 792Path.Combine("gradle", "libs.versions.toml") 816"-classpath", Path.Combine(dependencyDirectory, "*"), 828"-sourcepath", string.Join(Path.PathSeparator, ".", Path.Combine("src", "main", "java")), 860$"{CombineProjectPath(projectPath, Path.Combine("src", "main", "java"))}/**", 864.Select(output => Path.Combine(classesDirectory, Path.GetFileName(output))) 867StampFile = Path.Combine(classesDirectory, Path.GetFileName(baseCompile.UpToDateCheck.StampFile)) 877var classPath = string.Join(Path.PathSeparator, [classesDirectory, Path.Combine(dependencyDirectory, "*")]);
Projects\LegacyTypeScriptAppHost.cs (2)
41return File.Exists(Path.Combine(appPath, LegacyAppHostFileName)) && 42!File.Exists(Path.Combine(appPath, ModernAppHostFileName));
Projects\NativeAppHostServerProject.cs (13)
33if (!Path.IsPathFullyQualified(executable) || !File.Exists(executable)) 96var root = Path.GetDirectoryName(entryPoint)!; 97var descriptorPath = Path.Combine(root, "aspire.apphost-server.json"); 118var contract = Path.Combine(Path.GetDirectoryName(_executable)!, "ats-contract.json"); 124var generatedSdkDirectory = Path.Combine(_directory.FullName, $"sdk-{++_preparationCount}"); 125var requestPath = Path.Combine(_directory.FullName, "codegen-request.json"); 165await File.WriteAllTextAsync(Path.Combine(generatedSdkDirectory, "providers.json"), 175var path = Path.GetFullPath(relativePath, root); 176var relative = Path.GetRelativePath(root, path); 177if (Path.IsPathRooted(relativePath) || Path.IsPathRooted(relative) || 178relative == ".." || relative.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal) ||
Projects\PrebuiltAppHostServer.cs (17)
96_appDirectoryPath = Path.GetFullPath(appPath); 112_projectReferencePrepareLockPath = Path.Combine(_workingDirectory, "project-layouts", "prepare.lock"); 150var assemblyPath = hostingAssembly?.Path ?? (_integrationLibsPath is not null ? Path.Combine(_integrationLibsPath, "Aspire.Hosting.dll") : null); 249_integrationProbeManifestPath = Path.Combine(_workingDirectory, IntegrationPackageProbeManifest.FileName); 477var dependencyGraphSpecPath = Path.Combine( 479$"{Path.GetFileName(projectFilePath)}.nuget.dgspec.json"); 587var restoreDir = Path.Combine(_workingDirectory, "integration-restore"); 598var intermediateOutputPath = Path.Combine(restoreDir, "obj"); 616var projectFilePath = Path.Combine(restoreDir, IntegrationProjectFileName); 628Path.Combine(restoreDir, "Directory.Packages.props"), directoryPackagesProps, cancellationToken); 633Path.Combine(restoreDir, "Directory.Build.props"), 643Path.Combine(restoreDir, "Directory.Build.targets"), "<Project />", cancellationToken); 648var dependencyGraphSpecPath = Path.Combine( 650$"{Path.GetFileName(projectFilePath)}.nuget.dgspec.json"); 690Path.Combine(intermediateOutputPath, IntegrationClosureBuilder.ProjectAssetsFileName), 701Path.Combine(restoreDir, ClosureManifestFileName), 1011Path.Combine(contentRootPath, "appsettings.json"),
Projects\ProjectLocator.cs (28)
570var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, appHostProject.AppHostFile.FullName); 577var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, appHostProject.AppHostFile.FullName); 584var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, unsupportedProject.FullName); 663var prefix = directoryPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar; 733var configFilePath = Path.Combine(searchDirectory.FullName, AspireConfigFile.FileName); 745var qualifiedPath = Path.IsPathRooted(configAppHostPath) 747: Path.Combine(searchDirectory.FullName, configAppHostPath); 802var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath); 892if (path.Length == 0 || path.Contains('\0') || path.IndexOfAny(Path.GetInvalidPathChars()) >= 0) 1035file => $"{file.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName).EscapeMarkup()})", 1238MultipleAppHostProjectsFoundBehavior.Prompt => await interactionService.PromptForSelectionAsync(InteractionServiceStrings.SelectAppHostToUse, results.BuildableAppHost.Select(c => c.AppHostFile).ToList(), projectFile => $"{projectFile.Name.EscapeMarkup()} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName).EscapeMarkup()})", cancellationToken: cancellationToken), 1337Path.IsPathRooted(existingPath) ? existingPath : Path.Combine(settingsFile.Directory!.FullName, existingPath)); 1363var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/'); 1388var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/'); 1400var configDirectoryPath = Path.GetDirectoryName(configPath)!; 1404var trimmedConfigDirectoryPath = configDirectoryPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 1405if (string.Equals(Path.GetFileName(trimmedConfigDirectoryPath), ".aspire", StringComparison.OrdinalIgnoreCase) && 1408targetSettingsFilePath = Path.Combine(parentDirectory.FullName, AspireConfigFile.FileName); 1424var newConfigPath = Path.Combine(configRoot.FullName, AspireConfigFile.FileName); 1464return Path.GetFullPath(Path.Combine(userProfile, ".nuget", "packages"));
Projects\ProjectUpdater.cs (7)
573new(Path.Combine(configRoot.FullName, AspireConfigFile.FileName)) 854candidates.Add(Path.GetFullPath(path, projectFile.Directory!.FullName)); 1574var directoryPackagesPropsPath = Path.Combine(current.FullName, "Directory.Packages.props"); 2059var root = Path.Combine(aspireHomeDirectory.FullName, "cache", "update-validation"); 2083internal string PackagesDirectory => Path.Combine(Directory.FullName, "packages"); 2087["NUGET_HTTP_CACHE_PATH"] = Path.Combine(Directory.FullName, "http-cache"), 2088["NUGET_FALLBACK_PACKAGES"] = Path.Combine(Directory.FullName, "fallback-packages")
Projects\RepositoryToolUpdater.cs (3)
46foreach (var path in new[] { Path.Combine(current.FullName, ".config", "dotnet-tools.json"), Path.Combine(current.FullName, "dotnet-tools.json") }) 69var manifest = await ReadManifestAsync(Path.Combine(current.FullName, "package.json"), isNpm: true, cancellationToken);
Projects\SolutionLocator.cs (2)
43solutionFile => $"{solutionFile.Name.EscapeMarkup()} ({Path.GetRelativePath(startDirectory.FullName, solutionFile.FullName).EscapeMarkup()})", 87.OrderBy(f => f.Directory?.FullName.Count(c => c == Path.DirectorySeparatorChar) ?? 0)
Projects\TypeScriptAppHostToolchainResolver.cs (14)
63if (File.Exists(Path.Combine(candidateDirectory.FullName, BunLockFileName))) 68if (File.Exists(Path.Combine(candidateDirectory.FullName, BunBinaryLockFileName))) 73if (File.Exists(Path.Combine(candidateDirectory.FullName, PnpmLockFileName))) 78var yarnLockFilePath = Path.Combine(candidateDirectory.FullName, YarnLockFileName); 89if (File.Exists(Path.Combine(candidateDirectory.FullName, YarnConfigFileName))) 94if (File.Exists(Path.Combine(candidateDirectory.FullName, DenoLockFileName))) 99if (File.Exists(Path.Combine(candidateDirectory.FullName, DenoJsonFileName))) 104if (File.Exists(Path.Combine(candidateDirectory.FullName, DenoJsoncFileName))) 109if (File.Exists(Path.Combine(candidateDirectory.FullName, PackageLockFileName))) 355var packageJsonPath = Path.Combine(appHostDirectory.FullName, PackageJsonFileName); 503var parentPath = Path.TrimEndingDirectorySeparator(parentDirectory.FullName); 504if (string.Equals(parentPath, Path.TrimEndingDirectorySeparator(parentDirectory.Root.FullName), pathComparison)) 511!string.Equals(parentPath, Path.TrimEndingDirectorySeparator(Path.GetFullPath(homeDirectory)), pathComparison);
Scaffolding\ScaffoldingService.cs (23)
207var filePath = Path.Combine(scaffoldDirectory.FullName, fileName); 208var fileDirectory = Path.GetDirectoryName(filePath); 265var appHostRunPath = Path.Combine(scaffoldDirectory.FullName, "apphost.run.json"); 291if (IsTypeScriptLanguage(language) && File.Exists(Path.Combine(directory.FullName, PackageJsonFileName))) 295return new DirectoryInfo(Path.Combine(directory.FullName, BrownfieldTypeScriptAppHostDirectoryName)); 299File.Exists(Path.Combine(directory.FullName, "go.mod"))) 302return new DirectoryInfo(Path.Combine(directory.FullName, "aspire-apphost")); 312return Path.Combine(scaffoldDirectory.FullName, appHostFileName); 318rootDirectory.FullName.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 319scaffoldDirectory.FullName.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 324var packageJsonPath = Path.Combine(rootDirectory.FullName, PackageJsonFileName); 341var relativeAppHostDirectory = PathNormalizer.NormalizePathForStorage(Path.GetRelativePath(rootDirectory.FullName, appHostDirectory.FullName)); 394language.MatchesFile(Path.GetFileName(fileName))); 399Path.GetRelativePath(rootDirectory.FullName, Path.Combine(scaffoldDirectory.FullName, appHostFileName))); 521var outputPath = Path.Combine(directoryPath, LanguageInfo.GeneratedFolderName); 526var filePath = Path.Combine(outputPath, fileName); 527var fileDirectory = Path.GetDirectoryName(filePath); 589var filePath = Path.Combine(rootDirectory, fileName); 635=> Path.GetFileName(fileName).Equals(".gitignore", StringComparison.Ordinal); 638=> Path.GetFileName(fileName).Equals(PackageJsonFileName, StringComparison.OrdinalIgnoreCase);
Secrets\AspireSecretsStoreResolver.cs (2)
175var environment = Path.GetFileNameWithoutExtension(file); 228var environment = Path.GetFileNameWithoutExtension(sourceFile);
src\Shared\AspireHomeDirectory.cs (1)
32? Path.Combine(userProfileDirectory, ".aspire")
src\Shared\BackchannelConstants.cs (9)
106=> Path.Combine(homeDirectory, SocketDirectoryNames.Aspire, SocketDirectoryNames.Cli, SocketDirectoryNames.Backchannels); 114=> Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 260var socketPath = Path.Combine(dir, $"{appHostId}{instanceId}.{processId.ToString(CultureInfo.InvariantCulture)}"); 278var socketPath = Path.Combine(dir, socketName); 316return Path.Combine(dir, appHostId); 360var fileName = Path.GetFileName(socketPath); 395var fileName = Path.GetFileName(socketPath); 541var fileName = Path.GetFileName(f); 569var fileName = Path.GetFileName(f);
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\ChildProcess.cs (1)
133_completionPath = Path.Combine(_completionDirectory.FullName, "exit-code");
src\Shared\CommandPathResolver.cs (1)
93return Path.GetFileNameWithoutExtension(command);
src\Shared\Export\ExportArchive.cs (1)
131var invalidChars = Path.GetInvalidFileNameChars();
src\Shared\FileLock.cs (1)
163var directory = Path.GetDirectoryName(lockPath);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\IntegrationPackageProbeManifest.cs (3)
220var normalizedFileName = Path.GetFileName(libraryName); 221var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(normalizedFileName); 358return Path.GetFullPath(path);
src\Shared\LinuxTrayPayload.cs (3)
24if (File.Exists(Path.ChangeExtension(path, ".runtimeconfig.json"))) 51var executable = Path.Combine(directory, ExecutableName); 60using var icon = File.OpenRead(Path.Combine(directory, IconName));
src\Shared\Model\ResourceSourceViewModel.cs (2)
24return new ResourceSource(Path.GetFileName(projectPath), projectPath, KnownProperties.Project.Path); 37return new ResourceSource(Path.GetFileName(executablePath), executablePath, KnownProperties.Executable.Path);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
src\Shared\PrivateTemporaryStorage.cs (14)
28return _session.Value.Path + Path.DirectorySeparatorChar; 33var path = Path.Combine(GetTempPath(), Path.GetRandomFileName()); 41if (prefix.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 || 42prefix.Contains(Path.DirectorySeparatorChar) || prefix.Contains(Path.AltDirectorySeparatorChar)) 47return CreatePrivateDirectory(Path.Combine(GetTempPath(), prefix + Path.GetRandomFileName())); 79var session = Path.Combine(root, Path.GetRandomFileName()); 86using var marker = CreateFile(Path.Combine(session, ".preserve")); 100if (!Path.IsPathFullyQualified(home) || !Directory.Exists(Path.GetDirectoryName(home))) 106var root = Path.Combine(home, "tmp");
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
src\Shared\ProcessSupervisor.cs (2)
49var isDotnet = Path.GetFileNameWithoutExtension(executable).Equals("dotnet", StringComparison.OrdinalIgnoreCase); 52arguments[0] = Path.GetFullPath(arguments[0]);
src\Shared\SocketPermissionHelper.cs (8)
39var directory = new DirectoryInfo(Path.GetFullPath(path, currentDirectory)); 40var tempRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(tempDirectory, currentDirectory)); 43: Path.TrimEndingDirectorySeparator(Path.GetFullPath(userProfileDirectory, currentDirectory)); 46var isWorkingDirectory = string.Equals(directory.FullName, Path.TrimEndingDirectorySeparator(currentDirectory), comparison); 48var isTemporaryRoot = string.Equals(Path.TrimEndingDirectorySeparator(directory.FullName), tempRoot, comparison); 113var directory = Path.GetDirectoryName(socketPath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
src\Shared\Telemetry\AspireTelemetryExporter.cs (1)
18return Path.Combine(
src\Shared\Telemetry\InternalMicrosoftDetector.cs (10)
72Path.Combine(cacheDirectory.FullName, CacheSubdirectoryName, CacheFileName), 553var directory = Path.GetDirectoryName(_cacheFilePath); 559var tempPath = Path.Combine(directory, $"{Path.GetRandomFileName()}.tmp"); 639var accountStore = Path.Combine(localAppData, ".IdentityService", "V3AccountStore.json"); 905var copilotHome = Path.Combine(_homeDirectory.FullName, ".copilot"); 1582var path = Path.Combine(directory, fileName); 1631var extensions = _environment.IsWindows() && string.IsNullOrEmpty(Path.GetExtension(command)) 1635foreach (var directory in path.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 1639var candidate = Path.Combine(directory, command + extension);
src\Shared\Telemetry\LinuxMachineInformationProvider.cs (1)
38userDir = Path.Combine(rootPath, SecondaryPathSubDirectory);
src\Shared\Telemetry\MacOSXMachineInformationProvider.cs (1)
43var subdirectoryPath = Path.Combine(userDir, "Library", "Application Support");
src\Shared\Telemetry\TelemetryMetadata.cs (1)
40new DirectoryInfo(Path.Combine(AspireHomeDirectory.GetDefault(), "cache")),
src\Shared\Telemetry\UnixMachineInformationProvider.cs (3)
28cachePath = Path.Combine(GetStoragePath(), MicrosoftDirectory, DeveloperToolsDirectory); 83var fullPath = Path.Combine(directoryPath, fileName); 107var path = Path.Combine(directoryPath, fileName);
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
src\Shared\TerminalHostPayload.cs (2)
33=> GetRequiredFiles(rid).All(file => File.Exists(Path.Combine(directory, file)) && new FileInfo(Path.Combine(directory, file)).Length > 0);
src\Shared\UserSecrets\AspireSecretsPathHelper.cs (3)
32.Where(path => string.Equals(Path.GetFileName(path), $"{environmentName}.json", StringComparison.OrdinalIgnoreCase)) 45return Path.Combine(directory, $"{environmentName}.json"); 83return Path.Combine(homeDirectory.FullName, ".aspire", SecretsDirectoryName, safeAppHostId);
src\Shared\UserSecrets\IsolatedUserSecretsHelper.cs (2)
36var isolatedSecretsDir = Path.GetDirectoryName(isolatedSecretsPath); 62var secretsDir = Path.GetDirectoryName(secretsPath);
src\Shared\UserSecrets\SecretsStore.cs (3)
116var directory = Path.GetDirectoryName(filePath); 135var tempFilename = Path.Combine(directory, $".{Path.GetFileName(filePath)}.{Guid.NewGuid():N}.tmp");
src\Shared\UserSecrets\UserSecretsPathHelper.cs (2)
52? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 53: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
src\Shared\WindowsTrayPayload.cs (2)
28var path = Path.Combine(directory, name); 38using var stream = File.OpenRead(Path.Combine(directory, ExecutableName));
Telemetry\AgentTelemetryUploader.cs (2)
19internal static string LockPath => Path.Combine(Path.GetDirectoryName(AspireTelemetryExporter.GetTelemetryStoragePath("cli"))!, LockFileName);
Telemetry\ProfilingTelemetry.cs (2)
782var executableName = Path.GetFileName(executablePath); 1025public void SetBackchannelSocketFile(string socketPath) => SetTag(Tags.BackchannelSocketFile, Path.GetFileName(socketPath));
Templating\CliTemplateFactory.cs (9)
338var relativePath = resourceName[resourcePrefix.Length..].Replace('/', Path.DirectorySeparatorChar); 339var filePath = Path.Combine(outputPath, relativePath); 340var fileDirectory = Path.GetDirectoryName(filePath); 350if (s_binaryTemplateExtensions.Contains(Path.GetExtension(filePath))) 360if (s_osLineBreakTemplateFileNames.Contains(Path.GetFileName(filePath))) 377if (_environment.IsWindows() || !s_executableTemplateFileNames.Contains(Path.GetFileName(filePath))) 400var relativePath = Path.GetRelativePath(currentDir, outputPath); 406if (!string.Equals(Path.GetFullPath(currentDir), Path.GetFullPath(outputPath), pathComparison))
Templating\CliTemplateFactory.EmptyTemplate.cs (1)
153var aspireConfigPath = Path.Combine(outputPath, Configuration.AspireConfigFile.FileName);
Templating\CliTemplateFactory.GoStarterTemplate.cs (1)
90var appHostProject = _projectFactory.TryGetProject(new FileInfo(Path.Combine(outputPath, "apphost.go")));
Templating\CliTemplateFactory.JavaStarterTemplate.cs (1)
77var appHostProject = _projectFactory.TryGetProject(new FileInfo(Path.Combine(outputPath, "AppHost.java")));
Templating\CliTemplateFactory.PythonStarterTemplate.cs (1)
91var appHostProject = _projectFactory.TryGetProject(new FileInfo(Path.Combine(outputPath, "apphost.mts")));
Templating\CliTemplateFactory.TypeScriptStarterTemplate.cs (1)
75var appHostProject = _projectFactory.TryGetProject(new FileInfo(Path.Combine(outputPath, "apphost.mts")));
Templating\DotNetTemplateFactory.cs (3)
108var sdkInstallPath = Path.Combine(executionContext.SdksDirectory.FullName, "dotnet", DotNetSdkInstaller.MinimumSdkVersion); 118foreach (var directory in pathVariable.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 122if (File.Exists(Path.Combine(directory, dotnetFileName)))
Templating\OutputPathHelper.cs (10)
37return Path.GetFullPath(outputPath, workingDirectory); 52if (!IsNonEmptyDirectory(Path.GetFullPath(baseCandidate, workingDirectory))) 60if (!IsNonEmptyDirectory(Path.GetFullPath(candidate, workingDirectory))) 134var fullPath = Path.GetFullPath(path, workingDirectory); 146var normalizedOutputPath = Path.TrimEndingDirectorySeparator(outputPath); 147return string.Equals(Path.GetFileName(normalizedOutputPath), projectName, StringComparison.OrdinalIgnoreCase) 149: Path.Combine(normalizedOutputPath, projectName); 158var invalidChars = Path.GetInvalidPathChars(); 165return path.AsSpan().IndexOfAny(Path.GetInvalidPathChars()) >= 0; 170return Path.IsPathRooted(fullPath) && Directory.Exists(fullPath) && Directory.EnumerateFileSystemEntries(fullPath).Any();
Templating\TemplateEngineFactory.cs (11)
59? Path.GetFullPath(source.Path, executionContext.WorkingDirectory.FullName) 150var cacheRoot = Path.Combine(executionContext.CacheDirectory.FullName, "git"); 151var pathRoot = Path.Combine(cacheRoot, "repository"); 173var cacheDirectory = Path.Combine(cacheRoot, key); 187var repositoryRoot = new DirectoryInfo(Path.Combine(checkout.FullName, "repository")); 192Directory.Move(Path.Combine(repositoryRoot.FullName, ".git"), Path.Combine(checkout.FullName, ".git")); 232if (!Path.IsPathRooted(repository) && !repository.Contains(':')) 234var localPath = Path.GetFullPath(repository, executionContext.WorkingDirectory.FullName); 279var repositoryRoot = Path.Combine(checkout, "repository"); 280var fullPath = Path.GetFullPath(relativePath, repositoryRoot);
Templating\TemplateEngineFactory.NuGetValues.cs (6)
34var parent = Directory.GetParent(Path.TrimEndingDirectorySeparator(outputPath))!.FullName; 132var path = Path.GetFullPath(relativePath, root); 133var relative = Path.GetRelativePath(root, path); 134if (Path.IsPathRooted(relativePath) || relative == ".." || 135relative.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal) || 165configs.Add(Path.GetRelativePath(root, config.FullName), File.ReadAllBytes(config.FullName));
Templating\TemplateEngineHost.cs (2)
84path.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar])
Templating\TemplateNuGetConfigService.cs (2)
243AppHostWorkloadId.Create(Path.GetFullPath(logicalOutputPath)), 248var targetFile = new FileInfo(Path.Combine(outputDirectory.FullName, "nuget.config"));
Templating\TemplateSource.cs (6)
14[System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar], 31var relativePath = System.IO.Path.GetRelativePath(basePath, System.IO.Path.GetFullPath(path, basePath)); 32if (System.IO.Path.IsPathRooted(path) || relativePath == ".." || 33relativePath.StartsWith($"..{System.IO.Path.DirectorySeparatorChar}", StringComparison.Ordinal))
Templating\TemplateSourceConfiguration.cs (2)
101if (reference is null && Path.IsPathFullyQualified(path)) 159TemplateSource.GetRepositoryRelativePath(path, Path.GetFullPath("."));
Templating\TemplateSourceStore.cs (1)
80if (Path.GetFileName(path).Equals("globalsettings.json", StringComparison.OrdinalIgnoreCase))
Testing\TestRunReporter.cs (7)
43public string SummaryPath => Path.Combine(OutputPath, "summary.json"); 61var parent = Path.Combine(executionContext.AspireHomeDirectory.FullName, "testruns"); 68var reservation = Path.Combine(parent, $".{id}.reserve"); 69var outputPath = Path.Combine(parent, id); 441var temporaryPath = Path.Combine(OutputPath, $".summary-{Guid.NewGuid():N}.tmp"); 498RunId = Path.GetFileName(OutputPath), 617string.Equals(current.FullName, Path.TrimEndingDirectorySeparator(TemporaryStorage.SystemTempPath), comparison))
Utils\AppHostHelper.cs (2)
75var relativePath = Path.GetRelativePath(workingDirectory.FullName, projectFile.FullName); 89var relativePath = Path.GetRelativePath(workingDirectory.FullName, projectFile.FullName);
Utils\ArchiveHelper.cs (15)
38var normalizedDestination = Path.GetFullPath(destinationPath); 48var fullPath = Path.GetFullPath(Path.Combine(destinationPath, entry.FullName)); 49if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 61var dir = Path.GetDirectoryName(fullPath); 73var normalizedDestination = Path.GetFullPath(destinationPath); 86var fullPath = Path.GetFullPath(Path.Combine(destinationPath, entry.Name)); 89if (!fullPath.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 102var dir = Path.GetDirectoryName(fullPath); 122var linkTarget = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(fullPath)!, entry.LinkName)); 123if (!linkTarget.StartsWith(normalizedDestination + Path.DirectorySeparatorChar, StringComparison.Ordinal) && 128var linkDir = Path.GetDirectoryName(fullPath);
Utils\AspireRepositoryDetector.cs (6)
71return Path.GetFullPath(envRoot); 77repoRoot = FindRepositoryRoot(Path.GetDirectoryName(processPath)); 97if (File.Exists(Path.Combine(currentDirectory, AspireSolutionFileName))) 110var fullPath = Path.GetFullPath(path); 119return Path.GetDirectoryName(fullPath)!; 122var parentDirectory = Path.GetDirectoryName(fullPath);
Utils\CliDownloader.cs (3)
69var archivePath = Path.Combine(tempDir, archiveFilename); 70var checksumPath = Path.Combine(tempDir, checksumFilename); 116var fileName = Path.GetFileName(uri.AbsolutePath);
Utils\CliPathHelper.cs (22)
68var tempRoot = DirectoryHelper.CreateWithOwnerOnlyPermissions(Path.Combine(aspireHomeDirectory.FullName, "tmp")); 69var sdkRoot = DirectoryHelper.CreateWithOwnerOnlyPermissions(Path.Combine(tempRoot.FullName, "sdk")); 70var directory = DirectoryHelper.CreateWithOwnerOnlyPermissions(Path.Combine(sdkRoot.FullName, Guid.NewGuid().ToString("N"))); 75File.WriteAllText(Path.Combine(directory.FullName, Configuration.AspireConfigFile.FileName), "{}"); 105return Path.Combine(aspireHomeDirectory.FullName, StagingNuGetPackagesFolderName); 109=> Path.EndsInDirectorySeparator(path) 111: path + Path.DirectorySeparatorChar; 120/// <see cref="Path.GetFullPath(string)" />. Matching that normalization keeps cache identities 132return Path.GetFullPath(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 150return Path.Combine(GetStagingNuGetPackagesDirectory(aspireHomeDirectory), cacheKey); 211var binaryDir = Path.GetDirectoryName(realBinaryPath); 217var sidecarPath = Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName); 223or InstallSourceExtensions.LocalHiveWire => Path.GetDirectoryName(binaryDir) ?? binaryDir, 231var prDir = Path.GetDirectoryName(binaryDir); 237var dogfoodDir = Path.GetDirectoryName(prDir); 239!string.Equals(Path.GetFileName(dogfoodDir), InstallationDiscoveryLayout.DogfoodDirectoryName, StringComparison.Ordinal)) 244return Path.GetDirectoryName(dogfoodDir); 294return MaybeStripMacOSFirmlinkPrefix(Path.GetFullPath(path)); 318/// <see cref="Path.GetFullPath(string)"/>, <c>$PATH</c> walks via 445var socketDirectory = Path.GetDirectoryName(socketPath)!;
Utils\ConfigurationHelper.cs (11)
52var newSettingsPath = Path.Combine(currentDirectory.FullName, AspireConfigFile.FileName); 105? new FileInfo(Path.Combine(settingsFile.Directory!.FullName, AspireConfigFile.FileName)) 122var lockPath = Path.Combine(cacheDirectory.FullName, "workspace-config-locks", $"{lockFileName}.lock"); 138return Path.Combine(workingDirectory, ".aspire", "settings.json"); 185return new DirectoryInfo(Path.Combine(configRoot.FullName, AspireJsonConfiguration.SettingsFolder)); 191return new DirectoryInfo(Path.Combine(workspaceAspireDirectory.FullName, IntegrationCacheFolderName)); 204var configPath = Path.Combine(searchDir.FullName, AspireConfigFile.FileName); 369var temporaryPath = Path.Combine(Path.GetDirectoryName(filePath)!, $".{Path.GetFileName(filePath)}.{Guid.NewGuid():N}.tmp"); 723var directory = Path.GetDirectoryName(filePath);
Utils\DotNetToolDetection.cs (11)
144if (!IsAspireExecutable(Path.GetFileName(processPath))) 149var processDirectory = Path.GetDirectoryName(processPath); 155var storeDirectory = Path.Combine(processDirectory, ".store"); 169if (!IsAspireExecutable(Path.GetFileName(candidatePath))) 189var processDirectory = Path.GetDirectoryName(NormalizeDirectorySeparators(processPath)); 202var currentDirectory = Path.GetDirectoryName(NormalizeDirectorySeparators(processPath)); 205if (string.Equals(Path.GetFileName(currentDirectory), ".store", StringComparison.OrdinalIgnoreCase)) 207var parentDirectory = Path.GetDirectoryName(currentDirectory); 217currentDirectory = Path.GetDirectoryName(currentDirectory); 226return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar);
Utils\EnvironmentChecker\AspireVersionCheck.cs (1)
420return Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName);
Utils\EnvironmentChecker\DcpConnectionChecker.cs (3)
249var kubeconfigPath = Path.Combine(sessionDirectory, "kubeconfig"); 277var extensionsPath = Path.Combine(dcpDirectory, "ext"); 565var keyPath = Path.ChangeExtension(certificatePath, ".key");
Utils\EnvironmentChecker\DcpDeveloperCertificateCache.cs (3)
22if (!Path.IsPathFullyQualified(cacheDirectory)) 28var certificatePath = Path.Combine(cacheDirectory, $"{lookup}.crt"); 29var keyPath = Path.ChangeExtension(certificatePath, ".key");
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (1)
46var configPath = Path.Combine(workingDirectory.FullName, location.RelativePath);
Utils\EnvironmentChecker\DevCertsCheck.cs (3)
293var certificateFile = Path.Combine(trustPath, certificateFileName); 379var hashEntryPath = Path.Combine(trustPath, $"{hash}.{i}"); 411var workingDirectory = Path.GetDirectoryName(certificateFile) is { } directory
Utils\EnvironmentChecker\LegacySettingsFileCheck.cs (1)
40var modernConfigPath = Path.Combine(searchDir.FullName, AspireConfigFile.FileName);
Utils\EnvironmentChecker\VsCodeExtensionCheck.cs (5)
162yield return Path.Combine(home, ".vscode", "extensions"); 163yield return Path.Combine(home, ".vscode-insiders", "extensions"); 164yield return Path.Combine(home, ".vscode-server", "extensions"); 165yield return Path.Combine(home, ".vscode-server-insiders", "extensions"); 193if (IsVersionedExtensionFolder(Path.GetFileName(directory)))
Utils\FileSystemHelper.cs (6)
74var targetFilePath = Path.Combine(currentDestination, file.Name); 81var targetSubDir = Path.Combine(currentDestination, subDir.Name); 173var extension = Path.GetExtension(fileName); 179? Path.Combine(segments[^2], segments[^1]) 212var candidate = Path.Combine(segments[^newDepth..]); 219if (firstCandidateSegment.Length == 0 || Path.IsPathRooted(firstCandidateSegment))
Utils\FirstTimeUseNoticeSentinel.cs (2)
21_sentinelFilePath = Path.Combine(aspireUserDirectory, "cli", SentinelFileName); 38var directory = Path.GetDirectoryName(_sentinelFilePath);
Utils\MarkupHelpers.cs (1)
100var fileUri = new Uri(Path.GetFullPath(filePath)).AbsoluteUri;
Utils\ReparsePoint.cs (11)
298var parent = Path.GetDirectoryName(linkPath) ?? "."; 299var name = Path.GetFileName(linkPath); 301return Path.Combine(parent, $"{name}.new.{suffix}"); 307if (Path.IsPathFullyQualified(normalizedTarget)) 309return Path.GetFullPath(normalizedTarget); 312var linkParent = Path.GetDirectoryName(Path.GetFullPath(linkPath)) ?? "."; 313return Path.GetFullPath(Path.Combine(linkParent, normalizedTarget)); 349var substituteName = @"\??\" + target.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Utils\TemporaryCacheDirectory.cs (1)
40var fullName = Path.Combine(parentDirectory, $".{prefix}-{Guid.NewGuid():N}");
aspire-managed (30)
AppHostServerV2CodeGeneration.cs (1)
20await File.WriteAllTextAsync(Path.Combine(input.Output, name), content).ConfigureAwait(false);
AppHostServerV2CodeGenerationInput.cs (1)
44if (Path.GetFileName(name) != name || !name.EndsWith(".mts", StringComparison.Ordinal) ||
Program.cs (3)
77var dashboardDirectory = Path.GetFullPath(Path.Combine(managedDirectory, "..", BundleDiscovery.DashboardDirectoryName)); 80FileName = Path.Combine(dashboardDirectory, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)),
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
TerminalHostForwarder.cs (3)
24var directory = Path.GetFullPath(Path.Combine(managedDirectory, "..", BundleDiscovery.TerminalHostDirectoryName)); 25var startInfo = new ProcessStartInfo(Path.Combine(directory, BundleDiscovery.GetExecutableFileName(BundleDiscovery.TerminalHostExecutableName)))
aspire-tray (116)
FolderApplication.cs (6)
38var terminalAlias = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), 44var powerShell = FindAppPath("pwsh.exe", reportError) ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), 69if (Path.IsPathFullyQualified(path) && path.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) && File.Exists(path)) 71return Path.GetFullPath(path); 90directory = Path.GetFullPath(directory); 135if (!Path.IsPathFullyQualified(executable) || !File.Exists(executable))
NativeSmokeHarness.cs (4)
54_missing = Path.Combine(_directory.FullName, "Missing.AppHost.cs"); 70var path = Path.Combine(_directory.FullName, name); 103var folder = Directory.CreateDirectory(Path.Combine(_directory.FullName, "project;new-tab")).FullName; 169.Concat([_pinned, _missingPin, _recent, _missing]).Select(Path.GetDirectoryName)),
Program.cs (1)
92Path.Combine(WindowsSingleInstance.DirectoryPath, "Startup", "aspire-tray-login.exe"),
SingleInstance.cs (2)
17if (!Path.IsPathFullyQualified(localAppData)) 22return Path.Combine(localAppData, "Aspire", "Tray");
src\Aspire.Tray\Common\AppHostPresentation.cs (10)
12var name = Path.GetFileNameWithoutExtension(host.AppHostPath); 18name = Path.GetFileName(directory); 19directory = Path.GetDirectoryName(directory) ?? ""; 36=> ToSingleLine($"{Path.GetFileNameWithoutExtension(host.AppHostPath)} - {GetLocation(host)} (PID {host.AppHostPid})"); 38public static string GetDirectory(AppHostInfo host) => Path.GetDirectoryName(host.AppHostPath) ?? host.AppHostPath; 45var directory = Path.GetDirectoryName(appHostPath) ?? appHostPath; 46var parent = Path.GetDirectoryName(directory); 47return ToSingleLine(parent is null ? directory : Path.Combine(Path.GetFileName(parent), Path.GetFileName(directory)));
src\Aspire.Tray\Common\CliAppHostCommands.cs (2)
20if (!Path.IsPathFullyQualified(target.AppHostPath) || target.AppHostPath.Contains('\0')) 41startInfo.WorkingDirectory = Path.GetDirectoryName(path)!;
src\Aspire.Tray\Common\CliProcess.cs (1)
12if (!Path.IsPathFullyQualified(cliPath))
src\Aspire.Tray\Common\CliProtocol.cs (1)
41|| !Path.IsPathFullyQualified(item.AppHostPath) || item.AppHostPath.Contains('\0')
src\Aspire.Tray\Common\FileTraySavedStateStore.cs (4)
30_directory = Path.GetDirectoryName(_path) 37Path.Combine(TrayAppHostPath.Normalize(legacyDirectory), "apphosts.json")); 103var temporaryPath = Path.Combine(_directory, $".history-{Guid.NewGuid():N}.tmp"); 178|| !Path.IsPathFullyQualified(host.AppHostPath) || host.AppHostPath.Contains('\0'))
src\Aspire.Tray\Common\MacTrayStartupSettings.cs (2)
13: RegisteredTrayStartupSettings(new FileTrayStartupRegistrationStore(Path.Combine(launchAgentsDirectory, FileName))) 45return cli is not null && Path.IsPathFullyQualified(cli)
src\Aspire.Tray\Common\TrayConfiguration.cs (10)
21=> Path.Combine(GetAspireHome(cliPath, configuredAspireHome, userProfileDirectory), "aspire.config.json"); 28=> Path.Combine(GetAspireHome(cliPath, configuredAspireHome, userProfileDirectory), "tray", "apphosts.json"); 37? Path.Combine(userProfileDirectory, ".aspire") : configuredAspireHome); 139var directory = Path.GetDirectoryName(binary)!; 140using var stream = File.OpenRead(Path.Combine(directory, ".aspire-install.json")); 155return Path.GetDirectoryName(directory) ?? directory; 157var dogfood = Path.GetDirectoryName(Path.GetDirectoryName(directory)); 158return source.GetString() == "pr" && dogfood is not null && Path.GetFileName(dogfood) == "dogfood" 159? Path.GetDirectoryName(dogfood) : null;
src\Aspire.Tray\Common\TrayLaunchCommand.cs (7)
17if (!Path.IsPathFullyQualified(options.BundleRoot) || !Path.IsPathFullyQualified(options.CliPath)) 22var executable = Path.Combine(options.BundleRoot, "tray", "aspire-tray.exe"); 36WorkingDirectory = Path.GetDirectoryName(executable)! 88var appPath = Path.Combine(options.BundleRoot, "tray", "Aspire Tray.app"); 89var executable = Path.Combine(appPath, "Contents", "MacOS", "aspire-tray"); 90if (!File.Exists(executable) || !File.Exists(Path.Combine(appPath, "Contents", "Info.plist")))
src\Aspire.Tray\Common\TrayOptions.cs (3)
58if (cli is null || !Path.IsPathFullyQualified(cli) || !File.Exists(cli)) 63if (bundleRoot is not null && (!Path.IsPathFullyQualified(bundleRoot) || !Directory.Exists(bundleRoot))) 67if (startupCli is not null && !Path.IsPathFullyQualified(startupCli))
src\Aspire.Tray\Common\TraySavedState.cs (2)
108if (string.IsNullOrWhiteSpace(path) || !Path.IsPathFullyQualified(path) || path.Contains('\0')) 112return Path.GetFullPath(path);
src\Aspire.Tray\Common\TrayStartupBootstrap.cs (3)
20if (!Path.IsPathFullyQualified(sourceExecutable) || !File.Exists(sourceExecutable) 47var directory = Path.GetDirectoryName(bootstrapPath)!; 50var temporary = Path.Combine(directory, $".aspire-login-{Guid.NewGuid():N}.tmp");
src\Aspire.Tray\Common\TrayStartupEntry.cs (14)
20|| !Path.IsPathFullyQualified(startup) || !File.Exists(startup)) 53if (File.Exists(Path.ChangeExtension(path, ".runtimeconfig.json"))) 91var root = Path.TrimEndingDirectorySeparator(Path.GetFullPath(directory)); 92var full = Path.GetFullPath(path); 93return full.Equals(root, comparison) || full.StartsWith(root + Path.DirectorySeparatorChar, comparison); 97=> Path.GetFullPath(path).Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 111var full = Path.GetFullPath(path); 112var current = Path.GetPathRoot(full)!; 113foreach (var component in full[current.Length..].Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) 115current = Path.Combine(current, component); 124return Path.GetFullPath(current);
src\Aspire.Tray\Common\TrayStartupRegistration.cs (4)
151var directory = Path.GetDirectoryName(path) 157var temporary = Path.Combine(directory, $".aspire-startup-{Guid.NewGuid():N}.tmp"); 184if (!Path.IsPathFullyQualified(path)) 188foreach (FileSystemInfo entry in new FileSystemInfo[] { new FileInfo(path), new DirectoryInfo(Path.GetDirectoryName(path)!) })
src\Aspire.Tray\Common\WindowsLoginBootstrap.cs (1)
15if (!Path.IsPathFullyQualified(cliPath) || !File.Exists(cliPath))
src\Aspire.Tray\Common\WindowsTrayStartupSettings.cs (1)
99return Path.IsPathFullyQualified(cli.ToString())
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\LinuxTrayPayload.cs (3)
24if (File.Exists(Path.ChangeExtension(path, ".runtimeconfig.json"))) 51var executable = Path.Combine(directory, ExecutableName); 60using var icon = File.OpenRead(Path.Combine(directory, IconName));
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
TrayApplication.Actions.cs (2)
53CopyPath(Path.GetDirectoryName(target.Id.AppHostPath)!); 74application.Open(Path.GetDirectoryName(target.Id.AppHostPath)!);
TrayApplication.Icons.cs (1)
47var original = NativeMethods.LoadImage(0, Path.Combine(AppContext.BaseDirectory, "Aspire.ico"),
TrayApplication.NativeSmoke.cs (1)
123var path = Path.ChangeExtension(export, ".png");
TrayApplication.Panel.cs (1)
773_panelLogo = NativeMethods.LoadImage(0, Path.Combine(AppContext.BaseDirectory, "Aspire.ico"),
WindowsTrayLog.cs (6)
22public static string LogPath => Path.Combine(WindowsSingleInstance.DirectoryPath, "aspire-tray.log"); 41directory = Path.GetFullPath(directory); 42var current = Path.GetPathRoot(directory)!; 47foreach (var component in directory[current.Length..].Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) 49current = Path.Combine(current, component); 64var file = CreateFile(Path.Combine(directory, "aspire-tray.log"),
Aspire.Acquisition.Tests (507)
Scripts\Common\FakeArchiveHelper.cs (11)
22var archivePath = Path.Combine(outputDir, $"aspire-cli-{platform}.{extension}"); 25var contentDir = Path.Combine(outputDir, $"archive-content-{Guid.NewGuid():N}"); 31var binaryPath = Path.Combine(contentDir, binaryName); 61var path = Path.Combine(outputDir, filename); 96var archivePath = Path.Combine(outputDir, $"aspire-cli-{platform}.{extension}"); 99var contentDir = Path.Combine(outputDir, $"verify-content-{Guid.NewGuid():N}"); 107? Path.Combine(contentDir, "payload") 111var binaryPath = Path.Combine(binaryDir, "aspire"); 119var sidecarPath = Path.Combine(contentDir, ".aspire-install.json"); 200var relativePath = Path.GetRelativePath(contentDir, fullPath).Replace(Path.DirectorySeparatorChar, '/');
Scripts\Common\ScriptFunctionCommand.cs (5)
36: base(GetExecutable(scriptPath), testOutput, label: $"{Path.GetFileName(scriptPath)}:func") 47WithEnvironmentVariable("XDG_CONFIG_HOME", Path.Combine(_testEnvironment.MockHome, ".config")); 63var fullScriptPath = Path.Combine(repoRoot, _scriptPath); 89var tempScript = Path.Combine(_testEnvironment.TempDirectory, $"test-func-{Guid.NewGuid():N}.sh"); 131var tempScript = Path.Combine(_testEnvironment.TempDirectory, $"test-func-{Guid.NewGuid():N}.ps1");
Scripts\Common\ScriptHostFixture.cs (3)
37_scriptsDirectory = Path.Combine(repoRoot, "eng", "scripts"); 182var safeName = Path.GetFileName(requestPath); 183var filePath = Path.Combine(_scriptsDirectory, safeName);
Scripts\Common\ScriptPaths.cs (6)
8private static readonly string s_scriptsDirectory = Path.Combine("eng", "scripts"); 10public static readonly string ReleaseShell = Path.Combine(s_scriptsDirectory, "get-aspire-cli.sh"); 11public static readonly string ReleasePowerShell = Path.Combine(s_scriptsDirectory, "get-aspire-cli.ps1"); 12public static readonly string PRShell = Path.Combine(s_scriptsDirectory, "get-aspire-cli-pr.sh"); 13public static readonly string PRPowerShell = Path.Combine(s_scriptsDirectory, "get-aspire-cli-pr.ps1"); 14public static readonly string VerifyCliArchivePowerShell = Path.Combine(s_scriptsDirectory, "verify-cli-archive.ps1");
Scripts\Common\ScriptToolCommand.cs (3)
28: base(GetExecutable(scriptPath), testOutput, label: Path.GetFileName(scriptPath)) 39WithEnvironmentVariable("XDG_CONFIG_HOME", Path.Combine(_testEnvironment.MockHome, ".config")); 69var fullScriptPath = Path.Combine(repoRoot, _scriptPath);
Scripts\Common\TestEnvironment.cs (3)
31MockHome = Path.Combine(TempDirectory, "home"); 42var mockBinDir = Path.Combine(TempDirectory, "mock-bin"); 46var ghScriptPath = Path.Combine(mockBinDir, isWindows ? "gh.cmd" : "gh");
Scripts\CompletionScriptTests.cs (115)
21var profile = Path.Combine(env.MockHome, "profile.ps1"); 22var blockedDirectory = Path.GetDirectoryName(CompletionPath(env.MockHome, cli, dogfood))!; 23Directory.CreateDirectory(Path.GetDirectoryName(blockedDirectory)!); 41Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 74var target = Path.Combine(env.TempDirectory, "actual"); 75var selected = Path.Combine(env.TempDirectory, "selected"); 76var outside = Path.Combine(env.TempDirectory, "outside"); 84$destination = '{{Quote(Path.Combine(selected, "completions", "aspire.ps1"))}}' 88New-Item -ItemType $linkType -Path '{{Quote(Path.Combine(target, "completions"))}}' -Target '{{Quote(outside)}}' -ErrorAction Stop | Out-Null 110var home = Path.Combine(env.MockHome, "it's $home ` [test]"); 112var profile = Path.Combine(home, "edition profile", "profile.ps1"); 113Directory.CreateDirectory(Path.GetDirectoryName(profile)!); 143Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 166var cli = CreateFakeCli(outsideHome ? Path.Combine(env.TempDirectory, "custom install") : env.MockHome); 167var profile = Path.Combine(env.MockHome, "profile.ps1"); 169Directory.CreateDirectory(Path.GetDirectoryName(completion)!); 189Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 192Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 204var cli = CreateFakeCli(Path.Combine(env.TempDirectory, "custom install")); 205var profile = Path.Combine(Path.GetDirectoryName(cli)!, "outside-profile.ps1"); 222Assert.False(Directory.Exists(Path.Combine(Path.GetDirectoryName(cli)!, "completions"))); 233var cli = CreateFakeCli(Path.Combine(env.TempDirectory, "it's $install ` [test]")); 234var profile = Path.Combine(env.MockHome, "profile.ps1"); 257Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 258Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 272var installRoot = Path.Combine(env.TempDirectory, "custom install"); 274var profile = Path.Combine(env.MockHome, "profile.ps1"); 277var outside = Path.Combine(env.TempDirectory, "custom install-other"); 279var sentinel = Path.Combine(outside, "aspire.ps1"); 282var link = destination == "directory-link" ? Path.GetDirectoryName(completion)! : completion; 283Directory.CreateDirectory(Path.GetDirectoryName(link)!); 308Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 311Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 322var installRoot = Path.Combine(env.TempDirectory, "not yet installed", "bin"); 323var cli = Path.Combine(installRoot, "aspire.ps1"); 324var profile = Path.Combine(env.MockHome, "profile.ps1"); 340Assert.False(Directory.Exists(Path.GetDirectoryName(installRoot))); 355var profile = Path.Combine(env.MockHome, "profile.ps1"); 357Directory.CreateDirectory(Path.GetDirectoryName(completion)!); 376Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 377Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 390var profile = Path.Combine(env.MockHome, "profile.ps1"); 417var profile = Path.Combine(env.MockHome, "profile.ps1"); 445var profile = Path.Combine(env.MockHome, "profile.ps1"); 447Directory.CreateDirectory(Path.GetDirectoryName(completion)!); 465Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 473var cli = Path.Combine(home, "fake aspire.ps1"); 487Path.Combine(dogfood ? Path.GetDirectoryName(cli)! : Path.Combine(home, ".aspire"), "completions", "aspire.ps1"); 500var bashrc = Path.Combine(env.MockHome, ".bashrc"); 501var outside = Path.Combine(env.TempDirectory, "outside-profile"); 504File.CreateSymbolicLink(Path.Combine(env.MockHome, ".bash_profile"), outside); 529var profiles = new[] { Path.Combine(env.MockHome, ".bashrc"), Path.Combine(env.MockHome, ".bash_profile") }; 569var target = Path.Combine(env.TempDirectory, "actual"); 570var selected = Path.Combine(env.TempDirectory, "selected"); 571var outside = Path.Combine(env.TempDirectory, "outside"); 579is_completion_path_within_root '{{Quote(Path.Combine(selected, "completions", "aspire.bash"))}}' '{{Quote(selected)}}' 580ln -s '{{Quote(outside)}}' '{{Quote(Path.Combine(target, "completions"))}}' 581if is_completion_path_within_root '{{Quote(Path.Combine(selected, "completions", "aspire.bash"))}}' '{{Quote(selected)}}'; then 629var home = Path.Combine(env.MockHome, "it's $home ` [test]"); 634"zsh" => Path.Combine(home, "z dot", ".zshrc"), 635"fish" => Path.Combine(home, "xdg config", "fish", "conf.d", "aspire-completions.fish"), 636_ => Path.Combine(home, ".bashrc") 638Directory.CreateDirectory(Path.GetDirectoryName(profile)!); 640var completion = Path.Combine(dogfood ? home : Path.Combine(home, ".aspire"), "completions", $"aspire.{shell}"); 666Assert.Empty(Directory.GetDirectories(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 697var cli = await CreateFakeCliAsync(outsideHome ? Path.Combine(env.TempDirectory, "custom install") : env.MockHome); 698var completion = Path.Combine(dogfood || outsideHome ? Path.GetDirectoryName(cli)! : Path.Combine(env.MockHome, ".aspire"), "completions", "aspire.bash"); 699Directory.CreateDirectory(Path.GetDirectoryName(completion)!); 701var profile = Path.Combine(env.MockHome, ".bashrc"); 721Assert.Empty(Directory.GetDirectories(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 724Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 734var installRoot = Path.Combine(env.TempDirectory, "custom install"); 736var outside = Path.Combine(installRoot, ".zshrc"); 740File.CreateSymbolicLink(Path.Combine(env.MockHome, ".zshrc"), outside); 756Assert.True(File.Exists(Path.Combine(env.MockHome, ".aspire", "completions", "aspire.zsh"))); 757Assert.False(Directory.Exists(Path.Combine(installRoot, "completions"))); 772var installRoot = Path.Combine(env.TempDirectory, "it's $install ` [test]"); 776"zsh" => Path.Combine(env.MockHome, ".zshrc"), 777"fish" => Path.Combine(env.MockHome, ".config", "fish", "conf.d", "aspire-completions.fish"), 778_ => Path.Combine(env.MockHome, ".bashrc") 780Directory.CreateDirectory(Path.GetDirectoryName(profile)!); 782var completion = Path.Combine(installRoot, "completions", $"aspire.{shell}"); 803Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 804Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile"))); 805Assert.Empty(Directory.GetDirectories(Path.GetDirectoryName(completion)!, ".aspire-completions-*")); 821var installRoot = Path.Combine(env.TempDirectory, "custom install"); 823var profile = Path.Combine(env.MockHome, ".bashrc"); 826var outside = Path.Combine(env.TempDirectory, "custom install-other"); 828var sentinel = Path.Combine(outside, "aspire.bash"); 830var completionDirectory = Path.Combine(installRoot, "completions"); 831var completion = Path.Combine(completionDirectory, "aspire.bash"); 845File.CreateSymbolicLink(completion, destination == "file-link" ? sentinel : Path.Combine(outside, "missing")); 866Assert.False(File.Exists(Path.Combine(env.MockHome, "called"))); 876var installRoot = Path.Combine(env.TempDirectory, "not yet installed", "bin"); 877var cli = Path.Combine(installRoot, "aspire"); 878var profile = Path.Combine(env.MockHome, ".bashrc"); 895Assert.False(Directory.Exists(Path.GetDirectoryName(installRoot))); 907var profile = Path.Combine(env.MockHome, loginProfile); 927Assert.True(File.Exists(Path.Combine(env.MockHome, ".bashrc"))); 935File.WriteAllText(Path.Combine(env.MockHome, ".bashrc"), "export ASPIRE_TEST_BASHRC_LOADED=true\n"); 960var profile = Path.Combine(env.MockHome, ".bashrc"); 976Assert.True(File.Exists(Path.Combine(env.MockHome, "completions", "aspire.bash"))); 977Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile"))); 986var profile = Path.Combine(env.MockHome, ".bashrc"); 1003Assert.False(File.Exists(Path.Combine(env.MockHome, ".bash_profile"))); 1004Assert.True(File.Exists(Path.Combine(env.MockHome, ".aspire", "completions", "aspire.bash"))); 1011var cli = Path.Combine(home, "fake aspire");
Scripts\FileHelperTests.cs (1)
24var path = Path.Combine(env.TempDirectory, "mock tool");
Scripts\HomebrewCompletionTests.cs (3)
21var template = await File.ReadAllTextAsync(Path.Combine(repoRoot, "eng", "homebrew", "aspire.rb.template")); 27var loaderPath = Path.Combine(environment.TempDirectory, "loader.ps1"); 29var testPath = Path.Combine(environment.TempDirectory, "test.ps1");
Scripts\LocalHiveScriptFunctionTests.cs (1)
110return Path.Combine(repoRoot, relativePath);
Scripts\PipedInstallTests.cs (4)
99var installPath = Path.Combine(env.TempDirectory, "path with spaces", "cli"); 127var scriptPath = Path.Combine(repoRoot, ScriptPaths.ReleaseShell); 149var scriptPath = Path.Combine(repoRoot, ScriptPaths.PRShell); 240var installPath = Path.Combine(env.TempDirectory, "path with spaces", "cli");
Scripts\PRScriptFunctionTests.cs (15)
89var pkgDir = Path.Combine(env.TempDirectory, "packages"); 112var emptyDir = Path.Combine(env.TempDirectory, "empty-packages"); 131var pkgDir = Path.Combine(env.TempDirectory, "packages"); 153var pkgDir = Path.Combine(env.TempDirectory, "packages"); 229var tempDir = Path.Combine(env.TempDirectory, "download-temp"); 231File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake"); 249var tempDir = Path.Combine(env.TempDirectory, "download-temp"); 251File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake"); 269var tempDir = Path.Combine(env.TempDirectory, "download-temp"); 271File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake"); 294var tempDir = Path.Combine(env.TempDirectory, "work"); 318var tempDir = Path.Combine(env.TempDirectory, "work"); 341var tempDir = Path.Combine(env.TempDirectory, "work"); 372var configFile = Path.Combine(env.MockHome, ".zshrc"); 375var newPath = Path.Combine(env.MockHome, ".aspire", "bin");
Scripts\PRScriptInstallE2ETests.cs (6)
28var stageDir = Path.Combine(env.TempDirectory, "stage"); 35var installPrefix = Path.Combine(env.TempDirectory, "install"); 39cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 56var binDir = Path.Combine(installPrefix, "dogfood", "pr-16817", "bin"); 57Assert.True(File.Exists(Path.Combine(binDir, "aspire")), $"CLI binary missing under {binDir}"); 59var sidecarPath = Path.Combine(binDir, ".aspire-install.json");
Scripts\PRScriptInstallerModeTests.cs (99)
22cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 30cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 37await File.WriteAllTextAsync(Path.Combine(root, "aspire.rb"), "cask \"aspire\" do\n version \"13.3.0\"\nend\n"); 38await File.WriteAllTextAsync(Path.Combine(root, "dogfood.sh"), "#!/usr/bin/env bash\nexit 0\n"); 47await File.WriteAllTextAsync(Path.Combine(root, "Microsoft.Aspire.installer.yaml"), "PackageIdentifier: Microsoft.Aspire\nPackageVersion: 13.3.0\nInstallers: []\n"); 48await File.WriteAllTextAsync(Path.Combine(root, "dogfood.ps1"), "exit 0\n"); 66var manifestDir = Path.Combine(root, "installer-winget"); 67var archiveRoot = Path.Combine(root, "installer-native-archives"); 70var archiveDir = Path.Combine(archiveRoot, "Debug", "Shipping"); 94await File.WriteAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.installer.yaml"), installerYaml); 95await File.WriteAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.yaml"), $"PackageIdentifier: Microsoft.Aspire\nPackageVersion: {version}\nManifestType: version\nManifestVersion: 1.10.0\n"); 96await File.WriteAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.locale.en-US.yaml"), $"PackageIdentifier: Microsoft.Aspire\nPackageVersion: {version}\nPackageLocale: en-US\nManifestType: defaultLocale\nManifestVersion: 1.10.0\n"); 97await File.WriteAllTextAsync(Path.Combine(manifestDir, "dogfood.ps1"), "exit 0\n"); 103await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, $"aspire-cli-win-x64-{version}.zip"), $"stub-x64-{version}"); 104await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, $"aspire-cli-win-arm64-{version}.zip"), $"stub-arm64-{version}"); 111var mockBinDir = Path.Combine(env.TempDirectory, "mock-homebrew-bin"); 112var brewRepository = Path.Combine(env.TempDirectory, "brew-repository"); 113var brewPrefix = Path.Combine(env.TempDirectory, "brew-prefix"); 114var brewLog = Path.Combine(env.TempDirectory, "brew.log"); 115var codesignLog = Path.Combine(env.TempDirectory, "codesign.log"); 116var brewTrustStore = Path.Combine(env.TempDirectory, "brew-trust.txt"); 122var brewPath = Path.Combine(mockBinDir, "brew"); 233var curlPath = Path.Combine(mockBinDir, "curl"); 240var codesignPath = Path.Combine(mockBinDir, "codesign"); 272var mockBinDir = Path.Combine(env.TempDirectory, "mock-winget-bin"); 273var wingetLog = Path.Combine(env.TempDirectory, "winget.log"); 279var implPath = Path.Combine(mockBinDir, "winget-impl.ps1"); 414var wingetCmd = Path.Combine(mockBinDir, "winget.cmd"); 420var aspireCmd = Path.Combine(mockBinDir, "aspire.cmd"); 433await File.WriteAllTextAsync(Path.Combine(root, "aspire-cli-osx-arm64-13.3.0.tar.gz"), "fake arm64 archive"); 434await File.WriteAllTextAsync(Path.Combine(root, "aspire-cli-osx-x64-13.3.0.tar.gz"), "fake x64 archive"); 439var archiveDir = Path.Combine(root, "Debug", "Shipping"); 444await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, "aspire-cli-win-x64-13.3.0.zip"), "stub-x64-13.3.0"); 445await WriteRealAspireWinGetZipAsync(Path.Combine(archiveDir, "aspire-cli-win-arm64-13.3.0.zip"), "stub-arm64-13.3.0"); 462var parent = Path.GetDirectoryName(path); 569var localDir = await CreateHomebrewInstallerArtifactAsync(Path.Combine(env.TempDirectory, "homebrew-artifact")); 608var localDir = await CreateHomebrewInstallerArtifactAsync(Path.Combine(env.TempDirectory, "homebrew-artifact")); 611cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin"); 613var result = await cmd.ExecuteAsync(Path.Combine(localDir, "aspire.rb")); 625var caskPath = Path.Combine(env.TempDirectory, "aspire.rb"); 629cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin"); 644var caskPath = Path.Combine(env.TempDirectory, "aspire.rb"); 648cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin"); 658var brewLog = (await File.ReadAllLinesAsync(Path.Combine(env.TempDirectory, "brew.log"))).ToList(); 664var trustStore = Path.Combine(env.TempDirectory, "brew-trust.txt"); 674var archiveRoot = Path.Combine(env.TempDirectory, "archives"); 678cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin"); 684"--output-dir", Path.Combine(env.TempDirectory, "homebrew-output"), 691var brewLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "brew.log")); 696var codesignLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "codesign.log")); 707var archiveRoot = Path.Combine(env.TempDirectory, "archives"); 711cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin"); 717"--output-dir", Path.Combine(env.TempDirectory, "homebrew-output"), 721var codesignLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "codesign.log")); 723var brewLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "brew.log")); 733var archiveRoot = Path.Combine(env.TempDirectory, "archives"); 736var outputDir = Path.Combine(env.TempDirectory, "homebrew-output"); 738cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}/usr/bin:/bin:/usr/sbin:/sbin"); 749var cask = await File.ReadAllTextAsync(Path.Combine(outputDir, "aspire.rb")); 755Assert.Contains((await GetSha256HexAsync(Path.Combine(archiveRoot, "aspire-cli-osx-arm64-13.3.0.tar.gz"))).ToLowerInvariant(), cask); 756Assert.Contains((await GetSha256HexAsync(Path.Combine(archiveRoot, "aspire-cli-osx-x64-13.3.0.tar.gz"))).ToLowerInvariant(), cask); 758Assert.True(File.Exists(Path.Combine(outputDir, "dogfood.sh"))); 767var brewLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "brew.log")); 798Assert.DoesNotContain($"dogfood{Path.DirectorySeparatorChar}pr-12345{Path.DirectorySeparatorChar}bin", result.Output); 823Assert.DoesNotContain($"dogfood{Path.DirectorySeparatorChar}pr-12345{Path.DirectorySeparatorChar}bin", result.Output); 831var localDir = await CreateWinGetInstallerArtifactAsync(Path.Combine(env.TempDirectory, "winget-artifact")); 870var archiveRoot = Path.Combine(env.TempDirectory, "archives"); 872var outputDir = Path.Combine(env.TempDirectory, "winget-output"); 883var installerManifest = await File.ReadAllTextAsync(Path.Combine(outputDir, "Microsoft.Aspire.installer.yaml")); 887Assert.Contains(await GetSha256HexAsync(Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-x64-13.3.0.zip")), installerManifest); 888Assert.Contains(await GetSha256HexAsync(Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-arm64-13.3.0.zip")), installerManifest); 892var localeManifest = await File.ReadAllTextAsync(Path.Combine(outputDir, "Microsoft.Aspire.locale.en-US.yaml")); 894Assert.True(File.Exists(Path.Combine(outputDir, "Microsoft.Aspire.yaml"))); 895Assert.True(File.Exists(Path.Combine(outputDir, "dogfood.ps1"))); 904var localDir = await CreateWinGetInstallerArtifactAsync(Path.Combine(env.TempDirectory, "winget-artifact")); 907cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 912var wingetLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "winget.log")); 923var localDir = await CreateWinGetInstallerArtifactAsync(Path.Combine(env.TempDirectory, "winget-artifact")); 926cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 953cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 959var wingetLog = await File.ReadAllTextAsync(Path.Combine(env.TempDirectory, "winget.log")); 964var originalInstaller = await File.ReadAllTextAsync(Path.Combine(manifestDir, "Microsoft.Aspire.installer.yaml")); 986var x64Archive = Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-x64-13.3.0.zip"); 991cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 1013var archiveRoot = Path.Combine(env.TempDirectory, "archives"); 1014var archiveDir = Path.Combine(archiveRoot, "Debug", "Shipping"); 1016var x64Zip = Path.Combine(archiveDir, "aspire-cli-win-x64-13.3.0.zip"); 1017var arm64Zip = Path.Combine(archiveDir, "aspire-cli-win-arm64-13.3.0.zip"); 1021var outputDir = Path.Combine(env.TempDirectory, "winget-output"); 1032var installerYaml = await File.ReadAllTextAsync(Path.Combine(outputDir, "Microsoft.Aspire.installer.yaml")); 1038var extractDir = Path.Combine(env.TempDirectory, $"extract-{Path.GetFileNameWithoutExtension(archive)}"); 1042var expected = Path.Combine(extractDir, rel.Replace('/', Path.DirectorySeparatorChar)); 1044$"NestedInstallerFiles entry '{rel}' from {Path.GetFileName(archive)} not found at {expected}. Manifest disagrees with archive contents."); 1064var x64Archive = Path.Combine(archiveRoot, "Debug", "Shipping", "aspire-cli-win-x64-13.3.0.zip"); 1076cmd.WithEnvironmentVariable("PATH", $"{mockBinDir}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
Scripts\PRScriptPowerShellTests.cs (27)
27cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 83Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 115var mockGhPath = Path.Combine(mockBinPath, OperatingSystem.IsWindows() ? "gh.cmd" : "gh"); 129var mockGhPath = Path.Combine(mockBinPath, OperatingSystem.IsWindows() ? "gh.cmd" : "gh"); 143var mockGhPath = Path.Combine(mockBinPath, OperatingSystem.IsWindows() ? "gh.cmd" : "gh"); 156var customPath = Path.Combine(env.TempDirectory, "custom"); 201var localDir = Path.Combine(env.TempDirectory, "local artifacts"); 226var localDir = Path.Combine(env.TempDirectory, "raw-build"); 229await File.WriteAllTextAsync(Path.Combine(localDir, "aspire"), "#!/bin/sh\necho fake\n"); 309var customPath = Path.Combine(env.TempDirectory, "custom"); 434var localDir = Path.Combine(env.TempDirectory, "local-artifacts"); 468var expectedBinaryPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", binaryName); 488var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 514Assert.Contains(Path.Combine("dogfood", "pr-99999", "bin"), hintLine); 515var binDir = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin"); 523Assert.Contains($"{binDir}{Path.PathSeparator}$env:PATH", hintLine); 530var customPath = Path.Combine(env.TempDirectory, "custom-prefix"); 537var binDir = Path.Combine(customPath, "dogfood", "pr-99999", "bin"); 539Assert.Contains($"{binDir}{Path.PathSeparator}$env:PATH", hintLine); 540Assert.DoesNotContain(Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin"), hintLine); 568var expectedHive = Path.Combine("hives", "pr-99999", "packages"); 585var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 601var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 615var localDir = Path.Combine(env.TempDirectory, "local-artifacts"); 634var binSidecar = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 638var aspireRoot = Path.Combine(env.MockHome, ".aspire"); 716var dogfoodRoot = Path.Combine(mockHome, ".aspire", "dogfood");
Scripts\PRScriptPSFunctionTests.cs (21)
84var cliBinDir = Path.Combine(env.TempDirectory, "cli-bin"); 85var existingPath = $"{cliBinDir}{Path.PathSeparator}{Path.Combine(env.TempDirectory, "other-bin")}"; 86var githubPath = Path.Combine(env.TempDirectory, "github-path.txt"); 116var pkgDir = Path.Combine(env.TempDirectory, "packages"); 139var emptyDir = Path.Combine(env.TempDirectory, "empty-packages"); 158var pkgDir = Path.Combine(env.TempDirectory, "packages"); 180var pkgDir = Path.Combine(env.TempDirectory, "packages"); 260var tempDir = Path.Combine(env.TempDirectory, "download-temp"); 262File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake"); 280var tempDir = Path.Combine(env.TempDirectory, "download-temp"); 282File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake"); 300var tempDir = Path.Combine(env.TempDirectory, "download-temp"); 302File.WriteAllText(Path.Combine(tempDir, "artifact.tar.gz"), "fake"); 324var downloadDir = Path.Combine(env.TempDirectory, "cli-download"); 326await File.WriteAllTextAsync(Path.Combine(downloadDir, "README.txt"), "no archive here"); 328var binDir = Path.Combine(env.TempDirectory, "bin"); 346var downloadDir = Path.Combine(env.TempDirectory, "cli-download"); 348await File.WriteAllTextAsync(Path.Combine(downloadDir, "aspire-cli-linux-x64.tar.gz"), "fake1"); 349await File.WriteAllTextAsync(Path.Combine(downloadDir, "aspire-cli-osx-arm64.tar.gz"), "fake2"); 351var binDir = Path.Combine(env.TempDirectory, "bin");
Scripts\PRScriptShellTests.cs (22)
25cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 108var mockGhPath = Path.Combine(mockBinPath, "gh"); 122var mockGhPath = Path.Combine(mockBinPath, "gh"); 135var customPath = Path.Combine(env.TempDirectory, "custom"); 161var localDir = Path.Combine(env.TempDirectory, "local artifacts"); 186var localDir = Path.Combine(env.TempDirectory, "raw-build"); 189await File.WriteAllTextAsync(Path.Combine(localDir, "aspire"), "#!/bin/sh\necho fake\n"); 365var customPath = Path.Combine(env.TempDirectory, "custom"); 512var localDir = Path.Combine(env.TempDirectory, "local-artifacts"); 543var expectedBinaryPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", "aspire"); 545var scriptRouteBin = Path.Combine(env.MockHome, ".aspire", "bin", "aspire"); 565var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 588Assert.Contains(Path.Combine("dogfood", "pr-99999", "bin"), hintLine); 597var customPath = Path.Combine(env.TempDirectory, "custom-prefix"); 633var expectedHive = Path.Combine("hives", "pr-99999", "packages"); 650var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999", "bin", ".aspire-install.json"); 666var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 680var localDir = Path.Combine(env.TempDirectory, "local-artifacts"); 701var binSidecar = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 705var aspireRoot = Path.Combine(env.MockHome, ".aspire"); 741var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-99999999999", "bin", ".aspire-install.json"); 792var dogfoodRoot = Path.Combine(mockHome, ".aspire", "dogfood");
Scripts\PRScriptToolModeTests.cs (84)
35cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 43cmd.WithEnvironmentVariable("PATH", $"{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 49var mockBinDir = Path.Combine(env.TempDirectory, "mock-dotnet-bin"); 53var dotnetScriptPath = Path.Combine(mockBinDir, isWindows ? "dotnet.cmd" : "dotnet"); 165var localDir = Path.Combine(env.TempDirectory, "artifacts"); 191var localDir = Path.Combine(env.TempDirectory, "artifacts"); 211var localDir = Path.Combine(env.TempDirectory, "artifacts"); 214var customPath = Path.Combine(env.TempDirectory, "custom"); 224Assert.Contains($"Would install CLI archive to: {Path.Combine(customPath, "bin")}", result.Output); 320var localDir = Path.Combine(env.TempDirectory, "artifacts"); 322var customPath = Path.Combine(env.TempDirectory, "custom"); 332Assert.Contains($"dotnet tool install --tool-path {Path.Combine(customPath, "bin")} Aspire.Cli", result.Output); 341var localDir = Path.Combine(env.TempDirectory, "artifacts"); 362var localDir = Path.Combine(env.TempDirectory, "artifacts"); 382var localDir = Path.Combine(env.TempDirectory, "artifacts"); 385var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 388cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 413var localDir = Path.Combine(env.TempDirectory, "artifacts"); 416var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 419cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 437var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-5678", "packages"); 441Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")), 450var localDir = Path.Combine(env.TempDirectory, "artifacts"); 453var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 456cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 484var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 487cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 501var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-12345", "bin", ".aspire-install.json"); 505var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-12345", "packages"); 507Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")), 524cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 578var localDir = Path.Combine(env.TempDirectory, "artifacts"); 580var customPath = Path.Combine(env.TempDirectory, "custom"); 581var expectedToolPath = Path.Combine(customPath, "bin"); 604var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 624var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 626await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.symbols.nupkg"), "fake-symbols-nupkg-content"); 627await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.snupkg"), "fake-symbols-package-content"); 629await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13_3_0.nupkg"), "fake-invalid-version-content"); 648var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 652await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.1_0.nupkg"), "fake-invalid-version-content"); 671var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 693var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 747var localDir = Path.Combine(env.TempDirectory, "artifacts"); 772var localDir = Path.Combine(env.TempDirectory, "artifacts"); 791var localDir = Path.Combine(env.TempDirectory, "artifacts"); 794var customPath = Path.Combine(env.TempDirectory, "custom"); 803Assert.Contains($"Installing Aspire CLI to {Path.Combine(customPath, "bin")}", result.Output); 869Assert.Contains(Path.Combine("hives", "pr-99999", "packages"), result.Output); 897var localDir = Path.Combine(env.TempDirectory, "artifacts"); 899var customPath = Path.Combine(env.TempDirectory, "custom"); 909Assert.Contains($"dotnet tool install --tool-path {Path.Combine(customPath, "bin")} Aspire.Cli", result.Output); 918var localDir = Path.Combine(env.TempDirectory, "artifacts"); 939var localDir = Path.Combine(env.TempDirectory, "artifacts"); 959var localDir = Path.Combine(env.TempDirectory, "artifacts"); 962var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 965cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 989var localDir = Path.Combine(env.TempDirectory, "artifacts"); 992var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 995cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 1013var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-5678", "packages"); 1017Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")), 1028var dotnetCommandsPath = Path.Combine(env.TempDirectory, "dotnet-commands.txt"); 1031cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 1045var sidecarPath = Path.Combine(env.MockHome, ".aspire", "dogfood", "pr-12345", "bin", ".aspire-install.json"); 1049var prHive = Path.Combine(env.MockHome, ".aspire", "hives", "pr-12345", "packages"); 1051Assert.True(File.Exists(Path.Combine(prHive, "Aspire.Hosting.13.3.0-pr.5678.deadbeef.nupkg")), 1068cmd.WithEnvironmentVariable("PATH", $"{mockDotnetPath}{Path.PathSeparator}{mockGhPath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 1105var localDir = Path.Combine(env.TempDirectory, "artifacts"); 1107var customPath = Path.Combine(env.TempDirectory, "custom"); 1108var expectedToolPath = Path.Combine(customPath, "bin"); 1131var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 1151var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 1153await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.symbols.nupkg"), "fake-symbols-nupkg-content"); 1154await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13.3.0-pr.5678.deadbeef.snupkg"), "fake-symbols-package-content"); 1156await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.13_3_0.nupkg"), "fake-invalid-version-content"); 1175var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 1178await File.WriteAllTextAsync(Path.Combine(pkgDir, "Aspire.Cli.1_0.nupkg"), "fake-invalid-version-content"); 1197var pkgDir = Path.Combine(env.TempDirectory, "pkgs"); 1219var pkgDir = Path.Combine(env.TempDirectory, "pkgs");
Scripts\ReleaseScriptFunctionTests.cs (20)
372var destPath = Path.Combine(env.TempDirectory, "install-dest"); 383Assert.True(File.Exists(Path.Combine(destPath, "aspire")), 393var destPath = Path.Combine(env.TempDirectory, "install-dest-zip"); 404Assert.True(File.Exists(Path.Combine(destPath, "aspire.exe")), 504var cliPath = Path.Combine(env.TempDirectory, "aspire"); 505var capturePath = Path.Combine(env.TempDirectory, "setup-args.txt"); 576var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 579File.WriteAllText(Path.Combine(env.MockHome, ".bashrc"), "# existing config\n"); 591var bashrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".bashrc")); 600var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 603File.WriteAllText(Path.Combine(env.MockHome, ".zshrc"), "# existing config\n"); 615var zshrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".zshrc")); 624var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 629Path.Combine(env.MockHome, ".bashrc"), 642var bashrcContent = File.ReadAllText(Path.Combine(env.MockHome, ".bashrc")); 651var installPath = Path.Combine(env.MockHome, ".aspire", "bin"); 675var mockBinDir = Path.Combine(env.TempDirectory, "mock-bin"); 678var mockCurl = Path.Combine(mockBinDir, "curl"); 711var mockBinDir = Path.Combine(env.TempDirectory, "mock-bin"); 714var mockCurl = Path.Combine(mockBinDir, "curl");
Scripts\ReleaseScriptPowerShellTests.cs (22)
46Assert.False(Directory.Exists(Path.Combine(env.MockHome, ".aspire"))); 80var customPath = Path.Combine(env.TempDirectory, "custom"); 92var installPath = Path.Combine(env.TempDirectory, "install"); 93var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 141var installPath = Path.Combine(env.TempDirectory, "install"); 142var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 192var installPath = Path.Combine(env.TempDirectory, "install"); 193var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 247var installPath = Path.Combine(env.TempDirectory, "install"); 248var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 300var installPath = Path.Combine(env.TempDirectory, "install"); 356var customPath = Path.Combine(env.TempDirectory, "custom"); 430var installPath = Path.Combine(env.TempDirectory, "install"); 441await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json"))); 459var installPath = Path.Combine(env.TempDirectory, "install"); 461var sidecarPath = Path.Combine(installPath, ".aspire-install.json"); 490var installPath = Path.Combine(env.TempDirectory, "install"); 519await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json"))); 606var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 628var configPath = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 650var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 668var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
Scripts\ReleaseScriptPSFunctionTests.cs (7)
392var destPath = Path.Combine(env.TempDirectory, "install-dest"); 403Assert.True(File.Exists(Path.Combine(destPath, "aspire")), 413var destPath = Path.Combine(env.TempDirectory, "install-dest-zip"); 424Assert.True(File.Exists(Path.Combine(destPath, "aspire.exe")), 528var cliPath = Path.Combine(env.TempDirectory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 529var capturePath = Path.Combine(env.TempDirectory, "setup-args.txt"); 562var cliPath = Path.Combine(env.TempDirectory, "setup-invoked.txt");
Scripts\ReleaseScriptShellTests.cs (26)
92var customPath = Path.Combine(env.TempDirectory, "custom-bin"); 107var installPath = Path.Combine(env.TempDirectory, "install"); 108var tempDir = Path.Combine(env.TempDirectory, "download"); 109var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 149var installPath = Path.Combine(env.TempDirectory, "install"); 150var tempDir = Path.Combine(env.TempDirectory, "download"); 151var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 193var installPath = Path.Combine(env.TempDirectory, "install"); 194var tempDir = Path.Combine(env.TempDirectory, "download"); 195var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 241var installPath = Path.Combine(env.TempDirectory, "install"); 242var tempDir = Path.Combine(env.TempDirectory, "download"); 243var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 287var installPath = Path.Combine(env.TempDirectory, "install"); 288var tempDir = Path.Combine(env.TempDirectory, "download"); 289var capturePath = Path.Combine(env.TempDirectory, "downloads.txt"); 373var installPath = Path.Combine(env.TempDirectory, "install"); 384await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json"))); 400var installPath = Path.Combine(env.TempDirectory, "install"); 413Assert.True(File.Exists(Path.Combine(installPath, ".aspire-install.json"))); 420var installPath = Path.Combine(env.TempDirectory, "install"); 443await File.ReadAllBytesAsync(Path.Combine(installPath, ".aspire-install.json"))); 528var globalConfig = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 550var configPath = Path.Combine(env.MockHome, ".aspire", "aspire.config.json"); 572var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json"); 592var sidecarPath = Path.Combine(env.MockHome, ".aspire", "bin", ".aspire-install.json");
Scripts\ScriptToolCommandTests.cs (1)
17var scriptPath = Path.Combine(env.TempDirectory, "interleave.sh");
tests\Shared\Playwright\TestUtils.cs (2)
14if (Directory.Exists(Path.Combine(repoRoot.FullName, ".git")) || File.Exists(Path.Combine(repoRoot.FullName, ".git")))
Aspire.Azure.AI.Extensions.OpenAI.Tests (2)
AspireAzureOpenAIExtensionsTests.cs (1)
49var schema = JsonSchema.FromFile(Path.Combine(AppContext.BaseDirectory, "ConfigurationSchema.json"),
AspireAzureProjectOpenAIExtensionsTests.cs (1)
47var schema = JsonSchema.FromFile(Path.Combine(AppContext.BaseDirectory, "ConfigurationSchema.json"),
Aspire.Azure.AI.Projects.Tests (1)
AspireAzureAIProjectsExtensionsTests.cs (1)
42var schema = JsonSchema.FromFile(Path.Combine(AppContext.BaseDirectory, "ConfigurationSchema.json"),
Aspire.Cli.EndToEnd.Tests (725)
AgentCommandTests.cs (23)
98var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 153var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 189var vscodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode"); 201var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 203var localSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", "aspire", "SKILL.md"); 204Directory.CreateDirectory(Path.GetDirectoryName(localSkillPath)!); 246Assert.False(Directory.Exists(Path.GetDirectoryName(localSkillPath))); 249var vscodeMcpConfigPath = Path.Combine(vscodePath, "mcp.json"); 282Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills"))); 311var vscodePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".vscode"); 312var mcpConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 379var mcpConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "StarterApp", ".mcp.json"); 381var agentInstructionsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "StarterApp", "AGENTS.md"); 417Assert.False(Directory.Exists(Path.Combine( 444Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 480var executablePathFile = Path.Combine(workspace.WorkspaceRoot.FullName, "cli-executable.txt"); 558var copilotDirectory = scope == "project" ? Path.Combine(root, ".github", "copilot") : Path.Combine(root, ".copilot"); 561(Path.Combine(copilotDirectory, "settings.json"), pluginSettings, expectedPluginSettings), 562(Path.Combine(root, ".claude", "settings.json"), pluginSettings, 564(Path.Combine(scope == "project" ? root : Path.Combine(root, ".config", "opencode"), "opencode.jsonc"), 569Directory.CreateDirectory(Path.GetDirectoryName(path)!);
AgentMcpExcludeFromMcpTests.cs (1)
37var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "McpExcludeApp", "McpExcludeApp.AppHost", "AppHost.cs");
AppHostSyntaxErrorOutputTests.cs (5)
118configureProject(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 256var appHostPath = Path.Combine(projectDirectory, "apphost.cs"); 259File.WriteAllText(Path.Combine(projectDirectory, "BrokenDotNetApp.csproj"), $$""" 285File.WriteAllText(Path.Combine(projectDirectory, "MissingSdkAppHost.csproj"), """ 297File.WriteAllText(Path.Combine(projectDirectory, "apphost.mts"), "const value = ;");
BundleSmokeTests.cs (15)
66var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 67var appHostDirectory = Path.Combine(projectRoot, $"{projectName}.AppHost"); 68var appHostProjectPath = Path.Combine(appHostDirectory, $"{projectName}.AppHost.csproj"); 69var appHostSourcePath = Path.Combine(appHostDirectory, "AppHost.cs"); 70var argsOutputPath = Path.Combine(projectRoot, "apphost-args.txt"); 95var appHostProjectRelativePath = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, appHostProjectPath); 136var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 137var appHostDirectory = Path.Combine(projectRoot, $"{ProjectName}.AppHost"); 138var appHostProjectPath = Path.Combine(appHostDirectory, $"{ProjectName}.AppHost.csproj"); 139var appHostSourcePath = Path.Combine(appHostDirectory, "AppHost.cs"); 140var argsOutputPath = Path.Combine(projectRoot, "apphost-dnx-args.txt"); 191var appHostProjectRelativePath = Path.GetRelativePath(projectRoot, appHostProjectPath); 230var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 231var appHostSourcePath = Path.Combine(projectRoot, "apphost.cs"); 232var argsOutputPath = Path.Combine(projectRoot, "apphost-file-args.txt");
CentralPackageManagementTests.cs (18)
46var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest"); 47var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost"); 48var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj"); 49var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props"); 68File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """ 158var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest"); 159var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost"); 160var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj"); 161var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props"); 179File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """ 281var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "CpmTest"); 282var appHostDir = Path.Combine(projectDir, "CpmTest.AppHost"); 283var appHostCsprojPath = Path.Combine(appHostDir, "CpmTest.AppHost.csproj"); 284var directoryPackagesPropsPath = Path.Combine(projectDir, "Directory.Packages.props"); 299File.WriteAllText(Path.Combine(appHostDir, "Program.cs"), """ 379var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 380var directoryPackagesPropsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"); 415var lsOutput = File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "ls.json"));
ChannelUpdateWorkflowTests.cs (10)
84var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 85var aspireConfigPath = Path.Combine(projectPath, "aspire.config.json"); 114var appHostPath = Path.GetFullPath(Path.Combine(projectPath, appHostRelativePath)); 254var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 266Path.Combine(projectPath, "aspire.config.json"), expectConfigUpdatePreview: true); 296var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 307Path.Combine(projectPath, "aspire.config.json"), expectConfigUpdatePreview: true); 339var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 354Path.Combine(projectPath, "aspire.config.json"), expectConfigUpdatePreview: false);
CompletionTests.cs (12)
34await File.WriteAllTextAsync(Path.Combine(home.FullName, "globalsettings.json"), legacyConfig); 42var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 60Assert.Equal(string.Empty, await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "completion.stderr"))); 61Assert.Equal(string.Empty, await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "suggestions.stderr"))); 62Assert.Equal("completions\n", await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "suggestions.txt"))); 63Assert.Equal("complete -o default -F _aspire_complete aspire\n", await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "registration.txt"))); 64Assert.Equal(["globalsettings.json"], Directory.GetFiles(home.FullName, "*", SearchOption.AllDirectories).Select(Path.GetFileName)); 66Assert.Equal(legacyConfig, await File.ReadAllTextAsync(Path.Combine(home.FullName, "globalsettings.json"))); 89await File.WriteAllTextAsync(Path.Combine(fakeBin.FullName, "aspire"), (""" 110await File.ReadAllBytesAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-arguments.bin"))); 111Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-executed"))); 126await File.ReadAllBytesAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-arguments.bin")));
ConfigDiscoveryTests.cs (7)
53var primaryConfigPath = Path.Combine(workspaceRoot, "Primary", "aspire.config.json"); 54var alternateConfigPath = Path.Combine(workspaceRoot, "Alternate", "aspire.config.json"); 55var alternateAppHostPath = Path.Combine(workspaceRoot, "Alternate", "apphost.cs"); 56var alternateRunMarkerPath = Path.Combine(workspaceRoot, "Alternate", "alternate-run-marker.txt"); 57var workspaceConfigPath = Path.Combine(workspaceRoot, "aspire.config.json"); 161var projectConfigPath = Path.Combine( 163var parentConfigPath = Path.Combine(
ConfigHealingTests.cs (1)
47var configFilePath = Path.Combine(
ConfigMigrationTests.cs (14)
46var aspireHomeDir = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home"); 126var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json"); 127var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json"); 190var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json"); 191var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json"); 235var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json"); 238Path.Combine(aspireHomeDir, "globalsettings.json"), 291var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json"); 292var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json"); 362var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json"); 363var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json"); 443var newConfigPath = Path.Combine(aspireHomeDir, "aspire.config.json"); 444var legacyPath = Path.Combine(aspireHomeDir, "globalsettings.json"); 594return Path.Combine(workspace.Path, "exported-aspire.config.json");
CSharpInitTests.cs (14)
28[Path.Combine(appDirectory.FullName, "package.json")] = """{"name":"existing-web","private":true}""", 29[Path.Combine(appDirectory.FullName, "Incidental.slnx")] = "<Solution />" 33existingFiles[Path.Combine(appDirectory.FullName, "aspire.config.json")] = """{"appHost":{"language":"typescript/nodejs"}}"""; 66var errorOutput = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "init-error.txt")); 82var toolsDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "tools")); 83var projectPath = Path.Combine(toolsDirectory.FullName, "Incidental.csproj"); 86[Path.Combine(workspace.WorkspaceRoot.FullName, "Incidental.sln")] = """ 91[Path.Combine(toolsDirectory.FullName, "Incidental.slnx")] = """ 124Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 125Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json"))); 126var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"))); 141var description = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "resources.json"))); 188var appHostCs = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 189var aspireConfigJson = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json");
CSharpProjectModeInitTests.cs (7)
67var solutionPath = Path.Combine(workspace.WorkspaceRoot.FullName, solutionFileName); 85var workspaceNuGetConfig = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 86var appHostCsproj = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost", "Test.AppHost.csproj"); 139var solutionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"); 141var appHostDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost")); 142var leftoverPath = Path.Combine(appHostDir.FullName, "leftover.txt"); 158var workspaceNuGetConfig = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config");
CustomTemplateTests.cs (11)
33var testDirectory = Path.Combine(repoRoot, "tests", "Aspire.Cli.EndToEnd.Tests"); 37Path.Combine(testDirectory, "Fixtures", "CustomTemplate"), 38Path.Combine(workspace.WorkspaceRoot.FullName, "template")); 43var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "template", ".template.config", "template.json"); 73var sourceLocation = CliE2ETestHelpers.ToContainerPath(Path.Combine(workspace.WorkspaceRoot.FullName, "template"), workspace); 104var listed = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "sources.json")))!.AsObject(); 111var table = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "sources.txt")); 188Assert.Empty(JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "empty-sources.json")))!.AsObject()); 192var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "out"); 195.ToDictionary(path => Path.GetRelativePath(outputDirectory, path).Replace('\\', '/'), File.ReadAllText); 196await VerifyXunit.Verifier.Verify(files).UseDirectory(Path.Combine(testDirectory, "Snapshots"));
DescribeCommandTests.cs (13)
48var appHostDir = Path.Combine(workspace.WorkspaceRoot.FullName, "AspireResourcesTestApp", "AspireResourcesTestApp.AppHost"); 49var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 102using var resourcesJson = JsonDocument.Parse(File.ReadAllText(Path.Combine(appHostDir, "resources.json"))); 145var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "AspireOtlpStatusApp"); 146var appHostDir = Path.Combine(projectDir, "AspireOtlpStatusApp.AppHost"); 147Directory.CreateDirectory(Path.Combine(projectDir, "silent")); 148File.WriteAllText(Path.Combine(projectDir, "silent", "server.js"), "setInterval(() => {}, 60_000);\n"); 150var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 179using var resourcesJson = JsonDocument.Parse(File.ReadAllText(Path.Combine(appHostDir, "resources.json"))); 190var table = File.ReadAllText(Path.Combine(appHostDir, "describe-table.txt")); 238var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, "AspireReplicaTestApp"); 239var appHostDir = Path.Combine(projectDir, "AspireReplicaTestApp.AppHost"); 240var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
DockerComposeDeployWithVolumeTests.cs (2)
48var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 152using var compose = JsonDocument.Parse(File.ReadAllText(Path.Combine(projectDir, "deploy-output", "compose.json")));
DockerDeploymentTests.cs (6)
54var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 55var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 56var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 151var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 152var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 153var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
DocsCommandE2ETests.cs (1)
19var docsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "llms-small.txt");
DoctorCommandTests.cs (9)
44var skillDirectory = workspace.CreateDirectory(Path.Combine(".agents", "skills", "aspire")); 45var skillPath = Path.Combine(skillDirectory.FullName, "SKILL.md"); 66Path.Combine(workspace.Path, "doctor-skills.txt"), TestContext.Current.CancellationToken); 73Path.Combine(workspace.Path, "doctor-skills.json"), TestContext.Current.CancellationToken)); 131Path.Combine(runtimeDirectory.FullName, runtime), 168Path.Combine(workspace.WorkspaceRoot.FullName, "doctor-runtime.txt"), 178Path.Combine(workspace.WorkspaceRoot.FullName, "doctor-runtime.json"), 195Assert.Equal("1", await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "doctor-text.exit"))); 196Assert.Equal("1", await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "doctor-json.exit")));
EmptyAppHostTemplateTests.cs (7)
64var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "DestroySentinel", "apphost.cs"); 79var exitCode = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "destroy-exit.txt")); 80var errorOutput = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "destroy-output.txt")); 81var sentinelPath = Path.Combine(workspace.WorkspaceRoot.FullName, "destroy-apphost-started"); 192var sourcePackage = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "source-template.nupkg")); 275var destinationPath = Path.Combine(destinationFeed.FullName, $"Aspire.ProjectTemplates.{packageVersion}.nupkg"); 319Path.Combine(workspace.FullName, "NuGet.Config"),
EmulatedLocalReleaseBuildTests.cs (8)
88var projectDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 96var appHostCsproj = Path.Combine(projectDir.FullName, $"{projectName}.AppHost", $"{projectName}.AppHost.csproj"); 153var projectDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 154var configPath = Path.Combine(projectDir.FullName, "aspire.config.json"); 239var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 292Path.Combine(workspace.WorkspaceRoot.FullName, "explicit-feed"), 336var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 571var packagePath = Path.Combine(sourceDirectory, $"{packageId}.{packageVersion}.nupkg");
EmulatedReleasedBuildTests.cs (4)
70var projectDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 77var appHostCsproj = Path.Combine(projectDir.FullName, $"{projectName}.AppHost", $"{projectName}.AppHost.csproj"); 128var projectDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 129var configPath = Path.Combine(projectDir.FullName, "aspire.config.json");
EmulatedStagingBuildTests.cs (5)
82await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), $$""" 98var projectDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 103var appHostCsproj = Path.Combine(projectDir.FullName, $"{projectName}.AppHost", $"{projectName}.AppHost.csproj"); 161var projectDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectName)); 162var configPath = Path.Combine(projectDir.FullName, "aspire.config.json");
EntityFrameworkCoreDeploymentTests.cs (8)
137var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 138var targetRuntimePath = Path.Combine(projectDirectory, ".aspire-e2e-rid"); 157var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 158var appHostDirectory = Path.Combine(projectDirectory, $"{ProjectName}.AppHost"); 159var apiDirectory = Path.Combine(projectDirectory, $"{ProjectName}.ApiService"); 162Path.Combine(appHostDirectory, "AppHost.cs"), 214Path.Combine(apiDirectory, "Program.cs"), 252var apiProjectPath = Path.Combine(apiDirectory, $"{ProjectName}.ApiService.csproj");
GoCodegenValidationTests.cs (8)
40existingFiles[Path.Combine(apiDirectory.FullName, "go.mod")] = """ 45existingFiles[Path.Combine(apiDirectory.FullName, "main.go")] = """ 72var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 87Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.go"), 94var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules"); 98var sdkPath = Path.Combine(modulesDir, "aspire.go"); 99var codegenHashPath = Path.Combine(modulesDir, ".codegen-hash"); 127var filePath = Path.Combine(modulesDir, file);
GoEmptyAppHostTemplateTests.cs (3)
75var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 76Assert.True(File.Exists(Path.Combine(projectRoot, "apphost.go")), $"Expected apphost.go in {projectRoot}"); 77Assert.True(File.Exists(Path.Combine(projectRoot, "go.mod")), $"Expected go.mod in {projectRoot}");
GoKubernetesDeployTests.cs (1)
71var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName, "apphost.go");
GoPublishTests.cs (6)
70var dockerComposePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-output", "docker-compose.yaml"); 101Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.go"), 107var artifactsPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "artifacts"); 108var composeContent = await File.ReadAllTextAsync(Path.Combine(artifactsPath, "docker-compose.yaml")); 126Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.go"), 139var dockerfilePath = Path.Combine(artifactsPath, $"{resourceName}.Dockerfile");
GoRootModuleInitTests.cs (11)
27File.WriteAllBytes(Path.Combine(root, "go.mod"), goMod); 28File.WriteAllBytes(Path.Combine(root, "main.go"), mainGo); 31File.WriteAllBytes(Path.Combine(root, "go.work"), goWork); 49Assert.Equal(goMod, File.ReadAllBytes(Path.Combine(root, "go.mod"))); 50Assert.Equal(mainGo, File.ReadAllBytes(Path.Combine(root, "main.go"))); 53Assert.Equal(goWork, File.ReadAllBytes(Path.Combine(root, "go.work"))); 57Assert.False(File.Exists(Path.Combine(root, "go.work"))); 60var appHostRoot = Path.Combine(root, "aspire-apphost"); 61Assert.True(File.Exists(Path.Combine(appHostRoot, "apphost.go"))); 62Assert.True(File.Exists(Path.Combine(appHostRoot, "go.mod"))); 63Assert.True(File.Exists(Path.Combine(appHostRoot, "go.work")));
GoSecretAppHostTests.cs (1)
62await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "listed-secrets.json"), TestContext.Current.CancellationToken));
GoStarterReadinessTests.cs (2)
45var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "GoReady"); 47Assert.True(File.Exists(Path.Combine(projectRoot, "api", "go.sum")));
GoStarterTemplateTests.cs (4)
24var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.go"); 98var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "GoStarterApp"); 99var aspireModulePath = Path.Combine(projectRoot, ".aspire", "modules", "aspire.go"); 104var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(projectRoot, "aspire.config.json")));
Helpers\CliE2EAutomatorHelpers.cs (3)
525var localDirPrScript = AspireCliShellCommandHelpers.QuoteBashArg(Path.Combine(CliE2ETestHelpers.GetRepoRoot(), "eng", "scripts", "get-aspire-cli-pr.sh")); 538var getAspireCliScript = AspireCliShellCommandHelpers.QuoteBashArg(Path.Combine(CliE2ETestHelpers.GetRepoRoot(), "eng", "scripts", "get-aspire-cli.sh")); 744var versionsPropsPath = Path.Combine(CliE2ETestHelpers.GetRepoRoot(), "eng", "Versions.props");
Helpers\CliE2ETestHelpers.cs (28)
412return Path.Combine(repoRoot, "tests", "Shared", "Docker", dockerfileName); 516var dockerfilePath = Path.Combine(repoRoot, "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"); 568var dockerfilePath = Path.Combine(repoRoot, "tests", "Shared", "Docker", "Dockerfile.e2e-podman"); 689if (File.Exists(Path.Combine(dir.FullName, "Aspire.slnx"))) 998var relativePath = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, hostPath); 1009var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props"); 1036var versionsPropsPath = Path.Combine(repoRoot, "eng", "Versions.props"); 1056TestContext.Current.KeyValueStorage[$"CaptureFile:{Path.GetFileName(fileName)}"] = path; 1090Path.Combine(repoRoot, "artifacts", "packages", "Debug", "Shipping"), 1091Path.Combine(repoRoot, "artifacts", "packages", "Release", "Shipping") 1106.Select(Path.GetFileName) 1121if (!packageFiles.Any(file => Path.GetFileName(file).StartsWith("Aspire.Hosting.", StringComparison.OrdinalIgnoreCase))) 1130if (!packageFiles.Any(file => Path.GetFileName(file).StartsWith(prefix, StringComparison.OrdinalIgnoreCase))) 1158Path.Combine(repoRoot, "artifacts", "packages", "Debug", "Shipping"), 1159Path.Combine(repoRoot, "artifacts", "packages", "Release", "Shipping") 1173var fileName = Path.GetFileName(file); 1224var configPath = Path.Combine(projectRoot, "aspire.config.json"); 1254destDir = Path.Combine(destDir, label); 1257using var logWriter = new StreamWriter(Path.Combine( 1272var captureFileName = Path.GetFileName(fileName); 1279var destFile = Path.Combine(destDir, captureFileName); 1291? Path.Combine(githubWorkspace, "testresults") 1292: Path.Combine(AppContext.BaseDirectory, "TestResults"); 1294return Path.Combine(baseDir, "workspaces", testName); 1305var destFile = Path.Combine(destDir, Path.GetFileName(file)); 1311var dirName = Path.GetFileName(dir); 1323CopyDirectory(dir, Path.Combine(destDir, destDirName), log);
Helpers\CliInstallStrategyTests.cs (16)
23var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "selected.tar.gz"); 314Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"), options.DockerfilePath); 392Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"), options.DockerfilePath); 438Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-go"), options.DockerfilePath); 453Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-java"), options.DockerfilePath); 468Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e"), options.DockerfilePath); 498Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e"), options.DockerfilePath); 513Assert.Equal(Path.Combine("/repo", "tests", "Shared", "Docker", "Dockerfile.e2e-polyglot-base"), options.DockerfilePath); 601File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.3.0-preview.1.25175.1.nupkg"), ""); 602File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.linux-x64.13.3.0-preview.1.25175.1.nupkg"), ""); 898File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.3.0-preview.1.12345.1.nupkg"), ""); 920File.WriteAllText(Path.Combine(tempDir.FullName, $"Aspire.Cli.{version}.nupkg"), ""); 938File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.linux-x64.13.3.0.nupkg"), ""); 956File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.3.0.nupkg"), ""); 957File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.13.4.0.nupkg"), ""); 976File.WriteAllText(Path.Combine(tempDir.FullName, "Aspire.Cli.linux-x64.13.3.0.nupkg"), "");
Helpers\ConfigSourceTestContext.cs (24)
31_feedRoot = CliE2ETestHelpers.ToContainerPath(Path.Combine(_root, "integration-feed"), workspace); 35_repository = CliE2ETestHelpers.ToContainerPath(Path.Combine(_root, "configuration source"), workspace); 54await File.WriteAllTextAsync(Path.Combine(context._root, "check-source.cs"), SourceCheckProgram, cancellationToken); 93var directory = Directory.CreateDirectory(Path.Combine(_root, "integration-feed", feed)); 94using var archive = ZipFile.Open(Path.Combine(directory.FullName, $"{id}.1.0.0.nupkg"), ZipArchiveMode.Create); 108var integrations = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_root, "integrations.json"), _cancellationToken))!.AsArray(); 120var appHost = await File.ReadAllTextAsync(Path.Combine(_root, "actual-apphost.cs"), _cancellationToken); 204var consentOutput = await File.ReadAllTextAsync(Path.Combine(_root, "consent.log"), _cancellationToken); 207Assert.False(Directory.Exists(Path.Combine(_root, "SourceApp"))); 217Assert.False(Directory.Exists(Path.Combine(_root, "SourceApp"))); 243Assert.Equal("accepted", await File.ReadAllTextAsync(Path.Combine(_root, "git-authenticated.txt"), _cancellationToken)); 252var log = await File.ReadAllTextAsync(Path.Combine(_root, "actual-git-auth-cli.log"), _cancellationToken); 311var actual = await File.ReadAllTextAsync(Path.Combine(_root, "actual-agent-settings.json"), _cancellationToken); 317Assert.False(Directory.Exists(Path.Combine(_root, "SourceApp", ".agents", "skills"))); 332var directory = Path.GetDirectoryName(appHostPath)!.Replace('\\', '/'); 355await File.ReadAllTextAsync(Path.Combine(_root, "run.log"), _cancellationToken)); 371var output = await File.ReadAllTextAsync(Path.Combine(_root, "source-disabled.log"), _cancellationToken); 382var output = await File.ReadAllTextAsync(Path.Combine(_root, "missing-source.log"), _cancellationToken); 406var appHost = await File.ReadAllTextAsync(Path.Combine(_root, "SourceApp", "apphost.cs"), _cancellationToken); 457return JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(_root, "actual-config.json"), _cancellationToken))!.AsObject(); 461=> (await File.ReadAllTextAsync(Path.Combine(_root, "source-version.txt"), _cancellationToken)).Trim(); 471var directory = Directory.CreateDirectory(Path.Combine(_root, "configuration source", "teams")); 472await File.WriteAllTextAsync(Path.Combine(directory.FullName, "platform.json"), $$""" 503await File.WriteAllTextAsync(Path.Combine(_root, "ssh-probe.cs"), SshProbeProgram, _cancellationToken);
Helpers\GitHttpServer.cs (1)
52startInfo.ArgumentList.Add($"safe.directory={Path.Combine(directory, "template.git")}");
Helpers\GitIgnoreAssertions.cs (1)
12var gitIgnorePath = Path.Combine(projectRoot, ".gitignore");
Helpers\HungCommandDiagnosticsTests.cs (6)
35var home = Path.Combine(workspace.FullName, "home"); 36Directory.CreateDirectory(Path.Combine(home, ".aspire", "logs")); 37await File.WriteAllTextAsync(Path.Combine(home, ".aspire", "logs", "cli_hung.log"), "msbuild -getProperty started", TestContext.Current.CancellationToken); 48var diagnostics = Path.Combine(workspace.FullName, CliE2EAutomatorHelpers.DiagnosticsDirectoryName); 49var snapshot = await File.ReadAllTextAsync(Path.Combine(diagnostics, CliE2EAutomatorHelpers.HungCommandProcessesFileName), TestContext.Current.CancellationToken); 53Assert.Equal("msbuild -getProperty started", await File.ReadAllTextAsync(Path.Combine(diagnostics, "logs", "cli_hung.log"), TestContext.Current.CancellationToken));
Helpers\IntegrationHostLifetimeTestHelper.cs (30)
13var evidence = Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(recording)!, testName)); 20File.Copy(Path.Combine(directory, file), Path.Combine(evidence.FullName, file), overwrite: true); 22File.Copy(Path.Combine(directory, "exported-logs", "session.log"), 23Path.Combine(evidence.FullName, "session.log"), overwrite: true); 25Path.Combine(directory, "integration", "processes.jsonl"), 26Path.Combine(evidence.FullName, "processes.jsonl"), 30File.Copy(Path.Combine(directory, "restart.log"), Path.Combine(evidence.FullName, "restart.log"), overwrite: true); 34File.Copy(Path.Combine(directory, "probe-stalled.log"), Path.Combine(evidence.FullName, "probe-stalled.log"), overwrite: true); 38File.Copy(Path.Combine(directory, "exported-logs", "install-session.log"), 39Path.Combine(evidence.FullName, "install-session.log"), overwrite: true); 40File.Copy(Path.Combine(directory, "install.log"), Path.Combine(evidence.FullName, "install.log"), overwrite: true); 41File.Copy(Path.Combine(directory, "integration", "install-processes.json"), 42Path.Combine(evidence.FullName, "install-processes.json"), overwrite: true); 50var integration = Directory.CreateDirectory(Path.Combine(directory, "integration")); 52Path.Combine(repoRoot, "playground", "TsIntegrationSpike", "kafka-integration", "host-runtime.ts"), 53Path.Combine(integration.FullName, "host-runtime.ts")); 54File.WriteAllText(Path.Combine(integration.FullName, "host.ts"), HostSource); 55File.WriteAllText(Path.Combine(integration.FullName, "package.json"), """ 90File.WriteAllText(Path.Combine(directory, "apphost.mts"), $$""" 99File.WriteAllText(Path.Combine(directory, "process-control.mjs"), ControlSource); 101var configPath = Path.Combine(directory, "aspire.config.json"); 117var integrationDirectory = Path.Combine(directory, "integration"); 118var manifestPath = Path.Combine(integrationDirectory, "package.json"); 122File.WriteAllText(Path.Combine(integrationDirectory, "block-install"), ""); 123File.WriteAllText(Path.Combine(integrationDirectory, "install-lifetime.mjs"), InstallSource);
Helpers\KubernetesDeployTestHelpers.cs (10)
427var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 428var apiDir = Path.Combine(projectDir, $"{projectName}.ApiService"); 430Assert.True(File.Exists(Path.Combine(appHostDir, "AppHost.cs"))); 431Assert.True(File.Exists(Path.Combine(apiDir, $"{projectName}.ApiService.csproj"))); 432Assert.True(File.Exists(Path.Combine(apiDir, "Properties", "launchSettings.json"))); 437var projectFile = Path.Combine(appHostDir, $"{projectName}.AppHost.csproj"); 444var resourceProjectPath = Path.Combine(projectDir, resourceProject, $"{resourceProject}.csproj"); 452output.WriteLine($"Writing AppHost.cs to: {Path.Combine(appHostDir, "AppHost.cs")}"); 453File.WriteAllText(Path.Combine(appHostDir, "AppHost.cs"), appHostCode); 454File.WriteAllText(Path.Combine(apiDir, "Program.cs"), apiProgramCode);
Helpers\KubernetesDeployTestHelpersTests.cs (1)
77var destination = Path.Combine(directory.FullName, "download");
Helpers\LocalDeploymentTestHelpers.cs (4)
16var webDirectory = Path.Combine(projectDir, $"{projectName}.Web"); 17Assert.True(File.Exists(Path.Combine(webDirectory, $"{projectName}.Web.csproj"))); 18Assert.True(File.Exists(Path.Combine(webDirectory, "Properties", "launchSettings.json"))); 19var programPath = Path.Combine(webDirectory, "Program.cs");
Helpers\SecretInputTestHelpers.cs (3)
24var valuePath = Path.Combine(workspace.Path, "secret-value.txt"); 25var sourcePath = Path.Combine(workspace.Path, "secret-source.txt"); 26var patternsPath = Path.Combine(workspace.Path, "secret-log-patterns.txt");
Helpers\TerminalRun.cs (6)
132var diagnosticsSource = Path.Combine(_workspace.WorkspaceRoot.FullName, CliE2EAutomatorHelpers.DiagnosticsDirectoryName); 153WriteTestOutput($"[TerminalRun] {Path.GetFileName(subDir)}/: {fileCount} file(s)"); 175File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), overwrite: true); 180CopyDirectoryIfExists(dir, Path.Combine(destination, Path.GetFileName(dir)));
Helpers\TestDirectoryHelpers.cs (4)
23File.Copy(file, Path.Combine(destination, Path.GetFileName(file))); 28CopyDirectory(dir, Path.Combine(destination, Path.GetFileName(dir)));
Helpers\TypeScriptAppHostToolchainTestHelpers.cs (5)
36var packageJsonPath = Path.Combine(projectRoot, "package.json"); 51var lockFilePath = Path.Combine(projectRoot, lockFileName); 58var nodeModulesPath = Path.Combine(projectRoot, "node_modules"); 178var yarnConfigPath = Path.Combine(projectRoot, YarnConfigurationFileName); 185var yarnLockPath = Path.Combine(projectRoot, "yarn.lock");
IntegrationSourceTests.cs (7)
77using (var archive = ZipFile.Open(Path.Combine(feed.FullName, $"{packageId}.{packageVersion}.nupkg"), ZipArchiveMode.Create)) 115var projectDirectory = Path.Combine(root, "SourceApp"); 116var nugetConfigPath = Path.Combine(projectDirectory, "nuget.config"); 126var packageCacheDirectory = Path.Combine(root, ".nuget-packages", packageId.ToLowerInvariant(), packageVersion); 138await File.ReadAllLinesAsync(Path.Combine(projectDirectory, "apphost.cs"), cancellationToken), 145var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(projectDirectory, "aspire.config.json"), cancellationToken))!; 176var metadata = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(packageCacheDirectory, ".nupkg.metadata"), cancellationToken))!;
JavaCodegenValidationTests.cs (6)
49var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire/modules"); 55var codegenHashPath = Path.Combine(modulesDir, ".codegen-hash"); 58var builderPath = Path.Combine(modulesDir, "aspire", "IDistributedApplicationBuilder.java"); 95var filePath = Path.Combine(modulesDir, Path.Combine(file.Split('/'))); 108var builderJava = File.ReadAllText(Path.Combine(modulesDir, "aspire", "IDistributedApplicationBuilder.java"));
JavaEmptyAppHostTemplateTests.cs (1)
37Path.Combine(workspace.WorkspaceRoot.FullName, "JavaEmptyApp"),
JavaPolyglotApphostDirectoryTests.cs (1)
70var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "javaapp", "AppHost.java");
JavaPolyglotTests.cs (1)
52var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.java");
JavaScriptPublishTests.cs (12)
17private static readonly string s_fixturesDir = Path.Combine( 157var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 192var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 227var appDir = Path.Combine(workspace.WorkspaceRoot.FullName, appName); 234File.WriteAllText(Path.Combine(appDir, "package.json"), $$""" 249File.WriteAllText(Path.Combine(appDir, "yarn.lock"), $$""" 266File.WriteAllText(Path.Combine(appDir, "server.js"), $$""" 291File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "verify-runtime.sh"), $$""" 346File.Copy(file, Path.Combine(workspace.WorkspaceRoot.FullName, Path.GetFileName(file))); 352var targetDir = Path.Combine(workspace.WorkspaceRoot.FullName, Path.GetFileName(fixtureDir));
KubernetesDeployBasicApiServiceTests.cs (1)
110Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployTypeScriptTests.cs (2)
76var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 77var appHostFilePath = Path.Combine(projectDir, "apphost.mts");
KubernetesDeployTypeScriptWithPersistentVolumeTests.cs (3)
91var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 92var appHostFilePath = Path.Combine(projectDir, "apphost.mts"); 93var apiIndexFilePath = Path.Combine(projectDir, "api", "src", "index.ts");
KubernetesDeployWithCertManagerTests.cs (3)
29var fixtureDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "pebble-eab"); 33Path.Combine(fixtureDirectory, "reject-issuer-delete.yaml"), 72var appHostPath = Path.Combine(
KubernetesDeployWithFileKeyRefTests.cs (1)
124Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithGarnetTests.cs (1)
106Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithHelmChartTests.cs (1)
103Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithMongoDBTests.cs (1)
109Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithMySqlTests.cs (1)
103Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithNatsTests.cs (1)
107Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithPersistentVolumeTests.cs (1)
150Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithPostgresTests.cs (1)
103Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithProjectPersistentVolumeTests.cs (1)
131Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithRabbitMQTests.cs (1)
99Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithRedisTests.cs (1)
111Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithSqlServerTests.cs (1)
103Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesDeployWithValkeyTests.cs (1)
106Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
KubernetesPublishRequiresExternalEndpointTests.cs (3)
89var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 90var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 91var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
KubernetesPublishTests.cs (5)
137var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 138var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 139var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 303cleanupProcess.StartInfo.FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "bin", "kind"); 344var appHostFilePath = Path.Combine(
LaunchProfileTests.cs (5)
29File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "LaunchProfile.sln"), "Fake solution file"); 41var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "LaunchProfile.AppHost"); 42var appHostSourcePath = Path.Combine(appHostDirectory, "AppHost.cs"); 43var launchSettingsPath = Path.Combine(appHostDirectory, "Properties", "launchSettings.json"); 44var profileOutputPath = Path.Combine(appHostDirectory, "selected-profile.txt");
LaunchSettingsPortHelpersTests.cs (3)
129var properties = project.CreateSubdirectory(Path.Combine(projectName, "Properties")); 130File.WriteAllText(Path.Combine(properties.FullName, "launchSettings.json"), content); 134Path.Combine(project.FullName, $"{project.Name}.AppHost", "Properties", "launchSettings.json");
LocalConfigMigrationTests.cs (2)
87var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 140var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "StaleConfigApp", "aspire.config.json");
McpDocsE2ETests.cs (9)
333var scriptsDir = Path.Combine(CliE2ETestHelpers.GetRepoRoot(), "eng", "scripts"); 337AspireExecutablePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "bin", "aspire"); 344var prScript = $"bash {AspireCliShellCommandHelpers.QuoteBashArg(Path.Combine(scriptsDir, "get-aspire-cli-pr.sh"))}"; 345var installScript = $"bash {AspireCliShellCommandHelpers.QuoteBashArg(Path.Combine(scriptsDir, "get-aspire-cli.sh"))}"; 355Path.Combine(installPrefix, "bin")), 358$"{AspireCliShellCommandHelpers.GetInstallScriptCommand(strategy, installScript)} --install-path {AspireCliShellCommandHelpers.QuoteBashArg(Path.Combine(installPrefix, "bin"))} {isolatedInstallArgs}", 359Path.Combine(installPrefix, "bin")), 368Path.Combine(installPrefix, "dogfood", $"pr-{prNumber}", "bin")); 371AspireExecutablePath = Path.Combine(cliBinDir, "aspire");
NewChannelNuGetConfigTests.cs (1)
64var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "nuget.config");
OllamaIntegrationTests.cs (4)
52var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 53var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 54var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 74var crashDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName, "crash");
PersistentContainerEndToEndTests.cs (1)
130Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName),
PodmanDeploymentTests.cs (3)
64var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName); 65var appHostDir = Path.Combine(projectDir, $"{ProjectName}.AppHost"); 66var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
ProjectReferenceTests.cs (19)
34CreateRestoreProbePackage(Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed")); 35Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "empty-source")); 76var configPath = Path.Combine(workDir, "aspire.config.json"); 84var integrationDirectory = Directory.CreateDirectory(Path.Combine(workDir, "MyIntegration")); 87File.WriteAllText(Path.Combine(integrationDirectory.FullName, "NuGet.Config"), """ 96File.WriteAllText(Path.Combine(integrationDirectory.FullName, "MyIntegration.csproj"), """ 156File.WriteAllText(Path.Combine(integrationDirectory.FullName, "MyIntegrationExtensions.cs"), """ 197var packagePath = Path.Combine(sourceDirectory, "Custom.RestoreProbe.1.0.0.nupkg"); 246var configPath = Path.Combine(workDir, "aspire.config.json"); 252var integrationDir = Path.Combine(workDir, "MyIntegration"); 255File.WriteAllText(Path.Combine(integrationDir, "MyIntegration.csproj"), $$""" 270var aspireHome = Path.Combine( 272var hivesDir = Path.Combine(aspireHome, "hives"); 279var packagesDir = Path.Combine(hiveDir, "packages"); 282var hiveName = Path.GetFileName(hiveDir); 295File.WriteAllText(Path.Combine(workDir, "nuget.config"), nugetConfig); 298File.WriteAllText(Path.Combine(integrationDir, "MyIntegrationExtensions.cs"), """ 324var modulesDir = Path.Combine(workDir, ".aspire", "modules"); 331File.WriteAllText(Path.Combine(workDir, "apphost.mts"), """
PsCommandTests.cs (1)
99var outputFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "ps-output.json");
PythonReactTemplateTests.cs (1)
36Path.Combine(workspace.WorkspaceRoot.FullName, "AspirePyReactApp"),
RadiusDeployTests.cs (6)
117var appHostFilePath = Path.Combine( 146var appBicepPath = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName, "radius-output", "app.bicep"); 322var appHostFilePath = Path.Combine( 351var appBicepPath = Path.Combine(workspace.WorkspaceRoot.FullName, PostgresProjectName, "radius-output", "app.bicep"); 581var appHostFilePath = Path.Combine( 620var appBicepPath = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName, "radius-output", "app.bicep");
RadiusDotnetProjectDeployTests.cs (1)
27var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName);
RadiusPublishTests.cs (5)
80var appHostFilePath = Path.Combine( 116var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, ProjectName, "radius-output-v1"); 118var appBicepPath = Path.Combine(outputDir, "app.bicep"); 130var bicepConfigPath = Path.Combine(outputDir, "bicepconfig.json"); 161var updatedAppBicepPath = Path.Combine(
RepositoryToolUpdateTests.cs (13)
42var repositoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "repository"); 43var dotnetManifestPath = Path.Combine(repositoryPath, ".config", "dotnet-tools.json"); 44var npmManifestPath = Path.Combine(repositoryPath, "package.json"); 45var probeDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "package-manager-probes"); 46var invocationLogPath = Path.Combine(workspace.WorkspaceRoot.FullName, "package-manager-invocations.log"); 48Directory.CreateDirectory(Path.GetDirectoryName(dotnetManifestPath)!); 49Directory.CreateDirectory(Path.Combine(repositoryPath, ".git")); 108await File.WriteAllBytesAsync(Path.Combine(repositoryPath, name), bytes, cancellationToken); 131Path.Combine(probeDirectory, tool), 217Assert.Equal(bytes, await File.ReadAllBytesAsync(Path.Combine(repositoryPath, name), cancellationToken)); 223Assert.False(File.Exists(Path.Combine(repositoryPath, "lifecycle-ran"))); 224Assert.False(Directory.Exists(Path.Combine(repositoryPath, "node_modules"))); 225Assert.False(File.Exists(Path.Combine(repositoryPath, "aspire.config.json")));
ResourceCommandTests.cs (4)
39var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs"); 136var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs"); 233var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs"); 341var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs");
SdkExportTests.cs (2)
24var scriptPath = Path.Combine(workspace.WorkspaceRoot.FullName, "run-sdk-export.sh"); 25var exportPath = Path.Combine(workspace.WorkspaceRoot.FullName, "sdk-export.json");
SecretDotNetAppHostTests.cs (2)
114var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "DeploymentSecrets", "apphost.cs"); 193await File.WriteAllTextAsync(Path.ChangeExtension(appHostFilePath, ".run.json"), """
SelfUpdateChannelPersistenceTests.cs (2)
71var initialSidecar = ReadSidecar(Path.Combine(workspace.WorkspaceRoot.FullName, "initial-install-sidecar.json")); 85var updatedSidecar = ReadSidecar(Path.Combine(workspace.WorkspaceRoot.FullName, "updated-install-sidecar.json"));
SettledNpmReleasesTests.cs (3)
42File.WriteAllText(Path.Combine(workspace.FullName, "package.json"), """{ "name": "consumer", "version": "1.0.0", "private": true }"""); 43File.WriteAllText(Path.Combine(workspace.FullName, "user.npmrc"), string.Empty); 55var installedManifest = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.FullName, "node_modules", PackageName, "package.json")));
SingleFileAppHostInitDotnetRunTests.cs (3)
67var appHostCs = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 68var aspireConfigJson = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 69var appHostRunJson = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json");
SmokeTests.cs (4)
211var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs"); 247var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 248var configPath = Path.Combine(projectPath, "aspire.config.json"); 250var appHostPath = Path.Combine(projectPath, appHostFileName);
StartStopTests.cs (9)
90Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "Directory.Build.targets"), 129var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs"); 207var bothInstancesPath = Path.Combine(workspace.WorkspaceRoot.FullName, "both-instances.json"); 208var remainingInstancePath = Path.Combine(workspace.WorkspaceRoot.FullName, "remaining-instance.json"); 209var restartedInstancePath = Path.Combine(workspace.WorkspaceRoot.FullName, "restarted-instance.json"); 210var stoppedInstancesPath = Path.Combine(workspace.WorkspaceRoot.FullName, "stopped-instances.json"); 269string.Equals(Path.GetDirectoryName(instance.AppHostPath), primaryCheckout, StringComparison.Ordinal)); 271string.Equals(Path.GetDirectoryName(instance.AppHostPath), linkedCheckout, StringComparison.Ordinal)); 371var assertionScript = Path.Combine(workspace.WorkspaceRoot.FullName, "assert-detached-process-group.py");
StopForceTests.cs (1)
44var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs");
StopNonInteractiveTests.cs (2)
271new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App2")), 272new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App1")));
StopWaitTests.cs (2)
43var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs"); 127var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, "apphost.cs");
TerminalCommandTests.cs (11)
36var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TerminalReplicas"); 37var appHostPath = Path.Combine(projectDirectory, "apphost.cs"); 52File.WriteAllText(Path.Combine(projectDirectory, "TerminalProbe", "Program.cs"), """ 66File.WriteAllText(Path.Combine(projectDirectory, "probe.tape"), ""); 76using var discovery = JsonDocument.Parse(File.ReadAllText(Path.Combine(projectDirectory, "resources.json"))); 105File.ReadAllText(Path.Combine(projectDirectory, "attach-ambiguity.log"))); 110File.ReadAllText(Path.Combine(projectDirectory, "tape-ambiguity.log"))); 127var selectedInput = Path.Combine(projectDirectory, "received", $"{selectedProcessId}.input"); 128var otherInput = Path.Combine(projectDirectory, "received", $"{otherProcessId}.input"); 132File.WriteAllText(Path.Combine(projectDirectory, "probe.tape"), $$""" 167var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TerminalSupportApp", "apphost.mts");
TestCommandTests.cs (7)
44var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TestingApp"); 94File.WriteAllText(Path.Combine(directory, "service.py"), """ 109File.WriteAllText(Path.Combine(directory, "probe.py"), """ 132File.WriteAllText(Path.Combine(directory, "inspect.py"), """ 159File.WriteAllText(Path.Combine(directory, "verify.py"), """ 227File.WriteAllText(Path.Combine(directory, "apphost.mts"), """ 270var appHostPath = Path.Combine(directory, "apphost.cs");
tests\Aspire.Hosting.TestUtilities\Utils\MSBuildUtils.cs (2)
13while (directory != null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
tests\Shared\CliPackageDiscovery.cs (5)
42.Where(path => IsPointerPackageFileName(Path.GetFileName(path))) 44.OrderBy(package => Path.GetFileName(package.PackagePath), StringComparer.OrdinalIgnoreCase) 55$"Found {matches.Count} Aspire.Cli pointer nupkg files in '{packageDirectory}': {string.Join(", ", matches.Select(p => Path.GetFileName(p.PackagePath)))}. Expected exactly one Aspire.Cli.{{version}}.nupkg package."); 83var fileName = Path.GetFileName(packagePath); 102.Select(Path.GetFileName)
tests\Shared\Hex1bTestHelpers.cs (3)
138recordingsDir = Path.Combine(githubWorkspace, "testresults", "recordings"); 143recordingsDir = Path.Combine(AppContext.BaseDirectory, "TestResults", "recordings", localSubDir); 147return Path.Combine(recordingsDir, $"{testName}.cast");
tests\Shared\PebbleAcmeFixture.cs (1)
187var path = Path.Combine(directory, name);
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
TypeScriptBlazorGatewayTests.cs (2)
83var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 96var verificationScriptPath = Path.Combine(workspace.WorkspaceRoot.FullName, "verify-blazor-gateway.sh");
TypeScriptCodegenValidationTests.cs (15)
68var baselineSdkPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules", "aspire.mts"); 70var baselineHashPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules", ".codegen-hash"); 95var lockFilePath = Path.Combine( 104var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 135var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules"); 144var filePath = Path.Combine(modulesDir, file); 157var aspireTs = File.ReadAllText(Path.Combine(modulesDir, "aspire.mts")); 206var modulesDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "modules"); 212var aspireModulePath = Path.Combine(modulesDir, "aspire.mts"); 229var codegenHashPath = Path.Combine(modulesDir, ".codegen-hash"); 254var filePath = Path.Combine(modulesDir, file); 273var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 286var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 337var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 419var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
TypeScriptDotnetProjectBuildConfigurationTests.cs (2)
76var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 90var verificationScriptPath = Path.Combine(workspace.WorkspaceRoot.FullName, "verify-build-configuration.sh");
TypeScriptEmptyAppHostTemplateTests.cs (9)
37var appDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TsEmptyApp"); 40var appHostPath = Path.Combine(appDirectory, "apphost.mts"); 92var appDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TsDeadlockRepro"); 106var extensionDirectory = Directory.CreateDirectory(Path.Combine(appDirectory, "DeadlockExtension")); 108File.WriteAllText(Path.Combine(extensionDirectory.FullName, "DeadlockExtension.csproj"), $$""" 122File.WriteAllText(Path.Combine(extensionDirectory.FullName, "DeadlockExtensions.cs"), """ 162File.WriteAllText(Path.Combine(appDirectory, "apphost.mts"), """ 176var configPath = Path.Combine(appDirectory, "aspire.config.json"); 188var configPath = Path.Combine(appDirectory, "aspire.config.json");
TypeScriptLegacyAppHostTests.cs (11)
107var mtsPath = Path.Combine(projectRoot, "apphost.mts"); 113var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules"); 122File.WriteAllText(Path.Combine(projectRoot, "apphost.ts"), """ 134var configPath = Path.Combine(projectRoot, "aspire.config.json"); 145File.WriteAllText(Path.Combine(projectRoot, "tsconfig.apphost.json"), """ 171var legacyModulesDir = Path.Combine(projectRoot, ".modules"); 180var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules"); 190var filePath = Path.Combine(legacyModulesDir, expectedFile); 217var filePath = Path.Combine(legacyModulesDir, unexpectedFile); 229var aspireTs = File.ReadAllText(Path.Combine(legacyModulesDir, "aspire.ts")); 234$"File path: {Path.Combine(legacyModulesDir, "aspire.ts")}.");
TypeScriptMigrateAppHostTests.cs (13)
98var mtsPath = Path.Combine(projectRoot, "apphost.mts"); 104var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules"); 112File.WriteAllText(Path.Combine(projectRoot, "apphost.ts"), """ 122var configPath = Path.Combine(projectRoot, "aspire.config.json"); 130File.WriteAllText(Path.Combine(projectRoot, "tsconfig.apphost.json"), """ 157var legacyAppHost = Path.Combine(projectRoot, "apphost.ts"); 165var modernAppHost = Path.Combine(projectRoot, "apphost.mts"); 181var legacyModulesDir = Path.Combine(projectRoot, ".modules"); 189var modernModulesDir = Path.Combine(projectRoot, ".aspire", "modules"); 198var filePath = Path.Combine(modernModulesDir, expectedFile); 206var aspireMts = File.ReadAllText(Path.Combine(modernModulesDir, "aspire.mts")); 211$"File path: {Path.Combine(modernModulesDir, "aspire.mts")}."); 215var tsconfig = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "tsconfig.apphost.json")))!.AsObject();
TypeScriptPolyglotApphostDirectoryTests.cs (2)
59var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "tsapp"); 78var appHostPath = Path.Combine(projectRoot, "apphost.mts");
TypeScriptPolyglotTests.cs (26)
82var viteProjectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "viteapp"); 98var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 121var appHostLockFilePath = Path.Combine( 128var viteLockFilePath = Path.Combine( 197var viteProjectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "viteapp"); 208var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 227var appHostLockFilePath = Path.Combine( 234var guestLockFilePath = Path.Combine( 283var lockFilePath = Path.Combine( 352var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 360var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 361var restartCountPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".deno-watch-restart-count"); 426Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), 447var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "packages", "brownfield"); 448var packageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "package.json")))!.AsObject(); 454originalTsConfig = File.ReadAllText(Path.Combine(projectRoot, "tsconfig.json")); 456File.WriteAllText(Path.Combine(projectRoot, "package.json"), packageJson.ToJsonString(new JsonSerializerOptions { WriteIndented = true })); 479packageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "package.json")))!.AsObject(); 496Assert.Equal(originalTsConfig, File.ReadAllText(Path.Combine(projectRoot, "tsconfig.json"))); 497Assert.False(File.Exists(Path.Combine(projectRoot, "tsconfig.apphost.json"))); 498Assert.False(File.Exists(Path.Combine(projectRoot, "apphost.mts"))); 500var appHostDirectory = Path.Combine(projectRoot, "aspire-apphost"); 501var appHostPath = Path.Combine(appHostDirectory, "apphost.mts"); 504var appHostPackageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(appHostDirectory, "package.json")))!.AsObject(); 516Assert.True(File.Exists(Path.Combine(appHostDirectory, "tsconfig.apphost.json"))); 519var configPath = Path.Combine(projectRoot, "aspire.config.json");
TypeScriptPublishTests.cs (22)
15private static readonly string s_jsPublishFixturesDir = Path.Combine( 50var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 122var artifactsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts"); 124var chartPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(claimPath)))!; 126.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(chartPath, "templates", "omitted", "omitted.yaml")), "yaml") 127.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(chartPath, "templates", "parameterized", "parameterized.yaml")), "yaml") 128.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(chartPath, "values.yaml")), "yaml") 129.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(chartPath, "templates", "data-service", "statefulset.yaml")), "yaml"); 139var failureLog = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "callback-failure.log")); 183var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 268var artifactsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts"); 269var composeContent = await File.ReadAllTextAsync(Path.Combine(artifactsPath, "docker-compose.yaml")); 357var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 385var dockerComposePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-output", "docker-compose.yaml"); 432var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 463var envFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts", ".env"); 473var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 506Path.Combine(s_jsPublishFixturesDir, fixtureName), 507Path.Combine(workspace.WorkspaceRoot.FullName, fixtureName)); 513var dockerfilePath = Path.Combine(artifactsPath, $"{resourceName}.Dockerfile");
TypeScriptReusablePackageTests.cs (13)
31var appDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "app")); 32var helperDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "packages", "aspire-commands")); 44var appAppHostPath = Path.Combine(appDirectory.FullName, "apphost.mts"); 57var helperAppHostPath = Path.Combine(helperDirectory.FullName, "apphost.mts"); 69var helperModulesDirectory = Path.Combine(helperDirectory.FullName, ".aspire", "modules"); 71Assert.Contains("addRedis", File.ReadAllText(Path.Combine(helperModulesDirectory, "aspire.mts"))); 93var configPath = Path.Combine(appDirectory.FullName, "aspire.config.json"); 101File.WriteAllText(Path.Combine(appDirectory.FullName, "apphost.mts"), """ 113File.WriteAllText(Path.Combine(appDirectory.FullName, "tsconfig.json"), """ 141File.WriteAllText(Path.Combine(helperDirectory.FullName, "aspire.config.json"), $$""" 155File.WriteAllText(Path.Combine(helperDirectory.FullName, "package.json"), """ 171File.WriteAllText(Path.Combine(helperDirectory.FullName, "tsconfig.json"), """ 194File.WriteAllText(Path.Combine(helperSourceDirectory.FullName, "index.ts"), """
TypeScriptSqlServerNativeAssetsBundleTests.cs (1)
54var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
TypeScriptStarterSmokeTests.cs (4)
50var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "TsStarterApp"); 52var modulesDir = Path.Combine(projectRoot, ".aspire/modules"); 59var aspireModulePath = Path.Combine(modulesDir, "aspire.mts"); 79AssertAspireConfigChannelConsistentWithSdkVersion(Path.Combine(projectRoot, "aspire.config.json"));
TypeScriptStarterTemplateTests.cs (3)
37var projectRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "TsStarterApp"); 39var modulesDir = Path.Combine(projectRoot, ".aspire/modules"); 46var aspireModulePath = Path.Combine(modulesDir, "aspire.mts");
UpdateChannelNuGetConfigOrderingTests.cs (20)
68var packagePath = Path.Combine(feed.FullName, $"{dependencyId}.{dependencyVersion}.nupkg"); 97var projectPath = Path.Combine(root, "AppHost.csproj"); 113var configPath = Path.Combine(root, "aspire.config.json"); 123var nugetPath = Path.Combine(root, "nuget.config"); 140foreach (var path in new[] { projectPath, configPath, nugetPath, Path.Combine(root, "packages.lock.json") }) 181var cachedDependency = Path.Combine(root, ".nuget-packages", dependencyId.ToLowerInvariant(), dependencyVersion); 182Assert.True(File.Exists(Path.Combine(cachedDependency, ".nupkg.metadata"))); 185var assetsPath = Path.Combine(root, "obj", "project.assets.json"); 194await File.ReadAllTextAsync(Path.Combine(root, "dry-run-output.txt"))); 198Assert.True(File.Exists(Path.Combine(cachedDependency, ".nupkg.metadata"))); 228await File.ReadAllTextAsync(Path.Combine(root, "dry-run-exit.txt"))); 287var appHostCsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 288var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 289var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 437var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 438var appHostPath = Path.Combine(projectPath, "apphost.cs"); 439var configPath = Path.Combine(projectPath, "aspire.config.json"); 440var nugetConfigPath = Path.Combine(projectPath, "nuget.config"); 441var restoreMarkerPath = Path.Combine(projectPath, "native-restore.txt"); 442await File.WriteAllTextAsync(Path.Combine(projectPath, "Directory.Build.targets"), """
Aspire.Cli.Tests (5857)
Acquisition\IdentityResolverTests.cs (3)
508=> File.WriteAllText(Path.Combine(directory, InstallSidecarReader.SidecarFileName), json); 580logsDirectory: Path.Combine(workspace.WorkspaceRoot.FullName, "logs"), 581logFilePath: Path.Combine(workspace.WorkspaceRoot.FullName, "logs", "test.log"),
Acquisition\InstallationDiscoveryDiscoverAllTests.cs (54)
39var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "no-sidecar-bin"); 44using var _ = new EnvVarOverride("PATH", pathDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty)); 55var expectedSidecarPath = Path.Combine(pathDir, InstallSidecarReader.SidecarFileName); 69var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "unreadable-bin"); 72var sidecarPath = Path.Combine(pathDir, InstallSidecarReader.SidecarFileName); 101var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "malformed-bin"); 104var sidecarPath = Path.Combine(pathDir, InstallSidecarReader.SidecarFileName); 128var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin"); 131File.WriteAllText(Path.Combine(binDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}"); 163var firstPathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "path-first"); 164var secondPathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "path-second"); 165var offPathDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin"); 196using var pathOverride = new EnvVarOverride("PATH", firstPathDir + Path.PathSeparator + secondPathDir); 218var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin"); 249var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin"); 276var prDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-9999", "bin"); 279File.WriteAllText(Path.Combine(prDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"pr\"}"); 300var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin"); 303File.WriteAllText(Path.Combine(binDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}"); 322var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, hasInstallMetadata ? "metadata-bin" : "no-metadata-bin"); 328File.WriteAllText(Path.Combine(binDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}"); 336using var _ = new EnvVarOverride("PATH", binDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty)); 366var prDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-12345", "bin"); 369File.WriteAllText(Path.Combine(prDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"pr\"}"); 400var prDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-12345", "bin"); 403File.WriteAllText(Path.Combine(prDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"pr\"}"); 435var brewDir = Path.Combine(workspace.WorkspaceRoot.FullName, "Caskroom", "aspire", "13.4.0-pr.17115.gcd700928"); 438File.WriteAllText(Path.Combine(brewDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"brew\"}"); 471var brewDir = Path.Combine(workspace.WorkspaceRoot.FullName, "Caskroom", "aspire", "13.4.0"); 474File.WriteAllText(Path.Combine(brewDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"brew\"}"); 509var binary = Path.Combine(workspace.WorkspaceRoot.FullName, "dogfood", labelName, "bin", "aspire"); 510Directory.CreateDirectory(Path.GetDirectoryName(binary)!); 523var binary = Path.Combine(workspace.WorkspaceRoot.FullName, "staging", "pr-1234", "bin", "aspire"); 524Directory.CreateDirectory(Path.GetDirectoryName(binary)!); 534var binary = Path.Combine(workspace.WorkspaceRoot.FullName, "dogfood", "pr-9876", "bin", "aspire"); 574var pathDir = Path.Combine(workspace.WorkspaceRoot.FullName, "no-sidecar-bin"); 578using var _ = new EnvVarOverride("PATH", pathDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty)); 606var staleDogfoodDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood", "pr-9999"); 637var dogfoodRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "dogfood"); 680var toolStore = Path.Combine(workspace.WorkspaceRoot.FullName, ".dotnet", "tools", ".store", "aspire.cli"); 762var releaseBinDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "bin"); 765File.WriteAllText(Path.Combine(releaseBinDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"script\"}"); 792var releaseBinDir = Path.Combine(aspireHome.FullName, "bin"); 795File.WriteAllText(Path.Combine(releaseBinDir, InstallSidecarReader.SidecarFileName), "{\"source\":\"localhive\"}"); 815logFilePath: Path.Combine(root.FullName, "test.log"), 847var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, "firmlink-self-bin"); 856binDir + Path.PathSeparator + (Environment.GetEnvironmentVariable("PATH") ?? string.Empty)); 922var binDir = Path.Combine(workspace.WorkspaceRoot.FullName, "hint-bin"); 925var fakeCanonical = Path.Combine(workspace.WorkspaceRoot.FullName, "deliberately-different-canonical-path", "aspire"); 958return resolved?.FullName ?? Path.GetFullPath(path); 962return Path.GetFullPath(path); 996logFilePath: Path.Combine(root.FullName, "test.log"), 1009var path = Path.Combine(dir, name); 1027File.WriteAllText(Path.Combine(dir, InstallSidecarReader.SidecarFileName), $"{{\"source\":\"{source}\"}}");
Acquisition\InstallSidecarReaderTests.cs (8)
45var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 143var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 162var sidecarPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 235var sidecarPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 251var sidecarPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 267var sidecarPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 285var sidecarPath = Path.Combine(workspace.WorkspaceRoot.FullName, InstallSidecarReader.SidecarFileName); 363var path = Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName);
Acquisition\InstallSidecarWriterTests.cs (5)
15var sidecarPath = Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName); 54var sidecarPath = Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName); 63var sidecarPath = Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName); 77var sidecarPath = Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName); 97var sidecarPath = Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName);
Acquisition\InstallSourceDetectorTests.cs (29)
25var binaryDirectory = workspace.CreateDirectory(Path.Combine("mise", "installs", "aspire", "13.5.0")); 26File.WriteAllText(Path.Combine(binaryDirectory.FullName, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"}"""); 31var detector = CreateDetector(Path.Combine(binaryDirectory.FullName, "aspire.exe"), environment, new TestWindowsRegistryReader(true)); 47File.WriteAllText(Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName), sidecar); 49var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), TestEnvironment.CreateLinux()); 74var detector = CreateDetector(Path.Combine(workspace.Path, "dotnet"), environment); 91var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), environment); 102var processPath = Path.Combine(workspace.Path, "aspire.exe"); 125var detector = CreateDetector(Path.Combine(workspace.Path, "aspire"), TestEnvironment.CreateLinux(), registry); 138var detector = CreateDetector(Path.Combine(workspace.Path, "aspire.exe"), TestEnvironment.CreateWindows(), registry); 161var processPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar)); 181[variable] = Path.Combine(workspace.Path, root) + Path.DirectorySeparatorChar 183var processPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar)); 200var root = Path.Combine("/tmp", workspace.WorkspaceRoot.Name, "custom"); 203var installsRoot = variable == "MISE_DATA_DIR" ? Path.Combine(processRoot, "installs") : processRoot; 206[variable] = configuredRoot + Path.DirectorySeparatorChar 208var detector = CreateDetector(Path.Combine(installsRoot, "aspire", "13.5.0", "aspire"), environment); 220var processPath = Path.Combine(workspace.Path, "MISE", "INSTALLS", "ASPIRE", "13.5.0", windows ? "ASPIRE.EXE" : "aspire"); 233var directory = workspace.CreateDirectory(Path.Combine("mise", "installs", "aspire", "13.5.0")); 236File.WriteAllText(Path.Combine(directory.FullName, InstallSidecarReader.SidecarFileName), sidecar); 242var detector = CreateDetector(Path.Combine(directory.FullName, "aspire"), environment); 253var processPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar)); 265var processPath = Path.Combine(installDirectory.FullName, "aspire"); 267File.WriteAllText(Path.Combine(installDirectory.FullName, InstallSidecarReader.SidecarFileName), """{"source":"brew"}"""); 268var linkPath = Path.Combine(workspace.Path, "aspire");
Acquisition\PeerInstallProbeTests.cs (6)
69var missing = Path.Combine(workspace.WorkspaceRoot.FullName, "does-not-exist"); 367var pidFile = Path.Combine(workspace.WorkspaceRoot.FullName, "descendant.pid"); 431var pidFile = Path.Combine(workspace.WorkspaceRoot.FullName, "peer.pid"); 564var argvFile = Path.Combine(workspace.WorkspaceRoot.FullName, "argv.txt"); 574? Path.Combine(workspace.WorkspaceRoot.FullName, "peer.cmd") 575: Path.Combine(workspace.WorkspaceRoot.FullName, "peer");
Acquisition\WingetRegistryProbeTests.cs (3)
25var sidecarPath = Path.Combine(workspace.Path, SidecarFileName); 44var sidecarPath = Path.Combine(workspace.Path, SidecarFileName); 89var sidecarPath = Path.Combine(workspace.Path, SidecarFileName);
Agents\AgentConfigurationTestContext.cs (6)
38["ProgramFiles"] = Path.Combine(Workspace.WorkspaceRoot.FullName, "system"), 39["ProgramData"] = Path.Combine(Workspace.WorkspaceRoot.FullName, "system-data") 78var hooks = Path.Combine(ExecutionContext.AspireHomeDirectory.FullName, "hooks"); 80.Replace("{sh}", Escape(Path.Combine(hooks, "track-telemetry.sh"))) 81.Replace("{ps1}", Escape(Path.Combine(hooks, "track-telemetry.ps1"))); 119Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Agents\AgentConfigurationTests.cs (57)
32var path = Path.Combine(_context.Project.FullName, "settings.json"); 55var path = Path.Combine(_context.Project.FullName, "settings.json"); 81var path = Path.Combine(_context.Project.FullName, "settings.json"); 108var path = Path.Combine(_context.Project.FullName, "settings.json"); 133var directory = Path.Combine(_context.Project.FullName, "missing"); 134var path = Path.Combine(directory, "settings.json"); 151var path = Path.Combine(_context.Project.FullName, "settings.json"); 173var path = Path.Combine(_context.Project.FullName, "settings.json"); 242var directory = Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.d"); 243var fragment = Path.Combine(directory, "team.json"); 278var directory = Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.d"); 285await File.WriteAllTextAsync(Path.Combine(directory, ".ignored.json"), "{malformed"); 316Assert.Equal([path], Directory.GetFiles(Path.GetDirectoryName(path)!)); 324var path = Path.Combine(_context.Project.FullName, "settings.json"); 325var target = Path.Combine(_context.Project.FullName, "linked.json"); 355var path = Path.Combine(_context.Project.FullName, "settings.json"); 401var path = Path.Combine(_context.Project.FullName, "settings.json"); 434var path = Path.Combine(_context.Project.FullName, "settings.json"); 461var path = Path.Combine(_context.Project.FullName, "settings.json"); 525Assert.Equal(Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json"), 537Assert.Equal(Path.Combine(_context.CopilotDirectory, "settings.json"), Assert.Single(userResults).TargetPath); 538var project = await File.ReadAllTextAsync(Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json")).DefaultTimeout(); 539var user = await File.ReadAllTextAsync(Path.Combine(_context.CopilotDirectory, "settings.json")).DefaultTimeout(); 541Assert.False(Directory.Exists(Path.Combine(_context.Project.FullName, ".vscode"))); 549var userPath = Path.Combine(_context.ClaudeDirectory, "settings.json"); 576var project = await File.ReadAllTextAsync(Path.Combine(_context.Project.FullName, ".claude", "settings.json")).DefaultTimeout(); 590var path = local ? Path.Combine(_context.Project.FullName, ".claude", "settings.local.json") 640var higher = Path.Combine(_context.Project.FullName, overridePath); 657_context.SetVariable("COPILOT_HOME", Path.Combine(_context.Project.FullName, ".github", "copilot")); 659var lower = Path.Combine(_context.Project.FullName, ".claude", "settings.json"); 677var lower = Path.Combine(_context.Project.FullName, claudePath); 726Path.Combine(Path.GetDirectoryName(target)!, "settings.local.json"), 733Path.Combine(managedDirectory, "managed-settings.json"), 762var local = Path.Combine(Path.GetDirectoryName(target)!, "settings.local.json"); 766var managed = Path.Combine(managedDirectory, "managed-settings.json"); 792var managed = Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.json"); 793var fragment = Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.d", "team.json"); 810var copilotLocal = Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.local.json"); 811var claudeLocal = Path.Combine(_context.Project.FullName, ".claude", "settings.local.json"); 828? Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.d", "team.json") 829: Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.json"); 831var target = Path.Combine(_context.Project.FullName, ".claude", "settings.json"); 864var user = Path.Combine(_context.ClaudeDirectory, "settings.json"); 867var target = Path.Combine(_context.Project.FullName, ".claude", "settings.json"); 882var custom = Path.Combine(_context.Home.FullName, "claude-work"); 884var state = Path.Combine(custom, ".claude.json"); 891Assert.True(File.Exists(Path.Combine(custom, "settings.json"))); 892Assert.False(File.Exists(Path.Combine(_context.Home.FullName, ".claude.json"))); 899_context.SetVariable("COPILOT_HOME", Path.Combine(_context.Project.FullName, ".github", "copilot")); 904Assert.Equal(Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json"), results[0].TargetPath); 932_context.SetVariable("COPILOT_HOME", Path.Combine(_context.ClaudeDirectory, suffix)); 933var path = Path.Combine(_context.ClaudeDirectory, "settings.json"); 937Path.Combine(_context.ClaudeManagedDirectory, "managed-settings.json"), 953var unreadable = Path.Combine(_context.Project.FullName, ".github", "copilot", "settings.json"); 960Assert.True(File.Exists(Path.Combine(_context.Project.FullName, ".claude", "settings.json")));
Agents\AgentInstructionsFileTests.cs (39)
20var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "My App.AppHost", "My App.AppHost.csproj"); 32var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 48var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 66var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 67var target = Path.Combine(workspace.WorkspaceRoot.FullName, "CLAUDE.md"); 85var real = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "real")); 86var link = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 89var appHost = PathNormalizer.ResolveSymlinks(Path.Combine(real.FullName, "App", "apphost.cs")); 97await File.ReadAllTextAsync(Path.Combine(link, AgentInstructionsFile.FileName))); 104var real = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere", "App")); 105var link = Path.Combine(workspace.WorkspaceRoot.FullName, "app"); 108var change = await AgentInstructionsFile.WriteAsync(workspace.WorkspaceRoot, Path.Combine(link, "apphost.cs"), false, CancellationToken.None); 121var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 122var target = Path.Combine(workspace.WorkspaceRoot.FullName, "CLAUDE.md"); 139var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 156var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 176var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 197var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 214workspace.WorkspaceRoot, Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), false, CancellationToken.None); 224var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 240var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 254var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 270var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 284var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 298var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 312var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 328var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 358Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 368var repository = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo")); 369var shared = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "shared")); 370var target = Path.Combine(shared.FullName, "AGENTS.md"); 372var link = Path.Combine(repository.FullName, AgentInstructionsFile.FileName); 377interactionService, repository, Path.Combine(repository.FullName, "apphost.cs"), false, CancellationToken.None); 381await AgentInstructionsFile.WriteAsync(repository, Path.Combine(repository.FullName, "apphost.cs"), false, CancellationToken.None)); 395var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 410var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 425var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 443var appHost = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 455Path.Combine(workspace.WorkspaceRoot.FullName, AgentInstructionsFile.FileName);
Agents\AgentPathTests.cs (11)
26: Path.Combine(_context.Home.FullName, relative.Replace('/', Path.DirectorySeparatorChar)); 29Assert.Equal(Path.Combine(expected, ".claude.json"), ClaudeCodePaths.GetGlobalMcpConfigPath(_context.ExecutionContext, _context.Environment)); 41var expected = Path.Combine(_context.Home.FullName, "custom-config"); 44Assert.Equal(Path.Combine(expected, "settings.json"), 46Assert.Equal(Path.Combine(expected, "mcp-config.json"), 55Assert.Equal(Path.Combine(_context.Project.FullName, "~other-user"), AgentPath.Expand("~other-user", _context.ExecutionContext)); 65var path = Path.Combine(_context.Workspace.Path, directory, ".agents", "skills", "aspire", "SKILL.md"); 74var path = Path.Combine(project.FullName, ".agents", "skills", "aspire", "SKILL.md"); 82var homePath = Path.Combine(_context.Home.FullName, "config.json"); 83var projectPath = Path.Combine(_context.Project.FullName, "config.json");
Agents\ClaudeCodeAgentEnvironmentScannerTests.cs (4)
22var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 59? new DirectoryInfo(workspace.WorkspaceRoot.FullName + Path.DirectorySeparatorChar) 108Directory.CreateDirectory(Path.Combine(workingDirectory.FullName, ".claude")); 111Directory.CreateDirectory(Path.Combine(selectedRoot.FullName, ".claude"));
Agents\CopilotAgentEnvironmentScannerTests.cs (2)
19var appPath = Path.Combine(workspace.CreateDirectory("Applications").FullName, "GitHub-Copilot-linux-arm64.AppImage"); 103var configPath = Path.Combine(configDirectory.FullName, "mcp-config.json");
Agents\CopilotAppInstallationDetectorTests.cs (18)
20var appPath = Path.Combine(appDirectory.FullName, fileName); 25? string.Join(Path.PathSeparator, workspace.CreateDirectory("bin").FullName, appDirectory.FullName) 41await File.WriteAllTextAsync(Path.Combine(appDirectory.FullName, fileName), 58Path.Combine(localAppData.FullName, "Programs", "GitHub Copilot")); 60Path.Combine(appDirectory.FullName, "github.exe"), 67var executablePath = Path.Combine(appDirectory.FullName, "github.exe"); 76var appBundlePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Applications", "GitHub Copilot.app"); 102Path.Combine(".local", "share", "applications")); 104Path.Combine(applicationsDirectory.FullName, "github-copilot.desktop"), 111var desktopEntryPath = Path.Combine(applicationsDirectory.FullName, "github-copilot.desktop"); 123var rootDirectory = Path.DirectorySeparatorChar.ToString(); 127Path.Combine(workspace.WorkspaceRoot.FullName, ".local", "share", "applications"), 128Path.Combine(rootDirectory, "usr", "local", "share", "applications"), 129Path.Combine(rootDirectory, "usr", "share", "applications"), 145Path.PathSeparator, 154Path.Combine(dataHome.FullName, "applications"), 155Path.Combine(firstDataDirectory.FullName, "applications"), 156Path.Combine(secondDataDirectory.FullName, "applications"),
Agents\LocalAspireSkillsTests.cs (23)
26var skills = Path.Combine(_context.Project.FullName, ".agents", "skills"); 29await AgentConfigurationTestContext.WriteAsync(Path.Combine(skills, name, "references", "notes.md"), "local skill"); 31await AgentConfigurationTestContext.WriteAsync(Path.Combine(skills, "aspire-custom", "SKILL.md"), "unrelated"); 32await AgentConfigurationTestContext.WriteAsync(Path.Combine(skills, "playwright-cli", "SKILL.md"), "unrelated"); 38names.Select(name => (Path.Combine(skills, name), AgentConfigurationScope.Project)).OrderBy(entry => entry.Item1, StringComparers.FileSystemPath), 53.Select(root => Path.Combine(root.FullName, directory, skills, "aspire")).ToArray(); 56await AgentConfigurationTestContext.WriteAsync(Path.Combine(path, "SKILL.md"), "active local skill"); 59Path.Combine(parent.FullName, "sibling", directory, skills, "aspire", "SKILL.md"), "unrelated"); 61Path.Combine(_context.Workspace.Path, directory, skills, "aspire", "SKILL.md"), "outside the workspace"); 73var project = Path.Combine(_context.Project.FullName, ".agents", "skills", "aspire-init"); 74var user = Path.Combine(_context.Home.FullName, ".agents", "skills", "aspireify"); 75await AgentConfigurationTestContext.WriteAsync(Path.Combine(project, "SKILL.md"), "project"); 76await AgentConfigurationTestContext.WriteAsync(Path.Combine(user, "SKILL.md"), "user"); 77await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Home.FullName, ".claude", "skills", "aspire", "SKILL.md"), "claude"); 78await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.CopilotDirectory, "skills", "aspire", "SKILL.md"), "copilot"); 91var skill = Path.Combine(_context.Home.FullName, ".agents", "skills", "aspire"); 92await AgentConfigurationTestContext.WriteAsync(Path.Combine(skill, "SKILL.md"), "shared"); 102await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.CopilotDirectory, "installed-plugins", "aspire", "skills", "aspire", "SKILL.md"), "installed"); 103await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Project.FullName, "unrelated", ".agents", "skills", "aspire", "SKILL.md"), "unrelated"); 112var selected = Path.Combine(_context.Project.FullName, ".agents", "skills", "aspire"); 113await AgentConfigurationTestContext.WriteAsync(Path.Combine(selected, "SKILL.md"), "selected"); 114await AgentConfigurationTestContext.WriteAsync(Path.Combine(outside.FullName, ".agents", "skills", "aspire", "SKILL.md"), "outside"); 115await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.Workspace.Path, ".agents", "skills", "aspire", "SKILL.md"), "ancestor");
Agents\OpenCodeAgentClientTests.cs (34)
19var workingDirectory = _context.Project.CreateSubdirectory(Path.Combine("apps", "api")); 22var nestedConfig = Path.Combine(workingDirectory.FullName, "opencode.json"); 28Assert.Equal(Path.Combine(_context.Project.FullName, "opencode.jsonc"), target); 46var lowerPath = Path.Combine(_context.Project.FullName, "opencode.json"); 47var ownerPath = Path.Combine(_context.Project.FullName, ".opencode", "opencode.json"); 48var higherPath = Path.ChangeExtension(ownerPath, ".jsonc"); 74var json = Path.Combine(_context.Project.FullName, "opencode.json"); 75var jsonc = Path.ChangeExtension(json, ".jsonc"); 104var json = Path.Combine(directory, "opencode.json"); 105var jsonc = Path.ChangeExtension(json, ".jsonc"); 125var json = Path.Combine(_context.Project.FullName, "opencode.json"); 126var jsonc = Path.ChangeExtension(json, ".jsonc"); 144var path = Path.Combine(_context.Project.FullName, "opencode.json"); 156var path = Path.Combine(_context.Project.FullName, "opencode.json"); 190var root = Path.Combine(_context.Project.FullName, "opencode.jsonc"); 193var path = Path.Combine(_context.Project.FullName, ".opencode", "opencode.jsonc"); 214var path = Path.Combine(_context.Project.FullName, "opencode.json"); 240var path = Path.Combine(_context.Project.FullName, "opencode.json"); 250await AgentConfigurationTestContext.WriteAsync(Path.Combine(_context.OpenCodeDirectory, "opencode.json"), inherited); 257Assert.Equal(inherited, await File.ReadAllTextAsync(Path.Combine(_context.OpenCodeDirectory, "opencode.json"))); 265var path = Path.Combine(_context.Project.FullName, "opencode.json"); 266var global = Path.Combine(_context.OpenCodeDirectory, "opencode.json"); 291var path = Path.Combine(_context.Project.FullName, "opencode.json"); 307var json = Path.Combine(directory, "opencode.json"); 308var jsonc = Path.Combine(directory, "opencode.jsonc"); 344? Path.Combine(_context.Project.FullName, "~", "custom-opencode") 345: Path.Combine(_context.Home.FullName, "custom-opencode"); 346_context.SetVariable("OPENCODE_CONFIG_DIR", relative ? Path.Combine("~", "custom-opencode") : customDirectory); 347var inherited = Path.Combine(_context.OpenCodeDirectory, "opencode.json"); 355Assert.Equal(Path.Combine(customDirectory, "opencode.jsonc"), result.TargetPath); 368var selected = Path.Combine(_context.Home.FullName, "selected", "custom.jsonc"); 369var customDirectory = Path.Combine(_context.Home.FullName, "custom-opencode"); 372var other = Path.Combine(customDirectory, "opencode.jsonc"); 373var normal = Path.Combine(_context.OpenCodeDirectory, "opencode.json");
Agents\OpenCodeAgentEnvironmentScannerTests.cs (1)
24var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileName);
Agents\PlaywrightCliInstallerTests.cs (113)
22var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}"); 39var directory = Path.Combine(root.FullName, scopeName, clientFolder, "skills", PlaywrightCliInstaller.PlaywrightCliSkillName); 41await File.WriteAllTextAsync(Path.Combine(directory, "SKILL.md"), "existing skill"); 42await File.WriteAllTextAsync(Path.Combine(directory, "stale.md"), "existing reference"); 53var directory = Path.Combine(stagingRoot, FakePlaywrightCliRunner.SkillBaseDirectory, PlaywrightCliInstaller.PlaywrightCliSkillName); 54Directory.CreateDirectory(Path.Combine(directory, "references")); 55File.WriteAllText(Path.Combine(directory, "SKILL.md"), "generated skill"); 56File.WriteAllText(Path.Combine(directory, "references", "commands.md"), "generated commands"); 59var generatedDirectory = Path.Combine(stagingRoot, folder, "skills", PlaywrightCliInstaller.PlaywrightCliSkillName); 61File.WriteAllText(Path.Combine(generatedDirectory, "SKILL.md"), "unselected generated skill"); 67var sharedDirectory = Path.Combine(root.FullName, scope, ".agents", "skills"); 72Path.Combine(root.FullName, scope, ".claude", "skills") 88files.Add(Path.GetRelativePath(root.FullName, path).Replace('\\', '/'), await File.ReadAllTextAsync(path)); 111new HashSet<string> { Path.Combine(root.FullName, ".agents", "skills") }, CancellationToken.None); 134var blockedPath = Path.Combine(root.FullName, "blocked"); 137var destination = Path.Combine(root.FullName, "skills"); 158Assert.Equal("# Playwright CLI Skill", await File.ReadAllTextAsync(Path.Combine(destination, PlaywrightCliInstaller.PlaywrightCliSkillName, "SKILL.md"))); 191new HashSet<string> { Path.Combine(root.FullName, "skills") }, CancellationToken.None); 224var skillDirectory = Path.Combine(directory, FakePlaywrightCliRunner.SkillBaseDirectory, PlaywrightCliInstaller.PlaywrightCliSkillName); 226var skillFile = Path.Combine(skillDirectory, "SKILL.md"); 235var destination = Path.Combine(root.FullName, "skills"); 241var installedFile = Path.Combine(destination, PlaywrightCliInstaller.PlaywrightCliSkillName, "SKILL.md"); 250Directory.Delete(Path.GetDirectoryName(readOnlyFile)!, recursive: true); 327var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}"); 428var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}"); 430var tarballPath = Path.Combine(tempDir, "package.tgz"); 476var tarballPath = Path.Combine(tempDir, "package.tgz"); 519var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}"); 521var tarballPath = Path.Combine(tempDir, "package.tgz"); 563var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}"); 565var tarballPath = Path.Combine(tempDir, "package.tgz"); 612var tempPath = Path.Combine(tempDir, "package.tgz"); 704var tempDir = Path.Combine(Path.GetTempPath(), $"test-playwright-{Guid.NewGuid():N}"); 706var tarballPath = Path.Combine(tempDir, "package.tgz"); 858var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-mirror-test-{Guid.NewGuid():N}"); 871var skillDir = Path.Combine(repoRoot, ".claude", "skills", "playwright-cli"); 873File.WriteAllText(Path.Combine(skillDir, "SKILL.md"), "# Playwright CLI Skill"); 874Directory.CreateDirectory(Path.Combine(skillDir, "subdir")); 875File.WriteAllText(Path.Combine(skillDir, "subdir", "extra.md"), "Extra content"); 892Path.Combine(".claude", "skills"), 893Path.Combine(".agents", "skills") 902Path.Combine(".agents", "skills", "playwright-cli", "SKILL.md"), 903Path.Combine(".agents", "skills", "playwright-cli", "subdir", "extra.md"), 904Path.Combine(".claude", "skills", "playwright-cli", "SKILL.md"), 905Path.Combine(".claude", "skills", "playwright-cli", "subdir", "extra.md") 908.Select(path => Path.GetRelativePath(tempDir, path)).Order(StringComparer.Ordinal)); 909Assert.Equal("# Playwright CLI Skill", await File.ReadAllTextAsync(Path.Combine(tempDir, ".agents", "skills", "playwright-cli", "SKILL.md"))); 923var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-sync-test-{Guid.NewGuid():N}"); 924var sourceDir = Path.Combine(tempDir, "source"); 925var targetDir = Path.Combine(tempDir, "target"); 931File.WriteAllText(Path.Combine(sourceDir, "keep.md"), "keep"); 935File.WriteAllText(Path.Combine(targetDir, "keep.md"), "old content"); 936File.WriteAllText(Path.Combine(targetDir, "stale.md"), "should be removed"); 937Directory.CreateDirectory(Path.Combine(targetDir, "stale-dir")); 938File.WriteAllText(Path.Combine(targetDir, "stale-dir", "old.md"), "should be removed"); 943Assert.Equal("keep", File.ReadAllText(Path.Combine(targetDir, "keep.md"))); 946Assert.False(File.Exists(Path.Combine(targetDir, "stale.md"))); 947Assert.False(Directory.Exists(Path.Combine(targetDir, "stale-dir"))); 961var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-cleanup-test-{Guid.NewGuid():N}"); 974var skillDir = Path.Combine(repoRoot, ".claude", "skills", "playwright-cli"); 976File.WriteAllText(Path.Combine(skillDir, "SKILL.md"), "# Playwright CLI Skill"); 994Path.Combine(".agents", "skills") 999Assert.True(File.Exists(Path.Combine(tempDir, ".agents", "skills", "playwright-cli", "SKILL.md"))); 1002Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude", "skills", "playwright-cli"))); 1016var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-preexist-test-{Guid.NewGuid():N}"); 1022var preExistingDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli"); 1024await File.WriteAllTextAsync(Path.Combine(preExistingDir, "SKILL.md"), "# User's existing skill"); 1047Path.Combine(".agents", "skills") 1066var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-emptydir-test-{Guid.NewGuid():N}"); 1079var skillDir = Path.Combine(repoRoot, ".claude", "skills", "playwright-cli"); 1081File.WriteAllText(Path.Combine(skillDir, "SKILL.md"), "# Playwright CLI Skill"); 1098Path.Combine(".agents", "skills") 1103Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude", "skills"))); 1105Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude"))); 1119var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}"); 1125var skillDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli"); 1133Path.Combine(".claude", "skills")); 1135Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude", "skills"))); 1136Assert.False(Directory.Exists(Path.Combine(tempDir, ".claude"))); 1151var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}"); 1157var skillDir = Path.Combine(tempDir, ".claude", "skills", "playwright-cli"); 1159Directory.CreateDirectory(Path.Combine(tempDir, ".claude", "skills", "other-skill")); 1165Path.Combine(".claude", "skills")); 1168Assert.True(Directory.Exists(Path.Combine(tempDir, ".claude", "skills"))); 1169Assert.True(Directory.Exists(Path.Combine(tempDir, ".claude", "skills", "other-skill"))); 1183var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}"); 1189var skillDir = Path.Combine(tempDir, ".agents", "playwright-cli"); 1199Assert.False(Directory.Exists(Path.Combine(tempDir, ".agents"))); 1215var tempDir = Path.Combine(Path.GetTempPath(), $"aspire-rmparent-test-{Guid.NewGuid():N}"); 1221var deepDir = Path.Combine(tempDir, "a", "b", "c", "d", "e"); 1231Path.Combine("a", "b")); 1234Assert.False(Directory.Exists(Path.Combine(tempDir, "a", "b", "c", "d"))); 1235Assert.False(Directory.Exists(Path.Combine(tempDir, "a", "b", "c"))); 1236Assert.False(Directory.Exists(Path.Combine(tempDir, "a", "b"))); 1238Assert.True(Directory.Exists(Path.Combine(tempDir, "a"))); 1276PackResult = Path.Combine(outputDirectory, "package.tgz"); 1335var directory = Path.Combine(workingDirectory, FakePlaywrightCliRunner.SkillBaseDirectory, PlaywrightCliInstaller.PlaywrightCliSkillName); 1337File.WriteAllText(Path.Combine(directory, "SKILL.md"), "# Playwright CLI Skill");
Agents\SkillSourceTests.cs (2)
321await AgentConfigurationTestContext.WriteAsync(Path.Combine(app.FullName, "aspire.config.json"), """ 325var source = Assert.Single(SkillSource.Resolve(app, new FileInfo(Path.Combine(context.Home.FullName, "aspire.config.json"))));
Agents\TelemetryHookConfiguratorTests.cs (41)
30var hookFile = Path.Combine(home.FullName, ".copilot", "hooks", "aspire-telemetry.json"); 60Assert.True(File.Exists(Path.Combine(home.FullName, ".copilot", "hooks", "aspire-telemetry.json"))); 61Assert.True(File.Exists(Path.Combine(home.FullName, ".claude", "settings.json"))); 62Assert.False(Directory.Exists(Path.Combine(home.FullName, ".aspire", "hooks"))); 70var copilotHome = Path.Combine(workspace.WorkspaceRoot.FullName, "copilot-home-file"); 84Assert.True(File.Exists(Path.Combine(home.FullName, ".claude", "settings.json"))); 101Assert.True(File.Exists(Path.Combine(copilotHome.FullName, "hooks", "aspire-telemetry.json"))); 102Assert.False(Directory.Exists(Path.Combine(home.FullName, ".copilot"))); 142var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 143var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json"); 181var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 182var legacyHooks = Directory.CreateDirectory(Path.Combine(home.FullName, ".aspire", "hooks")); 183var legacyShellScript = Path.Combine(legacyHooks.FullName, "track-telemetry.sh"); 184var legacyPowerShellScript = Path.Combine(legacyHooks.FullName, "track-telemetry.ps1"); 202await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"), settings.ToJsonString()).DefaultTimeout(); 232var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 233await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"), 256var legacyHooks = Path.Combine(home.FullName, ".aspire", "hooks"); 258.Replace("{sh}", JsonEncodedText.Encode(Path.Combine(legacyHooks, "track-telemetry.sh")).ToString()) 259.Replace("{ps1}", JsonEncodedText.Encode(Path.Combine(legacyHooks, "track-telemetry.ps1")).ToString()); 260var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 261await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"), 278var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 293await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"), settings.ToJsonString()).DefaultTimeout(); 314var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 315var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json"); 340var claude = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 343var host = string.Equals(Path.GetFileNameWithoutExtension(Environment.ProcessPath), "dotnet", StringComparison.OrdinalIgnoreCase) 345: Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"); 350["args"] = new JsonArray(Path.Combine(workspace.Path, assemblyName), "agent", "telemetry", "--hook") 363await File.WriteAllTextAsync(Path.Combine(claude.FullName, "settings.json"), settings.ToJsonString()); 383var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 384var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json"); 400var claudeDirectory = Directory.CreateDirectory(Path.Combine(home.FullName, ".claude")); 401var settingsPath = Path.Combine(claudeDirectory.FullName, "settings.json"); 425Assert.True(File.Exists(Path.Combine(home.FullName, ".claude", "settings.json"))); 426Assert.False(Directory.Exists(Path.Combine(home.FullName, ".copilot"))); 442Assert.False(Directory.Exists(Path.Combine(home.FullName, ".aspire", "hooks"))); 443Assert.False(Directory.Exists(Path.Combine(home.FullName, ".copilot"))); 444Assert.False(Directory.Exists(Path.Combine(home.FullName, ".claude"))); 449var settingsPath = Path.Combine(home.FullName, ".claude", "settings.json");
Agents\VsCodeAgentEnvironmentScannerTests.cs (2)
73var configPath = Path.Combine(configDirectory.FullName, "mcp.json"); 136homeDirectory: new DirectoryInfo(Path.Combine(workingDirectory.FullName, "fake-home")));
AssemblyMetadataChannelTests.cs (2)
41var csprojPath = Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Aspire.Cli.csproj"); 61while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "global.json")))
Backchannel\AppHostCliBackchannelTests.cs (4)
36var tempFile = Path.Combine(tempDir.FullName, "large.bin"); 63var socketPath = Path.Combine(tempDir.FullName, "apphost.sock"); 96var socketPath = Path.Combine(tempDir.FullName, "apphost.sock"); 142var tempFile = Path.Combine(tempDir.FullName, "small.bin");
Backchannel\AppHostConnectionResolverTests.cs (26)
35var configPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 60Assert.False(File.Exists(Path.Combine(projectFile.Directory!.FullName, AspireConfigFile.FileName))); 100string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("TestAppHost", "TestAppHost.csproj")), 132string.Format(CultureInfo.CurrentCulture, SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("TestAppHost", "TestAppHost.csproj")), 555var realProjectFile = new FileInfo(Path.Combine(realDirectory.FullName, "TestAppHost.csproj")); 559var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 561var projectFileViaSymlink = new FileInfo(Path.Combine(symlinkDirectory, "TestAppHost.csproj")); 599var projectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "TestAppHost.csproj")); 602var differentlyCasedProjectPath = Path.Combine( 646Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 652var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 760Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 766var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 799Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 805var appHostDirectory = workspace.WorkspaceRoot.CreateSubdirectory(Path.Combine("src", "MyApp.AppHost")); 806var appHostPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj"); 841Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 847var configuredAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost", "MyApp.AppHost.csproj"); 848var otherAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "Other.AppHost", "Other.AppHost.csproj"); 919var commonGitDirectory = Path.Combine(primaryCheckout.FullName, ".git"); 921var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryCheckout.FullName, ".worktrees", "feature")).FullName; 923return Path.Combine(worktreeRoot, "AppHost", "AppHost.csproj"); 929var projectFile = new FileInfo(Path.Combine(directory.FullName, fileName)); 944var backchannelsDir = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch"); 948var appHostId = Path.GetFileName(prefix); 949var socketPath = Path.Combine(
Backchannel\AuxiliaryBackchannelMonitorTests.cs (49)
85CreateLiveOwnerSocketPath(homeDirectory), Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj")); 129var appHostPath = Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj"); 182CreateLiveOwnerSocketPath(homeDirectory), Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj")); 213CreateLiveOwnerSocketPath(homeDirectory), Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj")); 250CreateLiveOwnerSocketPath(homeDirectory), Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj")); 286var actualPath = Path.Combine(directory.FullName, "CaseSensitive.AppHost.csproj"); 288var caseVariant = Path.Combine( 313var uppercaseDirectoryPath = Path.Combine( 322var lowercaseAppHostPath = Path.Combine(lowercaseDirectory.FullName, "AppHost.csproj"); 323var uppercaseAppHostPath = Path.Combine(uppercaseDirectory.FullName, "AppHost.csproj"); 337var missingPath = Path.Combine( 352var existingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Existing.AppHost.csproj"); 353var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Missing.AppHost.csproj"); 379var actualPath = Path.Combine(caseSensitiveDirectory.FullName, "CaseSensitive.AppHost.csproj"); 380var caseVariant = Path.Combine(caseSensitiveDirectory.FullName, "casesensitive.apphost.csproj"); 411var firstTarget = Path.Combine(workspace.WorkspaceRoot.FullName, "first.csproj"); 412var secondTarget = Path.Combine(workspace.WorkspaceRoot.FullName, "second.csproj"); 415var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "current.csproj"); 452var appHostPath = Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj"); 554var compactPath = Path.Combine(compactDirectory, $"{BackchannelConstants.ComputeAppHostId("AppHost.cs")}a1b2C3d4.{int.MaxValue}"); 555var legacyPath = Path.Combine(legacyDirectory, $"auxi.sock.abc123def4567890.{int.MaxValue}"); 594Directory.CreateDirectory(Path.GetDirectoryName(legacyDirectory)!); 622var socketPath = Path.Combine(homeDirectory.FullName, "stale-socket"); 660var realDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "real")); 661var symlinkDirectory = Path.Combine(tempRoot.FullName, "link"); 665var appHostPathViaReal = Path.Combine(realDirectory.FullName, "apphost.cs"); 669var appHostPathViaSymlink = Path.Combine(symlinkDirectory, "apphost.cs"); 684var workingDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "wd")).FullName; 685var outsideAppHost = Path.Combine(tempRoot.FullName, "other", "apphost.cs"); 698Assert.False(AuxiliaryBackchannelMonitor.IsAppHostInScopeOfDirectory(null, Path.GetTempPath())); 699Assert.False(AuxiliaryBackchannelMonitor.IsAppHostInScopeOfDirectory(string.Empty, Path.GetTempPath())); 709Directory.CreateDirectory(Path.Combine(primaryRoot, ".git")); 710var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName; 711TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git")); 713var primaryAppHost = Path.Combine(primaryRoot, "AppHost.csproj"); 714var nestedAppHost = Path.Combine(worktreeRoot, "AppHost.csproj"); 734Directory.CreateDirectory(Path.Combine(primaryRoot, ".git")); 735var submoduleRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, "extern", "dep")).FullName; 738Path.Combine(primaryRoot, ".git", "modules", "dep")); 740var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj"); 756Directory.CreateDirectory(Path.Combine(primaryRoot, ".git")); 757var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName; 758var adminDirectory = TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git")); 759var submoduleRoot = Directory.CreateDirectory(Path.Combine(worktreeRoot, "extern", "dep")).FullName; 760TestGitWorktree.WriteGitDirFile(submoduleRoot, Path.Combine(adminDirectory, "modules", "dep")); 761var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj"); 919var appHostId = BackchannelConstants.ComputeAppHostId(Path.Combine(homeDirectory.FullName, "MyApp.AppHost.csproj")); 920var socketPath = Path.Combine(backchannelsDirectory, $"{appHostId}a1b2C3d4.{Environment.ProcessId}"); 952logFilePath: Path.Combine(homeDirectory.FullName, "test.log"),
Backchannel\BackchannelConstantsTests.cs (43)
16var appHostPath = Path.Combine("path", "to", "MyApp.AppHost.csproj"); 17var homeDirectory = Path.Combine(Path.GetTempPath(), "testuser"); 21var fileName = Path.GetFileName(socketPrefix); 24var dir = Path.GetDirectoryName(socketPrefix); 26Assert.Equal(Path.Combine(homeDirectory, ".aspire", "cli", "bch"), dir); 68var fileName = Path.GetFileName(socketPrefix); 82var fileName = Path.GetFileName(socketPrefix); 93var oldSocketPath = Path.Combine(homeDirectory, ".aspire", "cli", "backchannels", "auxi.sock.3a579b6853b74a71.fee67dd76369.26688"); 257var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 263var appHostId = Path.GetFileName(prefix); 265var socket1 = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.12345"); 266var socket2 = Path.Combine(backchannelsDir, $"{appHostId}Z9y8X7w6.67890"); 270var otherSocket = Path.Combine(backchannelsDir, "differentId1a1b2C3d4.99999"); 285var legacyBackchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels"); 292var oldFormatSocket = Path.Combine(legacyBackchannelsDir, $"auxi.sock.{hash}"); 295var legacyPidSocket = Path.Combine(legacyBackchannelsDir, $"auxi.sock.{hash}.12345"); 310var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 316var appHostId = Path.GetFileName(prefix); 319var badSeparator = Path.Combine(backchannelsDir, $"{appHostId}AbCdEfGhX12345"); 323var badPid = Path.Combine(backchannelsDir, $"{appHostId}AbCdEfGh.notapid"); 336var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 342var otherSocket = Path.Combine(backchannelsDir, "differentId1a1b2C3d4.99999"); 354var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 364var appHostId = Path.GetFileName(prefix); 368var orphanedSocket = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.{deadPid}"); 369var liveSocket = Path.Combine(backchannelsDir, $"{appHostId}Z9y8X7w6.{currentPid}"); 370var pidlessSocket = Path.Combine(backchannelsDir, appHostId); 399var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 402var projectFileViaSymlink = Path.Combine(symlinkDirectory, "TestAppHost.csproj"); 416var backchannelsDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 420var appHostId = Path.GetFileName( 422var socketPath = Path.Combine(backchannelsDirectory, $"{appHostId}A{index:D7}.{currentPid}"); 451var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 454var realProjectPath = Path.Combine(realDirectory.FullName, "TestAppHost.csproj"); 456var projectFileViaSymlink = Path.Combine(symlinkDirectory, "TestAppHost.csproj"); 530var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 537var socket = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.12345"); 552var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 566var appHostId = Path.GetFileName(upperPrefix); 568var socket = Path.Combine(backchannelsDir, $"{appHostId}a1b2C3d4.12345"); 588var backchannelsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cli", "backchannels"); 598var legacySocket = Path.Combine(backchannelsDir, $"auxi.sock.{legacyHash}.a1b2c3d4e5f6.99999");
Backchannel\OrphanedAppHostCollectorTests.cs (1)
369var path = Path.Combine(directory.FullName, name);
BundleNuGetServiceTests.cs (1)
17var managedPath = Path.Combine(tempDir.FullName, "aspire-managed");
Bundles\BundleServiceCrossRouteExtractionTests.cs (5)
71var processPath = Path.Combine(root, ToNativePath(relativeProcessPath)); 72var binaryDir = Path.GetDirectoryName(processPath)!; 78var sidecarPath = Path.Combine(binaryDir, ".aspire-install.json"); 91_ => Path.Combine(root, ToNativePath(relativeExpectedExtractDir)) 112=> forwardSlashPath.Replace('/', Path.DirectorySeparatorChar);
BundleServiceComputeDefaultExtractDirTests.cs (23)
32var prefixDir = Path.Combine(workspace.Path, "aspire"); 33var binDir = Path.Combine(prefixDir, "bin"); 36var binaryPath = Path.Combine(binDir, ExeName("aspire")); 38File.WriteAllText(Path.Combine(binDir, SidecarFileName), $"{{\"source\":\"{source}\"}}"); 55var prDir = Path.Combine(workspace.Path, "dogfood", "pr-12345"); 56var binDir = Path.Combine(prDir, "bin"); 59var binaryPath = Path.Combine(binDir, ExeName("aspire")); 61File.WriteAllText(Path.Combine(binDir, SidecarFileName), "{\"source\":\"pr\"}"); 76var installDir = Path.Combine(workspace.Path, "WindowsApps", "Microsoft.Aspire_8wekyb3d8bbwe"); 79var binaryPath = Path.Combine(installDir, "aspire.exe"); 81File.WriteAllText(Path.Combine(installDir, SidecarFileName), "{\"source\":\"winget\"}"); 103var cellarDir = Path.Combine(workspace.Path, "Caskroom", "aspire", "13.2.0"); 105var cellarBinary = Path.Combine(cellarDir, "aspire"); 107File.WriteAllText(Path.Combine(cellarDir, SidecarFileName), "{\"source\":\"brew\"}"); 109var brewBinDir = Path.Combine(workspace.Path, "bin"); 111var symlinkPath = Path.Combine(brewBinDir, "aspire"); 118Assert.NotEqual(Path.GetDirectoryName(brewBinDir), result); 130var ridDir = Path.Combine( 144var binaryPath = Path.Combine(ridDir, ExeName("aspire")); 146File.WriteAllText(Path.Combine(ridDir, SidecarFileName), "{\"source\":\"dotnet-tool\"}"); 160var prefixDir = Path.Combine(workspace.Path, "nix", "store", "aspire"); 161var binDir = Path.Combine(prefixDir, "bin"); 164var binaryPath = Path.Combine(binDir, ExeName("aspire"));
BundleServiceIntegrationTests.cs (81)
49var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName); 55var bundleLink = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 62var managedExe = Path.Combine(bundleLink, 67var dashboardExe = Path.Combine(bundleLink, 71Assert.True(File.Exists(Path.Combine(bundleLink, BundleDiscovery.DashboardDirectoryName, "wwwroot", "index.html"))); 126var dashboardDir = Path.Combine(layoutRoot, BundleDiscovery.DashboardDirectoryName); 127var dashboardDataDir = Path.Combine(dashboardDir, dataDirectoryName, "run-1"); 129var databasePath = Path.Combine(dashboardDataDir, "dashboard.db"); 133File.WriteAllText(Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), "dashboard"); 158var legacyDashboardDir = Path.Combine(layoutRoot, BundleDiscovery.DashboardDirectoryName); 159Directory.CreateDirectory(Path.Combine(legacyDashboardDir, "wwwroot")); 160File.WriteAllText(Path.Combine(legacyDashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), "dashboard"); 161File.WriteAllText(Path.Combine(legacyDashboardDir, "wwwroot", "index.html"), "<html></html>"); 192var dashboardExe = Path.Combine( 230var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 234"blazor" => Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName, "wwwroot", "_framework", "blazor.web.js"), 235"sqlite" => Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName, sqliteLibraryName), 278var v1BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v1", "cli-v1"); 279var v2BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v2", "cli-v2-longer"); 292var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName); 313var managedExe = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName, 333var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName); 337Directory.CreateDirectory(Path.Combine(versionsDir, "stale-aaaaaaaaaaaaaaaa")); 338Directory.CreateDirectory(Path.Combine(versionsDir, $"stale{BundleService.TempSuffixPrefix}deadbeef")); 339Directory.CreateDirectory(Path.Combine(versionsDir, $"stale{BundleService.BadSuffixPrefix}99999")); 374Assert.False(Directory.Exists(Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName))); 383var destinationPath = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 384var lockedFilePath = Path.Combine(sourcePath, "locked.dll"); 415var binDir = Path.Combine(layoutRoot, ".fake-bins"); 423File.WriteAllText(Path.Combine(binDir, ".aspire-install.json"), "{\"source\":\"script\"}"); 429var versionsDir = Path.Combine(layoutRoot, BundleService.VersionsDirectoryName); 443Path.GetFullPath(v1VersionDir), 444Path.GetFullPath(managedPath!), 446var expectedTrayPath = includeTray ? Path.Combine(v1VersionDir, TrayExecutablePath) : null; 470var versionsDir = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName); 471var staleVersionDir = Path.Combine(versionsDir, "stale-version"); 485var versionsDir = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName); 486var staleVersionDir = Path.Combine(versionsDir, "stale-version"); 487var leasesDir = Path.Combine(staleVersionDir, BundleVersionLease.LeasesDirectoryName); 489File.WriteAllText(Path.Combine(leasesDir, "orphan.lease"), "{}"); 506var versionsDir = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName); 507var staleVersionDir = Path.Combine(versionsDir, "stale-version"); 508var leasesDir = Path.Combine(staleVersionDir, BundleVersionLease.LeasesDirectoryName); 510File.WriteAllText(Path.Combine(leasesDir, "unknown.lease"), "{}"); 550var ridDir = Path.Combine( 566File.WriteAllText(Path.Combine(ridDir, ".aspire-install.json"), "{\"source\":\"dotnet-tool\"}"); 574var bundleLink = Path.Combine(ridDir, BundleDiscovery.BundleDirectoryName); 579var managedExe = Path.Combine(bundleLink, 598var binaryDir = workspace.CreateDirectory(Path.Combine("package", "lib", "aspire-cli")).FullName; 600File.WriteAllText(Path.Combine(binaryDir, ".aspire-install.json"), "{\"source\":\"nix\"}"); 603var symlinkPath = Path.Combine(workspace.CreateDirectory("bin").FullName, "aspire"); 608var bundleDir = Path.Combine(binaryDir, BundleDiscovery.BundleDirectoryName); 630var managedPath = Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName, 657var binaryDir = Path.Combine(workspace.WorkspaceRoot.FullName, "opt", "aspire-readonly", "bin"); 663var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "home", ".aspire"); 690var bundleLink = Path.Combine(aspireHome, BundleDiscovery.BundleDirectoryName); 694var managedExe = Path.Combine(bundleLink, 701Directory.Exists(Path.Combine(binaryDir, BundleDiscovery.BundleDirectoryName)), 704Directory.Exists(Path.Combine(Path.GetDirectoryName(binaryDir)!, BundleDiscovery.BundleDirectoryName)), 710var versionsDir = Path.Combine(aspireHome, BundleService.VersionsDirectoryName); 718Path.GetFullPath(activeVersionDir), 719Path.GetFullPath(managedPath!), 744var managedExe = Path.Combine(dest, BundleDiscovery.ManagedDirectoryName, 751Assert.True(Directory.Exists(Path.Combine(dest, BundleDiscovery.DcpDirectoryName))); 766var v1BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v1", "cli-v1"); 767var v2BinaryPath = CreateFakeCliBinary(Path.Combine(layoutRoot, ".fake-bins"), "aspire-v2", "cli-v2-longer"); 775var bundleLink = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 905var linkPath = Path.Combine(layoutRoot, dir); 925var path = Path.Combine(directory, name); 938var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 939var managedDir = Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName); 940var dcpDir = Path.Combine(bundleDir, BundleDiscovery.DcpDirectoryName); 942var managedExe = Path.Combine(managedDir, managedExeName); 955Managed = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.ManagedDirectoryName), 956Dashboard = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DashboardDirectoryName), 957Dcp = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName), 964var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 967LayoutComponent.Managed => Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName, 969LayoutComponent.Dashboard => Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName), 970LayoutComponent.Dcp => Path.Combine(bundleDir, BundleDiscovery.DcpDirectoryName),
BundleServiceTests.cs (31)
77var processPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 131var managedExe = Path.Combine(dir, BundleDiscovery.ManagedDirectoryName, 147var dashboardDir = Path.Combine(dir, BundleDiscovery.DashboardDirectoryName); 148var dashboardExe = Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 160var frameworkDir = Path.Combine(dashboardDir, "wwwroot", "_framework"); 162File.WriteAllText(Path.Combine(frameworkDir, "blazor.web.js"), "blazor"); 164File.WriteAllText(Path.Combine(dashboardDir, sqliteLibraryName), "sqlite"); 179var sqliteLibrary = Path.Combine(dir, BundleDiscovery.DashboardDirectoryName, sqliteLibraryName); 204var wwwrootDir = Path.Combine(dir, BundleDiscovery.DashboardDirectoryName, "wwwroot"); 205var frameworkDir = Path.Combine(wwwrootDir, "_framework"); 206var blazorScript = Path.Combine(frameworkDir, "blazor.web.js"); 235Directory.Delete(Path.Combine(dir, BundleDiscovery.DcpDirectoryName), recursive: true); 246File.Delete(BundleDiscovery.GetDcpExecutablePath(Path.Combine(dir, BundleDiscovery.DcpDirectoryName))); 283var versionsRoot = Path.Combine(workspace.WorkspaceRoot.FullName, BundleService.VersionsDirectoryName); 287Directory.CreateDirectory(Path.Combine(versionsRoot, active)); 288Directory.CreateDirectory(Path.Combine(versionsRoot, "stale-bbbbbbbbbbbbbbbb")); 289Directory.CreateDirectory(Path.Combine(versionsRoot, $"active{BundleService.TempSuffixPrefix}deadbeef")); 290Directory.CreateDirectory(Path.Combine(versionsRoot, $"active{BundleService.BadSuffixPrefix}99999")); 294Assert.True(Directory.Exists(Path.Combine(versionsRoot, active))); 295var remaining = Directory.EnumerateDirectories(versionsRoot).Select(Path.GetFileName).ToArray(); 311Directory.CreateDirectory(Path.Combine(dir, BundleDiscovery.BundleDirectoryName)); 320var path = Path.Combine(root, "terminalhost", file); 321Directory.CreateDirectory(Path.GetDirectoryName(path)!); 325var managedDir = Path.Combine(root, BundleDiscovery.ManagedDirectoryName); 328Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 331var dashboardDir = Path.Combine(root, BundleDiscovery.DashboardDirectoryName); 334Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 336var frameworkDir = Path.Combine(dashboardDir, "wwwroot", "_framework"); 338File.WriteAllText(Path.Combine(frameworkDir, "blazor.web.js"), "blazor"); 341File.WriteAllText(Path.Combine(dashboardDir, sqliteLibraryName), "sqlite"); 343var dcpDir = Path.Combine(root, BundleDiscovery.DcpDirectoryName);
Caching\AppHostInfoDiskCacheTests.cs (49)
29var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json")); 36var path = Path.Combine(workspace.WorkspaceRoot.FullName, name); 58var cacheDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info"); 170var objDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "obj")); 171var assetsPath = Path.Combine(objDir.FullName, "project.assets.json"); 189File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"), "<Project />"); 199File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 212var cacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info"); 249var cacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info"); 288var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyHost")); 289var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 296var commonProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Common.props"); 352var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj")); 353var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 358File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """ 364var sharedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "shared")); 365var sharedProps = Path.Combine(sharedDirectory.FullName, "Directory.Build.props"); 389var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj")); 390var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 392File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """ 398var sharedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "shared")); 399var sharedProps = Path.Combine(sharedDirectory.FullName, "Directory.Build.props"); 422var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj")); 423var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 425File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """ 447var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj")); 448var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 453File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """ 476var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyHost")); 477var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 484File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Common"), ""); 485var commonProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Aspire.Common.props"); 556var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "proj")); 557var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 562File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"), """ 567File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "repo", "Directory.Build.props"), """ 592var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyHost")); 593var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyHost.csproj")); 600File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Repo.marker"), ""); 601var customProps = Path.Combine(workspace.WorkspaceRoot.FullName, "Custom.props"); 725projectDir = Directory.CreateDirectory(Path.Combine(projectDir, $"level-{i}")).FullName; 728var projectFile = new FileInfo(Path.Combine(projectDir, "Deep.AppHost.csproj")); 732File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"), "<Project />"); 743var parentImport = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"); 746var repoRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "worktree-root")); 748Path.Combine(repoRoot.FullName, ".git"), 749$"gitdir: {Path.Combine(workspace.WorkspaceRoot.FullName, ".git", "worktrees", "worktree-root")}"); 751var projectDir = Directory.CreateDirectory(Path.Combine(repoRoot.FullName, "src", "AppHost")); 752var projectFile = new FileInfo(Path.Combine(projectDir.FullName, "AppHost.csproj"));
Caching\DiskCacheTests.cs (4)
118var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search"); 126var name = Path.GetFileNameWithoutExtension(entry); 129var oldName = Path.Combine(Path.GetDirectoryName(entry)!, $"{hash}.{oldUnix}.json");
Certificates\CertificateServiceTests.cs (3)
251return Path.Combine(directory, "aspire-dev-cert-test.pem"); 267Assert.Equal(Path.Combine(aspireHomeDirectory.FullName, "dev-certs"), exportDirectory); 686Assert.Contains(CertificateHelpers.GetDevCertsTrustPath(new HostEnvironment()), environmentVariables["SSL_CERT_DIR"].Split(Path.PathSeparator));
Certificates\DeveloperCertificateCacheWriteTests.cs (4)
27var userHttpsCertificateLocation = Path.Combine(homePath, ".aspnet", "dev-certs", "https"); 36var onDiskPfxPath = Path.Combine(userHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx"); 42var cachedPfxPath = Path.Combine(aspireDevCertsCacheDirectory, $"{aspireLookup}.pfx"); 43var cachedKeyPath = Path.Combine(aspireDevCertsCacheDirectory, $"{aspireLookup}.key");
Certificates\MacOSCertificateManagerTests.cs (3)
24var home = Directory.CreateDirectory(Path.Combine(workspace.Path, "home with spaces")).FullName; 25var tool = Path.Combine(workspace.Path, "security"); 26var argumentsPath = Path.Combine(workspace.Path, "security-arguments");
Certificates\NativeCertificateToolRunnerTests.cs (2)
95var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "dev-certs"); 99var expectedPath = Path.Combine(outputDirectory, $"aspire-dev-cert-{hash}.pem");
Certificates\UnixCertificateManagerTests.cs (24)
212var missingProfileDirectory = Path.Combine(homeDirectory.FullName, "missing-profile"); 248var missingProfileDirectory = Path.Combine(homeDirectory.FullName, "missing-profile"); 324["DOTNET_DEV_CERTS_NSSDB_PATHS"] = $"firefox={Path.PathSeparator}chromium=" 362var certificatePath = Path.Combine(homeDirectory.FullName, "certificate with spaces.pem"); 388var certificatePath = Path.Combine(homeDirectory.FullName, "certificate with spaces.pem"); 409var nssDbDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "nssdb")); 410var parentPidFile = Path.Combine(tempDirectory.FullName, "certutil-parent.pid"); 411var childPidFile = Path.Combine(tempDirectory.FullName, "certutil-child.pid"); 460var nssDbDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "nssdb")); 501["PATH"] = Path.Combine(openSslDirectory.FullName, "missing-tools"), 503["DOTNET_DEV_CERTS_NSSDB_PATHS"] = Path.Combine(openSslDirectory.FullName, "missing-nss-db") 509var certificatePath = Path.Combine(openSslDirectory.FullName, $"aspnetcore-localhost-{certificate.Thumbprint}.pem"); 536["PATH"] = Path.Combine(corruptOpenSslDirectory.FullName, "missing-tools"), 537["SSL_CERT_DIR"] = string.Join(Path.PathSeparator, corruptOpenSslDirectory.FullName, validOpenSslDirectory.FullName), 538["DOTNET_DEV_CERTS_NSSDB_PATHS"] = Path.Combine(corruptOpenSslDirectory.FullName, "missing-nss-db") 545File.WriteAllText(Path.Combine(corruptOpenSslDirectory.FullName, certificateFileName), "not a certificate"); 546File.WriteAllText(Path.Combine(validOpenSslDirectory.FullName, certificateFileName), certificate.ExportCertificatePem()); 571["PATH"] = Path.Combine(openSslDirectory.FullName, "missing-tools"), 572["DOTNET_DEV_CERTS_NSSDB_PATHS"] = Path.Combine(openSslDirectory.FullName, "missing-nss-db"), 580var certificatePath = Path.Combine(openSslDirectory.FullName, $"aspnetcore-localhost-{savedCertificate.Thumbprint}.pem"); 606["PATH"] = Path.Combine(nssDbDirectory.FullName, "missing-certutil"), 633var certUtilFile = new FileInfo(Path.Combine(directory.FullName, "certutil")); 657var certUtilFile = new FileInfo(Path.Combine(directory.FullName, "certutil")); 690var path = Path.Combine([homeDirectory.FullName, .. pathSegments]);
CliBootstrapTests.cs (30)
73var home = Path.Combine(workspace.Path, ".aspire"); 74var configuredHome = Path.Combine(workspace.Path, "workspace-config-home"); 81Assert.StartsWith(Path.Combine(context.AspireHomeDirectory.FullName, "tmp") + Path.DirectorySeparatorChar, storage.GetTempPath()); 168Assert.Equal(Path.Combine(aspireHome.FullName, "cache"), context.CacheDirectory.FullName); 172var cacheDirectory = Path.Combine(context.CacheDirectory.FullName, "tuf"); 173foreach (var directory in new[] { cacheDirectory, Path.Combine(cacheDirectory, "targets") }) 201var tufDirectory = Directory.CreateDirectory(Path.Combine(aspireHome.FullName, "cache", "tuf")); 202Directory.CreateDirectory(Path.Combine(tufDirectory.FullName, "targets")); 274Assert.Equal(Path.Combine(aspireHome.FullName, "cache"), context.CacheDirectory.FullName); 275var cacheDirectory = Path.Combine(context.CacheDirectory.FullName, "tuf"); 325File.WriteAllText(Path.Combine(aspireHome.FullName, AspireConfigFile.FileName), globalConfig); 360var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-pr-test"); 361var binaryPath = WriteBinaryWithSidecar(Path.Combine(installPrefix, "dogfood", "pr-17159", "bin"), InstallSourceExtensions.PrWire); 365Assert.Equal(Path.Combine(installPrefix, "logs"), loggingOptions.LogsDirectory); 366Assert.Equal(loggingOptions.LogsDirectory, Path.GetDirectoryName(loggingOptions.LogFilePath)); 373var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-pr-test"); 374var binaryDir = Path.Combine(installPrefix, "dogfood", "pr-17159", "bin"); 376var logsDirectory = Path.Combine(installPrefix, "logs"); 377var logFilePath = Path.Combine(logsDirectory, "aspire.log"); 394Assert.Equal(Path.Combine(installPrefix, "hives"), context.HivesDirectory.FullName); 395Assert.Equal(Path.Combine(installPrefix, "cache"), context.CacheDirectory.FullName); 396Assert.Equal(Path.Combine(installPrefix, "sdks"), context.SdksDirectory.FullName); 397Assert.Equal(Path.Combine(installPrefix, "packages"), context.PackagesDirectory?.FullName); 423logsDirectory: Path.Combine(workspace.WorkspaceRoot.FullName, "logs"), 424logFilePath: Path.Combine(workspace.WorkspaceRoot.FullName, "logs", "aspire.log"), 445logsDirectory: Path.Combine(workspace.WorkspaceRoot.FullName, "logs"), 446logFilePath: Path.Combine(workspace.WorkspaceRoot.FullName, "logs", "aspire.log"), 510var binaryPath = Path.Combine(binaryDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 513File.WriteAllText(Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"{{channelField}}}""");
CliExecutionContextTests.cs (10)
13var hivesDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "hives")); 14var cacheDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "cache")); 15var sdksDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "sdks")); 16var logsDir = new DirectoryInfo(Path.Combine(AppContext.BaseDirectory, "logs")); 23var cacheDir = new DirectoryInfo(Path.Combine(workingDir.FullName, "cache")); 24var sdksDir = new DirectoryInfo(Path.Combine(workingDir.FullName, "sdks")); 25var logsDir = new DirectoryInfo(Path.Combine(workingDir.FullName, "logs")); 66var nonexistentHives = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "no-hives-here")); 109File.WriteAllText(Path.Combine(hivesDir.FullName, "README.md"), "stray"); 110File.WriteAllText(Path.Combine(hivesDir.FullName, ".DS_Store"), string.Empty);
CliSmokeTests.cs (1)
100var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "credential-source.log");
Commands\AddCommandTests.cs (105)
37var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 50File.WriteAllText(Path.Combine(workspace.Path, "nuget.config"), $$""" 62File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 266var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 268File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), configuredSources ? """ 277var configPath = Path.Combine(workspace.Path, "nuget.config"); 445var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 447File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 453"source": {{JsonSerializer.Serialize(Path.Combine(workspace.Path, "missing"))}}, 523var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 525File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 632File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 678var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 680File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 688var configPath = Path.Combine(workspace.Path, "nuget.config"); 760var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 762File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 769File.WriteAllText(Path.Combine(workspace.Path, "nuget.config"), $$""" 837configurations.Add(new XElement(id, XDocument.Load(Path.Combine(workspace.Path, "nuget.config")).Root)); 850var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 852File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 855var configPath = Path.Combine(workspace.Path, "nuget.config"); 900var appHostFile = new FileInfo(Path.Combine(appDirectory.FullName, "AppHost.csproj")); 904File.WriteAllText(Path.Combine(appDirectory.FullName, AspireConfigFile.FileName), $$""" 915var configPath = Path.Combine(workspace.Path, "nuget.config"); 1015var appHostFile = new FileInfo(Path.Combine(appDirectory.FullName, 1018File.WriteAllText(Path.Combine(appDirectory.FullName, AspireConfigFile.FileName), $$""" 1027var configPath = Path.Combine(appDirectory.FullName, "nuget.config"); 1116AmbientSettingsLoader = (directory, _) => File.Exists(Path.Combine(directory, "nuget.config")) 1189var appHostFile = new FileInfo(Path.Combine(appDirectory.FullName, "apphost.ts")); 1191File.WriteAllText(Path.Combine(appDirectory.FullName, AspireConfigFile.FileName), """ 1194File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 1197File.WriteAllText(Path.Combine(workspace.Path, "nuget.config"), """ 1260await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "nuget.config")), "xml").UseParameters(specifyVersion); 1635var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 1637File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 1708var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 1710File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 1789var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 1791File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 1888var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 1892File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), $$""" 1975var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.ts")); 1977File.WriteAllText(Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), """ 1982File.WriteAllText(Path.Combine(invocationDirectory.FullName, "nuget.config"), """ 1987File.WriteAllText(Path.Combine(projectDirectory.FullName, "nuget.config"), """ 2036var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 2109var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 2111File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 2179Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives", "test-hive")); 2698var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 2700File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 3362File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 3392Assert.True(File.Exists(Path.Combine(dir.FullName, "NuGet.Config"))); 3927var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, isTypeScript ? "apphost.ts" : "AppHost.csproj")); 3932File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), $$""" 3941var hivesDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 4024var appHostFile = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 4026File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """{"channel":"staging"}"""); 4105var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4107File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 4220var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 4290var packagesDir = workspace.CreateDirectory(Path.Combine(".aspire", "hives", "pr-12345", "packages")); 4291File.WriteAllText(Path.Combine(packagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty); 4292File.WriteAllText(Path.Combine(packagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty); 4307var localSource = workspace.CreateDirectory(Path.Combine(".aspire", "hives", "pr-12345", "packages")).FullName; 4308var parentConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 4342var config = XDocument.Load(Path.Combine(projectDirectory.FullName, "nuget.config")); 4356var higherPrecedenceConfigPath = Path.Combine(projectWithMappingDisabled.FullName, "nuget.config"); 4378Path.Combine(projectWithoutInheritedMapping.FullName, "nuget.config")); 4393var localPackagesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives", PackageChannelNames.Local, "packages")); 4396File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty); 4397File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty); 4428var hivesRoot = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 4429var localPackagesDir = new DirectoryInfo(Path.Combine(hivesRoot.FullName, PackageChannelNames.Local, "packages")); 4430var prPackagesDir = new DirectoryInfo(Path.Combine(hivesRoot.FullName, "pr-12345", "packages")); 4434File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty); 4435File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty); 4437File.WriteAllText(Path.Combine(prPackagesDir.FullName, $"Aspire.Hosting.{staleVersion}.nupkg"), string.Empty); 4438File.WriteAllText(Path.Combine(prPackagesDir.FullName, $"Aspire.Hosting.Redis.{staleVersion}.nupkg"), string.Empty); 4463var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 4467File.WriteAllText(Path.Combine(identityPackagesDir.FullName, $"Aspire.Hosting.{cliVersion}.nupkg"), string.Empty); 4468File.WriteAllText(Path.Combine(identityPackagesDir.FullName, $"Aspire.Hosting.Redis.{cliVersion}.nupkg"), string.Empty); 4543var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 4604var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4663var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4718var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "apphost.ts")); 4722Path.Combine(sourceDirectory.FullName, "Aspire.Hosting.Redis.1.0.0.nupkg"), 4762var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4767workspace.CreateDirectory(Path.Combine(".aspire", "hives", channelName)); 4770Path.Combine(localSource.FullName, $"Aspire.Hosting.Redis.{packageVersion}.nupkg"), 4817Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"))); 4827var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4881var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4929var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 4977var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 5025var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 5077var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 5128var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 5186var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 5258var hivesDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "hives")); 5259var cacheDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "cache")); 5260var sdksDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "sdks")); 5261var logsDirectory = new DirectoryInfo(Path.Combine(aspireDirectory.FullName, "logs")); 5269Path.Combine(logsDirectory.FullName, "test.log"),
Commands\AgentInitClientSelectionTests.cs (79)
47Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills"))); 121Assert.False(Directory.Exists(Path.Combine(unselectedRoot.FullName, ".agents"))); 160var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 278Assert.Equal(before.Append(Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc")).Order(StringComparer.Ordinal), 327await File.WriteAllTextAsync(Path.Combine(workspace.Path, "apphost.cs"), string.Empty); 369await File.WriteAllTextAsync(Path.Combine(workspace.Path, "apphost.cs"), string.Empty); 396Assert.True(File.Exists(Path.Combine(directory, "dotnet-inspect", "SKILL.md"))); 397Assert.Equal(playwrightOutcome == "installed", File.Exists(Path.Combine(directory, "playwright-cli", "SKILL.md"))); 417await File.WriteAllTextAsync(Path.Combine(workspace.Path, "apphost.cs"), string.Empty); 419var blockedSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".claude", "skills", "playwright-cli"); 442Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", "playwright-cli", "SKILL.md"))); 455await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), "{}"); 456var skillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", "aspire", "SKILL.md"); 530Assert.True(File.Exists(Path.Combine(homeDirectory.FullName, ".copilot", "mcp-config.json"))); 540await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 571Assert.Equal(!configureAspire, File.Exists(Path.Combine(homeDirectory.FullName, ".copilot", "mcp-config.json"))); 655contents.Add(Path.GetRelativePath(root.FullName, path).Replace('\\', '/'), JsonSerializer.Deserialize<JsonElement>(await File.ReadAllTextAsync(path))); 667var path = Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"); 685var configPath = Path.Combine(configDirectory.FullName, "mcp.json"); 716var configPath = Path.Combine(configDirectory.FullName, "mcp.json"); 746var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, configFileName); 775var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, expectedRelativePath.Replace('/', Path.DirectorySeparatorChar)); 795var configDirectory = new DirectoryInfo(Path.GetDirectoryName( 801await File.WriteAllTextAsync(Path.Combine(configDirectory.FullName, "opencode.json"), """{"model":"keep-json","mcp":{"other":{"command":["other"]}}}"""); 805await File.WriteAllTextAsync(Path.Combine(configDirectory.FullName, "opencode.jsonc"), """{"model":"keep-jsonc","mcp":{"other":{"command":["other"]}}}"""); 814var expectedPath = Path.Combine(configDirectory.FullName, expectedFileName); 826configurations.Add(Path.GetFileName(path), await File.ReadAllTextAsync(path)); 845var configDirectory = Path.GetDirectoryName(scope is AgentConfigurationScope.Project 851var path = Path.Combine(configDirectory, fileName); 902var jsonPath = Path.ChangeExtension(jsoncPath, ".json"); 905Directory.CreateDirectory(Path.GetDirectoryName(jsoncPath)!); 927var jsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.json"); 939var jsoncPath = Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc"); 967var jsonPath = Path.ChangeExtension(jsoncPath, ".json"); 984Directory.CreateDirectory(Path.GetDirectoryName(jsoncPath)!); 1019var jsonPath = Path.ChangeExtension(jsoncPath, ".json"); 1021Directory.CreateDirectory(Path.GetDirectoryName(jsoncPath)!); 1051var configDirectory = workspace.CreateDirectory(relativeDirectory.Replace('/', Path.DirectorySeparatorChar)); 1052var configPath = Path.Combine(configDirectory.FullName, "opencode.json"); 1079["OPENCODE_CONFIG"] = Path.Combine(openCode.FullName, "custom.json") 1117var path = Path.Combine(homeDirectory.FullName, ".copilot", "mcp-config.json"); 1119Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1147var path = Path.Combine(homeDirectory.FullName, ".copilot", "mcp-config.json"); 1149Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1190Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1244Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1276Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1310Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1344Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1394await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), config); 1436Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1486var vsCodeUserDataRoot = OperatingSystem.IsWindows() ? Path.Combine(homeDirectory.FullName, "AppData", "Roaming") 1487: OperatingSystem.IsMacOS() ? Path.Combine(homeDirectory.FullName, "Library", "Application Support") 1488: Path.Combine(homeDirectory.FullName, ".config"); 1489var vsCodeUserMcpPath = Path.Combine(vsCodeUserDataRoot, "Code", "User", "mcp.json"); 1494"vscode-profile-mcp" => [(Path.Combine(vsCodeUserDataRoot, "Code - Insiders", "User", "profiles", "1a2b3c", "mcp.json"), """{"servers":{"aspire":{"type":"stdio","command":"aspire","args":["agent","mcp"]}}}""")], 1509Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1551Directory.CreateDirectory(Path.GetDirectoryName(pluginPath)!); 1579? Path.Combine(homeDirectory.FullName, ".claude", "settings.json") 1580: Path.Combine(homeDirectory.FullName, ".copilot", "hooks", "aspire-telemetry.json"); 1581Directory.CreateDirectory(Path.GetDirectoryName(hookConfigPath)!); 1611var mcpPath = Path.Combine(workspace.WorkspaceRoot.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 1612Directory.CreateDirectory(Path.GetDirectoryName(mcpPath)!); 1616await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"), "{broken"); 1643var userDataRoot = OperatingSystem.IsWindows() ? Path.Combine(homeDirectory.FullName, "AppData", "Roaming") 1644: OperatingSystem.IsMacOS() ? Path.Combine(homeDirectory.FullName, "Library", "Application Support") 1645: Path.Combine(homeDirectory.FullName, ".config"); 1646var mcpPath = Path.Combine(userDataRoot, "Code", "User", "mcp.json"); 1648Directory.CreateDirectory(Path.GetDirectoryName(mcpPath)!); 1672Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"))); 1684? Path.Combine(context.CopilotDirectory, "settings.json") 1685: Path.Combine(context.Home.FullName, ".agents", "skills", "aspire", "SKILL.md"); 1689var projectSkillPath = Path.Combine(context.Project.FullName, projectDirectory, "skills", "aspire-init", "SKILL.md"); 1721Assert.False(Directory.Exists(Path.GetDirectoryName(path))); 1741var logDirectory = Path.Combine(".aspire", "logs") + Path.DirectorySeparatorChar; 1743.Where(path => !Path.GetRelativePath(workspaceRoot.FullName, path).StartsWith(logDirectory, StringComparison.Ordinal))
Commands\AgentInitCommandTests.cs (97)
69var firstProject = new FileInfo(Path.Combine(first.FullName, "First.csproj")); 70var selectedProject = new FileInfo(Path.Combine(selected.FullName, "Selected.csproj")); 71await AgentConfigurationTestContext.WriteAsync(Path.Combine(selected.FullName, AspireConfigFile.FileName), """ 128new FileInfo(Path.Combine(directory.FullName, "First", "First.csproj")), 129new FileInfo(Path.Combine(directory.FullName, "Second", "Second.csproj"))]); 166await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), """ 180await File.ReadAllTextAsync(Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName))); 190await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), """ 201var agentInstructionsPath = Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName); 220await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), """ 231var agentInstructionsPath = Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName); 250await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), """ 264await File.ReadAllTextAsync(Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName))); 271var appHost = new FileInfo(Path.Combine(context.Project.FullName, "App.AppHost", "App.AppHost.csproj")); 287await File.ReadAllTextAsync(Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName))); 294var workingDirectoryAppHost = new FileInfo(Path.Combine(context.Project.FullName, "A.AppHost", "A.AppHost.csproj")); 296var otherRepositoryAppHost = new FileInfo(Path.Combine(otherRepository.FullName, "B.AppHost", "B.AppHost.csproj")); 321await File.ReadAllTextAsync(Path.Combine(otherRepository.FullName, AgentInstructionsFile.FileName))); 322Assert.False(File.Exists(Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName))); 329var webDirectory = context.Project.CreateSubdirectory(Path.Combine("src", "Web")); 330var appHost = new FileInfo(Path.Combine(context.Project.FullName, "src", "AppHost", "AppHost.csproj")); 356await File.ReadAllTextAsync(Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName))); 364var externalAppHost = new FileInfo(Path.Combine(externalDirectory.FullName, "External.AppHost", "External.AppHost.csproj")); 365var appHost = new FileInfo(Path.Combine(context.Project.FullName, "App.AppHost", "App.AppHost.csproj")); 388await File.ReadAllTextAsync(Path.Combine(context.Project.FullName, AgentInstructionsFile.FileName))); 398await AgentConfigurationTestContext.WriteAsync(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"), """ 405await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "web", "Web.csproj"), """ 408await AgentConfigurationTestContext.WriteAsync(Path.Combine(appHostDirectory.FullName, AspireConfigFile.FileName), """ 411await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), """ 429new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")))); 439Assert.Equal([Path.Combine(appHostDirectory.FullName, "AppHost.csproj")], 485await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), defaultOnly ? "{}" : """ 566await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, AspireConfigFile.FileName), configuration); 596await File.WriteAllTextAsync(Path.Combine(context.Project.FullName, "apphost.cs"), string.Empty); 680var agentsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents"); 728Assert.False(Directory.Exists(Path.Combine(skillsRoot.FullName, ".agents", "skills"))); 729Assert.False(Directory.Exists(Path.Combine(skillsRoot.FullName, ".claude", "skills"))); 774await AgentConfigurationTestContext.WriteAsync(Path.Combine(app.FullName, "aspire.config.json"), """ 806await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "aspire.config.json"), """ 809await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, ".aspire", "settings.global.json"), """ 821await AgentConfigurationTestContext.WriteAsync(Path.Combine(app.FullName, "aspire.config.json"), """ 856var aspireSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName); 873Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"))); 874var openCodeConfig = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc"))); 892Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"))); 893Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc"))); 909Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"))); 910var openCodeConfig = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "opencode.jsonc"))); 931var agentsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills"); 944await File.WriteAllTextAsync(Path.Combine(workspace.Path, appHostFileName), string.Empty); 971Assert.Equal(expected, File.Exists(Path.Combine(workspace.Path, ".agents", "skills", SkillDefinition.DotnetInspect.Name, "SKILL.md"))); 993var hookFile = Path.Combine(homeDirectory.FullName, ".copilot", "hooks", "aspire-telemetry.json"); 1105var expectedPath = Path.Combine(root.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 1188$"{prefix}{Path.GetRelativePath(scopeRoot.FullName, client.GetIntegrationConfigPath(scope, context.Project)).Replace(Path.DirectorySeparatorChar, '/')} ({client.DisplayName})").ToArray(); 1215await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "aspire.config.json"), """ 1306var path = Path.Combine(context.Project.FullName, "opencode.json"); 1343var configPath = Path.Combine(context.Project.FullName, ".opencode", "opencode.jsonc"); 1344var skillDirectory = Path.Combine(context.Project.FullName, ".opencode", "skill", "aspire"); 1345var configuredSkillPath = Path.Combine(context.Project.FullName, "team-skills", "aspire", "SKILL.md"); 1350await AgentConfigurationTestContext.WriteAsync(Path.Combine(skillDirectory, "SKILL.md"), "My customized Aspire instructions."); 1351await AgentConfigurationTestContext.WriteAsync(Path.Combine(skillDirectory, "references", "deploy.md"), "Supporting file."); 1367Assert.True(Directory.Exists(Path.Combine(context.Project.FullName, ".opencode", "skill"))); 1389var skillPath = Path.Combine(reason == "project-scope" ? context.Home.FullName : context.Project.FullName, 1393var configPath = Path.Combine(context.Project.FullName, "aspire.config.json"); 1449var skillDirectory = Path.Combine(context.Project.FullName, ".agents", "skills", "aspire"); 1450await AgentConfigurationTestContext.WriteAsync(Path.Combine(skillDirectory, "SKILL.md"), "My customized Aspire instructions."); 1451await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "aspire.config.json"), 1493var skillDirectory = Path.Combine(context.Project.FullName, ".agents", "skills", "aspire"); 1494await AgentConfigurationTestContext.WriteAsync(Path.Combine(skillDirectory, "SKILL.md"), "My customized Aspire instructions."); 1495await AgentConfigurationTestContext.WriteAsync(Path.Combine(skillDirectory, "references", "notes.md"), "My notes."); 1546var skillPath = Path.Combine(client.GetSkillBaseDirectory(scope, context.Project), "aspire", "SKILL.md"); 1549await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "aspire.config.json"), 1555? Path.Combine(context.Project.FullName, overridePath) 1556: Path.Combine(AgentPath.GetManagedSettingsDirectory(context.ExecutionContext, context.Environment, "GitHubCopilot", "github-copilot"), overridePath), 1577var skillPath = Path.Combine(context.Home.FullName, ".agents", "skills", "aspire", "SKILL.md"); 1580await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "aspire.config.json"), 1590var copilotLocal = Path.Combine(context.Project.FullName, ".github", "copilot", "settings.local.json"); 1601Path.Combine(context.Project.FullName, ".claude", "settings.local.json"), projectEnabled ? enabled : disabled); 1631var skillPath = Path.Combine(context.Home.FullName, ".agents", "skills", "aspire", "SKILL.md"); 1634await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Project.FullName, "aspire.config.json"), 1641var projectLocal = Path.Combine(context.Project.FullName, ".github", "copilot", "settings.local.json"); 1683Path.Combine(context.Project.FullName, skillRoot, "aspire", "SKILL.md"), "My customized Aspire instructions."); 1692skillRoots.Where(skillRoot => Directory.Exists(Path.Combine(context.Project.FullName, skillRoot, "aspire")))); 1700var sharedSkillPath = Path.Combine(shared.FullName, "aspire", "SKILL.md"); 1703var linkPath = Path.Combine(context.Project.FullName, ".agents", "skills"); 1704Directory.CreateDirectory(Path.GetDirectoryName(linkPath)!); 1737var sharedFilePath = Path.Combine(shared.FullName, "notes.md"); 1740var skillDirectory = Path.Combine(context.Project.FullName, ".agents", "skills", "aspire"); 1741await AgentConfigurationTestContext.WriteAsync(Path.Combine(skillDirectory, "SKILL.md"), "My customized Aspire instructions."); 1744Directory.CreateSymbolicLink(Path.Combine(skillDirectory, "references"), shared.FullName); 1782var skillsDirectory = Path.Combine(context.Project.FullName, ".agents", "skills"); 1783var failedDirectory = Path.Combine(skillsDirectory, "aspire"); 1784var failedSkillPath = Path.Combine(failedDirectory, "SKILL.md"); 1785var removableDirectory = Path.Combine(skillsDirectory, "aspire-deployment"); 1788await AgentConfigurationTestContext.WriteAsync(Path.Combine(removableDirectory, "SKILL.md"), skill);
Commands\AgentMcpCommandTests.cs (42)
163var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 232AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 296AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "AnnotatedAppHost", "AnnotatedAppHost.csproj"), 373AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 437var appHostAPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "AppHostA", "AppHostA.csproj"); 438var appHostBPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "AppHostB", "AppHostB.csproj"); 506AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 577var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 617var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 640var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 654AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "UnrelatedAppHost", "UnrelatedAppHost.csproj"), 784var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 788var unrelatedPath = Path.GetFullPath(Path.Combine("UnrelatedAppHost", "UnrelatedAppHost.csproj")); 907var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 980var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 993AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "UnrelatedAppHost", "UnrelatedAppHost.csproj"), 1016var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 1028AppHostPath = Path.GetFullPath(Path.Combine("UnrelatedAppHost", "UnrelatedAppHost.csproj")), 1082var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 1109var appHostPath = Path.GetFullPath(Path.Combine("PinnedAppHost", "PinnedAppHost.csproj")); 1171AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 1199AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 1398AppHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 1504var appHostPath = Path.Combine(ctx.Workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"); 1690var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "PinnedAppHost.csproj")); 1723var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "PinnedAppHost.csproj")); 1755var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "MissingAppHost"); 1784Path.Combine(appHostDirectory.FullName, "First.AppHost.csproj"), 1788Path.Combine(appHostDirectory.FullName, "Second.AppHost.csproj"), 1830AppHostPath = appHostPath ?? Path.Combine(workspace.WorkspaceRoot.FullName, hash, $"{hash}.csproj"),
Commands\AgentTelemetryCommandTests.cs (10)
163options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 195options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 225options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 255options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 278options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 306options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 334options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 401options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 438options.TelemetryFactory = _ => TestTelemetryHelper.CreateInitializedTelemetry(reportedSourceName, $"Diag.{Path.GetRandomFileName()}"); 454reportedSourceName = $"Test.{Path.GetRandomFileName()}";
Commands\AppHostLauncherTests.cs (15)
60var logsDirectory = Path.Combine(Path.GetTempPath(), "aspire-cli-tests"); 65var fileName = Path.GetFileName(path); 1061var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log"); 1089var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log"); 1112var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log"); 1174var childLogFile = Path.Combine(workspace.WorkspaceRoot.FullName, "child.log"); 1324var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1330var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 1332locatedAppHostFile = new FileInfo(Path.Combine(linkPath, "AppHost.csproj")); 1341Path.Combine(logsDirectory.FullName, "parent.log"), 1409Path.Combine(_workspace.WorkspaceRoot.FullName, "common", ".git")); 1414var backchannelsDir = Path.Combine(_homeDirectory.FullName, ".aspire", "cli", "bch"); 1419var appHostId = Path.GetFileName(prefix); 1420var socketPath = Path.Combine(
Commands\BaseCommandTests.cs (3)
305var cliLogPath = Path.Combine(workspace.WorkspaceRoot.FullName, "current-cli.log"); 306var appHostLogPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost-cli.log"); 353var cliLogPath = Path.Combine(workspace.WorkspaceRoot.FullName, "current-cli.log");
Commands\CacheCommandTests.cs (20)
47var packagesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "packages")); 49File.WriteAllText(Path.Combine(restoreDir.FullName, "test.dll"), "fake"); 63Assert.False(File.Exists(Path.Combine(restoreDir.FullName, "test.dll"))); 70var appHostInfoCacheDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "apphost-info")); 72var cacheEntry = Path.Combine(appHostInfoCacheDir.FullName, "entry.json"); 105await File.WriteAllTextAsync(Path.Combine(firstBuildCache.FullName, "Aspire.Hosting.dll"), "fake").DefaultTimeout(); 106await File.WriteAllTextAsync(Path.Combine(secondBuildCache.FullName, "Aspire.Hosting.dll"), "fake").DefaultTimeout(); 116Assert.False(Directory.Exists(Path.Combine(stagingCacheRoot.FullName, "deadbeef"))); 117Assert.False(Directory.Exists(Path.Combine(stagingCacheRoot.FullName, "cafef00d"))); 147var packagesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "packages-nonexistent")); 166var tempDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}")); 171File.WriteAllText(Path.Combine(tempDir.FullName, "root.txt"), "root"); 172File.WriteAllText(Path.Combine(subDir.FullName, "nested.txt"), "nested"); 192var tempDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}")); 196var keepFile = Path.Combine(tempDir.FullName, "keep.txt"); 197var deleteFile = Path.Combine(tempDir.FullName, "delete.txt"); 221var nonExistent = new DirectoryInfo(Path.Combine(Path.GetTempPath(), $"aspire-test-nonexistent-{Guid.NewGuid():N}"));
Commands\CompletionsCommandTests.cs (4)
255var legacyConfig = Path.Combine(home.FullName, "globalsettings.json"); 261"global" => Path.Combine(home.FullName, AspireConfigFile.FileName), 264_ => Path.Combine(workspace.Path, AspireConfigFile.FileName) 333var settingsPath = Path.Combine(workspace.Path, AspireConfigFile.FileName);
Commands\CompletionScriptTests.cs (23)
24var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.ps1"); 66var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.ps1"); 68await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.ps1"), """ 84["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 98var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.bash"); 100var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 124["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 151var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.bash"); 152var capturedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "arguments.bin"); 153var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 172["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 178Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "completion-executed"))); 187var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "completion.bash"); 188var capturedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "arguments.bin"); 189var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 208["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 221var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.fish"); 245var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.zsh"); 269var completionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "_aspire"); 270var binaryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 271var capturedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "arguments.bin"); 298["PATH"] = workspace.WorkspaceRoot.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 311WorkingDirectory = Path.GetDirectoryName(environment["COMPLETION_SCRIPT"]),
Commands\ConfigCommandTests.cs (21)
141var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 247var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 295var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 320var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 354var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 433var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 464var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 533var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 793var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 812var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 873var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 904var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 935var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 949var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 951var settingsPath = Path.Combine(settingsDir, "settings.json"); 982var settingsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 984var settingsPath = Path.Combine(settingsDir, "settings.json"); 1024var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1041var legacySettingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 1054var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1151var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
Commands\ConfigSourceCommandTests.cs (67)
54Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 77var config = AspireConfigFile.Load(Path.Combine(workspace.Path, outputDirectory)); 99var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 121Directory.CreateDirectory(Path.GetDirectoryName(globalPath)!); 145Repository = Path.Combine(workspace.Path, "missing-repository"), 202Repository = Path.Combine(workspace.Path, "missing-repository"), 295var projectFile = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 353var path = Path.Combine(context.Project.FullName, AspireConfigFile.FileName); 386await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Test.sln"), "Fake solution file"); 405File.WriteAllText(Path.Combine(outputPath, $"{name}.csproj"), "<Project />"); 406File.WriteAllText(Path.Combine(outputPath, AspireConfigFile.FileName), $$""" 434Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 435var appHostConfigPath = Path.Combine(workspace.Path, "Test.AppHost", AspireConfigFile.FileName); 450Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 560var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 598var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 612var projectFile = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 690var projectFile = new FileInfo(Path.Combine(project.FullName, "apphost.cs")); 693var rootPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 732Assert.False(File.Exists(Path.Combine(project.FullName, AspireConfigFile.FileName))); 744var localPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 754File.Move(Path.Combine(globalFile.Directory.FullName, AspireConfigFile.FileName), globalFile.FullName); 759$"update --config-source --apphost \"{Path.Combine(workspace.Path, requestedPath)}\" --yes --non-interactive"); 776await File.WriteAllTextAsync(Path.Combine(project.FullName, "apphost.cs"), "#:sdk Aspire.AppHost.Sdk"); 780var parentPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 786var result = command.Parse($"update --config-source --apphost \"{Path.Combine(project.FullName, "apphost.cs")}\" --yes --non-interactive"); 828var localPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 832await File.WriteAllTextAsync(Path.Combine(workspace.Path, "apphost.cs"), "#:sdk Aspire.AppHost.Sdk"); 842File.Move(Path.Combine(globalFile.Directory.FullName, AspireConfigFile.FileName), globalFile.FullName); 846var appHostArgument = explicitAppHost ? $" --apphost \"{Path.Combine(workspace.Path, "apphost.cs")}\"" : ""; 871var projectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 873var configPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 941Assert.False(File.Exists(Path.Combine(appHostDirectory.FullName, AspireConfigFile.FileName))); 957var projectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 959var configPath = Path.Combine(appHostDirectory.FullName, AspireConfigFile.FileName); 1003var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1006await File.WriteAllTextAsync(Path.Combine(workspace.Path, "AppHost.csproj"), "<Project />"); 1040var selectedFile = new FileInfo(Path.Combine(selected.FullName, "apphost.cs")); 1048await File.WriteAllTextAsync(Path.Combine(selected.FullName, AspireConfigFile.FileName), "{}"); 1093var parentPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1097var projectFile = new FileInfo(Path.Combine(selected.FullName, "apphost.cs")); 1115Assert.False(File.Exists(Path.Combine(selected.FullName, AspireConfigFile.FileName))); 1126var projectFile = new FileInfo(Path.Combine(selected.FullName, "apphost.cs")); 1131Path.Combine(workspace.Path, AspireConfigFile.FileName), "appHost.path", "selected/apphost.cs"); 1158var parentPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1164await File.WriteAllTextAsync(Path.Combine(projectDirectory.FullName, "apphost.cs"), "#:sdk Aspire.AppHost.Sdk"); 1174var selectedPath = Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName); 1227var missingProject = Path.Combine(workspace.Path, "missing.csproj"); 1280var output = Path.Combine(workspace.Path, "created-project"); 1284await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 1287await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", AspireConfigFile.FileName), "{}"); 1301var configuration = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(output, AspireConfigFile.FileName)))!; 1304Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 1322var configuration = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName)))!; 1324Assert.True(File.Exists(Path.Combine(workspace.Path, "apphost.cs"))); 1337var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1366await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Test.sln"), "Fake solution file"); 1367var childPath = Path.Combine(workspace.Path, "Test.AppHost"); 1368var projectPath = Path.Combine(childPath, "Test.AppHost.csproj"); 1369var rootConfigPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1391await File.WriteAllTextAsync(Path.Combine(childPath, AspireConfigFile.FileName), templateConfig); 1395var configPath = Path.Combine(configDirectory.FullName, AspireConfigFile.FileName); 1421File.WriteAllText(Path.Combine(outputPath, $"{name}.csproj"), "<Project />"); 1422File.WriteAllText(Path.Combine(outputPath, AspireConfigFile.FileName), templateConfig); 1464Assert.Equal(appHostConfig, File.Exists(Path.Combine(childPath, AspireConfigFile.FileName))); 1503Assert.Equal(appHostConfig, File.Exists(Path.Combine(childPath, AspireConfigFile.FileName))); 1519var output = Path.Combine(workspace.Path, "created-project");
Commands\DashboardRunCommandTests.cs (11)
192Directory.Delete(Path.GetDirectoryName(dashboardPath)!); 197var managedDir = Path.Combine(workspace.WorkspaceRoot.FullName, "layout", BundleDiscovery.ManagedDirectoryName); 198File.WriteAllText(Path.Combine(managedDir, Path.GetFileName(dashboardPath)), "fake legacy dashboard"); 657var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [dashboard].log"); 676var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri; 687var layoutDir = Path.Combine(workspace.WorkspaceRoot.FullName, "layout"); 688var managedDir = Path.Combine(layoutDir, "managed"); 690var managedPath = Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName("aspire-managed")); 692var dashboardDir = Path.Combine(layoutDir, BundleDiscovery.DashboardDirectoryName); 693var dashboardPath = Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName));
Commands\DeployCommandTests.cs (9)
40var expectedAspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, ".home", ".aspire"); 88var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 90var expectedAspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, ".home", ".aspire"); 325var expectedAspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, ".home", ".aspire"); 402var appHostFile = new FileInfo(Path.Combine(tempRepo.WorkspaceRoot.FullName, "AppHost.csproj")); 431var explicitPath = Path.Combine(tempRepo.WorkspaceRoot.FullName, "explicit.json"); 455var appHostFile = new FileInfo(Path.Combine(tempRepo.WorkspaceRoot.FullName, "AppHost.csproj")); 505var testOutputPath = Path.Combine(Path.GetTempPath(), "test");
Commands\DescribeCommandTests.cs (7)
1365AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "OtherAppHost", "OtherAppHost.csproj"), 1396Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 1397var appHostDirectory = workspace.WorkspaceRoot.CreateSubdirectory(Path.Combine("src", "MyApp.AppHost")); 1398var appHostPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj"); 1401Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 1870AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 1902AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\DestroyCommandTests.cs (2)
284var testOutputPath = Path.Combine(Path.GetTempPath(), "test-destroy");
Commands\DoctorCommandTests.cs (24)
44Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json"), 46await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.ClaudeDirectory, "settings.json"), 66check!["details"] = Path.GetRelativePath(context.Home.FullName, check["details"]!.GetValue<string>()).Replace('\\', '/'); 77.Select(directory => Path.Combine(directory.FullName, ".agents", "skills", "aspire", "SKILL.md")) 114Path.Combine(directory.FullName, ".agents", "skills", "aspire", "SKILL.md"), "static guidance"); 276var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 303var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 306Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 379var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Normal.csproj")); 407var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Normal.csproj")); 410var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 433await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), "<Project />"); 434await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.fsproj"), "<Project />"); 460var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 517Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 521"path": "{{Path.GetRelativePath(workspace.WorkspaceRoot.FullName, appHostFile.FullName).Replace('\\', '/')}}" 544Path.Combine("level0", "level1", "level2", "level3", "level4", "level5", "AppHost.csproj"), 605var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 608Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 636var appHostFile = new FileInfo(Path.Combine(nestedAppHostDir.FullName, "AppHost.csproj")); 639Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 663Assert.Equal(Path.Combine("src", "NestedAppHost", "AppHost.csproj"), metadata.GetProperty("appHostPath").GetString()); 670var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1187return new FileInfo(Path.Combine(directory.FullName, "AppHost.csproj"));
Commands\DotNetSdkCheckTests.cs (4)
103var filePath = Path.Combine(workspace.WorkspaceRoot.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 104Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 145? new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, appHostFileName))
Commands\ExportCommandTests.cs (20)
27var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 115var customDir = Path.Combine(workspace.WorkspaceRoot.FullName, "custom", "nested"); 116var outputPath = Path.Combine(customDir, "my-export.zip"); 149var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 152var appHostDir = Path.Combine(workspace.WorkspaceRoot.FullName, "MyAppHost"); 154var appHostProjectPath = Path.Combine(appHostDir, "MyAppHost.csproj"); 182var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 192AppHostPath = Path.Combine("C:", "other", "OtherAppHost", "OtherAppHost.csproj"), 215AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TargetAppHost", "TargetAppHost.csproj"), 301var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 427var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 485var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 539var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 604var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 648var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 692var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 734var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 762var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 815var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "export.zip"); 882AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\ExtensionInternalCommandTests.cs (4)
61var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp.AppHost.csproj")); 102var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp.AppHost.csproj")); 137var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App1.AppHost.csproj")); 138var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App2.AppHost.csproj"));
Commands\GoAppHostToolingCheckTests.cs (9)
92var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 109var configuredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "..", "ts", "apphost.mts")); 531var sourcePath = Path.Combine(GetRepoRoot(), "src", sourceFileName.Replace('/', Path.DirectorySeparatorChar)); 544var sourceDirectory = Path.Combine(GetRepoRoot(), "src"); 545var detector = File.ReadAllText(Path.Combine(sourceDirectory, "Aspire.Hosting.Go", "GoVersionDetector.cs")); 553var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.go"); 562File.WriteAllText(Path.Combine(serviceDirectory.FullName, "Api.csproj"), "<Project Sdk=\"Microsoft.NET.Sdk.Web\" />"); 676while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "global.json")))
Commands\InitCommandTests.cs (115)
38await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Test.sln"), "Fake solution file"); 40var configPath = Path.Combine(workspace.Path, "nuget.config"); 73Assert.False(File.Exists(Path.Combine(workspace.Path, "apphost.cs"))); 74Assert.False(Directory.Exists(Path.Combine(workspace.Path, "Test.AppHost"))); 118var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 121var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, projectFileName)); 161Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"))); 168await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Test.sln"), "Fake solution file"); 187Assert.True(Directory.Exists(Path.Combine(workspace.Path, "Test.AppHost"))); 189[Path.Combine(workspace.Path, ".github", "copilot", "settings.json")], 191Assert.False(Directory.Exists(Path.Combine(workspace.Path, ".agents", "skills"))); 192Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 205var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 238Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"))); 265var appHostContent = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 280var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, solutionPath)); 284var projectPath = Path.Combine(solutionFile.Directory.FullName, "Test.csproj"); 287var otherSolutionPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Other.slnx"); 313Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 314Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json"))); 315var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)))!.AsObject(); 354Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 355Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".gitignore"))); 357var config = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject(); 376LineEndingAssert.FileUsesOsLineBreaksAndSingleFinalNewline(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")); 377LineEndingAssert.FileUsesOsLineBreaksAndSingleFinalNewline(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")); 399var runJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json"); 426var aspireConfig = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject(); 469File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), existingAspireConfig); 480var runJson = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")))!.AsObject(); 519var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 544Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json"))); 568Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 585await File.WriteAllTextAsync(Path.Combine(workspace.Path, "apphost.mts"), "console.log('existing AppHost');"); 670Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"))); 672var config = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject(); 756var existingAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"); 759File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), """{ "type": "commonjs" }"""); 774Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"))); 775Assert.Equal("""{ "type": "commonjs" }""", File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"))); 784File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{}"); 793File.WriteAllText(Path.Combine(scaffoldDirectory.FullName, context.Language.AppHostFileName!), string.Empty); 823Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"))); 824Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-apphost", "apphost.mts"))); 835File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), moduleContent); 836File.WriteAllText(Path.Combine(workspace.Path, "go.work"), workspaceContent); 837File.WriteAllText(Path.Combine(workspace.Path, "main.go"), sourceContent); 866Assert.Equal(moduleContent, File.ReadAllText(Path.Combine(workspace.Path, "go.mod"))); 867Assert.Equal(workspaceContent, File.ReadAllText(Path.Combine(workspace.Path, "go.work"))); 868Assert.Equal(sourceContent, File.ReadAllText(Path.Combine(workspace.Path, "main.go"))); 869Assert.Equal("module apphost\n\ngo 1.26\n", File.ReadAllText(Path.Combine(workspace.Path, "aspire-apphost", "go.mod"))); 872File.ReadAllText(Path.Combine(workspace.Path, "aspire-apphost", "go.work"))); 1017await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), settings); 1062Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 1064var aspireSkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName); 1067var aspireifySkillPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireifySkillName); 1084Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 1087var agentsDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills"); 1106Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 1119Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills"))); 1120Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".mcp.json"))); 1130var skillDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName); 1132await File.WriteAllTextAsync(Path.Combine(skillDirectory, "SKILL.md"), "My customized Aspire instructions."); 1165var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 1196var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1225var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1249var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1270var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 1290var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 1334File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")), 1343var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 1347var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 1348Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-12345", "packages")); 1420var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 1486var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 1535var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 1605Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 1607var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1640Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"))); 1642var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1677var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1701var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1750var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1794var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1909var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2016var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2021SettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"), 2096var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2100var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 2184var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2187var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2245var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2274var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2292var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2296var appHostDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost")); 2298Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"))); 2319var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2337var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 2339Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"))); 2356var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2375var solutionFile = new FileInfo(Path.Combine(solutionDir.FullName, "Test.sln")); 2405Assert.True(File.Exists(Path.Combine(solutionDir.FullName, "nuget.config")), 2407Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")), 2409AssertNuGetConfigHasChannelShape(Path.Combine(solutionDir.FullName, "nuget.config"), contextChannel); 2425var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2437var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2486var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2518var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2536var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2581File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")), 2597var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.slnx")); 2627var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2698var workingDirectory = Path.GetDirectoryName(nugetConfigPath)!; 2716File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, appHostFileName), string.Empty); 2726File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, AspireConfigFile.FileName), config.ToJsonString());
Commands\IntegrationAssemblyNameResolverTests.cs (1)
60var projectPath = System.IO.Path.Combine(Path, fileName);
Commands\LogsCommandTests.cs (5)
728AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 818AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 985AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 1548AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"), 1626AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\LsCommandTests.cs (18)
93var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 94var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"); 174var configuredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "ConfiguredAppHost.csproj")); 176await File.WriteAllTextAsync(Path.Combine(workingDirectory.FullName, "aspire.config.json"), JsonSerializer.Serialize(new 214var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 215var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"); 289var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 290var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"); 374var appHostPathZ = Path.Combine(workspace.WorkspaceRoot.FullName, "ZApp", "Z.AppHost.csproj"); 375var appHostPathA = Path.Combine(workspace.WorkspaceRoot.FullName, "AApp", "A.AppHost.csproj"); 376var appHostPathM = Path.Combine(workspace.WorkspaceRoot.FullName, "MApp", "M.AppHost.csproj"); 419var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App", "App.AppHost.csproj"); 520var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 521var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"); 556var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 557var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"); 609var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App", "App.AppHost.csproj"); 763var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App", "App.AppHost.csproj");
Commands\NewCommandChannelResolutionTests.cs (4)
44SettingsFilePath = Path.Combine(workspace.Path, ".aspire", "settings.global.json"), 575pathDeriverCallback: (ctx, projectName) => Path.Combine(ctx.WorkingDirectory.FullName, projectName), 582var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "captured"); 682File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{version}.nupkg"), string.Empty);
Commands\NewCommandLocalTemplateTests.ConfiguredGitSourceObjects.cs (17)
84var root = Path.GetRelativePath(workspace.Path, destination.FullName); 108["local"] = Path.Combine(workspace.Path, "local") 147["working"] = Path.Combine(workspace.Path, "local") 166var link = Path.Combine(workspace.Path, "template-link"); 169Directory.CreateSymbolicLink(link, Path.Combine(workspace.Path, "local")); 180Directory.Move(link, Path.Combine(destination.FullName, "templates")); 189["working"] = Path.Combine(workspace.Path, "local") 212Path.Combine(provider.GetRequiredService<CliExecutionContext>().CacheDirectory.FullName, "git"))); 213Assert.True(File.Exists(Path.Combine(workspace.Path, "local", "TemplateApp.txt"))); 226Path.GetRelativePath(workspace.Path, Path.Combine(destination.FullName, "templates/sample")), 243var missingPath = Path.Combine(GetGitFetches(git)[0].Destination.FullName, "templates", "missing"); 260Path.Combine(provider.GetRequiredService<CliExecutionContext>().CacheDirectory.FullName, "git"))); 325var pinnedSha = (await File.ReadAllTextAsync(Path.Combine(repository.FullName, ".git", "refs", "heads", "main"))).Trim(); 328await File.WriteAllTextAsync(Path.Combine(repository.FullName, "templates", "sample", "TemplateApp.txt"), "Latest: GreetingValue"); 400outputs[label] = ReadOutput(Path.Combine(workspace.Path, "out", label)); 403Assert.Equal(2, Directory.GetDirectories(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git")).Length);
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (14)
126Assert.Equal("Remote: Hello", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 157await File.ReadAllTextAsync(Path.Combine(workspace.Path, $"out{invocation}", "Demo.txt"))); 206Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 225["local-source"] = Path.Combine(workspace.Path, "local"), 315await File.WriteAllTextAsync(Path.Combine(partial.FullName, "partial-object"), "partial download", token); 335["local-source"] = Path.Combine(workspace.Path, "local"), 367Path.Combine(provider.GetRequiredService<CliExecutionContext>().CacheDirectory.FullName, "git"))); 383await File.WriteAllTextAsync(Path.Combine(partial.FullName, "partial-object"), "partial download", token); 417var cacheRoot = Path.Combine(provider.GetRequiredService<CliExecutionContext>().CacheDirectory.FullName, "git"); 493Assert.Equal("Directory: Hello", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 557await CreateSearchTemplateAsync(workspace, Path.GetRelativePath(workspace.Path, destination.FullName), 593await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 660Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 667Path.GetRelativePath(workspace.Path, destination.FullName), "sample", "Sample template", marker);
Commands\NewCommandLocalTemplateTests.ConfiguredSources.cs (21)
45await WriteConfiguredSourcesAsync(provider, new() { ["company"] = Path.Combine(workspace.Path, "template") }); 51Assert.Equal("Found: Hello", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 222await File.WriteAllTextAsync(Path.Combine(workspace.Path, "aspire.config.json"), 246["first-source"] = Path.Combine(workspace.Path, "first"), 247["second-source"] = Path.Combine(workspace.Path, "second") 268await WriteConfiguredSourcesAsync(provider, new() { ["examples"] = Path.Combine(workspace.Path, "template") }); 293["missing"] = Path.Combine(workspace.Path, "missing"), 295["working"] = Path.Combine(workspace.Path, "valid") 366["second-source"] = new { path = Path.Combine(workspace.Path, "second"), displayName = "Company [templates]" }, 367["first-source"] = new { path = Path.Combine(workspace.Path, "first"), displayName = "Company [templates]" } 407var templatePath = Path.Combine(workspace.Path, "template"); 439await WriteConfiguredSourcesAsync(provider, new() { ["company"] = Path.Combine(workspace.Path, "template") }); 477await WriteConfiguredSourcesAsync(provider, new() { ["missing"] = Path.Combine(workspace.Path, "missing") }); 490Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 530Directory.CreateDirectory(Path.GetDirectoryName(localPath)!); 632Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 672await WriteConfiguredSourcesAsync(provider, new() { ["company"] = Path.Combine(workspace.Path, "templates") }); 688await WriteConfiguredSourcesAsync(provider, new() { ["company"] = Path.Combine(workspace.Path, "template") }); 703? Path.IsPathFullyQualified(text) ? new { path = text } : (object)new { repository = text } 711await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), JsonSerializer.Serialize(new 730await File.WriteAllTextAsync(Path.Combine(workspace.Path, directory, "TemplateApp.txt"), $"{marker}: GreetingValue");
Commands\NewCommandLocalTemplateTests.cs (156)
38await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 49await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "greeting.txt"), "GreetingValue"); 84await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), JsonSerializer.Serialize(new 103await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "features.txt"), "FeaturesValue"); 210Assert.Equal(ReadOutput(Path.Combine(workspace.Path, "non-interactive-out")), ReadOutput(workspace)); 252await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 272await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.txt"), "Mode: [ModeValue]\n"); 378Assert.Equal(!useDatabase, Directory.Exists(Path.Combine(workspace.Path, "out"))); 393await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 414await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.txt"), 442await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 460await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.txt"), 495Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 504await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 521await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.txt"), "First: FirstValue\nSecond: SecondValue\n"); 545await File.WriteAllTextAsync(Path.Combine(gitDirectory.FullName, "config"), "Original repository configuration"); 548await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".git"), "gitdir: ../git-storage"); 552await File.WriteAllTextAsync(Path.Combine(nestedGitDirectory.FullName, "config"), "Nested repository configuration"); 554await File.WriteAllTextAsync(Path.Combine(nestedWorktree.FullName, ".git"), "gitdir: ../../git-storage"); 555await File.WriteAllTextAsync(Path.Combine(nestedWorktree.FullName, "content.txt"), "Keep worktree content"); 556await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".gitignore"), "bin/"); 557await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".gitattributes"), "* text=auto"); 559await File.WriteAllTextAsync(Path.Combine(github.FullName, "content.txt"), "Keep GitHub content"); 560var originalSource = ReadOutput(Path.Combine(workspace.Path, "template")); 570Assert.Equal(originalSource, ReadOutput(Path.Combine(workspace.Path, "template"))); 571Assert.Equal("Original repository configuration", await File.ReadAllTextAsync(Path.Combine(gitDirectory.FullName, "config"))); 581var templateDirectory = Path.Combine(Enumerable.Repeat("d", 50).Append("template").ToArray()); 582var templatePath = Path.Combine(workspace.Path, templateDirectory); 583Assert.True(templatePath.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]).Length > 47); 584var config = workspace.CreateDirectory(Path.Combine(templateDirectory, ".template.config")); 585await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 590await File.WriteAllTextAsync(Path.Combine(templatePath, ".git"), "gitdir: ../git-storage"); 594var git = workspace.CreateDirectory(Path.Combine(templateDirectory, ".git")); 595await File.WriteAllTextAsync(Path.Combine(git.FullName, "config"), "Original repository configuration"); 597var nestedGit = workspace.CreateDirectory(Path.Combine(templateDirectory, "nested", ".git")); 598await File.WriteAllTextAsync(Path.Combine(nestedGit.FullName, "config"), "Nested repository configuration"); 599await File.WriteAllTextAsync(Path.Combine(templatePath, "content.txt"), "Keep template content"); 600await File.WriteAllTextAsync(Path.Combine(templatePath, ".gitignore"), "bin/"); 601var github = workspace.CreateDirectory(Path.Combine(templateDirectory, ".github")); 602await File.WriteAllTextAsync(Path.Combine(github.FullName, "content.txt"), "Keep GitHub content"); 607Assert.False(fileSystem.FileExists(Path.Combine(templatePath, ".git"))); 608Assert.False(fileSystem.DirectoryExists(Path.Combine(templatePath, ".git"))); 609Assert.False(fileSystem.FileExists(Path.Combine(nestedGit.FullName, "config"))); 610Assert.Throws<FileNotFoundException>(() => fileSystem.ReadAllText(Path.Combine(nestedGit.FullName, "config"))); 678outputCreated = File.Exists(Path.Combine(workspace.Path, "out", "Demo.cs")); 706await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), $$""" 722await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "aspire.config.json"), """ 743using var generatedConfig = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "aspire.config.json"))); 772Directory.CreateDirectory(Path.Combine(context.HivesDirectory.FullName, channel, "packages")); 822var outputPath = Path.Combine(workspace.Path, "out"); 828_ => Path.Combine(context.HivesDirectory.FullName, channel, "packages") 867var outputPath = Path.Combine(workspace.Path, "out"); 886var templateConfigPath = Path.Combine(workspace.Path, "template", "nuget.config"); 887var targetConfigPath = Path.Combine(workspace.Path, "template", fileName); 953var outputPath = Path.Combine(workspace.Path, "out"); 964_ => Path.Combine(context.HivesDirectory.FullName, channel, "packages") 980var sourceConfigPath = Path.Combine(workspace.Path, "template", "nuget.config"); 991foreach (var file in Directory.EnumerateFiles(Path.Combine(workspace.Path, "template"), "*", SearchOption.AllDirectories)) 993var target = Path.Combine(destination.FullName, Path.GetRelativePath(Path.Combine(workspace.Path, "template"), file)); 994Directory.CreateDirectory(Path.GetDirectoryName(target)!); 1012Assert.Equal(ownedConfig, await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "nuget.config"))); 1017ReadOutput(Path.Combine(workspace.Path, "template")).Keys); 1020var cachedTemplate = Assert.Single(Directory.GetDirectories(Path.Combine(workspace.Path, ".aspire", "cache", "git"))); 1022ReadOutput(Path.Combine(workspace.Path, "template")), 1023ReadOutput(Path.Combine(cachedTemplate, "repository"))); 1045Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1061await File.WriteAllTextAsync(Path.Combine(conflictingDirectory.FullName, "keep.txt"), "Template content"); 1087Assert.False(File.Exists(Path.Combine(workspace.Path, "out", "nuget.config"))); 1097Assert.Equal("Template content", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "nuget.config", "keep.txt"))); 1125var config = XDocument.Load(Path.Combine(workspace.Path, "out", "nuget.config")); 1141await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"), "{}"); 1152Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1199Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1218await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".template.config", "template.json"), "{ not json"); 1222await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template"), "not a directory"); 1232Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1259await File.WriteAllTextAsync(Path.Combine(workspace.Path, "out", "existing.txt"), "Keep me"); 1298Assert.Equal("second", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "identity.txt"))); 1304Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1337Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1355Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1372["new", "--template-path", Path.Combine(workspace.Path, "template"), "--name", "Demo", "--output", "out", "--suppress-agent-init"]) 1390await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 1400var path = Path.Combine(root.FullName, appHostFile); 1401Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1414var outputDirectory = Path.Combine(workspace.Path, "out"); 1415Assert.False(File.Exists(Path.Combine(outputDirectory, "aspire.config.json"))); 1416var agentInstructionsPath = Path.Combine(outputDirectory, AgentInstructionsFile.FileName); 1456var cacheRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"); 1476Assert.True(Directory.Exists(Path.Combine(checkout, ".git"))); 1497Directory.CreateDirectory(Path.Combine(destination.FullName, ".git")); 1498await CreateTemplateAsync(workspace, Path.GetRelativePath(workspace.Path, Path.Combine(destination.FullName, "template"))); 1568Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1571Assert.Empty(Directory.GetFileSystemEntries(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1596Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1599Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1606var linkPath = Path.Combine(workspace.Path, "template-link"); 1619Directory.CreateDirectory(Path.Combine(destination.FullName, ".git")); 1621Directory.Move(linkPath, Path.Combine(destination.FullName, "template")); 1635Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1638Assert.Empty(Directory.GetFileSystemEntries(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1651var gitObject = Path.Combine(gitDirectory.FullName, "partial-object"); 1666Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 1669Assert.Empty(Directory.GetFileSystemEntries(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1683Directory.CreateDirectory(Path.Combine(destination.FullName, ".git")); 1684var readOnlyFile = Path.Combine(destination.FullName, ".git", "read-only-object"); 1687await CreateTemplateAsync(workspace, Path.GetRelativePath(workspace.Path, Path.Combine(destination.FullName, "template"))); 1695var cacheRoot = Path.Combine(provider.GetRequiredService<CliExecutionContext>().CacheDirectory.FullName, "git"); 1725Assert.Single(Directory.GetFileSystemEntries(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1735var identityFile = Path.Combine(repository.FullName, "template", "identity.txt"); 1742var firstSha = (await File.ReadAllTextAsync(Path.Combine(repository.FullName, ".git", "refs", "heads", "main"))).Trim(); 1748var secondSha = (await File.ReadAllTextAsync(Path.Combine(repository.FullName, ".git", "refs", "heads", "main"))).Trim(); 1761var cacheRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"); 1771var sha = (await File.ReadAllTextAsync(Path.Combine(directory, ".git", "shallow"))).Trim(); 1773Assert.Matches("^[0-9a-f]{16}$", Path.GetFileName(directory)); 1791var repositoryPath = Path.GetRelativePath(provider.GetRequiredService<CliExecutionContext>().WorkingDirectory.FullName, repository.FullName); 1807outputs[label] = ReadOutput(Path.Combine(workspace.Path, "out", label)); 1818Directory.CreateDirectory(Path.Combine(destination.FullName, ".git")); 1819await CreateTemplateAsync(workspace, Path.GetRelativePath(workspace.Path, Path.Combine(destination.FullName, "one"))); 1820await CreateTemplateAsync(workspace, Path.GetRelativePath(workspace.Path, Path.Combine(destination.FullName, "two"))); 1850var cacheRoot = Path.Combine(provider.GetRequiredService<CliExecutionContext>().CacheDirectory.FullName, "git"); 1876Directory.CreateDirectory(Path.Combine(destination.FullName, ".git")); 1877await CreateTemplateAsync(workspace, Path.GetRelativePath(workspace.Path, Path.Combine(destination.FullName, "template"))); 1893var cacheRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"); 1895Assert.True(Directory.Exists(Path.Combine(cached, ".git"))); 1896Assert.True(File.Exists(Path.Combine(cached, "repository", "template", ".template.config", "template.json"))); 1937Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1959Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 1998Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 2031Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "git"))); 2037await File.WriteAllTextAsync(Path.Combine(config.FullName, "aspirecli.host.json"), 2039await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), $$""" 2069await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "nuget.config"), """ 2081await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "aspire.config.json"), """ 2114await File.WriteAllTextAsync(Path.Combine(workspace.Path, "nuget.config"), """ 2124await File.WriteAllTextAsync(Path.Combine(config.FullName, "aspirecli.host.json"), 2126await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 2140await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "aspire.config.json"), 2145ReadOutput(Path.Combine(workspace.Path, "out")); 2151.ToDictionary(path => Path.GetRelativePath(directory, path).Replace('\\', '/'), File.ReadAllText); 2158await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), $$""" 2177await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.txt"), "Mode: [ModeValue]\n"); 2210await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), JsonSerializer.Serialize(new 2217await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.txt"), 2226await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), $$""" 2268await File.WriteAllTextAsync(Path.Combine(root.FullName, "TemplateApp.cs"), """ 2281await File.WriteAllTextAsync(Path.Combine(root.FullName, "worker-only.txt"), "Worker content"); 2282await File.WriteAllTextAsync(Path.Combine(root.FullName, "identity.txt"), name);
Commands\NewCommandLocalTemplateTests.HostConfiguration.cs (33)
37var config = Path.Combine(workspace.Path, "template", ".template.config"); 40await File.WriteAllTextAsync(Path.Combine(config, "dotnetcli.host.json"), $$""" 46await File.WriteAllTextAsync(Path.Combine(config, "aspirecli.host.json"), aspireConfiguration == 1 ? "{}" : """ 95await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"), """ 131await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 153await File.WriteAllTextAsync(Path.Combine(config.FullName, hostFile), """ 161await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "settings.json"), 175using var settings = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "settings.json"))); 191await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"), """ 207Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 227var config = Path.Combine(workspace.Path, "template", ".template.config"); 228await File.WriteAllTextAsync(Path.Combine(config, "aspirecli.host.json"), contents); 229await File.WriteAllTextAsync(Path.Combine(config, "dotnetcli.host.json"), "{}"); 239Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 247await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"), """ 270await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"), """ 301var hostFile = Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"); 311await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "aspire.config.json"), """ 318await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "apphost.mts"), 345var config = Path.Combine(workspace.Path, "template", ".template.config"); 346await File.WriteAllTextAsync(Path.Combine(config, "template.json"), """ 353await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "aspire.config.json"), "{}"); 354var hostFile = Path.Combine(config, "aspirecli.host.json"); 363await File.WriteAllTextAsync(Path.Combine(config, "dotnetcli.host.json"), 376var output = Path.Combine(workspace.Path, "out"); 377Assert.Equal(expectedCreate, File.Exists(Path.Combine(output, "nuget.config"))); 432var output = Path.Combine(workspace.Path, "out"); 497var appHost = XDocument.Load(Path.Combine(workspace.Path, "out", "Demo.AppHost", "Demo.AppHost.csproj")); 526var result = await creator.InstantiateAsync(discoveredTemplate, "Demo", null, Path.Combine(workspace.Path, "out"), 532var invalid = await creator.InstantiateAsync(discoveredTemplate, "Demo", null, Path.Combine(workspace.Path, "invalid"), 539var source = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, 545var configurationPath = Path.Combine(template.FullName, ".template.config", "template.json");
Commands\NewCommandLocalTemplateTests.InitConfig.cs (12)
51"enterprise": { "path": {{JsonSerializer.Serialize(Path.Combine(workspace.Path, "enterprise"))}} } 61await WriteConfiguredSourcesAsync(provider, new() { ["personal"] = Path.Combine(workspace.Path, "personal") }); 74await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 136var localPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 198"templateSources": { "enterprise": { "path": {{JsonSerializer.Serialize(Path.Combine(workspace.Path, "enterprise"))}}, "displayName": "Team [templates]" } }, 207["personal"] = new { path = Path.Combine(workspace.Path, "personal"), displayName = "Team [templates]" } 225var projectConfig = Path.Combine(workspace.Path, "out", AspireConfigFile.FileName); 227Assert.Equal("Enterprise: Hello", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 259await WriteConfiguredSourcesAsync(provider, new() { ["personal"] = Path.Combine(workspace.Path, "personal") }); 273await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", AspireConfigFile.FileName)), "json"); 274Assert.Equal("Personal: Hello", await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 281var localPath = Path.Combine(workspace.Path, AspireConfigFile.FileName);
Commands\NewCommandLocalTemplateTests.NuGetValues.cs (42)
42await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "NuGet.Config"), """ 90await File.WriteAllTextAsync(Path.Combine(workspace.Path, "NuGet.Config"), config); 95await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "AppHost", "nuget.config"), 97await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "nuget.config"), 103File.Copy(Path.Combine(feed.FullName, "Aspire.Hosting.Dotnet.13.6.1-preview.3.nupkg"), 104Path.Combine(embedded.FullName, "Aspire.Hosting.Dotnet.13.6.1-preview.3.nupkg")); 105await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "nuget.config"), config); 109await File.WriteAllTextAsync(Path.Combine(workspace.Path, "NuGet.Config"), 111var host = Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"); 136var output = Path.Combine(workspace.Path, "out"); 138[policy == "embedded" ? Path.Combine(output, "feed") : feed.FullName], 139NuGetTestHelper.GetEligiblePackageSources(policy == "nested" ? Path.Combine(output, "AppHost") : output, "Aspire.Hosting.Dotnet")); 140await Verify(await File.ReadAllTextAsync(Path.Combine(output, "versions.json"))).UseParameters(policy); 165Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 200Assert.Equal(existingOutput, Directory.Exists(Path.Combine(workspace.Path, "out"))); 203Assert.Empty(Directory.GetFileSystemEntries(Path.Combine(workspace.Path, "out"))); 232Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 243await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "nuget.config"), """ 260Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 273var path = Path.Combine(workspace.Path, "template", ".template.config", "template.json"); 288Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 303var path = Path.Combine(workspace.Path, "template", ".template.config", "template.json"); 335Assert.Equal(enabled, File.Exists(Path.Combine(workspace.Path, "out", "versions.json"))); 347var config = Path.Combine(workspace.Path, "template", ".template.config"); 348File.Move(Path.Combine(config, "aspirecli.host.json"), Path.Combine(config, "dotnetcli.host.json")); 349var definitionPath = Path.Combine(config, "template.json"); 355await File.WriteAllTextAsync(Path.Combine(config, "aspirecli.host.json"), "{}"); 390var config = Path.Combine(workspace.Path, "template", ".template.config"); 391var hostPath = Path.Combine(config, "aspirecli.host.json"); 396var templatePath = Path.Combine(config, "template.json"); 409Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 436Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 454await File.WriteAllTextAsync(Path.Combine(output.FullName, "keep.txt"), "Concurrent user content", token); 477var config = Path.Combine(workspace.Path, "template", ".template.config"); 478var path = Path.Combine(config, "template.json"); 488path = Path.Combine(config, "aspirecli.host.json"); 494await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "preliminary-only.txt"), "Placeholder render only"); 495await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "versions.json"), 518await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 530await File.WriteAllTextAsync(Path.Combine(config.FullName, "aspirecli.host.json"), $$""" 539await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "versions.json"),
Commands\NewCommandLocalTemplateTests.PromptDefaults.cs (9)
126var templatePath = Path.Combine(workspace.Path, "template", ".template.config", "template.json"); 129var hostPath = Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"); 224Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 236var hostPath = Path.Combine(workspace.Path, "template", ".template.config", "aspirecli.host.json"); 251Assert.False(Directory.Exists(Path.Combine(workspace.Path, "out"))); 259var templatePath = Path.Combine(workspace.Path, "template", ".template.config", "template.json"); 282await File.WriteAllTextAsync(Path.Combine(config.FullName, "template.json"), """ 318await File.WriteAllTextAsync(Path.Combine(config.FullName, "aspirecli.host.json"), """ 326await File.WriteAllTextAsync(Path.Combine(workspace.Path, "template", "names.txt"),
Commands\NewCommandLocalTemplateTests.SourceList.cs (3)
50Directory.CreateDirectory(Path.GetDirectoryName(localPath)!); 235Directory.CreateDirectory(Path.GetDirectoryName(localPath)!); 434Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName)));
Commands\NewCommandLocalTemplateTests.SourceListGit.cs (17)
73Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 75previousPointer = await File.ReadAllTextAsync(Path.Combine(previousCache, "current")); 76previousCheck = await File.ReadAllTextAsync(Path.Combine(previousCache, "check.json")); 86var projectPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 87Directory.CreateDirectory(Path.GetDirectoryName(projectPath)!); 140var snapshot = Path.Combine(cache, await File.ReadAllTextAsync(Path.Combine(cache, "current"))); 141Assert.True(Directory.Exists(Path.Combine(snapshot, "repository.git"))); 142var metadata = JsonSerializer.Deserialize(await File.ReadAllTextAsync(Path.Combine(snapshot, "metadata.json")), 148JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(snapshot, AspireConfigFile.FileName))))); 156Assert.Equal(previousPointer, await File.ReadAllTextAsync(Path.Combine(cache, "current"))); 157Assert.Equal(previousCheck, await File.ReadAllTextAsync(Path.Combine(cache, "check.json"))); 161Assert.False(Directory.Exists(Path.GetDirectoryName(cache))); 259await WriteConfiguredSourcesAsync(provider, new() { ["personal"] = Path.Combine(workspace.Path, "personal") }); 275await File.ReadAllTextAsync(Path.Combine(workspace.Path, "out", "Demo.txt"))); 318var path = Path.Combine(repository.FullName, "teams", "platform.json"); 319Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Commands\NewCommandLocalTemplateTests.SourceManagement.cs (1)
464await File.WriteAllTextAsync(Path.Combine(cache.FullName, "workspace-config-locks"), "Blocks lock directory creation.");
Commands\NewCommandTemplateConfigPersistenceTests.cs (14)
237outputDirectory => File.ReadAllText(Path.Combine(outputDirectory, AspireConfigFile.FileName))); 288File.WriteAllText(Path.Combine(outputPath, $"{name}.generated"), templateName); 327var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, outputDirectoryName); 332var appHostFile = Path.Combine(outputDirectory, "apphost.cs"); 341var csharpNuGetConfig = await File.ReadAllTextAsync(Path.Combine(outputDirectory, "nuget.config")); 364var dotNetNuGetConfig = await File.ReadAllTextAsync(Path.Combine(outputDirectory, "nuget.config")); 391File.ReadAllText(Path.Combine(outputDirectory, "apphost.go")), 482var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, outputDirectoryName); 557hivesDirectory: new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")), 592var installPrefix = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "custom-aspire-prefix")); 593var processPath = Path.Combine(installPrefix.FullName, "dogfood", PrChannelName, "bin", "aspire"); 594Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 597var packagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", PrChannelName, "packages")); 598File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{s_prVersion}.nupkg"), string.Empty);
Commands\NewCommandTests.cs (135)
52var configPath = Path.Combine(workspace.Path, "nuget.config"); 74Path.Combine(workspace.Path, "TemplateOut", "nuget.config"), "company")], interaction.DisplayedErrors); 76Assert.Empty(Directory.EnumerateFiles(Path.Combine(workspace.Path, "TemplateOut"))); 181var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "TemplateOut"); 182var nugetConfigPath = Path.Combine(outputDirectory, "nuget.config"); 211var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TemplateOut", "apphost.settings.json"); 613var config = AspireConfigFile.Load(Path.Combine(workspace.WorkspaceRoot.FullName, "output")); 795var doc = XDocument.Load(Path.Combine(outputPath, "nuget.config")); 966File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.mts"), "// test apphost"); 983Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.mts"))); 984Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "aspire.config.json"))); 1023File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.go"), "// test apphost"); 1037Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.go"))); 1184File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "AppHost.java"), "package aspire;"); 1209File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), """ 1247File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "AppHost.java"), "package aspire;"); 1275File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.mts"), "// test apphost"); 1287Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.mts"))); 1359AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), expectedSource); 1369var expectedSource = Path.Combine(workspace.WorkspaceRoot.FullName, "relative-feed"); 1370var nestedDirectory = Directory.CreateDirectory(Path.Combine(expectedSource, "aspire.projecttemplates", "9.2.0")); 1371File.WriteAllText(Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty); 1402AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), expectedSource); 1414var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed"); 1416File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty); 1443File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, scaffoldFileName), "// test apphost"); 1455AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride); 1468var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed"); 1470File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty); 1481AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride); 1499await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "output", AgentInstructionsFile.FileName))); 1511var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 1512Assert.True(File.Exists(Path.Combine(outputDirectory, "aspire.config.json"))); 1513Assert.False(File.Exists(Path.Combine(outputDirectory, AgentInstructionsFile.FileName))); 1536Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "output")); 1549Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output"))); 1581var expectedSource = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.org"); 1584Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output"))); 1604File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.mts"), "// test apphost"); 1643File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "AppHost.java"), "package aspire;"); 1655Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "AppHost.java"))); 1679File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.py"), "# test apphost"); 1691Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.py"))); 1707File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.go"), "// test apphost"); 1719Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.go"))); 1735Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.cs"))); 1765var appHostCreated = File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.cs")); 1801var content = await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "output", "apphost.cs")); 1837var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 1838var aspireConfigPath = Path.Combine(outputDir, "aspire.config.json"); 1839var appHostRunJsonPath = Path.Combine(outputDir, "apphost.run.json"); 1871var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 1872var aspireConfigPath = Path.Combine(outputDir, "aspire.config.json"); 1873var appHostRunJsonPath = Path.Combine(outputDir, "apphost.run.json"); 1946var outputRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 1948var aspireConfigPath = Path.Combine(outputRoot, "aspire.config.json"); 1955var appHostRunJsonPath = Path.Combine(outputRoot, "apphost.run.json"); 2080var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestApp"); 2125await File.WriteAllTextAsync(Path.Combine(context.TargetDirectory.FullName, "aspire.config.json"), """ 2155var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", "aspire.config.json"); 2219var modulesDir = Directory.CreateDirectory(Path.Combine(directory.FullName, LanguageInfo.GeneratedFolderName)); 2220File.WriteAllText(Path.Combine(modulesDir.FullName, "aspire.mts"), "// generated sdk"); 2235Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "output", LanguageInfo.GeneratedFolderName, "aspire.mts"))); 2305var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed"); 2309File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty); 2343var modulesDir = Directory.CreateDirectory(Path.Combine(directory.FullName, ".aspire", "modules")); 2344File.WriteAllText(Path.Combine(modulesDir.FullName, "aspire.ts"), "// generated sdk"); 2357AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride); 2412AssertSourceOverrideNuGetConfig(Path.Combine(workspace.WorkspaceRoot.FullName, "output"), sourceOverride); 2422var sourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "source-feed"); 2426File.WriteAllText(Path.Combine(sourceOverride, "Aspire.ProjectTemplates.9.2.0.nupkg"), string.Empty); 2521var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 2522var agentsDir = Path.Combine(outputDir, ".agents", "skills"); 2546var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 2548[Path.Combine(outputDir, ".github", "copilot", "settings.json")], [SkillSource.BuiltIn])); 2549Assert.False(Directory.Exists(Path.Combine(outputDir, ".agents", "skills"))); 2561var skillDirectory = Path.Combine(homeDirectory.FullName, ".agents", "skills", CommonAgentApplicators.AspireSkillName); 2563await File.WriteAllTextAsync(Path.Combine(skillDirectory, "SKILL.md"), "My customized Aspire instructions."); 2675Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-starter"), capturedOutputPath); 2711var result = command.Parse($"new aspire-starter --name MyProject --output {Path.Combine(workspace.WorkspaceRoot.FullName, "my-project")} --use-redis-cache --test-framework None"); 2721[Path.Combine(capturedOutputPath, ".github", "copilot", "settings.json")], 2723Assert.False(Directory.Exists(Path.Combine(capturedOutputPath, ".agents", "skills"))); 2754var outputDir = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 2762var skillPath = Path.Combine(outputDir, ".agents", "skills", "aspire", "SKILL.md"); 2873Path.Combine(workspace.WorkspaceRoot.FullName, "source"); 2904var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", "MyFirstApp"); 2932Path.Combine(workspace.WorkspaceRoot.FullName, "source", "MyFirstApp"); 2963var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", "MyFirstApp"); 2989Path.Combine(workspace.WorkspaceRoot.FullName, "source"); 3020var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source"); 3085workspaceRoot => Path.Combine(workspaceRoot, "source") + Path.DirectorySeparatorChar, 3086workspaceRoot => Path.Combine(workspaceRoot, "source", projectName)); 3090workspaceRoot => Path.Combine(workspaceRoot, projectName) + Path.DirectorySeparatorChar, 3091workspaceRoot => Path.Combine(workspaceRoot, projectName)); 3117Path.Combine(workspace.WorkspaceRoot.FullName, "source"); 3128File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost"); 3142var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", projectName); 3144Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts"))); 3154File.WriteAllText(Path.Combine(selectedParent.FullName, "existing.txt"), "existing content"); 3191File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost"); 3206var expectedPath = Path.Combine(selectedParent.FullName, projectName); 3208Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts"))); 3218var collidingProject = Directory.CreateDirectory(Path.Combine(collidingParent.FullName, projectName)); 3219File.WriteAllText(Path.Combine(collidingProject.FullName, "existing.txt"), "existing content"); 3284Assert.Equal(Path.Combine(validParent.FullName, projectName), capturedOutputPath); 3344File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost"); 3359var expectedPath = Path.Combine(selectedParent.FullName, projectName); 3361Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts"))); 3413File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost"); 3429Assert.True(File.Exists(Path.Combine(selectedOutputPath.FullName, "apphost.ts"))); 3430Assert.False(File.Exists(Path.Combine(selectedOutputPath.FullName, projectName, "apphost.ts"))); 3456Path.Combine(workspace.WorkspaceRoot.FullName, "source", projectName); 3467File.WriteAllText(Path.Combine(context.TargetDirectory.FullName, "apphost.ts"), "// test apphost"); 3481var expectedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "source", projectName); 3483Assert.True(File.Exists(Path.Combine(expectedPath, "apphost.ts"))); 3521var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 3523[Path.Combine(outputDirectory, ".github", "copilot", "settings.json")], 3525Assert.False(Directory.Exists(Path.Combine(outputDirectory, ".agents", "skills"))); 3550var skillPath = Path.Combine(workspace.WorkspaceRoot.FullName, "output", ".agents", "skills", CommonAgentApplicators.AspireSkillName, "SKILL.md"); 3576var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 3578[Path.Combine(outputDirectory, ".github", "copilot", "settings.json")], 3580Assert.False(Directory.Exists(Path.Combine(outputDirectory, ".agents", "skills"))); 3605var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 3607[Path.Combine(outputDirectory, ".github", "copilot", "settings.json")], 3609Assert.False(Directory.Exists(Path.Combine(outputDirectory, ".agents", "skills"))); 3629var configurationPath = Path.Combine(homeDirectory.FullName, ".claude", "settings.json"); 3634var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 3635Assert.False(Directory.Exists(Path.Combine(outputDirectory, ".claude", "skills"))); 3636Assert.False(Directory.Exists(Path.Combine(outputDirectory, ".agents", "skills"))); 3637Assert.False(File.Exists(Path.Combine(outputDirectory, ".mcp.json"))); 3638Assert.False(File.Exists(Path.Combine(outputDirectory, ".vscode", "mcp.json"))); 3648File.WriteAllText(Path.Combine(existingDir.FullName, "file.txt"), "content"); 3697File.WriteAllText(Path.Combine(existingDir.FullName, "file.txt"), "content");
Commands\ParseResultHelperTests.cs (1)
113var relativePath = Path.Combine("Profile Output", "profile.zip");
Commands\PsCommandTests.cs (18)
131AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 146AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"), 198var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 237AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 277AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 283AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 321AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 365AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 402var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 436var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 506AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 545AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 579var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 678AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 722AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 762AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 769AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"), 809AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"),
Commands\PublishCommandPromptingIntegrationTests.cs (18)
262var selectedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "artifact.zip"); 265var missingFile = Path.Combine(workspace.WorkspaceRoot.FullName, "missing.zip"); 266var relativeMissingFile = Path.GetRelativePath(Directory.GetCurrentDirectory(), missingFile); 267var relativeSelectedFile = Path.GetRelativePath(Directory.GetCurrentDirectory(), selectedFile); 803var oversizedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "large.bin"); 806var validFile = Path.Combine(workspace.WorkspaceRoot.FullName, "small.bin"); 809var relativeOversized = Path.GetRelativePath(Directory.GetCurrentDirectory(), oversizedFile); 810var relativeValid = Path.GetRelativePath(Directory.GetCurrentDirectory(), validFile); 849var wrongExtFile = Path.Combine(workspace.WorkspaceRoot.FullName, "cert.txt"); 852var correctFile = Path.Combine(workspace.WorkspaceRoot.FullName, "cert.pem"); 855var relativeWrong = Path.GetRelativePath(Directory.GetCurrentDirectory(), wrongExtFile); 856var relativeCorrect = Path.GetRelativePath(Directory.GetCurrentDirectory(), correctFile); 895var validFile = Path.Combine(workspace.WorkspaceRoot.FullName, "deploy.zip"); 898var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), validFile); 927Assert.Equal(Path.GetFullPath(validFile), uploadedFilePath); 941var validFile = Path.Combine(workspace.WorkspaceRoot.FullName, "archive.tar.gz"); 944var relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), validFile); 970Assert.Equal(Path.GetFullPath(validFile), uploadedFilePath);
Commands\ResourceCommandHelpParserTests.cs (2)
44Assert.EndsWith(Path.Combine("AppHost", "AppHost.csproj"), appHostProjectFile.FullName); 62Assert.EndsWith(Path.Combine("AppHost", "AppHost.csproj"), appHostProjectFile.FullName);
Commands\ResourceCommandTests.cs (7)
43var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj")); 227var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 245Path.Combine(workspace.WorkspaceRoot.FullName, "socket1"), 248Path.Combine(workspace.WorkspaceRoot.FullName, "socket2"), 279var appHostProjectFile = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj")); 281var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 283var symlinkedAppHostPath = Path.Combine(symlinkDirectory, appHostProjectFile.Name);
Commands\RestoreCommandTests.cs (2)
19var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 56var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Commands\RunCommandTests.cs (77)
66var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 206var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 207File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """ 255var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 256File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), $$""" 362var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 403var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 450var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 495var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 579var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 675var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 780var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 882var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 978var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 1083var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 1269await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, projectFile), "<Project />"); 1296string[] arguments = explicitPath is null ? ["run"] : ["run", "--apphost", Path.GetFullPath(explicitPath, workspace.WorkspaceRoot.FullName)]; 1407var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj")); 1433var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj")); 1437Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 1466var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj")); 1500var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj")); 1529var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj")); 1606var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1679var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1680File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """ 1799var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 1875var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 1939var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2001var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2061var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2129var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2212var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2318var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2381var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2442var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 2504var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 3181var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [run].log"); 3201var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri; 3294$"{InteractionServiceStrings.BuildingAppHost} src{Path.DirectorySeparatorChar}MyApp.AppHost{Path.DirectorySeparatorChar}MyApp.AppHost.csproj", 3303var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost"); 3305var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj"); 3946var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3994var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4038var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4086var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4129var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4173var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4217var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4359var originalSecretsDir = Path.GetDirectoryName(originalSecretsPath)!; 4511var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4573var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4610var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4652var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4710var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4754var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4815Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"), 4853Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"), 4888var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4937var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 4981var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 5037Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"), 5079var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 5136var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 5183Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git")); 5185var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 5187var relativeCapturePath = Path.Combine("Profile Output", "profile.zip"); 5250Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git")); 5252var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 5278Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git")); 5280var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 5532var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 5573var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 5581var backchannelsDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch"); 5586var appHostId = Path.GetFileName(prefix); 5587var socketPath = Path.Combine(
Commands\Sdk\SdkResponseFileTests.cs (11)
39var responseFile = Path.Combine( 48await File.WriteAllTextAsync(Path.Combine(aspireHome.FullName, "aspire.config.json"), 75Assert.Equal(Path.Combine(aspireHome.FullName, "tmp", "sdk"), Directory.GetParent(appPath)?.FullName); 79Assert.Equal(Path.Combine(appPath, "server"), project.ProjectModelPath); 81Path.Combine(parentDirectory ? appPath : project.ProjectModelPath, "Directory.Build.rsp"), 90var probeProject = new FileInfo(Path.Combine(modelDirectory.FullName, "Probe.proj")); 103var integrationProject = Path.Combine(repoRoot, "src", "Aspire.Hosting", "Aspire.Hosting.csproj"); 104var outputPath = Path.Combine(workspace.Path, "output"); 122Directory.GetFileSystemEntries(aspireHome.FullName).Select(Path.GetFileName).Order(StringComparer.Ordinal)); 127Assert.NotEmpty(await File.ReadAllTextAsync(Path.Combine(outputPath, "aspire.mts"))); 145Assert.NotEmpty(await File.ReadAllTextAsync(Path.Combine(outputPath, "Aspire.Hosting.ats.txt")));
Commands\SdkCommandTests.cs (11)
24var aspireHome = new DirectoryInfo(Path.Combine(workspace.Path, "custom-aspire-home")); 26await File.WriteAllTextAsync(Path.Combine(aspireHome.FullName, "aspire.config.json"), 30foreach (var path in new[] { Path.Combine(aspireHome.FullName, "tmp"), Path.Combine(aspireHome.FullName, "tmp", "sdk") }) 47Assert.Equal(Path.Combine(aspireHome.FullName, "tmp", "sdk"), Directory.GetParent(appPath)?.FullName); 50Assert.Equal(Path.Combine(appPath, ".aspire", "integrations"), 54foreach (var directory in new[] { appPath, Path.Combine(aspireHome.FullName, "tmp"), Path.Combine(aspireHome.FullName, "tmp", "sdk") }) 65var integrationProject = Path.Combine(workspace.Path, "Integration.csproj"); 67var outputPath = Path.Combine(workspace.Path, "output"); 88Assert.Empty(Directory.GetFileSystemEntries(Path.Combine(aspireHome.FullName, "tmp", "sdk")));
Commands\SdkDumpCommandTests.cs (7)
277Path.Combine(workspace.Path, "output"), "Aspire.Hosting.Redis@13.2.0"]); 285Assert.Equal([Path.Combine(scannerPath, "aspire.config.json")], scannerFiles); 302var projectPath = Path.Combine(repoRoot, "src", "Aspire.Hosting", "Aspire.Hosting.csproj"); 305var tempDirectory = Path.Combine(Path.GetTempPath(), "aspire-sdk-dump-tests", $"{Guid.NewGuid():N}"); 307var outputPath = Path.Combine(tempDirectory, "capabilities.txt"); 448if (File.Exists(Path.Combine(currentDirectory.FullName, "Aspire.slnx")))
Commands\SdkInstallerTests.cs (3)
29await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent); 116await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent); 154await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent);
Commands\SecretCommandTests.cs (39)
53var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 66Directory.CreateDirectory(Path.GetDirectoryName(path)!); 104var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 111Directory.CreateDirectory(Path.GetDirectoryName(aspirePath)!); 112Directory.CreateDirectory(Path.GetDirectoryName(legacyPath)!); 147var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 157Directory.CreateDirectory(Path.GetDirectoryName(path)!); 171Directory.CreateDirectory(Path.GetDirectoryName(expectedPath)!); 193var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 204Assert.False(Directory.Exists(Path.GetDirectoryName(expectedPath))); 214var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 218Directory.CreateDirectory(Path.GetDirectoryName(path)!); 257var appHostFile = new FileInfo(Path.Combine(workspace.Path, fileName)); 300Directory.Delete(Path.GetDirectoryName(secretsPath)!); 313var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 342Directory.Delete(Path.GetDirectoryName(secretsPath)!); 354var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 399Directory.Delete(Path.GetDirectoryName(secretsPath)!); 412var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 445Directory.Delete(Path.GetDirectoryName(secretsPath)!); 461var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 491Directory.Delete(Path.GetDirectoryName(secretsPath)!); 504var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 554Directory.Delete(Path.GetDirectoryName(secretsPath)!); 564var appHostFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 580var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 606var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 632var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 689var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 726var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 748var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 793var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 799Directory.CreateDirectory(Path.GetDirectoryName(userSecretsPath)!); 854var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 864Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "secrets"))); 875var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 893Assert.Equal($"{originalEnvironment}.json", Path.GetFileName(Assert.Single(Directory.EnumerateFiles(directory)))); 897Assert.Contains(Path.Combine(directory, $"{originalEnvironment}.json"), outputWriter.Logs); 911var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Commands\SetupCommandTests.cs (6)
16var processPath = Path.Combine("home", ".aspire", "bin", "aspire"); 20Assert.Equal(Path.Combine("home", ".aspire"), result); 26var processPath = Path.Combine("home", ".aspire", "dogfood", "pr-12345", "bin", "aspire"); 30Assert.Equal(Path.Combine("home", ".aspire", "dogfood", "pr-12345"), result); 38var processPath = Path.Combine("Program Files", "WindowsApps", "Microsoft.Aspire_xyz", "aspire.exe"); 42Assert.Equal(Path.Combine("Program Files", "WindowsApps"), result);
Commands\StartCommandTests.cs (15)
250var propertiesDirectory = Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 251File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """ 302await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "fake"); 305await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "fake"); 333await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "fake"); 336await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "fake"); 364var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 417var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 556Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git")); 652Path.Combine(workspace.WorkspaceRoot.FullName, "common", ".git")); 687Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 706var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.csproj")); 714var backchannelsDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch"); 719var appHostId = Path.GetFileName(prefix); 720var socketPath = Path.Combine(
Commands\StopCommandTests.cs (95)
70var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App Host", fileName); 122var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 146"path" => Path.Combine(workspace.WorkspaceRoot.FullName, "Other", "AppHost.csproj"), 147"directory" => Path.GetDirectoryName(appHostPath)!, 192var connection = CreateConnection(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs"), 1); 232var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"); 266var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs"); 305var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs"); 354var resolvedProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Resolved.AppHost", "Resolved.AppHost.csproj")); 379string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("Resolved.AppHost", "Resolved.AppHost.csproj")), 392var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "AppHost.cs"); 393var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "AppHost.cs"); 411var expectedPath1 = Path.Combine("App1", "AppHost.cs"); 412var expectedPath2 = Path.Combine("App2", "AppHost.cs"); 427var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost", "App1.AppHost.csproj"); 464var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost", "App1.AppHost.csproj"); 483var expectedPath = Path.Combine("App1", "App1.AppHost", "App1.AppHost.csproj"); 492Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 493var worktreeRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".worktrees", "feature")).FullName; 496Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 502var primaryAppHost = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 503var nestedAppHost = Path.Combine(worktreeRoot, "AppHost.csproj"); 535var expectedPath = Path.Combine("AppHost", "AppHost.csproj"); 547var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 571string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("AppHost", "AppHost.csproj")), 579var commonGitDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, ".git"); 581var worktreeRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".worktrees", "feature")).FullName; 591var appHostPath = Path.Combine(worktreeRoot, "App1", "App1.AppHost", "App1.AppHost.csproj"); 630var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost", "App1.AppHost.csproj"); 666var appHostPath1 = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 667var appHostPath2 = Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "App2.AppHost.csproj"); 744var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 769Assert.Contains(interactionService.DisplayedMessages, message => message.Message == string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("AppHost", "AppHost.csproj"))); 779var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 811var runningAppHostFile = new FileInfo(Path.Combine(runningAppHostDirectory.FullName, "Running.AppHost.csproj")); 814var discoveredAppHostFile = new FileInfo(Path.Combine(discoveredAppHostDirectory.FullName, "Discovered.AppHost.csproj")); 853Path.Combine("RunningAppHost", "Running.AppHost.csproj")); 863var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 895var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 930var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 936var outOfScopeAppHostFile = Path.Combine(workspace.WorkspaceRoot.FullName, "OtherWorkspace", "Other.AppHost.csproj"); 970var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1010var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1051var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1091var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1130var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "apphost.ts")); 1166string.Format(SharedCommandStrings.AppHostNotRunningAtPath, Path.Combine("AppHost", "apphost.ts")), 1176var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1213var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1258var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1296var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1334var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1402var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1489var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "App1.AppHost.csproj"); 1521var connection1 = CreateConnection(Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "AppHost.cs"), int.MaxValue - 1); 1522var connection2 = CreateConnection(Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "AppHost.cs"), int.MaxValue - 2); 1550var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1590var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1635var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1654? string.Format(CultureInfo.CurrentCulture, StopCommandStrings.AppHostIdentifierWithProcessId, Path.Combine("AppHost", "AppHost.csproj"), connection.AppHostInfo!.ProcessId) 1655: Path.Combine("AppHost", "AppHost.csproj"); 1686var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1691var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 1754var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1776var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 1792var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1814var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 1838var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1850? string.Format(CultureInfo.CurrentCulture, StopCommandStrings.AppHostIdentifierWithProcessId, Path.Combine("AppHost", "AppHost.csproj"), appHostProcess.Id) 1851: Path.Combine("AppHost", "AppHost.csproj"); 1914var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 1921? string.Format(CultureInfo.CurrentCulture, StopCommandStrings.AppHostIdentifierWithProcessId, Path.Combine("AppHost", "AppHost.csproj"), appHostProcess.Id) 1922: Path.Combine("AppHost", "AppHost.csproj"); 1981var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 2006var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 2029var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 2036var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 2138var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 2154var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 2182var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 2214var unsupported = CreateConnection(Path.Combine(workspace.WorkspaceRoot.FullName, "App1", "AppHost.cs"), int.MaxValue - 1); 2216var unconfirmed = CreateConnection(Path.Combine(workspace.WorkspaceRoot.FullName, "App2", "AppHost.cs"), int.MaxValue - 2); 2230var stoppingUnsupported = string.Format(CultureInfo.CurrentCulture, StopCommandStrings.StoppingAppHost, Path.Combine("App1", "AppHost.cs")); 2250string.Format(CultureInfo.CurrentCulture, StopCommandStrings.ResourceTeardownUnsupported, Path.Combine("App1", "AppHost.cs"), "--wait"), 2251string.Format(CultureInfo.CurrentCulture, StopCommandStrings.ResourceTeardownNotConfirmed, Path.Combine("App2", "AppHost.cs")) 2264var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 2279var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 2292var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 2316var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 2340var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 2352var appHostIdentifier = Path.Combine("AppHost", "AppHost.csproj"); 2523var homeDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".home")); 2524var backchannelsDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "cli", "bch"); 2529var appHostId = Path.GetFileName(prefix); 2531var socketPath = Path.Combine(
Commands\TelemetryFollowTests.cs (1)
240AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost.csproj"),
Commands\TelemetryTestHelper.cs (1)
83AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\TelemetryTracesCommandTests.cs (1)
88AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
Commands\TemplateSourceStartupTests.cs (31)
94var globalPath = Path.Combine(home.FullName, legacyGlobal ? "globalsettings.json" : AspireConfigFile.FileName); 95var projectPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 107Assert.False(File.Exists(Path.Combine(home.FullName, AspireConfigFile.FileName))); 120var globalPath = Path.Combine(home.FullName, legacyGlobal ? "globalsettings.json" : AspireConfigFile.FileName); 121var projectPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 133Assert.False(File.Exists(Path.Combine(home.FullName, AspireConfigFile.FileName))); 144var globalPath = Path.Combine(home.FullName, AspireConfigFile.FileName); 145var projectPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 172var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 173var migratedPath = Path.Combine(home.FullName, AspireConfigFile.FileName); 175File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), 199var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 204File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), 207File.WriteAllText(Path.Combine(cache.FullName, "workspace-config-locks"), "Blocks lock directory creation."); 211Assert.False(File.Exists(Path.Combine(home.FullName, AspireConfigFile.FileName))); 223var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 238var originalPath = Path.Combine(homePath, "globalsettings.json"); 239var destination = Path.Combine(homePath, AspireConfigFile.FileName); 274var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 290var destination = Path.Combine(homePath, AspireConfigFile.FileName); 291var legacy = Path.Combine(homePath, "globalsettings.json"); 327var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 328var migratedPath = Path.Combine(home.FullName, AspireConfigFile.FileName); 330File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), 349var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 350var migratedPath = Path.Combine(home.FullName, AspireConfigFile.FileName); 353File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), 369File.WriteAllText(Path.Combine(legacyDirectory.FullName, "settings.json"), 386var legacyPath = Path.Combine(home.FullName, "globalsettings.json"); 387var migratedPath = Path.Combine(home.FullName, AspireConfigFile.FileName); 390File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName),
Commands\TerminalTapePlayCommandTests.cs (23)
57await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, path), contents); 100await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), ""); 118await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), ""); 163await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), ""); 242await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), 289await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), ""); 342await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"), 371await File.WriteAllTextAsync(Path.Combine(directory.FullName, "probe.tape"), "# Inspect the current screen."); 373["terminal", "tape", "play", "shell", "--tape-file", Path.Combine("tape files", "probe.tape")]); 392await File.WriteAllTextAsync(Path.Combine(directory.FullName, "play.tape"), """ 397await File.WriteAllTextAsync(Path.Combine(directory.FullName, "nested", "input.tape"), """ 403["terminal", "tape", "play", "shell", "--tape-file", Path.Combine("scripts", "play.tape")]); 423await File.WriteAllTextAsync(Path.Combine(directory.FullName, "play.tape"), 425await File.WriteAllTextAsync(Path.Combine(directory.FullName, "nested", "wait.tape"), 428["terminal", "tape", "play", "shell", "--tape-file", Path.Combine("scripts", "play.tape")]); 432path => Assert.Equal(Path.Combine(directory.FullName, "screen.txt"), path)); 433var capture = await File.ReadAllTextAsync(Path.Combine(directory.FullName, "screen.txt")); 448var file = Path.Combine(workspace.WorkspaceRoot.FullName, "play.tape"); 474await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"), 492await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"), 511await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"), 530await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "wait.tape"), 549await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "probe.tape"), "");
Commands\TestCommandTests.cs (19)
92summaryPath = Path.Combine(context.EnvironmentVariables[KnownConfigNames.TestOutputPath], "summary.json"); 204summaryPath = Path.Combine(outputPath, "summary.json"); 206var summary = System.Text.Json.Nodes.JsonNode.Parse(File.ReadAllText(Path.Combine(outputPath, "summary.json")))!; 345var summaryPath = Path.Combine(context.EnvironmentVariables[KnownConfigNames.TestOutputPath], "summary.json"); 436Assert.False(Directory.Exists(Path.Combine(workspace.CreateExecutionContext().AspireHomeDirectory.FullName, "testruns"))); 477Assert.Equal(Path.Combine(json["outputPath"]!.GetValue<string>(), "summary.json"), summaryPath); 506Assert.False(Directory.Exists(Path.Combine(workspace.CreateExecutionContext().AspireHomeDirectory.FullName, "testruns"))); 534summaryPath = Path.Combine(context.EnvironmentVariables[KnownConfigNames.TestOutputPath], "summary.json"); 628var path = Path.Combine(outputPath!, "summary.json"); 704summaryPath = Path.Combine(context.EnvironmentVariables[KnownConfigNames.TestOutputPath], "summary.json"); 749summaryPath = Path.Combine(context.EnvironmentVariables[KnownConfigNames.TestOutputPath], "summary.json"); 794var logPath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [test].log"); 821var logPath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [test].log"); 826TerminalLinkAssert.ContainsLink(stdout.ToString(), new Uri(Path.GetFullPath(logPath)).AbsoluteUri, logPath); 841var logPath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.log"); 1158Assert.False(Directory.Exists(Path.Combine(workspace.CreateExecutionContext().AspireHomeDirectory.FullName, "testruns"))); 1187Assert.False(Directory.Exists(Path.Combine(workspace.CreateExecutionContext().AspireHomeDirectory.FullName, "testruns"))); 1265summaryPath = Path.Combine(context.EnvironmentVariables[KnownConfigNames.TestOutputPath], "summary.json"); 1508var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Commands\TrayCommandTests.cs (29)
33var directory = Path.GetDirectoryName(bundle.Layout.GetTrayPath()!)!; 54LinuxTrayTestPayload.Create(Path.GetDirectoryName(bundle.Layout.GetTrayPath()!)!, 78LinuxTrayTestPayload.Create(Path.GetDirectoryName(bundle.Layout.GetTrayPath()!)!, 103var sidecar = Path.Combine(Path.GetDirectoryName(cliPath)!, InstallSidecarReader.SidecarFileName); 129var packageBin = Path.Combine(workspace.WorkspaceRoot.FullName, store, "aspire", "1.0.0", "bin"); 131var packagedCli = Path.Combine(packageBin, "aspire"); 133File.WriteAllText(Path.Combine(packageBin, InstallSidecarReader.SidecarFileName), """{"source":"script"}"""); 148File.WriteAllText(Path.Combine(Path.GetDirectoryName(cliPath)!, InstallSidecarReader.SidecarFileName), "{"); 162var installed = Path.Combine(workspace.WorkspaceRoot.FullName, "stable & installed aspire"); 234Assert.Equal(action == "start" ? 1 : 0, Directory.Exists(Path.Combine(root, ".leases")) 235? Directory.GetFiles(Path.Combine(root, ".leases"), "*.lease").Length : 0); 313"dotnet" => Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet"), 314"missing" => Path.Combine(workspace.WorkspaceRoot.FullName, "missing-aspire"), 354LinuxTrayTestPayload.Create(Path.GetDirectoryName(bundle.Layout.GetTrayPath()!)!, 357File.WriteAllText(Path.Combine(Path.GetDirectoryName(cliPath)!, InstallSidecarReader.SidecarFileName), 361var bundleRoot = Path.Combine(installRoot, BundleDiscovery.BundleDirectoryName); 364layout.Components.Dcp = Path.Combine(BundleDiscovery.BundleDirectoryName, BundleDiscovery.DcpDirectoryName); 365layout.Components.Tray = Path.Combine(BundleDiscovery.BundleDirectoryName, layout.Components.Tray!); 645var root = Path.Combine(workspace.WorkspaceRoot.FullName, "bundle versions", "version-1"); 648Directory.CreateDirectory(Path.GetDirectoryName(trayPath)!); 650var binaryDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "installed aspire", "bin"); 652File.WriteAllText(Path.Combine(binaryDirectory, InstallSidecarReader.SidecarFileName), """{"source":"script"}"""); 653var cliPath = Path.Combine(binaryDirectory, "aspire"); 678WindowsTrayTestPayload.Create(Path.Combine(bundle.Layout.LayoutPath!, "tray"), 752WindowsTrayTestPayload.Create(Path.Combine(root, "tray"), 757File.Delete(Path.Combine(root, "tray", "Aspire.ico"));
Commands\TrayProtocolCommandTests.cs (6)
141var path = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs"); 187var requestedPath = scenario == "path_mismatch" ? Path.Combine(workspace.WorkspaceRoot.FullName, "Other.cs") : path; 239var path = absolutePath ? Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs") : "apphost.cs"; 262var path = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.cs"); 315SocketPath = Path.Combine(Path.GetDirectoryName(path)!, $"socket-{pid}"),
Commands\TypeScriptAppHostToolingCheckTests.cs (5)
137var configuredAppHost = new FileInfo(Path.Combine(configuredWorkspace.Path, "apphost.cs")); 176Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock"), 218File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, markerFile), "{}"); 259var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"); 261File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), packageJsonContent);
Commands\UpdateCommandRepositoryToolsTests.cs (17)
27var appHost = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 75var appHost = new FileInfo(Path.Combine(directory.FullName, "AppHost.csproj")); 160var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 274var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 336var selectedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "selected")); 338var appHost = Path.Combine(selectedDirectory.FullName, "AppHost.csproj"); 400var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 452var appHostDirectory = workspace.CreateDirectory(Path.Combine("src", "AppHost")); 453var appHost = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 461var packagesPath = Path.Combine(directory.FullName, "Directory.Packages.props"); 473var configPath = Path.Combine(directory.FullName, "aspire.config.json"); 481var nugetPath = Path.Combine(directory.FullName, "NuGet.config"); 496var lockPath = Path.Combine(directory.FullName, "package-lock.json"); 661Directory.CreateDirectory(Path.Combine(directory.FullName, ".git")); 662var config = Directory.CreateDirectory(Path.Combine(directory.FullName, ".config")); 663var dotnetManifest = Path.Combine(config.FullName, "dotnet-tools.json"); 673var npmManifest = Path.Combine(directory.FullName, "package.json");
Commands\UpdateCommandTests.cs (114)
89var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 190var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe"); 191var oldBackup1 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890"); 192var oldBackup2 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.9876543210"); 193var otherFile = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.something"); 214var oldBackup = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890"); 239FileDeleteHelper.TryCleanupOldItems(Path.Combine("C:", "NonExistent"), "aspire.exe"); 311return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 379var appHost = new FileInfo(Path.Combine(workspace.Path, "apphost.ts")); 381var configPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 432var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"); 495var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"); 550var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"); 620return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 683var toolPath = Path.Combine(installDir.FullName, "custom tool path"); 699return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 776return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 849return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 892return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 933return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1017return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1070Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), pendingMigration.DetectedContext.AppHostFile.FullName); 1098Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), pendingMigration.DetectedContext.AppHostFile.FullName); 1100Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), pendingMigration.AppliedContext.AppHostFile.FullName); 1171File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"), projectContent); 1214return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1354var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"); 1397UseOrFindAppHostProjectFileAsyncCallback = (_, _, _) => Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))) 1479var toolPath = Path.Combine(installDir.FullName, "custom tool path"); 1562var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 1615var processPath = Path.Combine(installDirectory.FullName, "aspire"); 1619var sidecarPath = Path.Combine(installDirectory.FullName, InstallSidecarReader.SidecarFileName); 1657var processPath = Path.Combine(installDirectory.FullName, "aspire"); 1662var sidecarPath = Path.Combine(installDirectory.FullName, InstallSidecarReader.SidecarFileName); 1714var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 1755var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 1789return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1854return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1918return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 1976return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2053return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2102return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2158var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2177var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 2179var globalSettingsPath = Path.Combine(globalDir, "settings.global.json"); 2197var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2215var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 2217File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "daily" }"""); 2219var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2239var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 2241File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "staging" }"""); 2260var localConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2269return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2321Path.Combine(workspace.Path, AspireConfigFile.FileName), """{ "channel": "staging" }"""); 2333Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))) 2387var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere")); 2388var projectConfigPath = Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName); 2393updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}", 2407Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 2410var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 2412File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "staging" }"""); 2414var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere")); 2418updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}", 2435Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 2438var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere")); 2440Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), 2445updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}", 2461Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 2464var globalDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 2466File.WriteAllText(Path.Combine(globalDir, "settings.global.json"), """{ "channel": "staging" }"""); 2468var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere")); 2470Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), 2475updateArgs: $"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")}", 2518Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 2555return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2646var resolved = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2731return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 2773var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "elsewhere")); 2774var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "AppHost.csproj")); 2777Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), 2780Path.Combine(workspace.Path, AspireConfigFile.FileName), 2924Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 2961Path.Combine(workspace.Path, AspireConfigFile.FileName), 3034? Path.Combine(workspace.Path, AspireConfigFile.FileName) 3035: Path.Combine(workspace.Path, ".aspire", "settings.global.json"); 3040$"update --apphost {Path.Combine(projectDirectory.FullName, "AppHost.csproj")} --channel {selectedChannel}", 3067workspace, $"update --apphost {Path.Combine(projectDirectory.FullName, fileName)}", projectDirectory, identityChannel, 3093"project" => Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName), 3094"parent" => Path.Combine(workspace.Path, AspireConfigFile.FileName), 3095"legacy" => Path.Combine(workspace.Path, ".aspire", "settings.json"), 3096_ => Path.Combine(workspace.Path, ".aspire", "settings.global.json") 3102Path.Combine(workspace.Path, ".aspire", "settings.global.json"), """{ "channel": "daily" }"""); 3106workspace, $"update --apphost {Path.Combine(projectDirectory.FullName, fileName)}", projectDirectory, 3131await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), 3153Path.Combine(workspace.Path, AspireConfigFile.FileName), """{ "channel": "unknown-channel" }"""); 3235return Task.FromResult(new List<FileInfo> { new(Path.Combine(projectDirectory.FullName, appHostFileName)) }); 3239return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(projectDirectory.FullName, appHostFileName))); 3275var hivesDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 3370var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 3415var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 3460var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 3493var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 3526return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"))); 3680var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz"); 3702var executablePath = Path.Combine(contentDirectory.FullName, "aspire"); 3720var tarPath = Path.Combine(archiveDirectory.FullName, "aspire.tar"); 3723var archivePath = Path.Combine(archiveDirectory.FullName, "aspire.tar.gz"); 3750var processPath = Path.Combine(toolPath, GetAspireExecutableName()); 3751var storeExecutablePath = Path.Combine( 3764Directory.CreateDirectory(Path.GetDirectoryName(storeExecutablePath)!); 3773var binaryDir = Path.Combine(installPath, "nix", "store", "hash-aspire-cli", "lib", "aspire-cli"); 3776var processPath = Path.Combine(binaryDir, GetAspireExecutableName()); 3778File.WriteAllText(Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName), """{"source":"nix"}"""); 3846var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
Commands\VsCodeExtensionCheckTests.cs (8)
63Directory.CreateDirectory(Path.Combine(extensions.FullName, "microsoft-aspire.aspire-vscode-1.2.3")); 91Directory.CreateDirectory(Path.Combine(extensions.FullName, "microsoft-aspire.aspire-vscode-1.2.3")); 116Directory.CreateDirectory(Path.Combine(home.FullName, rootFolder, "extensions", "microsoft-aspire.aspire-vscode-1.2.3")); 137Directory.CreateDirectory(Path.Combine(home.FullName, ".vscode", "extensions", "microsoft-aspire.aspire-vscode-1.2.3")); 188Directory.CreateDirectory(Path.Combine(extensions.FullName, "Microsoft-Aspire.Aspire-VSCode-9.9.9")); 207Directory.CreateDirectory(Path.Combine(extensions.FullName, "ms-dotnettools.csharp-2.0.0")); 229Directory.CreateDirectory(Path.Combine(extensions.FullName, "microsoft-aspire.aspire-vscode-extras-1.0.0")); 250var missingExtensionsDirectory = Path.Combine(home.FullName, "does-not-exist");
Configuration\AppHostPathConfigurationPolicyTests.cs (5)
40var path = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 54var path = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 64var path = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 76var path = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 86var path = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
Configuration\AspireConfigFileTests.cs (45)
42var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 61var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 94var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 125var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 126var globalSettingsFile = new FileInfo(Path.Combine(workspace.Path, "globalsettings.json")); 167var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 193File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 216var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 240var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 263var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 282var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 296var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 309var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 332var filePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 345var subDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "dir"); 350Assert.True(File.Exists(Path.Combine(subDir, AspireConfigFile.FileName))); 366LineEndingAssert.FileUsesOsLineBreaksAndSingleFinalNewline(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)); 382File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), "{}"); 525var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 550Path.GetFullPath(Path.Combine(workspace.WorkspaceRoot.FullName, "DeadlockExtension/DeadlockExtension.csproj")), 559var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 592var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 638var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 658var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 686var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 707var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 734var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 814var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 835var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 858var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 881var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 899var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 910var configPath = Path.Combine(root, AspireConfigFile.FileName); 925var absolutePath = Path.Combine(root, "src", "apphost.ts").Replace(Path.DirectorySeparatorChar, '/'); 926var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 947var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 967var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 987var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 1007var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 1028var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 1048var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 1066var settingsPath = Path.Combine(root, ".aspire", "settings.json"); 1086var settingsPath = Path.Combine(root, ".aspire", "settings.json");
Configuration\ConfigSourceServiceGitTests.cs (12)
197var pidFile = Path.Combine(workspace.Path, "child.pid"); 402Assert.False(File.Exists(Path.Combine(cache.FullName, path))); 449configuration.AddJsonFile(Path.Combine(project.FullName, AspireConfigFile.FileName)); 530await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), """{"custom":"preview"}"""); 550await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), """{"custom":"latest"}"""); 575await File.WriteAllTextAsync(Path.Combine(workspace.Path, "unrelated.txt"), "Unrelated change"); 583await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), "invalid JSON is not read during a version check"); 626await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), content); 698await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), """{"custom":"updated"}""", token); 723var configPath = Path.Combine(workspace.Path, path.Replace('/', Path.DirectorySeparatorChar)); 724Directory.CreateDirectory(Path.GetDirectoryName(configPath)!);
Configuration\ConfigSourceServiceTests.cs (64)
89Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 169Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 195Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 220File.Move(Path.Combine(global.FullName, AspireConfigFile.FileName), globalFile.FullName); 226var localPath = Path.Combine(project.FullName, AspireConfigFile.FileName); 229var parentPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 251Assert.False(Directory.Exists(Path.Combine(context.AspireHomeDirectory.FullName, "configsources"))); 260Assert.False(File.Exists(Path.Combine(global.FullName, AspireConfigFile.FileName))); 309File.Move(Path.Combine(global.FullName, AspireConfigFile.FileName), globalFile.FullName); 317var siblingPath = Path.Combine(sibling.FullName, AspireConfigFile.FileName); 322var path = Path.Combine(directory.FullName, AspireConfigFile.FileName); 350var path = Path.Combine(directory.FullName, AspireConfigFile.FileName); 371Assert.False(File.Exists(Path.Combine(gap.FullName, AspireConfigFile.FileName))); 399File.Move(Path.Combine(global.FullName, AspireConfigFile.FileName), globalFile.FullName); 410var parentPath = Path.Combine(parent.FullName, AspireConfigFile.FileName); 411var rootPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 589new DirectoryInfo(workspace.Path + Path.DirectorySeparatorChar), CancellationToken.None); 635Assert.False(File.Exists(Path.Combine(other.FullName, AspireConfigFile.FileName))); 658var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 767var repository = System.IO.Path.Combine(workspace.Path, "local\nrepository"); 839Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 1129Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 1136var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1157var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1183var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1219var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1226File.Move(Path.Combine(global.FullName, AspireConfigFile.FileName), globalFile.FullName); 1253Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 1262var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1294await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName)), "json"); 1302var path = Path.Combine(project.FullName, AspireConfigFile.FileName); 1326var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1347var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1369var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1398var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1421var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1458var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1480var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1535var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1555Assert.Equal(["check.json"], Directory.GetFiles(service.GetCacheDirectory(s_source)).Select(Path.GetFileName).Order()); 1591var checkPath = Path.Combine(first.GetCacheDirectory(s_source), "check.json"); 1671var checkPath = Path.Combine(first.GetCacheDirectory(s_source), "check.json"); 1705await File.WriteAllTextAsync(Path.Combine(directory, "current"), "invalid pointer"); 1706using var heldFile = File.Open(Path.Combine(snapshot, AspireConfigFile.FileName), FileMode.Open, FileAccess.ReadWrite, FileShare.None); 1785await File.ReadAllTextAsync(Path.Combine(service.GetCacheDirectory(initialSource), "check.json")), 1840var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1842var pointer = Path.Combine(service.GetCacheDirectory(s_source), "current"); 1872var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1939var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1945Directory.CreateDirectory(Path.Combine(service.GetCacheDirectory(s_source), "current")); 1962var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1984var snapshot = await File.ReadAllTextAsync(Path.Combine(cache, "current")); 1985var metadata = JsonSerializer.Deserialize(await File.ReadAllTextAsync(Path.Combine(cache, snapshot, "metadata.json")), 1996var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 2028var modernPath = Path.Combine(project.FullName, AspireConfigFile.FileName); 2091var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 2095var stale = Directory.CreateDirectory(Path.Combine(cache, Guid.NewGuid().ToString("N"))); 2096await File.WriteAllTextAsync(Path.Combine(stale.FullName, "stale.txt"), "obsolete snapshot"); 2097File.SetAttributes(Path.Combine(stale.FullName, "stale.txt"), FileAttributes.ReadOnly); 2136var pointer = await File.ReadAllTextAsync(Path.Combine(next.GetCacheDirectory(s_source), "current")); 2137Assert.Equal(Path.Combine(cache, pointer), Assert.Single(Directory.GetDirectories(cache))); 2139Path.Combine(next.GetCacheDirectory(s_source), pointer, "metadata.json")), JsonSourceGenerationContext.Default.ConfigSourceMetadata)!; 2218Assert.False(File.Exists(Path.Combine(workspace.Path, AspireConfigFile.FileName))); 2229Assert.StartsWith(Path.Combine(home.FullName, "configsources"), service.GetCacheDirectory(s_source), StringComparison.Ordinal);
Configuration\ConfigurationHelperTests.cs (47)
25var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 26var target = Path.Combine(workspace.Path, "shared.json"); 51var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 83var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 114var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 135var targetPath = Path.Combine(shared.FullName, AspireConfigFile.FileName); 140targetDirectory = Path.Combine(workspace.Path, "linked-shared"); 143var path = Path.Combine(project.FullName, AspireConfigFile.FileName); 144var linkTarget = Path.Combine(targetDirectory, AspireConfigFile.FileName); 147linkTarget = Path.GetRelativePath(project.FullName, linkTarget); 168var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 169var targetPath = Path.Combine(workspace.Path, "shared", AspireConfigFile.FileName); 177Assert.Equal(targetPath, Assert.Single(Directory.GetFiles(Path.GetDirectoryName(targetPath)!))); 184var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 185var otherPath = Path.Combine(workspace.Path, "other.json"); 210var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 234var file = new FileInfo(Path.Combine(workspace.Path, AspireConfigFile.FileName)); 260var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 296var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 368var path = Path.Combine(workspace.Path, AspireConfigFile.FileName); 395var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 399var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName)); 499var globalSettingsFile = new FileInfo(Path.Combine(globalDirectory.FullName, AspireConfigFile.FileName)); 510_ => Path.Combine(workspace.Path, AspireConfigFile.FileName) 582var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 669var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", AspireConfigFile.FileName); 687var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", AspireConfigFile.FileName); 707var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 729var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 744var settingsPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 758var globalSettingsFile = new FileInfo(Path.Combine(workspace.Path, "global-settings.json")); 779var settingsPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 800var globalSettingsFile = new FileInfo(Path.Combine(workspace.Path, "global-settings.json")); 1012Directory.CreateDirectory(Path.Combine(configRoot.FullName, "nested", "apphost")); 1013File.WriteAllText(Path.Combine(configRoot.FullName, AspireConfigFile.FileName), "{}"); 1016new DirectoryInfo(Path.Combine(configRoot.FullName, "nested", "apphost"))); 1026var appHostDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "apphost")); 1032Path.Combine(workspace.WorkspaceRoot.FullName, AspireJsonConfiguration.SettingsFolder), 1053var legacySettingsPath = Path.Combine(legacyDir.FullName, AspireJsonConfiguration.FileName); 1061var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1065var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName)); 1091var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1101var legacySettingsPath = Path.Combine(legacyDir.FullName, AspireJsonConfiguration.FileName); 1107var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName)); 1125var legacySettingsPath = Path.Combine(legacyDir.FullName, AspireJsonConfiguration.FileName); 1129var globalSettingsFile = new FileInfo(Path.Combine(globalDir.FullName, AspireConfigFile.FileName)); 1138var migratedPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
Configuration\ConfigurationServiceTests.cs (9)
25var globalSettingsFile = new FileInfo(Path.Combine(globalSettingsDir.FullName, AspireConfigFile.FileName)); 27var settingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 49var legacyPath = Path.Combine(workspace.Path, ".aspire", "settings.json"); 68var profilesPath = Path.Combine(workspace.Path, "apphost.run.json"); 147await File.WriteAllTextAsync(Path.Combine(cache.FullName, "workspace-config-locks"), "Blocks lock directory creation."); 277var legacySettingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"); 412Path.Combine(srcDirectory.FullName, AspireConfigFile.FileName), 441Path.Combine(srcDirectory.FullName, AspireConfigFile.FileName), 545var loaded = AspireConfigFile.Load(Path.GetDirectoryName(settingsPath)!);
Configuration\DotNetBasedAppHostServerChannelResolutionTests.cs (2)
72Assert.False(File.Exists(Path.Combine(appPath, AspireConfigFile.FileName))); 109var projectModelPath = Path.Combine(appPath, ".aspire_server");
Configuration\IntegrationReferenceTests.cs (1)
86Assert.True(Path.IsPathRooted(projectRef.Path!));
Configuration\PrebuiltAppHostServerChannelResolutionTests.cs (2)
64Assert.False(File.Exists(Path.Combine(appHostDirectory.FullName, AspireConfigFile.FileName))); 97new TestConfigurationService { SettingsFilePath = Path.Combine(appPath, "global.json") }, new Aspire.Shared.TemporaryStorage());
Diagnostics\FileLoggerProviderTests.cs (8)
39var path = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 73var logsDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "logs"); 76? new FileLoggerProvider(Path.Combine(logsDirectory, "test.log"), errorWriter) 97var path = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"); 129? new FileLoggerProvider(Path.Combine(logsDirectory, "test.log"), new TestStartupErrorWriter()) 151var logsDirectory = Path.Combine(workspace.Path, "logs"); 156var logPath = Path.Combine(parentDirectory, "test.log"); 179var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test.log");
DotNet\DotNetAppHostNuGetConfigMergerSnapshotTests.cs (18)
32var path = Path.Combine(dir.FullName, "nuget.config"); 71var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 78var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/'); 134var original = await File.ReadAllBytesAsync(Path.Combine(root.FullName, "nuget.config")); 137Assert.Equal(original, await File.ReadAllBytesAsync(Path.Combine(root.FullName, "nuget.config"))); 144var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 152var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/'); 204var original = await File.ReadAllBytesAsync(Path.Combine(root.FullName, "nuget.config")); 208Assert.Equal(original, await File.ReadAllBytesAsync(Path.Combine(root.FullName, "nuget.config"))); 211var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 218var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/'); 268var configPath = Path.Combine(root.FullName, "nuget.config"); 276var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 283var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/'); 341var original = await File.ReadAllBytesAsync(Path.Combine(root.FullName, "nuget.config")); 344Assert.Equal(original, await File.ReadAllBytesAsync(Path.Combine(root.FullName, "nuget.config"))); 351var updated = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 359var hivePath = Path.Combine(hivesDir.FullName, channelName).Replace('\\', '/');
DotNet\DotNetAppHostNuGetConfigMergerTests.cs (42)
29var path = Path.Combine(dir.FullName, "nuget.config"); 76File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 110Path.Combine(packages.FullName, packageId.ToLowerInvariant(), "1.0.0", "content", "source.txt"), 149File.WriteAllText(Path.Combine(childDirectory.FullName, AspireConfigFile.FileName), $$""" 184File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 229File.WriteAllText(Path.Combine(directory.FullName, AspireConfigFile.FileName), $$""" 236var childPath = Path.Combine(directory.FullName, "nuget.config"); 283? new[] { Path.Combine(appHostDirectory.FullName, "NuGet.Config"), Path.Combine(workspace.Path, "nuget.config") } 284: [Path.Combine(workspace.Path, "nuget.config")]; 299? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet") 300: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet"); 301string[] configPaths = globalConfigExists ? [Path.Combine(globalDirectory, "NuGet.Config")] : []; 384Path.Combine(target.FullName, "nuget.config"), sourceKey), error.Message); 559var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 580var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 623var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 662var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 702var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 730var target = Path.Combine(root.FullName, "nuget.config"); 896var configPath = Path.Combine(root.FullName, "nuget.config"); 900var document = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 936var generated = await File.ReadAllBytesAsync(Path.Combine(output.FullName, "nuget.config")); 937await File.WriteAllBytesAsync(Path.Combine(destination.FullName, "nuget.config"), generated); 943await Verify(XDocument.Load(Path.Combine(output.FullName, "nuget.config")).ToString(), "xml"); 976var configPath = Path.Combine(root.FullName, "nuget.config"); 1013var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1054var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1106var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1172var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1229var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1312var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1362var xml = XDocument.Load(Path.Combine(root.FullName, "nuget.config")); 1403var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 1433var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 1483var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 1505var originalContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "nuget.config")).DefaultTimeout(); 1526var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 1548var targetConfigPath = Path.Combine(root.FullName, "nuget.config"); 1586var directory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "new-config")); 1603var directory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "new-config")); 2247XDocument.Load(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config")).ToString());
DotNet\DotNetAppHostRestorePreviewTests.cs (2)
18var project = new FileInfo(Path.Combine(appHost.FullName, "AppHost.csproj")); 20new FileInfo(Path.Combine(unrelated.FullName, "NuGet.Config")), null,
DotNet\DotNetAppHostUpdateTransactionTests.cs (8)
19var file = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 47var file = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 75var file = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 115var file = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 140var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config")); 172var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config")); 209var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 232var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
DotNet\DotNetCliRunnerTests.cs (156)
52return Path.Combine(dotnetRoot, OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"); 57return Path.GetFullPath(Path.Combine( 72var validationTargets = Path.Combine(root.FullName, "LegacySdk.targets"); 82var projectFile = new FileInfo(Path.Combine(root.FullName, fileBased ? "apphost.cs" : "AppHost.csproj")); 118Assert.Equal("NuGet.targets", Path.GetFileName(settings.RestoreTargets)); 142var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "apphost.cs" : "AppHost.csproj")); 246var configFile = new FileInfo(Path.Combine(root.FullName, "NuGet.Config")); 257var sdkDirectory = Path.Combine(Path.GetDirectoryName(GetDotNetExecutablePath())!, "sdk", versionOutput.Trim()); 258var childDirectory = Directory.CreateDirectory(Path.Combine(root.FullName, "child")); 259var childFile = new FileInfo(Path.Combine(childDirectory.FullName, "Child.csproj")); 260var childTargets = customChildTargets ? Path.Combine(childDirectory.FullName, "Custom;NuGet.targets") : string.Empty; 265<Import Project="{{MSBuildEscaping.Escape(Path.Combine(sdkDirectory, "NuGet.targets"))}}" /> 280await File.WriteAllTextAsync(Path.Combine(childDirectory.FullName, "NuGet.Config"), $$""" 287var projectFile = new FileInfo(Path.Combine(root.FullName, fileBased ? "apphost.cs" : "Root.csproj")); 322Path.Combine(sdkDirectory, "NuGet.targets"), []); 325var sdkCache = isolated ? Path.Combine(isolatedDirectory!.FullName, "packages") : nuGetService.GetGlobalPackagesFolder(root); 326var sdkPackageDirectory = Path.Combine(sdkCache, "aspire.apphost.sdk", sdkVersion); 347Assert.True(File.Exists(Path.Combine(sdkPackageDirectory, "Sdk", "Sdk.props"))); 354Assert.True(File.Exists(Path.Combine(sdkPackageDirectory, "Sdk", "Sdk.props"))); 366Assert.False(Directory.Exists(Path.Combine(root.FullName, "obj"))); 367Assert.False(Directory.Exists(Path.Combine(childDirectory.FullName, "obj"))); 368Assert.False(File.Exists(Path.Combine(root.FullName, "packages.lock.json"))); 372var rootOutput = isolated ? FindRestoreOutput(isolatedOutputDirectory!, "Root.csproj") : Path.Combine(root.FullName, "obj"); 373var childOutput = isolated ? FindRestoreOutput(isolatedOutputDirectory!, "Child.csproj") : Path.Combine(childDirectory.FullName, "obj"); 374using var graph = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(rootOutput, "Root.csproj.nuget.dgspec.json"))); 379Path.Combine(childOutput, "Child.csproj.nuget.dgspec.json"))); 385childProject.GetProperty("restore").GetProperty("packagesPath").GetString()?.TrimEnd(Path.DirectorySeparatorChar)); 390Assert.True(File.Exists(Path.Combine(rootOutput, "project.assets.json"))); 391Assert.True(File.Exists(Path.Combine(childOutput, "project.assets.json"))); 392Assert.True(File.Exists(Path.Combine(rootOutput, "packages.lock.json"))); 397await File.ReadAllTextAsync(Path.Combine(childDirectory.FullName, "custom-targets-ran"))); 408File.Delete(Path.Combine(childDirectory.FullName, "custom-targets-ran")); 415await File.ReadAllTextAsync(Path.Combine(childDirectory.FullName, "custom-targets-ran"))); 440var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 446var project = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 473using var assets = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "obj", "project.assets.json"))); 492await File.WriteAllTextAsync(Path.Combine(project.FullName, "NuGet.Config"), $$""" 495var projectFile = new FileInfo(Path.Combine(project.FullName, "App.csproj")); 512var lockFilePath = Path.Combine(project.FullName, lockFile); 518File.Move(Path.Combine(project.FullName, "packages.lock.json"), lockFilePath); 521Directory.Delete(Path.Combine(project.FullName, "obj"), recursive: true); 527var restoreTargets = Path.Combine(Path.GetDirectoryName(GetDotNetExecutablePath())!, "sdk", versionOutput.Trim(), "NuGet.targets"); 536Assert.False(Directory.Exists(Path.Combine(project.FullName, "obj"))); 544Path.Combine(FindRestoreOutput(outputDirectory, "App.csproj"), "packages.lock.json")); 551Path.Combine(FindRestoreOutput(outputDirectory, "App.csproj"), "packages.lock.json")); 556=> Path.GetDirectoryName(Directory.EnumerateFiles( 591var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 640var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, appHostFileName)); 679var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 713var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 714var appHostCommand = Path.Combine(workspace.WorkspaceRoot.FullName, "bin", "Debug", "net10.0", "AppHost"); 715var runWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "run-cwd")); 755var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 756var appHostAssembly = Path.Combine(workspace.WorkspaceRoot.FullName, "bin", "Debug", "net10.0", "AppHost.dll"); 757var runWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "run-cwd")); 769Assert.Equal("dotnet", Path.GetFileNameWithoutExtension(fileName)); 796var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 824var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 856var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 889var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts", "bin", "Aspire.Cli", "Debug", "net10.0")); 890var cliPath = Path.Combine(cliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 892File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty); 902var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "artifacts", "bin", "Aspire.Cli", "Debug", "net10.0")); 903var cliPath = Path.Combine(cliDirectory.FullName, "aspire"); 905File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty); 907var linkDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin")); 908var linkPath = Path.Combine(linkDirectory.FullName, "aspire"); 918var dotnetDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet")); 919var dotnetPath = Path.Combine(dotnetDirectory.FullName, OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"); 929var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin")); 930var cliPath = Path.Combine(cliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 932File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty); 933File.WriteAllText(Path.Combine(cliDirectory.FullName, ".aspire-install.json"), """{"source":"script"}"""); 942var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin")); 943var cliPath = Path.Combine(cliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 945File.WriteAllText(Path.Combine(cliDirectory.FullName, "aspire.dll"), string.Empty); 946Directory.CreateDirectory(Path.Combine(cliDirectory.FullName, "dcp")); 947Directory.CreateDirectory(Path.Combine(cliDirectory.FullName, "managed")); 948File.WriteAllText(Path.Combine(cliDirectory.FullName, "dcp", OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), string.Empty); 949File.WriteAllText(Path.Combine(cliDirectory.FullName, "managed", OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"), string.Empty); 966var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 972var targets = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "candidate;targets%('literal')@$?.targets")); 973var packages = new DirectoryInfo(Path.Combine(workspace.Path, "restore packages")); 1018var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "Generated.csproj")); 1019var resultPath = Path.Combine(projectDirectory.FullName, "result.txt"); 1020await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.rsp"), 1056var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1097var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1134var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1163var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1187Assert.Equal(binlogDirectory.FullName, Path.GetDirectoryName(binlogPath)); 1189Assert.Contains("build", Path.GetFileName(binlogPath)); 1190Assert.Contains("AppHost", Path.GetFileName(binlogPath)); 1236var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1273var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1314var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1359var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1414var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1511var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1551var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1593var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1640var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1688[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock") 1723var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, singleFile ? "AppHost.cs" : "AppHost.csproj")); 1725var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "test results"); 1759[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock"), 1771var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1805[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock") 1817var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1843[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock") 1859var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1885[KnownConfigNames.UnixSocketPath] = Path.Combine(workspace.WorkspaceRoot.FullName, "cli.sock") 1901var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 1954var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2021var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2087var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2160var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln")); 2165var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj")); 2169var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj")); 2189invocationOptions.StandardOutputCallback?.Invoke($"Project1{Path.DirectorySeparatorChar}Project1.csproj"); 2190invocationOptions.StandardOutputCallback?.Invoke($"Project2{Path.DirectorySeparatorChar}Project2.csproj"); 2207var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2210var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj")); 2240var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2287var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2333var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2370var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2407var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2447var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2492var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2544var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2593var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2641var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2680var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, fileName)); 2714var projectFile = new FileInfo(Path.Combine(workspace.Path, "AppHost.csproj")); 2747var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2785var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2828var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2870var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2910var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2949var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "RunPropertiesApp")); 2950var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "RunPropertiesApp.csproj")); 2961await File.WriteAllTextAsync(Path.Combine(projectDirectory.FullName, "Program.cs"), "Console.WriteLine(\"Hello\");"); 2995Assert.Equal(Path.Combine(projectDirectory.FullName, "relative-working-directory"), properties.GetProperty("RunWorkingDirectory").GetString()); 3003var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3047var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 3232var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 3335var packagePath = Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{packageVersion}.nupkg"); 3405var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3443var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3481var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3521var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3560var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
DotNet\DotNetRestoreConfigurationTests.cs (7)
20var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, fileName)); 24var toolsPath = Path.Combine(workspace.WorkspaceRoot.FullName, "sdk"); 38values["NuGetRestoreTargets"] = Path.Combine(toolsPath, "NuGet.targets"); 48Assert.Equal(Path.Combine(toolsPath, "NuGet.targets"), settings.RestoreTargets); 60var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 67values[propertyName] = Path.Combine(workspace.WorkspaceRoot.FullName, "custom"); 82var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
DotNet\ProcessExecutionDetachedTests.cs (1)
83var capturePath = Path.Combine(workspace.WorkspaceRoot.FullName, "capture.txt");
DotNet\ProcessExecutionFactoryEnvironmentTests.cs (1)
114await File.WriteAllTextAsync(Path.Combine(directory.FullName, "argv.cjs"),
DotNet\ProcessExecutionTests.cs (2)
296var scriptFile = new FileInfo(Path.Combine(workspaceRoot.FullName, "long-running.cmd")); 305var scriptFile = new FileInfo(Path.Combine(workspaceRoot.FullName, "long-running.sh"));
DotNet\ProcessInvocationOptionsTests.cs (4)
27NuGetRestoreTargetsFile = new FileInfo(Path.Combine(Path.GetFullPath("."), "Candidate.targets")), 28IsolatedRestorePackagesDirectory = new DirectoryInfo(Path.Combine(Path.GetFullPath("."), "packages")),
DotNetSdkInstallerTests.cs (4)
55var parentPidFile = Path.Combine(tempDirectory.FullName, "dotnet-parent.pid"); 56var childPidFile = Path.Combine(tempDirectory.FullName, "dotnet-child.pid"); 329var scriptFile = Path.Combine(directory.FullName, "dotnet-shim.ps1"); 352var shellFile = Path.Combine(directory.FullName, "dotnet");
Git\GitClientTests.cs (1)
114var repository = new GitRepositoryLocation(new DirectoryInfo(Path.Combine(workspace.Path, "repository.git")), IsBare: true);
Git\GitCommandRunnerTests.Authentication.cs (30)
52var marker = Path.Combine(workspace.Path, "askpass-called"); 53var helper = Path.Combine(workspace.Path, "askpass.sh"); 61var config = Path.Combine(workspace.Path, "gitconfig"); 99var marker = Path.Combine(workspace.Path, "credential-operations"); 100var helper = Path.Combine(workspace.Path, "credential.sh"); 108var config = Path.Combine(workspace.Path, "gitconfig"); 176var config = Path.Combine(workspace.Path, "gitconfig"); 212var config = Path.Combine(workspace.Path, "gitconfig"); 276var directory = Directory.CreateDirectory(Path.Combine(workspace.Path, 278var config = Path.Combine(workspace.Path, "gitconfig"); 281var sshDirectory = Path.GetDirectoryName(ssh)!; 282var relative = Path.GetRelativePath(Environment.CurrentDirectory, sshDirectory); 287info.Environment["PATH"] = $"{relative}{Path.PathSeparator}{sshDirectory}{Path.PathSeparator}{info.Environment["PATH"]}"; 301var config = Path.Combine(workspace.Path, "gitconfig"); 303var executables = Directory.CreateDirectory(Path.Combine(workspace.Path, "Git child executables")); 304var ssh = Path.Combine(executables.FullName, "ssh"); 330var config = Path.Combine(workspace.Path, "gitconfig"); 337info.Environment["PATH"] = string.Join(Path.PathSeparator, 338info.Environment["PATH"]!.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 339.Where(directory => !File.Exists(Path.Combine(directory, "ssh.exe")) && !File.Exists(Path.Combine(directory, "ssh")))); 365var gitDirectory = Path.Combine(workspace.Path, "git-directory"); 366var absolute = Path.Combine(workspace.Path, "absolute"); 367var path = $"tools{Path.PathSeparator}\0invalid{Path.PathSeparator}{absolute}{Path.PathSeparator}{Path.PathSeparator}"; 371Assert.Equal($"{Path.Combine(gitDirectory, "tools")}{Path.PathSeparator}{absolute}", normalized);
Git\GitCommandRunnerTests.cs (2)
178var startInfo = new ProcessStartInfo(Path.Combine(workspace.Path, "missing-private-executable")) 248var logPath = Path.Combine(workspace.Path, "git.log");
Git\GitHelpersTests.cs (1)
48var repository = Path.GetFullPath(name);
Git\GitRepositoryTests.cs (12)
35await File.WriteAllTextAsync(Path.Combine(workspace.Path, "example.txt"), "example"); 47Assert.Equal([Path.Combine(workspace.Path, "example.txt")], Assert.IsAssignableFrom<IReadOnlySet<string>>(result)); 142var trackedFile = Path.Combine(appDir.FullName, "AppHost.csproj"); 147var untrackedFile = Path.Combine(samplesDir.FullName, "Sample.csproj"); 151var gitignorePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".gitignore"); 156var ignoredFile = Path.Combine(binDir.FullName, "Stale.csproj"); 170Assert.Contains(Path.GetFullPath(trackedFile), result!); 171Assert.Contains(Path.GetFullPath(untrackedFile), result); 172Assert.DoesNotContain(Path.GetFullPath(ignoredFile), result); 183var trackedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"); 199Assert.Contains(Path.GetFullPath(trackedFile), result!); 210var trackedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj");
Git\GitWorktreeTests.cs (86)
17Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 18var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost", "AppHost.csproj"); 29var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 32Path.Combine(fixtureRoot, "primary", ".git")); 33var appHostPath = Path.Combine(worktreeRoot, "AppHost", "AppHost.csproj"); 48var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 51Path.Combine(fixtureRoot, commonGitDirectoryName)); 66Path.Combine(worktreeRoot, "primary", ".git"), 81Path.Combine(fixtureRoot, "physical", "checkouts", "feature")).FullName; 84Path.Combine(fixtureRoot, "physical", "primary", ".git"), 86var aliasRoot = Path.Combine(fixtureRoot, "aliases", "feature"); 87Directory.CreateDirectory(Path.GetDirectoryName(aliasRoot)!); 120var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 123Path.Combine(fixtureRoot, "primary", ".git")); 124var caseVariantRoot = Path.Combine(fixtureRoot, "WORKTREE"); 140var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "checkout")).FullName; 142Path.Combine(fixtureRoot, "physical", "primary", ".git", "worktrees", "feature")).FullName; 143var aliasDirectory = Path.Combine(fixtureRoot, "aliases", "admin"); 144Directory.CreateDirectory(Path.GetDirectoryName(aliasDirectory)!); 163Path.Combine(adminDirectory, "gitdir"), 164Path.GetRelativePath(adminDirectory, gitFilePath) + Environment.NewLine); 184Path.Combine(worktreeRoot, "primary", ".git")); 186Path.Combine(worktreeRoot, ".git"), 187$"gitdir: {adminDirectory}{Path.DirectorySeparatorChar}{Environment.NewLine}"); 200var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 201var adminDirectory = Path.Combine(fixtureRoot, "primary", ".git", "WORKTREES", "feature"); 204Path.Combine(adminDirectory, "gitdir"), 222Path.Combine(worktreeRoot, "primary", ".git")); 223var caseVariantGitFile = Path.Combine(worktreeRoot, ".GIT"); 225Path.Combine(adminDirectory, "gitdir"), 241var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 244Path.Combine(fixtureRoot, "primary", ".git")); 245var aliasRoot = Path.Combine(fixtureRoot, "worktree-alias"); 263Path.Combine(adminDirectory, "gitdir"), 264Path.Combine(aliasRoot, ".git") + Environment.NewLine); 282var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 285Path.Combine(fixtureRoot, "primary", ".git")); 286var submoduleRoot = Directory.CreateDirectory(Path.Combine(worktreeRoot, "extern", "dep")).FullName; 289Path.Combine(adminDirectory, "modules", "dep")); 291Assert.Null(GitWorktree.TryGetLinkedWorktreeRoot(Path.Combine(submoduleRoot, "AppHost.csproj"))); 299var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 300var adminDirectory = Path.Combine(fixtureRoot, "primary", ".git", "modules", "dep"); 303Path.Combine(adminDirectory, "gitdir"), 314var commonGitDirectory = Path.Combine(fixtureRoot, "primary", ".git"); 315var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 317var otherWorktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "other-worktree")).FullName; 320Path.Combine(commonGitDirectory, "worktrees", "other")); 322Path.Combine(adminDirectory, "gitdir"), 333var worktreeRoot = Directory.CreateDirectory(Path.Combine(fixtureRoot, "worktree")).FullName; 336Path.Combine(fixtureRoot, "primary", ".git", "worktrees", "stale")); 345Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".git")); 346var submoduleRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "extern", "dep")).FullName; 349Path.Combine(workspace.WorkspaceRoot.FullName, ".git", "modules", "dep")); 350var appHostPath = Path.Combine(submoduleRoot, "AppHost.csproj"); 370Directory.CreateDirectory(Path.Combine(primaryRoot, ".git")); 371var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName; 372TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git")); 373var nestedAppHost = Path.Combine(worktreeRoot, "AppHost.csproj"); 374var primaryAppHost = Path.Combine(primaryRoot, "AppHost.csproj"); 387Directory.CreateDirectory(Path.Combine(primaryRoot, ".git")); 388var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName; 389var adminDirectory = TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git")); 390var submoduleRoot = Directory.CreateDirectory(Path.Combine(worktreeRoot, "extern", "dep")).FullName; 391TestGitWorktree.WriteGitDirFile(submoduleRoot, Path.Combine(adminDirectory, "modules", "dep")); 392var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj"); 404Directory.CreateDirectory(Path.Combine(primaryRoot, ".git")); 405var submoduleRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, "extern", "dep")).FullName; 408Path.Combine(primaryRoot, ".git", "modules", "dep")); 409var submoduleAppHost = Path.Combine(submoduleRoot, "AppHost.csproj"); 419var appHostPath = Path.Combine(primaryRoot, "sub", "App", "App.csproj"); 430var repoBAppHost = Path.Combine(repoBRoot, "App", "App.csproj"); 433Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(repoARoot, "App", "App.csproj"), repoBRoot)); 442var repoBSubmoduleRoot = Directory.CreateDirectory(Path.Combine(repoBRoot, "extern", "dep")).FullName; 445Path.Combine(repoBRoot, ".git", "modules", "dep")); 446var repoBSubmoduleAppHost = Path.Combine(repoBSubmoduleRoot, "AppHost.csproj"); 457var worktreeRoot = Directory.CreateDirectory(Path.Combine(primaryRoot, ".worktrees", "feature")).FullName; 458TestGitWorktree.WriteLinkedWorktreeMetadata(worktreeRoot, Path.Combine(primaryRoot, ".git")); 460Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(worktreeRoot, "App", "App.csproj"), primaryRoot)); 461Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(primaryRoot, "App", "App.csproj"), worktreeRoot)); 468var workingDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "plain")).FullName; 469var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "other", "App.csproj"); 479var unmanagedDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "outside")).FullName; 480var unmanagedAppHost = Path.Combine(unmanagedDirectory, "App.csproj"); 483Assert.False(GitWorktree.IsSameWorktreeScope(Path.Combine(primaryRoot, "App", "App.csproj"), unmanagedDirectory)); 493var root = Directory.CreateDirectory(Path.Combine(parent.FullName, name)).FullName; 494Directory.CreateDirectory(Path.Combine(root, ".git"));
HeldFileLeaseTests.cs (9)
44var orphanPath = Path.Combine(leaseDirectory, $"orphan{LeaseExtension}"); 57var leaseDirectory = Path.Combine(workspace.Path, "missing"); 67var leasePath = Path.Combine(leaseDirectory, $"orphan.unverified-lock{LeaseExtension}"); 79var readyPath = Path.Combine(workspace.Path, "ready"); 80var releasePath = Path.Combine(workspace.Path, "release"); 119var orphanPath = Path.Combine(leaseDirectory, $"orphan{LeaseExtension}"); 135var readyPath = Path.Combine(workspace.Path, "ready"); 136var releasePath = Path.Combine(workspace.Path, "release"); 178File.WriteAllText(Path.Combine(leaseDirectory, $"orphan{LeaseExtension}"), "{}");
Interaction\ConsoleInteractionServiceTests.cs (4)
1329var logFilePath = Path.Combine(s_logsDirectory.FullName, "cli [dev team].log"); 1339var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri; 1357var logFilePath = Path.Combine(s_logsDirectory.FullName, "cli [dev team].log"); 1364var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri;
Interaction\ExtensionInteractionServiceTests.cs (10)
116var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [extension].log"); 149var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log"); 191var cliLogFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log"); 192var appHostLogFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cli.log"); 246var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log"); 310Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.cli.log"), 502var invalidPath = Path.Combine(workspace.WorkspaceRoot.FullName, "invalid"); 503var validPath = Path.Combine(workspace.WorkspaceRoot.FullName, "valid"); 544var invalidPath = Path.Combine(workspace.WorkspaceRoot.FullName, "invalid"); 612var logFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli [extension].log");
Layout\LayoutConfigurationTests.cs (4)
40Directory.CreateDirectory(Path.GetDirectoryName(path)!); 55Directory.CreateDirectory(Path.GetDirectoryName(layout.GetManagedPath()!)!); 94Directory.CreateDirectory(Path.GetDirectoryName(dashboardPath)!); 99Directory.CreateDirectory(Path.GetDirectoryName(managedPath)!);
Layout\LayoutDiscoveryReparsePointTests.cs (46)
36var realLayoutRoot = Path.Combine( 43var realBinary = Path.Combine(realLayoutRoot, "aspire"); 46var linksDir = Path.Combine(workspace.WorkspaceRoot.FullName, "WinGet", "Links"); 48var linkPath = Path.Combine(linksDir, "aspire"); 69var rawLayoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "custom-layout"); 72var realBinaryDir = Path.Combine(workspace.WorkspaceRoot.FullName, "real-binary"); 74var realBinary = Path.Combine(realBinaryDir, "aspire"); 77var linkPath = Path.Combine(rawLayoutRoot, "aspire"); 97var versionsDir = Path.Combine(layoutRoot, "versions", "v1"); 98var versionedManaged = Path.Combine(versionsDir, BundleDiscovery.ManagedDirectoryName); 99var versionedDashboard = Path.Combine(versionsDir, BundleDiscovery.DashboardDirectoryName); 100var versionedDcp = Path.Combine(versionsDir, BundleDiscovery.DcpDirectoryName); 105Path.Combine(versionedManaged, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 107var dashboardPath = Path.Combine(versionedDashboard, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 113var bundleLink = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 128Path.Combine(bundleLink, BundleDiscovery.DashboardDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 147var binaryDir = Path.Combine(workspace.WorkspaceRoot.FullName, "opt", "aspire", "bin"); 149var binaryPath = Path.Combine(binaryDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 152var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "home", ".aspire"); 190var relativeLayoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "colocated"); 191var binDir = Path.Combine(relativeLayoutRoot, "bin"); 193var binaryPath = Path.Combine(binDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 198var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "home", ".aspire"); 231? Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName) 234var managedDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.ManagedDirectoryName)); 235Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DcpDirectoryName)); 237Path.Combine(managedDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 239var dashboardDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DashboardDirectoryName)); 241Path.Combine(dashboardDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 243var binaryPath = Path.Combine(layoutRoot, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 266? Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName) 269var managedDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.ManagedDirectoryName)); 270var dcpDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DcpDirectoryName)); 272Path.Combine(managedDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 278Path.Combine(managedDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 282var binaryPath = Path.Combine(layoutRoot, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 291var dashboardDir = Directory.CreateDirectory(Path.Combine(componentRoot, BundleDiscovery.DashboardDirectoryName)); 294var dashboardPath = Path.Combine(dashboardDir.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 306var bundleDir = Path.Combine(layoutRoot, BundleDiscovery.BundleDirectoryName); 307var managedDir = Path.Combine(bundleDir, BundleDiscovery.ManagedDirectoryName); 308var dashboardDir = Path.Combine(bundleDir, BundleDiscovery.DashboardDirectoryName); 309var dcpDir = Path.Combine(bundleDir, BundleDiscovery.DcpDirectoryName); 314Path.Combine(managedDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 317Path.Combine(dashboardDir, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 327var path = Path.Combine(componentRoot, BundleDiscovery.TerminalHostDirectoryName, file); 328Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Layout\TrayLayoutTests.cs (25)
25var components = bundleDirectory ? Path.Combine(root, "bundle") : root; 26Directory.CreateDirectory(Path.Combine(components, "managed")); 27Directory.CreateDirectory(Path.Combine(components, "dashboard")); 28Directory.CreateDirectory(Path.Combine(components, "dcp")); 29File.WriteAllText(Path.Combine(components, "managed", BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), ""); 30File.WriteAllText(Path.Combine(components, "dashboard", BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), ""); 31File.WriteAllText(BundleDiscovery.GetDcpExecutablePath(Path.Combine(components, "dcp")), ""); 34var path = Path.Combine(components, BundleDiscovery.TerminalHostDirectoryName, file); 35Directory.CreateDirectory(Path.GetDirectoryName(path)!); 38var trayPath = Path.Combine(components, OperatingSystem.IsWindows() 43Directory.CreateDirectory(Path.GetDirectoryName(trayPath)!); 75var source = Path.Combine(workspace.Path, "publish"); 83writer.WriteEntry(Path.Combine(source, file), $"{rid}/tray/{file}"); 87var extracted = Path.Combine(workspace.Path, "extracted"); 89LinuxTrayPayload.Validate(Path.Combine(extracted, "tray"), rid); 91Directory.GetFiles(Path.Combine(extracted, "tray")).Select(Path.GetFileName).Order(StringComparer.Ordinal)); 100var source = Path.Combine(workspace.Path, "publish"); 108writer.WriteEntry(Path.Combine(source, file), $"{rid}/tray/{file}"); 112var extracted = Path.Combine(workspace.Path, "extracted"); 116WindowsTrayPayload.Validate(Path.Combine(extracted, "tray"), rid); 118Directory.GetFiles(Path.Combine(extracted, "tray")).Select(Path.GetFileName).Order()); 121Assert.Equal(File.ReadAllBytes(Path.Combine(source, file)), File.ReadAllBytes(Path.Combine(extracted, "tray", file)));
Mcp\ApiDocs\ApiDocsCacheTests.cs (8)
112new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")), 113new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache")), 114new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), 115new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")), 120=> Directory.GetFiles(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", subdirectory)) 121.Select(Path.GetFileName)
Mcp\AppHostConnectionSelectionLogicTests.cs (10)
77var firstDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "AppHost")); 78var secondDirectoryPath = Path.Combine(tempRoot.FullName, "apphost"); 83var firstPath = Path.Combine(firstDirectory.FullName, "AppHost.csproj"); 84var secondPath = Path.Combine(secondDirectory.FullName, "AppHost.csproj"); 130var appHostPath = Path.Combine(appHostDirectory.FullName, "RootCase.AppHost.csproj"); 142var realAppHostPath = Path.Combine(realDirectory.FullName, "Symlinked.AppHost.csproj"); 144var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 155var symlinkedAppHostPath = Path.Combine(symlinkDirectory, "Symlinked.AppHost.csproj"); 203var actualAppHostPath = Path.Combine(directory.FullName, "CaseSensitive.AppHost.csproj"); 205var selectedAppHostPath = Path.Combine(
Mcp\Docs\DocsCacheTests.cs (10)
37var cacheFiles = Directory.GetFiles(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "docs")) 38.Select(Path.GetFileName) 87var cacheFiles = Directory.GetFiles(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "docs")) 88.Select(Path.GetFileName) 125new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")), 126new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache")), 127new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-runtimes")), 128new DirectoryInfo(Path.Combine(Path.GetTempPath(), "aspire-test-logs")),
Mcp\E2E\McpDocsE2ETests.cs (2)
289while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "Aspire.slnx"))) 300var cliProjectPath = Path.Combine(dir.FullName, "src", "Aspire.Cli", "Aspire.Cli.csproj");
Mcp\ListAppHostsToolTests.cs (2)
47var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost"); 111var inScopeAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "InScopeAppHost");
Mcp\ListIntegrationsToolTests.cs (5)
29File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 33File.WriteAllText(Path.Combine(directory.FullName, AspireConfigFile.FileName), """ 43var appHostFile = new FileInfo(Path.Combine(directory.FullName, "AppHost.csproj")); 114File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 138File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """
Mcp\ListResourcesToolTests.cs (3)
282var realAppHostPath = Path.Combine(realDirectory.FullName, "Symlinked.AppHost.csproj"); 284var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 295var symlinkedAppHostPath = Path.Combine(symlinkDirectory, "Symlinked.AppHost.csproj");
Mcp\MockPackagingService.cs (1)
39new DirectoryInfo(Path.GetTempPath()));
Mcp\SelectAppHostToolTests.cs (13)
28var appHostFile = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj")); 31var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 33var suppliedPath = Path.Combine("link", appHostFile.Name); 34var displayPath = Path.GetFullPath(Path.Combine(workspace.WorkspaceRoot.FullName, suppliedPath)); 75var realAppHostPath = Path.Combine(realDirectory.FullName, "Symlinked.AppHost.csproj"); 77var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 88var symlinkedAppHostPath = Path.Combine(symlinkDirectory, "Symlinked.AppHost.csproj"); 111var actualAppHostPath = Path.Combine(directory.FullName, "CaseSensitive.AppHost.csproj"); 113var selectedAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "casesensitiveapphost", "casesensitive.apphost.csproj"); 150var firstAppHostPath = Path.Combine(firstDirectory.FullName, "First.AppHost.csproj"); 151var secondAppHostPath = Path.Combine(secondDirectory.FullName, "Second.AppHost.csproj"); 152var requestedAppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Missing", "Missing.AppHost.csproj");
Migrations\TypeScriptAppHostMigrationTests.cs (29)
54var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"); 71Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), 83await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"), "// legacy"); 84await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), "// modern"); 95await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), "// csharp"); 106var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "external-apphost")); 108var appHostPath = Path.Combine(appHostDirectory.FullName, "apphost.ts"); 152await File.WriteAllTextAsync(Path.Combine(root.FullName, "apphost.ts"), LegacyAppHostContent); 154Path.Combine(root.FullName, "aspire.config.json"), 163Path.Combine(root.FullName, "tsconfig.apphost.json"), 171Path.Combine(root.FullName, "package.json"), 181await File.WriteAllTextAsync(Path.Combine(root.FullName, "eslint.config.mjs"), LegacyEslintConfigContent); 183var modulesDir = Directory.CreateDirectory(Path.Combine(root.FullName, ".modules")); 184await File.WriteAllTextAsync(Path.Combine(modulesDir.FullName, "aspire.ts"), "// generated"); 189var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root.FullName, "aspire.config.json")))!; 192var tsconfig = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root.FullName, "tsconfig.apphost.json")))!; 196var packageJson = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(root.FullName, "package.json")))!; 201var eslintConfig = await File.ReadAllTextAsync(Path.Combine(root.FullName, "eslint.config.mjs")); 214Assert.False(File.Exists(Path.Combine(root.FullName, "apphost.ts"))); 215Assert.False(Directory.Exists(Path.Combine(root.FullName, ".modules"))); 217var modernContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "apphost.mts")); 234LineEndingAssert.FileUsesOsLineBreaksAndSingleFinalNewline(Path.Combine(root.FullName, "aspire.config.json")); 241var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "external-apphost")); 244await CreateMigration(workspace).ApplyAsync(new MigrationContext(new FileInfo(Path.Combine(appHostDirectory.FullName, "apphost.ts"))), CancellationToken.None); 246Assert.False(File.Exists(Path.Combine(appHostDirectory.FullName, "apphost.ts"))); 247Assert.False(Directory.Exists(Path.Combine(appHostDirectory.FullName, ".modules"))); 248Assert.Equal(ExpectedModernAppHostContent, await File.ReadAllTextAsync(Path.Combine(appHostDirectory.FullName, "apphost.mts"))); 290var migratedContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "apphost.mts")); 294Assert.Equal(migratedContent, await File.ReadAllTextAsync(Path.Combine(root.FullName, "apphost.mts")));
Npm\AspireJsLauncherTests.cs (26)
66var monkeyPatchScript = Path.Combine(workspace.Path, "patch-chmod.js"); 95var monkeyPatchScript = Path.Combine(workspace.Path, "patch-copy.js"); 138var cachedBinaryPath = Path.Combine(layout.CacheDir, pointerVersion, rid, "bin", binaryName); 145var scriptPath = Path.Combine(GetRepoRoot(), "eng", "scripts", "pack-cli-npm-package.ps1"); 147var launcherScriptPath = Path.Combine(GetRepoRoot(), "eng", "clipack", "npm", "aspire.js"); 150var probeScript = Path.Combine(workspace.Path, "detect-rids.js"); 168var launcherScriptPath = Path.Combine(GetRepoRoot(), "eng", "clipack", "npm", "aspire.js"); 169var probeScript = Path.Combine(workspace.Path, "detect-current-rid.js"); 228var pointerDir = Path.Combine(rootPath, "pointer"); 229var pointerBinDir = Path.Combine(pointerDir, "bin"); 230var nodeModulesDir = Path.Combine(rootPath, "node_modules"); 231var ridPackageDir = Path.Combine(nodeModulesDir, ridPackageName.Replace("/", Path.DirectorySeparatorChar.ToString())); 232var ridBinDir = Path.Combine(ridPackageDir, "bin"); 233var cacheDir = Path.Combine(rootPath, "cache"); 246Path.Combine(pointerDir, "package.json"), 250var realLauncherPath = Path.Combine(GetRepoRoot(), "eng", "clipack", "npm", "aspire.js"); 251var launcherScript = Path.Combine(pointerBinDir, "aspire.js"); 257Path.Combine(pointerBinDir, "aspire-package-map.json"), 267Path.Combine(ridPackageDir, "package.json"), 271var binaryPath = Path.Combine(ridBinDir, binaryName); 274var probeScript = Path.Combine(rootPath, "probe-native.js"); 285return new FakeNpmLayout(launcherScript, cacheDir, probeScript, Path.Combine(ridPackageDir, "package.json")); 322WorkingDirectory = Path.GetDirectoryName(launcherScript), 347WorkingDirectory = Path.GetDirectoryName(scriptPath), 408while (current is not null && !File.Exists(Path.Combine(current, "Aspire.slnx")))
Npm\NpmRunnerTests.cs (5)
168var argumentsPath = Path.Combine(tempDirectory.FullName, "arguments.txt"); 170using var pathOverride = new EnvVarOverride("PATH", $"{tempDirectory.FullName}{Path.PathSeparator}{existingPath}"); 175var tarballPath = Path.Combine(tempDirectory.FullName, "playwright-%PATH%! cli.tgz"); 261Path.Combine(directory.FullName, "npm.cmd"), 274var npmPath = Path.Combine(directory.FullName, "npm");
NuGet\BundleNuGetServiceTests.cs (36)
33File.WriteAllText(Path.Combine(app.FullName, AspireConfigFile.FileName), $$""" 40var configPath = Path.Combine(inherited ? workspace.Path : app.FullName, "nuget.config"); 64new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 118File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), invalidConfiguration ? """ 123File.WriteAllText(Path.Combine(workspace.Path, "nuget.config"), """ 130new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 155var global = new FileInfo(Path.Combine(workspace.Path, "global.json")); 159File.WriteAllText(Path.Combine(workspace.Path, "nuget.config"), """ 190File.WriteAllText(Path.Combine(app.FullName, AspireConfigFile.FileName), """ 193File.WriteAllText(Path.Combine(workspace.Path, "nuget.config"), """ 199new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 211var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 239new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 248Assert.StartsWith(Path.Combine(appHostDirectory.FullName, ".aspire") + Path.DirectorySeparatorChar, preview.EffectiveWorkingDirectory.FullName); 252Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "private-feed"), privateSource.Source); 288Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 303new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 331var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 350var globalPackagesFolder = Path.Combine(workspace.WorkspaceRoot.FullName, "packages"); 359var restoreRoot = Path.Combine( 365Assert.Equal(Path.Combine(Path.GetDirectoryName(manifestPath)!, "obj"), capturedOutputPath); 474var toolPath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.dll"); 494Path.Combine(AppContext.BaseDirectory, $"{typeof(BundleNuGetService).Assembly.GetName().Name}.dll"), 551var manifestPath = Path.Combine(GetRestoreDirectory(workspace, packageList), ManifestFileName); 552Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!); 575var manifestPath = Path.Combine(GetRestoreDirectory(workspace, packageList), ManifestFileName); 576Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!); 595var firstAppHost = workspace.CreateDirectory(Path.Combine("apps", "api")); 596var secondAppHost = workspace.CreateDirectory(Path.Combine("apps", "web")); 599var restoreRoot = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "integrations", "package-restore"); 631var legacyLibsDirectory = Directory.CreateDirectory(Path.Combine(restoreDirectory, "libs")); 632var lockedFilePath = Path.Combine(legacyLibsDirectory.FullName, "Microsoft.Extensions.DependencyInjection.xml"); 643Assert.Equal(Path.Combine(restoreDirectory, ManifestFileName), result); 705return Path.Combine(
NuGet\NuGetClientTests.cs (68)
48.Save(Path.Combine(workspace.Path, "nuget.config")); 52File.Delete(Path.Combine(feed.FullName, $"{packageId}.{version}.nupkg")); 68Assert.True(File.Exists(Path.Combine(fallback.FullName, packageId.ToLowerInvariant(), version, "Sdk", "Sdk.props"))); 180await File.WriteAllTextAsync(Path.Combine(workspace.Path, "nuget.config"), """ 201await File.WriteAllTextAsync(Path.Combine(workspace.Path, "nuget.config"), $$""" 224await File.WriteAllTextAsync(Path.Combine(workspace.Path, "nuget.config"), 255var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 370Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 459var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 493var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 527Path.Combine(machineDirectory.FullName, "NuGet.Config"), 538Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 605Path.Combine(restoredPackage.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll"), 647Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"), 668nugetConfigPath: Path.Combine(workspace.WorkspaceRoot.FullName, "missing", "nuget.config"), 718var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 774var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1067var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1101packageRoot = Path.GetDirectoryName(restoredPackages[0].InstallPath); 1102var manifestPath = Path.Combine(restoreDirectory.FullName, IntegrationPackageProbeManifest.FileName); 1104Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName), 1112Assert.False(Directory.Exists(Path.Combine(restoreDirectory.FullName, "libs"))); 1115Path.Combine( 1124Path.Combine("runtimes", "win-x64", "lib", "net10.0", "RuntimeOnly.dll"), 1128Path.Combine("runtimes", "win-x64", "lib", "net10.0", "Neutral.resources.dll"), 1132Path.Combine("runtimes", "win-x64", "lib", "net10.0", "fr", "RuntimeOnly.resources.dll"), 1136Path.Combine("runtimes", "win-x64", "lib", "net10.0", "de", "RuntimeOnly.resources.dll"), 1162var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1212var assets = new LockFileFormat().Read(Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName)); 1216Path.TrimEndingDirectorySeparator(folder.Path), 1217Path.TrimEndingDirectorySeparator(environmentPackagesDirectory.FullName), 1222Directory.Exists(Path.Combine(environmentPackagesDirectory.FullName, packageId.ToLowerInvariant(), "1.0.0")), 1270var assets = new LockFileFormat().Read(Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName)); 1274Path.TrimEndingDirectorySeparator(folder.Path), 1275Path.TrimEndingDirectorySeparator(configPackagesDirectory.FullName), 1278Directory.Exists(Path.Combine(configPackagesDirectory.FullName, packageId.ToLowerInvariant(), "1.0.0")), 1318var manifestPath = Path.Combine(restoreDirectory.FullName, IntegrationPackageProbeManifest.FileName); 1320Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName), 1328Path.Combine("runtimes", "unix-x64", "lib", "net10.0", "UnixFallback.dll"), 1372var manifestPath = Path.Combine(restoreDirectory.FullName, IntegrationPackageProbeManifest.FileName); 1374Path.Combine(restoreDirectory.FullName, LockFileFormat.AssetsFileName), 1447var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1496Path.Combine(restoredPackage.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll"), 1512var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1560Path.Combine(restoredPackage.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll"), 1574var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1691var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1706Path.GetDirectoryName(nugetConfigPath)!, 1707Path.GetFileName(nugetConfigPath)); 1709var incompleteInstallPath = Path.Combine(globalPackagesFolder, packageId.ToLowerInvariant(), "1.0.0"); 1711File.WriteAllText(Path.Combine(incompleteInstallPath, "partial.txt"), "incomplete"); 1733Assert.True(File.Exists(Path.Combine(package.InstallPath, ".nupkg.metadata"))); 1734Assert.True(File.Exists(Path.Combine(package.InstallPath, "lib", "net10.0", "Aspire.Test.Package.dll"))); 1738Directory.Delete(Path.Combine(globalPackagesFolder, packageId.ToLowerInvariant()), recursive: true); 1747var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 1805Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 1827var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 1860var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 1881var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "policy", "NuGet.Config"); 1917var originalPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 1932var overlayPath = Path.Combine(overlayDirectory.FullName, "NuGet.Config"); 1951var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 1971var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2013? Settings.LoadSpecificSettings(Path.GetDirectoryName(nugetConfigPath)!, Path.GetFileName(nugetConfigPath)) 2028var lockFile = new LockFileFormat().Read(Path.Combine(restoreDirectory, LockFileFormat.AssetsFileName)); 2050var packagePath = Path.Combine(feedDirectory, $"{packageId}.{version}.nupkg"); 2130var packageDirectory = Path.Combine(globalPackagesFolder, packageId.ToLowerInvariant());
NuGet\NuGetConfigurationQueryTests.cs (17)
25var configPath = Path.Combine(workspace.Path, "nuget.config"); 46await File.WriteAllTextAsync(Path.Combine(appHostDirectory.FullName, Aspire.Cli.Configuration.AspireConfigFile.FileName), $$""" 55new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 65Assert.False(File.Exists(Path.Combine(appHostDirectory.FullName, "nuget.config"))); 83var configPath = Path.Combine(workspace.Path, "nuget.config"); 107await File.WriteAllTextAsync(Path.Combine(appHostDirectory.FullName, Aspire.Cli.Configuration.AspireConfigFile.FileName), $$""" 116new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()); 127Assert.False(File.Exists(Path.Combine(appHostDirectory.FullName, "nuget.config"))); 168var sdkFeed = workspace.CreateDirectory(Path.Combine(".aspire", "hives", "pr-21366", "packages")).FullName; 172await File.WriteAllTextAsync(Path.Combine(workspace.Path, "nuget.config"), $$""" 235var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 326var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 382Path.Combine(directory.FullName, "NuGet.Config"), 425var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 455Path.Combine(nonCanonicalDirectory.FullName, "NuGet.Config"), 469Path.Combine(mappingThenClearDirectory.FullName, "NuGet.Config"), 481Path.Combine(clearThenMappingDirectory.FullName, "NuGet.Config"),
NuGet\NuGetPackageCacheTests.cs (2)
49File.WriteAllText(Path.Combine(workspace.Path, "NuGet.Config"), """ 121Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"),
NuGet\NuGetPackageOperationConfigurationTests.cs (3)
97var ambientPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 214var persistentPath = Path.Combine(workspace.CreateDirectory("persistent").FullName, "NuGet.Config"); 249Path.Combine(directory.FullName, "NuGet.Config"),
NuGet\NuGetTestHelperTests.cs (4)
16var expectedConfigPath = Path.Combine(AppContext.BaseDirectory, "NuGetTestSettings.config"); 39var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 51var machineConfigPath = Path.Combine(machineDirectory.FullName, "NuGet.Config"); 68Assert.Equal([configPath, Path.Combine(AppContext.BaseDirectory, "NuGetTestSettings.config"), machineConfigPath], snapshot.ConfigPaths);
NuGet\TemporaryNuGetConfigFileTests.cs (2)
19var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config")); 42var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"));
Packaging\IntegrationSourceTests.cs (17)
72var global = new FileInfo(Path.Combine(workspace.Path, "global.json")); 79File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 82File.WriteAllText(Path.Combine(app.FullName, AspireConfigFile.FileName), $$""" 96new[] { "https://example.com/global", "https://example.com/team", Path.Combine(app.FullName, "packages") } 105var global = new FileInfo(Path.Combine(workspace.Path, "global.json")); 106File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 121File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), json); 124workspace.WorkspaceRoot, new FileInfo(Path.Combine(workspace.Path, "global.json")))); 185var global = new FileInfo(Path.Combine(workspace.Path, "global.json")); 189File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 192File.WriteAllText(Path.Combine(app.FullName, AspireConfigFile.FileName), """ 215File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 265File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 349File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 400File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """ 429File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """{"integrationSources":"invalid"}"""); 463File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), """
Packaging\PackageChannelTests.cs (47)
28var source = Path.Combine(workspace.Path, "unavailable"); 60var source = Path.Combine(workspace.Path, "packages"); 88File.WriteAllText(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 93"missing": {"source": {{JsonSerializer.Serialize(Path.Combine(workspace.Path, "missing"))}}} 244var nestedDirectory = Directory.CreateDirectory(Path.Combine( 250Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.6.0.nupkg"), 332File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty); 336File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty); 379File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty); 382File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty); 420File.WriteAllText(Path.Combine(channelPackagesDirectory.FullName, "Aspire.ProjectTemplates.13.4.0-preview.1.nupkg"), string.Empty); 423var nestedDirectory = Directory.CreateDirectory(Path.Combine(overridePackagesDirectory.FullName, "aspire.projecttemplates", "13.5.0-preview.2")); 424File.WriteAllText(Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.5.0-preview.2.nupkg"), string.Empty); 458var nestedDirectory = Directory.CreateDirectory(Path.Combine(packagesDirectory.FullName, "aspire.projecttemplates", "13.5.0-preview.2")); 459File.WriteAllText(Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.5.0-preview.2.nupkg"), string.Empty); 486File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Redis.{pinnedVersion}.nupkg"), string.Empty); 487File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.PostgreSQL.{pinnedVersion}.nupkg"), string.Empty); 488File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"CommunityToolkit.Aspire.Hosting.NodeJS.{pinnedVersion}.nupkg"), string.Empty); 491File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.SqlServer.13.3.0.nupkg"), string.Empty); 494File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty); 501File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.AppHost.{pinnedVersion}.nupkg"), string.Empty); 502File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Sdk.{pinnedVersion}.nupkg"), string.Empty); 503File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Orchestration.linux-arm64.{pinnedVersion}.nupkg"), string.Empty); 504File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Testing.{pinnedVersion}.nupkg"), string.Empty); 505File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Msi.{pinnedVersion}.nupkg"), string.Empty); 506File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Integration.Analyzers.{pinnedVersion}.nupkg"), string.Empty); 509File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.Dapr.{pinnedVersion}.nupkg"), string.Empty); 510File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.GitHub.Models.{pinnedVersion}.nupkg"), string.Empty); 511File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.Hosting.NodeJs.{pinnedVersion}.nupkg"), string.Empty); 794File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.4.0.nupkg"), string.Empty); 795File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.5.0-preview.1.nupkg"), string.Empty); 796File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.PostgreSQL.13.4.0-preview.1.nupkg"), string.Empty); 813File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.4.0.nupkg"), string.Empty); 814File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.5.0-preview.1.nupkg"), string.Empty); 815File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.PostgreSQL.13.4.0.nupkg"), string.Empty); 832File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.5.0.nupkg"), string.Empty); 833File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Redis.13.6.0-preview.1.nupkg"), string.Empty); 834File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Azure.Kubernetes.13.6.0-pr.19404.gf51e8e1d.nupkg"), string.Empty); 863File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Dapr.13.4.0.nupkg"), string.Empty); 864File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Sql.13.4.0.nupkg"), string.Empty); 883File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Dapr.13.4.0.nupkg"), string.Empty); 884File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.Hosting.Sql.13.4.0.nupkg"), string.Empty); 1142var missingDirectory = Path.Combine(Path.GetTempPath(), $"aspire-missing-{Guid.NewGuid():N}"); 1182CreatePackageWithTags(Path.Combine(packagesDirectory.FullName, $"{packageId}.{version}.nupkg"), packageId, version, tags); 1187var packagePath = Path.Combine(packagesDirectory.FullName, packageId.ToLowerInvariant(), version, $"{packageId}.{version}.nupkg"); 1188Directory.CreateDirectory(Path.GetDirectoryName(packagePath)!);
Packaging\PackageSourceIdentityTests.cs (3)
114: Path.GetRelativePath(workspace.WorkspaceRoot.FullName, feed.FullName); 146var caseVariant = Path.Combine(feed.Parent!.FullName, "feed with spaces"); 173.Save(Path.Combine(directory.FullName, "NuGet.Config"));
Packaging\PackageSourceOverrideMappingsTests.cs (2)
182Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, "relative:feed"), result); 195Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, source), result);
Packaging\PackagingServiceTests.cs (135)
27var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 60var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 96var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 200var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 237var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 270var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 304var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 360var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 425var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 457var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 487var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 512var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 540var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 567var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 593var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 613var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 634var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 664var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 696var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 718var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 746var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 771var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 807var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 869var configPath = Path.Combine(workspace.Path, "nuget.config"); 909var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 948var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 980var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1012var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1043var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1073var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1103var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1133var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1187var nugetConfigPath = Path.Combine(tempDir.FullName, "nuget.config"); 1212var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1216Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-10167")); 1217Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-11832")); 1268var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1272Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-12345")); 1308var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1343var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1378var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1442var nugetConfigPath = Path.Combine(tempDir.FullName, "nuget.config"); 1459var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1491var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1521var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1552var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1554var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, "local", "packages")); 1558File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{localVersion}.nupkg"), string.Empty); 1559File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{localVersion}.nupkg"), string.Empty); 1579var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1580var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire"); 1581Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1584var packagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages")); 1585File.WriteAllText(Path.Combine(packagesDirectory.FullName, $"Aspire.ProjectTemplates.{prVersion}.nupkg"), string.Empty); 1590var defaultHivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1622var defaultHivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1623var defaultPackagesDirectory = Directory.CreateDirectory(Path.Combine(defaultHivesDir.FullName, prChannelName, "packages")); 1624File.WriteAllText(Path.Combine(defaultPackagesDirectory.FullName, $"Aspire.ProjectTemplates.{defaultHiveVersion}.nupkg"), string.Empty); 1626var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1627var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire"); 1628Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1631var dogfoodPackagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages")); 1632File.WriteAllText(Path.Combine(dogfoodPackagesDirectory.FullName, $"Aspire.ProjectTemplates.{dogfoodHiveVersion}.nupkg"), string.Empty); 1662var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1663var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire"); 1664Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1667var packagesDirectory = Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages")); 1668File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.not-a-semver.nupkg"), string.Empty); 1672hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")), 1698var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1699var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire"); 1700Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1705hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")), 1728var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1729var processPath = Path.Combine(installPrefix.FullName, "dogfood", installedPrChannelName, "bin", "aspire"); 1730Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1732Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", identityPrChannelName, "packages")); 1736hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")), 1760hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")), 1784var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1785var processPath = Path.Combine(installPrefix.FullName, "dogfood", prChannelName, "bin", "aspire"); 1786Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1788Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages")); 1792hivesDirectory: new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")), 1820var installPrefix = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "custom-aspire-prefix")); 1821var processPath = Path.Combine(installPrefix.FullName, "bin", "aspire"); 1822Directory.CreateDirectory(Path.GetDirectoryName(processPath)!); 1824Directory.CreateDirectory(Path.Combine(installPrefix.FullName, "hives", prChannelName, "packages")); 1840var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1842var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, "local", "packages")); 1846File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{localVersion}.nupkg"), string.Empty); 1881var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1933var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 1984var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2030var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2034var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, localHiveName, "packages")); 2038File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty); 2064var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2067var runPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, runHiveName, "packages")); 2071File.WriteAllText(Path.Combine(runPackagesDir.FullName, $"Aspire.ProjectTemplates.{pinnedVersion}.nupkg"), string.Empty); 2098var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2101var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, "local", "packages")); 2106File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.{localVersion}.nupkg"), string.Empty); 2108File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.Redis.{localVersion}.nupkg"), string.Empty); 2109File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.Hosting.JavaScript.{localVersion}.nupkg"), string.Empty); 2111File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.ProjectTemplates.{localVersion}.nupkg"), string.Empty); 2112File.WriteAllText(Path.Combine(localPackagesDir.FullName, $"Aspire.AppHost.Sdk.{localVersion}.nupkg"), string.Empty); 2138var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2141var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, PackageChannelNames.Local, "packages")); 2143File.WriteAllText(Path.Combine(localPackagesDir.FullName, "Aspire.Hosting.13.4.0-pr.16820.g1a99aa46.nupkg"), string.Empty); 2175var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2179var localHiveDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, PackageChannelNames.Local)); 2194var expectedLocalPackagesPath = Path.Combine(localHiveDir.FullName, "packages").Replace('\\', '/'); 2205var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2208var localPackagesDir = new DirectoryInfo(Path.Combine(hivesDir.FullName, PackageChannelNames.Local, "packages")); 2228var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2230var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping")); 2232File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, $"Aspire.ProjectTemplates.{overrideVersion}.nupkg"), string.Empty); 2233File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, $"Aspire.Hosting.{overrideVersion}.nupkg"), string.Empty); 2257var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives")); 2259var staleHiveDir = Directory.CreateDirectory(Path.Combine(hivesDir.FullName, PackageChannelNames.Daily, "packages")); 2260File.WriteAllText(Path.Combine(staleHiveDir.FullName, "Aspire.Hosting.13.4.0.nupkg"), string.Empty); 2262var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping")); 2264File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, $"Aspire.Hosting.{overrideVersion}.nupkg"), string.Empty); 2289var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping")); 2290File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.Hosting.13.4.1.nupkg"), string.Empty); 2291File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.Hosting.13.4.2.nupkg"), string.Empty); 2293File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.ProjectTemplates.13.4.2.nupkg"), string.Empty); 2317var packagesOverrideDir = Directory.CreateDirectory(Path.Combine(tempDir.FullName, "shipping")); 2318File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.Hosting.13.4.1.nupkg"), string.Empty); 2319var nestedDir = Directory.CreateDirectory(Path.Combine(packagesOverrideDir.FullName, "nested")); 2320File.WriteAllText(Path.Combine(nestedDir.FullName, "Aspire.Hosting.13.4.2.nupkg"), string.Empty); 2322File.WriteAllText(Path.Combine(nestedDir.FullName, "Aspire.ProjectTemplates.13.4.2.nupkg"), string.Empty); 2323File.WriteAllText(Path.Combine(packagesOverrideDir.FullName, "Aspire.ProjectTemplates.13.4.2.nupkg"), string.Empty); 2344var missingDir = new DirectoryInfo(Path.Combine(tempDir.FullName, "does-not-exist"));
Processes\ProcessTreeGracefulShutdownServiceTests.cs (7)
36AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), 74AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), 250AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), 295AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), 334AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), 372AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"), 405Path.Combine(workspace.WorkspaceRoot.FullName, "test.log"),
ProfileCaptureOptionsTests.cs (15)
39var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "profiles", "startup.zip"); 66Assert.Contains("aspire-profile-", Path.GetFileName(options.OutputPath), StringComparison.Ordinal); 74var outputDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "profiles")); 83Assert.Equal(outputDirectory.FullName, Path.GetDirectoryName(options.OutputPath)); 85Assert.Contains("aspire-profile-", Path.GetFileName(options.OutputPath), StringComparison.Ordinal); 92var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "profiles") + Path.DirectorySeparatorChar; 101Assert.Equal(Path.TrimEndingDirectorySeparator(Path.GetFullPath(outputDirectory)), Path.GetDirectoryName(options.OutputPath)); 103Assert.Contains("aspire-profile-", Path.GetFileName(options.OutputPath), StringComparison.Ordinal); 110var dashboardBaseDirectory = Directory.CreateDirectory(Path.Combine( 117var expectedDashboardPath = Path.Combine( 131var dashboardBaseDirectory = Directory.CreateDirectory(Path.Combine( 138var expectedDashboardPath = Path.Combine(
ProfileCaptureServiceTests.cs (11)
117var managedPath = Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)); 122Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 153Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 156var dashboardPath = Path.Combine(dashboardDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)); 385var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nested", "profile.zip"); 402Assert.True(Directory.Exists(Path.GetDirectoryName(outputPath))); 526var dashboardPath = Path.Combine( 541var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "missing"); 551var logPath = Path.Combine(workspace.WorkspaceRoot.FullName, "profile-service.log"); 738var path = Path.Combine(workspace.WorkspaceRoot.FullName, fileName); 749outputPath ?? Path.Combine(workspace.WorkspaceRoot.FullName, "profile.zip"),
ProgramTests.cs (7)
65File.WriteAllText(Path.Combine(workspace.Path, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"}"""); 72? Path.Combine(workspace.Path, "mise", "installs", "aspire", "13.5.0", "aspire") 73: Path.Combine(workspace.Path, "aspire"); 104new TestProcessPathProvider(Path.Combine(workspace.Path, "aspire.exe")), 192var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 209var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 226var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName);
Projects\AppHostCandidateFinderTests.cs (11)
93var missingAppHost = Path.Combine(workspace.WorkspaceRoot.FullName, "Removed", "AppHost.csproj"); 169var searchRoot = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "obj")); 206var nugetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache"); 316var nugetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache"); 340var differentlyCasedNuGetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "NUGET-CACHE"); 384var nugetCachePath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache"); 542await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, ".gitignore"), "legacy/\n"); 575var searchDirectory = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src")); 610var fullPath = Path.Combine(root.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 611Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
Projects\AppHostInfoResolverTests.cs (1)
241var path = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.AppHost.csproj");
Projects\AppHostServerProjectTests.cs (26)
91var parentConfigPath = Path.Combine(_workspace.Path, "NuGet.Config"); 107var repoConfigPath = Path.Combine(repoRoot.FullName, "NuGet.Config"); 120await File.WriteAllTextAsync(Path.Combine(repoRoot.FullName, "Directory.Packages.props"), "<Project />"); 121await File.WriteAllTextAsync(Path.Combine(appPath.FullName, "NuGet.Config"), """ 207var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json"); 228var programCsPath = Path.Combine(project.ProjectModelPath, "Program.cs"); 250var programCs = Path.Combine(project.ProjectModelPath, "Program.cs"); 273var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json"); 328Path.Combine("src", "Aspire.Hosting.PostgreSQL")); 329var integrationProjectPath = Path.Combine(integrationDirectory.FullName, "Aspire.Hosting.PostgreSQL.csproj"); 363Path.Combine("src", "Aspire.Hosting.Redis")); 364var integrationProjectPath = Path.Combine(integrationDirectory.FullName, "Aspire.Hosting.Redis.csproj"); 390var firstProjectPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "Integration", "Integration.csproj"); 391var secondProjectPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "integration", "Integration.csproj"); 430var normalizedAppPath = Path.GetFullPath(project.AppDirectoryPath); 436var expectedRoot = Path.Combine(CliPathHelper.GetAspireHomeDirectory(), "hosts"); 437var expectedPath = Path.Combine(expectedRoot, pathDir); 438var parentDirectory = Path.GetDirectoryName(project.ProjectModelPath); 497var aspireConfigPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 545var projectModelPath = Path.Combine(appPath, ".aspire_server"); 576var projectFilePath = Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName); 601var aspireConfigPath = Path.Combine(appPath, AspireConfigFile.FileName); 619var projectModelPath = Path.Combine(appPath, ".aspire_server"); 663var projectModelPath = Path.Combine(appPath, ".aspire_server"); 691var aspireConfigPath = Path.Combine(appPath, AspireConfigFile.FileName); 709var projectModelPath = Path.Combine(appPath, ".aspire_server");
Projects\AppHostServerSessionTests.cs (2)
214Path.Combine(workspace.WorkspaceRoot.FullName, "absent.sock"), output, execution); 521var integrationCachePathBlockedByFile = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "integrations");
Projects\AppHostWorkloadIdTests.cs (9)
14var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 17var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.Link.csproj"); 31var target = new FileInfo(Path.Combine(nestedDirectory.FullName, "AppHost.csproj")); 34var linkDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 36var pathThroughLink = Path.Combine(linkDirectoryPath, "nested", "AppHost.csproj"); 49var target = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 54AppHostWorkloadId.Create(Path.Combine(nestedDirectory.FullName, "..", "AppHost.csproj"))); 61var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 81var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
Projects\DefaultLanguageDiscoveryTests.cs (11)
164var file = new FileInfo(Path.Combine(Path.GetTempPath(), fileName)); 179var file = new FileInfo(Path.Combine(Path.GetTempPath(), fileName)); 190var file = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.py")); 203var file = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.py")); 248var appHostPath = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar)); 249Directory.CreateDirectory(Path.GetDirectoryName(appHostPath)!);
Projects\DotNetAppHostProjectTests.cs (185)
84var appHostFile = new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, fileName)); 93var appHostFile = new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "Missing.csproj")); 308File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """ 445await File.WriteAllTextAsync(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """ 561Assert.Equal(Path.Combine(bundleRoot.FullName, BundleDiscovery.DcpDirectoryName), env![BundleDiscovery.DcpPathEnvVar]); 590var customDcpDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "custom-dcp")); 592var customDashboardPath = Path.Combine( 643var inheritedDcpDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "inherited-dcp")).FullName; 645var inheritedDashboardPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "inherited-dashboard"); 706: Path.Combine(_workspace.WorkspaceRoot.FullName, "missing-dcp"); 709: Path.Combine(_workspace.WorkspaceRoot.FullName, "missing-dashboard"); 976var repoLocalTerminalHost = Path.Combine(_workspace.WorkspaceRoot.FullName, "repo-local-terminalhost"); 1005Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 1036var customTerminalHost = Path.Combine(_workspace.WorkspaceRoot.FullName, "my-custom-terminal-host"); 1104var runWorkingDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "run-cwd")); 1115Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1116File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1214Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1215File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1256"--log-file", Path.Combine(_workspace.WorkspaceRoot.FullName, "child.log"), 1304Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1305File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1370Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1371File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1460Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1461File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1502Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1503File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1546Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1547File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), $$""" 1593Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1594File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1638Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1639File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1746var missingTargetPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", "missing", "AppHost.dll"); 1757var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", Guid.NewGuid().ToString("N"))); 1758var targetPath = Path.Combine(outputDirectory.FullName, "AppHost.dll"); 1770var missingRunCommand = Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", "missing", "AppHost"); 1871Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1872File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 1938Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 1939File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), $$""" 2042File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "AppHost.run.json"), """ 2107Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "My Project")); 2108File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "My Project", "launchSettings.json"), """ 2168Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 2169File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 2233Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 2234File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 2290Directory.CreateDirectory(Path.Combine(appHostFile.DirectoryName!, "Properties")); 2291File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "Properties", "launchSettings.json"), """ 2401Assert.Equal(Path.Combine(bundleRoot.FullName, BundleDiscovery.DcpDirectoryName), env![BundleDiscovery.DcpPathEnvVar]); 2585File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """ 2817var appHostSymlink = Path.Combine(appHostFile.DirectoryName!, "apphost-link.cs"); 2846var targetAppHostFile = new FileInfo(Path.Combine(realDirectory.FullName, "apphost.cs")); 2850var selectedAppHostPath = Path.Combine(selectedDirectory.FullName, "apphost.cs"); 2880var selectedAppHostFile = new FileInfo(Path.Combine(configuredAppHostFile.DirectoryName!, "AppHost.cs")); 2943File.WriteAllText(Path.Combine(appHostFile.DirectoryName!, "apphost.run.json"), """ 3097var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.cs"); 3112var backchannelsDir = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 3117var appHostId = Path.GetFileName(prefix); 3118var socketPath = Path.Combine( 3127var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", Guid.NewGuid().ToString("N"))); 3128var targetPath = Path.Combine(outputDirectory.FullName, fileName); 3130File.WriteAllText(Path.ChangeExtension(targetPath, ".runtimeconfig.json"), "{}"); 3136var outputDirectory = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "bin", Guid.NewGuid().ToString("N"))); 3137var commandPath = Path.Combine(outputDirectory.FullName, fileName); 3238var appHost = new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.cs")); 3254var appHost = new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.cs")); 3267var appHost = new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.cs")); 3500var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3519var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3591var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "project", "Library.csproj"), """ 3596WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 3603WriteIsLikelyAppHostProject(Path.Combine("outer", "project", "Directory.Build.props"), """ 3640var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3685var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 3688WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """ 3693WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.targets"), """ 3707var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 3765var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3789var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 3816var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3834var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3853var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), """ 3875var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "inner-repo", "MyAppHost", "MyAppHost.csproj"), """ 3882WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 3891Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, "outer", "inner-repo", ".git")); 3909var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "src", "MyAppHost", "MyAppHost.csproj"), """ 3917WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """ 3922WriteIsLikelyAppHostProject(Path.Combine("repo", "Custom.props"), """ 3945var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "src", "OrdinaryLib", "OrdinaryLib.csproj"), """ 3952WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """ 3959WriteIsLikelyAppHostProject(Path.Combine("repo", "src", "Directory.Build.props"), """ 3980var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "OrdinaryLib.csproj"), """ 3987WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 3994WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4012var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "MyAppHost.csproj"), """ 4019WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4026WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4052var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "proj", "OrdinaryLib.csproj"), """ 4059WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4066WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """ 4073WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "Directory.Build.props"), """ 4095var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "proj", "OrdinaryLib.csproj"), """ 4102WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4109WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """ 4116WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "Directory.Build.props"), """ 4133var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "MyAppHost.csproj"), """ 4140WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4147WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4165var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """ 4168WriteIsLikelyAppHostProject(Path.Combine("outer", "directory.build.props"), """ 4175WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4189var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """ 4192WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.targets"), """ 4199WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4204WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """ 4220var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """ 4223WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.targets"), """ 4230WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4235WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """ 4251var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """ 4254WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4259WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """ 4266WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Directory.Build.targets"), """ 4282var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """ 4285WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4292WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4306var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "Library.csproj"), """ 4309WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4316WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4321WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Shared.props"), "<Project />"); 4333var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "MyHost.csproj"), """ 4340WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4347WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.targets"), """ 4368var projectFile = WriteIsLikelyAppHostProject(Path.Combine("proj", "MyApp.csproj"), """ 4375var externalAnchor = Path.Combine(_workspace.WorkspaceRoot.FullName, "external", "anchor"); 4377WriteIsLikelyAppHostProject(Path.Combine("proj", "Directory.Build.props"), $""" 4382WriteIsLikelyAppHostProject(Path.Combine("external", "Directory.Build.props"), """ 4419var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), "<Project Sdk=\"Microsoft.NET.Sdk\""); 4437var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "MyHost", "MyHost.csproj"), "<Project Sdk=\"Microsoft.NET.Sdk\""); 4455var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 4458WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """ 4473var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 4476WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """ 4491var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 4494WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """ 4512var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 4515WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """ 4534var projectFile = WriteIsLikelyAppHostProject(Path.Combine("src", "Library", "Library.csproj"), """ 4537WriteIsLikelyAppHostProject(Path.Combine("src", "Directory.Build.props"), """ 4581var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "proj", "OrdinaryLib.csproj"), """ 4588WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4595WriteIsLikelyAppHostProject(Path.Combine("outer", "repo", "Directory.Build.props"), """ 4619var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "proj", "OrdinaryLib.csproj"), """ 4626WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4633WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """ 4640WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "inner", "Directory.Build.props"), """ 4656var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "proj", "OrdinaryLib.csproj"), """ 4659WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """ 4675var projectFile = WriteIsLikelyAppHostProject(Path.Combine("repo", "proj", "OrdinaryLib.csproj"), """ 4678WriteIsLikelyAppHostProject(Path.Combine("repo", "Directory.Build.props"), """ 4707var projectFile = WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "repo", "proj", "OrdinaryLib.csproj"), """ 4710WriteIsLikelyAppHostProject(Path.Combine("outer", "Repo.marker"), "<Project />"); 4711WriteIsLikelyAppHostProject(Path.Combine("outer", "Directory.Build.props"), """ 4718WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "Directory.Build.props"), """ 4725WriteIsLikelyAppHostProject(Path.Combine("outer", "mid", "repo", "Directory.Build.props"), """ 4787var projectFile = new FileInfo(Path.Combine(repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar))); 4805while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "Aspire.slnx"))) 4821Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, ".git")); 4823var path = Path.Combine(_workspace.WorkspaceRoot.FullName, fileName); 4824var directory = Path.GetDirectoryName(path); 4858var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, fileName); 4875var projectPath = Path.Combine(_workspace.WorkspaceRoot.FullName, fileName); 4889var bundleRoot = Directory.CreateDirectory(Path.Combine(_workspace.WorkspaceRoot.FullName, Guid.NewGuid().ToString())); 4890var dcpDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.DcpDirectoryName)); 4891var managedDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.ManagedDirectoryName)); 4892var dashboardDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.DashboardDirectoryName)); 4893var terminalHostDirectory = Directory.CreateDirectory(Path.Combine(bundleRoot.FullName, BundleDiscovery.TerminalHostDirectoryName)); 4896Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.ManagedExecutableName)), 4899Path.Combine(dashboardDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.DashboardExecutableName)), 4902Path.Combine(terminalHostDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.TerminalHostExecutableName)), 4959=> File.WriteAllText(Path.Combine(directory, "aspire.config.json"), content);
Projects\DotNetBasedAppHostServerScaffoldCacheTests.cs (13)
77Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName)); 95var programPath = Path.Combine(project.ProjectModelPath, "Program.cs"); 116var objPath = Path.Combine(project.ProjectModelPath, "obj"); 118var stalePath = Path.Combine(objPath, "stale.cache"); 137var firstProject = Path.Combine(appPath, "v1", "Contoso.Widgets.csproj"); 138var secondProject = Path.Combine(appPath, "v2", "Contoso.Widgets.csproj"); 144var csprojPath = Path.Combine(project.ProjectModelPath, DotNetBasedAppHostServerProject.ProjectFileName); 161var firstHost = Path.Combine(appPath, "first", "host.ts"); 162var secondHost = Path.Combine(appPath, "second", "host.ts"); 166var appSettingsPath = Path.Combine(project.ProjectModelPath, "appsettings.json"); 193var objPath = Path.Combine(project.ProjectModelPath, "obj"); 195var assetsPath = Path.Combine(objPath, "project.assets.json"); 204var projectModelPath = Path.Combine(appPath, ".aspire_server");
Projects\ExtensionGuestLauncherTests.cs (17)
32var command = Path.Combine(Path.GetTempPath(), "npx"); 57var effectivePath = Path.GetDirectoryName(effectiveJava)!; 58using var ambientPath = new EnvVarOverride("PATH", Path.GetDirectoryName(ambientJava)); 64new FileInfo(Path.Combine(root.FullName, "AppHost.java")), 100await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "npx"), ["tsx"], new DirectoryInfo("/tmp"), new Dictionary<string, string>(), afterLaunchAsync: null, options: null, CancellationToken.None); 115await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "npx"), [], new DirectoryInfo("/tmp"), new Dictionary<string, string>(), afterLaunchAsync: null, options: null, CancellationToken.None); 136await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "npx"), ["tsx"], new DirectoryInfo("/tmp"), envVars, afterLaunchAsync: null, options: null, CancellationToken.None); 150var (exitCode, output) = await launcher.LaunchAsync(Path.Combine(Path.GetTempPath(), "cmd"), [], new DirectoryInfo("/tmp"), new Dictionary<string, string>(), afterLaunchAsync: null, options: null, CancellationToken.None); 166var command = Path.Combine(Path.GetTempPath(), "python"); 179var binDirectory = Directory.CreateDirectory(Path.Combine(root.FullName, runtimeDirectory, "bin")); 180var executable = Path.Combine(binDirectory.FullName, OperatingSystem.IsWindows() ? $"{command}.exe" : command);
Projects\FallbackProjectParserTests.cs (22)
28var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 43var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 81var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 97var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{extension}")); 127var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 149var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 174var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 199var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 224var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 250var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 270var tempPath = Path.GetTempPath().Replace("\\", "/"); 289var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.csproj"); 316var referencedPath = Path.Combine(webDirectory.FullName, "Web.csproj"); 317var include = absolute ? referencedPath : Path.GetRelativePath(appHostDirectory.FullName, referencedPath); 319var projectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 341var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs"); 365var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs"); 395var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs"); 418var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs"); 442var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs"); 465var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.cs"); 487var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Test.txt");
Projects\GuestAppHostProjectTests.cs (108)
69var executable = Path.Combine(root.FullName, "server"); 95await File.WriteAllTextAsync(Path.Combine(root.FullName, "apphost.mts"), "// test apphost"); 123await File.WriteAllTextAsync(Path.Combine(root.FullName, "apphost.mts"), "// test apphost"); 163var appHostFile = new FileInfo(Path.Combine(appDirectory.FullName, "apphost.mts")); 199using var pathOverride = new EnvVarOverride("PATH", binDirectory.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")); 235hostRestoredBeforeBootstrap = File.Exists(Path.Combine(integrationDirectory.FullName, "installed.txt")); 243&& File.Exists(Path.Combine(appDirectory.FullName, "app-installed.txt")) 244&& File.Exists(Path.Combine(integrationDirectory.FullName, "installed.txt")); 299Assert.Equal(guestInstallExitCode == 0, File.Exists(Path.Combine(integrationDirectory.FullName, "installed.txt"))); 316Assert.Equal("combined", await File.ReadAllTextAsync(Path.Combine(appDirectory.FullName, ".aspire", "modules", "aspire.mts"))); 353Assert.Equal(["install"], await File.ReadAllLinesAsync(Path.Combine(directory.FullName, "arguments.txt"))); 381parentPid = await ProcessTestHelpers.WaitForProcessIdAsync(Path.Combine(directory.FullName, "parent.pid"), readinessCts.Token); 382childPid = await ProcessTestHelpers.WaitForProcessIdAsync(Path.Combine(directory.FullName, "child.pid"), readinessCts.Token); 407var outputPath = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "modules"); 408Directory.CreateDirectory(Path.Combine(outputPath, "aspire")); 409var kept = Path.Combine(outputPath, "aspire", "Kept.java"); 410var obsolete = Path.Combine(outputPath, "aspire", "RemovedResource.java"); 417[Path.Combine("aspire", "Kept.java"), Path.Combine("aspire", "RemovedResource.java")], 425[Path.Combine("aspire", "Kept.java")], 435var outputPath = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "modules"); 437var handWritten = Path.Combine(outputPath, "HandWritten.java"); 451var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "Generated.java"); 467var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "Generated.java"); 481var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "New.java"); 492var filePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire_app.py"); 534var settingsPath = Path.Combine(settingsDir.FullName, "settings.json"); 554var settingsPath = Path.Combine(settingsDir.FullName, "settings.json"); 740var settingsPath = Path.Combine(settingsDir.FullName, "settings.json"); 800var launchSettingsPath = Path.Combine(propertiesDir.FullName, "launchSettings.json"); 889var aspireConfigPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1070var legacyAppHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, LegacyTypeScriptAppHost.LegacyAppHostFileName); 1073Path.Combine(_workspace.WorkspaceRoot.FullName, LegacyTypeScriptAppHost.ModernAppHostFileName), 1093Assert.True(Directory.Exists(Path.Combine( 1096Assert.False(Directory.Exists(Path.Combine( 1118var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1126var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1183var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1191var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1194Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.mts"), 1196var installScriptPath = Path.Combine(_workspace.WorkspaceRoot.FullName, OperatingSystem.IsWindows() ? "install.cmd" : "install.sh"); 1200var installMarkerPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "install.marker"); 1210Command = OperatingSystem.IsWindows() ? Path.Combine(Environment.SystemDirectory, "cmd.exe") : "/bin/sh", 1225var manifestPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "package.json"); 1229await File.WriteAllTextAsync(Path.Combine(_workspace.WorkspaceRoot.FullName, "package.after-install.json"), installedManifest); 1302var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1310var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1350var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1358var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1396var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1404var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1448var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1456var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1490var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1499var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1540var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1549var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1583var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1607var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.mts"); 1609var identity = Path.Combine(_workspace.WorkspaceRoot.FullName, "server", "AppHostServer.csproj"); 1629var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1638var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1696var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1704var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1753var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1762var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1813var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1822var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1870var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1879var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 1937var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1954var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2053var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2105var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2192var appHostFile = new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts")); 2195await File.WriteAllTextAsync(Path.Combine(properties.FullName, "launchSettings.json"), """ 2308var appHostFile = new FileInfo(Path.Combine(root.FullName, "apphost.mts")); 2309var executable = Path.Combine(root.FullName, "server"); 2365var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2392var secretsFilePath = secretsFileName is null ? null : Path.Combine(_workspace.WorkspaceRoot.FullName, secretsFileName); 2405Path.Combine(AppContext.BaseDirectory, ".home", ".aspire"), 2427var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2442new FileInfo(Path.Combine(_workspace.WorkspaceRoot.FullName, "package.json"))); 2479var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2487var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2569var configPath = Path.Combine(_workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2577var appHostPath = Path.Combine(_workspace.WorkspaceRoot.FullName, "apphost.ts"); 2659var backchannelsDir = Path.Combine(_workspace.WorkspaceRoot.FullName, ".aspire", "cli", "bch"); 2664var appHostId = Path.GetFileName(prefix); 2665var socketPath = Path.Combine( 2696var logFilePath = Path.Combine(_workspace.WorkspaceRoot.FullName, $"test-guest-{Guid.NewGuid()}.log"); 2774var devCertificatePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire-dev-cert.pem"); 2778["NODE_EXTRA_CA_CERTS"] = Path.GetFileName(devCertificatePath) 2790Assert.False(Directory.Exists(Path.Combine(_workspace.WorkspaceRoot.FullName, "bundles"))); 2796var devCertificatePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire-dev-cert.pem"); 2817var lowerCaseDirectory = Path.Combine(_workspace.WorkspaceRoot.FullName, "certificates"); 2818var upperCaseDirectory = Path.Combine(_workspace.WorkspaceRoot.FullName, "CERTIFICATES"); 2821var devCertificatePath = Path.Combine(lowerCaseDirectory, "aspire.pem"); 2822var existingBundlePath = Path.Combine(upperCaseDirectory, "ASPIRE.PEM"); 2871var existingBundlePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "existing-ca-certs.pem"); 2872var inheritedBundlePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "inherited-ca-certs.pem"); 2873var devCertificateDirectory = Path.Combine(homeDirectory.FullName, ".aspire", "dev-certs"); 2874var devCertificatePath = Path.Combine(devCertificateDirectory, "aspire-dev-cert.pem"); 2891[configuredNodeExtraCaCertsKey] = Path.GetFileName(existingBundlePath) 2895var expectedBundlePath = Path.Combine( 2918envVars[configuredNodeExtraCaCertsKey] = Path.GetFileName(existingBundlePath); 2934File.GetUnixFileMode(Path.GetDirectoryName(expectedBundlePath)!)); 2946var devCertificatePath = Path.Combine(_workspace.WorkspaceRoot.FullName, "aspire-dev-cert.pem");
Projects\GuestRuntimeTests.cs (59)
285var appHostFile = new FileInfo(Path.Combine(directory.FullName, "apphost.ts")); 580var effectivePath = Path.GetDirectoryName(effectiveJava)!; 605var appHostFile = new FileInfo(Path.Combine(root.FullName, "AppHost.java")); 610new Dictionary<string, string> { ["PATH"] = Path.GetDirectoryName(ambientJava)! }, 759new DirectoryInfo(Path.GetTempPath()), 777var scriptPath = Path.Combine( 861new DirectoryInfo(Path.GetTempPath()), 893var appHostFile = new FileInfo(Path.Combine(Path.GetTempPath(), "apphost.ts")); 916var logFilePath = Path.Combine(Path.GetTempPath(), $"guest-output-test-{Guid.NewGuid()}.log"); 927new DirectoryInfo(Path.GetTempPath()), 1000Assert.Equal($"process {Path.GetFileName(resolvedDotNet)}", activity.DisplayName); 1104new DirectoryInfo(Path.GetTempPath()), 1163var appHostFile = new FileInfo(Path.Combine(tempDir, "apphost.ts")); 1167var migrationFilePath = Path.Combine(tempDir, migrationFileName); 1189var migrationFilePath = Path.Combine(tempDir, migrationFileName); 1211var appHostFile = new FileInfo(Path.Combine(tempDir, "apphost.ts")); 1251Assert.True(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "classes", ".aspire-compile-stamp"))); 1277var runtime = CreateRuntime(CreateUpToDateSpec(requiredOutputs: [Path.Combine("classes", "AppHost.class")])); 1296var input = Path.Combine(workspace.WorkspaceRoot.FullName, relativeInput.Replace('/', Path.DirectorySeparatorChar)); 1317var classFile = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.class"); 1345File.Delete(Path.Combine(workspace.WorkspaceRoot.FullName, relativeInput.Replace('/', Path.DirectorySeparatorChar))); 1360var pom = Path.Combine(workspace.WorkspaceRoot.FullName, "pom.xml"); 1382var dependencies = Path.Combine(workspace.WorkspaceRoot.FullName, "target", "dependency"); 1384File.WriteAllText(Path.Combine(dependencies, "guava-32.0.0.jar"), ""); 1395File.Delete(Path.Combine(dependencies, "guava-32.0.0.jar")); 1396File.WriteAllText(Path.Combine(dependencies, "guava-33.0.0.jar"), ""); 1398var runtime = CreateRuntime(CreateUpToDateSpec(extraInputs: [Path.Combine("target", "dependency")])); 1411var dependencies = Path.Combine(workspace.WorkspaceRoot.FullName, "target", "dependency"); 1413var jar = Path.Combine(dependencies, "guava-32.0.0.jar"); 1422var runtime = CreateRuntime(CreateUpToDateSpec(extraInputs: [Path.Combine("target", "dependency")])); 1440var unrelated = Path.Combine(workspace.WorkspaceRoot.FullName, "vendor", "nested", "Vendored.java"); 1441Directory.CreateDirectory(Path.GetDirectoryName(unrelated)!); 1458StampFile = Path.Combine("classes", ".aspire-compile-stamp") 1482var nested = Path.Combine(workspace.WorkspaceRoot.FullName, "config", "Resources.java"); 1483Directory.CreateDirectory(Path.GetDirectoryName(nested)!); 1506Path.Combine(workspace.WorkspaceRoot.FullName, "classes", "config", "Resources.class"), 1507Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "vendor", "Vendored.java"), 1508Path.Combine(workspace.WorkspaceRoot.FullName, ".gradle", "caches", "Cached.java") 1513Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1529Directory.SetLastWriteTimeUtc(Path.GetDirectoryName(path)!, DateTime.UtcNow.AddMinutes(1)); 1553var unreadable = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "main", "java", "locked"); 1555File.WriteAllText(Path.Combine(unreadable, "Hidden.java"), "class Hidden { }"); 1596Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "classes", ".aspire-compile-stamp"))); 1614StampFile = Path.Combine("classes", ".aspire-compile-stamp") 1622var appHostFile = new FileInfo(Path.Combine(root.FullName, "AppHost.java")); 1624File.WriteAllText(Path.Combine(root.FullName, "Helper.java"), "class Helper { }"); 1626var generated = Path.Combine(root.FullName, ".aspire", "modules", "com", "example"); 1628File.WriteAllText(Path.Combine(generated, "Generated.java"), "class Generated { }"); 1630var sources = Path.Combine(root.FullName, "src", "main", "java", "com", "example"); 1632File.WriteAllText(Path.Combine(sources, "Service.java"), "class Service { }"); 1634Directory.CreateDirectory(Path.Combine(root.FullName, "classes")); 1661var stamp = Path.Combine(root.FullName, "classes", ".aspire-compile-stamp"); 1662Directory.CreateDirectory(Path.GetDirectoryName(stamp)!); 1669var binDirectory = Directory.CreateDirectory(Path.Combine(root.FullName, runtimeDirectory, "bin")); 1670var executable = Path.Combine(binDirectory.FullName, OperatingSystem.IsWindows() ? $"{command}.exe" : command);
Projects\JavaAppHostToolchainResolverTests.cs (123)
17var path = Path.Combine(directory, wrapperName); 35["/c", "call", Path.Combine(".", Path.GetRelativePath(appHostDirectory, wrapperPath)), .. toolArgs], 85File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 96File.WriteAllText(Path.Combine(workspace.Path, buildFileName), ""); 105File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 106File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), ""); 115File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 139File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 149["-B", "-q", "dependency:copy-dependencies", $"-DoutputDirectory={Path.Combine("target", "aspire-deps")}", "-DincludeScope=runtime"], 160"-classpath", Path.Combine("target", "aspire-deps", "*"), 161"-sourcepath", $".{Path.PathSeparator}{Path.Combine("src", "main", "java")}", 162"-d", Path.Combine("target", "classes"), 172["-cp", $"{Path.Combine("target", "classes")}{Path.PathSeparator}{Path.Combine("target", "aspire-deps", "*")}", "AppHost"], 187File.WriteAllText(Path.Combine(workspace.Path, buildFileName), ""); 211Outputs = [Path.Combine(".java-build", "AppHost.class")], 213StampFile = Path.Combine(".java-build", ".aspire-compile-stamp") 229Assert.Contains(descriptor.Replace('/', Path.DirectorySeparatorChar), inputs); 232Assert.Contains(Path.Combine(outputDirectoryName, "aspire-deps"), inputs); 234? Path.Combine("target", "classes") 235: Path.Combine("build", "classes", "java", "main"); 236Assert.Equal([Path.Combine(expectedClassesDirectory, "AppHost.class")], check.Outputs!); 244File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), ""); 255["-q", "--init-script", JavaAppHostToolchainResolver.GradleInitScriptRelativePath.Replace('/', Path.DirectorySeparatorChar), "aspireCopyDependencies"], 263"-classpath", Path.Combine("build", "aspire-deps", "*"), 264"-sourcepath", $".{Path.PathSeparator}{Path.Combine("src", "main", "java")}", 265"-d", Path.Combine("build", "classes", "java", "main"), 273["-cp", $"{Path.Combine("build", "classes", "java", "main")}{Path.PathSeparator}{Path.Combine("build", "aspire-deps", "*")}", "AppHost"], 282File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 316var wrapperPath = Path.Combine(workspace.Path, expectedWrapper); 328Assert.Equal(["/c", "call", Path.Combine(".", expectedWrapper)], invocation.PrefixArgs); 353var rootWrapperPath = Path.Combine(workspace.Path, expectedWrapper); 356var moduleDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "apphost")); 357File.WriteAllText(Path.Combine(moduleDirectory.FullName, useMaven ? "pom.xml" : "build.gradle"), ""); 363Assert.Equal(["/c", "call", Path.Combine(".", "..", expectedWrapper)], invocation.PrefixArgs); 377var localRepository = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-maven-repository")); 387Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"), 391"-f", Path.Combine("..", "..", "..", "..", "pom.xml"), 411Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"), 415"-f", Path.Combine("..", "..", "..", "..", "pom.xml"), 418$"-DoutputDirectory={Path.Combine("target", "aspire-deps")}", 433File.Exists(Path.Combine(resolution.ProjectDirectory.FullName, "target", "aspire-deps", "library-1.0-SNAPSHOT.jar")), 443var localRepository = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-maven-repository")); 453Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"), 457"-f", Path.Combine("..", "..", "..", "..", "pom.xml"), 481Path.Combine(workspace.Path, "pom.xml"), 485var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "standalone")); 486File.WriteAllText(Path.Combine(appHostDirectory.FullName, "pom.xml"), "<project />"); 497$"-DoutputDirectory={Path.Combine("target", "aspire-deps")}", 505File.WriteAllText(Path.Combine(root, "pom.xml"), """ 522var libraryDirectory = Directory.CreateDirectory(Path.Combine(root, "library")); 523File.WriteAllText(Path.Combine(libraryDirectory.FullName, "pom.xml"), """ 535var librarySources = Directory.CreateDirectory(Path.Combine(libraryDirectory.FullName, "src", "main", "java", "com", "example")); 537Path.Combine(librarySources.FullName, "Library.java"), 540var appHostProjectDirectory = Directory.CreateDirectory(Path.Combine(root, "apphost")); 541File.WriteAllText(Path.Combine(appHostProjectDirectory.FullName, "pom.xml"), """ 561Path.Combine(appHostProjectDirectory.FullName, "src", "main", "java")); 563Path.Combine(appHostDirectory.FullName, "AppHost.java"), 566var wrapperSource = Path.Combine( 572Path.Combine(wrapperSource, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"), 573Path.Combine(root, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw")); 574var wrapperDirectory = Directory.CreateDirectory(Path.Combine(root, ".mvn", "wrapper")); 576Path.Combine(wrapperSource, ".mvn", "wrapper", "maven-wrapper.properties"), 577Path.Combine(wrapperDirectory.FullName, "maven-wrapper.properties")); 584File.WriteAllText(Path.Combine(root, "pom.xml"), """ 597var appHostProjectDirectory = Directory.CreateDirectory(Path.Combine(root, "apphost")); 598File.WriteAllText(Path.Combine(appHostProjectDirectory.FullName, "pom.xml"), """ 607Path.Combine(appHostProjectDirectory.FullName, "src", "main", "java")); 609Path.Combine(appHostDirectory.FullName, "AppHost.java"), 612var wrapperSource = Path.Combine( 618Path.Combine(wrapperSource, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw"), 619Path.Combine(root, OperatingSystem.IsWindows() ? "mvnw.cmd" : "mvnw")); 620var wrapperDirectory = Directory.CreateDirectory(Path.Combine(root, ".mvn", "wrapper")); 622Path.Combine(wrapperSource, ".mvn", "wrapper", "maven-wrapper.properties"), 623Path.Combine(wrapperDirectory.FullName, "maven-wrapper.properties")); 681=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..")); 694File.WriteAllText(Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? windowsWrapperName : wrapperName), ""); 696var innerCheckout = Directory.CreateDirectory(Path.Combine(workspace.Path, "inner")); 697Directory.CreateDirectory(Path.Combine(innerCheckout.FullName, ".git")); 698File.WriteAllText(Path.Combine(innerCheckout.FullName, useMaven ? "pom.xml" : "build.gradle"), ""); 710File.WriteAllText(Path.Combine(directory, "pom.xml"), ""); 714File.WriteAllText(Path.Combine(directory, "settings.gradle"), ""); 722File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), ""); 724var scriptPath = Path.Combine(workspace.Path, ".aspire", "aspire-gradle-init.gradle"); 741File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), ""); 746var script = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".aspire", "aspire-gradle-init.gradle")); 757File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 759var dependencyDirectory = Path.Combine(workspace.Path, "target", "aspire-deps"); 761await File.WriteAllTextAsync(Path.Combine(dependencyDirectory, "library-1.0.jar"), ""); 774File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 778Assert.False(Directory.Exists(Path.Combine(workspace.Path, "target"))); 785File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), ""); 788var dependencyDirectory = Path.Combine(workspace.Path, "build", "aspire-deps"); 790await File.WriteAllTextAsync(Path.Combine(dependencyDirectory, "library-1.0.jar"), ""); 807File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 824File.WriteAllText(Path.Combine(workspace.Path, buildFileName), ""); 825var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java")); 839File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 840var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "a", "b", "c")); 849File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 851var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java")); 858var toProjectRoot = Path.Combine("..", "..", ".."); 860Assert.Contains(Path.Combine(toProjectRoot, "pom.xml"), spec.InstallDependencies.Args); 865Assert.Contains($"-DoutputDirectory={Path.Combine("target", "aspire-deps")}", spec.InstallDependencies.Args); 871"-classpath", Path.Combine(toProjectRoot, "target", "aspire-deps", "*"), 872"-sourcepath", $".{Path.PathSeparator}{Path.Combine("src", "main", "java")}", 873"-d", Path.Combine(toProjectRoot, "target", "classes"), 881$"{Path.Combine(toProjectRoot, "target", "classes")}{Path.PathSeparator}{Path.Combine(toProjectRoot, "target", "aspire-deps", "*")}", 891File.WriteAllText(Path.Combine(workspace.Path, "build.gradle"), ""); 893var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java")); 900var scriptPath = Path.Combine(workspace.Path, ".aspire", "aspire-gradle-init.gradle"); 905Assert.Equal(scriptPath, Path.GetFullPath(Path.Combine(appHostDirectory.FullName, initScriptArgument)));
Projects\LanguageInfoTests.cs (7)
65File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"), ""); 76File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp.csproj"), ""); 87var nested = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "AppHost"); 89File.WriteAllText(Path.Combine(nested, "apphost.cs"), ""); 101var deep = Path.Combine(workspace.WorkspaceRoot.FullName, "a", "b", "c", "d", "e", "f"); 103File.WriteAllText(Path.Combine(deep, "apphost.cs"), ""); 121var result = s_csharp.FindInDirectory(Path.Combine("C:", "NonExistent", "Dir"));
Projects\LegacyTypeScriptAppHostHelperTests.cs (3)
14File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"), "// legacy"); 23File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts"), "// legacy"); 24File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), "// modern");
Projects\NativeAppHostServerProjectTests.cs (37)
27var enabled = Directory.CreateDirectory(Path.Combine(workspace.Path, "enabled")); 29var disabled = Directory.CreateDirectory(Path.Combine(workspace.Path, "disabled")); 30var executable = Path.Combine(workspace.Path, "server"); 34var managedExecutable = Path.Combine(managedDirectory.FullName, 73var executable = Path.Combine(serverDirectory.FullName, "server"); 74var contract = Path.Combine(serverDirectory.FullName, "ats-contract.json"); 78var managed = Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName("aspire-managed")); 81var entryPoint = Path.Combine(providerDirectory.FullName, "host.mjs"); 83await File.WriteAllTextAsync(Path.Combine(providerDirectory.FullName, "metadata.json"), "{}"); 84await File.WriteAllTextAsync(Path.Combine(providerDirectory.FullName, "aspire.apphost-server.json"), 119Path.Combine(workspace.Path, "missing"), new TestProcessExecutionFactory(), new Aspire.Shared.TemporaryStorage(), NullLogger.Instance)); 126var executable = Path.Combine(workspace.Path, "server"); 138[IntegrationReference.FromProject("Aspire.Hosting.Redis", Path.Combine(workspace.Path, "Redis.csproj"))])); 149var executable = Path.Combine(workspace.Path, "server"); 153? IntegrationReference.FromProject(name, Path.Combine(workspace.Path, "tooling.csproj")) 163var executable = Path.Combine(workspace.Path, "server"); 176directory = Path.GetDirectoryName(start.Environment["REMOTE_APP_HOST_SOCKET_PATH"])!; 182Assert.False(Path.IsPathFullyQualified(start.Environment["REMOTE_APP_HOST_SOCKET_PATH"]!)); 206Assert.Equal(directory, Path.GetDirectoryName(finalSession.SocketPath)); 218var executable = Path.Combine(workspace.Path, "server"); 258var executable = Path.Combine(workspace.Path, "server"); 310var executable = Path.Combine(workspace.Path, "server"); 375var executable = Path.Combine(workspace.Path, "server"); 434var executable = Path.Combine(workspace.Path, "server"); 436var root = Directory.CreateDirectory(Path.Combine(workspace.Path, "provider")); 437var entryPoint = Path.Combine(root.FullName, "host.mjs"); 439await File.WriteAllTextAsync(Path.Combine(root.FullName, "aspire.apphost-server.json"), new JsonObject 447await File.WriteAllTextAsync(Path.Combine(workspace.Path, "outside.json"), "{}"); 461var executable = Path.Combine(workspace.Path, "server"); 462var managedDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "managed")); 464await File.WriteAllTextAsync(Path.Combine(managedDirectory.FullName, BundleDiscovery.GetExecutableFileName("aspire-managed")), ""); 465await File.WriteAllTextAsync(Path.Combine(workspace.Path, "ats-contract.json"), "{}"); 466var providerDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "provider")); 467var entryPoint = Path.Combine(providerDirectory.FullName, "host.mjs"); 469await File.WriteAllTextAsync(Path.Combine(providerDirectory.FullName, "metadata.json"), "{}"); 470await File.WriteAllTextAsync(Path.Combine(providerDirectory.FullName, "aspire.apphost-server.json"), 515var temporaryDirectory = Path.GetDirectoryName(firstOutput)!;
Projects\PrebuiltAppHostServerTests.cs (166)
38var path = Path.Combine(workspace.WorkspaceRoot.FullName, "IntegrationRestore.csproj"); 55var path = Path.Combine(workspace.WorkspaceRoot.FullName, "IntegrationRestore.csproj"); 68var path = Path.Combine(workspace.WorkspaceRoot.FullName, "IntegrationRestore.csproj"); 138var projectPath = Path.Combine(projectDirectory.FullName, "PackageDowngrade.csproj"); 153var nuGetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 232Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 269new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()) 301Assert.True(File.Exists(Path.Combine( 308Assert.True(File.Exists(Path.Combine( 353await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), $$""" 378var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 391new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()) 420Assert.Equal(expectedContent, await File.ReadAllTextAsync(Path.Combine(packagesDirectory.FullName, 554Path.Combine("/custom/output/path", "bin") + Path.DirectorySeparatorChar, 557"/custom/intermediate/path" + Path.DirectorySeparatorChar, 570var integrationProjectPath = Path.Combine(integrationDirectory.FullName, "MyIntegration.csproj"); 581var projectPath = Path.Combine(projectDirectory.FullName, "GeneratedClosure.csproj"); 582var nuGetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 600Path.Combine(projectDirectory.FullName, "Directory.Build.props"), 603Path.Combine(restoreDirectory.FullName, "obj"), 628Assert.True(File.Exists(Path.Combine(restoreDirectory.FullName, "obj", IntegrationClosureBuilder.ProjectAssetsFileName))); 629Assert.True(File.Exists(Path.Combine(restoreDirectory.FullName, "bin", "Debug", "net10.0", "GeneratedClosure.dll"))); 630Assert.False(Directory.Exists(Path.Combine(projectDirectory.FullName, "obj"))); 631Assert.False(Directory.Exists(Path.Combine(projectDirectory.FullName, "bin"))); 634Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName)); 635Assert.Equal(["MyIntegration.dll", "MyIntegration.pdb"], sourcePaths.Select(Path.GetFileName)); 639await File.ReadAllLinesAsync(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName))); 642await File.ReadAllLinesAsync(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureTargetsFileName))); 645await File.ReadAllLinesAsync(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ProjectRefAssemblyNamesFileName))); 675var projectIntegrationPath = Path.Combine(projectIntegrationDirectory.FullName, "ProjectIntegration.csproj"); 766.Save(Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config")); 781var generatedProjectPath = Path.Combine(generatedProjectDirectory.FullName, "IntegrationRestore.csproj"); 789Path.Combine(generatedProjectDirectory.FullName, "Directory.Build.props"), 792Path.Combine(restoreDirectory.FullName, "obj"), 794Path.Combine(workspace.WorkspaceRoot.FullName, "packages")).ToString()); 796Path.Combine(generatedProjectDirectory.FullName, "Directory.Packages.props"), 804var restoreConfig = XDocument.Load(Path.Combine( 845var projectNuGetConfigPath = Path.Combine( 859Path.Combine(restoreDirectory.FullName, "obj", IntegrationClosureBuilder.ProjectAssetsFileName))); 865Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName)); 867Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName)); 872Path.Combine("runtimes", RuntimeInformation.RuntimeIdentifier, "native", "hostnative.bin"), 897Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ClosureMetadataFileName), doc.Descendants(ns + "AspireClosureMetadataFile").FirstOrDefault()?.Value); 898Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ClosureSourcesFileName), doc.Descendants(ns + "AspireClosureSourcesFile").FirstOrDefault()?.Value); 899Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ClosureTargetsFileName), doc.Descendants(ns + "AspireClosureTargetsFile").FirstOrDefault()?.Value); 900Assert.Equal(Path.Combine("/tmp/work", IntegrationClosureBuilder.ProjectRefAssemblyNamesFileName), doc.Descendants(ns + "AspireProjectRefAssemblyNamesFile").FirstOrDefault()?.Value); 1013var rootDirectory = Path.Combine(normalizedWorkspaceRoot, ".aspire", "integrations", "apphosts"); 1015var parentDirectory = Path.GetDirectoryName(workingDirectory); 1228var firstAppHost = workspace.CreateDirectory(Path.Combine("apps", "api")); 1229var secondAppHost = workspace.CreateDirectory(Path.Combine("apps", "web")); 1243var appHostsRoot = Path.Combine(normalizedWorkspaceRoot, ".aspire", "integrations", "apphosts"); 1270var linkDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "linked-apphost"); 1286await File.WriteAllTextAsync(Path.Combine(lexicalWorkspace.FullName, AspireConfigFile.FileName), "{}"); 1288var linkedAppHostPath = Path.Combine(lexicalWorkspace.FullName, "apphost"); 1296Path.Combine(lexicalWorkspace.FullName, ".aspire", "integrations", "apphosts")) + Path.DirectorySeparatorChar, 1422Assert.True(Path.IsPathFullyQualified(gpfValue), $"globalPackagesFolder value must be an absolute path. Got: {gpfValue}"); 1439var expectedCachePath = Path.Combine( 1482Assert.True(Path.IsPathFullyQualified(gpfValue), $"globalPackagesFolder value must be an absolute path. Got: {gpfValue}"); 1497var expectedCachePath = Path.Combine( 1888var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 1910var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 1944var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 1975Assert.True(Path.IsPathFullyQualified(gpfValue), $"globalPackagesFolder value must be an absolute path. Got: {gpfValue}"); 1993var expectedCachePath = Path.Combine( 2003var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 2032var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "integration-packages"); 2127var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 2153var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 2196var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 2218var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 2240var packageSourceOverride = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-packages"); 2373new(new DirectoryInfo(Path.GetTempPath()), 2374new DirectoryInfo(Path.Combine(Path.GetTempPath(), "hives")), 2375new DirectoryInfo(Path.Combine(Path.GetTempPath(), "cache")), 2376new DirectoryInfo(Path.Combine(Path.GetTempPath(), "sdks")), 2377new DirectoryInfo(Path.Combine(Path.GetTempPath(), "logs")), 2401new TestConfigurationService { SettingsFilePath = Path.Combine(workspace.Path, "global.json") }, new Aspire.Shared.TemporaryStorage()) 2507var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2541var appSettingsPath = Path.Combine(workingDirectory, "appsettings.json"); 2575Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "integrations", "package-restore")), 2620Path.Combine("aspire-pr-hive", "packages")).FullName; 2682Path.Combine("aspire-pr-hive", "packages")).FullName; 2714var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2763var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2813var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2863var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2910var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2952var missingPackageSource = Path.Combine(workspace.WorkspaceRoot.FullName, "this-hive-was-deleted"); 2954var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 3005var packageSourceOverride = Path.Combine( 3011var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 3077var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 3160var policyConfigPath = Path.Combine( 3164Directory.CreateDirectory(Path.GetDirectoryName(policyConfigPath)!); 3215Assert.False(File.Exists(Path.Combine(workingDirectory, "integration-restore", "NuGet.Config"))); 3236var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 3242var ambientConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 3373Assert.True(File.Exists(Path.Combine( 3377var directoryBuildProps = XDocument.Load(Path.Combine( 3382Path.Combine(workspace.WorkspaceRoot.FullName, AspireJsonConfiguration.SettingsFolder), 3429Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 3518Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 3579Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"), 3644var ambientConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 3694var ambientConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 3760Assert.True(Directory.Exists(Path.GetDirectoryName(server.IntegrationProbeManifestPath))); 3774var ambientConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 3851var ambientConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NuGet.Config"); 4049var restoreDirectory = Path.Combine(workingDirectory, IntegrationClosureBuilder.IntegrationRestoreFolderName); 4051Path.Combine(restoreDirectory, PrebuiltAppHostServer.IntegrationProjectFileName)); 4052var intermediateOutputPath = Path.Combine(restoreDirectory, "obj"); 4053dependencyGraphSpecPath = Path.Combine( 4198var aspireConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 4259var packageSourceOverride = Path.Combine( 4451Assert.True(File.Exists(Path.Combine(layoutPath, "libs", "MyIntegration.dll"))); 4454Assert.Equal(Path.Combine(layoutPath, "libs"), startInfo.Environment[KnownConfigNames.IntegrationLibsPath]); 4488Assert.Single(Directory.GetDirectories(Path.Combine(workingDirectory, "project-layouts", "items"))); 4524var copiedLibs = Directory.GetFiles(Path.Combine(layoutPath, "libs"), "*", SearchOption.AllDirectories) 4525.Select(path => Path.GetRelativePath(Path.Combine(layoutPath, "libs"), path).Replace('\\', '/')) 4533Path.Combine(workingDirectory, IntegrationPackageProbeManifest.FileName), 4542var generatedProject = XDocument.Load(Path.Combine(workingDirectory, "integration-restore", PrebuiltAppHostServer.IntegrationProjectFileName)); 4556await Verify(await File.ReadAllTextAsync(Path.Combine(workingDirectory, "appsettings.json")), "json"); 4680var copiedLibs = Directory.GetFiles(Path.Combine(layoutPath, "libs"), "*", SearchOption.AllDirectories) 4681.Select(path => Path.GetRelativePath(Path.Combine(layoutPath, "libs"), path).Replace('\\', '/')) 4759var copiedFilePath = Path.Combine(layoutPath, "libs", "MyIntegration.dll"); 4767Assert.Single(Directory.GetDirectories(Path.Combine(workingDirectory, "project-layouts", "items"))); 4796var lockedFilePath = Path.Combine(firstLayoutPath, "libs", "MyIntegration.dll"); 4808Assert.True(File.Exists(Path.Combine(secondLayoutPath, "libs", "MyIntegration.dll"))); 4824var firstSourcePath = Path.Combine(firstPackageRoot.FullName, "Aspire.Hosting.Redis.dll"); 4825var secondSourcePath = Path.Combine(secondPackageRoot.FullName, "Aspire.Hosting.Redis.dll"); 4869var firstPackagePath = Path.Combine(firstPackageRoot.FullName, "Aspire.Hosting.Redis.dll"); 4870var secondPackagePath = Path.Combine(secondPackageRoot.FullName, "Aspire.Hosting.Redis.dll"); 4871var projectPath = Path.Combine(projectRoot.FullName, "MyIntegration.dll"); 4918var sourcePath = Path.Combine(restoreDirectory.FullName, "MyIntegration.dll "); 4922Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName), 4925Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName), 4928Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureTargetsFileName), 4930var intermediateOutputPath = Path.Combine(restoreDirectory.FullName, "obj"); 4935Path.Combine(intermediateOutputPath, IntegrationClosureBuilder.ProjectAssetsFileName), 4967var packageSourcePath = Path.Combine(workingDirectory, "integration-restore", "closure-sources", "Aspire.Hosting.Redis.dll"); 4973Assert.Single(Directory.GetDirectories(Path.Combine(workingDirectory, "project-layouts", "items"))); 5040File.WriteAllText(Path.Combine(terminalDirectory.FullName, BundleDiscovery.GetExecutableFileName(BundleDiscovery.TerminalHostExecutableName)), "native"); 5042Path.Combine( 5093var sourcePath = Path.Combine(sourceRoot.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 5094var sourcePathDirectory = Path.GetDirectoryName(sourcePath); 5106targetPaths.Add(relativePath.Replace('/', Path.DirectorySeparatorChar)); 5113File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureMetadataFileName), metadataLines); 5114File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureSourcesFileName), sourcePaths); 5115File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ClosureTargetsFileName), targetPaths); 5116File.WriteAllLines(Path.Combine(restoreDirectory.FullName, IntegrationClosureBuilder.ProjectRefAssemblyNamesFileName), projectReferenceAssemblyNames); 5135var packagePath = Path.Combine(feedDirectory.FullName, $"{packageId}.{packageVersion}.nupkg"); 5175var document = XDocument.Load(Path.Combine(restoreDirectory.FullName, "Directory.Build.props")); 5213Path.Combine(intermediateOutputPath, $"{generatedProjectFile.Name}.nuget.dgspec.json"), 5249File.WriteAllText(Path.Combine(objDirectory.FullName, "project.assets.json"), projectAssetsContent); 5345var dashboardPath = Path.Combine( 5414var props = XDocument.Load(Path.Combine(projectFilePath.DirectoryName!, "Directory.Build.props")); 5419return XDocument.Load(Path.Combine(policyDirectory, "NuGet.Config"));
Projects\ProcessGuestLauncherTests.cs (7)
66new DirectoryInfo(Path.GetTempPath()), 126new DirectoryInfo(Path.GetTempPath()), 189new DirectoryInfo(Path.GetTempPath()), 219var descendantPidFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "descendant.pid")); 311new DirectoryInfo(Path.GetTempPath()), 353var scriptFile = new FileInfo(Path.Combine(workspaceRoot.FullName, "spawn-descendant.ps1")); 367var shellFile = new FileInfo(Path.Combine(workspaceRoot.FullName, "spawn-descendant.sh"));
Projects\ProjectLocatorTests.cs (315)
41var appHostFile = new FileInfo(Path.Combine(directory.FullName, "apphost.cs")); 73var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 77var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 80var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 104var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 108var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 111var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 133var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 137var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 140var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 166var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 170var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 173var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 199var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 203var firstAlternative = new FileInfo(Path.Combine(alternativesDirectory.FullName, "FirstAlternative.csproj")); 205var secondAlternative = new FileInfo(Path.Combine(alternativesDirectory.FullName, "SecondAlternative.csproj")); 208var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 232var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 236var alternativeAppHost = new FileInfo(Path.Combine(alternativeDirectory.FullName, "Alternative.csproj")); 239var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 261var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 264var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 285var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 288var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 310var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, $"AppHost{index}.csproj")); 315var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 365var configuredPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"); 367var differentlyCasedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.csproj"); 382var configuredPath = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"); 384var differentlyCasedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.csproj"); 400var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 404var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 407var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 431var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 435var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 438var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 467var firstAppHostProjectFile = new FileInfo(Path.Combine(firstAppHostDirectory.FullName, "FirstAppHost.csproj")); 471var secondAppHostProjectFile = new FileInfo(Path.Combine(secondAppHostDirectory.FullName, "SecondAppHost.csproj")); 474var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 516var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 538var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 559Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName))); 570var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj")); 574var decoyAppHost = new FileInfo(Path.Combine(decoyDirectory.FullName, "HealthyAppHost.csproj")); 577var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire")); 579var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json")); 582appHostPath = Path.GetRelativePath(aspireSettingsDir.FullName, brokenAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 595var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json")); 609Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName))); 620var outsideAppHost = new FileInfo(Path.Combine(outsideDirectory.FullName, "OutsideAppHost.csproj")); 624var configPath = Path.Combine(workingDirectory.FullName, AspireConfigFile.FileName); 629path = Path.GetRelativePath(workingDirectory.FullName, outsideAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 658var appHostFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 690var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Missing.csproj")); 721var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebApp.csproj")); 750var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 754var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj")); 758var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 763appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName) 783var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 787var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 792appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName) 814var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 818var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 823appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName) 841var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj")); 846var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 882var staleProjectFile = new FileInfo(Path.Combine(staleProjectDirectory.FullName, "StaleProject.csproj")); 885var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj")); 889var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 894appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, staleProjectFile.FullName) 935var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 958var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 993var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 997var decoyAppHostProjectFile = new FileInfo(Path.Combine(decoyAppHostDirectory.FullName, "DecoyAppHost.csproj")); 1000var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1005path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, targetAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/') 1031var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 1035var decoyAppHostProjectFile = new FileInfo(Path.Combine(decoyAppHostDirectory.FullName, "DecoyAppHost.csproj")); 1038var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1043path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, targetAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/') 1068var guestAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 1071var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1105var configuredAppHostProjectFile = new FileInfo(Path.Combine(configuredAppHostDirectory.FullName, "ConfiguredAppHost.csproj")); 1108var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj")); 1111var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1116path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/') 1158var configuredAppHostProjectFile = new FileInfo(Path.Combine(configuredAppHostDirectory.FullName, "ConfiguredAppHost.csproj")); 1161var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj")); 1164var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1169path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/') 1210var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 1214var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj")); 1217var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1222path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, targetAppHostProjectFile.FullName).Replace(Path.DirectorySeparatorChar, '/') 1247var settingsAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SettingsAppHost.csproj")); 1253var configPath = Path.Combine(workingDirectory.FullName, AspireConfigFile.FileName); 1278Assert.Contains(Path.Join("..", "SettingsAppHost.csproj"), displayedSubtleMessages); 1286var firstAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "First", "AppHost.csproj")); 1290var secondAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Second", "AppHost.csproj")); 1294var thirdAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Third", "AppHost.csproj")); 1347Assert.Equal(Path.Join("First", "AppHost.csproj"), recordedEvents[2]); 1348Assert.Contains(Path.Join("Second", "AppHost.csproj"), recordedEvents[3]); 1349Assert.Contains(Path.Join("Third", "AppHost.csproj"), recordedEvents[4]); 1364await File.WriteAllTextAsync(Path.Combine(directory.FullName, "AppHost.csproj"), "Not a real apphost"); 1409var settingsAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.custom")); 1412var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1444var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj")); 1448var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 1451var relativePath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName); 1452var forwardSlashPath = relativePath.Replace(Path.DirectorySeparatorChar, '/'); 1474var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj")); 1477var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj")); 1492var appHostProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1495var webProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebProject.csproj")); 1539var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectFileExtension}")); 1557var onDiskProjectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj")); 1590var onDiskProjectFile = new FileInfo(Path.Combine(realDirectory.FullName, "RealAppHost.csproj")); 1593var linkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "LinkedAppHost"); 1596var linkedProjectFile = new FileInfo(Path.Combine(linkDirectory, onDiskProjectFile.Name)); 1621var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 1636var legacyAppHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.ts")); 1637var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts")); 1640await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), JsonSerializer.Serialize(new 1649var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"); 1675var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 1684var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"); 1695var settingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)); 1712var appHostFile = new FileInfo(Path.Combine(srcDirectory.FullName, "apphost.ts")); 1715var adjacentConfigPath = Path.Combine(srcDirectory.FullName, AspireConfigFile.FileName); 1739var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json")); 1760Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName))); 1779var appHost1File = new FileInfo(Path.Combine(appHost1Directory.FullName, "apphost.ts")); 1781var appHost1ConfigPath = Path.Combine(appHost1Directory.FullName, AspireConfigFile.FileName); 1791var appHost2File = new FileInfo(Path.Combine(appHost2Directory.FullName, "apphost.ts")); 1793var appHost2ConfigPath = Path.Combine(appHost2Directory.FullName, AspireConfigFile.FileName); 1808var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json")); 1830Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName))); 1849var appHostFile = new FileInfo(Path.Combine(srcDirectory.FullName, "apphost.ts")); 1863var globalSettingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json")); 1884Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName))); 1898var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "MyAppHost.csproj")); 1905var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire")); 1906var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json")); 1907var relativeAppHostPath = Path 1909.Replace(Path.DirectorySeparatorChar, '/'); 1913var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json"); 1928var aspireConfigFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 1942var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 1967var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs")); 1993var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs")); 2003var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj")); 2008var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs")); 2048var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2068var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj")); 2073var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs")); 2109var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2136var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2160var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2182var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2209var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, fileName)); 2231var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2234var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2257var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 2268var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj")); 2283var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt")); 2303var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 2308var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs")); 2380? Path.Combine(executionContext.HomeDirectory.FullName, ".aspire", AspireConfigFile.FileName) 2381: Path.Combine(executionContext.WorkingDirectory.FullName, AspireConfigFile.FileName); 2495var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj")); 2554var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "UnbuildableAppHost.csproj")); 2572Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName))); 2584var first = new FileInfo(Path.Combine(firstProjectDirectory.FullName, "FirstAppHost.csproj")); 2587var second = new FileInfo(Path.Combine(secondProjectDirectory.FullName, "SecondAppHost.csproj")); 2624var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj")); 2629var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2634path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, brokenAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 2666var healthyAppHost = new FileInfo(Path.Combine(healthyDirectory.FullName, "HealthyAppHost.csproj")); 2671var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj")); 2674var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2679path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, healthyAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 2707var configuredAppHost = new FileInfo(Path.Combine(configuredDirectory.FullName, "ConfiguredAppHost.csproj")); 2712var firstAppHost = new FileInfo(Path.Combine(firstDirectory.FullName, "FirstAppHost.csproj")); 2715var secondAppHost = new FileInfo(Path.Combine(secondDirectory.FullName, "SecondAppHost.csproj")); 2718var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2723path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 2752var unsupportedAppHost = new FileInfo(Path.Combine(unsupportedDirectory.FullName, "UnsupportedAppHost.csproj")); 2757var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2762path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, unsupportedAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 2792var directory = new DirectoryInfo(Path.Combine(Path.GetPathRoot(Environment.CurrentDirectory)!, "repo", "Apps")); 2793var file = new FileInfo(Path.Combine(Path.GetPathRoot(Environment.CurrentDirectory)!, "repo", "apps", "AppHost.csproj")); 2808var appHostFile = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj")); 2811var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 2826var brokenAppHost = new FileInfo(Path.Combine(brokenDirectory.FullName, "BrokenAppHost.csproj")); 2830var firstHealthy = new FileInfo(Path.Combine(firstHealthyDirectory.FullName, "FirstHealthyAppHost.csproj")); 2834var secondHealthy = new FileInfo(Path.Combine(secondHealthyDirectory.FullName, "SecondHealthyAppHost.csproj")); 2837var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 2842path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, brokenAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 2876var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj")); 2878var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj")); 2913var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs")); 2941var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj")); 2980var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj")); 2985var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "AppHost.cs")); 3023var csprojFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyApp.AppHost.csproj")); 3027var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs")); 3065var appHostCsFile = new FileInfo(Path.Combine(appHostDir.FullName, "apphost.cs")); 3088var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3109var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3131var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 3183var normalProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp", "AppHost.csproj")); 3188var nugetCacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".nuget", "packages", 3191var cachedProject = new FileInfo(Path.Combine(nugetCacheDir, "Aspire.AppHost1.csproj")); 3201["NUGET_PACKAGES"] = Path.Combine(workspace.WorkspaceRoot.FullName, ".nuget", "packages") 3220var project1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "App1", "AppHost.csproj")); 3224var project2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "samples", "App2", "AppHost.csproj")); 3251var normalProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "MyApp", "AppHost.csproj")); 3256var customCacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, "custom-nuget-cache"); 3257var cachedProjectDir = Path.Combine(customCacheDir, "aspire.projecttemplates", "9.1.0", "content"); 3259var cachedProject = new FileInfo(Path.Combine(cachedProjectDir, "Aspire.AppHost1.csproj")); 3288var customCacheDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache"); 3291var siblingDir = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget-cache-extra", "MyApp"); 3293var siblingProject = new FileInfo(Path.Combine(siblingDir, "AppHost.csproj")); 3297var cachedProjectDir = Path.Combine(customCacheDir, "aspire.projecttemplates", "9.1.0", "content"); 3299var cachedProject = new FileInfo(Path.Combine(cachedProjectDir, "Aspire.AppHost1.csproj")); 3329var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "MyAppHost.csproj")); 3352var appHost1File = new FileInfo(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj")); 3358var appHost2File = new FileInfo(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj")); 3382var appHostFile = new FileInfo(Path.Combine(appHostDir.FullName, "RealAppHost.csproj")); 3406await File.WriteAllTextAsync(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj"), "Not a real apphost"); 3409await File.WriteAllTextAsync(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj"), "Not a real apphost"); 3427var appHost1File = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj")); 3430var appHost2File = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj")); 3433var slowValidationFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SlowValidation.csproj")); 3486var appHost1File = new FileInfo(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj")); 3490var appHost2File = new FileInfo(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj")); 3494var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire")); 3496var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json")); 3497var relativeAppHostPath = Path 3499.Replace(Path.DirectorySeparatorChar, '/'); 3519var appHost1File = new FileInfo(Path.Combine(appHost1Dir.FullName, "AppHost1.csproj")); 3523var appHost2File = new FileInfo(Path.Combine(appHost2Dir.FullName, "AppHost2.csproj")); 3527var aspireSettingsDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire")); 3529var aspireSettingsFile = new FileInfo(Path.Combine(aspireSettingsDir.FullName, "settings.json")); 3530var relativeAppHostPath = Path 3532.Replace(Path.DirectorySeparatorChar, '/'); 3553var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3558var staleAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj")); 3581var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3585var staleAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj")); 3610var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3614var skipListedAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj")); 3641await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, fileName), """ 3650var projectFile = new FileInfo(Path.Combine(searchDirectory.FullName, fileName)); 3685var buildableAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Buildable", "AppHost.csproj")); 3689var unbuildableAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Unbuildable", "AppHost.csproj")); 3724var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3729var staleAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj")); 3764var configuredAppHost = new FileInfo(Path.Combine(configuredDirectory.FullName, "ConfiguredAppHost.csproj")); 3768var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 3773path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/') 3800var appHost = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 3802await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), """ 3832var trackedAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3836var ignoredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "legacy", "Stale.csproj")); 3867var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3872var nodeModulesAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "foo", "AppHost.csproj")); 3904var realAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "App", "AppHost.csproj")); 3909var phantomAppHost = Path.Combine(workspace.WorkspaceRoot.FullName, "Removed", "AppHost.csproj"); 3961var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 3965var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 3971appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, appHostProjectFile.FullName) 3999var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4028var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.unknown")); 4032var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4038appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, appHostProjectFile.FullName) 4061var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 4065var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4071appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, appHostProjectFile.FullName) 4109var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4144var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 4175var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4202var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 4227var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4252var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 4282var settingsPath = Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"); 4309var settingsPath = Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"); 4336var settingsPath = Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"); 4374var realAppHost = new FileInfo(Path.Combine(realAppDirectory.FullName, "AppHost.csproj")); 4381var linkDirectory = Path.Combine(nodeModulesDir.FullName, "link"); 4395var pathThroughLink = Path.Combine(linkDirectory, "AppHost.csproj"); 4403var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json")); 4446var appHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 4449var differentlyCasedPath = Path.Combine(workspace.WorkspaceRoot.FullName, "APPHOST.csproj"); 4457var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 4480var configuredAppHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "node_modules", "Configured", "AppHost.csproj")); 4484var configPath = Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName); 4489path = Path.GetRelativePath(workspace.WorkspaceRoot.FullName, configuredAppHost.FullName).Replace(Path.DirectorySeparatorChar, '/')
Projects\ProjectUpdaterNuGetConfigurationTests.cs (59)
57var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 84json["Properties"]![overriddenProperty] = Path.Combine(workspace.WorkspaceRoot.FullName, "custom-policy"); 110Assert.Empty(Directory.EnumerateDirectories(Path.Combine(workspace.Path, ".aspire"), ".aspire-nuget-config-*")); 152Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"))); 153Assert.Empty(Directory.EnumerateDirectories(Path.Combine(workspace.Path, ".aspire"), ".aspire-nuget-config-*")); 177projectFile.MoveTo(Path.Combine(workspace.CreateDirectory("AppHost").FullName, fileName)); 179var configPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 217var restoreDirectory = Path.GetDirectoryName(packagesDirectory)!; 218Assert.Equal(validationRoot, Path.GetDirectoryName(restoreDirectory)); 233validationRoot = Path.Combine( 278var restoreDirectory = Path.GetDirectoryName(packagesDirectory)!; 295var propsPath = Path.Combine(workspace.Path, "Directory.Build.props"); 404var aspireConfigPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 520Assert.Empty(Directory.EnumerateDirectories(Path.Combine(workspace.Path, ".aspire"), ".aspire-nuget-config-*")); 550Assert.False(File.Exists(Path.Combine(workspace.Path, "nuget.config"))); 551Assert.Empty(Directory.EnumerateDirectories(Path.Combine(workspace.Path, ".aspire"), ".aspire-nuget-config-*")); 579var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 587var projectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj")); 594var webProject = new FileInfo(Path.Combine(webDirectory.FullName, "Web.csproj")); 662Assert.True(File.Exists(Path.Combine(globalPackagesFolder, "aspire.apphost.sdk", newVersion, "Sdk", "Sdk.props"))); 682var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 690var projectFile = new FileInfo(Path.Combine(workspace.Path, "apphost.cs")); 700var aspireConfigPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 782var file = new FileInfo(Path.Combine(workspace.Path, fileName)); 812await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), 859Assert.Empty(Directory.EnumerateDirectories(Path.Combine(workspace.Path, ".aspire"), ".aspire-nuget-config-*")); 894var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 974var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 1081[configFile.FullName, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet.Config")]); 1103await File.WriteAllTextAsync(Path.Combine(workspace.Path, AspireConfigFile.FileName), 1133var aspireConfigPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1146[configFile.FullName, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet.Config")]); 1198projectFile.MoveTo(Path.Combine(workspace.CreateDirectory("AppHost").FullName, projectFile.Name)); 1203var parentConfig = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 1215var configFile = new FileInfo(Path.Combine(projectFile.DirectoryName!, "NuGet.Config")); 1233await File.WriteAllTextAsync(Path.Combine(projectFile.DirectoryName!, AspireConfigFile.FileName), 1364var aspireConfigPath = Path.Combine(workspace.Path, AspireConfigFile.FileName); 1405[configFile.FullName, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet.Config")]); 1501Assert.Empty(Directory.EnumerateDirectories(Path.Combine(workspace.Path, ".aspire"), ".aspire-nuget-config-*")); 1521project.MoveTo(Path.Combine(appHostDirectory.FullName, fileName)); 1524var configPath = Path.Combine( 1533Assert.StartsWith(Path.Combine(appHostDirectory.FullName, ".aspire") + Path.DirectorySeparatorChar, directory.FullName); 1539? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet") 1540: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet"); 1546: [Path.Combine(globalConfigDirectory, "NuGet.Config")]); 1566Assert.StartsWith(Path.Combine(appHostDirectory.FullName, ".aspire") + Path.DirectorySeparatorChar, 1611Assert.Equal(Path.GetDirectoryName(configPath), Assert.Single(interaction.FilePathPromptCalls).DefaultValue); 1636var propsFile = new FileInfo(Path.Combine(workspace.Path, "Directory.Packages.props")); 1691await File.WriteAllTextAsync(Path.Combine(workspace.Path, "NuGet.Config"), 1694var childDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "Child")); 1698await File.WriteAllTextAsync(Path.Combine(childDirectory.FullName, "NuGet.Config"), 1787var configFile = new FileInfo(Path.Combine(workspace.Path, "NuGet.Config")); 1821var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 1870var configPath = Path.Combine(workspace.Path, "NuGet.Config"); 1938projectFile.MoveTo(Path.Combine(directory.FullName, projectFile.Name)); 1939var parentPath = Path.Combine(workspace.Path, "NuGet.Config"); 1954var configPath = Path.Combine(directory.FullName, "NuGet.Config");
Projects\ProjectUpdaterTests.cs (96)
34var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs")); 69var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{extension}")); 72var importedFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"); 194var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "apphost.cs" : $"AppHost{extension}")); 209await File.WriteAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"), 219? await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props")) 221var configFile = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"); 223var cpmFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"); 258var syntheticProject = Path.Combine(workspace.Path, "generated", "apphost.cs.csproj"); 264document.WithProperty("DirectoryBuildPropsPath", Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props")); 266Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"); 304Assert.Equal(importedContent, await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"))); 323var props = System.Xml.Linq.XDocument.Load(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props")); 351var appHost = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 403var appHostProject = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj")); 406var symlinkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 408var appHostProjectViaSymlink = new FileInfo(Path.Combine(symlinkDirectory, appHostProject.Name)); 420var lowerCaseProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.csproj")); 422var upperCaseProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 439var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 442var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 445var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 549var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 552var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 555var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 568var aspireConfigFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")); 717var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 720var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 723var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 735var aspireConfigFile = new FileInfo(Path.Combine(appHostFolder.FullName, "aspire.config.json")); 824var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 827var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj")); 830var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 840var aspireConfigFile = new FileInfo(Path.Combine(appHostFolder.FullName, "aspire.config.json")); 999var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1119var sharedProjectFile = new FileInfo(Path.Combine(sharedProjectFolder.FullName, "SharedProject.csproj")); 1122var projectAFile = new FileInfo(Path.Combine(projectAFolder.FullName, "ProjectA.csproj")); 1125var projectBFile = new FileInfo(Path.Combine(projectBFolder.FullName, "ProjectB.csproj")); 1128var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "DiamondTest.AppHost.csproj")); 1252var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj")); 1255var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1257var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1388var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1390var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1491var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1493var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1613var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1615var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1724var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1803var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1880var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 1881var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 1980Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"))); 1981Assert.False(File.Exists(Path.Combine(appHostProjectFile.DirectoryName!, "nuget.config"))); 1995var nugetConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 2022Assert.StartsWith(Path.Combine(appHostProjectFile.DirectoryName!, ".aspire") + Path.DirectorySeparatorChar, workingDirectory.FullName); 2032Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet", "NuGet.Config") 2063Assert.True(File.Exists(Path.Combine(appHostProjectFile.DirectoryName!, "nuget.config"))); 2069var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2230var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2232var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 2343var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2345var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 2467var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2469var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 2581var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2583var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 2692var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2786var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2788var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 2888var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 2968var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 3050var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs")); 3143var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs")); 3237var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs")); 3313var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs")); 3395var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 3481var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 3559var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 3637var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 3770var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 3772var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props")); 3897var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 3930var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 3962var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 3999var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 4035var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 4068var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 4105var projectFile = Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectExtension}"); 4123var directoryPackagesPropsFile = Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"); 4175var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "Issue15891.AppHost.csproj")); 4294var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 4371var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj")); 4425var existingConfigFile = new FileInfo(Path.Combine(executionContext.WorkingDirectory.FullName, "nuget.config")); 4457var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
Projects\RepositoryToolUpdaterTests.cs (23)
26var workingDirectory = root.CreateSubdirectory(Path.Combine("src", "app")); 60var unrelatedPath = Path.Combine(child.CreateSubdirectory(".config").FullName, "dotnet-tools.json"); 80var rootManifestPath = Path.Combine(child.CreateSubdirectory(".config").FullName, "dotnet-tools.json"); 105var gitPath = Path.Combine(root.FullName, ".git"); 142var unrelatedPath = Path.Combine(child.FullName, "package.json"); 167var link = Path.Combine(root.FullName, directoryLink ? ".config" : "package.json"); 169var alias = Path.Combine(workspace.WorkspaceRoot.FullName, "alias"); 193var manifestPath = Path.Combine(configDirectory.FullName, "dotnet-tools.json"); 212var unrelatedPath = Path.Combine(root.FullName, "package.json"); 215var workingDirectory = root.CreateSubdirectory(Path.Combine("src", "app")); 216var localManifestPath = Path.Combine(workingDirectory.CreateSubdirectory(".config").FullName, "dotnet-tools.json"); 253var manifestPath = Path.Combine(root.FullName, "package.json"); 317var lockPath = Path.Combine(root.FullName, "package-lock.json"); 385Assert.False(File.Exists(Path.Combine(root.FullName, "package-lock.json"))); 386Assert.False(File.Exists(Path.Combine(root.FullName, "npm-shrinkwrap.json"))); 461var lockPath = Path.Combine(root.FullName, "package-lock.json"); 552var path = Path.Combine(root.FullName, isNpm ? "package.json" : "dotnet-tools.json"); 576var lockPath = Path.Combine(root.FullName, "package-lock.json"); 609var dotNetPath = Path.Combine(root.FullName, "dotnet-tools.json"); 610var npmPath = Path.Combine(root.FullName, "package.json"); 731var path = Path.Combine(directory.FullName, isNpm ? "package.json" : "dotnet-tools.json"); 762var packageLockPath = Path.Combine(directory.FullName, "package-lock.json"); 763var shrinkwrapPath = Path.Combine(directory.FullName, "npm-shrinkwrap.json");
Projects\RunningInstanceManagerTests.cs (1)
42var socketPath = Path.Combine(socketDirectory.FullName, "a.sock");
Projects\TypeScriptAppHostToolchainResolverTests.cs (41)
18File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }"); 29File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"deno@2.9.0\" }"); 42var packageJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"); 57File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 58File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "deno.lock"), "{ \"version\": \"5\" }"); 70File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 71File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "deno.json"), "{}"); 83File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 84File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "deno.jsonc"), "{ /* Deno configuration */ }"); 96File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 97File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "pnpm-lock.yaml"), "lockfileVersion: '9.0'"); 108var packageJsonPath = Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"); 120File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"yarn@4.14.1\" }"); 131File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 132var yarnLockPath = Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock"); 146File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 147File.WriteAllText(Path.Combine(parentDirectory.FullName, "package.json"), "{ \"name\": \"workspace\" }"); 148var yarnLockPath = Path.Combine(parentDirectory.FullName, "yarn.lock"); 162File.WriteAllText(Path.Combine(parentDirectory.FullName, "package.json"), "{ \"name\": \"workspace\" }"); 163File.WriteAllText(Path.Combine(parentDirectory.FullName, "yarn.lock"), string.Empty); 164File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 165File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package-lock.json"), "{}"); 177File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 178File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package-lock.json"), "{}"); 179File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock"), string.Empty); 191File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 192Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".yarn")); 203File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 214File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 215File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "yarn.lock"), string.Empty); 234File.WriteAllText(Path.Combine(appHostDirectory.Parent!.FullName, "package.json"), "{ \"packageManager\": \"pnpm@10.12.1\" }"); 235File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 248File.WriteAllText(Path.Combine(appHostDirectory.Parent!.FullName, "package.json"), "{ \"packageManager\": \"pnpm@10.12.1\" }"); 249File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }"); 254Assert.Equal($"packageManager 'bun@1.2.0' found in {Path.Combine(appHostDirectory.FullName, "package.json")}", resolution.Reason); 263File.WriteAllText(Path.Combine(appHostDirectory.Parent!.FullName, "package.json"), "{ \"packageManager\": \"yarn@4.14.1\" }"); 264File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"name\": \"apphost\" }"); 265File.WriteAllText(Path.Combine(appHostDirectory.FullName, "pnpm-lock.yaml"), "lockfileVersion: '9.0'"); 277File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }"); 289var directory = new DirectoryInfo(Path.GetPathRoot(Path.GetTempPath())!);
Scaffolding\DefaultHostingPackagesTests.cs (8)
66Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), 83Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 103Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json"), 138var configPath = Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates", template, "aspire.config.json"); 155var sourceDirectory = Path.Combine(GetRepoRoot(), "src"); 161var projectPath = Path.Combine(sourceDirectory, package, $"{package}.csproj"); 185=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Scaffolding\ScaffoldingServiceTests.cs (15)
41File.WriteAllText(Path.Combine(rootDirectory.FullName, "go.mod"), "module existing\n\ngo 1.26\n"); 47hasModule ? Path.Combine(rootDirectory.FullName, "aspire-apphost") : rootDirectory.FullName, 50Path.Combine(scaffoldDirectory.FullName, "apphost.go"), 66File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{}"); 71Path.Combine(rootDirectory.FullName, ScaffoldingService.BrownfieldTypeScriptAppHostDirectoryName), 104File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{}"); 186var appHostDirectory = Directory.CreateDirectory(Path.Combine(rootDirectory.FullName, ScaffoldingService.BrownfieldTypeScriptAppHostDirectoryName)); 187File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{ \"packageManager\": \"npm@10.0.0\" }"); 188File.WriteAllText(Path.Combine(appHostDirectory.FullName, "package.json"), "{ \"packageManager\": \"pnpm@10.0.0\" }"); 258var scaffoldDirectory = Directory.CreateDirectory(Path.Combine(rootDirectory.FullName, ScaffoldingService.BrownfieldTypeScriptAppHostDirectoryName)); 281File.WriteAllText(Path.Combine(rootDirectory.FullName, ".gitignore"), "node_modules/\n"); 282File.WriteAllText(Path.Combine(rootDirectory.FullName, "package.json"), "{}"); 283File.WriteAllText(Path.Combine(rootDirectory.FullName, "apphost.mts"), string.Empty); 320Directory.CreateDirectory(Path.Combine(rootDirectory.FullName, ".vscode")); 321File.WriteAllText(Path.Combine(rootDirectory.FullName, ".vscode", "settings.json"), "{}");
Secrets\SecretsStoreTests.cs (7)
14_tempDir = Path.Combine(Path.GetTempPath(), $"aspire-test-{Guid.NewGuid():N}"); 26private string GetSecretsPath() => Path.Combine(_tempDir, "secrets.json"); 114var dir = Path.GetDirectoryName(path)!; 136var dir = Path.GetDirectoryName(path)!; 166var dir = Path.GetDirectoryName(path)!; 201var path = Path.Combine(_tempDir, "nested", "dir", "secrets.json");
Secrets\SecretStoreResolverTests.cs (19)
24var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 54var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 103var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 142var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 189var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")); 264var upperPath = Path.Combine("work", "Foo", "AppHost.csproj"); 265var lowerPath = Path.Combine("work", "foo", "AppHost.csproj"); 281Assert.Equal(Path.Combine(homeDirectory.FullName, ".aspire", "secrets", "apphost-id", "Production.json"), path); 326Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "secrets", "apphost-id", $"{environment}.json"), 361File.WriteAllText(Path.Combine(directory, "Production.json"), "{}"); 362File.WriteAllText(Path.Combine(directory, "production.json"), "{}"); 410Assert.Equal(segment, Path.GetFileName(Path.GetDirectoryName(path))); 426var directory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "shared")); 431var path = Path.Combine(directory.FullName, "secrets.json"); 463var path = Path.Combine(workspace.WorkspaceRoot.FullName, "secrets.json"); 500var directory = Path.Combine(workspace.WorkspaceRoot.FullName, "new", "nested"); 501var path = Path.Combine(directory, "secrets.json"); 521var projectPath = Path.Combine(directory.FullName, "AppHost.csproj");
Telemetry\ActivityTagEnrichmentProcessorTests.cs (3)
20using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 66using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}"); 107using var source = new ActivitySource($"Test.{Path.GetRandomFileName()}");
Telemetry\AgentTelemetryPersistenceTests.cs (1)
398var lockPath = Path.Combine(workspace.Path, "uploader.lock");
Telemetry\AgentTelemetryUploaderTests.cs (5)
17var pending = Path.Combine(storage, "pending"); 18var lockPath = Path.Combine(workspace.Path, "uploader.lock"); 42var lockPath = Path.Combine(workspace.Path, "uploader.lock"); 53var pending = Path.Combine(storage, "pending"); 54var lockPath = Path.Combine(workspace.Path, "uploader.lock");
Telemetry\InternalMicrosoftDetectorTests.cs (66)
43var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 44Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!); 85var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 111var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 112Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!); 135var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 136Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!); 174Path.Combine(workspace.Path, "cache", "detector.json"), 210Path.Combine(workspace.Path, "cache", "detector.json"), 256Path.Combine(workspace.Path, "cache", "detector.json"), 286Path.Combine(workspace.Path, "cache", "detector.json"), 329Path.Combine(workspace.Path, "cache", "detector.json"), 356Path.Combine(workspace.Path, "cache", "detector.json"), 372var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 391var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 392Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!); 418var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 441var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 467Path.Combine(workspace.Path, "cache", "detector.json"), 490var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 491Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!); 524var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 563var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 564Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!); 589Path.Combine(workspace.Path, "cache", "detector.json"), 610Path.Combine(workspace.Path, "cache", "detector.json"), 630await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty); 631await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty); 642Path.Combine(workspace.Path, "cache", "detector.json"), 668await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty); 669await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty); 679Path.Combine(workspace.Path, "cache", "detector.json"), 702await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty); 703await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty); 710Path.Combine(workspace.Path, "cache", "detector.json"), 849var appSsoPath = Path.Combine(workspace.Path, "usr", "bin", "app-sso"); 850Directory.CreateDirectory(Path.GetDirectoryName(appSsoPath)!); 871Path.Combine(workspace.Path, "cache", "detector.json"), 891var outputPath = Path.Combine(workspace.Path, "platform-sso-output.txt"); 922Path.Combine(workspace.Path, "detector.json"), 941Path.Combine(workspace.Path, "cache", "detector.json"), 944macPlatformSsoPath: Path.Combine(workspace.Path, "missing-app-sso")); 957var appSsoPath = Path.Combine(workspace.Path, "app-sso"); 987Path.Combine(workspace.Path, "cache", "detector.json"), 1001Path.Combine(workspace.Path, "full-detector-cache", "detector.json"), 1074Path.Combine(workspace.Path, "cache", "detector.json"), 1095await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd"), string.Empty); 1096await File.WriteAllTextAsync(Path.Combine(workspace.Path, "dsregcmd.EXE"), string.Empty); 1102Path.Combine(workspace.Path, "cache", "detector.json"), 1126await File.WriteAllTextAsync(Path.Combine(workspace.Path, executable), string.Empty); 1136Path.Combine(workspace.Path, "cache", "detector.json"), 1157await File.WriteAllTextAsync(Path.Combine(workspace.Path, executable), string.Empty); 1167Path.Combine(workspace.Path, "cache", "detector.json"), 1191Path.Combine(workspace.Path, "cache", "detector.json"), 1216Path.Combine(workspace.Path, "cache", "detector.json"), 1233var cacheFilePath = Path.Combine(workspace.Path, "cache", "detector.json"); 1264Path.Combine(workspace.Path, "cache", "detector.json"), 1288Path.Combine(workspace.Path, "cache", "detector.json"), 1312Path.Combine(workspace.Path, "cache", "detector.json"), 1336Path.Combine(workspace.Path, "cache", "detector.json"), 1359Path.Combine(workspace.Path, "cache", "detector.json"), 1391Path.Combine(workspace.Path, "cache", "detector.json"), 1416Path.Combine(workspace.Path, "cache", "detector.json"), 1625Path.Combine(workspace.Path, "cache", "detector.json"), 1675Path.Combine(workspace.Path, "cache", "detector.json"), 1720new DirectoryInfo(Path.GetDirectoryName(cacheFilePath) ?? AppContext.BaseDirectory),
Telemetry\ProfilingTelemetryTests.cs (4)
55var aspirePath = Path.Combine("tools", "aspire"); 56var npmPath = Path.Combine("node", "npm"); 125var aspirePath = Path.Combine("tools", "aspire"); 171var appHostProjectFile = new FileInfo(Path.Combine("AppHost", "AppHost.csproj"));
Telemetry\ReportedLogExportTests.cs (5)
65await File.WriteAllTextAsync(Path.Combine(directory, "envelopes.json"), JsonSerializer.Serialize(records)); 70var envelopes = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "envelopes.json")))!.AsArray(); 121var loggingOptions = new Program.CliLoggingOptions(LogLevel.Error, false, directory, Path.Combine(directory, "cli.log")); 144Path.Combine(directory, "storage"), builder => 152Assert.Equal(Path.Combine(directory, "storage"), options.StorageDirectory);
Telemetry\TelemetryFixture.cs (2)
44ReportedSourceName = $"Test.{Path.GetRandomFileName()}"; 45DiagnosticsSourceName = $"Test.{Path.GetRandomFileName()}";
Telemetry\TelemetryShutdownTests.cs (1)
152var storage = Path.Combine(directory, "storage");
Templating\CliTemplateFactoryConfigLineEndingTests.cs (2)
33var outputDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "out"); 41LineEndingAssert.FileUsesOsLineBreaksAndSingleFinalNewline(Path.Combine(outputDirectory, fileName));
Templating\DotNetTemplateFactoryTests.cs (17)
39var path = Path.Combine(dir.FullName, "nuget.config"); 63var nugetConfigPath = Path.Combine(workingDir.FullName, "nuget.config"); 95var nugetConfigPath = Path.Combine(workingDir.FullName, "nuget.config"); 108var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 133var parentConfigPath = Path.Combine(workingDir.FullName, "nuget.config"); 139var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config"); 152var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 175var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config"); 189var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 202var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config"); 206var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config"); 219var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 228var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config"); 229var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config"); 240var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject")); 249var workingConfigPath = Path.Combine(workingDir.FullName, "nuget.config"); 250var outputConfigPath = Path.Combine(outputDir.FullName, "nuget.config");
Templating\GoStarterTemplateTests.cs (20)
20var path = Path.Combine(GetGoStarterDirectory(), "aspire.config.json"); 46var viteConfig = File.ReadAllText(Path.Combine(GetGoStarterDirectory(), "frontend", "vite.config.ts")); 49var api = File.ReadAllText(Path.Combine(GetGoStarterDirectory(), "api", "main.go")); 71var apiDirectory = Path.Combine(GetGoStarterDirectory(), "api"); 72var main = ConditionalBlockProcessor.Process(File.ReadAllText(Path.Combine(apiDirectory, "main.go")), conditions); 73var goMod = ConditionalBlockProcessor.Process(File.ReadAllText(Path.Combine(apiDirectory, "go.mod")), conditions); 74var goSum = ConditionalBlockProcessor.Process(File.ReadAllText(Path.Combine(apiDirectory, "go.sum")), conditions); 86var frontendDirectory = Path.Combine(GetGoStarterDirectory(), "frontend"); 88Assert.True(File.Exists(Path.Combine(frontendDirectory, "package.json"))); 89Assert.True(File.Exists(Path.Combine(frontendDirectory, "package-lock.json"))); 90Assert.True(File.Exists(Path.Combine(frontendDirectory, "src", "App.tsx"))); 91Assert.True(File.Exists(Path.Combine(frontendDirectory, "vite.config.ts"))); 93var logo = File.ReadAllBytes(Path.Combine(frontendDirectory, "public", "Aspire.png")); 100var apiDirectory = Path.Combine(GetGoStarterDirectory(), "api"); 102var goMod = File.ReadAllText(Path.Combine(apiDirectory, "go.mod")); 105var telemetry = File.ReadAllText(Path.Combine(apiDirectory, "telemetry.go")); 117var path = Path.Combine(GetGoStarterDirectory(), "apphost.go"); 124=> Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates", "go-starter"); 127=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\JavaAppHostTemplateTests.cs (15)
45var path = Path.Combine(GetJavaStarterDirectory(), ".vscode", "settings.json"); 81var apiDirectory = Path.Combine(GetJavaStarterDirectory(), "api"); 83var buildPath = Path.Combine(apiDirectory, "build.gradle"); 90var settingsPath = Path.Combine(apiDirectory, "settings.gradle"); 95.Select(path => Path.GetFileName(path)) 111var path = Path.Combine(GetJavaStarterDirectory(), "aspire.config.json"); 132var apiDirectory = Path.Combine(GetJavaStarterDirectory(), "api"); 136var path = Path.Combine(apiDirectory, relativePath); 140var propertiesPath = Path.Combine(apiDirectory, "gradle", "wrapper", "gradle-wrapper.properties"); 149var path = Path.Combine(apiDirectory, relativePath); 167var viteConfig = File.ReadAllText(Path.Combine(GetJavaStarterDirectory(), "frontend", "vite.config.ts")); 173var path = Path.Combine(GetJavaStarterDirectory(), "AppHost.java"); 180=> Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates", "java-starter"); 183=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\JavaStarterScaffoldTests.cs (16)
38var wrapperPath = Path.Combine(outputDirectory, "api", "gradlew"); 62.EnumerateFiles(Path.Combine(outputDirectory, "api"), "*", SearchOption.AllDirectories) 63.Select(path => Path.GetRelativePath(outputDirectory, path).Replace(Path.DirectorySeparatorChar, '/')) 81var templateWrapperJarPath = Path.Combine( 92var scaffoldedWrapperJarPath = Path.Combine(outputDirectory, "api", "gradle", "wrapper", "gradle-wrapper.jar"); 95Assert.True(File.Exists(Path.Combine(outputDirectory, "frontend", "vite.config.ts"))); 96Assert.True(File.Exists(Path.Combine(outputDirectory, "AppHost.java"))); 105Assert.True(File.Exists(Path.Combine(outputDirectory, ".project"))); 106Assert.True(File.Exists(Path.Combine(outputDirectory, ".classpath"))); 107Assert.True(File.Exists(Path.Combine(outputDirectory, ".settings", "org.eclipse.jdt.core.prefs"))); 108Assert.Contains("<name>JavaStarterOut</name>", File.ReadAllText(Path.Combine(outputDirectory, ".project"))); 110using var config = JsonDocument.Parse(File.ReadAllText(Path.Combine(outputDirectory, "aspire.config.json"))); 151return new ScaffoldedTemplate(workspace, Path.Combine(workspace.WorkspaceRoot.FullName, outputDirectoryName)); 155=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\OutputPathHelperTests.cs (6)
36File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content"); 52File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content"); 67File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content"); 99var path = Path.Combine(workspace.WorkspaceRoot.FullName, "new-dir"); 122File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content"); 159File.WriteAllText(Path.Combine(dir.FullName, "file.txt"), "content");
Templating\TemplateEngineFactoryGitCheckoutTests.cs (20)
31Assert.Equal(new byte[] { 1, 2, 3 }, await File.ReadAllBytesAsync(Path.Combine(GetCheckout(workspace, commit), "content"))); 48new TemplateSource(".", Path.GetRelativePath(workspace.WorkspaceRoot.FullName, repository.FullName), commit), 51var actual = await File.ReadAllBytesAsync(Path.Combine(destination, path)); 54Assert.Equal(commit, (await File.ReadAllTextAsync(Path.Combine(Directory.GetParent(destination)!.FullName, ".git", "HEAD"))).Trim()); 63await File.WriteAllBytesAsync(Path.Combine(repository.FullName, "content"), [4, 5, 6]); 70Assert.Equal(content, await File.ReadAllBytesAsync(Path.Combine(GetCheckout(workspace, commit), "content"))); 79await File.WriteAllBytesAsync(Path.Combine(repository.FullName, "content"), [4, 5, 6]); 82var branchCommit = (await File.ReadAllTextAsync(Path.Combine(repository.FullName, ".git", "refs", "heads", "same"))).Trim(); 87Assert.Equal(new byte[] { 4, 5, 6 }, await File.ReadAllBytesAsync(Path.Combine(GetCheckout(workspace, branchCommit), "content"))); 89Assert.Equal(new byte[] { 1, 2, 3 }, await File.ReadAllBytesAsync(Path.Combine(GetCheckout(workspace, tagCommit), "content"))); 105new TemplateSource(".", Path.Combine(workspace.Path, "repository-diagnostic-marker"), null), TestContext.Current.CancellationToken)); 135Assert.Equal(new byte[] { 1, 2, 3 }, await File.ReadAllBytesAsync(Path.Combine(GetCheckout(workspace, commit), "content"))); 136Assert.Equal(commit, (await File.ReadAllTextAsync(Path.Combine(repository.FullName, ".git", "refs", "heads", "main"))).Trim()); 151var cacheRoot = Path.Combine(workspace.Path, ".aspire", "cache", "git"); 153directory => File.ReadAllText(Path.Combine(directory, ".git", "HEAD")).Trim() == commit); 154return Path.Combine(cached, "repository"); 162var file = Path.Combine(repository.FullName, path); 163Directory.CreateDirectory(Path.GetDirectoryName(file)!); 166await File.WriteAllTextAsync(Path.Combine(configuration.FullName, "template.json"), 173var commit = (await File.ReadAllTextAsync(Path.Combine(repository.FullName, ".git", "refs", "heads", "main"))).Trim();
Templating\TemplateEngineFactoryGitTests.cs (2)
264await File.WriteAllTextAsync(Path.Combine(configuration.FullName, "template.json"), 266await File.WriteAllTextAsync(Path.Combine(destination.FullName, "content.txt"), "template content", token);
Templating\TemplateGitIgnoreTests.cs (8)
15var filePath = Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates", templateName, ".gitignore"); 26var templatesDirectory = Path.Combine(GetRepoRoot(), "src", "Aspire.Cli", "Templating", "Templates"); 29.Where(path => string.Equals(Path.GetFileName(Path.GetDirectoryName(path)), "frontend", StringComparison.Ordinal)) 30.Select(path => Directory.GetParent(Path.GetDirectoryName(path)!)!.FullName) 38var gitIgnorePath = Path.Combine(starterDirectory, ".gitignore"); 48=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\TemplateNuGetConfigServiceTests.cs (44)
35var ambientPath = Path.Combine(workspace.Path, "nuget.config"); 71var ambientPath = Path.Combine(workspace.Path, "nuget.config"); 113await Verify(await File.ReadAllTextAsync(Path.Combine(output.FullName, "nuget.config"))) 146Assert.Equal(builtInCreatesConfig, File.Exists(Path.Combine(builtInOutput.FullName, "nuget.config"))); 147Assert.Equal(templateEngineCreatesConfig, File.Exists(Path.Combine(templateEngineOutput.FullName, "nuget.config"))); 170var path = Path.Combine(output.FullName, fileName); 191Assert.Equal([fileName], Directory.GetFiles(output.FullName).Select(Path.GetFileName)); 220var inheritedPath = Path.Combine(workspace.Path, "nuget.config"); 221var nestedPath = Path.Combine(nested.FullName, "nuget.config"); 231var generated = await File.ReadAllBytesAsync(Path.Combine(output.FullName, "nuget.config")); 234Assert.Equal(generated, await File.ReadAllBytesAsync(Path.Combine(output.FullName, "nuget.config"))); 240await Verify(await File.ReadAllTextAsync(Path.Combine(output.FullName, "nuget.config"))) 250Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"), 299await File.WriteAllTextAsync(Path.Combine(workspace.Path, "nuget.config"), """ 326var doc = XDocument.Load(Path.Combine(outputDirectory.FullName, "nuget.config")); 341Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"), 351Path.Combine(outputDirectory.FullName, "nuget.config"), 368var projectConfigPath = Path.Combine(outputDirectory.FullName, "nuget.config"); 369var parentConfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"); 409Assert.False(File.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, "nuget.config"))); 674var nestedDirectory = Directory.CreateDirectory(Path.Combine( 679Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), 819var hivesDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives")); 877File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty); 878File.WriteAllText(Path.Combine(prPackagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0-dev.nupkg"), string.Empty); 951File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty); 952File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0.nupkg"), string.Empty); 988var nestedDirectory = Directory.CreateDirectory(Path.Combine( 993Path.Combine(nestedDirectory.FullName, "Aspire.ProjectTemplates.13.6.0.nupkg"), 1030File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0-dev.nupkg"), string.Empty); 1031File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.99.0.0.nupkg"), string.Empty); 1066File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.99.0.0.nupkg"), string.Empty); 1107File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.6.0-dev.nupkg"), string.Empty); 1108File.WriteAllText(Path.Combine(packagesDirectory.FullName, "Aspire.ProjectTemplates.13.7.0-dev.nupkg"), string.Empty); 1208File.WriteAllText(Path.Combine(packagesDir.FullName, "Aspire.ProjectTemplates.13.5.0.nupkg"), string.Empty); 1259var templatePackagePath = Path.Combine( 1264Directory.CreateDirectory(Path.GetDirectoryName(templatePackagePath)!); 1361var configPath = Path.Combine(outputDir.FullName, "nuget.config"); 1400Assert.False(File.Exists(Path.Combine(outputDir.FullName, "nuget.config"))); 1411Path.Combine(outputDir.FullName, "nuget.config"), 1441var configPath = Path.Combine(outputDir.FullName, "nuget.config"); 1465Path.Combine(outputDir.FullName, "nuget.config"), 1494var configPath = Path.Combine(outputDir.FullName, "nuget.config"); 1524var configPath = Path.Combine(outputDir.FullName, "nuget.config");
Templating\TemplatePackageLockTests.cs (15)
13var filePath = Path.Combine( 38var filePath = Path.Combine( 63var filePath = Path.Combine( 95var filePath = Path.Combine( 122var filePath = Path.Combine( 155var filePath = Path.Combine( 170var filePath = Path.Combine( 188var filePath = Path.Combine( 219var directory = Path.Combine(GetRepoRoot(), relativeDirectory); 220Assert.True(File.Exists(Path.Combine(directory, "package-lock.json")), $"Expected a package-lock.json in {relativeDirectory}."); 222var npmrcPath = Path.Combine(directory, ".npmrc"); 262"Aspire.Cli" => Path.Combine(GetRepoRoot(), "src", projectName, "Templating", "Templates", templateName), 263"Aspire.ProjectTemplates" => Path.Combine(GetRepoRoot(), "src", projectName, "templates", templateName), 268=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".."));
Templating\TemplateSourceConfigurationTests.cs (6)
20? Path.GetPathRoot(workspace.Path)! 39var root = Path.GetPathRoot(Path.GetFullPath("."))!; 50var root = Path.GetPathRoot(Path.GetFullPath("."))!; 94var directory = Path.GetFullPath(".");
Testing\TestRunReporterTests.cs (8)
32Assert.Equal(Path.Combine(context.AspireHomeDirectory.FullName, "testruns"), Path.GetDirectoryName(reporter.OutputPath)); 33AssertPrivateDirectory(Path.GetDirectoryName(reporter.OutputPath)!); 41Assert.Equal(["summary.json"], Directory.GetFiles(reporter.OutputPath).Select(Path.GetFileName)); 63AssertPrivateDirectory(Path.GetDirectoryName(reporter.OutputPath)!); 111Assert.Empty(Directory.GetFiles(Path.Combine(context.AspireHomeDirectory.FullName, "testruns"))); 119var parent = Path.Combine(context.AspireHomeDirectory.FullName, "testruns"); 696var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "untouched.txt"));
tests\Shared\LinuxTrayTestPayload.cs (2)
18var executable = Path.Combine(directory, "aspire-tray"); 24File.WriteAllBytes(Path.Combine(directory, "Aspire.png"),
tests\Shared\Processes\ChildProcessTests.cs (1)
430var cleanupPath = Path.Combine(fixture.CreateDirectory().FullName, "cleanup-completed");
tests\Shared\Processes\ProcessSupervisorTests.cs (3)
36var shim = Path.Combine(directory.FullName, "literal %PATH%! shim.cmd"); 49startInfo.Environment["ASPIRE_TEST_DOTNET"] = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), "..", "..", "..", "dotnet.exe"); 73var completionPath = Path.Combine(directory.FullName, "exit-code");
tests\Shared\Processes\ProcessTestFixture.cs (8)
47while (!File.Exists(Path.Combine(repository.FullName, "Aspire.slnx"))) 61var sourcePaths = sources.Select(source => Path.Combine(repository.FullName, "src", "Shared", source)).Concat( 63Path.Combine(repository.FullName, "tests", "Shared", "AsyncTestHelpers.cs"), 64Path.Combine(repository.FullName, "tests", "Aspire.TestUtilities", "PlatformDetection.cs") 68var project = Path.Combine(_directory.FullName, "ProcessTestHost.csproj"); 84await File.WriteAllTextAsync(Path.Combine(_directory.FullName, "Program.cs"), HostProgram); 86["restore", project, "--configfile", Path.Combine(repository.FullName, "NuGet.config"), "--verbosity", "quiet"]); 88_assemblyPath = Path.Combine(_directory.FullName, "bin", "Debug", targetFramework, "ProcessTestHost.dll");
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
tests\Shared\WindowsTrayTestPayload.cs (2)
13File.WriteAllText(Path.Combine(directory, "Aspire.ico"), "test icon"); 14using var stream = File.Create(Path.Combine(directory, "aspire-tray.exe"));
TestServices\DcpConnectionTestProcess.cs (5)
69var standardOutputPath = Path.Combine(workingDirectory, StandardOutputFileName); 70var standardErrorPath = Path.Combine(workingDirectory, StandardErrorFileName); 79File.WriteAllText(Path.Combine(workingDirectory, SessionDirectoryFileName), sessionDirectory); 136await WaitForApiAsync(Path.Combine(sessionDirectory, "kubeconfig"), readiness.Token); 162await File.WriteAllTextAsync(Path.Combine(sessionDirectory, "kubeconfig"), "clusters:", handoff.Token);
TestServices\FakeNuGetClient.cs (1)
130Directory.CreateDirectory(Path.GetDirectoryName(outputPath)!);
TestServices\FakePlaywrightServices.cs (3)
47internal static string SkillBaseDirectory { get; } = Path.Combine(".claude", "skills"); 56var skillDirectory = Path.Combine(workingDirectory, SkillBaseDirectory, PlaywrightCliInstaller.PlaywrightCliSkillName); 58File.WriteAllText(Path.Combine(skillDirectory, "SKILL.md"), "# Playwright CLI Skill");
TestServices\NuGetTestHelper.cs (4)
20using var archive = ZipFile.Open(Path.Combine(feed.FullName, $"{id}.{version}.nupkg"), ZipArchiveMode.Create); 60.Select(name => Path.Combine(directory.FullName, name)) 64configPaths.AddRange(Settings.LoadSpecificSettings(directory.FullName, Path.GetFileName(configPath)).GetConfigFilePaths()); 68configPaths.Add(Path.Combine(AppContext.BaseDirectory, "NuGetTestSettings.config"));
TestServices\ProcessTestHelpers.cs (1)
12var path = Path.Combine(directory.FullName, OperatingSystem.IsWindows() ? $"{name}.cmd" : name);
TestServices\TerminalCommandTestServices.cs (1)
24AppHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, "TestAppHost", "TestAppHost.csproj"),
TestServices\TerminalTapeTestHost.cs (1)
34SocketPath = Path.Combine(_directory.FullName, "h.sock");
TestServices\TestAuxiliaryBackchannelServer.cs (1)
23Directory.CreateDirectory(Path.GetDirectoryName(socketPath)!);
TestServices\TestCliDownloader.cs (1)
37var path = Path.Combine(_tempDirectory.FullName, filename);
TestServices\TestConfigSourceServices.cs (2)
22var path = Path.Combine(projectDirectory.FullName, AspireConfigFile.FileName); 62var path = Path.Combine(service.GetCacheDirectory(source), "check.json");
TestServices\TestConfigurationService.cs (1)
62public string SettingsFilePath { get; set; } = Path.Combine(AppContext.BaseDirectory, "settings.global.json");
TestServices\TestDotNetCliRunner.cs (3)
104PlatformID.Win32NT => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet", "NuGet.Config")], 105_ => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet", "NuGet.Config")], 179values["NuGetRestoreTargets"] = Path.Combine(AppContext.BaseDirectory, "NuGet.targets");
TestServices\TestGitWorktree.cs (8)
14var adminDirectory = Path.Combine(Path.GetFullPath(commonGitDirectory), "worktrees", worktreeName); 19? Path.GetRelativePath(adminDirectory, gitFilePath) 21File.WriteAllText(Path.Combine(adminDirectory, "gitdir"), backPointer + Environment.NewLine); 28var fullCheckoutRoot = Path.GetFullPath(checkoutRoot); 29var fullGitDirectory = Path.GetFullPath(gitDirectory); 33var gitFilePath = Path.Combine(fullCheckoutRoot, ".git"); 35? Path.GetRelativePath(fullCheckoutRoot, fullGitDirectory)
TestServices\TestProcessExecutionFactory.cs (1)
31guardian.FileName = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), "..", "..", "..", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
TestServices\TestProjectLocator.cs (2)
95var fakeProjectFilePath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString(), "AppHost.csproj");
Utils\AppHostHelperTests.cs (3)
28var projectFile = new FileInfo(Path.Combine(Path.GetTempPath(), "test.csproj")); 29var workingDirectory = new DirectoryInfo(Path.GetTempPath());
Utils\AspireRepositoryDetectorTests.cs (6)
41File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty); 43var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "src", "Project")).FullName; 67File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty); 72var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "playground", "polyglot")).FullName; 88File.WriteAllText(Path.Combine(repoRoot, "Aspire.slnx"), string.Empty); 90var nestedDirectory = Directory.CreateDirectory(Path.Combine(repoRoot, "src", "Project")).FullName;
Utils\AspireSkillsCheckTests.cs (3)
25var project = Path.Combine(_context.Project.FullName, ".claude", "skills", "aspire-init", "SKILL.md"); 26var user = Path.Combine(_context.Home.FullName, ".agents", "skills", "aspire", "SKILL.md"); 49Path.Combine(_context.Home.FullName, ".agents", "skills", "aspire", "SKILL.md"), "shared guidance");
Utils\CliPathHelperTests.cs (33)
25Assert.Equal(Path.GetFileName(socketPath1), socketPath1); 26Assert.Equal(Path.GetFileName(socketPath2), socketPath2); 32var expectedDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "cli", "bch"); 33Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath1)); 34Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath2)); 35Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath1)); 36Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath2)); 55var expectedDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "cli", "bch"); 56Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath1)); 57Assert.Equal(expectedDirectory, Path.GetDirectoryName(socketPath2)); 58Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath1)); 59Assert.Matches("^h[A-Za-z0-9_-]{8}$", Path.GetFileName(socketPath2)); 188var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 189var binDir = Path.Combine(installPrefix, "bin"); 201var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-pr-test"); 202var binDir = Path.Combine(installPrefix, "dogfood", "pr-17159", "bin"); 230var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "portable"); 231var binDir = Path.Combine(installPrefix, "dogfood", "pr-17159", "bin"); 255Assert.Equal(Path.Combine("/home/user", ".aspire"), result); 271var path = Path.Combine("relative", "path", "aspire"); 275Assert.Equal(Path.GetFullPath(path), result); 291var target = Path.Combine(workspace.WorkspaceRoot.FullName, "target-aspire"); 294var link = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire"); 366var realPath = Path.Combine(workspace.WorkspaceRoot.FullName, "binary-under-test"); 382var realPath = Path.Combine(workspace.WorkspaceRoot.FullName, "binary-under-test"); 402var installPrefix = Path.Combine(workspace.WorkspaceRoot.FullName, "portable"); 403var binDir = Path.Combine(installPrefix, "dogfood", "pr-17105", "bin"); 421var binaryPath = Path.Combine(binaryDir, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 423File.WriteAllText(Path.Combine(binaryDir, InstallSidecarReader.SidecarFileName), $$"""{"source":"{{source}}"}"""); 435Directory.CreateDirectory(Path.GetDirectoryName(staleFile)!); 444var socketDirectory = Path.GetDirectoryName(staleFile)!; 464Directory.CreateDirectory(Path.GetDirectoryName(matching)!); 473var socketDirectory = Path.GetDirectoryName(matching)!;
Utils\CliTestHelper.cs (6)
119var globalSettingsFilePath = Path.Combine(options.WorkingDirectory.FullName, ".aspire", "settings.global.json"); 131var testLogsDirectory = Path.Combine(options.WorkingDirectory.FullName, ".aspire", "logs"); 491var globalSettingsFilePath = Path.Combine(workingDirectory.FullName, ".aspire", "settings.global.json"); 680var tmpDirectory = new DirectoryInfo(Path.Combine(executionContext.WorkingDirectory.FullName, "tmp")); 844LayoutPath = Path.GetDirectoryName(dcpDirectory), 845Components = new LayoutComponents { Dcp = Path.GetFileName(dcpDirectory) }
Utils\CliTestHelperTests.cs (1)
27Assert.StartsWith(Path.Combine(workspacePath, ".aspire", "logs"), logFilePath);
Utils\CliUpdateNotificationServiceTests.cs (4)
219var toolPath = Path.Combine(workspace.CreateDirectory("install").FullName, "custom tool path"); 409var processPath = Path.Combine(toolPath, GetAspireExecutableName()); 410var storeExecutablePath = Path.Combine( 423Directory.CreateDirectory(Path.GetDirectoryName(storeExecutablePath)!);
Utils\DcpConnectionHealthCheckTests.cs (6)
207Path.Combine(sessionDirectory, "kubeconfig") 362File.WriteAllText(Path.Combine(environment["DCP_SESSION_FOLDER"], "kubeconfig"), server.Kubeconfig); 469File.WriteAllText(Path.Combine(environment["DCP_SESSION_FOLDER"], "kubeconfig"), "clusters:"); 629var kubeconfigPath = Path.Combine(workspace.WorkspaceRoot.FullName, "kubeconfig"); 674var certificatePath = Path.Combine(cacheDirectory, $"{lookup}.crt"); 675var keyPath = Path.Combine(cacheDirectory, $"{lookup}.key");
Utils\DcpConnectionLifetimeTests.cs (7)
67using var storage = new PrivateTemporaryStorage(Path.Combine(workspace.Path, ".aspire"), new ConfigurationBuilder().Build()); 101Assert.Equal(Path.TrimEndingDirectorySeparator(storage.GetTempPath()), Path.GetDirectoryName(sessionDirectory)); 102Assert.StartsWith("dcp-", Path.GetFileName(sessionDirectory), StringComparison.Ordinal); 142var linkedDirectory = Path.Combine(workspace.Path, "linked-dcp"); 166var sessionDirectoryFile = Path.Combine(workspace.Path, DcpConnectionTestProcess.SessionDirectoryFileName); 254var path = Path.Combine(workspace.Path, logFile);
Utils\DevCertsCheckTests.cs (28)
68var certUtilPath = Path.Combine(directory.FullName, CertificateHelpers.CertUtilCommand); 81? Path.Combine(directory.FullName, "openssl.cmd") 82: Path.Combine(directory.FullName, "openssl"); 116File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificatePem); 117File.WriteAllText(Path.Combine(trustDirectory.FullName, hashEntryName), certificatePem); 363["PATH"] = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N")) 426var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 470var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 521var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 576var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 577File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem()); 626var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 627File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem()); 685var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 686File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem()); 742var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 743File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), certificate.ExportCertificatePem()); 784var trustDirectory = Path.Combine(tempDirectory.FullName, "missing-trust"); 828var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 872var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 874File.WriteAllText(Path.Combine(trustDirectory.FullName, corruptCertificateFileName), "not a certificate"); 918var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 920File.WriteAllText(Path.Combine(trustDirectory.FullName, corruptCertificateFileName), "not a certificate"); 964var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 966File.WriteAllText(Path.Combine(trustDirectory.FullName, "unrelated.pem"), "not a certificate"); 1008var trustDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.FullName, "trust")); 1009File.WriteAllText(Path.Combine(trustDirectory.FullName, GetOpenSslCertificateFileName(certificate)), staleCertificate.ExportCertificatePem()); 1062["PATH"] = Path.Combine(AppContext.BaseDirectory, Guid.NewGuid().ToString("N"))
Utils\DotNetToolDetectionTests.cs (7)
27var toolPath = Path.Combine(workspace.Path, "custom tool path"); 28var processPath = Path.Combine(toolPath, GetAspireExecutableName()); 29var storeExecutablePath = Path.Combine( 42Directory.CreateDirectory(Path.GetDirectoryName(storeExecutablePath)!); 54var toolPath = Path.Combine(workspace.Path, "custom tool path"); 55var processPath = Path.Combine( 82var processPath = Path.Combine(workspace.Path, GetAspireExecutableName());
Utils\FileDeleteHelperTests.cs (2)
18var filePath = Path.Combine(directory, "Aspire.Hosting.dll"); 41var filePath = Path.Combine(directory, "Aspire.Hosting.dll");
Utils\FileSystemHelperTests.cs (68)
16var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 19File.WriteAllText(Path.Combine(sourceDir.FullName, "file1.txt"), "content1"); 20File.WriteAllText(Path.Combine(sourceDir.FullName, "file2.txt"), "content2"); 21File.WriteAllText(Path.Combine(sourceDir.FullName, "file3.cs"), "using System;"); 28Assert.True(File.Exists(Path.Combine(destDir, "file1.txt"))); 29Assert.True(File.Exists(Path.Combine(destDir, "file2.txt"))); 30Assert.True(File.Exists(Path.Combine(destDir, "file3.cs"))); 32Assert.Equal("content1", File.ReadAllText(Path.Combine(destDir, "file1.txt"))); 33Assert.Equal("content2", File.ReadAllText(Path.Combine(destDir, "file2.txt"))); 34Assert.Equal("using System;", File.ReadAllText(Path.Combine(destDir, "file3.cs"))); 43var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 49File.WriteAllText(Path.Combine(sourceDir.FullName, "root.txt"), "root content"); 50File.WriteAllText(Path.Combine(subDir1.FullName, "level1.txt"), "level 1 content"); 51File.WriteAllText(Path.Combine(subDir2.FullName, "level2.txt"), "level 2 content"); 58Assert.True(File.Exists(Path.Combine(destDir, "root.txt"))); 59Assert.True(Directory.Exists(Path.Combine(destDir, "subdir1"))); 60Assert.True(File.Exists(Path.Combine(destDir, "subdir1", "level1.txt"))); 61Assert.True(Directory.Exists(Path.Combine(destDir, "subdir1", "subdir2"))); 62Assert.True(File.Exists(Path.Combine(destDir, "subdir1", "subdir2", "level2.txt"))); 64Assert.Equal("root content", File.ReadAllText(Path.Combine(destDir, "root.txt"))); 65Assert.Equal("level 1 content", File.ReadAllText(Path.Combine(destDir, "subdir1", "level1.txt"))); 66Assert.Equal("level 2 content", File.ReadAllText(Path.Combine(destDir, "subdir1", "subdir2", "level2.txt"))); 75var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "empty_destination"); 91var nonExistentSource = Path.Combine(workspace.WorkspaceRoot.FullName, "nonexistent"); 92var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 104var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 128var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 153var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 156var binaryFilePath = Path.Combine(sourceDir.FullName, "binary.dat"); 165var copiedFilePath = Path.Combine(destDir, "binary.dat"); 178var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 185File.WriteAllText(Path.Combine(current.FullName, $"file{i}.txt"), $"content at level {i}"); 195currentDest = Path.Combine(currentDest, $"level{i}"); 197var filePath = Path.Combine(currentDest, $"file{i}.txt"); 209var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 212File.WriteAllText(Path.Combine(sourceDir.FullName, "file1.txt"), "new content 1"); 213File.WriteAllText(Path.Combine(sourceDir.FullName, "file2.txt"), "new content 2"); 216File.WriteAllText(Path.Combine(subDir.FullName, "project.assets.json"), "new assets"); 217File.WriteAllText(Path.Combine(subDir.FullName, "project.csproj.nuget.dgspec.json"), "new dgspec"); 221File.WriteAllText(Path.Combine(destDir, "file1.txt"), "old content 1"); 222File.WriteAllText(Path.Combine(destDir, "file2.txt"), "old content 2"); 224var destSubDir = Directory.CreateDirectory(Path.Combine(destDir, "obj")); 225File.WriteAllText(Path.Combine(destSubDir.FullName, "project.assets.json"), "old assets"); 226File.WriteAllText(Path.Combine(destSubDir.FullName, "project.csproj.nuget.dgspec.json"), "old dgspec"); 232Assert.Equal("new content 1", File.ReadAllText(Path.Combine(destDir, "file1.txt"))); 233Assert.Equal("new content 2", File.ReadAllText(Path.Combine(destDir, "file2.txt"))); 234Assert.Equal("new assets", File.ReadAllText(Path.Combine(destDir, "obj", "project.assets.json"))); 235Assert.Equal("new dgspec", File.ReadAllText(Path.Combine(destDir, "obj", "project.csproj.nuget.dgspec.json"))); 244var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination"); 247File.WriteAllText(Path.Combine(sourceDir.FullName, "file1.txt"), "new content"); 251File.WriteAllText(Path.Combine(destDir, "file1.txt"), "old content"); 284Assert.Equal(Path.Combine("folder1", "Project.csproj"), result[paths[0]]); 285Assert.Equal(Path.Combine("folder2", "Project.csproj"), result[paths[1]]); 299Assert.Equal(Path.Combine("folder1", "Project.csproj"), result[paths[0]]); 300Assert.Equal(Path.Combine("folder2", "Project.csproj"), result[paths[1]]); 314Assert.Equal(Path.Combine("a", "shared", "Project.csproj"), result[paths[0]]); 315Assert.Equal(Path.Combine("b", "shared", "Project.csproj"), result[paths[1]]); 325Assert.Equal(Path.Combine("MyApp", "AppHost.cs"), result[paths[0]]); 348Assert.Equal(Path.Combine("App1", "AppHost.cs"), result[paths[0]]); 362Assert.Equal(Path.Combine("App1", "AppHost.cs"), result[paths[0]]); 363Assert.Equal(Path.Combine("App2", "AppHost.cs"), result[paths[1]]); 377Assert.Equal(Path.Combine("a", "src", "AppHost.cs"), result[paths[0]]); 378Assert.Equal(Path.Combine("b", "src", "AppHost.cs"), result[paths[1]]); 393Assert.Equal(Path.Combine("App2", "AppHost.cs"), result[paths[1]]); 416Assert.Equal(Path.Combine("folder1", "Project.csproj"), result[paths[0]]); 417Assert.Equal(Path.Combine("folder2", "Project.csproj"), result[paths[1]]); 449Assert.Equal(Path.Combine("Folder", "Project.csproj"), result[paths[0]]); 450Assert.Equal(Path.Combine("folder", "Project.csproj"), result[paths[1]]);
Utils\FirstTimeUseNoticeSentinelTests.cs (8)
29var cliDir = Path.Combine(workspace.WorkspaceRoot.FullName, "cli"); 31var sentinelFilePath = Path.Combine(cliDir, "cli.firstUseSentinel"); 53var sentinelFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "cli", "cli.firstUseSentinel"); 62var cliDir = Path.Combine(workspace.WorkspaceRoot.FullName, "cli"); 64var sentinelFilePath = Path.Combine(cliDir, "cli.firstUseSentinel"); 81var nonExistentDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "non-existent-dir"); 88var cliDir = Path.Combine(nonExistentDirectory, "cli"); 89var sentinelFilePath = Path.Combine(cliDir, "cli.firstUseSentinel");
Utils\HelpOutputVerifyExtensions.cs (1)
16/// <see cref="Path.GetFileNameWithoutExtension(string)"/> treats ".Tests" in the extension-less apphost name as
Utils\IsolatedUserSecretsHelperTests.cs (2)
61var sourceDir = Path.GetDirectoryName(sourcePath)!; 114var secretsDir = Path.GetDirectoryName(secretsPath)!;
Utils\LegacySettingsFileCheckTests.cs (17)
15var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 17await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}"); 21var subDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src")); 43Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 60var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 62await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}"); 64Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 83Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName), 88var subDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src")); 105var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 107await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}"); 111var subDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyProject")); 131var legacyDir = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"); 133await File.WriteAllTextAsync(Path.Combine(legacyDir, "settings.json"), "{}"); 136var childDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "project")); 139Path.Combine(childDir.FullName, AspireConfigFile.FileName), 143var workingDir = new DirectoryInfo(Path.Combine(childDir.FullName, "src"));
Utils\LegacyTelemetryHookCheckTests.cs (17)
35? Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json") 36: Path.Combine(context.ClaudeDirectory, "settings.json"); 72? Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json") 73: Path.Combine(context.ClaudeDirectory, "settings.json"); 98context.SetVariable("ASPIRE_HOME", Path.Combine(context.Workspace.WorkspaceRoot.FullName, "configured-home")); 99var script = JsonEncodedText.Encode(Path.Combine(context.Home.FullName, ".aspire", "hooks", "track-telemetry.sh")).ToString(); 101? Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json") 102: Path.Combine(context.ClaudeDirectory, "settings.json"); 127var configPath = Path.Combine(context.ClaudeDirectory, "settings.json"); 128var targetPath = Path.Combine(context.Workspace.WorkspaceRoot.FullName, "shared-settings.json"); 183Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json"), config); 184await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.ClaudeDirectory, "settings.json"), config); 198Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json"), config); 199await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.ClaudeDirectory, "settings.json"), config); 209Path.Combine(context.CopilotDirectory, "hooks", "aspire-telemetry.json"), "{malformed"); 210await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.ClaudeDirectory, "settings.json"), 224await AgentConfigurationTestContext.WriteAsync(Path.Combine(context.Home.FullName, ".aspire", "hooks", script), "legacy script");
Utils\MarkupHelpersTests.cs (11)
110var path = Path.Combine(Path.GetTempPath(), "logs", "cli [Dev].log"); 121var path = Path.Combine(Path.GetTempPath(), "logs", "aspire.log"); 125var expectedUri = new Uri(Path.GetFullPath(path)).AbsoluteUri; 132var path = Path.Combine(Path.GetTempPath(), "logs", "cli [Dev].log"); 136var expectedUri = new Uri(Path.GetFullPath(path)).AbsoluteUri; 143var path = Path.Combine(Path.GetTempPath(), "logs", "cli [Dev].log"); 151var fileUri = new Uri(Path.GetFullPath(path)).AbsoluteUri;
Utils\MissingJavaScriptToolWarningTests.cs (1)
52File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "package.json"), "{ \"packageManager\": \"bun@1.2.0\" }");
Utils\PathNormalizerTests.cs (31)
21var file = new FileInfo(Path.Combine(subdir.FullName, "app.csproj")); 42var file = new FileInfo(Path.Combine(directory.FullName, "App.csproj")); 44var caseVariantPath = Path.Combine(workspace.WorkspaceRoot.FullName, "mixedcase", "app.CSPROJ"); 61var file = new FileInfo(Path.Combine(directory.FullName, "App.csproj")); 63var caseVariantPath = Path.Combine(workspace.WorkspaceRoot.FullName, "mixedcase", "app.CSPROJ"); 78var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Missing", "App.csproj"); 79var expectedPath = Path.Combine( 92var target = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "target.csproj")); 95var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "link.csproj"); 117var file = new FileInfo(Path.Combine(nested.FullName, "app.csproj")); 120var linkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 125var pathThroughLink = Path.Combine(linkDirectory, "nested", "app.csproj"); 138var missingTarget = Path.Combine(workspace.WorkspaceRoot.FullName, "missing.csproj"); 139var linkPath = Path.Combine(workspace.WorkspaceRoot.FullName, "broken-link.csproj"); 157var projectFile = new FileInfo(Path.Combine(realDirectory.FullName, "AppHost.csproj")); 160var linkDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "link"); 163var linkPath = Path.Combine(linkDirectory, projectFile.Name); 177var file = new FileInfo(Path.Combine(tempDirectory.FullName, "AppHost.csproj")); 201var missingPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Missing.AppHost", "Missing.AppHost.csproj"); 205Assert.EndsWith(Path.Combine("Missing.AppHost", "Missing.AppHost.csproj"), resolved, StringComparison.Ordinal); 216var decomposedPath = Path.Combine(testRoot.FullName, decomposedName); 220var composedPath = Path.Combine(testRoot.FullName, composedName); 241var alias = Path.Combine(testRoot.FullName, "CAFE\u0301"); 251Assert.Equal(Path.GetFileName(enumeratedPath), Path.GetFileName(resolvedPath)); 261var normalizationMatch = Path.Combine(testRoot.FullName, "Cafe\u0301"); 267var candidate = Path.Combine(testRoot.FullName, "Caf\u00E9"); 287var file = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "app.csproj")); 292file.FullName[2] == Path.DirectorySeparatorChar, 309.FirstOrDefault(driveLetter => !Directory.Exists($"{driveLetter}:{Path.DirectorySeparatorChar}")); 312var missingDriveRoot = $"{char.ToLowerInvariant(missingDriveLetter)}:{Path.DirectorySeparatorChar}";
Utils\ReparsePointTests.cs (71)
16var target = Path.Combine(root, "real"); 18File.WriteAllText(Path.Combine(target, "marker"), "hello"); 20var link = Path.Combine(root, "link"); 27Assert.Equal("hello", File.ReadAllText(Path.Combine(link, "marker"))); 43var target1 = Path.Combine(root, "t1"); 44var target2 = Path.Combine(root, "t2"); 47File.WriteAllText(Path.Combine(target1, "id"), "one"); 48File.WriteAllText(Path.Combine(target2, "id"), "two"); 50var link = Path.Combine(root, "link"); 52Assert.Equal("one", File.ReadAllText(Path.Combine(link, "id"))); 58Assert.Equal("two", File.ReadAllText(Path.Combine(link, "id"))); 77var real = Path.Combine(root, "link"); 79File.WriteAllText(Path.Combine(real, "legacy"), "legacy"); 81var target = Path.Combine(root, "target"); 90Assert.True(File.Exists(Path.Combine(real, "legacy"))); 97var dir = Path.Combine(workspace.WorkspaceRoot.FullName, "plain"); 107Assert.False(ReparsePoint.IsReparsePoint(Path.Combine(workspace.WorkspaceRoot.FullName, "nope"))); 116var target = Path.Combine(root, "target"); 118var markerPath = Path.Combine(target, "keep"); 121var link = Path.Combine(root, "link"); 134var dir = Path.Combine(workspace.WorkspaceRoot.FullName, "plain"); 135Directory.CreateDirectory(Path.Combine(dir, "nested")); 136File.WriteAllText(Path.Combine(dir, "nested", "f"), "x"); 147ReparsePoint.RemoveIfExists(Path.Combine(workspace.WorkspaceRoot.FullName, "missing")); 156var link = Path.Combine(root, "bundle"); 157var target = Path.Combine(root, "versions", "v1"); 159var resolvedTarget = ReparsePoint.ResolveTargetPath(link, Path.Combine("versions", "v1")); 161Assert.Equal(Path.GetFullPath(target), resolvedTarget); 170var link = Path.Combine(root, "bundle"); 173Directory.CreateSymbolicLink(link, Path.Combine("versions", "missing")); 210var target = Path.Combine(root, "real"); 212File.WriteAllText(Path.Combine(target, "marker"), "hello"); 214var link = Path.Combine(root, "junction"); 223Assert.Equal("hello", File.ReadAllText(Path.Combine(link, "marker"))); 241var target = Path.Combine(root, "real"); 242var nestedDir = Path.Combine(target, "nested"); 244File.WriteAllText(Path.Combine(nestedDir, "data.txt"), "payload"); 246var link = Path.Combine(root, "junction"); 254var nestedThroughLink = Path.Combine(link, "nested"); 256Assert.Equal("payload", File.ReadAllText(Path.Combine(nestedThroughLink, "data.txt"))); 260.Select(p => Path.GetFileName(p)) 280var target = Path.Combine(root, "real"); 282var markerPath = Path.Combine(target, "keep"); 285var link = Path.Combine(root, "junction"); 304var target = Path.Combine(root, "real"); 307var link = Path.Combine(root, "junction"); 318Path.GetFullPath(target).TrimEnd(Path.DirectorySeparatorChar), 319Path.GetFullPath(linkTarget!).TrimEnd(Path.DirectorySeparatorChar)); 348var targetV1 = Path.Combine(root, "v1"); 349var targetV2 = Path.Combine(root, "v2"); 352File.WriteAllText(Path.Combine(targetV1, "id"), "one"); 353File.WriteAllText(Path.Combine(targetV2, "id"), "two"); 355var link = Path.Combine(root, "link"); 362Assert.Equal("one", File.ReadAllText(Path.Combine(link, "id"))); 372Assert.Equal("two", File.ReadAllText(Path.Combine(link, "id"))); 377Path.GetFullPath(targetV2).TrimEnd(Path.DirectorySeparatorChar), 378Path.GetFullPath(resolvedTarget!).TrimEnd(Path.DirectorySeparatorChar)); 382Assert.True(File.Exists(Path.Combine(targetV1, "id"))); 404var probe = Path.Combine(root, "symlink-probe"); 405var probeTarget = Path.Combine(root, "probe-target"); 428var targetV1 = Path.Combine(root, "v1"); 429var targetV2 = Path.Combine(root, "v2"); 432File.WriteAllText(Path.Combine(targetV1, "id"), "one"); 433File.WriteAllText(Path.Combine(targetV2, "id"), "two"); 435var link = Path.Combine(root, "link"); 453Assert.Equal("two", File.ReadAllText(Path.Combine(link, "id"))); 456Assert.True(File.Exists(Path.Combine(targetV1, "id")));
Utils\TemporaryStorageTests.cs (24)
17var home = Path.Combine(workspace.Path, ".aspire"); 21var session = Path.TrimEndingDirectorySeparator(storage.GetTempPath()); 23Assert.Equal(Path.Combine(home, "tmp"), Path.GetDirectoryName(session)); 24Assert.Matches("^[a-z0-9]{8}\\.[a-z0-9]{3}$", Path.GetFileName(session)); 27Assert.Equal(session, Path.GetDirectoryName(file)); 33Assert.Equal(directoryMode, File.GetUnixFileMode(Path.Combine(home, "tmp"))); 52var home = Path.Combine(workspace.Path, ".aspire"); 69using var storage = CreateStorage(Path.Combine(workspace.Path, ".aspire"), value); 70Assert.Equal(expected, File.Exists(Path.Combine(storage.GetTempPath(), ".preserve"))); 79using var storage = CreateStorage(Path.Combine(workspace.Path, ".aspire")); 88var home = Path.Combine(workspace.Path, "missing", ".aspire"); 106var home = Directory.CreateDirectory(Path.Combine(workspace.Path, ".aspire")); 107var directory = configureTmp ? Directory.CreateDirectory(Path.Combine(home.FullName, "tmp")) : home; 122Assert.Equal(Path.Combine(home.FullName, "tmp"), Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(storage.GetTempPath()))); 144var home = Path.Combine(workspace.Path, ".aspire"); 151Assert.Equal(root.FullName, Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(storage.GetTempPath()))); 166var home = Directory.CreateDirectory(Path.Combine(workspace.Path, ".aspire")); 172var session = Path.TrimEndingDirectorySeparator(storage.GetTempPath()); 175Assert.Equal(privateMode, File.GetUnixFileMode(Path.Combine(home.FullName, "tmp"))); 188var home = Path.Combine(workspace.Path, ".aspire");
Utils\TemporaryWorkspaceTests.cs (1)
23Assert.True(Directory.Exists(Path.Combine(workspace.Path, ".git")));
Utils\TestExecutionContextHelper.cs (6)
64hivesDirectory ??= new DirectoryInfo(Path.Combine(root, ".aspire", "hives")); 65homeDirectory ??= new DirectoryInfo(Path.Combine(root, ".home")); 66var cacheDirectory = new DirectoryInfo(Path.Combine(root, ".aspire", "cache")); 67var sdksDirectory = new DirectoryInfo(Path.Combine(root, ".aspire", "sdks")); 68var logsDirectory = new DirectoryInfo(Path.Combine(root, ".aspire", "logs")); 69logFilePath ??= Path.Combine(logsDirectory.FullName, "test.log");
Aspire.Components.Common.TestUtilities (5)
ConformanceTests.cs (5)
56protected string JsonSchemaPath => Path.Combine(AppContext.BaseDirectory, "ConfigurationSchema.json"); 681var launchedToolsFile = Path.Combine(toolsDirectory.FullName, "launched-tools.txt"); 686File.WriteAllText(Path.Combine(toolsDirectory.FullName, $"{tool}.cmd"), $"@echo {tool}>>\"{launchedToolsFile}\"\r\n@exit /b 1\r\n"); 690var toolPath = Path.Combine(toolsDirectory.FullName, tool); 697options.StartInfo.Environment["PATH"] = toolsDirectory.FullName + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH");
Aspire.Dashboard (90)
Components\Dialogs\GenAIVisualizerDialog.razor.cs (1)
333FileName: CalculateFileName(Path.GetFileName(result.LocalPath), uriPart.MimeType!));
Components\Legacy\Pages\ConsoleLogs.razor.cs (1)
966: string.Join("_", PageViewModel.SelectedResource.Id!.InstanceId!.Split(Path.GetInvalidFileNameChars()));
Components\Pages\ConsoleLogs.razor.cs (1)
1129: string.Join("_", (PageViewModel.SelectedResource.Id?.InstanceId ?? PageViewModel.SelectedResource.Name).Split(Path.GetInvalidFileNameChars()));
DashboardWebApplication.cs (2)
682var baseDirectoryPath = Path.Combine(baseDirectory, manifestFileName); 688var contentRootManifestPath = Path.Combine(contentRootPath, manifestFileName);
Model\ResourceIconHelpers.cs (1)
51var extension = Path.GetExtension(projectPath);
Model\TelemetryImportService.cs (1)
72var extension = Path.GetExtension(fileName).ToLowerInvariant();
Model\VolumePathLauncher.cs (2)
37var fullPath = Path.GetFullPath(path); 86var folder = isDirectory ? fullPath : Path.GetDirectoryName(fullPath);
ServiceClient\DashboardDataSourcePool.cs (1)
80var databasePath = Path.GetFullPath(run.DatabasePath);
ServiceClient\DashboardRunStore.cs (23)
133DatabasePath = Path.Combine(CurrentWorkingDirectory, DatabaseFileName); 141CurrentWorkingDirectory = Path.Combine(_runsDirectory, runId); 142DatabasePath = Path.Combine(CurrentWorkingDirectory, DatabaseFileName); 145File.WriteAllText(Path.Combine(CurrentWorkingDirectory, _applicationMarkerFileName), string.Empty); 153_metadataPath = Path.Combine(CurrentWorkingDirectory, "run.json"); 158CurrentWorkingDirectory = Path.Combine(resumesDirectory, _applicationMarkerFileName); 159DatabasePath = Path.Combine(CurrentWorkingDirectory, DatabaseFileName); 201DatabaseFileName = Path.GetFileName(DatabasePath) 218!File.Exists(Path.Combine(directory, DatabaseFileName))) 307var runDirectory = Path.GetDirectoryName(storedRun.DatabasePath)!; 322var metadataPath = Path.Combine(runDirectory, "run.json"); 378var runDirectory = Path.GetDirectoryName(storedRun.DatabasePath)!; 410if (!File.Exists(Path.Combine(directory, _applicationMarkerFileName))) 415var metadataPath = Path.Combine(directory, "run.json"); 515var directory = Path.GetDirectoryName(run.DatabasePath)!; 543var metadataPath = Path.Combine(runDirectory, "run.json"); 575var runDirectory = Path.Combine(runsDirectory, runId); 667Path.Combine(runDirectory, metadata.DatabaseFileName), 676return Path.Combine(GetResumesDirectory(dataRoot), GetApplicationDirectoryName(applicationName)); 679internal static string GetRunsDirectory(string? dataRoot) => Path.Combine(GetDataRoot(dataRoot), "runs"); 681internal static string GetResumesDirectory(string? dataRoot) => Path.Combine(GetDataRoot(dataRoot), "resumes"); 683private static string GetDataRoot(string? dataRoot) => Path.GetFullPath( 685? Path.Combine(AspireHomeDirectory.GetDefault(), "dashboard")
ServiceClient\DashboardSqliteDatabase.cs (2)
40DatabasePath = Path.GetFullPath(databasePath); 45Directory.CreateDirectory(Path.GetDirectoryName(DatabasePath)!);
ServiceClient\TracingSqliteConnection.cs (3)
23new(base.BeginTransaction(), Path.GetFileName(databasePath), activitySource); 26new(base.BeginTransaction(isolationLevel), Path.GetFileName(databasePath), activitySource); 28protected override DbCommand CreateDbCommand() => new TracingDbCommand(base.CreateDbCommand(), Path.GetFileName(databasePath), activitySource);
src\Shared\AspireHomeDirectory.cs (1)
32? Path.Combine(userProfileDirectory, ".aspire")
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\ChildProcess.cs (1)
133_completionPath = Path.Combine(_completionDirectory.FullName, "exit-code");
src\Shared\Export\ExportArchive.cs (1)
131var invalidChars = Path.GetInvalidFileNameChars();
src\Shared\FileLock.cs (1)
163var directory = Path.GetDirectoryName(lockPath);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\Model\ResourceSourceViewModel.cs (2)
24return new ResourceSource(Path.GetFileName(projectPath), projectPath, KnownProperties.Project.Path); 37return new ResourceSource(Path.GetFileName(executablePath), executablePath, KnownProperties.Executable.Path);
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
src\Shared\ProcessSupervisor.cs (2)
49var isDotnet = Path.GetFileNameWithoutExtension(executable).Equals("dotnet", StringComparison.OrdinalIgnoreCase); 52arguments[0] = Path.GetFullPath(arguments[0]);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
src\Shared\Telemetry\AspireTelemetryExporter.cs (1)
18return Path.Combine(
src\Shared\Telemetry\InternalMicrosoftDetector.cs (10)
72Path.Combine(cacheDirectory.FullName, CacheSubdirectoryName, CacheFileName), 553var directory = Path.GetDirectoryName(_cacheFilePath); 559var tempPath = Path.Combine(directory, $"{Path.GetRandomFileName()}.tmp"); 639var accountStore = Path.Combine(localAppData, ".IdentityService", "V3AccountStore.json"); 905var copilotHome = Path.Combine(_homeDirectory.FullName, ".copilot"); 1582var path = Path.Combine(directory, fileName); 1631var extensions = _environment.IsWindows() && string.IsNullOrEmpty(Path.GetExtension(command)) 1635foreach (var directory in path.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 1639var candidate = Path.Combine(directory, command + extension);
src\Shared\Telemetry\LinuxMachineInformationProvider.cs (1)
38userDir = Path.Combine(rootPath, SecondaryPathSubDirectory);
src\Shared\Telemetry\MacOSXMachineInformationProvider.cs (1)
43var subdirectoryPath = Path.Combine(userDir, "Library", "Application Support");
src\Shared\Telemetry\TelemetryMetadata.cs (1)
40new DirectoryInfo(Path.Combine(AspireHomeDirectory.GetDefault(), "cache")),
src\Shared\Telemetry\UnixMachineInformationProvider.cs (3)
28cachePath = Path.Combine(GetStoragePath(), MicrosoftDirectory, DeveloperToolsDirectory); 83var fullPath = Path.Combine(directoryPath, fileName); 107var path = Path.Combine(directoryPath, fileName);
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
Aspire.Dashboard.Components.Tests (11)
Layout\ResourcesLayoutTests.cs (1)
583var original = type is KnownResourceTypes.Project or KnownResourceTypes.Executable ? Path.Combine("workspace", value) : value;
Pages\ResourceOverviewEmptyPanelsTests.cs (1)
564var projectPath = Path.Combine("projects", "test", "Test.csproj");
Shared\FluentUISetupHelpers.cs (3)
174var databasePath = Path.Combine(context.Services.GetRequiredService<TemporaryWorkspace>().Path, "dashboard.db"); 215var databasePath = Path.Combine(services.GetRequiredService<TemporaryWorkspace>().Path, "dashboard.db"); 248var databasePath = Path.Combine(services.GetRequiredService<TemporaryWorkspace>().Path, "dashboard.db");
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
Aspire.Dashboard.Playwright.Tests (38)
Integration\Playwright\DashboardInteractionsTests.cs (4)
332await page.AddScriptTagAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, "wwwroot", "js", "app.js") }); 444await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, "fluentui-grid-disposal-regression.png") }); 481await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, "fluentui-legacy-splitter.png") }); 562await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"fluentui-filter-{(legacy ? "legacy" : "new")}.png") });
Integration\Playwright\Infrastructure\DashboardServerFixture.cs (2)
78var currentAssemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!; 92WebRootPath = Path.Combine(aspireAssemblyDirectory, "wwwroot"),
Integration\Playwright\NativeAotDashboardTests.cs (2)
66var leasesDirectory = Path.Combine(workingDirectory.FullName, ".leases"); 127var leasesDirectory = Path.Combine(workingDirectory.FullName, ".leases");
Integration\Playwright\ResourcePaneMotionTests.cs (2)
520await page.Context.Tracing.StopAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"resource-pane-motion-{width}-{reducedMotion}.zip") }); 573await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"resource-pane-motion-{width}-{reducedMotion}-{expanding}.png") });
Integration\Playwright\ResourcePaneResponsiveTests.cs (16)
219await File.WriteAllTextAsync(Path.Combine(AppContext.BaseDirectory, $"axe-pane-{width}-{dark}-{canvas}-{surface}.json"), 439await File.WriteAllTextAsync(Path.Combine(AppContext.BaseDirectory, "activity-performance.json"), 469await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, "activity-populated-28-resources.png") }); 1023Path = Path.Combine(AppContext.BaseDirectory, $"ux29-final-{(dark ? "dark" : "light")}-{density}-pane{width}.png") 1070var prefix = Path.Combine(AppContext.BaseDirectory, $"dynamic-reorder-{(dark ? "dark" : "light")}"); 1113Path.Combine(AppContext.BaseDirectory, $"dynamic-geometry-{(dark ? "dark" : "light")}.json"), 1579await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"resource-tree-{theme}-{width}.png") }); 1589await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"canvas-failure-{theme}.png") }); 1612await Assertions.Expect(source).ToHaveAttributeAsync("data-tooltip", Path.Combine("workspace", "MyFrontend.csproj")); 1613await Assertions.Expect(source).ToHaveAttributeAsync("aria-label", $"Source: {Path.Combine("workspace", "MyFrontend.csproj")}"); 1622await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"resource-tree-{theme}-canvas-{width}.png") }); 2474await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, $"resource-pane-label-canvas-{width}.png") }); 2591await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, "resource-pane-label-resize-460.png") }); 2594await page.ScreenshotAsync(new() { Path = Path.Combine(AppContext.BaseDirectory, "resource-pane-label-resize-560.png") }); 2816var value = type == KnownResourceTypes.Project ? Path.Combine("workspace", name == "api" ? "MyFrontend.csproj" : $"{name}.csproj") : 2817type == KnownResourceTypes.Container ? name == "cache" ? LongImage : "rabbitmq:4" : Path.Combine("tools", name);
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\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
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.Dashboard.Tests (119)
BlazorAssetsTests.cs (8)
14var imaskPath = Path.Combine(repoRoot, "src", "Aspire.Dashboard", "wwwroot", "js", "imask-7.6.1.min.js"); 15var appPath = Path.Combine(repoRoot, "src", "Aspire.Dashboard", "Components", "App.razor"); 33var appPath = Path.Combine(GetRepoRoot(), "src", "Aspire.Dashboard", "Components", "App.razor"); 44var componentsPath = Path.Combine(GetRepoRoot(), "src", "Aspire.Dashboard", "Components"); 48File.ReadAllText(Path.Combine(componentsPath, "Layout", "TerminalDock.razor.cs")), 52File.ReadAllText(Path.Combine(componentsPath, "Pages", "TerminalWindow.razor.cs")), 56File.ReadAllText(Path.Combine(componentsPath, "Controls", "TerminalWindowButton.razor.cs")), 63while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "Aspire.slnx")))
Integration\OtlpGrpcServiceTests.cs (1)
165var configPath = Path.GetTempFileName();
Integration\OtlpHttpServiceTests.cs (1)
170var configFilePath = Path.Combine(tempDirectory.FullName, "appsettings.json");
Integration\StartupTests.cs (5)
317var configFilePath = Path.Combine(tempDirectory.FullName, Path.GetRandomFileName()); 728var configFilePath = Path.Combine(tempDirectory.FullName, Path.GetRandomFileName()); 1377var browserTokenConfigFile = Path.Combine(fileConfigDirectory.FullName, DashboardConfigNames.DashboardFrontendBrowserTokenName.EnvVarName);
Integration\StaticAssetsTests.cs (4)
218var baseDir = Path.Combine(tempRoot.FullName, "base"); 219var contentRoot = Path.Combine(tempRoot.FullName, "content"); 225var contentManifestPath = Path.Combine(contentRoot, "Aspire.Dashboard.staticwebassets.endpoints.json"); 230var baseManifestPath = Path.Combine(baseDir, "Aspire.Dashboard.staticwebassets.endpoints.json");
Model\DashboardClientTests.cs (3)
253var path = Path.Combine(workspace.Path, "client.pfx"); 296var path = Path.Combine(workspace.Path, "client.pfx"); 323var path = Path.Combine(workspace.Path, "missing.pfx");
Model\DashboardDataSourceTests.cs (47)
41var expectedRunsDirectory = Path.Combine(workspace.Path, "runs"); 43Assert.True(File.Exists(Path.Combine(runStore.CurrentWorkingDirectory, applicationDirectoryName))); 44Assert.False(Directory.Exists(Path.Combine(workspace.Path, applicationDirectoryName))); 56var expectedResumesDirectory = Path.Combine(workspace.Path, "resumes"); 57Assert.Equal(Path.Combine(expectedResumesDirectory, applicationDirectoryName), runStore.CurrentWorkingDirectory); 58Assert.True(File.Exists(Path.Combine(expectedResumesDirectory, $"{applicationDirectoryName}.lock"))); 65var expectedDirectory = Path.Combine( 121Assert.Equal(runStore.RunId, Path.GetFileName(runStore.CurrentWorkingDirectory)); 136Assert.Equal(secondRunStore.RunId, Path.GetFileName(secondRunStore.CurrentWorkingDirectory)); 139Assert.True(File.Exists(Path.Combine(secondRunStore.CurrentWorkingDirectory, applicationDirectoryName))); 147var existingRunDirectory = Path.Combine(DashboardRunStore.GetRunsDirectory(workspace.Path), "20260720T123456789Z"); 149var existingFilePath = Path.Combine(existingRunDirectory, "existing.txt"); 156Assert.Equal(["existing.txt"], Directory.EnumerateFileSystemEntries(existingRunDirectory).Select(Path.GetFileName)); 171Directory.CreateDirectory(DashboardRunStore.GetRunLockPath(Path.Combine(runsDirectory, runId))); 186var metadataPath = Path.Combine(runStore.CurrentWorkingDirectory, "run.json"); 220using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(runStore.CurrentWorkingDirectory, "run.json"))); 243metadataPath = Path.Combine(historicalRunStore.CurrentWorkingDirectory, "run.json"); 300using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(currentRunStore.CurrentWorkingDirectory, "run.json"))); 328Assert.False(File.Exists(Path.Combine(runStore.CurrentWorkingDirectory, "run.json"))); 449File.WriteAllText(Path.Combine(abandonedDirectory, "dashboard.db"), string.Empty); 471var temporaryRoot = Path.GetTempPath(); 472var abandonedLockPath = Path.Combine(temporaryRoot, $"aspire-dashboard-{Guid.NewGuid():N}.lock"); 473var activeLockPath = Path.Combine(temporaryRoot, $"aspire-dashboard-{Guid.NewGuid():N}.lock"); 474var unrelatedLockPath = Path.Combine(temporaryRoot, $"unrelated-{Guid.NewGuid():N}.lock"); 553File.WriteAllText(Path.Combine(otherDirectory, "dashboard.db"), string.Empty); 698var databasePath = Path.Combine(workspace.Path, $"malformed-{Guid.NewGuid():N}.db"); 805var metadataPath = Path.Combine(incompatibleRunDirectory, "run.json"); 846var metadataPath = Path.Combine(futureRunDirectory, "run.json"); 890var metadataPath = Path.Combine(incompatibleRunDirectory, "run.json"); 908var runsDirectory = Path.GetDirectoryName(currentRunStore.CurrentWorkingDirectory)!; 986var runsDirectory = Path.GetDirectoryName(currentRunStore.CurrentWorkingDirectory)!; 1001var abandonedLockPath = Path.Combine(runsDirectory, "abandoned.lock"); 1002var activeLockPath = Path.Combine(runsDirectory, "active.lock"); 1086pinnedRunDirectories.Add(Path.GetDirectoryName(run.DatabasePath)!); 1088using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(pinnedRunDirectories[^1], "run.json"))); 1132var runsDirectory = Path.GetDirectoryName(currentRunStore.CurrentWorkingDirectory)!; 1265using var metadata = JsonDocument.Parse(File.ReadAllText(Path.Combine(Path.GetDirectoryName(historicalRun.DatabasePath)!, "run.json"))); 1348var malformedRunDirectory = Path.GetDirectoryName(malformedDatabasePath)!; 1360var historicalDirectory = Path.Combine(workspace.Path, "historical"); 1361var historicalDatabasePath = Path.Combine(historicalDirectory, DashboardRunStore.DatabaseFileName); 1366var malformedDirectory = Path.Combine(workspace.Path, "malformed"); 1367var malformedDatabasePath = Path.Combine(malformedDirectory, DashboardRunStore.DatabaseFileName); 1393DatabasePath = Path.Combine(workspace.Path, "unavailable", DashboardRunStore.DatabaseFileName), 1426var database = new DashboardSqliteDatabase(Path.Combine(workspace.Path, "connection.db")); 1595DatabasePath = Path.Combine(workspace.Path, "incompatible", DashboardRunStore.DatabaseFileName), 1729var runDirectory = Path.GetDirectoryName(run.DatabasePath)!;
Model\DashboardSqliteDatabaseTests.cs (11)
27using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 40var databasePath = Path.Combine(_workspace.Path, "dashboard.db"); 59using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 77using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 109using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 132using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 149using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 168using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 188using var database = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "dashboard.db"), pooling: false); 209using var observedDatabase = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "observed.db"), pooling: false); 210using var otherDatabase = new DashboardSqliteDatabase(Path.Combine(_workspace.Path, "other.db"), pooling: false);
Model\ResourceMenuBuilderTests.cs (1)
49var runStore = new TestDashboardRunStore(databasePath: Path.Combine(temporaryDirectory.FullName, "dashboard.db"));
Model\SqliteResourceRepositoryTests.cs (1)
978private static string GetDatabasePath(string workspacePath) => Path.Combine(workspacePath, "dashboard.db");
Model\TelemetryExportServiceTests.cs (2)
1271var runStore = new TestDashboardRunStore(databasePath: Path.Combine(temporaryDirectory.FullName, "dashboard.db")); 1351Path.Combine(workspacePath, "dashboard.db"),
Model\VolumePathLauncherTests.cs (1)
56Assert.Equal([Path.GetDirectoryName(path)!], startInfo.ArgumentList);
Shared\InMemoryBrowserLocalStorage.cs (1)
121var script = File.ReadAllText(Path.Combine(AppContext.BaseDirectory, "wwwroot", "js", "app.js"));
Shared\SqliteRepositoryTestHelpers.cs (1)
42Path.Combine(temporaryDirectory.FullName, "dashboard.db"),
TelemetryRepositoryTests\HistogramTests.cs (11)
98var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 251var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 339var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 418var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 648var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 696var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 772var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 1024var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 1226var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 1390var databasePath = Path.Combine(workspace.Path, "dashboard.db"); 1523var databasePath = Path.Combine(workspace.Path, "dashboard.db");
TelemetryRepositoryTests\SqliteTelemetryPersistenceTests.cs (1)
1225private static string GetDatabasePath(string workspacePath) => Path.Combine(workspacePath, "dashboard.db");
TelemetryRepositoryTests\TelemetryReceiptTests.cs (6)
28var path = Path.Combine(_workspace.Path, "dashboard.db"); 58using var context = SqliteRepositoryTestHelpers.CreateTelemetryRepository(Path.Combine(_workspace.Path, "dashboard.db")); 79Path.Combine(_workspace.Path, "dashboard.db"), pauseManager: pauseManager); 89using var context = SqliteRepositoryTestHelpers.CreateTelemetryRepository(Path.Combine(_workspace.Path, "dashboard.db")); 109var path = Path.Combine(_workspace.Path, "dashboard.db"); 128using var context = SqliteRepositoryTestHelpers.CreateTelemetryRepository(Path.Combine(_workspace.Path, "dashboard.db"));
TelemetryRepositoryTests\TelemetryRepositoryTestBase.cs (1)
47Path.Combine(temporaryDirectory, "dashboard.db"),
Terminal\DefaultTerminalConnectionResolverTests.cs (4)
67var socketPath = Path.Combine(directory.FullName, "terminal.sock"); 74udsPath: resourceName == "svc-abc" ? socketPath : Path.Combine(directory.FullName, "other.sock")), 76udsPath: resourceName == "svc-def" ? socketPath : Path.Combine(directory.FullName, "other.sock")) 147udsPath: Path.Combine(directory.FullName, "nonexistent.sock"));
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestCertificateLoader.cs (3)
10private static readonly string s_baseDir = Path.Combine(Directory.GetCurrentDirectory(), "shared", "TestCertificates"); 17public static string TestCertificatePath { get; } = Path.Combine(s_baseDir, "testCert.pfx"); 18public static string GetCertPath(string name) => Path.Combine(s_baseDir, name);
Aspire.Deployment.EndToEnd.Tests (244)
AcaCompactNamingDeploymentTests.cs (2)
105var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 250var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AcaCompactNamingUpgradeDeploymentTests.cs (1)
221var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AcaCustomRegistryDeploymentTests.cs (3)
104var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 105var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 106var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AcaDeploymentErrorOutputTests.cs (2)
60var deployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "deploy-output.txt"); 94var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AcaExistingRegistryDeploymentTests.cs (3)
132var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 133var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 134var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AcaExpressDeploymentTests.cs (7)
58var projectDirectory = Path.Combine(workspace.Path, ProjectName); 182var appHostPath = Path.Combine(projectDirectory, "apphost.cs"); 210File.Delete(Path.Combine(projectDirectory, "Api", "Properties", "launchSettings.json")); 211File.Delete(Path.Combine(projectDirectory, "Frontend", "Properties", "launchSettings.json")); 212File.WriteAllText(Path.Combine(projectDirectory, "Api", "Program.cs"), $$""" 228File.WriteAllText(Path.Combine(projectDirectory, "Frontend", "Program.cs"), """ 331var summary = File.ReadAllText(Path.Combine(projectDirectory, DeploymentLogFile));
AcaManagedRedisDeploymentTests.cs (5)
71var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 72var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 73var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 74var serverDir = Path.Combine(projectDir, $"{projectName}.Server"); 75var programFilePath = Path.Combine(serverDir, "Program.cs");
AcaStarterDeploymentTests.cs (7)
103var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 104var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 105var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 149var apiProgramPath = Path.Combine(projectDir, $"{projectName}.ApiService", "Program.cs"); 167DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(projectDir, $"{projectName}.Web", "Program.cs"), 201var frontendUrlFile = Path.Combine(projectDir, "frontend-url.txt"); 202var apiUrlFile = Path.Combine(projectDir, "api-url.txt");
AcrPurgeTaskDeploymentTests.cs (4)
107var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 108var appHostFilePath = Path.Combine(projectDir, "apphost.mts"); 159var projectDir2 = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 160var mainPyPath = Path.Combine(projectDir2, "app", "main.py");
AksAzureKubernetesEnvironmentCertManagerDeploymentTests.cs (4)
80var pebbleDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "pebble-eab"); 112var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 113var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 114var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AksAzureKubernetesEnvironmentCertManagerTypeScriptDeploymentTests.cs (2)
132var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 135var appHostFilePath = Path.Combine(projectDir, "apphost.mts");
AksAzureKubernetesEnvironmentGatewayDeploymentTests.cs (3)
108var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 109var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 110var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AksBlazorRedisDeploymentTests.cs (3)
98var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 99var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 100var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AksCrossResourceGroupRegistryDeploymentTests.cs (8)
64var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, $"{projectName}.AppHost"); 65await File.WriteAllTextAsync(Path.Combine(appHostDirectory, "AppHost.cs"), $$""" 280await File.WriteAllTextAsync(Path.Combine(appHostDirectory, "legacy-cluster.bicep"), """ 352var recordingDirectory = Path.GetDirectoryName(DeploymentE2ETestHelpers.GetTestResultsRecordingPath(testName))!; 353var artifactsDirectory = Path.Combine(recordingDirectory, "..", "generated-bicep", 360var destination = Path.Combine(artifactsDirectory, Path.GetRelativePath(workspace.Path, source)); 361Directory.CreateDirectory(Path.GetDirectoryName(destination)!);
AksExistingClusterDeploymentTests.cs (1)
66var appHostPath = Path.Combine(workspace.WorkspaceRoot.FullName, projectName, $"{projectName}.AppHost", "AppHost.cs");
AksMultipleNodePoolsDeploymentTests.cs (3)
98var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 99var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 100var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AksPersistentVolumeDeploymentTests.cs (4)
75var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 76var appHostDirectory = Path.Combine(projectDirectory, $"{projectName}.AppHost"); 77var appHostPath = Path.Combine(appHostDirectory, "AppHost.cs"); 78var apiProgramPath = Path.Combine(
AksStarterDeploymentTests.cs (4)
188var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 189var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 190var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 224var apiServiceFilePath = Path.Combine(projectDir, $"{projectName}.ApiService", "Program.cs");
AksStarterWithRedisHelmDeploymentTests.cs (3)
179var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 180var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 181var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AksVnetInfraDeploymentTests.cs (1)
93var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AksVnetWithAzureResourcesDeploymentTests.cs (5)
123var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 124var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 125var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 179var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 180var apiProgramPath = Path.Combine(projectDir, $"{projectName}.ApiService", "Program.cs");
AksWithAzureResourcesDeploymentTests.cs (5)
121var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 122var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 123var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 165var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 166var apiProgramPath = Path.Combine(projectDir, $"{projectName}.ApiService", "Program.cs");
AksWithHelmChartDeploymentTests.cs (3)
102var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 103var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 104var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
ApiManagementDeploymentTests.cs (1)
74var appHostFilePath = Path.Combine(
ApiManagementInfraDeploymentTests.cs (1)
73var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AppServiceDotnetProjectDeploymentTests.cs (6)
36var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 37var appHostFile = Path.Combine(projectDir, $"{projectName}.AppHost", "AppHost.cs"); 44DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(projectDir, $"{projectName}.Server", "Program.cs"), 51var publicDir = Directory.CreateDirectory(Path.Combine(projectDir, "frontend", "public")); 52File.WriteAllText(Path.Combine(publicDir.FullName, "deployment-marker.txt"), $"static:{marker}"); 62var urlFile = Path.Combine(projectDir, "server-url.txt");
AppServicePythonDeploymentTests.cs (2)
111var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 112var appHostFilePath = Path.Combine(projectDir, "apphost.mts");
AppServiceReactDeploymentTests.cs (4)
117var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 118var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 119var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 164var serverFilePath = Path.Combine(projectDir, $"{projectName}.Server", "Program.cs");
AppServiceStoragePrivateEndpointDeploymentTests.cs (3)
99var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 100var appHostFilePath = Path.Combine(projectDir, $"{projectName}.AppHost", "AppHost.cs"); 101var serverProgramPath = Path.Combine(projectDir, $"{projectName}.Server", "Program.cs");
AzureAppConfigDeploymentTests.cs (1)
101var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureConnectorNamespaceDeploymentTests.cs (1)
194var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureContainerRegistryDeploymentTests.cs (1)
87var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureEntraIdAppRoleDeploymentTests.cs (8)
29var projectDirectory = Path.Combine(deployment.Workspace.Path, "EntraRoles"); 40Path.Combine(projectDirectory, "apphost.cs"), "Read orders.", "Read all orders."); 46var appHost = Path.Combine(projectDirectory, "apphost.cs"); 57var appHostPath = Path.Combine(projectDirectory, "apphost.cs"); 105File.Delete(Path.Combine(projectDirectory, "Api", "Properties", "launchSettings.json")); 106File.Delete(Path.Combine(projectDirectory, "Caller", "Properties", "launchSettings.json")); 107File.WriteAllText(Path.Combine(projectDirectory, "Api", "Program.cs"), """ 134File.WriteAllText(Path.Combine(projectDirectory, "Caller", "Program.cs"), """
AzureEntraIdDeploymentTests.cs (5)
36var projectDirectory = Path.Combine(deployment.Workspace.Path, "EntraDeployment"); 54Path.Combine(projectDirectory, "apphost.cs"), RedirectUri, UpdatedRedirectUri); 63var appHostPath = Path.Combine(projectDirectory, "apphost.cs"); 87File.Delete(Path.Combine(projectDirectory, "Consumer", "Properties", "launchSettings.json")); 88File.WriteAllText(Path.Combine(projectDirectory, "Consumer", "Program.cs"), """
AzureEntraIdStarterDeploymentTests.cs (4)
36WriteStarterWithEntra(Path.Combine(deployment.Workspace.Path, projectName), projectName); 47var appHostPath = Path.Combine(solutionDirectory, $"{projectName}.AppHost", "AppHost.cs"); 77DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(solutionDirectory, $"{projectName}.ApiService", "Program.cs"), 83DotnetProjectDeploymentHelpers.ReplaceInFile(Path.Combine(solutionDirectory, $"{projectName}.Web", "Program.cs"),
AzureEventHubsDeploymentTests.cs (1)
101var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureFunctionsDeploymentTests.cs (8)
80["Functions"] = File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "functions-url.txt")) 100var functions = Directory.CreateDirectory(Path.Combine(root, "functions")).FullName; 104File.WriteAllText(Path.Combine(functions, "package.json"), """ 115File.WriteAllText(Path.Combine(functions, "tsconfig.json"), """ 127File.WriteAllText(Path.Combine(functions, "host.json"), """ 136File.WriteAllText(Path.Combine(functions, "index.ts"), """ 178File.WriteAllText(Path.Combine(root, "apphost.mts"), """ 197File.WriteAllText(Path.Combine(root, "verify-functions.py"), """
AzureKeyVaultDeploymentTests.cs (1)
101var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureLogAnalyticsDeploymentTests.cs (1)
87var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureResourceScopeDeploymentTests.cs (1)
86var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureRoleAssignmentRunModeTests.cs (2)
93var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 112var validateScriptPath = Path.Combine(workspace.WorkspaceRoot.FullName, "validate-role-assignment.py");
AzureSandboxesDeploymentTests.cs (19)
57var defaultUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-default-url.txt"); 58var anonymousUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-anonymous-url.txt"); 59var deployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-deploy-output.txt"); 60var stateMarkerFile = Path.Combine(workspace.WorkspaceRoot.FullName, "dotnet-state-marker"); 247var firstDeployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "first-deploy-output.txt"); 248var secondDeployOutputFile = Path.Combine(workspace.WorkspaceRoot.FullName, "second-deploy-output.txt"); 249var firstUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "first-url.txt"); 250var secondUrlFile = Path.Combine(workspace.WorkspaceRoot.FullName, "second-url.txt"); 251var stateMarkerFile = Path.Combine(workspace.WorkspaceRoot.FullName, "state-marker"); 418var siteDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "site")); 419File.WriteAllText(Path.Combine(siteDir.FullName, "Dockerfile"), """ 424File.WriteAllText(Path.Combine(siteDir.FullName, "index.html"), $$""" 432File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), """ 464var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 465var appHostFilePath = Path.Combine(projectDir, "apphost.cs"); 526var serviceDir = Path.Combine(projectDir, serviceName); 527var propertiesDir = Directory.CreateDirectory(Path.Combine(serviceDir, "Properties")); 573File.WriteAllText(Path.Combine(serviceDir, "Program.cs"), program); 574File.WriteAllText(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """
AzureSandboxesDotnetProjectDeploymentTests.cs (1)
17var appHostPath = Path.Combine(projectDir.FullName, "apphost.cs");
AzureServiceBusDeploymentTests.cs (1)
102var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
AzureStorageDeploymentTests.cs (4)
113var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 260var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 261var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 262var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
AzureStorageRunModeTests.cs (2)
82var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"); 96var validateScriptPath = Path.Combine(workspace.WorkspaceRoot.FullName, "validate-get-resource.py");
FoundryDotnetProjectDeploymentTests.cs (3)
48var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 49var appHostFile = Path.Combine(projectDir, "apphost.cs"); 64FoundryEchoTestApp.Write(Path.Combine(projectDir, "EchoAgent"), marker);
FoundryHostedAgentDeploymentTests.cs (8)
93var appHostFilePath = Path.Combine( 462var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 463var hostedAgentDir = Path.Combine(projectDir, "DotNetHostedAgent"); 464var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 475File.WriteAllText(Path.Combine(hostedAgentDir, "DotNetHostedAgent.csproj"), """ 502File.WriteAllText(Path.Combine(hostedAgentDir, "Program.cs"), """ 574File.WriteAllText(Path.Combine(hostedAgentDir, ".dockerignore"), """ 593var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
FrontDoorDeploymentTests.cs (3)
110var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 111var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 112var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
Helpers\DeploymentE2ETestHelpers.cs (3)
199candidates.Add(Path.Combine(home, ".aspire", "dogfood", $"pr-{prNumber}", "bin", "aspire")); 202candidates.Add(Path.Combine(home, ".aspire", "bin", "aspire")); 203candidates.Add(Path.Combine(home, ".aspire", "aspire"));
Helpers\FoundryEchoTestApp.cs (3)
13File.WriteAllText(Path.Combine(directory, "EchoAgent.csproj"), """ 26File.WriteAllText(Path.Combine(directory, "Program.cs"), """ 39File.WriteAllText(Path.Combine(directory, "EchoAIAgent.cs"), $$"""
KubernetesGatewayTlsDeploymentTests.cs (3)
261var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 262var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 263var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
KubernetesHelmChartDeploymentTests.cs (3)
149var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 150var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 151var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs");
NspStorageKeyVaultDeploymentTests.cs (5)
129var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 130var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 131var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 191var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 192var serverProgramPath = Path.Combine(projectDir, $"{projectName}.Server", "Program.cs");
PythonFastApiDeploymentTests.cs (2)
113var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 114var appHostFilePath = Path.Combine(projectDir, "apphost.mts");
RadiusAzureResourcesDeploymentTests.cs (1)
71var appHostFilePath = Path.Combine(
RadiusStarterDeploymentTests.cs (4)
337var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 338var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 339var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 340var webProgramFilePath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
tests\Shared\CliPackageDiscovery.cs (5)
42.Where(path => IsPointerPackageFileName(Path.GetFileName(path))) 44.OrderBy(package => Path.GetFileName(package.PackagePath), StringComparer.OrdinalIgnoreCase) 55$"Found {matches.Count} Aspire.Cli pointer nupkg files in '{packageDirectory}': {string.Join(", ", matches.Select(p => Path.GetFileName(p.PackagePath)))}. Expected exactly one Aspire.Cli.{{version}}.nupkg package."); 83var fileName = Path.GetFileName(packagePath); 102.Select(Path.GetFileName)
tests\Shared\Hex1bTestHelpers.cs (3)
138recordingsDir = Path.Combine(githubWorkspace, "testresults", "recordings"); 143recordingsDir = Path.Combine(AppContext.BaseDirectory, "TestResults", "recordings", localSubDir); 147return Path.Combine(recordingsDir, $"{testName}.cast");
tests\Shared\PebbleAcmeFixture.cs (1)
187var path = Path.Combine(directory, name);
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
TypeScriptAzureContainerAppJobDeploymentTests.cs (1)
127File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), """
TypeScriptAzureProvisioningDeploymentTests.cs (1)
141File.WriteAllText(Path.Combine(workspace.Path, "apphost.mts"), appHostSource);
TypeScriptExpressDeploymentTests.cs (2)
107var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 108var appHostFilePath = Path.Combine(projectDir, "apphost.mts");
TypeScriptJavaScriptHostingDeploymentTests.cs (7)
123var apiDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "api")); 124File.WriteAllText(Path.Combine(apiDir.FullName, "package.json"), """ 134File.WriteAllText(Path.Combine(apiDir.FullName, "server.js"), """ 144var staticSiteDir = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "staticsite")); 145File.WriteAllText(Path.Combine(staticSiteDir.FullName, "package.json"), """ 155File.WriteAllText(Path.Combine(staticSiteDir.FullName, "index.html"), """ 168File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts"), """
TypeScriptVnetSqlServerInfraDeploymentTests.cs (1)
178var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.mts");
VnetKeyVaultConnectivityDeploymentTests.cs (5)
113var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 114var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 115var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 155var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 156var webProgramPath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
VnetKeyVaultInfraDeploymentTests.cs (1)
99var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
VnetSqlServerConnectivityDeploymentTests.cs (5)
118var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 119var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 120var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 161var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 162var webProgramPath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
VnetSqlServerInfraDeploymentTests.cs (1)
99var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
VnetStorageBlobConnectivityDeploymentTests.cs (5)
115var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 116var appHostDir = Path.Combine(projectDir, $"{projectName}.AppHost"); 117var appHostFilePath = Path.Combine(appHostDir, "AppHost.cs"); 160var projectDir = Path.Combine(workspace.WorkspaceRoot.FullName, projectName); 161var webProgramPath = Path.Combine(projectDir, $"{projectName}.Web", "Program.cs");
VnetStorageBlobInfraDeploymentTests.cs (1)
100var appHostFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs");
Aspire.EndToEnd.Tests (66)
IntegrationServicesFixture.cs (2)
47_testProjectPath = Path.Combine(BuildEnvironment.TestAssetsPath, "testproject"); 56_testProjectPath = Path.Combine(BuildEnvironment.RepoRoot.FullName, "tests", "testproject");
tests\Shared\Playwright\PlaywrightProvider.cs (1)
55var probePath = Path.Combine(repoRoot.FullName, "artifacts", "bin", "playwright-deps");
tests\Shared\Playwright\TestUtils.cs (2)
14if (Directory.Exists(Path.Combine(repoRoot.FullName, ".git")) || File.Exists(Path.Combine(repoRoot.FullName, ".git")))
tests\Shared\TemplatesTesting\AspireProject.cs (21)
23Path.Combine(BuildEnvironment.TestAssetsPath, "nuget8.config"); 32public string ServiceDefaultsProjectPath => Path.Combine(RootDir, $"{Id}.ServiceDefaults"); 33public string TestsProjectDirectory => Path.Combine(RootDir, $"{Id}.Tests"); 48LogPath = Path.Combine(_buildEnv.LogRootPath, Id); 50AppHostProjectDirectory = Path.Combine(RootDir, $"{Id}.AppHost"); 65File.WriteAllText(Path.Combine(dir, "Directory.Build.props"), "<Project />"); 66File.WriteAllText(Path.Combine(dir, "Directory.Build.targets"), "<Project />"); 72string targetNuGetConfigPath = Path.Combine(dir, "nuget.config"); 93projectDir = Path.Combine(rootDir, id); 97rootDir = projectDir = Path.Combine(BuildEnvironment.TestRootPath, id); 100string logPath = Path.Combine(BuildEnvironment.ForDefaultFramework.LogRootPath, id); 107File.WriteAllText(Path.Combine(rootDir, "Directory.Build.props"), "<Project />"); 108File.WriteAllText(Path.Combine(rootDir, "Directory.Build.targets"), "<Project />"); 115cmd.WithWorkingDirectory(Path.GetDirectoryName(projectDir)!) 153File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "EndPointWriterHook_cs"), Path.Combine(project.AppHostProjectDirectory, "EndPointWriterHook.cs")); 154string programCsPath = Path.Combine(project.AppHostProjectDirectory, "AppHost.cs"); 257_testOutput.WriteLine($"----------- [{Path.GetFileName(AppHostProjectDirectory)}] app has exited -------------"); 336workingDirectory ??= Path.Combine(RootDir, $"{Id}.AppHost"); 340var res = await restoreCmd.ExecuteAsync($"restore \"-bl:{Path.Combine(LogPath!, $"{Id}-restore.binlog")}\" /p:TreatWarningsAsErrors=true"); 343var buildArgs = $"build \"-bl:{Path.Combine(LogPath!, $"{Id}-build.binlog")}\" /p:TreatWarningsAsErrors=true";
tests\Shared\TemplatesTesting\BuildEnvironment.cs (28)
26? Path.GetTempPath() 27: Environment.GetEnvironmentVariable("DEV_TEMP") is { } devTemp && Path.Exists(devTemp) 29: Path.GetTempPath(); 32public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets"); 33public static readonly string TestRootPath = Path.Combine(TempDir, "templates-testroot"); 79var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName); 82sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath); 87string workloadsProjString = Path.Combine("tests", "workloads.proj"); 98.Split(Path.PathSeparator) 99.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 105sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 111BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping"); 121.Split(Path.PathSeparator) 122.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 128sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 138string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath); 144sdkForTemplatePath = Path.Combine(baseDir, sdkDirName); 159sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath); 163NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null; 171EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"; 183var runtimeRoot = Path.Combine(s_testRoot.Value, $"runtime-{Guid.NewGuid():N}"); 186var dashboardPath = Path.Combine(dashboardRoot, "tools", OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"); 187var dcpPath = Path.Combine(dcpRoot, "tools", OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"); 193EnvVars["DcpDir"] = Path.GetDirectoryName(dcpPath)!; 198var destination = Path.Combine(runtimeRoot, directory); 223DotNet = Path.Combine(sdkForTemplatePath!, "dotnet"); 231LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath); 236LogRootPath = 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 (320)
ApplicationModel\AppHostLocalStateStore.cs (4)
52?? Path.GetFullPath(appHostDirectory); 54_stateDirectory = Path.Combine(appHostDirectory, ".aspire", "state"); 55_statePath = Path.Combine(_stateDirectory, $"{identityHash}.json"); 197var ignorePath = Path.Combine(_stateDirectory!, ".gitignore");
ApplicationModel\AspireStore.cs (5)
27if (!Path.IsPathRooted(basePath)) 47filenameTemplate = Path.GetFileName(filenameTemplate); 62var name = Path.GetFileNameWithoutExtension(filenameTemplate); 63var ext = Path.GetExtension(filenameTemplate); 64var finalFilePath = Path.Combine(_basePath, $"{name}.{Convert.ToHexString(hash.GetCurrentHash())[..12].ToLowerInvariant()}{ext}");
ApplicationModel\CertificateTrustConfigurationCallbackAnnotation.cs (1)
132var bundleFilename = IsContainer ? $"{RootCertificatesPath}/bundles/{bundleId}" : Path.Join(RootCertificatesPath, "bundles", bundleId);
ApplicationModel\ContainerFileSystemCallbackAnnotation.cs (6)
32if (Path.GetDirectoryName(value) != string.Empty) 141var fullPath = Path.GetFullPath(path); 157var fileName = Path.GetFileName(relativePath); 158var parts = relativePath.Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries); 216Name = Path.GetFileName(fullPath),
ApplicationModel\ContainerMountAnnotation.cs (1)
31if (!Path.IsPathRooted(source))
ApplicationModel\DockerfileBuildAnnotation.cs (5)
149var targetDirectory = Path.GetDirectoryName(Path.GetFullPath(dockerfilePath)); 172var contextRootIgnore = Path.Combine(ContextPath, ".dockerignore"); 195return string.Equals(Path.GetFullPath(path), Path.GetFullPath(otherPath), comparison);
ApplicationModel\DotnetProgramPublishing.cs (6)
202var projectDirectory = Path.GetDirectoryName(projectMetadata.ProjectPath)!; 243var normalizedArchivePath = Path.Combine(stagedArchiveDirectory.Path, "normalized.tar"); 315: Path.Combine(outputPath, $"{ResourceExtensions.FlattenContainerImageName(imageName)}.tar"); 333var destinationDirectory = Path.GetDirectoryName(destinationPath); 339var tempPath = Path.Combine( 341$".{Path.GetFileName(destinationPath)}.{Guid.NewGuid():N}.tmp");
ApplicationModel\ExecutableLaunchRecipe.cs (2)
459var workingDirectory = executableAnnotation?.WorkingDirectory ?? Path.GetDirectoryName(projectMetadata.ProjectPath) ?? string.Empty; 873string.Equals(Path.GetFileNameWithoutExtension(executableAnnotation.Command), "dotnet", StringComparison.OrdinalIgnoreCase);
ApplicationModel\ProjectRebuilderResource.cs (1)
23: base(name, "dotnet", Path.GetDirectoryName(projectPath)!)
ApplicationModel\RequiredCommandValidator.cs (3)
195if (command.IndexOfAny([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]) >= 0) 197var candidate = Path.GetFullPath(command);
ApplicationModel\ResourceExtensions.cs (2)
1453return Path.Combine(outputPath, fileName); 1471return !Directory.Exists(outputPath) && Path.HasExtension(outputPath);
Backchannel\BackchannelService.cs (1)
47SocketPermissionHelper.CreateDirectory(Path.GetDirectoryName(unixSocketPath)!, repairExisting: false);
ContainerResourceBuilderExtensions.cs (19)
327var sourcePath = Path.IsPathRooted(source) ? source : Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory); 719var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 720.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 724var fullyQualifiedDockerfilePath = Path.GetFullPath(dockerfilePath, fullyQualifiedContextPath); 856var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 857.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 1521var sourceFullPath = Path.GetFullPath(sourcePath, builder.ApplicationBuilder.AppHostDirectory); 1703if (!Path.IsPathFullyQualified(existingSource) || !Path.IsPathFullyQualified(source)) 1710Path.TrimEndingDirectorySeparator(Path.GetFullPath(existingSource)), 1711Path.TrimEndingDirectorySeparator(Path.GetFullPath(source)), 1790var fullyQualifiedContextPath = Path.GetFullPath(contextPath, builder.ApplicationBuilder.AppHostDirectory) 1791.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Dashboard\DashboardEventHandlers.cs (15)
88if (string.Equals(".dll", Path.GetExtension(dashboardPath), StringComparison.OrdinalIgnoreCase)) 91originalRuntimeConfig = Path.ChangeExtension(dashboardPath, ".runtimeconfig.json"); 97var directory = Path.GetDirectoryName(dashboardPath)!; 98var fileName = Path.GetFileName(dashboardPath); 99var baseName = Path.GetExtension(fileName) switch 101".exe" => Path.GetFileNameWithoutExtension(fileName), // Windows: remove .exe 104originalRuntimeConfig = Path.Combine(directory, $"{baseName}.runtimeconfig.json"); 125var fullyQualifiedDashboardPath = Path.GetFullPath(dashboardPath); 126var dashboardWorkingDirectory = Path.GetDirectoryName(fullyQualifiedDashboardPath); 176if (string.Equals(".dll", Path.GetExtension(dashboardPath), StringComparison.OrdinalIgnoreCase)) 181var directory = Path.GetDirectoryName(dashboardPath)!; 182var fileName = Path.GetFileName(dashboardPath); 186var assemblyPath = Path.Combine(directory, $"{baseName}.dll"); 603!Path.IsPathFullyQualified(dataDirectory)) 605context.EnvironmentVariables[name] = Path.GetFullPath(dataDirectory, appHostDirectory);
Dcp\DcpHost.cs (6)
439Path.GetDirectoryName(Path.GetFullPath(terminalHostPath)) is not { } directory) 471Path.Combine(directory, "runtimes", runtimeIdentifier, "native") 476if (File.Exists(Path.Combine(candidate, "conpty.dll")) && 477File.Exists(Path.Combine(candidate, nativeHostDirectory, "OpenConsole.exe"))) 527SocketPermissionHelper.CreateDirectory(Path.GetDirectoryName(socketPath)!, repairExisting: true);
Dcp\DcpOptions.cs (3)
265if (Path.GetDirectoryName(options.CliPath) is string dcpDir && !string.IsNullOrEmpty(dcpDir)) 267options.ExtensionsPath = Path.Combine(dcpDir, "ext"); 274options.ExtensionsPath = Path.Combine(configDcpPath, "ext");
Dcp\ExecutableConfigurationResolver.cs (17)
39var bundleOutputPath = Path.Join(certificatesRootDirectory, "cert.pem"); 40var customBundleOutputPath = Path.Join(certificatesRootDirectory, "bundles"); 41var certificatesOutputPath = Path.Join(certificatesRootDirectory, "certs"); 42var baseServerAuthOutputPath = Path.Join(certificatesRootDirectory, "private"); 57Path.PathSeparator, 73CertificateDirectoriesPath = ReferenceExpression.Create($"{string.Join(Path.PathSeparator, directories)}"), 79CertificatePath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.crt")}"), 80KeyPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.key")}"), 81CertificateWithKeyPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.pem")}"), 82PfxPath = ReferenceExpression.Create($"{Path.Join(baseServerAuthOutputPath, $"{certificate.Thumbprint}.pfx")}"), 109File.WriteAllBytes(Path.Join(customBundleOutputPath, bundleFactory.Key), bundleBytes); 125File.WriteAllText(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.crt"), publicCertificatePem); 130File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.key"), keyBytes); 134Path.Join(baseServerAuthOutputPath, $"{thumbprint}.pem"), 144File.WriteAllBytes(Path.Join(baseServerAuthOutputPath, $"{thumbprint}.pfx"), pfxBytes); 174return Path.Join(_aspireStore.BasePath, "dcp", "executables", executable.Metadata.Name, "certificates"); 177return Path.Join(_locations.DcpSessionDir, executable.Metadata.Name);
Dcp\ExecutableCreator.cs (1)
314Path.GetDirectoryName(projectMetadata.ProjectPath);
Dcp\Locations.cs (2)
20public string DcpKubeconfigPath => Path.Combine(DcpSessionDir, "kubeconfig"); 22public string DcpLogSocket => Path.Combine(DcpSessionDir, "output.sock");
Dcp\ResourceSnapshotBuilder.cs (1)
296var executableName = Path.GetFileName(resource.Spec.ExecutablePath);
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)!);
DeveloperCertificateService.cs (4)
147private static readonly string s_userDevCertificateLocation = Path.Combine( 249var certFileName = Path.Join(s_userDevCertificateLocation, $"{lookup}.crt"); 250var pfxFileName = Path.Join(s_userDevCertificateLocation, $"{lookup}.pfx"); 251var keyFileName = Path.Join(s_userDevCertificateLocation, $"{lookup}.key");
Diagnostics\ProfilingTelemetry.cs (1)
259new(Tags.AppHostName, Path.GetFileName(appHostPath)),
DistributedApplicationBuilder.cs (11)
279var appHostPath = Path.Join(AppHostDirectory, appHostName); 282AppHostPath = Path.GetFullPath(appHostPath); 340!string.Equals(Path.GetExtension(appHostFilePath), ".csproj", StringComparison.OrdinalIgnoreCase); 344? PathNormalizer.ResolvePathCasing(Path.GetFullPath(appHostFilePath!)) 466return new AspireStore(Path.Combine(aspireDir, ".aspire"), directoryService); 993return Path.GetFullPath(configuredAspireSecretsFile); 1069var secretsFile = new FileInfo(Path.GetFullPath(aspireSecretsFile)); 1119var userSecretsFilePath = Path.GetFullPath(UserSecretsPathHelper.GetSecretsPathFromSecretsId(userSecretsId)); 1153string.Equals(Path.GetFullPath(left), Path.GetFullPath(right), OperatingSystem.IsWindows() ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal); 1273return Path.GetFullPath(appHostDirectory);
DistributedApplicationOptions.cs (11)
173if (string.IsNullOrEmpty(appHostFilePath) || string.Equals(Path.GetExtension(appHostFilePath), ".csproj", StringComparison.OrdinalIgnoreCase)) 181return Path.GetFileName(Path.TrimEndingDirectorySeparator(projectDirectory)); 184var appHostDirectory = Path.GetDirectoryName(appHostFilePath); 187: Path.GetFileName(Path.TrimEndingDirectorySeparator(appHostDirectory)); 196return Path.GetFullPath(entryPointFilePath); 207var fullPath = Path.GetFullPath(projectPath); 213var csprojPath = Path.Combine(fullPath, $"{name}.csproj"); 234var csprojPath = Path.Combine(projectDirectory, $"{projectName}.csproj"); 237return Path.GetFullPath(csprojPath);
ExecutableResourceBuilderExtensions.cs (3)
61workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 164dockerfileContextPath = Path.GetDirectoryName(projectMetadata.ProjectPath) ?? dockerfileContextPath; 233workingDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.ApplicationBuilder.AppHostDirectory, workingDirectory));
IProjectMetadata.cs (1)
69public bool IsFileBasedApp => string.Equals(Path.GetExtension(ProjectPath), ".cs", StringComparison.OrdinalIgnoreCase);
Pipelines\DefaultPipelineOutputComparer.cs (3)
41changes.Add(new(PipelineOutputChangeKind.Added, Path.GetRelativePath(outputDirectory, path))); 45changes.Add(new(PipelineOutputChangeKind.Removed, Path.GetRelativePath(outputDirectory, path))); 50changes.Add(new(PipelineOutputChangeKind.Changed, Path.GetRelativePath(outputDirectory, path)));
Pipelines\GitPipelineOutputReader.cs (9)
69return new(Path.GetFullPath(pathToRoot.IsEmpty ? "." : pathToRoot.ToString(), directory), processRunner); 84var scope = string.Equals(directory, Path.TrimEndingDirectorySeparator(repositoryRoot), PipelineOutputRoot.PathComparison) ? ":/" : 85literal + Path.GetRelativePath(repositoryRoot, directory).Replace(Path.DirectorySeparatorChar, '/').TrimEnd('/'); 90.Select(path => Path.GetRelativePath(directory, path)); 96var file = new FileInfo(Path.GetFullPath(match.Path, directory)); 133var path = Path.GetFullPath(entry.Path, repositoryRoot); 164paths.Add(Path.GetFullPath(path.ToString(), repositoryRoot)); 188working[Path.GetFullPath(entry.Path, repositoryRoot)] = entry;
Pipelines\Internal\FileDeploymentStateManager.cs (7)
212aspireHome = Path.Combine( 217var aspireDir = Path.Combine( 223return Path.Combine(aspireDir, $"{environment}.json"); 457var deploymentStateDirectory = Path.GetDirectoryName(statePath)!; 459var temporaryStatePath = Path.Combine( 461$".{Path.GetFileName(statePath)}.{Guid.NewGuid():N}.tmp"); 492var stateDirectory = Path.GetDirectoryName(statePath)!;
Pipelines\PipelineOutputChange.cs (3)
5using IOPath = System.IO.Path; 24if (IOPath.IsPathRooted(path) || path.IndexOfAny(IOPath.GetInvalidPathChars()) >= 0)
Pipelines\PipelineOutputDiffOptionsValidator.cs (1)
24Path.IsPathRooted(rule.Pattern) || rule.Pattern.Replace('\\', '/').Split('/').Contains(".."))
Pipelines\PipelineOutputDirectory.cs (1)
37new PipelineOutputDirectory(new DirectoryInfo(Path.GetFullPath(path, _directory.FullName)), cancellationToken);
Pipelines\PipelineOutputRoot.cs (4)
18return Path.TrimEndingDirectorySeparator(Path.GetFullPath(directoryPath)); 31path.StartsWith(Path.EndsInDirectorySeparator(directory) ? directory : directory + Path.DirectorySeparatorChar, PathComparison);
Pipelines\PipelineOutputService.cs (6)
36_outputPath = options.Value.OutputPath is not null ? Path.GetFullPath(options.Value.OutputPath) : null; 39: Path.Combine(Environment.CurrentDirectory, "aspire-output"); 53baseDirectory = Path.GetFullPath(appHostDirectory); 61return Path.Combine(baseDirectory, "aspire-output"); 76return Path.Combine(baseOutputDir, resource.Name); 91return Path.Combine(baseTempDir, resource.Name);
Pipelines\PipelineOutputSnapshotter.cs (1)
63.Select(match => Path.GetFullPath(match.Path, directory)).Where(path => PipelineOutputRoot.IsWithinDirectory(directory, path))
ProjectResourceBuilderExtensions.cs (10)
349projectPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, projectPath)); 452path = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, path)); 577var projectDirectory = Path.GetDirectoryName(currentProjectMetadata.ProjectPath); 1087var projectDirectoryPath = Path.GetDirectoryName(projectFilePath) ?? throw new InvalidOperationException($"Unable to get directory name for {projectFilePath}"); 1118var projectDirectoryPath = Path.GetDirectoryName(projectMetadata.ProjectPath)!; 1120var appSettingsPath = Path.Combine(projectDirectoryPath, "appsettings.json"); 1121var appSettingsEnvironmentPath = Path.Combine(projectDirectoryPath, $"appsettings.{env}.json"); 1123var appFileName = Path.GetFileName(projectDirectoryPath); 1124var appNameSettingsPath = Path.Combine(projectDirectoryPath, $"{appFileName}.settings.json"); 1125var appNameSettingsEnvironmentPath = Path.Combine(projectDirectoryPath, $"{appFileName}.settings.{env}.json");
Publishing\ContainerImageArchiveRewriter.cs (2)
60var sourceFullPath = Path.GetFullPath(sourceArchivePath); 61var destinationFullPath = Path.GetFullPath(destinationArchivePath);
Publishing\DockerContainerRuntime.cs (2)
179var normalizedContextPath = Path.TrimEndingDirectorySeparator(Path.GetFullPath(contextPath));
Publishing\ManifestPublisher.cs (2)
45_options.Value.OutputPath = Path.Combine(_options.Value.OutputPath, "aspire-manifest.json"); 60var fullyQualifiedPath = Path.GetFullPath(_options.Value.OutputPath);
Publishing\ManifestPublishingContext.cs (8)
95var fullyQualifiedManifestPath = Path.GetFullPath(ManifestPath); 96var manifestDirectory = Path.GetDirectoryName(fullyQualifiedManifestPath) ?? throw new DistributedApplicationException("Could not get directory name of output path"); 98var normalizedPath = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 99var relativePath = Path.GetRelativePath(manifestDirectory, normalizedPath); 442var manifestDirectory = Path.GetDirectoryName(Path.GetFullPath(ManifestPath))!; 443var resourceDockerfilePath = Path.Combine(manifestDirectory, $"{container.Name}.Dockerfile");
Publishing\ManifestPublishingExtensions.cs (2)
52outputPath = Path.Combine(outputPath, "aspire-manifest.json"); 70var fullyQualifiedPath = Path.GetFullPath(outputPath);
Publishing\PodmanContainerRuntime.cs (4)
274var archivePath = Path.GetFullPath(ResourceExtensions.GetContainerImageArchivePath(options.OutputPath!, imageName)); 275var archiveDirectory = Path.GetDirectoryName(archivePath)!; 280var stagingPrefix = Path.Combine(archiveDirectory, $".{Path.GetFileName(archivePath)}.{Guid.NewGuid():N}");
Publishing\ResourceContainerImageManager.cs (3)
806Path.GetDirectoryName(projectMetadata.ProjectPath); 1062var archivePath = Path.GetFullPath(ResourceExtensions.GetContainerImageArchivePath(outputPath, imageName, imageTag)); 1063Directory.CreateDirectory(Path.GetDirectoryName(archivePath)!);
Publishing\WslcContainerRuntime.cs (2)
78var normalizedContextPath = Path.TrimEndingDirectorySeparator(Path.GetFullPath(contextPath));
ResourceBuilderExtensions.cs (2)
5489var workingDirectory = Path.GetFullPath(builder.Resource.WorkingDirectory); 5495ScriptPath = Path.GetFullPath(scriptPath, workingDirectory),
src\Shared\BackchannelConstants.cs (9)
106=> Path.Combine(homeDirectory, SocketDirectoryNames.Aspire, SocketDirectoryNames.Cli, SocketDirectoryNames.Backchannels); 114=> Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 260var socketPath = Path.Combine(dir, $"{appHostId}{instanceId}.{processId.ToString(CultureInfo.InvariantCulture)}"); 278var socketPath = Path.Combine(dir, socketName); 316return Path.Combine(dir, appHostId); 360var fileName = Path.GetFileName(socketPath); 395var fileName = Path.GetFileName(socketPath); 541var fileName = Path.GetFileName(f); 569var fileName = Path.GetFileName(f);
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\DotnetSdkVersionProbe.cs (3)
86normalizedWorkingDirectory = Path.GetFullPath(workingDirectory ?? Environment.CurrentDirectory); 272var physicalWorkingDirectory = PathNormalizer.ResolveSymlinks(Path.GetFullPath(workingDirectory)); 275var globalJsonPath = Path.Combine(directory.FullName, "global.json");
src\Shared\FileLock.cs (1)
163var directory = Path.GetDirectoryName(lockPath);
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
85null => Path.Combine("Properties", "launchSettings.json"), 86_ => Path.Combine(projectFileInfo.DirectoryName, "Properties", "launchSettings.json") 99var runSettingsFilePath = Path.ChangeExtension(projectMetadata.ProjectPath, ".run.json");
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (3)
21? Path.Combine("Properties", "launchSettings.json") 22: Path.Combine(Path.GetFullPath(directoryPath), "Properties", "launchSettings.json");
src\Shared\MsBuildResponseFile.cs (1)
29var responseFilePath = Path.Combine(directory.Path, "build-properties.rsp");
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
src\Shared\ProjectPathResolver.cs (1)
43return Path.GetFullPath(projectFiles[0]);
src\Shared\SocketPermissionHelper.cs (8)
39var directory = new DirectoryInfo(Path.GetFullPath(path, currentDirectory)); 40var tempRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(tempDirectory, currentDirectory)); 43: Path.TrimEndingDirectorySeparator(Path.GetFullPath(userProfileDirectory, currentDirectory)); 46var isWorkingDirectory = string.Equals(directory.FullName, Path.TrimEndingDirectorySeparator(currentDirectory), comparison); 48var isTemporaryRoot = string.Equals(Path.TrimEndingDirectorySeparator(directory.FullName), tempRoot, comparison); 113var directory = Path.GetDirectoryName(socketPath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
src\Shared\TerminalHost\TerminalHostPaths.cs (4)
87return Path.Combine(homeDirectory, DotAspireDirectoryName, TrmnlDirectoryName); 112return Path.Combine(trmnlDirectory, $"{replicaId}.{sockPurpose}.sock"); 123return Path.Combine(trmnlDirectory, $"{replicaId}.{MetadataSuffix}"); 149var fileName = Path.GetFileName(path);
src\Shared\UserSecrets\AspireSecretsPathHelper.cs (3)
32.Where(path => string.Equals(Path.GetFileName(path), $"{environmentName}.json", StringComparison.OrdinalIgnoreCase)) 45return Path.Combine(directory, $"{environmentName}.json"); 83return Path.Combine(homeDirectory.FullName, ".aspire", SecretsDirectoryName, safeAppHostId);
src\Shared\UserSecrets\SecretsStore.cs (3)
116var directory = Path.GetDirectoryName(filePath); 135var tempFilename = Path.Combine(directory, $".{Path.GetFileName(filePath)}.{Guid.NewGuid():N}.tmp");
src\Shared\UserSecrets\UserSecretsPathHelper.cs (2)
52? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 53: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
src\Shared\VolumeMountPathResolver.cs (3)
54return Path.GetFullPath(Path.Combine([Path.GetFullPath(store.BasePath), .. pathSegments]));
TestResourceBuilderExtensions.cs (4)
86testingContext = new TestingContext(Path.GetFullPath(outputPath)); 152var resourceOutputPath = Path.Combine(runOutputPath, resourceName); 156var reservationPath = Path.Combine(runOutputPath, $".{resourceName.ToLowerInvariant()}.reserve"); 171.Any(path => string.Equals(Path.GetFileName(path), resourceName, StringComparison.OrdinalIgnoreCase)))
UserSecrets\UserSecretsManagerFactory.cs (4)
41var normalizedPath = Path.GetFullPath(filePath); 42var normalizedLegacyPath = string.IsNullOrWhiteSpace(legacyUserSecretsFilePath) ? null : Path.GetFullPath(legacyUserSecretsFilePath); 194string.Equals(Path.GetFullPath(left), Path.GetFullPath(right), OperatingSystem.IsWindows() ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
Utils\FileSystemService.cs (2)
167var filePath = Path.Combine(tempDir, fileName); 276var parentDir = System.IO.Path.GetDirectoryName(_path);
Utils\Hex1bPtySocketHelper.cs (4)
34directory = Path.Combine(home, SocketDirectoryNames.Aspire, SocketDirectoryNames.Pty); 37directory = Path.GetFullPath(directory); 40var proxyDirectory = Path.Combine(directory, "proxy"); 41var socketPath = Path.Combine(proxyDirectory, $"{Guid.NewGuid():N}.socket");
Aspire.Hosting.Analyzers (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Analyzers.Tests (1)
AnalyzerTest.cs (1)
58Path.Combine("ref", $"net{s_targetFrameworkVersion}"));
Aspire.Hosting.Azure (23)
AzureBicepResource.cs (4)
171? Path.Combine(directory ?? s_temporaryStorage.CreateTempSubdirectory("aspire").FullName, $"{Name.ToLowerInvariant()}.module.bicep") 172: Path.Combine(TempDirectory, $"{Name.ToLowerInvariant()}.module.bicep"); 183: Path.Combine(directory, $"{TemplateResourceName.ToLowerInvariant()}"); 235using var template = GetBicepTemplateFile(Path.GetDirectoryName(context.ManifestPath), deleteTemporaryFileOnDispose: false);
AzureBicepResourceExtensions.cs (2)
29var path = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, bicepFile));
AzureProvisioningResource.cs (2)
132var moduleSourcePath = Path.Combine(generationPath, "main.bicep"); 135var moduleDestinationPath = Path.Combine(directory ?? generationPath, $"{Name}.module.bicep");
AzurePublishingContext.cs (4)
186var modulePath = Path.Combine(moduleDirectory.FullName, $"{resource.Name}.bicep"); 497var resourceDockerfilePath = Path.Combine(outputPath, $"{resource.Name}.Dockerfile"); 509var modulePath = Path.Combine(moduleDirectory.FullName, $"{resource.Name}.bicep"); 642var bicepPath = Path.Combine(outputDirectoryPath, $"{MainInfrastructure.BicepName}.bicep");
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
Aspire.Hosting.Azure.ApiManagement (2)
AzureApiManagementExtensions.cs (2)
241var fullPath = Path.GetFullPath(documentPath, builder.ApplicationBuilder.AppHostDirectory); 3176return Path.GetExtension(pathWithoutQuery).ToLowerInvariant() switch
Aspire.Hosting.Azure.EntraId (2)
LocalDeveloperCertificateStore.cs (2)
19internal string GetPath(string resourceName) => Path.Combine(store.BasePath, "dev-certs", "Entra", $"{resourceName}.pfx"); 24var directory = Path.GetDirectoryName(path)!;
Aspire.Hosting.Azure.EntraId.Tests (37)
EntraIdApiProvisioningTests.cs (3)
786await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 787.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-api", "entra-api.bicep")), "bicep") 788.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep");
EntraIdAppRoleAssignmentTests.cs (3)
253await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 255.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-api", "entra-api.bicep")), "bicep") 256.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "worker", "worker.bicep")), "bicep");
EntraIdProvisioningTests.cs (13)
891await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 892.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep"); 918await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 919.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep"); 946await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep"); 976await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep") 977.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")), "bicep"); 1007await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "web", "web.bicep")), "bicep"); 1044var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1045var apiBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-api", "entra-api.bicep")); 1046var webBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "entra-web", "entra-web.bicep")); 1047var consumerBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "consumer", "consumer.bicep")); 1048Assert.Equal(new[] { "consumer", "entra-api", "entra-web" }, Directory.GetDirectories(workspace.Path).Select(Path.GetFileName).Order());
EntraIdStarterScenarioPublishTests.cs (10)
29var outputPath = Path.Combine(workspace.Path, "out"); 70await Verify(await File.ReadAllTextAsync(Path.Combine(outputPath, "main.bicep")), "bicep") 71.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(outputPath, "apiservice-entra", "apiservice-entra.bicep")), "bicep") 72.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(outputPath, "webfrontend-entra", "webfrontend-entra.bicep")), "bicep") 73.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(outputPath, "apiservice", "apiservice.bicep")), "bicep") 74.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(outputPath, "webfrontend", "webfrontend.bicep")), "bicep"); 80var directory = Directory.CreateDirectory(Path.Combine(root, "src", name)).FullName; 81var projectPath = Path.Combine(directory, $"{name}.csproj"); 89Directory.CreateDirectory(Path.Combine(directory, "Properties")); 90File.WriteAllText(Path.Combine(directory, "Properties", "launchSettings.json"), $$"""
LocalDeveloperCertificateTests.cs (6)
58Path.Combine(app.Services.GetRequiredService<IAspireStore>().BasePath, "dev-certs", "Entra", "entra-web.pfx"), 81Assert.Equal(["entra-web.pfx", "entra-web.pfx.lock"], Directory.GetFiles(Path.GetDirectoryName(path)!).Select(Path.GetFileName).Order(StringComparer.Ordinal)); 113Assert.Single(Directory.GetFiles(Path.GetDirectoryName(store.GetPath("entra-web"))!, "*.pfx")); 233Assert.Equal(UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute, File.GetUnixFileMode(Path.GetDirectoryName(path)!)); 247Assert.False(Directory.Exists(Path.Combine(app.Services.GetRequiredService<IAspireStore>().BasePath, "dev-certs")));
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Azure.Functions (15)
AzureFunctionsProjectResourceExtensions.cs (9)
167projectPath = NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, projectPath)); 221var normalizedAppDirectory = NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory)); 448if (File.Exists(Path.Combine(resource.AppDirectory, "Dockerfile"))) 461var hasPackageJson = File.Exists(Path.Combine(resource.AppDirectory, "package.json")); 462var hasPackageLock = File.Exists(Path.Combine(resource.AppDirectory, "package-lock.json")); 759path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 761return Path.GetFullPath(path); 791return Path.GetFullPath(projectFiles[0]);
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
85null => Path.Combine("Properties", "launchSettings.json"), 86_ => Path.Combine(projectFileInfo.DirectoryName, "Properties", "launchSettings.json") 99var runSettingsFilePath = Path.ChangeExtension(projectMetadata.ProjectPath, ".run.json");
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (3)
21? Path.Combine("Properties", "launchSettings.json") 22: Path.Combine(Path.GetFullPath(directoryPath), "Properties", "launchSettings.json");
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentResource.AksPipeline.cs (1)
286var kubeConfigPath = Path.Combine(kubeConfigDir.Path, "kubeconfig");
Aspire.Hosting.Azure.Kubernetes.Tests (36)
AzureKubernetesEnvironmentExtensionsTests.cs (30)
608var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 609var clusterBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 610var roleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "cluster-roles", "cluster-roles.bicep")); 818var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 819var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 820var roleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, roles.Name, $"{roles.Name}.bicep")); 821var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "registry", "registry.bicep")); 822var controlPlaneBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity", "aks-control-plane-identity.bicep")); 823var kubeletBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-kubelet-identity", "aks-kubelet-identity.bicep")); 824var operatorBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity-roles-aks-kubelet-identity", "aks-control-plane-identity-roles-aks-kubelet-identity.bicep")); 1033var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1034var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 1035var roleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, roles.Name, $"{roles.Name}.bicep")); 1036var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "registry", "registry.bicep")); 1131var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1132var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 1133var operatorBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, operatorRole.Name, $"{operatorRole.Name}.bicep")); 1134var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-acr", "aks-acr.bicep")); 1135var controlPlaneBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity", "aks-control-plane-identity.bicep")); 1136var kubeletBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-kubelet-identity", "aks-kubelet-identity.bicep")); 1137var registryRoleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, registryRole.Name, $"{registryRole.Name}.bicep")); 1221var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 1222var registryBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "registry", "registry.bicep")); 1223var registryRoleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, registryRole.Name, $"{registryRole.Name}.bicep")); 1224var networkBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "network", "network.bicep")); 1225var networkRoleBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, networkRole.Name, $"{networkRole.Name}.bicep")); 1226var aksBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks", "aks.bicep")); 1227var controlPlaneBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-control-plane-identity", "aks-control-plane-identity.bicep")); 1228var kubeletBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "aks-kubelet-identity", "aks-kubelet-identity.bicep")); 1230var operatorBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, operatorRoleName, $"{operatorRoleName}.bicep"));
AzureKubernetesIngressTests.cs (1)
32var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
AzureKubernetesPersistentVolumeTests.cs (3)
40var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 92var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 96var statefulSetPath = Path.Combine(workspace.Path, "templates", "service", "statefulset.yaml");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Azure.Kusto (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Azure.Kusto.Tests (3)
AddAzureKustoTests.cs (1)
240Assert.Equal(Path.Combine(builder.AppHostDirectory, "custom-data"), mountAnnotation.Source);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Azure.PostgreSQL (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Azure.Provisioning.Tests (2)
ProvisioningGeneratorTest.cs (2)
16.Split(Path.PathSeparator) 17.Where(static path => Path.GetFileNameWithoutExtension(path) is not (
Aspire.Hosting.Azure.Sandboxes (5)
AzureSandboxContainerDeployment.cs (4)
852var stateDirectory = Path.GetDirectoryName(Path.GetFullPath(stateFilePath)) 854var deploymentsDirectory = Path.GetDirectoryName(stateDirectory) ?? stateDirectory; 857var lockPath = Path.Combine(
src\Shared\FileLock.cs (1)
163var directory = Path.GetDirectoryName(lockPath);
Aspire.Hosting.Azure.Sql (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Azure.Storage (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Azure.Tests (102)
AzureApiManagementTests.cs (10)
444var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 480var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 938var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 972var documentPath = Path.Combine(workspace.Path, "deploy-only.json"); 996var documentPath = Path.Combine(workspace.Path, "deploy-only.json"); 1023var documentPath = Path.Combine(workspace.Path, "generated.json"); 1049var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 1143var documentPath = Path.Combine(temporaryWorkspace.Path, "catalog.json"); 1252Path.Combine(builder.AppHostDirectory, "catalog.json"), 2153var mainBicepPath = Path.Combine(workspace.Path, "main.bicep");
AzureAppServiceTests.cs (5)
509File.WriteAllText(Path.Combine(directory.FullName, "Dockerfile"), ""); 632var mainBicepPath = Path.Combine(workspace.Path, "main.bicep"); 636var envBicepPath = Path.Combine(workspace.Path, "env", "env.bicep"); 640var apiBicepPath = Path.Combine(workspace.Path, "api", "api.bicep"); 833Path.Combine(workspace.Path, "aspire-manifest.json"),
AzureBicepResourceTests.cs (4)
257var bicepFilePath = Path.Combine(workspace.Path, bicepFileName); 264var outputDir = Path.Combine(workspace.Path, "output"); 282var bicepFilePath = Path.Combine(workspace.Path, bicepFileName); 306var outputDir = Path.Combine(workspace.Path, "output");
AzureContainerAppEnvironmentExtensionsTests.cs (3)
566var mainBicepPath = Path.Combine(workspace.Path, "main.bicep"); 570var envBicepPath = Path.Combine(workspace.Path, "env", "env.bicep"); 607Assert.True(File.Exists(Path.Combine(workspace.Path, "main.bicep")));
AzureContainerAppExpressEndpointTests.cs (1)
267Assert.True(File.Exists(Path.Combine(workspace.Path, "main.bicep")));
AzureContainerAppsTests.cs (3)
86File.WriteAllText(Path.Combine(directory.FullName, "Dockerfile"), ""); 2037await VerifyFile(Path.Combine(workspace.Path, "aspire-manifest.json")); 2835File.WriteAllText(Path.Combine(workspace.Path, "Dockerfile"), "FROM alpine");
AzureDeployerTests.cs (2)
1932var deploymentStatePath = Path.Combine( 1939Directory.CreateDirectory(Path.GetDirectoryName(deploymentStatePath)!);
AzureEnvironmentResourceTests.cs (26)
149var mainBicepPath = Path.Combine(workspace.FullName, "main.bicep"); 153var envBicepPath = Path.Combine(workspace.FullName, "env", "env.bicep"); 186var mainBicepPath = Path.Combine(workspace.FullName, "main.bicep"); 239var mainBicepPath = Path.Combine(workspace.FullName, "main.bicep"); 289var mainBicep = File.ReadAllText(Path.Combine(workspace.FullName, "main.bicep")); 290var storageBicep = File.ReadAllText(Path.Combine(workspace.FullName, "storage", "storage.bicep")); 318var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep")); 363var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep")); 379var outputPath = Path.Combine(workspace.Path, "exclude-main"); 388Assert.False(File.Exists(Path.Combine(outputPath, "main.bicep"))); 389Assert.True(File.Exists(Path.Combine(outputPath, "mod", "mod.bicep"))); 417Assert.True(File.Exists(Path.Combine(workspace.Path, resourceName, $"{resourceName}.bicep"))); 418var mainBicep = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")); 433var outputPath = Path.Combine(workspace.Path, "write-main"); 443Assert.True(File.Exists(Path.Combine(outputPath, "mod", "mod.bicep"))); 449var mainBicep = await File.ReadAllTextAsync(Path.Combine(outputPath, "main.bicep")); 472var outputPath = Path.Combine(workspace.Path, "provider"); 479await Verify(await File.ReadAllTextAsync(Path.Combine(outputPath, "main.bicep")), "bicep"); 535var mainBicepPath = Path.Combine(workspace.Path, "main.bicep"); 540var includedStorageBicepPath = Path.Combine(workspace.Path, "included-storage", "included-storage.bicep"); 544var excludedStorageBicepPath = Path.Combine(workspace.Path, "excluded-storage", "excluded-storage.bicep"); 566var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile"); 593var bicepFilePath = Path.Combine(workspace, bicepFileName); 612var outputDir = Path.Combine(workspace, "output"); 629var mainBicepPath = Path.Combine(outputDir, "main.bicep"); 632var resourceBicepPath = Path.Combine(outputDir, "custom-resource", "custom-resource.bicep");
AzureEventHubsExtensionsTests.cs (3)
168Assert.Equal(Path.Combine(builder.AppHostDirectory, ".eventhubs", "eh"), volumeAnnotation.Source); 187Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source); 443var configJsonPath = Path.GetTempFileName();
AzureFrontDoorAppServicePrivateLinkTests.cs (3)
31await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "main.bicep")), "bicep"); 32Assert.True(File.Exists(Path.Combine(workspace.Path, "api", "api.bicep"))); 33Assert.True(File.Exists(Path.Combine(workspace.Path, "frontdoor", "frontdoor.bicep")));
AzureFunctionsTests.cs (20)
504var dockerfilePath = Path.Combine(tempDir.Path, "funcapp.Dockerfile"); 543var dockerfileContents = File.ReadAllText(Path.Combine(tempDir.Path, "funcapp.Dockerfile")); 558File.WriteAllText(Path.Combine(appDirectory, "Dockerfile"), "FROM custom-functions-image\n"); 566Assert.False(File.Exists(Path.Combine(tempDir.Path, "funcapp.Dockerfile"))); 965var projectPath = Path.Combine(workspace.Path, "TestFunctions.csproj"); 990var projectPath = Path.Combine(workspace.Path, "MyFunctions.csproj"); 994var relativePath = Path.GetRelativePath(builder.AppHostDirectory, projectPath); 1002Assert.True(Path.IsPathRooted(projectMetadata.ProjectPath)); 1012var projectPath = Path.Combine(workspace.Path, "TestFunctions.csproj"); 1042var projectPath1 = Path.Combine(workspace.Path, "Functions1.csproj"); 1043var projectPath2 = Path.Combine(workspace.Path, "Functions2.csproj"); 1064var projectPath = Path.Combine(workspace.Path, "Functions.csproj"); 1094var projectPath = Path.Combine(workspace.Path, "Functions.csproj"); 1134var appDirectory = Path.Combine(rootDirectory, "functions"); 1136Directory.CreateDirectory(Path.Combine(appDirectory, "src")); 1138File.WriteAllText(Path.Combine(appDirectory, "host.json"), "{}"); 1139File.WriteAllText(Path.Combine(appDirectory, "package.json"), """ 1146File.WriteAllText(Path.Combine(appDirectory, "src", "index.ts"), string.Empty); 1147File.WriteAllText(Path.Combine(appDirectory, "local.settings.json"), "{}"); 1151File.WriteAllText(Path.Combine(appDirectory, "package-lock.json"), "{}");
AzureManifestUtils.cs (2)
39if (pathNode?.ToString() is not { } path || !File.Exists(Path.Combine(manifestDir, path))) 44var bicepText = await File.ReadAllTextAsync(Path.Combine(manifestDir, path));
AzureResourceOptionsTests.cs (3)
24var outputPath = Path.Combine(tempDir.FullName, "aspire-manifest.json"); 44var sbBicep = await File.ReadAllTextAsync(Path.Combine(tempDir.FullName, "sb.module.bicep")); 46var sqlBicep = await File.ReadAllTextAsync(Path.Combine(tempDir.FullName, "sql-server.module.bicep"));
AzureSandboxesTests.cs (3)
218var mainBicep = File.ReadAllText(Path.Combine(workspace.Path, "main.bicep")); 3339var firstManager = new TestDeploymentStateManager(Path.Combine(tempDirectory.FullName, "legacy", "state.json")); 3340var secondManager = new TestDeploymentStateManager(Path.Combine(tempDirectory.FullName, "canonical", "state.json"));
AzureServiceBusExtensionsTests.cs (2)
545var configJsonPath = Path.GetTempFileName(); 1145var configJsonPath = Path.GetTempFileName();
AzureStorageExtensionsTests.cs (2)
37Assert.Equal(Path.Combine(builder.AppHostDirectory, ".azurite", "storage"), volumeAnnotation.Source); 63Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
FoundryExtensionsTests.cs (4)
218var daemonPidPath = Path.Combine(temporaryDirectory.FullName, "daemon.pid"); 354var commandLogPath = Path.Combine(temporaryDirectory.FullName, "commands.log"); 355var executablePath = Path.Combine(temporaryDirectory.FullName, "foundry"); 386Environment.SetEnvironmentVariable("PATH", $"{temporaryDirectory.FullName}{Path.PathSeparator}{originalPath}");
SqlServerContainerFixture.cs (2)
88"unix" or "npipe" => !File.Exists(Path.Combine(Path.GetPathRoot(Directory.GetCurrentDirectory()) ?? "/", ".dockerenv")),
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Blazor (36)
BlazorDotNetCliRunner.cs (1)
56WorkingDirectory = Path.GetDirectoryName(projectPath)!,
BlazorGatewayExtensions.cs (23)
61var gatewayDir = Path.GetDirectoryName(gatewayPath)!; 201new(CustomResourceKnownProperties.Source, Path.GetFileName(projectPath)), 218var resolvedPath = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, projectPath)); 226new(CustomResourceKnownProperties.Source, Path.GetFileName(resolvedPath)), 384var gatewayOutputRoot = Path.Combine( 421var outputDir = Path.Combine(gatewayOutputRoot, "output"); 440var mergedRuntimePath = Path.Combine(outputDir, "merged.staticwebassets.runtime.json"); 460var projectDir = Path.GetDirectoryName(projectPath)!; 462var relativeProjectPath = Path.GetRelativePath(solutionRoot, projectDir) 486var relativePath = Path.GetRelativePath(parentPath, childPath); 487return !Path.IsPathRooted(relativePath) 489&& !relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal); 606var destEndpoints = Path.Combine(outputDir, $"{reg.Resource.Name}.endpoints.json"); 628var relativeProjectPath = Path.GetRelativePath( 634var scriptDest = Path.Combine(project.SolutionRoot, ".aspire", "scripts", "PrefixEndpoints.cs"); 635Directory.CreateDirectory(Path.GetDirectoryName(scriptDest)!); 637var scriptRelativePath = Path.GetRelativePath(project.SolutionRoot, scriptDest) 681var projectDirectory = Path.GetDirectoryName(relativeProjectPath)?.Replace('\\', '/'); 682var projectFileName = Path.GetFileName(relativeProjectPath); 736var assemblyDir = Path.GetDirectoryName(typeof(BlazorGatewayExtensions).Assembly.Location)!; 737var scriptPath = Path.Combine(assemblyDir, "Scripts", scriptName); 758return Path.Combine(storePath, ".aspire", "blazor");
BlazorHostedExtensions.cs (4)
199var serverDirectory = Path.GetDirectoryName(projectMetadata.ProjectPath); 291var serverDirectory = Path.GetDirectoryName(serverProjectPath); 355return Path.GetFullPath(projectPath, serverDirectory); 378var workingDirectory = Path.GetDirectoryName(serverProjectPath) ?? serverProjectPath;
BlazorWasmAppBuilder.cs (6)
44BlazorGatewayLog.BuildSucceeded(logger, Path.GetFileNameWithoutExtension(projectPath)); 105var projectDir = Path.GetDirectoryName(projectPath)!; 106var endpoints = Path.GetFullPath(Path.Combine(projectDir, props.StaticWebAssetEndpointsBuildManifestPath)); 107var runtime = Path.GetFullPath(Path.Combine(projectDir, props.StaticWebAssetDevelopmentManifestPath));
BrowserDebuggerHelper.cs (1)
45var clientProjectDirectory = Path.GetDirectoryName(clientProjectPath) ?? clientProjectPath;
Resources\BlazorWasmAppResource.cs (1)
29public string ProjectDirectory => Path.GetDirectoryName(ProjectPath)!;
Aspire.Hosting.Blazor.Tests (60)
AddBlazorGatewayTests.cs (32)
45Assert.Equal(Path.GetFileName(app.Resource.ProjectPath), property.Value); 62Path.Combine("Scripts", "Gateway.cs"), 195var clientDirectory = Path.Combine(directory.Path, "Client"); 197await File.WriteAllTextAsync(Path.Combine(clientDirectory, "global.json"), 199File.Copy(Path.Combine(clientDirectory, "global.json"), Path.Combine(directory.Path, "global.json")); 201Path.Combine(Path.GetDirectoryName(typeof(BlazorGatewayExtensions).Assembly.Location)!, "Scripts", "PrefixEndpoints.cs")); 202await File.WriteAllTextAsync(Path.Combine(directory.Path, "PrefixEndpoints.cs"), 215await File.WriteAllTextAsync(Path.Combine(directory.Path, "Dockerfile"), dockerfile); 234var clientDirectory = Path.Combine(directory.Path, "Client"); 236await File.WriteAllTextAsync(Path.Combine(directory.Path, "Test.slnx"), "<Solution />"); 246var client = publishBuilder.AddBlazorWasmApp("app", Path.Combine(clientDirectory, "Client.csproj")) 255var gatewayDirectory = Directory.CreateDirectory(Path.Combine(directory.Path, "Gateway")).FullName; 257await File.WriteAllTextAsync(Path.Combine(gatewayDirectory, "Gateway.cs"), 258restoreDirective + await File.ReadAllTextAsync(Path.Combine(gatewayBuild.ContextPath, "Gateway.cs"))); 260gatewayContainer.Annotations.Add(new DockerfileBuildAnnotation(gatewayDirectory, Path.Combine(gatewayDirectory, "Dockerfile"), stage: null) 266var prefixScriptPath = Path.Combine(directory.Path, ".aspire", "scripts", "PrefixEndpoints.cs"); 362Directory.CreateDirectory(Path.Combine(clientDirectory, "wwwroot")); 363await File.WriteAllTextAsync(Path.Combine(clientDirectory, "Client.csproj"), 375await File.WriteAllTextAsync(Path.Combine(clientDirectory, "Program.cs"), 380await File.WriteAllTextAsync(Path.Combine(clientDirectory, "wwwroot", "index.html"), 409var projectPath = Path.Combine(directory.Path, "Client.csproj"); 438var projectPath = Path.Combine(directory.Path, "Client.csproj"); 456File.WriteAllText(Path.Combine(solutionRoot.FullName, "Test.slnx"), "<Solution />"); 457var appHostDirectory = Directory.CreateDirectory(Path.Combine(solutionRoot.FullName, "src", "AppHost")).FullName; 459var projectDirectory = Directory.CreateDirectory(Path.Combine(solutionRoot.FullName, "src", "Client")).FullName; 475var appHostDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "AppHost")).FullName; 477var projectDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "Client")).FullName; 496var appHostDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "AppHost")).FullName; 497File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.slnx"), "<Solution />"); 498var projectDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "Client")).FullName;
AddBlazorWasmAppTests.cs (1)
58Assert.Equal(Path.GetDirectoryName(resource.ProjectPath), resource.ProjectDirectory);
AddDotnetProjectBlazorGatewayTests.cs (3)
25Assert.Equal("Gateway.cs", Path.GetFileName(projectMetadata.ProjectPath)); 26Assert.Equal("Scripts", Path.GetFileName(Path.GetDirectoryName(projectMetadata.ProjectPath)));
BlazorHostedExtensionsTests.cs (7)
244var serverProjectPath = Path.Combine(tempDirectory.Path, "Server.csproj"); 321var serverProjectPath = Path.Combine(tempDirectory.Path, "Server.csproj"); 637var serverDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.Path, "Server")); 638var clientDirectory = Directory.CreateDirectory(Path.Combine(tempDirectory.Path, "Client")); 639var serverProjectPath = Path.Combine(serverDirectory.FullName, "Server.csproj"); 640var clientProjectPath = Path.Combine(clientDirectory.FullName, "Client.csproj"); 661var serverProjectPath = Path.Combine(tempDirectory.Path, "Server.csproj");
EndpointsManifestTransformerTests.cs (13)
15_tempDir = Path.Combine(Path.GetTempPath(), "BlazorHostingTests", Guid.NewGuid().ToString("N")); 39var manifestPath = Path.Combine(_tempDir, "endpoints.json"); 64var manifestPath = Path.Combine(_tempDir, "endpoints.json"); 123var manifestPath = Path.Combine(_tempDir, "endpoints.json"); 167var manifestPath = Path.Combine(_tempDir, "endpoints.json"); 200var manifestPath = Path.Combine(_tempDir, "endpoints.json"); 258var app1Path = Path.Combine(_tempDir, "app1.runtime.json"); 259var app2Path = Path.Combine(_tempDir, "app2.runtime.json"); 273var outputPath = Path.Combine(_tempDir, "merged.json"); 322var app1Path = Path.Combine(_tempDir, "app1.runtime.json"); 323var app2Path = Path.Combine(_tempDir, "app2.runtime.json"); 337var outputPath = Path.Combine(_tempDir, "merged.json");
tests\Shared\TestFileSystemService.cs (2)
33var resolvedName = fileName ?? System.IO.Path.GetRandomFileName(); 34var filePath = System.IO.Path.Combine(tempDir.FullName, resolvedName);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Browsers (44)
BrowserEndpointDiscovery.cs (3)
50Path.Combine(userDataDirectory, "aspire-debug-endpoint.json"); 247private static string NormalizePath(string path) => Path.TrimEndingDirectorySeparator(Path.GetFullPath(path));
BrowserHost.cs (1)
149var devToolsActivePortFilePath = Path.Combine(userDataDirectory.Path, "DevToolsActivePort");
BrowserHostRegistry.cs (1)
334var localStatePath = Path.Combine(userDataDirectory, "Local State");
BrowserLogsArtifacts.cs (7)
58var directory = Path.Combine( 73var filePath = Path.Combine(directory, fileName); 114return Path.Combine( 122return Path.Combine( 133: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); 134return Path.Combine(dataHome, "aspire", "command-artifacts"); 139var invalidChars = Path.GetInvalidFileNameChars();
BrowserUserDataPathResolver.cs (10)
59BrowserUserDataMode.Shared => Path.Combine(root, "shared", browserSegment), 60BrowserUserDataMode.Isolated => Path.Combine(root, "isolated", GetAppHostSegment(configuration), browserSegment), 76return Path.Combine( 84return Path.Combine( 97: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); 98return Path.Combine(dataHome, "aspire", "browser-data"); 122var name = Path.IsPathRooted(browser) || Path.IsPathFullyQualified(browser) 123? Path.GetFileNameWithoutExtension(browser) 138var invalidChars = Path.GetInvalidFileNameChars();
ChromiumBrowserResolver.cs (12)
24if (Path.IsPathRooted(browser) && File.Exists(browser)) 33if (Path.IsPathRooted(candidate)) 80var localStatePath = Path.Combine(userDataDirectory, "Local State"); 136if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)) || 166var localStatePath = Path.Combine(userDataDirectory, "Local State"); 196var directoryName = Path.GetFileName(directoryPath); 241Path.Combine(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"), 242Path.Combine(programFiles, "Microsoft", "Edge", "Application", "msedge.exe"), 247Path.Combine(programFilesX86, "Google", "Chrome", "Application", "chrome.exe"), 248Path.Combine(programFiles, "Google", "Chrome", "Application", "chrome.exe"), 267var directoryName = Path.GetFileName(directoryPath); 292if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)))
IBrowserHost.cs (2)
171var rooted = Path.GetFullPath(path); 172return Path.TrimEndingDirectorySeparator(rooted);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Browsers.Tests (80)
BrowserHostTests.cs (2)
21var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser"); 23var devToolsActivePortPath = Path.Combine(userDataDirectory.FullName, "DevToolsActivePort");
BrowserLogsBuilderExtensionsTests.cs (4)
770Path.Combine(AppContext.BaseDirectory, "artifacts", "screenshot.png"), 1020var tempBrowserPath = Path.Combine(tempDirectory.FullName, OperatingSystem.IsWindows() ? "tracked-browser.exe" : "tracked-browser"); 1785Path.Combine(AppContext.BaseDirectory, "screenshot.png"), 1946public string FilePath => Path.Combine(AppContext.BaseDirectory, "test-secrets.json");
BrowserLogsRunningSessionTests.cs (1)
22var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser");
BrowserLogsSessionManagerTests.cs (27)
24var executablePath = Path.Combine(userDataDirectory, "browser"); 26var identityWithTrailingSeparator = new BrowserHostIdentity(executablePath, userDataDirectory + Path.DirectorySeparatorChar); 63var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser"); 103var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser"); 138var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser"); 172var browserExecutable = Path.Combine(userDataDirectory.FullName, "browser"); 258Path.Combine(userDataDirectory.FullName, "browser"), 288Path.Combine(userDataDirectory.FullName, "bröwser"), 318Path.Combine(userDataDirectory.FullName, "browser"), 351Path.Combine(userDataDirectory.FullName, "browser"), 381Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1")); 394Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default")); 395Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1")); 397Path.Combine(userDataDirectory, "Local State"), 424Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default")); 425Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1")); 426Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 2")); 427Directory.CreateDirectory(Path.Combine(userDataDirectory, "System Profile")); 429Path.Combine(userDataDirectory, "Local State"), 479Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default")); 480Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1")); 481File.WriteAllText(Path.Combine(userDataDirectory, "Local State"), "{"); 507Directory.CreateDirectory(Path.Combine(userDataDirectory, "Default")); 508Directory.CreateDirectory(Path.Combine(userDataDirectory, "Profile 1")); 510Path.Combine(userDataDirectory, "Local State"), 630Path.Combine(AppContext.BaseDirectory, "browser"), 631Path.Combine(AppContext.BaseDirectory, "user-data")),
BrowserPageSessionTests.cs (2)
350Path.Combine(AppContext.BaseDirectory, "browser"), 351Path.Combine(AppContext.BaseDirectory, "user-data"));
src\Aspire.Hosting.Browsers\BrowserEndpointDiscovery.cs (3)
50Path.Combine(userDataDirectory, "aspire-debug-endpoint.json"); 247private static string NormalizePath(string path) => Path.TrimEndingDirectorySeparator(Path.GetFullPath(path));
src\Aspire.Hosting.Browsers\BrowserHost.cs (1)
149var devToolsActivePortFilePath = Path.Combine(userDataDirectory.Path, "DevToolsActivePort");
src\Aspire.Hosting.Browsers\BrowserHostRegistry.cs (1)
334var localStatePath = Path.Combine(userDataDirectory, "Local State");
src\Aspire.Hosting.Browsers\BrowserLogsArtifacts.cs (7)
58var directory = Path.Combine( 73var filePath = Path.Combine(directory, fileName); 114return Path.Combine( 122return Path.Combine( 133: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); 134return Path.Combine(dataHome, "aspire", "command-artifacts"); 139var invalidChars = Path.GetInvalidFileNameChars();
src\Aspire.Hosting.Browsers\BrowserUserDataPathResolver.cs (10)
59BrowserUserDataMode.Shared => Path.Combine(root, "shared", browserSegment), 60BrowserUserDataMode.Isolated => Path.Combine(root, "isolated", GetAppHostSegment(configuration), browserSegment), 76return Path.Combine( 84return Path.Combine( 97: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); 98return Path.Combine(dataHome, "aspire", "browser-data"); 122var name = Path.IsPathRooted(browser) || Path.IsPathFullyQualified(browser) 123? Path.GetFileNameWithoutExtension(browser) 138var invalidChars = Path.GetInvalidFileNameChars();
src\Aspire.Hosting.Browsers\ChromiumBrowserResolver.cs (12)
24if (Path.IsPathRooted(browser) && File.Exists(browser)) 33if (Path.IsPathRooted(candidate)) 80var localStatePath = Path.Combine(userDataDirectory, "Local State"); 136if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)) || 166var localStatePath = Path.Combine(userDataDirectory, "Local State"); 196var directoryName = Path.GetFileName(directoryPath); 241Path.Combine(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"), 242Path.Combine(programFiles, "Microsoft", "Edge", "Application", "msedge.exe"), 247Path.Combine(programFilesX86, "Google", "Chrome", "Application", "chrome.exe"), 248Path.Combine(programFiles, "Google", "Chrome", "Application", "chrome.exe"), 267var directoryName = Path.GetFileName(directoryPath); 292if (!Directory.Exists(Path.Combine(userDataDirectory, profileEntry.Name)))
src\Aspire.Hosting.Browsers\IBrowserHost.cs (2)
171var rooted = Path.GetFullPath(path); 172return Path.TrimEndingDirectorySeparator(rooted);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.CodeGeneration.Go (2)
GoLanguageSupport.cs (2)
116var appHostPath = Path.Combine(directoryPath, "apphost.go"); 122var goModPath = Path.Combine(directoryPath, "go.mod");
Aspire.Hosting.CodeGeneration.Go.Tests (44)
AtsGoCodeGeneratorTests.cs (14)
77await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 79await File.WriteAllTextAsync(Path.Combine(directory.FullName, "terminal_test.go"), """ 157await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 160await File.WriteAllTextAsync(Path.Combine(directory.FullName, "transport_test.go"), """ 224: Path.Combine(directory.FullName, "socket"); 304await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 307await File.WriteAllTextAsync(Path.Combine(directory.FullName, "transport_hardening_test.go"), """ 1037await File.WriteAllTextAsync(Path.Combine(directory.FullName, "decode_test.go"), """ 1407await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 1410await File.WriteAllTextAsync(Path.Combine(directory.FullName, "runtime_test.go"), """ 2346await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 2349await File.WriteAllTextAsync(Path.Combine(directory.FullName, "callback_test.go"), """ 2518await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 2521await File.WriteAllTextAsync(Path.Combine(directory.FullName, "declared_interface_test.go"), """
AtsGoDerivedBuilderTests.cs (2)
405await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, cancellationToken); 412await File.WriteAllTextAsync(Path.Combine(packageDirectory.FullName, $"{packageName}.go"), source, cancellationToken);
GoDocCommentTests.cs (3)
229await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 231await File.WriteAllTextAsync(Path.Combine(directory.FullName, "options_compatibility.go"), """ 238await File.WriteAllTextAsync(Path.Combine(directory.FullName, "functional_options_test.go"), """
GoGeneratorEscapingTests.cs (4)
65await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 74var consumerDirectory = Directory.CreateDirectory(Path.Combine(directory.FullName, "consumer")); 75await File.WriteAllTextAsync(Path.Combine(consumerDirectory.FullName, "go.mod"), """ 84await File.WriteAllTextAsync(Path.Combine(consumerDirectory.FullName, "main.go"), """
GoScaffoldTests.cs (13)
58var starterRoot = Path.Combine(AppContext.BaseDirectory, "go-starter"); 61.Where(file => !string.Equals(Path.GetExtension(file), ".png", StringComparison.OrdinalIgnoreCase)) 67.Select(file => Path.GetRelativePath(starterRoot, file))); 148File.WriteAllText(Path.Combine(workspace.Path, name), content); 163File.WriteAllText(Path.Combine(workspace.Path, "apphost.go"), "// marker"); 175File.WriteAllText(Path.Combine(workspace.Path, "apphost.ts"), "// typescript"); 176File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module apphost"); 197WriteGoFile(workspace.Path, Path.Combine("scaffold", "apphost.go"), Scaffold(workspace)["apphost.go"]); 200var starterRoot = Path.Combine(AppContext.BaseDirectory, "go-starter"); 206WriteGoFile(workspace.Path, Path.Combine("go-starter", Path.GetRelativePath(starterRoot, starterFile)), File.ReadAllText(starterFile)); 248var path = Path.Combine(root, relativePath); 249Directory.CreateDirectory(Path.GetDirectoryName(path)!);
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Java (4)
JavaLanguageSupport.cs (4)
124var relativePath = pattern.Replace('/', Path.DirectorySeparatorChar); 126if (File.Exists(Path.Combine(directoryPath, relativePath))) 277Path.Combine(classOutputDirectory, $"{AppHostClassName}.class") 282stampFileProperty.SetValue(upToDateCheck, Path.Combine(classOutputDirectory, CompileStampFileName));
Aspire.Hosting.CodeGeneration.Java.Tests (23)
AtsJavaCodeGeneratorTests.cs (6)
4033_classes = Directory.CreateDirectory(Path.Combine(_root.FullName, "classes")); 4038var path = Path.Combine(_root.FullName, relativePath.Replace('/', Path.DirectorySeparatorChar)); 4039Directory.CreateDirectory(Path.GetDirectoryName(path)!); 4047.Select(path => Path.GetRelativePath(_root.FullName, path)) 4051var sourcesFile = Path.Combine(_root.FullName, "sources.txt");
JavaLanguageSupportDetectionTests.cs (10)
25var expected = relativePath.Replace('/', Path.DirectorySeparatorChar); 26var appHostPath = Path.Combine(workspace.Path, expected); 27Directory.CreateDirectory(Path.GetDirectoryName(appHostPath)!); 46File.WriteAllText(Path.Combine(workspace.Path, "AppHost.java"), "void main(String[] args) { }"); 47var nested = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "main", "java")); 48File.WriteAllText(Path.Combine(nested.FullName, "AppHost.java"), "void main(String[] args) { }"); 57File.WriteAllText(Path.Combine(workspace.Path, "pom.xml"), "<project />"); 75var path = Path.Combine(workspace.Path, relativePath.Replace('/', Path.DirectorySeparatorChar)); 76Directory.CreateDirectory(Path.GetDirectoryName(path)!);
JavaLanguageSupportTests.cs (5)
31var buildFilePath = Path.Combine( 105=> Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..")); 112Assert.Equal([Path.Combine(".java-build", "AppHost.class")], check.Outputs!); 114Assert.Equal(Path.Combine(".java-build", ".aspire-compile-stamp"), check.StampFile);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Python (3)
PythonLanguageSupport.cs (3)
142var appHostPath = Path.Combine(directoryPath, "apphost.py"); 148var hasPylock = File.Exists(Path.Combine(directoryPath, "pylock.apphost.toml")); 149var hasRequirements = File.Exists(Path.Combine(directoryPath, "apphost_requirements.txt"));
Aspire.Hosting.CodeGeneration.Python.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.Rust (2)
RustLanguageSupport.cs (2)
116var appHostPath = Path.Combine(directoryPath, AppHostFileName); 122var cargoPath = Path.Combine(directoryPath, "Cargo.toml");
Aspire.Hosting.CodeGeneration.Rust.Tests (16)
AtsRustCodeGeneratorTests.cs (3)
58await File.WriteAllTextAsync(Path.Combine(directory.FullName, name), content, timeout.Token); 60await File.WriteAllTextAsync(Path.Combine(directory.FullName, "Cargo.toml"), """ 78await File.WriteAllTextAsync(Path.Combine(directory.FullName, "terminal.rs"), """
RustLanguageSupportTests.cs (5)
42File.WriteAllText(Path.Combine(workspace.Path, "apphost.rs"), "// marker"); 43File.WriteAllText(Path.Combine(workspace.Path, "Cargo.toml"), "[package]"); 57File.WriteAllText(Path.Combine(workspace.Path, "apphost.ts"), "// typescript"); 58File.WriteAllText(Path.Combine(workspace.Path, "Cargo.toml"), "[package]"); 70File.WriteAllText(Path.Combine(workspace.Path, "apphost.rs"), "// marker");
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.CodeGeneration.TypeScript (5)
TypeScriptLanguageSupport.cs (5)
181File.Exists(Path.Combine(parent.FullName, PackageJsonFileName)); 186var packageJsonPath = Path.Combine(request.TargetPath, PackageJsonFileName); 227var appHostFileName = File.Exists(Path.Combine(directoryPath, AppHostFileName)) 230var appHostPath = Path.Combine(directoryPath, appHostFileName); 237var packageJsonPath = Path.Combine(directoryPath, PackageJsonFileName);
Aspire.Hosting.CodeGeneration.TypeScript.Tests (13)
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
TypeScriptLanguageSupportTests.cs (5)
71File.WriteAllText(Path.Combine(workspace.Path, "package.json"), """ 136File.WriteAllText(Path.Combine(workspace.Path, "package.json"), """{ "name": "existing-app" }"""); 137var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "aspire-apphost")); 158File.WriteAllText(Path.Combine(workspace.Path, "package.json"), """ 195var existingTsConfigPath = Path.Combine(workspace.Path, "tsconfig.json");
Aspire.Hosting.Containers.Tests (17)
ContainerResourceTests.cs (1)
240Assert.Equal(Path.Combine(basePath, "source"), mountAnnotation.Source);
DockerSocketBindMountTests.cs (2)
24var dockerFilePath = Path.Combine(contextDir.FullName, "Dockerfile"); 48var infoFile = Path.Combine(outDir.FullName, "docker-info.txt");
TestcontainersPodmanConfigurationTests.cs (5)
15/// Socket paths that the production code assembles with <see cref="Path.Combine(string[])"/> are built the 137var decision = Decide(isWindows: false, environment: [], existingSockets: [Path.Combine(socketPathParts)]); 153var podmanSocket = Path.Combine(socketPathParts); 236var dockerDesktopSocket = Path.Combine(HomeDirectory, ".docker", "desktop", "docker.sock"); 251var rootlessPodmanSocket = Path.Combine(XdgRuntimeDirectory, "podman", "podman.sock");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
WithDockerfileTests.cs (7)
263var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 313var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 362var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 410var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 868var manifestOutputPath = Path.Combine(tempContextPath, "aspire-manifest.json"); 913var manifestPath = Path.Combine(tempDir.FullName, "manifest.json"); 928var dockerfilePath = Path.Combine(tempDir.FullName, "testcontainer.Dockerfile");
Aspire.Hosting.DevTunnels (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.DevTunnels.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Docker (20)
DockerComposeEnvironmentResource.cs (5)
165var savedOutputPath = stateSection.Data["OutputPath"]?.ToString() ?? Path.GetDirectoryName(savedComposeFilePath)!; 434var dockerComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml"); 478var dockerComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml"); 602var envFilePath = Path.Combine(outputPath, $".env.{environmentName}"); 611ComposeFilePath = Path.Combine(outputPath, "docker-compose.yaml"),
DockerComposePublishingContext.cs (7)
97var resourceDockerfilePath = Path.Combine(OutputPath, $"{serviceResource.TargetResource.Name}.Dockerfile"); 148var outputFile = Path.Combine(OutputPath, "docker-compose.yaml"); 154var envFilePath = Path.Combine(OutputPath, ".env"); 196sourcePath = Path.Combine(OutputPath, composeService.Name, Path.GetFileName(file.SourcePath)); 198Directory.CreateDirectory(Path.Combine(OutputPath, composeService.Name)); 202sourcePath = Path.GetRelativePath(OutputPath, sourcePath).Replace('\\', '/');
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Docker.Tests (85)
DockerComposePublisherTests.cs (59)
63await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")), "env") 92await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml")), "yaml").UseParameters(longNames); 170await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")), "env").UseParameters(overridden); 199await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml")), "yaml") 200.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env")), "env") 201.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")), "env"); 285var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 286var envPath = Path.Combine(workspace.Path, ".env"); 308var compose = File.ReadAllText(Path.Combine(workspace.Path, "docker-compose.yaml")); 346var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 347var envPath = Path.Combine(workspace.Path, ".env"); 369var compose = File.ReadAllText(Path.Combine(workspace.Path, "docker-compose.yaml")); 370var environment = File.ReadAllText(Path.Combine(workspace.Path, ".env")); 394var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 423var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 474var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 476var envPath = Path.Combine(workspace.Path, ".env"); 505var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 513var envFilePath = Path.Combine(workspace.Path, ".env"); 544var envFilePath = Path.Combine(workspace.Path, ".env"); 585var envFilePath = Path.Combine(workspace.Path, ".env"); 618var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 644var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 676var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 707var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 735var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 769var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 793var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 821var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 851var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 880var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 912var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 937var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile"); 961var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 988var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1017var envFilePath = Path.Combine(workspace.Path, ".env.Staging"); 1051var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1073var envFilePath = Path.Combine(workspace.Path, ".env.Production"); 1107var envFilePath = Path.Combine(workspace.Path, ".env.Staging"); 1140var composeContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "docker-compose.yaml")); 1141var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1173var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1199var envFileContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, ".env.Production")); 1224var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1225var envPath = Path.Combine(workspace.Path, ".env"); 1251var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1282var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1283var envPath = Path.Combine(workspace.Path, ".env"); 1310var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1334envVar.DefaultValue = "./" + Path.GetFileName(mount.Source); 1346var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1347var envPath = Path.Combine(workspace.Path, ".env"); 1394var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1395var envPath = Path.Combine(workspace.Path, ".env"); 1428var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1429var envPath = Path.Combine(workspace.Path, ".env"); 1472var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1506var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 1534var composePath = Path.Combine(workspace.Path, "docker-compose.yaml");
DockerComposeTests.cs (8)
63var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 85var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 152var outputPath = Path.Combine(workspace.Path, "output"); 191var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 225var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 264var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml"); 351var composePath = Path.Combine(workspace.Path, "docker-compose.yaml"); 971["ComposeFilePath"] = Path.Combine(workspace.Path, "docker-compose.yaml")
EnvFileTests.cs (16)
16var envFilePath = Path.Combine(workspace.Path, ".env"); 50var envFilePath = Path.Combine(workspace.Path, ".env"); 70var envFilePath = Path.Combine(workspace.Path, ".env"); 88var envFilePath = Path.Combine(workspace.Path, ".env"); 108var envFilePath = Path.Combine(workspace.Path, ".env"); 123var envFilePath = Path.Combine(workspace.Path, ".env"); 145var envFilePath = Path.Combine(workspace.Path, ".env"); 165var envFilePath = Path.Combine(workspace.Path, ".env"); 185var envFilePath = Path.Combine(workspace.Path, ".env"); 212var envFilePath = Path.Combine(workspace.Path, ".env"); 228var envFilePath = Path.Combine(workspace.Path, ".env"); 254var envFilePath = Path.Combine(workspace.Path, ".env"); 280var envFilePath = Path.Combine(workspace.Path, ".env"); 320var envFilePath = Path.Combine(workspace.Path, ".env"); 345var envFilePath = Path.Combine(workspace.Path, ".env"); 362var envFilePath = Path.Combine(workspace.Path, ".env");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Dotnet (94)
DotnetProjectBuildArtifactManager.cs (11)
55var coordinationLockPath = Path.Combine(BuildDirectory, ".coordination.lock"); 164Path.Combine(BuildDirectory, $"{BuildProjectFilePrefix}{hash}{BuildProjectFileExtension}"); 167Path.Combine(GetStateDirectory(), $"{hash}{StateFileExtension}"); 180var temporaryPath = Path.Combine(BuildDirectory, $".{Path.GetRandomFileName()}.tmp"); 227var fileName = Path.GetFileName(buildProjectPath); 318var hash = Path.GetFileNameWithoutExtension(statePath); 427var temporaryPath = Path.Combine(stateDirectory, $".{Path.GetRandomFileName()}.tmp"); 455Path.Combine(BuildDirectory, ".leases", "v1", hash); 458Path.Combine(BuildDirectory, ".artifacts", "v1");
DotnetProjectBuildCoordinator.cs (7)
106var buildDirectory = Path.Combine(aspireStoreRoot, ".aspire", "build"); 926var originalDirectory = Path.GetDirectoryName(originalPath); 927var resolvedDirectory = Path.GetDirectoryName(resolvedPath)!; 977var projectDirectory = Path.GetDirectoryName(entry.Metadata.ProjectPath)!; 998: Path.GetDirectoryName(globalJsonPath)!; 1136var physicalWorkingDirectory = PathNormalizer.ResolveSymlinks(Path.GetFullPath(workingDirectory)); 1139var globalJsonPath = Path.Combine(directory.FullName, "global.json");
DotnetProjectBuildResource.cs (6)
244EscapeMsBuildPath(NormalizePath(Path.GetRelativePath(BuildDirectory, projectPath))))))), 328path.Replace(Path.DirectorySeparatorChar, '/'); 366var fullPath = Path.GetFullPath(path); 368while (!Path.Exists(existingPath)) 370var parent = Path.GetDirectoryName(existingPath); 382: Path.Join(resolvedExistingPath, fullPath[existingPath.Length..]);
DotnetProjectHostingExtensions.cs (3)
370path = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, path)); 382var workingDirectory = Path.GetDirectoryName(projectMetadata.ProjectPath) ?? builder.AppHostDirectory; 383var iconName = Path.GetExtension(projectMetadata.ProjectPath).ToLowerInvariant() switch
DotnetProjectMetadata.cs (2)
44var launchSettingsPath = Path.Combine(Path.GetDirectoryName(ProjectPath)!, "My Project", "launchSettings.json");
DotnetProjectRunPropertiesResolver.cs (7)
43var resultOutputPath = Path.Combine(resultDirectory.Path, "run-properties.json"); 152: Path.GetFullPath(runWorkingDirectory, Path.GetDirectoryName(Path.GetFullPath(projectPath))!); 165var normalizedTargetPath = Path.GetFullPath( 167Path.GetDirectoryName(Path.GetFullPath(projectPath))!);
MsTestHostingExtensions.cs (3)
69if (!string.Equals(Path.GetExtension(projectPath), ".csproj", StringComparison.OrdinalIgnoreCase)) 73projectPath = Path.GetFullPath(projectPath, builder.AppHostDirectory); 99var resource = builder.AddResource(new MsTestResource(name, Path.GetDirectoryName(projectPath)!))
MsTestTrxReport.cs (3)
36var path = Path.Combine(reportDirectory, FileName); 51path = Path.Combine(context.OutputPath, FileName); 80var target = Path.Combine(destination, entry.Name);
src\Shared\DotnetSdkVersionProbe.cs (3)
86normalizedWorkingDirectory = Path.GetFullPath(workingDirectory ?? Environment.CurrentDirectory); 272var physicalWorkingDirectory = PathNormalizer.ResolveSymlinks(Path.GetFullPath(workingDirectory)); 275var globalJsonPath = Path.Combine(directory.FullName, "global.json");
src\Shared\FileLock.cs (1)
163var directory = Path.GetDirectoryName(lockPath);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\LaunchProfiles\LaunchProfileExtensions.cs (3)
85null => Path.Combine("Properties", "launchSettings.json"), 86_ => Path.Combine(projectFileInfo.DirectoryName, "Properties", "launchSettings.json") 99var runSettingsFilePath = Path.ChangeExtension(projectMetadata.ProjectPath, ".run.json");
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (3)
21? Path.Combine("Properties", "launchSettings.json") 22: Path.Combine(Path.GetFullPath(directoryPath), "Properties", "launchSettings.json");
src\Shared\MsBuildResponseFile.cs (1)
29var responseFilePath = Path.Combine(directory.Path, "build-properties.rsp");
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
src\Shared\ProjectPathResolver.cs (1)
43return Path.GetFullPath(projectFiles[0]);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Dotnet.Tests (380)
DotnetCliToolTests.cs (3)
122var expectedWorkingDirectory = Path.GetFullPath(builder.AppHostDirectory); 189Assert.Equal(Path.GetFullPath(builder.AppHostDirectory), directory); 197Assert.Equal(Path.GetFullPath(builder.AppHostDirectory), tool.Resource.WorkingDirectory);
DotnetProjectBuildArtifactManagerTests.cs (14)
18var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 45var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 56Directory.Delete(Path.Combine(buildDirectory, ".artifacts"), recursive: true); 78var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 114var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 139var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 146Assert.Empty(Directory.GetFiles(Path.GetDirectoryName(statePath)!, ".*.tmp")); 153var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 168var buildDirectory = Path.Combine(workspace.Path, ".aspire", "build"); 169var stateDirectory = Path.Combine(buildDirectory, ".artifacts", "v1"); 174Path.Combine(buildDirectory, ".old.tmp"), 175Path.Combine(stateDirectory, ".old.tmp"), 179Path.Combine(buildDirectory, ".recent.tmp"), 180Path.Combine(stateDirectory, ".recent.tmp"),
DotnetProjectBuildCoordinatorTests.cs (207)
57var apiPath = Path.Combine(builder.AppHostDirectory, "Api", "Api.csproj"); 58var workerPath = Path.Combine(builder.AppHostDirectory, "Worker", "Worker.csproj"); 95Path.Combine(builder.Configuration["Aspire:Store:Path"]!, ".aspire", "build"), 147var globalJsonPath = Path.Combine(workspace.Path, "global.json"); 219var firstDotnetPath = Path.Combine(workspace.Path, "first-sdk"); 220var secondDotnetPath = Path.Combine(workspace.Path, "second-sdk"); 334Assert.True(File.Exists(Path.Combine( 335Path.GetDirectoryName(projectPath)!, 604var hash = Path.GetFileNameWithoutExtension(buildProjectPath)["projects.".Length..]; 638var appDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "worker")).FullName; 639var filePath = Path.Combine(appDirectory, "Caf\u00e9.cs"); 640var suppliedPath = Path.Combine(appDirectory, pathAlias switch 690var appDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "Caf\u00e9")).FullName; 691var filePath = Path.Combine(appDirectory, "worker.cs"); 716Assert.Equal(Path.GetDirectoryName(expectedPath), file.Resource.WorkingDirectory); 717Assert.Equal(Path.GetDirectoryName(expectedPath), rebuilder.WorkingDirectory); 777var filePath = Path.Combine(workspace.Path, "worker.cs"); 784Path.Combine(workspace.Path, "artifacts"); 807var appDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "Caf\u00e9")).FullName; 808var filePath = Path.Combine(appDirectory, "worker.cs"); 821Assert.Equal(Path.GetDirectoryName(suppliedPath), file.Resource.WorkingDirectory); 837var fileDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "worker")); 838var filePath = Path.Combine(fileDirectory.FullName, "worker.cs"); 927var firstSentinel = Path.Combine(workspace.Path, "first-ran.txt"); 928var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt"); 998var appDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "Caf\u00e9")).FullName; 999var appPath = Path.Combine(appDirectory, "worker.cs"); 1000var sentinelPath = Path.Combine(workspaceRoot, "worker-ran.txt"); 1053var projectPath = Path.Combine(builder.AppHostDirectory, "Api", "Api.csproj"); 1113NormalizeBuildProjectPath(Path.GetRelativePath(buildResource.BuildDirectory, firstProject)).Replace("'", "%27", StringComparison.Ordinal), 1117NormalizeBuildProjectPath(Path.GetRelativePath(buildResource.BuildDirectory, secondProject)), 1130var customTargetsPath = Path.Combine(workspace.Path, "CustomNuGet.targets"); 1141Path.Combine(workspace.Path, "obj", ".aspire", "build"), 1194Path.Combine(workspace.Path, "obj", ".aspire", "build"), 1204var missingTargetsPath = Path.Combine(workspace.Path, "missing", "NuGet.targets"); 1232Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(projectPath)!, "restore-ran.txt"))); 1241var aspireStoreRoot = Path.Combine(workspace.Path, "custom-obj"); 1250Assert.Equal(Path.Combine(aspireStoreRoot, ".aspire", "build"), buildResource.BuildDirectory); 1260var buildDirectory = Path.Combine(workspace.Path, "obj", ".aspire", "build"); 1300Assert.Equal(Path.GetDirectoryName(projectPath), buildResource.WorkingDirectory); 1313var feed = Directory.CreateDirectory(Path.Combine(projectRoot, "feed")).FullName; 1316var feedSource = new Uri(feed + Path.DirectorySeparatorChar).AbsoluteUri; 1319File.WriteAllText(Path.Combine(projectRoot, "nuget.config"), $$""" 1327File.WriteAllText(Path.Combine(projectRoot, "Directory.Build.props"), """ 1339var versionsPath = Path.Combine(projectRoot, "Directory.Packages.props"); 1376var escapedDirectory = Path.Combine(projectRoot, "First's Project;100% (test)"); 1377Directory.Move(Path.GetDirectoryName(firstProject)!, escapedDirectory); 1378firstProject = Path.Combine(escapedDirectory, Path.GetFileName(firstProject)); 1382Path.Combine(workspace.Path, "obj", ".aspire", "build"), 1396File.ReadAllText(Path.Combine(Path.GetDirectoryName(project)!, "package-version.txt"))); 1397Assert.True(File.Exists(Path.Combine(Path.GetDirectoryName(project)!, "packages.lock.json"))); 1400Path.Combine(Path.GetDirectoryName(sharedProject)!, "obj", "project.assets.json")))) 1415File.ReadAllText(Path.Combine(Path.GetDirectoryName(project)!, "package-version.txt"))); 1423File.ReadAllText(Path.Combine(Path.GetDirectoryName(project)!, "package-version.txt"))); 1437Path.Combine(workspaceRoot, "obj", ".aspire", "build"), 1440var caseVariantPath = Path.Combine(workspaceRoot, "service", "app.CSPROJ"); 1472var aspireStoreRoot = Path.Combine(workspaceRoot, "custom-obj"); 1489Path.Combine(aspireStoreRoot, ".aspire", "build"), 1503Assert.Equal(Path.GetDirectoryName(workerPath), directBuild.WorkingDirectory); 1543Path.Combine(Path.GetDirectoryName(projectPath)!, "bin", "Worker.dll"), 2061var appHostDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "AppHost")).FullName; 2063var buildDirectory = Path.Combine(appHostDirectory, "obj", ".aspire", "build"); 2089Assert.StartsWith(buildDirectory + Path.DirectorySeparatorChar, buildProjectPath, StringComparison.Ordinal); 2093var relativePath = Path.GetRelativePath(workspaceRoot, path) 2096var changedPath = Path.Combine(workspaceRoot, relativePath); 2332Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), 2653var appPath = Path.Combine(workspace.Path, "app.cs"); 2743Path.Combine(Path.GetDirectoryName(projectPath)!, "bin", "Worker.dll"), 2785Assert.Equal(Path.GetDirectoryName(projectPath), launchConfiguration.BuildWorkingDirectory); 3119var projectDirectory = Path.GetDirectoryName(projectPath)!; 3120var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "runtime")).FullName; 3121var sdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspaceRoot, "sdk-runtime")).FullName; 3130Path.Combine(projectDirectory, "bin", "Worker.dll"), 3173var projectDirectory = Path.GetDirectoryName(projectPath)!; 3174var firstSdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime-1")).FullName; 3175var secondSdkWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "sdk-runtime-2")).FullName; 3184Path.Combine(projectDirectory, "bin", "Worker.dll"), 3222var sourceRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "source")).FullName; 3223File.WriteAllText(Path.Combine(sourceRoot, "global.json"), "{}"); 3226var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime")).FullName; 3248Directory.CreateDirectory(Path.Combine(workspace.Path, "source")).FullName, 3251var projectDirectory = Path.GetDirectoryName(projectPath)!; 3252var foreignRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "foreign")).FullName; 3253File.WriteAllText(Path.Combine(foreignRoot, "global.json"), "{}"); 3254var runtimeWorkingDirectory = Directory.CreateDirectory(Path.Combine(foreignRoot, "runtime")).FullName; 3333var filePath = Path.Combine(workspace.Path, "worker.cs"); 3384File.WriteAllText(Path.Combine(Path.GetDirectoryName(firstPath)!, "global.json"), """ 3408Assert.True(File.Exists(Path.Combine(firstBuild.WorkingDirectory, "global.json"))); 3414Assert.Equal(Path.GetDirectoryName(secondPath), secondBuild.WorkingDirectory); 3429var physicalRoot = Directory.CreateDirectory(Path.Combine(workspace.Path, "Physical")); 3431File.WriteAllText(Path.Combine(physicalRoot.FullName, "global.json"), """ 3439var linkPath = Path.Combine(workspace.Path, "Alias"); 3449var aliasProjectPath = Path.Combine(linkPath, "Service", Path.GetFileName(linkedProjectPath)); 3463Assert.True(File.Exists(Path.Combine(linkedBuild.WorkingDirectory, "global.json"))); 3468Assert.Equal(Path.GetDirectoryName(otherProjectPath), otherBuild.WorkingDirectory); 3482var resource = new DotnetProjectResource("service", Path.GetDirectoryName(projectPath)!); 3506var removedResource = new DotnetProjectResource("removed", Path.GetDirectoryName(removedProjectPath)!); 3513var activeResource = new DotnetProjectResource("active", Path.GetDirectoryName(activeProjectPath)!); 3656var missingPath = Path.Combine(workspace.Path, "Missing", "Missing.csproj"); 3683File.WriteAllText(Path.Combine(Path.GetDirectoryName(firstPath)!, "global.json"), """ 3741var linkDirectory = Path.Combine(workspace.Path, "ServiceAlias"); 3745Directory.CreateSymbolicLink(linkDirectory, Path.GetDirectoryName(projectPath)!); 3752var aliasPath = Path.Combine(linkDirectory, Path.GetFileName(projectPath)); 3768Assert.Equal(Path.GetDirectoryName(coordinatedProjectPath), first.Resource.WorkingDirectory); 3769Assert.Equal(Path.GetDirectoryName(coordinatedProjectPath), second.Resource.WorkingDirectory); 3781Path.Combine(workspace.Path, "obj", ".aspire", "build"), 3833var escapedDirectory = Path.Combine(workspace.Path, "Api's Project 100% (test)"); 3834Directory.Move(Path.GetDirectoryName(apiProject)!, escapedDirectory); 3835apiProject = Path.Combine(escapedDirectory, Path.GetFileName(apiProject)); 3836var apiSentinel = Path.Combine(workspace.Path, "api-ran.txt"); 3837var workerSentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 3877var restoreCountPath = Path.Combine(Path.GetDirectoryName(project)!, "restore-count.txt"); 3893File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), """ 3900var sentinels = Directory.CreateDirectory(Path.Combine(workspace.Path, "instances")).FullName; 3935Assert.True(File.Exists(Path.Combine(sentinels, $"{processId}.txt"))); 4004var firstSentinel = Path.Combine(workspace.Path, "first-ran.txt"); 4005var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt"); 4046Assert.Equal(directSalt, File.ReadAllText(Path.Combine(Path.GetDirectoryName(secondProject)!, "handshake-salt.txt")).TrimEnd('\r', '\n')); 4082var sentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 4118var secondBuildMarker = Path.Combine(workspace.Path, "second-built.txt"); 4124var secondSentinel = Path.Combine(workspace.Path, "second-ran.txt"); 4180File.WriteAllText(Path.Combine(Path.GetDirectoryName(validProject)!, "Program.cs"), """ 4183var sentinelPath = Path.Combine(workspace.Path, "valid-ran.txt"); 4184var missingProject = Path.Combine(workspace.Path, "Missing", "Missing.csproj"); 4237var missingPath = Path.Combine(workspace.Path, "Missing", $"Missing.{extension}"); 4291var sentinelPath = Path.Combine(workspace.Path, "environment-build-ran.txt"); 4314var expectedTargetPath = Path.Combine(Path.GetDirectoryName(projectPath)!, "bin", "custom", "net10.0", "EnvironmentBuild.dll"); 4321Assert.Equal(Path.GetDirectoryName(projectPath), metadata.BuildWorkingDirectory); 4388var sentinelPath = Path.Combine(Path.GetDirectoryName(projectPath)!, "build-sentinel.txt"); 4405Path.Combine(Path.GetDirectoryName(projectPath)!, "PersistentProject.dll"), 4447var filePath = Path.Combine(workspace.Path, "worker.cs"); 4680var filePath = Path.Combine(workspace.Path, "worker.cs"); 4714var filePath = Path.Combine(workspace.Path, "worker.cs"); 4747Path.Combine(Path.GetDirectoryName(projectPath)!, "Api.dll"), 4785Path.Combine(workspace.Path, "missing-dotnet"); 4821var fileApp = Path.Combine(workspace.Path, "worker.cs"); 4822var sentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 4883var releaseBuild = Path.Combine(workspace.Path, "release-build"); 4885var fileApp = Path.Combine(workspace.Path, "worker.cs"); 4886var sentinel = Path.Combine(workspace.Path, "worker-ran.txt"); 4996using var archive = ZipFile.Open(Path.Combine(feed, $"Aspire.RestoreTest.{version}.nupkg"), ZipArchiveMode.Create); 5024var directory = Directory.CreateDirectory(Path.Combine(root, directoryName)); 5025var path = Path.Combine(directory.FullName, projectFileName); 5033Path.Combine(Path.GetDirectoryName(projectPath)!, "Properties")); 5034File.WriteAllText(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), $$""" 5069File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "SharedValue.cs"), """ 5085var directory = Directory.CreateDirectory(Path.Combine(root, name)); 5086var relativeSharedProject = Path.GetRelativePath(directory.FullName, sharedProject); 5087var projectPath = Path.Combine(directory.FullName, $"{name}{extension}"); 5141File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), """ 5160File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "BuildGate.cs"), $$""" 5190var projectDirectory = Path.GetDirectoryName(projectPath)!; 5191File.WriteAllText(Path.Combine(projectDirectory, "Program.cs"), "System.Console.WriteLine(\"Started\");"); 5208File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, "Program.cs"), "this does not compile"); 5217var directory = Directory.CreateDirectory(Path.Combine(root, name)); 5218var projectPath = Path.Combine(directory.FullName, $"{name}{extension}"); 5225var directory = Directory.CreateDirectory(Path.Combine(root, name)); 5226var appPath = Path.Combine(directory.FullName, $"{name}.cs"); 5227var relativeSharedProject = Path.GetRelativePath(directory.FullName, sharedProject) 5228.Replace(Path.DirectorySeparatorChar, '/'); 5239var directory = Path.GetDirectoryName(filePath)!; 5243var linkDirectory = Path.Combine(Path.GetDirectoryName(directory)!, "FileAppAlias"); 5253aliasPath = Path.Combine(linkDirectory, Path.GetFileName(filePath)); 5268"case" => Path.Combine( 5269Path.GetDirectoryName(directory)!, 5270Path.GetFileName(directory).ToUpperInvariant(), 5271Path.GetFileName(filePath)), 5275"case-and-normalization" => Path.Combine( 5276Path.GetDirectoryName(directory)!, 5277Path.GetFileName(directory).ToUpperInvariant().Normalize(NormalizationForm.FormD), 5278Path.GetFileName(filePath)), 5288Path.Combine(Path.GetDirectoryName(projectPath)!, "build-count.txt"); 5307path.Replace(Path.DirectorySeparatorChar, '/'); 5310Path.GetFullPath(path); 5427foreach (var directory in Directory.EnumerateDirectories(Path.GetTempPath(), "aspire-msbuild-*")) 5429var responseFilePath = Path.Combine(directory, "build-properties.rsp");
DotnetProjectBuildEnvironmentTests.cs (1)
27var responseFileDirectory = Path.GetDirectoryName(responseFilePath)!;
DotnetProjectFacadeTests.cs (1)
160var path = Path.Combine(workspace.Path, "Service.vbproj");
DotnetProjectLaunchProfileTests.cs (10)
37var resource = builder.AddDotnetProject("service", Path.GetDirectoryName(path)!); 118File.WriteAllText(Path.Combine(Path.GetDirectoryName(path)!, "appsettings.json"), """ 201File.Copy(preferredSettings, Path.ChangeExtension(path, ".run.json")); 227File.Move(settings, Path.ChangeExtension(path, ".run.json")); 286var directory = Directory.CreateDirectory(Path.Combine(root, "Service")); 287var path = Path.Combine(directory.FullName, $"Service{extension}"); 295var directory = Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(projectPath)!, directoryName)); 296var path = Path.Combine(directory.FullName, "launchSettings.json");
DotnetProjectOptionsTests.cs (5)
102var projectDirectory = Directory.CreateDirectory(Path.Combine(workspacePath, "Service")); 103var projectPath = Path.Combine(projectDirectory.FullName, "Service.csproj"); 105var propertiesDirectory = Directory.CreateDirectory(Path.Combine(projectDirectory.FullName, "Properties")); 106await File.WriteAllTextAsync(Path.Combine(propertiesDirectory.FullName, "launchSettings.json"), """ 122await File.WriteAllTextAsync(Path.Combine(projectDirectory.FullName, "appsettings.json"), """
DotnetProjectPathTests.cs (25)
24var projectPath = Path.Combine(workspace.Path, $"Service{extension}"); 30var relativeResource = builder.AddDotnetProject("relative", Path.GetFileName(projectPath), options => options.ExcludeLaunchProfile = true); 56var projectPath = Path.Combine(directory.FullName, $"Service{extension}"); 58File.WriteAllText(Path.Combine(directory.FullName, "app.cs"), ""); 59File.WriteAllText(Path.Combine(directory.FullName, "script.fsx"), ""); 61File.WriteAllText(Path.Combine(nested.FullName, "Other.csproj"), "<Project />"); 78File.WriteAllText(Path.Combine(directory.FullName, "Later.vbproj"), "<Project />"); 89var path = Path.Combine(workspace.Path, "Service.fsproj"); 102Path.TrimEndingDirectorySeparator(resource.Resource.GetProjectMetadata().ProjectPath)); 122File.WriteAllText(Path.Combine(directory.FullName, $"First{firstExtension}"), "<Project />"); 123File.WriteAllText(Path.Combine(directory.FullName, $"Second{secondExtension}"), "<Project />"); 125File.WriteAllText(Path.Combine(directory.FullName, "app.cs"), ""); 158var path = Path.Combine(workspace.Path, fileName); 159if (Path.HasExtension(fileName)) 188var csharpPath = Path.Combine(directory.FullName, "Service.csproj"); 193File.WriteAllText(Path.Combine(directory.FullName, "Service.fsproj"), "<Project />"); 194File.WriteAllText(Path.Combine(directory.FullName, "Service.vbproj"), "<Project />"); 216var path = Path.Combine(workspace.Path, $"Service{extension}"); 237var path = Path.Combine(workspace.Path, $"Service{extension}"); 264File.WriteAllText(Path.Combine(directory.FullName, $"First{firstExtension}"), "<Project />"); 265File.WriteAllText(Path.Combine(directory.FullName, $"Second{secondExtension}"), "<Project />"); 267File.WriteAllText(Path.Combine(directory.FullName, "app.cs"), ""); 287var path = Path.Combine(workspace.Path, fileName); 308var path = Path.Combine(workspace.Path, "MissingDirectory"); 327var path = Path.Combine(workspace.Path, $"Missing{extension}");
DotnetProjectResourceTests.cs (56)
40var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 56var appPath = Path.Combine(builder.AppHostDirectory, "service.cs"); 72var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 76Assert.Equal(Path.GetDirectoryName(projectPath), app.Resource.WorkingDirectory); 147var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 178var expectedPath = Path.GetRelativePath(workspace.Path, metadata.ProjectPath).Replace('\\', '/'); 256await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Dockerfile"), "FROM scratch"); 295var appPath = Path.Combine(workspace.Path, "app.cs"); 302var archivePath = Path.Combine(workspace.Path, "app.tar.gz"); 332var sentinelDockerfilePath = Path.Combine(workspace.Path, "Dockerfile.sentinel"); 333await File.WriteAllTextAsync(Path.Combine(workspace.Path, "sentinel.txt"), marker, cancellation.Token); 401var projectPath = Path.Combine(workspace.Path, "Project.csproj"); 408context.OutputPath = Path.Combine(workspace.Path, "project.tar"); 427var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "project")); 429var runtimeDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "runtime")); 430File.WriteAllText(Path.Combine(projectDirectory.FullName, "Dockerfile"), "FROM scratch"); 453var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 454var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj"); 471var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "AmbiguousService")); 472File.WriteAllText(Path.Combine(projectDir.FullName, "First.csproj"), "<Project />"); 473File.WriteAllText(Path.Combine(projectDir.FullName, "Second.csproj"), "<Project />"); 502var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", projectFileName); 540var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 541var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj"); 544var propertiesDir = Directory.CreateDirectory(Path.Combine(projectDir.FullName, "Properties")); 545await File.WriteAllTextAsync(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """ 572var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 586var appPath = Path.Combine(builder.AppHostDirectory, "service.cs"); 622AppHostFilePath = Path.Combine(projectDirectory, "apphost.mts") 625var projectPath = Path.Combine(projectDirectory, "MyService", "MyService.csproj"); 648var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", $"MyService{extension}"); 674var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 675var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj"); 678var propertiesDir = Directory.CreateDirectory(Path.Combine(projectDir.FullName, "Properties")); 679await File.WriteAllTextAsync(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """ 708var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 725var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 744var projectDir = Directory.CreateDirectory(Path.Combine(workspace.Path, "MyService")); 745var projectPath = Path.Combine(projectDir.FullName, "MyService.csproj"); 748var propertiesDir = Directory.CreateDirectory(Path.Combine(projectDir.FullName, "Properties")); 749await File.WriteAllTextAsync(Path.Combine(propertiesDir.FullName, "launchSettings.json"), """ 798var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 824var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 843var appPath = Path.Combine(builder.AppHostDirectory, "service.cs"); 878var appPath = Path.Combine(builder.AppHostDirectory, "service.cs"); 902var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 933var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 964var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 994var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 1023var projectPath = Path.Combine(builder.AppHostDirectory, "MyService", "MyService.csproj"); 1066var appPath = Path.Combine(builder.AppHostDirectory, "service.cs"); 1127var projectDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "project")); 1128var projectPath = Path.Combine(projectDirectory.FullName, $"Project{extension}"); 1154var archivePath = Path.Combine(workspace.Path, "project.tar.gz"); 1220var projectDirectory = Directory.CreateDirectory(Path.Combine(workspacePath, "MyService")); 1227var path = Path.Combine(directory, fileName);
DotnetProjectRunPropertiesResolverTests.cs (4)
21var projectPath = Path.Combine(workspace.Path, "Broken.csproj"); 57var projectPath = Path.Combine(workspace.Path, "Warning.csproj"); 86Path.Combine(workspace.Path, "bin"), 87Path.Combine(workspace.Path, "bin", "app.dll"),
Helpers\DotnetProjectContractFactory.cs (4)
49var projectPath = Path.Combine(directory, "Service.csproj"); 58File.WriteAllText(Path.Combine(directory, "Program.cs"), """ 67var properties = Directory.CreateDirectory(Path.Combine(directory, "Properties")).FullName; 69Path.Combine(properties, "launchSettings.json"),
Helpers\DotnetProjectTestHelpers.cs (3)
10var (fileName, source) = Path.GetExtension(projectPath).ToLowerInvariant() switch 18File.WriteAllText(Path.Combine(Path.GetDirectoryName(projectPath)!, fileName), source);
MsTestCollectorTests.cs (27)
48File.WriteAllText(Path.Combine(workspace.Path, "runner reports", "results.trx"), 71var path = Path.Combine(workspace.Path, "runner reports", "results.trx"); 78Directory.CreateDirectory(Path.Combine(Path.GetDirectoryName(path)!, "merged")); 79File.WriteAllText(Path.Combine(Path.GetDirectoryName(path)!, "merged", "results.trx"), Report); 91Assert.Equal(Report, await File.ReadAllTextAsync(Path.Combine(Path.GetDirectoryName(GetReportPath(resource))!, 115File.WriteAllText(Path.Combine(workspace.Path, "runner reports", "results.trx"), failure == "malformed" 169var source = Path.Combine(workspace.Path, "runner reports"); 170File.WriteAllText(Path.Combine(source, "results.trx"), Report); 172File.WriteAllText(Path.Combine(external, "external.txt"), "not copied"); 176File.WriteAllText(Path.Combine(external, "results.trx"), Report); 181Directory.CreateSymbolicLink(Path.Combine(link == "nested-source" ? source : annotation.OutputPath!, "nested"), external); 184Directory.CreateDirectory(Path.Combine(source, "nested")); 185File.WriteAllText(Path.Combine(source, "nested", "artifact.txt"), "not copied"); 192Assert.Equal(expected, Directory.GetFiles(external).Select(Path.GetFileName).Order().ToArray()); 207var target = Path.Combine(workspace.Path, "outside.trx"); 215File.Copy(target, Path.Combine(targetDirectory, "results.trx")); 220File.CreateSymbolicLink(Path.Combine(workspace.Path, "runner reports", "results.trx"), target); 237File.Copy(Path.Combine(MSBuildUtils.GetRepoRoot(), "NuGet.config"), Path.Combine(workspace.Path, "NuGet.config")); 238var projectPath = Path.Combine(projectDirectory, "Fixture.csproj"); 254File.WriteAllText(Path.Combine(projectDirectory, "Fixture.cs"), """ 313builder.Configuration[KnownConfigNames.TestOutputPath] = Path.Combine(workspace.Path, "test output"); 320var path = Path.Combine(workspace.Path, "tests.csproj"); 331return Path.Combine(resource.Resource.Annotations.OfType<TestingAnnotation>().Single().OutputPath!, "results.trx");
MsTestResourceTests.cs (13)
43var path = Path.Combine(project, "tests.csproj"); 49builder.Configuration["ASPIRE_TEST_OUTPUT_PATH"] = Path.Combine(workspace.Path, "reports with spaces"); 51var resource = builder.AddMsTest("tests", Path.GetRelativePath(workspace.Path, path), 104var path = Path.Combine(workspace.Path, "tests.csproj"); 107builder.Configuration["ASPIRE_TEST_OUTPUT_PATH"] = Path.Combine(workspace.Path, "reports"); 123var path = Path.Combine(workspace.Path, "tests.csproj"); 126builder.Configuration["ASPIRE_TEST_OUTPUT_PATH"] = Path.Combine(workspace.Path, "reports"); 142var path = Path.Combine(workspace.Path, "tests.csproj"); 145builder.Configuration["ASPIRE_TEST_OUTPUT_PATH"] = Path.Combine(workspace.Path, "reports"); 174var path = Path.Combine(workspace.Path, "tests.csproj"); 177builder.Configuration["ASPIRE_TEST_OUTPUT_PATH"] = Path.Combine(workspace.Path, "reports"); 196Assert.Throws<FileNotFoundException>(() => builder.AddMsTest("tests", Path.Combine(workspace.Path, "missing.csproj"))); 197var path = Path.Combine(workspace.Path, "tests.csproj");
tests\Shared\TestFileSystemService.cs (2)
33var resolvedName = fileName ?? System.IO.Path.GetRandomFileName(); 34var filePath = System.IO.Path.Combine(tempDir.FullName, resolvedName);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
WslcDotnetPublishingTests.cs (3)
63options.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 134options.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 154MsBuildResponseFileFactory.CreatePropertyArgument("ContainerArchiveOutputPath", Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"))
Aspire.Hosting.EntityFrameworkCore (13)
EFCoreOperationExecutor.cs (2)
140var workingDir = Path.GetDirectoryName(_startupProjectPath); 160var segments = assemblyPath.Split(Path.DirectorySeparatorChar, '/');
EFMigrationResourceBuilderExtensions.cs (7)
241projectPath = projectPath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 242projectPath = Path.GetFullPath(Path.Combine(builder.ApplicationBuilder.AppHostDirectory, projectPath)); 332var buildContext = Path.Combine(ResolvePipelineOutputDirectory(builder), "efmigrations"); 374return Path.GetFullPath(configured); 377return Path.Combine(builder.ApplicationBuilder.AppHostDirectory, "aspire-output");
EFResourceBuilderExtensions.cs (4)
340? Path.Combine(outputDir, migrationResource.Name + ".sql") 384? Path.Combine(outputDir, GetBundleFileName(migrationResource)) 454var outputDir = Path.Combine(pipelineOutputService.GetOutputDirectory(), "efmigrations"); 723var startupProjectDir = Path.GetDirectoryName(migrationResource.StartupProjectResource.GetProjectMetadata().ProjectPath)!;
Aspire.Hosting.EntityFrameworkCore.Tests (11)
EFBuildCustomizationWarningTests.cs (1)
41? builder.AddResource(new DotnetProjectResource("api", Path.GetDirectoryName(startupPath)!))
EFBuildReadinessTests.cs (1)
94var project = builder.AddResource(new DotnetProjectResource("api", Path.GetDirectoryName(projectPath)!))
EFMigrationConfigurationTests.cs (4)
273Assert.Equal(Path.GetFullPath(Path.Combine(builder.AppHostDirectory, "Target.csproj")), migrations.Resource.MigrationsProjectPath); 275Assert.Equal(Path.GetFullPath(Path.Combine(builder.AppHostDirectory, "Target.csproj")), migrations.Resource.MigrationsProjectPath);
EFMigrationPipelineTests.cs (2)
475Assert.Equal(Path.Combine(Path.GetFullPath("./"), "efmigrations"), dockerfileAnnotation.ContextPath);
EFOutputDiffingTests.cs (3)
76var artifact = Path.Combine(workspace.Path, "efmigrations", bundle ? "migrations" : "migrations.sql"); 77Directory.CreateDirectory(Path.GetDirectoryName(artifact)!); 118Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message);
Aspire.Hosting.Foundry.Tests (2)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Garnet.Tests (1)
AddGarnetTests.cs (1)
271Assert.Equal(Path.Combine(builder.AppHostDirectory, "mygarnetdata"), volumeAnnotation.Source);
Aspire.Hosting.Go (9)
GoHostingExtensions.cs (8)
85appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 169if (File.Exists(Path.Combine(appDirectory, "Dockerfile"))) 188var hasGoMod = File.Exists(Path.Combine(appDirectory, "go.mod")); 189var hasGoSum = File.Exists(Path.Combine(appDirectory, "go.sum")); 775var workingDirectory = Path.GetFullPath(resource.WorkingDirectory); 783Program = Path.GetFullPath(packagePath, workingDirectory), 856if (Path.GetRelativePath(resource.WorkingDirectory, Path.GetFullPath(packagePath.PackagePath, resource.WorkingDirectory)) == ".")
GoVersionDetector.cs (1)
14var goModPath = Path.Combine(appDirectory, "go.mod");
Aspire.Hosting.Go.Tests (44)
AddGoAppTests.cs (32)
109File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 116var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 634var packageDirectory = Path.Combine(sourceDir.FullName, "cmd", "server"); 916File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.23\n"); 917File.WriteAllText(Path.Combine(sourceDir.FullName, "main.go"), "package main\nfunc main() {}"); 924var dockerfilePath = Path.Combine(outputDir.FullName, "api.Dockerfile"); 944var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 956File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.22\n"); 966var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 978File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 988var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1001File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch"); 1042$"Go app resource 'api' is configured to run package './cmd/server', but publish is using the existing Dockerfile '{Path.Combine(sourceDir, "Dockerfile")}'. " + 1236File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.22\n"); 1244var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1258File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1266var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1278File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1286var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1334File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1351var dockerfile = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1368File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1391var dockerfile = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1436File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1443var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1510File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1517var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1529File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1537var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1643File.WriteAllText(Path.Combine(sourceDir.FullName, "go.mod"), "module example.com/api\n\ngo 1.24\n"); 1644File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\nENTRYPOINT [\"/app/api\"]\n"); 1651var dockerfilePath = Path.Combine(directory, fileName);
GoRunDebuggingTests.cs (5)
52var command = Path.Combine(builder.AppHostDirectory, "custom go"); 354File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/debugflags\n\ngo 1.18\n"); 355File.WriteAllText(Path.Combine(workspace.Path, "main.go"), """ 421File.WriteAllText(Path.Combine(workspace.Path, "tag.go"), """ 436var goEnvironment = Path.Combine(workspace.Path, "go.env");
GoVersionDetectorTests.cs (5)
22File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n\ngo 1.23\n"); 33File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n\ngo 1.23.4\n"); 44File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), 57File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), 69File.WriteAllText(Path.Combine(workspace.Path, "go.mod"), "module example.com/m\n");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Java (89)
JavaBuildToolResolver.cs (8)
31var hasMaven = File.Exists(Path.Combine(appDirectory, "pom.xml")); 32var hasGradle = s_gradleBuildFileNames.Any(fileName => File.Exists(Path.Combine(appDirectory, fileName))); 78FindWrapperInBuildRoot(appDirectory, wrapperName, tool) ?? Path.Combine(appDirectory, wrapperName)); 86var candidate = Path.Combine(directory.FullName, wrapperName); 99var gitPath = Path.Combine(directory.FullName, ".git"); 116JavaBuildTool.Gradle => File.Exists(Path.Combine(directory, "settings.gradle")) 117|| File.Exists(Path.Combine(directory, "settings.gradle.kts")), 120JavaBuildTool.Maven => File.Exists(Path.Combine(directory, "pom.xml")),
JavaDockerfileGenerator.cs (17)
121&& !File.Exists(Path.Combine(appDirectory, ".dockerignore"))) 391/// <see cref="Path.IsPathRooted(string)"/> applies only the rules of the host it runs on, so an AppHost 405=> Path.IsPathRooted(path) 411/// Detected without <see cref="Path.IsPathRooted(string)"/> so the answer is the same on every 782var path = Path.Combine(appDirectory, fileName); 842var propertiesPath = Path.Combine( 844wrapperSupportPath.Replace('/', Path.DirectorySeparatorChar), 945var propertiesPath = Path.Combine( 947wrapperSupportPath.Replace('/', Path.DirectorySeparatorChar), 991var wrapperDirectory = Path.GetDirectoryName(wrapper.AsSpan()); 999var propertiesPath = Path.Combine( 1001supportPath.Replace('/', Path.DirectorySeparatorChar), 1039var relative = Path.GetRelativePath(appDirectory, resolvedWrapperPath).Replace('\\', '/'); 1073if (Path.GetExtension(relative) is ".cmd" or ".bat") 1075var posixSibling = relative[..^Path.GetExtension(relative).Length]; 1077if (!File.Exists(Path.Combine(appDirectory, posixSibling.Replace('/', Path.DirectorySeparatorChar))))
JavaHostingExtensions.cs (27)
91Path.Combine(builder.AppHostDirectory, appDirectory)); 114if (File.Exists(Path.Combine(appDirectory, "Dockerfile"))) 953Path.Combine(builder.Resource.WorkingDirectory, wrapperPath)); 1161return Path.Combine(outputDirectory, "agent", "opentelemetry-javaagent.jar"); 1241resolved = Path.GetFullPath(Path.Combine(builder.Resource.WorkingDirectory, authored)); 1498var relativeWrapperPath = Path.GetRelativePath(workingDirectory, wrapperPath); 1503if (!Path.IsPathRooted(relativeWrapperPath)) 1505relativeWrapperPath = Path.Combine(".", relativeWrapperPath); 1810if (!Path.IsPathFullyQualified(command)) 1815var fileName = Path.GetFileName(command); 1866var jarPath = Path.GetFullPath(Path.Combine(resource.WorkingDirectory, NormalizeJarPathForJava(jar.JarPath))); 1900JavaBuildTool.Maven => Path.Combine(resource.WorkingDirectory, "target"), 1901JavaBuildTool.Gradle => Path.Combine(resource.WorkingDirectory, "build", "libs"), 1978var runJar = Path.Combine( 1984return File.Exists(runJar) ? Path.GetFullPath(runJar) : null; 1993Path.TrimEndingDirectorySeparator(Path.GetFullPath(left)), 1994Path.TrimEndingDirectorySeparator(Path.GetFullPath(right)), 1999var fileName = Path.GetFileName(jarPath); 2020JavaBuildTool.Maven => TryReadMavenArtifactId(Path.Combine(resource.WorkingDirectory, "pom.xml")), 2087var settingsPath = Path.Combine(workingDirectory, fileName); 2112var directoryName = Path.GetFileName(workingDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar));
JavaVersionDetector.cs (6)
45DetectFromGradle(Path.Combine(appDirectory, "build.gradle")), 46DetectFromGradle(Path.Combine(appDirectory, "build.gradle.kts")), 47DetectFromPom(Path.Combine(appDirectory, "pom.xml"), buildArgs: null), 52Path.Combine(appDirectory, "pom.xml"), 54DetectFromGradle(Path.Combine(appDirectory, "build.gradle")), 55DetectFromGradle(Path.Combine(appDirectory, "build.gradle.kts")),
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Java.Tests (194)
AddJavaAppPublishTests.cs (89)
46Directory.CreateDirectory(Path.Combine(workspace.Path, "build", "libs")); 50await File.WriteAllTextAsync(Path.Combine(workspace.Path, "build", "libs", "reports service.jar"), ""); 52var destination = Path.Combine(workspace.Path, "app.jar"); 232File.WriteAllText(Path.Combine(sourceDir.FullName, "build.gradle"), ""); 404File.WriteAllText(Path.Combine(source, ".dockerignore"), "secrets/\n"); 419File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n"); 425Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 440File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n"); 471File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n"); 503var manifest = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "aspire-manifest.json"), TestContext.Current.CancellationToken); 520File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), $""" 541File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 569File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 592File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 616File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 687File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "plugins { id 'java' }"); 697File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 722File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 906File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), script); 1018File.WriteAllText(Path.Combine(appDirectory.Path, fileName), script); 1028File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), """ 1041File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 1044File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "sourceCompatibility = '21'"); 1060File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 1063File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "sourceCompatibility = '21'"); 1077File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 1080File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), "plugins { id 'java' }"); 1092File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 1115File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 1137File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), """ 1158File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), "<project>"); 1190File.WriteAllText(Path.Combine(appDirectory.Path, fileName), ""); 1207File.WriteAllText(Path.Combine(appDirectory.Path, "pom.xml"), "<project />"); 1208File.WriteAllText(Path.Combine(appDirectory.Path, "build.gradle"), ""); 1254File.WriteAllText(Path.Combine(sourceDir.FullName, "pom.xml"), "<project/>"); 1278.WithWrapperPath(Path.Combine("..", "sibling", "mvnw")); 1379var wrapperDirectory = Path.Combine(source, "scripts"); 1380WriteWrapper(wrapperDirectory, Path.GetFileName(posixWrapper)); 1381WriteWrapper(wrapperDirectory, Path.GetFileName(windowsWrapper)); 1403File.Delete(Path.Combine(sourceDir.FullName, "mvnw")); 1429Directory.Delete(Path.Combine(sourceDir.FullName, supportDirectory), recursive: true); 1451Directory.CreateDirectory(Path.Combine(source, "scripts")); 1452WriteWrapper(Path.Combine(source, "scripts"), "custom-mvnw"); 1456.WithWrapperPath(Path.Combine("scripts", "custom-mvnw"))); 1468Directory.CreateDirectory(Path.Combine(source, "target")); 1469File.WriteAllText(Path.Combine(source, "target", "worker.jar"), ""); 1471jarPath: Path.Combine("target", "worker.jar")); 1488Directory.CreateDirectory(Path.Combine(source, "target")); 1489File.WriteAllText(Path.Combine(source, "target", "worker.jar"), ""); 1491jarPath: Path.Combine("target", "worker.jar"), 1504Directory.CreateDirectory(Path.Combine(source, "target")); 1505File.WriteAllText(Path.Combine(source, "target", "worker.jar"), ""); 1507jarPath: Path.Combine("target", "worker.jar")); 1521jarPath: Path.Combine("target", "api.jar")); 1539Path.Combine(sourceDir.FullName, "App.java"), 1560builder.AddJavaApp("api", sourceDir.FullName, Path.Combine("target", "app.jar"), ["--greeting", "hello"]); 1569await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "aspire-manifest.json"), TestContext.Current.CancellationToken)); 1579Path.Combine(outputDir.FullName, "api.Dockerfile"), 1580Path.Combine(sourceDir.FullName, "Dockerfile")); 1582Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"), 1583Path.Combine(sourceDir.FullName, ".dockerignore")); 1619Path.Combine(sourceDir.FullName, "pom.xml"), 1650var sourcePath = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "src", "main", "java")); 1652Path.Combine(sourcePath.FullName, "App.java"), 1686Path.Combine(outputDir.FullName, "api.Dockerfile"), 1687Path.Combine(sourceDir.FullName, "Dockerfile")); 1689Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"), 1690Path.Combine(sourceDir.FullName, ".dockerignore")); 1822var stagingDirectory = Path.Combine(workspace.Path, "staged"); 1863Assert.Equal("runner", File.ReadAllText(Path.Combine(stagingDirectory, "quarkus-run.jar"))); 1865var expectedDependency = Path.Combine(stagingDirectory, "lib", "dependency.jar"); 1868Assert.False(Directory.Exists(Path.Combine(stagingDirectory, "lib"))); 1923Path.Combine(source, ".mvn", "wrapper", "maven-wrapper.properties"), 2086Path.Combine(source, "pom.xml"), 2087File.ReadAllText(Path.Combine(source, "pom.xml")).Replace( 2132var nested = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "build tools")); 2138.WithWrapperPath(Path.Combine("build tools", "mvnw")); 2170File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile")), 2196return await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 2419return await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 2443var ignorePath = Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"); 2454File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), $""" 2471File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), """ 2497File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), $""" 2514File.WriteAllText(Path.Combine(sourceDirectory, "pom.xml"), $""" 2542File.WriteAllText(Path.Combine(sourceDirectory, "build.gradle"), contents); 2548File.WriteAllText(Path.Combine(sourceDirectory, wrapperName), "#!/bin/sh\nexit 0\n"); 2554var supportDirectory = Path.Combine(sourceDirectory, gradle ? "gradle" : ".mvn", "wrapper"); 2566Path.Combine(supportDirectory, gradle ? "gradle-wrapper.properties" : "maven-wrapper.properties"),
AddJavaAppTests.cs (68)
46Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper), tempDir.Path, "spring-boot:run"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource)); 59Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper), tempDir.Path, "bootRun", "--no-daemon"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource)); 139var expectedPath = Path.GetFullPath(tempDir.Path, builder.AppHostDirectory); 320var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper)); 338var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper)); 351File.WriteAllText(Path.Combine(repo.Path, "settings.gradle"), "include 'services:api'"); 352var module = Directory.CreateDirectory(Path.Combine(repo.Path, "services", "api")).FullName; 353File.WriteAllText(Path.Combine(module, "build.gradle"), ""); 359var expectedWrapper = Path.GetFullPath(Path.Combine(repo.Path, JavaHostingExtensions.s_defaultGradleWrapper)); 371File.WriteAllText(Path.Combine(repo.Path, "pom.xml"), "<project />"); 372var module = Directory.CreateDirectory(Path.Combine(repo.Path, "services", "api")).FullName; 373File.WriteAllText(Path.Combine(module, "pom.xml"), "<project />"); 379var expectedWrapper = Path.GetFullPath(Path.Combine(repo.Path, JavaHostingExtensions.s_defaultMavenWrapper)); 391var module = Directory.CreateDirectory(Path.Combine(repo.Path, "services", "api")).FullName; 392File.WriteAllText(Path.Combine(module, JavaHostingExtensions.s_defaultGradleWrapper), "#!/bin/sh\n"); 398var expectedWrapper = Path.GetFullPath(Path.Combine(module, JavaHostingExtensions.s_defaultGradleWrapper)); 409var workingDirectory = Path.Combine(Path.GetTempPath(), "repo", "services", "api"); 410var wrapperPath = Path.Combine(Path.GetTempPath(), "repo", "build tools", wrapperName); 415Assert.Equal(["/c", "call", Path.Combine(".", "..", "..", "build tools", wrapperName)], leadingArgs); 423var wrapperPath = Path.Combine(Path.GetTempPath(), "repo", "mvnw"); 426wrapperPath, Path.Combine(Path.GetTempPath(), "repo", "services", "api"), isWindows: false); 553var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, "scripts/custom-mvnw")); 571var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, "scripts/custom-gradlew")); 779var customWrapper = Path.Combine(tempDir.Path, "tools", "mvnw"); 780Directory.CreateDirectory(Path.GetDirectoryName(customWrapper)!); 788.WithWrapperPath(Path.Combine("tools", "mvnw")); 802ExpectedWrapperInvocation.Args(Path.GetFullPath(customWrapper), Path.GetFullPath(tempDir.Path), "spring-boot:run"), 815var wrapper = Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper); 974.WithOtelAgent(Path.Combine("target", "agent", "opentelemetry-javaagent.jar")); 983var expected = Path.GetFullPath( 984Path.Combine(app.Resource.WorkingDirectory, "target", "agent", "opentelemetry-javaagent.jar")); 987Assert.True(Path.IsPathFullyQualified(expected)); 1314var expectedWrapper = Path.GetFullPath(Path.Combine(tempDir.Path, "tools/mvn")); 1376var javaExecutable = Path.Combine(tempDir.Path, fileName); 1392var command = Path.Combine(tempDir.Path, fileName); 1404var command = Path.Combine("bin", OperatingSystem.IsWindows() ? "java.exe" : "java"); 1418var javaExecutable = Path.Combine(tempDir.Path, OperatingSystem.IsWindows() ? "java.exe" : "java"); 1445var javaExecutable = Path.Combine(tempDir.Path, OperatingSystem.IsWindows() ? "java.exe" : "java"); 1470var wrapperCommand = Path.Combine(tempDir.Path, OperatingSystem.IsWindows() ? "cmd.exe" : "sh"); 1509Path.Combine(outputDirectory, "quarkus-app", "quarkus-run.jar"), 1526var jarPath = Path.Combine(directory, fileName); 1527Directory.CreateDirectory(Path.GetDirectoryName(jarPath)!); 1558return Path.GetFullPath(jarPath); 1659Assert.Equal(Path.Combine(tempDir.Path, "no-main.jar"), Assert.Single(noMainClassConfiguration.ClassPaths!)); 1663Assert.Equal(Path.Combine(tempDir.Path, "does-not-exist.jar"), Assert.Single(missingConfiguration.ClassPaths!)); 1679Path.Combine(outputDirectory, "catalog-0.0.1-SNAPSHOT.jar"), 1689Path.Combine(tempDir.Path, tool == "maven" ? "pom.xml" : "settings.gradle"), 1797File.WriteAllText(Path.Combine(tempDir.Path, "pom.xml"), """ 1827File.WriteAllText(Path.Combine(tempDir.Path, "settings.gradle"), "rootProject.name = 'orders'\n"); 1849Path.GetFileName(tempDir.Path.TrimEnd(Path.DirectorySeparatorChar)), 1861Path.Combine(tempDir.Path, "settings.gradle"), 1882File.WriteAllText(Path.Combine(tempDir.Path, "pom.xml"), """ 1894Path.Combine("target", "worker-0.0.1-SNAPSHOT.jar"), 1898.AddJavaApp("worker", tempDir.Path, Path.Combine("target", "worker-0.0.1-SNAPSHOT.jar"))
AddQuarkusAppTests.cs (2)
101Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper), tempDir.Path, "quarkus:dev"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource)); 118Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper), tempDir.Path, "quarkusDev"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource));
AddSpringBootAppTests.cs (9)
26Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper), tempDir.Path, "spring-boot:run"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource)); 43Assert.Equal(ExpectedWrapperInvocation.Args(Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultGradleWrapper), tempDir.Path, "bootRun"), await ArgumentEvaluator.GetArgumentListAsync(app.Resource)); 119Path.Combine(tempDir.Path, JavaHostingExtensions.s_defaultMavenWrapper), 246var expected = Path.GetFullPath(Path.Combine(tempDir.Path, outputDirectory, "agent", "opentelemetry-javaagent.jar")); 277var expected = Path.GetFullPath(Path.Combine(tempDir.Path, outputDirectory, "agent", "opentelemetry-javaagent.jar")); 321.WithOtelAgent(Path.Combine(Path.GetTempPath(), "opentelemetry-javaagent.jar"));
ExpectedWrapperInvocation.cs (2)
29? ["/c", "call", Path.Combine(".", Path.GetRelativePath(workingDirectory, wrapperPath)), .. toolArgs]
JavaBuildToolResolverTests.cs (16)
26Assert.Equal(Path.GetFullPath(Path.Combine(tempDir.Path, expectedWrapperName)), wrapperPath); 40Assert.Equal(Path.GetFullPath(Path.Combine(tempDir.Path, "tools", "custom-wrapper")), wrapperPath); 54Assert.Equal(Path.GetFullPath(Path.Combine(root.RootPath, "mvnw")), wrapperPath); 78Assert.Equal(Path.GetFullPath(Path.Combine(module, "mvnw")), wrapperPath); 105Assert.Equal(Path.GetFullPath(Path.Combine(root.RootPath, "mvnw")), wrapperPath); 120Path.Combine(root.RootPath, "mvnw"), 129Assert.Equal(Path.GetFullPath(Path.Combine(module, "mvnw")), wrapperPath); 143File.WriteAllText(Path.Combine(_root.FullName, "pom.xml"), "<project/>"); 144File.WriteAllText(Path.Combine(_root.FullName, "mvnw"), "#!/bin/sh\n"); 152File.WriteAllText(Path.Combine(module.FullName, "pom.xml"), "<project/>");
TempJavaAppDirectory.cs (6)
27: Directory.CreateDirectory(System.IO.Path.Combine(_root.FullName, directoryName)); 43var fullPath = System.IO.Path.Combine(Path, fileName); 44Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!); 63var wrapperDirectory = System.IO.Path.GetDirectoryName(fullPath)!; 65Directory.CreateDirectory(System.IO.Path.Combine(wrapperDirectory, supportDirectory, "wrapper")); 67System.IO.Path.Combine(wrapperDirectory, supportDirectory, "wrapper", propertiesName),
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.JavaScript (75)
DenoHostingExtensions.cs (2)
1197else if (File.Exists(Path.Combine(workingDirectory, "deno.lock"))) 1386return File.Exists(Path.Combine(workingDirectory, lockFile));
JavaScriptHostingExtensions.cs (44)
160appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 192if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile"))) 280if (File.Exists(Path.Combine(appDirectory, "package.json"))) 493appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 525if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile"))) 690if (File.Exists(Path.Combine(appDirectory, "package.json"))) 835appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 898if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile"))) 1052if (File.Exists(Path.Combine(appDirectory, "package.json")) || 1053File.Exists(Path.Combine(appDirectory, "deno.json")) || 1054File.Exists(Path.Combine(appDirectory, "deno.jsonc"))) 1197appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory)); 1701if (File.Exists(Path.Combine(appDirectory, "Dockerfile"))) 2034appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory)); 2107var candidatePath = Path.GetFullPath(Path.Join(appDirectory, configFile)); 2121var absoluteConfigPath = Path.GetFullPath(configTarget, appDirectory); 2141var aspireConfigDir = Path.Join(nodeModulesDir, ".aspire", appHostId, resource.Name); 2145var relativeConfigPath = Path.GetRelativePath(aspireConfigDir, absoluteConfigPath).Replace("\\", "/"); 2151var aspireConfigPath = Path.Join(aspireConfigDir, $"aspire.{Path.GetFileName(configTarget)}"); 2247appDirectory = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, appDirectory)); 2417var hasBunLock = File.Exists(Path.Combine(workingDirectory, "bun.lock")) || 2418File.Exists(Path.Combine(workingDirectory, "bun.lockb")); 2423if (File.Exists(Path.Combine(workingDirectory, "bun.lock"))) 2427if (File.Exists(Path.Combine(workingDirectory, "bun.lockb"))) 2507if (File.Exists(Path.Combine(workingDirectory, manifest))) 2570File.Exists(Path.Combine(resource.Resource.WorkingDirectory, "package-lock.json")) 2588var hasYarnLock = File.Exists(Path.Combine(workingDirectory, "yarn.lock")); 2589var hasYarnrc = File.Exists(Path.Combine(workingDirectory, ".yarnrc.yml")); 2590var hasYarnBerryDir = Directory.Exists(Path.Combine(workingDirectory, ".yarn")); 2667var hasPnpmLock = File.Exists(Path.Combine(workingDirectory, "pnpm-lock.yaml")); 2668var hasPnpmWorkspace = File.Exists(Path.Combine(workingDirectory, "pnpm-workspace.yaml")); 2722var packageJsonPath = Path.Combine(workingDirectory, "package.json"); 2834var workingDirectory = Path.GetFullPath(resource.WorkingDirectory); 2864ScriptPath = Path.GetFullPath(scriptPath, workingDirectory), 2888var workingDirectory = Path.GetFullPath(resource.WorkingDirectory); 3183var configPath = Path.Combine(appDirectory, configFileName); 3231var current = Path.GetFullPath(startDirectory); 3234var candidate = Path.Join(current, "node_modules"); 3240var parent = Path.GetDirectoryName(current); 3308var nvmrcPath = Path.Combine(workingDirectory, ".nvmrc"); 3321var nodeVersionPath = Path.Combine(workingDirectory, ".node-version"); 3334var toolVersionsPath = Path.Combine(workingDirectory, ".tool-versions");
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
Aspire.Hosting.JavaScript.Tests (325)
AddBunAppTests.cs (19)
34var appDir = Path.Combine(workspace.Path, "js"); 39File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 46var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 62var appDir = Path.Combine(workspace.Path, "js"); 64File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 73await Verify(File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"))); 82var appDir = Path.Combine(workspace.Path, "js"); 84File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 93var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore"); 99Assert.False(File.Exists(Path.Combine(appDir, ".dockerignore")), "Aspire should not write a .dockerignore into the user's source tree."); 113var appDir = Path.Combine(workspace.Path, "js"); 115File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 121var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore"); 127var userIgnorePath = Path.Combine(appDir, ".dockerignore"); 143File.WriteAllText(Path.Combine(workspace.Path, "server.ts"), "console.log('hi');"); 165File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 349File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 371Assert.Equal(Path.GetFullPath("server.ts", workspace.Path), launchConfig.ScriptPath); 382File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}");
AddDenoAppTests.cs (133)
59var appDir = Path.Combine(workspace.Path, "js"); 64File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 71var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 87var appDir = Path.Combine(workspace.Path, "js"); 89File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 98var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 110var appDir = Path.Combine(workspace.Path, "js"); 112File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 121var perDockerfileIgnorePath = Path.Combine(workspace.Path, "js.Dockerfile.dockerignore"); 127Assert.False(File.Exists(Path.Combine(appDir, ".dockerignore")), "Aspire should not write a .dockerignore into the user's source tree."); 142var appDir = Path.Combine(workspace.Path, "js"); 149var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 177var appDir = Path.Combine(workspace.Path, "js"); 180File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}"); 186var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 197var appDir = Path.Combine(workspace.Path, "js"); 199File.WriteAllText(Path.Combine(appDir, "custom.lock"), "{}"); 209var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 221var appDir = Path.Combine(workspace.Path, "js"); 223File.WriteAllText(Path.Combine(appDir, "custom.lock"), "{}"); 235await Verify(File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile"))); 244var appDir = Path.Combine(workspace.Path, "js"); 246File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}"""); 253var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 264var appDir = Path.Combine(workspace.Path, "js"); 266File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}"""); 267File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}"); 278var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 291var appDir = Path.Combine(workspace.Path, "js"); 293File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"build":"deno run -A build.ts","start":"deno run -A main.ts"}}"""); 302var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 317var appDir = Path.Combine(workspace.Path, "js"); 320Path.Combine(appDir, "deno.json"), 333var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 348var appDir = Path.Combine(workspace.Path, "js"); 368var appDir = Path.Combine(workspace.Path, "js"); 388var appDir = Path.Combine(workspace.Path, "js"); 390File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"importMap":"import_map.json","tasks":{"start":"deno run main.ts"}}"""); 391File.WriteAllText(Path.Combine(appDir, "import_map.json"), """{"imports":{}}"""); 398var dockerfileLines = File.ReadAllLines(Path.Combine(workspace.Path, "js.Dockerfile")); 412var appDir = Path.Combine(workspace.Path, "js"); 414File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"importMap":"import_map.json","tasks":{"start":"deno run main.ts"}}"""); 415File.WriteAllText(Path.Combine(appDir, "import_map.json"), """{"imports":{}}"""); 423var dockerfileLines = File.ReadAllLines(Path.Combine(workspace.Path, "js.Dockerfile")); 437var appDir = Path.Combine(workspace.Path, "js"); 443var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 455var appDir = Path.Combine(workspace.Path, "js"); 462var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 474var appDir = Path.Combine(workspace.Path, "js"); 483var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 501var appDir = Path.Combine(workspace.Path, "js"); 520var appDir = Path.Combine(workspace.Path, "js"); 522File.WriteAllText(Path.Combine(appDir, "Dockerfile"), "FROM denoland/deno:2.9.0"); 529Assert.False(File.Exists(Path.Combine(workspace.Path, "js.Dockerfile"))); 538var appDir = Path.Combine(workspace.Path, "js"); 540File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);"); 550var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 565var appDir = Path.Combine(workspace.Path, "js"); 567File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);"); 581var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 608var appDir = Path.Combine(workspace.Path, "js"); 610File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);"); 619var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 629var appDir = Path.Combine(workspace.Path, "js"); 631File.WriteAllText(Path.Combine(appDir, "main.ts"), "console.log(1);"); 640var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 650var appDir = Path.Combine(workspace.Path, "js"); 652File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"build prod":"deno run -A build.ts","start":"deno run -A main.ts"}}"""); 661var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 672var appDir = Path.Combine(workspace.Path, "js"); 674File.WriteAllText(Path.Combine(appDir, "package.json"), """{"scripts":{"build prod":"echo build","start":"node main.js"}}"""); 684var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 694var appDir = Path.Combine(workspace.Path, "js"); 696File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}"""); 705var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 723var appDir = Path.Combine(workspace.Path, "js"); 725File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}"""); 743var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 754var appDir = Path.Combine(workspace.Path, "js"); 756File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}"""); 764var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 858var appDir = Path.Combine(workspace.Path, "js"); 860File.WriteAllText(Path.Combine(appDir, "deno.json"), """{"tasks":{"start":"deno run -A main.ts"}}"""); 870var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 882var appDir = Path.Combine(workspace.Path, "js"); 884File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}"); 891var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 901var appDir = Path.Combine(workspace.Path, "js"); 903File.WriteAllText(Path.Combine(appDir, "deno.lock"), "{}"); 910var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 949var appDir = Path.Combine(workspace.Path, "js"); 958var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 970var appDir = Path.Combine(workspace.Path, "js"); 972File.WriteAllText(Path.Combine(appDir, "custom lock's.lock"), "{}"); 981var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 993var appDir = Path.Combine(workspace.Path, "js"); 1002var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1019var appDir = Path.Combine(workspace.Path, "js"); 1027var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1037var appDir = Path.Combine(workspace.Path, "js"); 1046var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1058var appDir = Path.Combine(workspace.Path, "js"); 1067var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1079var appDir = Path.Combine(workspace.Path, "js"); 1091var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1103var appDir = Path.Combine(workspace.Path, "js"); 1121var appDir = Path.Combine(workspace.Path, "js"); 1148var appDir = Path.Combine(workspace.Path, "js"); 1177var appDir = Path.Combine(workspace.Path, "js"); 1196var appDir = Path.Combine(workspace.Path, "js"); 1225var appDir1 = Path.Combine(workspace.Path, "js1"); 1226var appDir2 = Path.Combine(workspace.Path, "js2"); 1240var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js2.Dockerfile")); 1250File.WriteAllText(Path.Combine(workspace.Path, "main.ts"), "console.log('hi');"); 1272File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 1299File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 1321File.WriteAllText(Path.Combine(workspace.Path, "main.ts"), "console.log('hi');"); 1575var appDir = Path.Combine(workspace.Path, "js"); 1584var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1599var appDir = Path.Combine(workspace.Path, "js"); 1609var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1626var appDir = Path.Combine(workspace.Path, "js"); 1635var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1646var appDir = Path.Combine(workspace.Path, "js"); 1654var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 1681var appDir = Path.Combine(workspace.Path, "js"); 2345var appDir = Path.Combine(workspace.Path, "deno-app"); 2347await File.WriteAllTextAsync(Path.Combine(appDir, "main.ts"), """ 2356var dockerfilePath = Path.Combine(workspace.Path, "deno-app.Dockerfile"); 2572Assert.Equal(Path.GetFullPath("main.ts", workspace.Path), launchConfig.ScriptPath); 2583File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 2601File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}"); 2620File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}");
AddJavaScriptAppTests.cs (44)
24var appDir = Path.Combine(workspace.Path, "js"); 33var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 46var appDir = Path.Combine(workspace.Path, "js"); 56var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 66var appDir = Path.Combine(workspace.Path, "js"); 76var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 86var appDir = Path.Combine(workspace.Path, "js"); 96var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 109var appDir = Path.Combine(workspace.Path, "js"); 114File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), string.Empty); 123var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 135var appDir = Path.Combine(workspace.Path, "js"); 144var dockerfileLines = await File.ReadAllLinesAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 169var appDir = Path.Combine(workspace.Path, "js"); 174File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), string.Empty); 184var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 411var appDir = Path.Combine(workspace.Path, "js"); 414File.WriteAllText(Path.Combine(appDir, "pnpm-workspace.yaml"), "allowBuilds: {}\n"); 422var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 442var appDir = Path.Combine(workspace.Path, "js"); 445Path.Combine(appDir, "package.json"), 458var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 476var appDir = Path.Combine(workspace.Path, "js"); 479Path.Combine(appDir, "package.json"), 493var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 508var appDir = Path.Combine(workspace.Path, "js"); 511Path.Combine(appDir, "package.json"), 524var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 537var appDir = Path.Combine(workspace.Path, "js"); 540Path.Combine(appDir, "package.json"), 553var dockerfile = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "js.Dockerfile")); 576var appDir = Path.Combine(workspace.Path, "js"); 578var packageJsonPath = Path.Combine(appDir, "package.json"); 603var appDir = Path.Combine(workspace.Path, "pnpm-app"); 617await File.WriteAllTextAsync(Path.Combine(appDir, "package.json"), packageJson); 625var dockerfilePath = Path.Combine(workspace.Path, "pnpm-app.Dockerfile"); 640var dockerfileInContext = Path.Combine(appDir, "Dockerfile"); 698var appDir = Path.Combine(workspace.Path, "pnpm-app"); 712await File.WriteAllTextAsync(Path.Combine(appDir, "package.json"), packageJson); 721var dockerfilePath = Path.Combine(workspace.Path, "pnpm-app.Dockerfile"); 730var dockerfileInContext = Path.Combine(appDir, "Dockerfile"); 783var appDir = Path.Combine(rootDirectory, "js"); 793File.WriteAllText(Path.Combine(appDir, "Dockerfile"), dockerfile); 794File.WriteAllText(Path.Combine(appDir, "package.json"), """
AddNodeAppTests.cs (20)
99var appDir = Path.Combine(workspace.Path, "js"); 104File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 105File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "{}"); 112var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 167var appDir = Path.Combine(workspace.Path, "js"); 169File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 181var dockerfilePath = Path.Combine(workspace.Path, "js.Dockerfile"); 214var appDir = Path.Combine(workspace.Path, "js"); 216File.WriteAllText(Path.Combine(appDir, "package.json"), "{}"); 227var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "js.Dockerfile")); 236File.WriteAllText(Path.Combine(workspace.Path, "app.js"), "{}"); 263File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 337File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent); 338File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent); 363var nodeDockerfilePath = Path.Combine(outputDir.FullName, "nodeapp.Dockerfile"); 394File.WriteAllText(Path.Combine(appDirectory, "package.json"), packageJsonContent); 395File.WriteAllText(Path.Combine(appDirectory, "app.js"), appContent); 420var nodeDockerfilePath = Path.Combine(outputDir.FullName, "nodeapp.Dockerfile"); 559File.WriteAllText(Path.Combine(workspace.Path, "app.js"), "console.log('hello');"); 604Assert.Equal(Path.GetFullPath("app.js", workspace.Path), launchConfig.ScriptPath);
AddViteAppTests.cs (92)
25var viteDir = Path.Combine(workspace.Path, "vite"); 29File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty"); 60var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 86var viteDir = Path.Combine(workspace.Path, "vite"); 88File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty"); 96var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 112var viteDir = Path.Combine(workspace.Path, "vite"); 114File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty"); 116var apiDir = Path.Combine(workspace.Path, "api"); 118File.WriteAllText(Path.Combine(apiDir, "package-lock.json"), "empty"); 129var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 139var viteDir = Path.Combine(workspace.Path, "vite"); 141File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty"); 160var viteDir = Path.Combine(workspace.Path, "vite"); 162File.WriteAllText(Path.Combine(viteDir, "package-lock.json"), "empty"); 164var apiDir = Path.Combine(workspace.Path, "api"); 166File.WriteAllText(Path.Combine(apiDir, "package-lock.json"), "empty"); 190var appDir = Path.Combine(workspace.Path, "angular"); 192File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "empty"); 200var dockerfilePath = Path.Combine(workspace.Path, "angular.Dockerfile"); 216var appDir = Path.Combine(workspace.Path, "vite"); 218File.WriteAllText(Path.Combine(appDir, "package-lock.json"), "empty"); 226var dockerfilePath = Path.Combine(workspace.Path, "vite.Dockerfile"); 239var nextDir = Path.Combine(workspace.Path, "nextjs"); 241File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty"); 248var dockerfilePath = Path.Combine(workspace.Path, "nextjs.Dockerfile"); 260var nextDir = Path.Combine(workspace.Path, "nextjs"); 262File.WriteAllText(Path.Combine(nextDir, "pnpm-lock.yaml"), ""); 269var dockerfilePath = Path.Combine(workspace.Path, "nextjs.Dockerfile"); 279var appDir = Path.Combine(workspace.Path, "nuxt"); 281File.WriteAllText(Path.Combine(appDir, "pnpm-lock.yaml"), ""); 289var dockerfilePath = Path.Combine(workspace.Path, "nuxt.Dockerfile"); 299var appDir = Path.Combine(workspace.Path, "nuxt"); 301File.WriteAllText(Path.Combine(appDir, "bun.lock"), ""); 309var dockerfilePath = Path.Combine(workspace.Path, "nuxt.Dockerfile"); 319File.WriteAllText(Path.Combine(workspace.Path, ".nvmrc"), "18.20.0"); 327var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 339File.WriteAllText(Path.Combine(workspace.Path, ".node-version"), "v21.5.0"); 347var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 364File.WriteAllText(Path.Combine(workspace.Path, ".tool-versions"), toolVersions); 372var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 390File.WriteAllText(Path.Combine(workspace.Path, ".tool-versions"), toolVersions); 398var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 416File.WriteAllText(Path.Combine(workspace.Path, "package.json"), packageJson); 424var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 441var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 457File.WriteAllText(Path.Combine(workspace.Path, ".nvmrc"), versionString); 465var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 487var dockerfileContents = File.ReadAllText(Path.Combine(workspace.Path, "vite.Dockerfile")); 545Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 548var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 593Assert.Contains(Path.Combine("node_modules", ".aspire"), newConfigPath); 606Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 609var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 710var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 753Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 756var viteConfigPath = Path.Combine(workspace.Path, "vite.config.js"); 808var repoRoot = Path.Combine(workspace.Path, "repo"); 809var appDir = Path.Combine(repoRoot, "packages", "frontend"); 811Directory.CreateDirectory(Path.Combine(repoRoot, "node_modules")); 814var viteConfigPath = Path.Combine(appDir, "vite.config.ts"); 855var expectedDir = Path.Combine(repoRoot, "node_modules", ".aspire", appHostId, "test-app"); 874var absoluteConfigPath = Path.GetFullPath(viteConfigPath); 884var repoRoot = Path.Combine(workspace.Path, "repo"); 885var firstAppDirectory = Path.Combine(repoRoot, "packages", "frontend-a"); 886var secondAppDirectory = Path.Combine(repoRoot, "packages", "frontend-b"); 889Directory.CreateDirectory(Path.Combine(repoRoot, "node_modules")); 891var firstConfigPath = Path.Combine(firstAppDirectory, "vite.config.ts"); 892var secondConfigPath = Path.Combine(secondAppDirectory, "vite.config.ts"); 934var firstWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", appHostId, "frontend-a", "aspire.vite.config.ts"); 935var secondWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", appHostId, "frontend-b", "aspire.vite.config.ts"); 938Assert.Contains(Path.GetFullPath(firstConfigPath).Replace("\\", "\\\\"), File.ReadAllText(firstWrapperPath)); 939Assert.Contains(Path.GetFullPath(secondConfigPath).Replace("\\", "\\\\"), File.ReadAllText(secondWrapperPath)); 947var repoRoot = Path.Combine(workspace.Path, "repo"); 948var firstAppDirectory = Path.Combine(repoRoot, "apps", "first"); 949var secondAppDirectory = Path.Combine(repoRoot, "apps", "second"); 952Directory.CreateDirectory(Path.Combine(repoRoot, "node_modules")); 954var firstConfigPath = Path.Combine(firstAppDirectory, "vite.config.ts"); 955var secondConfigPath = Path.Combine(secondAppDirectory, "vite.config.ts"); 973var expectedFirstWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", firstAppHostSha[..10], "frontend", "aspire.vite.config.ts"); 974var expectedSecondWrapperPath = Path.Combine(repoRoot, "node_modules", ".aspire", secondAppHostSha[..10], "frontend", "aspire.vite.config.ts"); 977Assert.Contains(Path.GetFullPath(firstConfigPath).Replace("\\", "\\\\"), File.ReadAllText(firstWrapperPath)); 978Assert.Contains(Path.GetFullPath(secondConfigPath).Replace("\\", "\\\\"), File.ReadAllText(secondWrapperPath)); 993Directory.CreateDirectory(Path.Combine(workspace.Path, "node_modules")); 996var viteConfigPath = Path.Combine(workspace.Path, configFileName); 1048var nextDir = Path.Combine(workspace.Path, "nextjs"); 1050File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty"); 1071var nextDir = Path.Combine(workspace.Path, "nextjs"); 1073File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty"); 1092var nextDir = Path.Combine(workspace.Path, "nextjs"); 1094File.WriteAllText(Path.Combine(nextDir, "package-lock.json"), "empty"); 1095File.WriteAllText(Path.Combine(nextDir, "next.config.ts"), standalone
BunAppFixture.cs (2)
83File.WriteAllText(Path.Combine(tempDir, "server.ts"), 101File.WriteAllText(Path.Combine(tempDir, "package.json"),
DenoAppFixture.cs (2)
118File.WriteAllText(Path.Combine(tempDir, "main.ts"), 136File.WriteAllText(Path.Combine(tempDir, "deno.json"),
NodeAppFixture.cs (2)
75File.WriteAllText(Path.Combine(tempDir, "app.js"), 95File.WriteAllText(Path.Combine(tempDir, "package.json"),
PackageInstallationTests.cs (8)
458File.WriteAllText(Path.Combine(workspace.Path, "package-lock.json"), "empty"); 485File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty"); 506File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty"); 507File.WriteAllText(Path.Combine(workspace.Path, ".yarnrc.yml"), "empty"); 522File.WriteAllText(Path.Combine(workspace.Path, "yarn.lock"), "empty"); 523Directory.CreateDirectory(Path.Combine(workspace.Path, ".yarn", "releases")); 538File.WriteAllText(Path.Combine(workspace.Path, "pnpm-lock.yaml"), "empty"); 553File.WriteAllText(Path.Combine(workspace.Path, "bun.lock"), "empty");
RequiredCommandTests.cs (2)
155File.WriteAllText(Path.Combine(workspace.Path, "package.json"), "{}"); 168File.WriteAllText(Path.Combine(workspace.Path, "deno.json"), "{}");
ResourceCreationTests.cs (1)
44Assert.Equal(Path.Combine(builder.AppHostDirectory, "test"), resource.WorkingDirectory);
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
205Assert.Equal(Path.Combine(appBuilder.AppHostDirectory, "kafka-data"), volumeAnnotation.Source);
Aspire.Hosting.Keycloak (2)
KeycloakResourceBuilderExtensions.cs (2)
222var importFullPath = Path.GetFullPath(import, builder.ApplicationBuilder.AppHostDirectory); 251var importFullPath = Path.GetFullPath(import, builder.ApplicationBuilder.AppHostDirectory);
Aspire.Hosting.Keycloak.Tests (2)
KeycloakPublicApiTests.cs (1)
177var filePath = Path.Combine(workspace.Path, file);
KeycloakResourceBuilderTests.cs (1)
122Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
Aspire.Hosting.Kubernetes (26)
Deployment\HelmDeploymentEngine.cs (4)
246var valuesFilePath = Path.Combine(outputPath, "values.yaml"); 364var overrideFilePath = Path.Combine(outputPath, GetDeployValuesFileName(environment.Name)); 436var valuesFilePath = Path.Combine(outputPath, "values.yaml"); 453var deployValuesFilePath = Path.Combine(outputPath, GetDeployValuesFileName(environment.Name));
KubernetesEnvironmentResource.cs (7)
1580var patchFilePath = Path.Combine(patchTempDir.Path, "patch.json"); 1692var certPath = Path.Combine(tempDir.Path, "tls.crt"); 1693var keyPath = Path.Combine(tempDir.Path, "tls.key"); 2010var patchFilePath = Path.Combine(patchTempDir.Path, "patch.json"); 2191var manifestPath = Path.Combine(tempDir.Path, "gateway.json"); 2313var certPath = Path.Combine(tempDir.Path, "tls.crt"); 2314var keyPath = Path.Combine(tempDir.Path, "tls.key");
KubernetesPublishingContext.cs (6)
95var resourceDockerfilePath = Path.Combine(OutputPath, $"{serviceResource.TargetResource.Name}.Dockerfile"); 388var templatesFolder = Path.Combine(OutputPath, "templates", resource.Name); 398var outputFile = Path.Combine(templatesFolder, fileName); 414var baseName = Path.GetFileNameWithoutExtension(fileName); 448var outputFile = Path.Combine(OutputPath!, "values.yaml"); 470var outputFile = Path.Combine(OutputPath, "Chart.yaml");
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\VolumeMountPathResolver.cs (3)
54return Path.GetFullPath(Path.Combine([Path.GetFullPath(store.BasePath), .. pathSegments]));
Aspire.Hosting.Kubernetes.Tests (180)
KubernetesDeployTests.cs (36)
844var chartYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "Chart.yaml")); 875var chartYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "Chart.yaml")); 897var deploymentYaml = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "svc", "deployment.yaml")); 938var outputPath = Path.Combine(workspace.Path, "env"); 949await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), valuesYaml); 968var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env")); 985var outputPath = Path.Combine(workspace.Path, "env"); 988await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), "parameters: {}\nsecrets: {}\nconfig: {}"); 997var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1005var outputPath = Path.Combine(workspace.Path, "env"); 1008await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), "parameters: {}\nsecrets: {}\nconfig: {}"); 1027var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1079var outputPath = Path.Combine(workspace.Path, "env"); 1082await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), "parameters: {}\nsecrets: {}\nconfig: {}"); 1103var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1236var outputPath = Path.Combine(workspace.Path, "env"); 1247await File.WriteAllTextAsync(Path.Combine(outputPath, "values.yaml"), valuesYaml); 1272var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1286var outputPath = Path.Combine(workspace.Path, "env"); 1296var deployValuesPath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1335var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1358var serverSecretsTemplatePath = Path.Combine(workspace.Path, "templates", "server", "secrets.yaml"); 1410var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1437var outputPath = Path.Combine(workspace.Path, "deploy"); 1469var overridePath = Path.Combine(outputPath, HelmDeploymentEngine.GetDeployValuesFileName("myenv")); 1527var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1588var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1633var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1673var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 1674await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1676await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "myapp", "config.yaml")), 1751var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1792var configPath = Path.Combine(workspace.Path, "templates", resourceName, "config.yaml"); 1827var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1862var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 1898var valuesPath = Path.Combine(workspace.Path, "values.yaml");
KubernetesEnvironmentResourceTests.cs (4)
30var chartYaml = Path.Combine(workspace.Path, "Chart.yaml"); 31var valuesYaml = Path.Combine(workspace.Path, "values.yaml"); 32var deploymentYaml = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml"); 96var outputPath = Path.Combine(workspace.Path, "output");
KubernetesGatewayTests.cs (15)
34var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 41var gatewayFile = files.FirstOrDefault(f => Path.GetFileName(f) == "public.yaml"); 75var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 106var gatewayPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 107var routePath = Path.Combine(workspace.Path, "templates", "public", "route.yaml"); 108var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 136var routePath = Path.Combine(workspace.Path, "templates", "public", "route.yaml"); 256var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 291var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 322var gatewayDir = Path.Combine(workspace.Path, "templates", "public"); 356var gatewayDir = Path.Combine(workspace.Path, "templates", "empty"); 434var templatesDir = Path.Combine(workspace.Path, "templates", "myapi"); 464var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 513var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 596var gatewayFile = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
KubernetesIngressTests.cs (23)
34var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 64var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 108var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 115var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 149var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 177var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 178var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 204var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 228var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 253var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 282var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 315var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 343var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 367var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 393var ingressDir = Path.Combine(workspace.Path, "templates", "empty"); 459var ingressDir = Path.Combine(workspace.Path, "templates", "public"); 556var ingressDir = Path.Combine(workspace.Path, "templates", "empty"); 576var templatesDir = Path.Combine(workspace.Path, "templates", "myapi"); 612var publicPath = Path.Combine(workspace.Path, "templates", "public-ingress", "public-ingress.yaml"); 613var internalPath = Path.Combine(workspace.Path, "templates", "internal-ingress", "internal-ingress.yaml"); 647var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 682var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml"); 798var ingressPath = Path.Combine(workspace.Path, "templates", "public", "public.yaml");
KubernetesPublisherTests.cs (100)
83var overridePath = Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env")); 215await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 259await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml").UseParameters(gateway, tls); 323await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 390await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates/backend/config.yaml")), "yaml") 391.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 392.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"))), "yaml"); 437await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates/myapp/deployment.yaml")), "yaml") 494var filePath = Path.Combine(workspace.Path, expectedFile); 495var fileExtension = Path.GetExtension(filePath)[1..]; 543var deployment = await File.ReadAllLinesAsync(Path.Combine(workspace.Path, "templates/myapp/deployment.yaml")); 566await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml"))); 575Assert.False(File.Exists(Path.Combine(workspace.Path, "templates/myapp/config.yaml"))); 576Assert.False(File.Exists(Path.Combine(workspace.Path, "templates/myapp/secrets.yaml"))); 621var deployment = await File.ReadAllLinesAsync(Path.Combine(workspace.Path, "templates/myapp/deployment.yaml")); 661var deploymentPath = Path.Combine(workspace.Path, "templates/service/deployment.yaml"); 719var filePath = Path.Combine(workspace.Path, expectedFile); 720var fileExtension = Path.GetExtension(filePath)[1..]; 774Directory.GetFiles(Path.Combine(workspace.Path, "templates", "myapp"), "*.yaml"), 846Directory.GetFiles(Path.Combine(workspace.Path, "templates", "myapp"), "*.yaml"), 902var manifestPath = Path.Combine(workspace.Path, "templates/myapp/scaler.yaml"); 1094var templatesFolder = Path.Combine(workspace.Path, "templates", "myapp"); 1096.ToDictionary(static path => Path.GetFileName(path), File.ReadAllText); 1191var filePath = Path.Combine(workspace.Path, expectedFile); 1192var fileExtension = Path.GetExtension(filePath)[1..]; 1245var filePath = Path.Combine(workspace.Path, expectedFile); 1246var fileExtension = Path.GetExtension(filePath)[1..]; 1277var dockerfilePath = Path.Combine(workspace.Path, "testcontainer.Dockerfile"); 1352var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1401var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1436var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1529var deploymentPath = Path.Combine(workspace.Path, "templates/myapp/deployment.yaml"); 1630var filePath = Path.Combine(workspace.Path, expectedFile); 1631var fileExtension = Path.GetExtension(filePath)[1..]; 1684await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1685.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "api", "deployment.yaml")), "yaml") 1704await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 1731var publishedValues = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")); 1735.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, HelmDeploymentEngine.GetDeployValuesFileName("env"))), "yaml") 1753await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml"); 1776await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1800await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1820await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1821.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "worker", "deployment.yaml")), "yaml") 1822.AppendContentAsFile(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "cache", "deployment.yaml")), "yaml"); 1837await Verify(File.ReadAllText(Path.Combine(workspace.Path, "Chart.yaml")), "yaml") 1838.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "values.yaml")), "yaml") 1839.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "deployment.yaml")), "yaml") 1840.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "service.yaml")), "yaml") 1841.AppendContentAsFile(File.ReadAllText(Path.Combine(workspace.Path, "templates", "api", "config.yaml")), "yaml"); 1874var filePath = Path.Combine(workspace.Path, expectedFile); 1875var fileExtension = Path.GetExtension(filePath)[1..]; 1918var filePath = Path.Combine(workspace.Path, expectedFile); 1944var servicePath = Path.Combine(workspace.Path, "templates/database/service.yaml"); 1980var filePath = Path.Combine(workspace.Path, expectedFile); 1981var fileExtension = Path.GetExtension(filePath)[1..]; 2032var filePath = Path.Combine(workspace.Path, expectedFile); 2033var fileExtension = Path.GetExtension(filePath)[1..]; 2075var filePath = Path.Combine(workspace.Path, expectedFile); 2076var fileExtension = Path.GetExtension(filePath)[1..]; 2120var filePath = Path.Combine(workspace.Path, expectedFile); 2121var fileExtension = Path.GetExtension(filePath)[1..]; 2275var filePath = Path.Combine(workspace.Path, expectedFile); 2276var fileExtension = Path.GetExtension(filePath)[1..]; 2321var filePath = Path.Combine(workspace.Path, expectedFile); 2322var fileExtension = Path.GetExtension(filePath)[1..]; 2382var filePath = Path.Combine(workspace.Path, expectedFile); 2383var fileExtension = Path.GetExtension(filePath)[1..]; 2433var filePath = Path.Combine(workspace.Path, expectedFile); 2434var fileExtension = Path.GetExtension(filePath)[1..]; 2495var filePath = Path.Combine(workspace.Path, expectedFile); 2496var fileExtension = Path.GetExtension(filePath)[1..]; 2531var valuesContent = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "values.yaml")); 2580var filePath = Path.Combine(workspace.Path, expectedFile); 2581var fileExtension = Path.GetExtension(filePath)[1..]; 2634var filePath = Path.Combine(workspace.Path, expectedFile); 2635var fileExtension = Path.GetExtension(filePath)[1..]; 2691var filePath = Path.Combine(workspace.Path, expectedFile); 2710var legacyPv = Path.Combine(workspace.Path, "templates", "service", "data-pv.yaml"); 2740var deploymentPath = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml"); 2785var filePath = Path.Combine(workspace.Path, expectedFile); 2798var legacyPvc = Path.Combine(workspace.Path, "templates", "service", "data-pvc.yaml"); 2802var deploymentPath = Path.Combine(workspace.Path, "templates", "service", "deployment.yaml"); 2840var filePath = Path.Combine(workspace.Path, expectedFile); 2880var claimPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 2907var omittedClaimPath = Path.Combine(workspace.Path, "templates", "omitted", "omitted.yaml"); 2908var emptyClaimPath = Path.Combine(workspace.Path, "templates", "empty", "empty.yaml"); 2949var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", name, $"{name}.yaml")); 2987var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", name, $"{name}.yaml")); 3023var content = await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "data", "data.yaml")); 3049var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml"); 3076var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml"); 3127var filePath = Path.Combine(workspace.Path, expectedFile); 3207var filePath = Path.Combine(workspace.Path, expectedFile); 3245var statefulSetPath = Path.Combine(workspace.Path, "templates", "service", "statefulset.yaml"); 3251var pvcPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 3315var statefulSetPath = Path.Combine(workspace.Path, "templates", "api", "statefulset.yaml"); 3389var pvcPath = Path.Combine(workspace.Path, "templates", "data", "data.yaml"); 3401var valuesPath = Path.Combine(workspace.Path, "values.yaml"); 3423var claimPath = Path.Combine(workspacePath, "templates", volumeName, $"{volumeName}.yaml");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Maui (38)
MauiPlatformHelper.cs (4)
53if (!Path.IsPathRooted(projectPath)) 56Path.Combine(builder.ApplicationBuilder.AppHostDirectory, projectPath)); 59var workingDirectory = Path.GetDirectoryName(projectPath) 107var workingDir = Path.GetDirectoryName(projectPath)
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Utilities\MauiEnvironmentHelper.cs (3)
60var targetsFilePath = Path.Combine(tempDirectory, $"{sanitizedName}.targets"); 140var invalidCharacters = Path.GetInvalidFileNameChars(); 201var targetsFilePath = Path.Combine(tempDirectory, $"{sanitizedName}.targets");
Aspire.Hosting.Maui.Tests (68)
MauiEnvironmentHelperTests.cs (1)
217var invalidChar = Path.GetInvalidFileNameChars()
MauiiOSValidationTests.cs (6)
24var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 50var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 76var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 97var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 116var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 135var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiOtlpTemplateTests.cs (4)
26var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 53var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 80var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 107var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiPlatformExtensionsTests.cs (38)
97var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 120var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 140var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 159var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 188var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 236var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 255var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 279var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 308var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 334var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 357var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 380var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 403var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 431var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 456var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 485var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 510var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 537var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 564var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 631var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 661var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 685var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 708var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 746var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 799var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 864var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 903var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 956var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1022var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1059var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1076var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1098var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1129var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1156var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1186var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1268var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1304var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 1367var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiUnsupportedPlatformTests.cs (6)
17var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 41var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 65var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 89var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 114var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 129var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
MauiWithArgsTests.cs (11)
21var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 39var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 58var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 78var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 95var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 115var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 132var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 151var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 168var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 188var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj"); 210var tempFile = Path.Combine(workspace.Path, "TempMauiProject.csproj");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Milvus (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Milvus.Tests (2)
MilvusFunctionalTests.cs (2)
97bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 196Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true);
Aspire.Hosting.MongoDB (3)
MongoDBBuilderExtensions.cs (1)
448var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.MongoDB.Tests (4)
MongoDbFunctionalTests.cs (4)
226bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 327Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true); 364var initFilePath = Path.Combine(bindMountPath, "mongo-init.js"); 461var initFilePath = Path.Combine(initFilesPath, "mongo-init.js");
Aspire.Hosting.MySql (3)
MySqlBuilderExtensions.cs (1)
475var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.MySql.Tests (4)
MySqlFunctionalTests.cs (4)
150bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 288Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true); 323File.WriteAllText(Path.Combine(bindMountPath, "init.sql"), """ 408File.WriteAllText(Path.Combine(initFilesPath, "init.sql"), """
Aspire.Hosting.Native.Client (6)
Authoring\NativeApplication.cs (5)
86settings.ApplicationDirectory = Path.GetFullPath(applicationRoot); 93var root = Path.TrimEndingDirectorySeparator(Path.GetFullPath(applicationRoot)); 94applicationName ??= Path.GetFileName(root) is { Length: > 0 } name ? name : "app"; 96var canonicalRoot = root.Replace(Path.DirectorySeparatorChar, '/');
Authoring\Publishing.cs (1)
91var context = new PublishingContext(model, Path.GetFullPath(outputPath, AppHostDirectory),
Aspire.Hosting.Native.CodeGeneration (21)
NativeContractCompilation.cs (4)
60var directory = Directory.CreateDirectory(Path.Combine(outputDirectory, "contract")); 61var assemblyPath = Path.Combine(directory.FullName, $"{assemblyName}.dll"); 63using (var documentation = File.Create(Path.ChangeExtension(assemblyPath, ".xml"))) 83return platformAssemblies.Split(Path.PathSeparator)
NativeProviderProjection.cs (5)
19assemblyPath = Path.GetFullPath(assemblyPath); 145await File.WriteAllTextAsync(Path.Combine(output, "ProviderContract.g.cs"), code.ToString()).ConfigureAwait(false); 146await File.WriteAllTextAsync(Path.Combine(output, "provider-contract.json"), metadata).ConfigureAwait(false); 211var path = Path.Combine(Path.GetDirectoryName(assemblyPath)!, name.Name + ".dll");
NativeProviderTypeScriptProjection.cs (1)
19await File.WriteAllTextAsync(Path.Combine(output, "provider-client.mts"), code).ConfigureAwait(false);
Program.cs (10)
18var output = Path.GetFullPath(args switch 51await File.WriteAllTextAsync(Path.Combine(output, "NativeClient.g.cs"), 182await File.WriteAllTextAsync(Path.Combine(output, "NativeDispatch.g.cs"), code.ToString()).ConfigureAwait(false); 203await File.WriteAllTextAsync(Path.Combine(output, "contract.json"), bundle).ConfigureAwait(false); 215await File.WriteAllTextAsync(Path.Combine(output, "languages.json"), new JsonArray(new JsonObject 224await File.WriteAllTextAsync(Path.Combine(output, name), projectedContent).ConfigureAwait(false); 231await File.WriteAllTextAsync(Path.Combine(output, "native-builder.mts"), await reader.ReadToEndAsync().ConfigureAwait(false)).ConfigureAwait(false); 238await File.WriteAllTextAsync(Path.Combine(output, "native-pipeline.mts"), await reader.ReadToEndAsync().ConfigureAwait(false)).ConfigureAwait(false); 240await File.WriteAllTextAsync(Path.Combine(output, "native-types.mts"), 249await File.WriteAllTextAsync(Path.Combine(output, "native-client.mts"), $$"""
src\Aspire.Hosting.RemoteHost\AtsCapabilityScanner.cs (1)
3513var xmlPath = Path.ChangeExtension(location, ".xml");
Aspire.Hosting.Native.Core (3)
Runtime\WorkloadDefinition.cs (3)
110mount.Type == WorkloadMountKind.Bind && (!Path.IsPathFullyQualified(mount.Source) || 123if (!Path.IsPathFullyQualified(plan.ExecutablePath) || requireLocalPaths && !File.Exists(plan.ExecutablePath) || 124!Path.IsPathFullyQualified(plan.WorkingDirectory) || requireLocalPaths && !Directory.Exists(plan.WorkingDirectory))
Aspire.Hosting.Native.Core.Tests (68)
DcpConnectionMaterialTests.cs (2)
53var path = Path.Combine(directory.FullName, "kubeconfig"); 86Path.Combine(directory.FullName, "kubeconfig"), () => true, TimeSpan.FromSeconds(1),
NativeAuxiliaryBackchannelTests.cs (1)
170File.GetUnixFileMode(Path.GetDirectoryName(host.SocketPath)!));
NativeBuilderAuthoringTests.cs (6)
73[$"--native-application-root={Path.Combine(root, "..", "shop")}{Path.DirectorySeparatorChar}"]); 112var firstRoot = Path.Combine(Path.GetPathRoot(Directory.GetCurrentDirectory())!, "native-volume-tests", "shop"); 113var otherRoot = Path.Combine(firstRoot, "..", "other", "shop"); 118(firstRoot, null), (Path.Combine(firstRoot, "..", "shop"), null),
NativeCliProtocolTests.cs (7)
28var parent = new DirectoryInfo(Path.GetDirectoryName(directory.SocketPath)!); 61var parent = Path.GetDirectoryName(directory.SocketPath)!; 62var target = Directory.CreateDirectory(Path.Combine(parent, "target")); 64var link = Path.Combine(parent, "link"); 66Assert.Throws<IOException>(() => CreateProtocol(Path.Combine(link, "cli.sock"))); 68Assert.False(File.Exists(Path.Combine(target.FullName, "cli.sock"))); 75SocketPermissionHelper.CreateDirectory(Path.GetDirectoryName(directory.SocketPath)!, repairExisting: true);
NativeComposeCSharpDockerTests.cs (4)
34"-p", project, "-f", Path.Combine(work.FullName, "compose.yaml")]; 38var inputs = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(work.FullName, "deployment-inputs.json")))!; 58if (File.Exists(Path.Combine(work.FullName, "compose.yaml"))) 123var state = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(work.FullName, "deployment-state.json")))!;
NativeComposeCSharpTests.cs (18)
32Assert.Equal(Path.Combine(root.FullName, "web"), build["context"]!.GetValue<string>()); 33Assert.Equal(Path.Combine(root.FullName, "web", "Dockerfile"), build["dockerfile"]!.GetValue<string>()); 137var requestPath = Path.Combine(root.FullName, "comparison.json"); 175Directory.CreateDirectory(Path.Combine(root.FullName, "web")); 176await File.WriteAllTextAsync(Path.Combine(root.FullName, "web", "Dockerfile"), "FROM node:24-alpine\n"); 199Assert.True(File.Exists(Path.Combine(context.PublishingContext.OutputPath, "compose.yaml"))); 206var document = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(context.OutputPath, "compose.yaml")))!; 211.Replace(JsonEncodedText.Encode(Path.Combine(root.FullName, "web", "Dockerfile")).ToString(), "/app/web/Dockerfile") 212.Replace(JsonEncodedText.Encode(Path.Combine(root.FullName, "web")).ToString(), "/app/web") 227Directory.CreateDirectory(Path.Combine(root.FullName, "web")); 228await File.WriteAllTextAsync(Path.Combine(root.FullName, "web", "Dockerfile"), "FROM node:24-alpine\n"); 248var state = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(context.OutputPath, "deployment-state.json")))!; 268.Replace(Path.DirectorySeparatorChar, '/'); 282Directory.CreateDirectory(Path.Combine(root.FullName, "web")); 283await File.WriteAllTextAsync(Path.Combine(root.FullName, "web", "Dockerfile"), "FROM node:24-alpine\n"); 307Directory.CreateDirectory(Path.Combine(root.FullName, "web")); 308await File.WriteAllTextAsync(Path.Combine(root.FullName, "web", "Dockerfile"), "FROM node:24-alpine\n"); 534return (new(model, Path.Combine(root, "published"), root, "Comparison", TestContext.Current.CancellationToken), builder);
NativeDashboardConfigurationTests.cs (1)
23var path = Path.Combine(directory.FullName, fileName);
NativeIpcSecurityTests.cs (1)
39var canaryPath = Path.Combine(directory.FullName, "public.sock");
NativeModelAlignmentTests.cs (2)
125var missing = Path.Combine(AppContext.BaseDirectory, "missing-" + Guid.NewGuid().ToString("N")); 132composition.AddExecutable("tool", Path.Combine(missing, "tool"), missing);
NativeProductCliTests.cs (9)
22var apphost = Path.Combine(directory.FullName, "apphost.mts"); 23var proof = Path.Combine(directory.FullName, "proof.json"); 45await File.WriteAllTextAsync(Path.Combine(directory.FullName, "aspire.config.json"), 47File.Copy(Path.Combine(AppContext.BaseDirectory, "Fixtures", "package.json"), 48Path.Combine(directory.FullName, "package.json")); 49File.Copy(Path.Combine(AppContext.BaseDirectory, "Fixtures", "tsconfig.apphost.json"), 50Path.Combine(directory.FullName, "tsconfig.apphost.json")); 77await File.WriteAllTextAsync(Path.Combine(directory.FullName, "finish"), ""); 108start.Environment["ASPIRE_HOME"] = Path.Combine(directory.FullName, "home");
NativeProviderActivationTests.cs (2)
24Path.Combine(directory.FullName, "missing-provider"), [], options, clock, 51var missing = Path.Combine(directory.FullName, "missing-provider");
NativeSocketIsolationTests.cs (1)
263var parent = Path.GetDirectoryName(directory.SocketPath)!;
NativeSymbolicWorkloadSocketTests.cs (1)
52Arguments = [Path.Combine(AppContext.BaseDirectory, "AotSmoke", "SymbolicRedisConsumer.mts")],
TestServices\ComposeTestApplication.cs (2)
31builder.AddExecutable("web", Path.Combine(root, "deployment-only", "node"), Path.Combine(root, "web"))
TestServices\DcpReadyTestHost.cs (3)
20public string KubeconfigPath => Path.Combine(directory.FullName, "kubeconfig"); 25while (!File.Exists(Path.Combine(root.FullName, "Aspire.slnx"))) 29var directory = Directory.CreateDirectory(Path.Combine(root.FullName, "artifacts", "dcp-ready", Guid.NewGuid().ToString("N")));
TestServices\NativeAuxiliaryTestHost.cs (3)
44while (!File.Exists(Path.Combine(root.FullName, "Aspire.slnx"))) 48HomeDirectory = Path.Combine(root.FullName, "artifacts", "aux", Guid.NewGuid().ToString("N")[..8]); 50AppHostPath = Path.Combine(HomeDirectory, "apphost.mts");
TestServices\NativeCliTestHost.cs (1)
25public string SocketPath => Path.Combine(_directory.FullName, "cli.sock");
TestServices\NativeSocketTestHost.cs (3)
120public string SocketPath => Path.Combine(_directory.FullName, "rpc.sock"); 127while (!File.Exists(Path.Combine(root.FullName, "Aspire.slnx"))) 131var path = Path.Combine(root.FullName, "artifacts", $"nst-{Guid.NewGuid():N}");
WorkloadDefinitionTests.cs (1)
80var directory = Path.GetDirectoryName(executable)!;
Aspire.Hosting.Native.Server (83)
Api\RuntimeApi.cs (2)
197if (!Path.IsPathFullyQualified(executable.ExecutablePath) || !File.Exists(executable.ExecutablePath) || 198!Path.IsPathFullyQualified(executable.WorkingDirectory) || !Directory.Exists(executable.WorkingDirectory) ||
Cli\NativeCliProtocol.cs (1)
34if (!Path.IsPathFullyQualified(path) || File.Exists(path))
Dashboard\DcpDashboardConfiguration.cs (3)
14if (!Path.IsPathFullyQualified(path) || !File.Exists(path)) 21var bundled = Path.GetFileNameWithoutExtension(path) == "aspire-managed"; 26WorkingDirectory = Path.GetDirectoryName(path)!,
Dcp\DcpApiClient.cs (1)
54var kubeconfig = Path.Combine(_directory.FullName, "kubeconfig");
NativeServerConfiguration.cs (1)
153if (!Path.IsPathFullyQualified(path))
Rpc\NativeLanguageCatalog.cs (2)
57files[Path.GetFileName(path)] = File.ReadAllText(path); 65catalog._providers = JsonNode.Parse(File.ReadAllText(Path.Combine(generatedSdkDirectory, "providers.json")))!.AsArray();
src\Shared\BackchannelConstants.cs (9)
106=> Path.Combine(homeDirectory, SocketDirectoryNames.Aspire, SocketDirectoryNames.Cli, SocketDirectoryNames.Backchannels); 114=> Path.Combine(homeDirectory, ".aspire", "cli", "backchannels"); 260var socketPath = Path.Combine(dir, $"{appHostId}{instanceId}.{processId.ToString(CultureInfo.InvariantCulture)}"); 278var socketPath = Path.Combine(dir, socketName); 316return Path.Combine(dir, appHostId); 360var fileName = Path.GetFileName(socketPath); 395var fileName = Path.GetFileName(socketPath); 541var fileName = Path.GetFileName(f); 569var fileName = Path.GetFileName(f);
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
src\Shared\SocketPermissionHelper.cs (8)
39var directory = new DirectoryInfo(Path.GetFullPath(path, currentDirectory)); 40var tempRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(tempDirectory, currentDirectory)); 43: Path.TrimEndingDirectorySeparator(Path.GetFullPath(userProfileDirectory, currentDirectory)); 46var isWorkingDirectory = string.Equals(directory.FullName, Path.TrimEndingDirectorySeparator(currentDirectory), comparison); 48var isTemporaryRoot = string.Equals(Path.TrimEndingDirectorySeparator(directory.FullName), tempRoot, comparison); 113var directory = Path.GetDirectoryName(socketPath);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
Aspire.Hosting.Oracle (3)
OracleDatabaseBuilderExtensions.cs (1)
159var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Oracle.Tests (2)
OracleFunctionalTests.cs (2)
278File.WriteAllText(Path.Combine(bindMountPath, "01_init.sql"), $""" 370File.WriteAllText(Path.Combine(initFilesPath, "01_init.sql"), $"""
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (1)
607var importFullPath = Path.GetFullPath(source, builder.ApplicationBuilder.AppHostDirectory);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.PostgreSQL.Tests (8)
AddPostgresTests.cs (4)
601Assert.Equal(".toml", Path.GetExtension(file.Name)); 608Assert.Equal(".toml", Path.GetExtension(file.Name)); 908Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source); 935Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
PostgresFunctionalTests.cs (4)
224bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 348Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true); 383File.WriteAllText(Path.Combine(bindMountPath, "init.sql"), """ 469File.WriteAllText(Path.Combine(initFilesPath, "init.sql"), """
Aspire.Hosting.Python (39)
PythonAppResourceBuilderExtensions.cs (35)
362var resource = createResource(name, "python", Path.GetFullPath(appDirectory, builder.AppHostDirectory)); 433if (File.Exists(Path.Combine(resource.WorkingDirectory, "Dockerfile"))) 527var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 529if (File.Exists(Path.Combine(appDirectoryFullPath, "pyproject.toml")) || 530File.Exists(Path.Combine(appDirectoryFullPath, "requirements.txt"))) 583Path.GetFullPath(left, appDirectory), 584Path.GetFullPath(right, appDirectory), 591var uvLockPath = Path.Combine(resource.WorkingDirectory, "uv.lock"); 700var requirementsTxtPath = Path.Combine(resource.WorkingDirectory, "requirements.txt"); 740var pyprojectTomlPath = Path.Combine(resource.WorkingDirectory, "pyproject.toml"); 818var appDirectoryFullPath = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 822var appHostParentDirectory = Path.GetDirectoryName(builder.AppHostDirectory); 828var relativePath = Path.GetRelativePath(appHostParentDirectory, appDirectoryFullPath); 830!Path.IsPathRooted(relativePath); 835return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath); 843var venvPath = Path.Combine(currentDirectory, virtualEnvironmentPath); 861var parentDirectory = Path.GetDirectoryName(currentDirectory); 873return Path.Combine(appDirectoryFullPath, virtualEnvironmentPath); 929var resolvedPath = Path.IsPathRooted(virtualEnvironmentPath) 931: Path.GetFullPath(virtualEnvironmentPath, builder.Resource.WorkingDirectory); 1011programPath = Path.GetFullPath(entrypoint, workingDirectory); 1032var venvPath = Path.IsPathRooted(annotation.VirtualEnvironment.VirtualEnvironmentPath) 1034: Path.GetFullPath(annotation.VirtualEnvironment.VirtualEnvironmentPath, workingDirectory); 1038interpreterPath = Path.Join(venvPath, "Scripts", "python.exe"); 1042interpreterPath = Path.Join(venvPath, "bin", "python"); 1216if (File.Exists(Path.Combine(workingDirectory, "pyproject.toml"))) 1221else if (File.Exists(Path.Combine(workingDirectory, "requirements.txt"))) 1327foreach (var directory in pathVariable.Split(Path.PathSeparator)) 1329var fullPath = Path.Combine(directory, commandWithExt); 1340foreach (var directory in pathVariable.Split(Path.PathSeparator)) 1342var fullPath = Path.Combine(directory, command); 1436var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath) 1438: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory); 1572var venvPath = Path.IsPathRooted(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath) 1574: Path.GetFullPath(pythonEnv.VirtualEnvironment.VirtualEnvironmentPath, builder.Resource.WorkingDirectory);
PythonVersionDetector.cs (2)
20var pythonVersionFile = Path.Combine(appDirectory, ".python-version"); 31var pyprojectFile = Path.Combine(appDirectory, "pyproject.toml");
VirtualEnvironment.cs (2)
26return Path.Join(virtualEnvironmentPath, "Scripts", name + ".exe"); 29return Path.Join(virtualEnvironmentPath, "bin", name);
Aspire.Hosting.Python.Tests (158)
AddPythonAppTests.cs (149)
30var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 34options.ProjectDirectory = Path.GetFullPath(projectDirectory); 68var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 72options.ProjectDirectory = Path.GetFullPath(projectDirectory); 169Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 173Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 208Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 212Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 251Assert.Equal(Path.Join(projectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 255Assert.Equal(Path.Join(projectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 275var pipPath = Path.Combine(projectDirectory, ".venv", OperatingSystem.IsWindows() ? "Scripts" : "bin", OperatingSystem.IsWindows() ? "pip.exe" : "pip"); 298var pythonExecutable = Path.Combine(projectDirectory, 309var scriptPath = Path.Combine(projectDirectory, "main.py"); 312var requirementsPath = Path.Combine(projectDirectory, "requirements.txt"); 316var dockerFilePath = Path.Combine(projectDirectory, "Dockerfile"); 360var relativePipPath = Path.Combine( 365var pipPath = Path.GetFullPath(relativePipPath, projectDirectory); 402? Path.Join(expectedVenvPath, "Scripts", "python.exe") 403: Path.Join(expectedVenvPath, "bin", "python"); 453var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 457Assert.Equal(Path.Join(expectedProjectDirectory, "custom-venv", "Scripts", "python.exe"), pythonProjectResource.Command); 461Assert.Equal(Path.Join(expectedProjectDirectory, "custom-venv", "bin", "python"), pythonProjectResource.Command); 488Assert.Equal(Path.Join(venvDir.FullName, "Scripts", "python.exe"), pythonProjectResource.Command); 492Assert.Equal(Path.Join(venvDir.FullName, "bin", "python"), pythonProjectResource.Command); 566var appVenvPath = Path.Combine(appDir.FullName, ".venv"); 579var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, appDir.FullName)); 580var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv"); 596var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName); 600var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv"); 642var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName); 646var appVenvPath = Path.Combine(appDirPath, ".venv"); 649var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv"); 699var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, appDir.FullName)); 700var expectedVenvPath = Path.Combine(expectedProjectDirectory, ".venv"); 716var appDirPath = Path.Combine(builder.AppHostDirectory, appDirName); 720var appHostVenvPath = Path.Combine(builder.AppHostDirectory, ".venv"); 724var customVenvPath = Path.Combine(appDirPath, "custom-venv"); 776var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1050var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1055Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 1059Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 1084var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1088Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", "python.exe"), pythonProjectResource.Command); 1092Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", "python"), pythonProjectResource.Command); 1118var expectedProjectDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, workspace.Path)); 1122Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "Scripts", $"{executableName}.exe"), pythonProjectResource.Command); 1126Assert.Equal(Path.Join(expectedProjectDirectory, ".venv", "bin", executableName), pythonProjectResource.Command); 1314$"Python app resource 'api' is configured to run {expectedKind} '{entrypoint}', but publish is using the existing Dockerfile '{Path.Combine(sourceDir, "Dockerfile")}'. " + 1434File.WriteAllText(Path.Combine(sourceDir.FullName, "main.py"), "print('Hello from Python!')"); 1442var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile")); 1611File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 1612File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent); 1613File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 1615var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 1634var scriptDockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile"); 1637var moduleDockerfilePath = Path.Combine(outputDir.FullName, "module-app.Dockerfile"); 1640var executableDockerfilePath = Path.Combine(outputDir.FullName, "executable-app.Dockerfile"); 1677File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 1679File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 1681var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 1700var scriptDockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile"); 1703var moduleDockerfilePath = Path.Combine(outputDir.FullName, "module-app.Dockerfile"); 1706var executableDockerfilePath = Path.Combine(outputDir.FullName, "executable-app.Dockerfile"); 1739var appDirectory = Path.Combine(workspace.Path, "myapp"); 1741var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1783var appDirectory = Path.Combine(workspace.Path, "myapp"); 1785var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1823var appDirectory = Path.Combine(workspace.Path, "myapp"); 1825var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1858var appDirectory = Path.Combine(workspace.Path, "myapp"); 1860var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1869Assert.Equal(Path.Combine(appDirectory, "main.py"), launchConfig.ProgramPath); 1879var appDirectory = Path.Combine(workspace.Path, "myapp"); 1881var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1903var appDirectory = Path.Combine(workspace.Path, "myapp"); 1905var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1927var appDirectory = Path.Combine(workspace.Path, "myapp"); 1929var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1931var customWorkingDirectory = Path.Combine(workspace.Path, "custom"); 1942Path.Combine(builder.AppHostDirectory, customWorkingDirectory)); 1954var appDirectory = Path.Combine(workspace.Path, "myapp"); 1956var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 1958var customWorkingDirectory = Path.Combine(workspace.Path, "custom"); 1968Path.Combine(builder.AppHostDirectory, customWorkingDirectory)); 1970Assert.Equal(Path.Combine(expectedWorkingDirectory, "main.py"), launchConfig.ProgramPath); 1995var appDirectory = Path.Combine(workspace.Path, "myapp"); 1997var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 2028var appDirectory = Path.Combine(workspace.Path, "myapp"); 2030var virtualEnvironmentPath = Path.Combine(workspace.Path, ".venv"); 2137File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 2138File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent); 2139File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 2154var dockerfilePath = Path.Combine(outputDir.FullName, "custom-images-app.Dockerfile"); 2184File.WriteAllText(Path.Combine(projectDirectory, "requirements.txt"), requirementsContent); 2185File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 2196var dockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile"); 2234File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 2235File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 2246var dockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile"); 2267File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 2278var dockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile"); 2301File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 2302File.WriteAllText(Path.Combine(projectDirectory, ".python-version"), pythonVersionContent); 2315var scriptDockerfilePath = Path.Combine(outputDir.FullName, "script-app.Dockerfile"); 2318var moduleDockerfilePath = Path.Combine(outputDir.FullName, "module-app.Dockerfile"); 2321var executableDockerfilePath = Path.Combine(outputDir.FullName, "executable-app.Dockerfile"); 2350var scriptPath = Path.Combine(workspace.Path, scriptName); 2354var pyprojectPath = Path.Combine(workspace.Path, "pyproject.toml"); 2384var scriptPath = Path.Combine(workspace.Path, scriptName); 2388var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2419var scriptPath = Path.Combine(workspace.Path, scriptName); 2423var pyprojectPath = Path.Combine(workspace.Path, "pyproject.toml"); 2425var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2449var scriptPath = Path.Combine(workspace.Path, scriptName); 2473var scriptPath = Path.Combine(workspace.Path, scriptName); 2496var scriptPath = Path.Combine(workspace.Path, scriptName); 2500var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2524var scriptPath = Path.Combine(workspace.Path, scriptName); 2528var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2553var scriptPath = Path.Combine(workspace.Path, "main.py"); 2581var scriptPath = Path.Combine(workspace.Path, "main.py"); 2585var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2624var scriptPath = Path.Combine(workspace.Path, "main.py"); 2627var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2654var scriptPath = Path.Combine(workspace.Path, "main.py"); 2657var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2688var scriptPath = Path.Combine(workspace.Path, "main.py"); 2691var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2724var scriptPath = Path.Combine(workspace.Path, "main.py"); 2727var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2754var scriptPath = Path.Combine(workspace.Path, "main.py"); 2757var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2786var scriptPath = Path.Combine(workspace.Path, "main.py"); 2789var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2818var scriptPath = Path.Combine(workspace.Path, "main.py"); 2821var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2854var scriptPath = Path.Combine(workspace.Path, "main.py"); 2908var scriptPath = Path.Combine(workspace.Path, scriptName); 2911var requirementsPath = Path.Combine(workspace.Path, "requirements.txt"); 2930File.WriteAllText(Path.Combine(sourceDir.FullName, "main.py"), "print('Hello from Python!')"); 2931File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\nENTRYPOINT [\"python\", \"main.py\"]\n"); 2938var dockerfilePath = Path.Combine(directory, fileName);
AddUvicornAppTests.cs (7)
16var appDirectory = Path.Combine(Path.GetTempPath(), "test-app"); 56File.WriteAllText(Path.Combine(projectDirectory, "pyproject.toml"), pyprojectContent); 57File.WriteAllText(Path.Combine(projectDirectory, "uv.lock"), uvLockContent); 58File.WriteAllText(Path.Combine(projectDirectory, "main.py"), scriptContent); 60var manifestPath = Path.Combine(projectDirectory, "aspire-manifest.json"); 86var appDockerfilePath = Path.Combine(outputDir.FullName, "main.Dockerfile");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Qdrant (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Qdrant.Tests (2)
QdrantFunctionalTests.cs (2)
116bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 214Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true);
Aspire.Hosting.Radius (18)
Publishing\RadiusBicepPublishingContext.cs (3)
91var bicepPath = Path.Combine(outputDir, "app.bicep"); 92var configPath = Path.Combine(outputDir, "bicepconfig.json"); 179Directory.CreateDirectory(Path.GetDirectoryName(destination)!);
Publishing\RadiusDeploymentPipelineStep.cs (9)
171var kubeConfigPath = Path.Combine(kubeConfigHome.Path, ".kube", "config"); 172Directory.CreateDirectory(Path.GetDirectoryName(kubeConfigPath)!); 278["KUBECONFIG"] = Path.Combine(kubeConfigHome, ".kube", "config"), 294Pin("AZURE_CONFIG_DIR", Path.Combine(realHome, ".azure")); 298Pin("AWS_CONFIG_FILE", Path.Combine(realHome, ".aws", "config")); 299Pin("AWS_SHARED_CREDENTIALS_FILE", Path.Combine(realHome, ".aws", "credentials")); 303Pin("CLOUDSDK_CONFIG", Path.Combine(realHome, ".config", "gcloud")); 519var bicepPath = Path.Combine(outputDir, "app.bicep"); 701var filePath = Path.Combine(directory.Path, "parameters.json");
Publishing\RadiusWorkspaceKubeContext.cs (1)
29return Path.Combine(home, ".rad", "config.yaml");
Secrets\RadiusSecretStoreExtensions.cs (1)
248population.SealedManifestPath = Path.GetFullPath(manifestPath, store.ApplicationBuilder.AppHostDirectory);
Secrets\SealedSecretArtifact.cs (4)
25Path.Combine(RootDirectoryName, storeName, Path.GetFileName(sourceManifestPath)); 33Path.Combine(outputDirectory, RootDirectoryName); 40Path.Combine(outputDirectory, RelativePath(storeName, sourceManifestPath));
Aspire.Hosting.Radius.Tests (37)
Deployment\ControlPlaneVersionGateTests.cs (20)
83var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test"); 84var expectedKubeConfig = Path.Combine(home, ".kube", "config"); 114var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test"); 115var realHome = Path.Combine(Path.GetTempPath(), "aspire-radius-real-home"); 123Assert.Equal(Path.Combine(home, ".kube", "config"), environment["KUBECONFIG"]); 126Assert.Equal(Path.Combine(realHome, ".azure"), environment["AZURE_CONFIG_DIR"]); 127Assert.Equal(Path.Combine(realHome, ".aws", "config"), environment["AWS_CONFIG_FILE"]); 128Assert.Equal(Path.Combine(realHome, ".aws", "credentials"), environment["AWS_SHARED_CREDENTIALS_FILE"]); 129Assert.Equal(Path.Combine(realHome, ".config", "gcloud"), environment["CLOUDSDK_CONFIG"]); 140var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test"); 141var realHome = Path.Combine(Path.GetTempPath(), "aspire-radius-real-home"); 149Assert.Equal(Path.Combine(realHome, ".config", "gcloud"), environment["CLOUDSDK_CONFIG"]); 159var home = Path.Combine(Path.GetTempPath(), "aspire-radius-kubeconfig-test"); 283Assert.Equal(Path.Combine(version.Environment!["HOME"]!, ".kube", "config"), kubeConfig);
Publishing\PostCallbackSecretValidationTests.cs (1)
30var path = Path.Combine(_manifestDirectory, $"{fileName}.sealed.yaml");
Publishing\RadiusDeployParametersTests.cs (1)
238var directory = Path.GetDirectoryName(parametersFile.Path)!;
Publishing\SealedSecretPublishTests.cs (7)
24var path = Path.Combine(_dir, $"{name}.sealed.yaml"); 74.WithSealedSecret(Path.Combine("secrets", "db-creds.sealed.yaml"), "username"); 78Assert.True(Path.IsPathFullyQualified(resolved)); 80Path.GetFullPath(Path.Combine("secrets", "db-creds.sealed.yaml"), store.ApplicationBuilder.AppHostDirectory), 87var missing = Path.Combine(_dir, "does-not-exist.sealed.yaml"); 102var manifest = Path.Combine(_dir, "no-payload.sealed.yaml");
Secrets\SealedSecretArtifactTests.cs (2)
15Assert.Equal(Path.Combine("sealed-secrets", "db-creds", "sealed.yaml"), path); 34Assert.Equal(Path.Combine("/out", "sealed-secrets", "db-creds", "sealed.yaml"), resolved);
Secrets\SealedSecretManifestTests.cs (1)
16var path = Path.Combine(_dir, $"{Guid.NewGuid():N}.sealed.yaml");
Secrets\SecretStoreValidationTests.cs (1)
56var path = Path.Combine(_sealedManifestDirectory, $"{Guid.NewGuid():N}.sealed.yaml");
tests\Shared\TestFileSystemService.cs (2)
33var resolvedName = fileName ?? System.IO.Path.GetRandomFileName(); 34var filePath = System.IO.Path.Combine(tempDir.FullName, resolvedName);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Redis (2)
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
667Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source); 809var stubPath = Path.Combine(binDirectory.FullName, "redis-server");
Aspire.Hosting.RemoteHost (35)
AssemblyLoader.cs (4)
259var assemblyName = Path.GetFileNameWithoutExtension(file); 356var libsPath = Path.Combine(integrationLibsPath, sharedName + ".dll"); 425probeDirs.Add(Path.GetFullPath(integrationLibsPath)); 429probeDirs.Add(Path.GetFullPath(applicationBasePath));
AtsCapabilityScanner.cs (1)
3513var xmlPath = Path.ChangeExtension(location, ".xml");
IntegrationLoadContext.cs (1)
139var path = Path.Combine(dir, $"{assemblyName}.dll");
JsonRpcServer.cs (3)
48socketPath = Path.Combine(temporaryStorage.GetTempPath(), "aspire", "remote-app-host.sock"); 60socketPath = Path.Combine(home, SocketDirectoryNames.Aspire, SocketDirectoryNames.Cli, SocketDirectoryNames.Backchannels, "remote-app-host.sock"); 195SocketPermissionHelper.CreateDirectory(Path.GetDirectoryName(_socketPath)!, repairExisting: _useDefaultSocketPath);
Language\IntegrationHostProcessLauncher.cs (1)
112WorkingDirectory = Path.GetDirectoryName(entryPoint)!,
src\Shared\ChildProcess.cs (1)
133_completionPath = Path.Combine(_completionDirectory.FullName, "exit-code");
src\Shared\CommandPathResolver.cs (1)
93return Path.GetFileNameWithoutExtension(command);
src\Shared\IntegrationPackageProbeManifest.cs (3)
220var normalizedFileName = Path.GetFileName(libraryName); 221var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(normalizedFileName); 358return Path.GetFullPath(path);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
src\Shared\ProcessSupervisor.cs (2)
49var isDotnet = Path.GetFileNameWithoutExtension(executable).Equals("dotnet", StringComparison.OrdinalIgnoreCase); 52arguments[0] = Path.GetFullPath(arguments[0]);
src\Shared\SocketPermissionHelper.cs (8)
39var directory = new DirectoryInfo(Path.GetFullPath(path, currentDirectory)); 40var tempRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(tempDirectory, currentDirectory)); 43: Path.TrimEndingDirectorySeparator(Path.GetFullPath(userProfileDirectory, currentDirectory)); 46var isWorkingDirectory = string.Equals(directory.FullName, Path.TrimEndingDirectorySeparator(currentDirectory), comparison); 48var isTemporaryRoot = string.Equals(Path.TrimEndingDirectorySeparator(directory.FullName), tempRoot, comparison); 113var directory = Path.GetDirectoryName(socketPath);
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
Aspire.Hosting.RemoteHost.Tests (96)
AssemblyLoaderTests.cs (13)
30[integrationLibs.Path, applicationBase.Path, Path.Combine(applicationBase.Path, "missing")]); 82var runtimeAssemblyPath = System.IO.Path.Combine(packageAssemblyDirectory.Path, "Aspire.Hosting.Azure.OperationalInsights.dll"); 83var resourceAssemblyPath = System.IO.Path.Combine(packageAssemblyDirectory.Path, "de", "Aspire.Hosting.resources.dll"); 85Directory.CreateDirectory(System.IO.Path.GetDirectoryName(resourceAssemblyPath)!); 88var manifestPath = System.IO.Path.Combine(manifestDirectory.Path, "integration-package-probe-manifest.json"); 108applicationBasePath: System.IO.Path.Combine(manifestDirectory.Path, "missing"), 128var packageAssemblyPath = System.IO.Path.Combine(packageAssemblyDirectory.Path, "Aspire.Hosting.PackageIntegration.dll"); 131var manifestPath = System.IO.Path.Combine(manifestDirectory.Path, "integration-package-probe-manifest.json"); 145applicationBasePath: System.IO.Path.Combine(manifestDirectory.Path, "missing"), 204var firstAssemblyPath = System.IO.Path.Combine(closureDirectory.Path, "Aspire.Hosting.Test.First.dll"); 205var secondAssemblyPath = System.IO.Path.Combine(closureDirectory.Path, "Aspire.Hosting.Test.Second.dll"); 209var manifestPath = System.IO.Path.Combine(manifestDirectory.Path, IntegrationPackageProbeManifest.FileName); 282File.WriteAllText(System.IO.Path.Combine(Path, fileName), string.Empty);
AtsExportsTests.cs (1)
139var tempFile = Path.Combine(workspace.WorkspaceRoot.FullName, "artifact.zip");
CodeGeneration\ApiReferenceExportTests.cs (5)
100var manifestPath = Path.Combine(manifestDirectory.Path, "integration-package-probe-manifest.json"); 101var packageAssetsPath = Path.Combine( 356var destinationDirectory = Path.Combine([packageAssetsPath, .. assetPathSegments]); 358var destinationPath = Path.Combine(destinationDirectory, Path.GetFileName(assemblyPath));
IntegrationHostConfigurationTests.cs (1)
17var entryPoint = Path.Combine(workspace.Path, "host.mts");
IntegrationHostLauncherTests.cs (6)
207var entryPoint = Path.GetFullPath(Path.Combine("integration packages", "host entry.mts")); 241Assert.Equal(Path.GetDirectoryName(entryPoint), startInfo.WorkingDirectory); 250var entryPoint = Path.GetFullPath("host.mts"); 265var entryPoint = Path.GetFullPath(Path.Combine("integration %TEMP%! packages", "host entry.mts"));
IntegrationHostProcessLauncherTests.cs (3)
55var descriptor = new IntegrationHostDescriptor { Language = "test/launch", PackageName = "example", HostEntryPoint = Path.Combine(AppContext.BaseDirectory, "host.mts") }; 76var entryPoint = Path.Combine(workspace.Path, "entry point.mts"); 139var descriptor = new IntegrationHostDescriptor { Language = "test/launch", PackageName = "example", HostEntryPoint = Path.Combine(AppContext.BaseDirectory, "host.mts") };
IntegrationHostProcessTests.cs (4)
88Assert.Equal("once\n", await File.ReadAllTextAsync(Path.Combine(server.Directory, "side-effects"))); 113Assert.Equal("once\n", await File.ReadAllTextAsync(Path.Combine(server.Directory, "side-effects"))); 132Assert.Equal("4", await File.ReadAllTextAsync(Path.Combine(server.Directory, "generation"))); 231Assert.False(File.Exists(Path.Combine(server.Directory, "host-pids")));
IntegrationLoadContextTests.cs (8)
41var assemblyPath = Path.Combine(AppContext.BaseDirectory, "Aspire.Hosting.CodeGeneration.Go.dll"); 47var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json"); 75var nativeLibraryPath = Path.Combine(manifestDirectory.FullName, "runtimes", "linux-x64", "native", "libe_sqlite3.so"); 76Directory.CreateDirectory(Path.GetDirectoryName(nativeLibraryPath)!); 79var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json"); 104var resourceAssemblyPath = Path.Combine(manifestDirectory.FullName, "fr", "Aspire.Hosting.Redis.resources.dll"); 105Directory.CreateDirectory(Path.GetDirectoryName(resourceAssemblyPath)!); 108var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json");
IntegrationPackageProbeManifestTests.cs (1)
26var manifestPath = Path.Combine(manifestDirectory.FullName, "integration-package-probe-manifest.json");
JsonRpcAuthenticationTests.cs (11)
107File.GetUnixFileMode(Path.GetDirectoryName(server.SocketPath)!)); 128var existingFile = Path.Combine(target.FullName, "rpc.sock"); 130workspace.CreateDirectory(Path.Combine(".aspire", "cli")); 131var link = Path.Combine(workspace.Path, ".aspire", "cli", "bch"); 136["REMOTE_APP_HOST_SOCKET_PATH"] = symbolicLink ? Path.Combine(link, "rpc.sock") : existingFile 160: Path.Combine(workspace.Path, "rpc", "rpc.sock"); 213var blockingFile = Path.Combine(workspace.Path, "not-a-directory"); 217["REMOTE_APP_HOST_SOCKET_PATH"] = Path.Combine(blockingFile, "rpc.sock") 241: Path.Combine(workspace.Path, "rpc", "rpc.sock") 283var directory = Path.Combine(workspace.Path, "rpc"); 291: Path.Combine(workspace.Path, "rpc", "rpc.sock");
KubernetesManifestTests.cs (2)
85await Verify(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "templates", "api", "netpol.yaml")), "yaml"); 207var extension = Path.GetExtension(generated.Key).TrimStart('.');
tests\Shared\Processes\ChildProcessTests.cs (1)
430var cleanupPath = Path.Combine(fixture.CreateDirectory().FullName, "cleanup-completed");
tests\Shared\Processes\ProcessSupervisorTests.cs (3)
36var shim = Path.Combine(directory.FullName, "literal %PATH%! shim.cmd"); 49startInfo.Environment["ASPIRE_TEST_DOTNET"] = Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), "..", "..", "..", "dotnet.exe"); 73var completionPath = Path.Combine(directory.FullName, "exit-code");
tests\Shared\Processes\ProcessTestFixture.cs (8)
47while (!File.Exists(Path.Combine(repository.FullName, "Aspire.slnx"))) 61var sourcePaths = sources.Select(source => Path.Combine(repository.FullName, "src", "Shared", source)).Concat( 63Path.Combine(repository.FullName, "tests", "Shared", "AsyncTestHelpers.cs"), 64Path.Combine(repository.FullName, "tests", "Aspire.TestUtilities", "PlatformDetection.cs") 68var project = Path.Combine(_directory.FullName, "ProcessTestHost.csproj"); 84await File.WriteAllTextAsync(Path.Combine(_directory.FullName, "Program.cs"), HostProgram); 86["restore", project, "--configfile", Path.Combine(repository.FullName, "NuGet.config"), "--verbosity", "quiet"]); 88_assemblyPath = Path.Combine(_directory.FullName, "bin", "Debug", targetFramework, "ProcessTestHost.dll");
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
TestServices\IntegrationHostProcessFixture.cs (21)
29while (!File.Exists(Path.Combine(repository.FullName, "Aspire.slnx"))) 33var project = Path.Combine(_directory.FullName, "LifetimeTestHost.csproj"); 44<ProjectReference Include="{Path.Combine(repository.FullName, "src", "Aspire.Hosting.RemoteHost", "Aspire.Hosting.RemoteHost.csproj")}" /> 45<ProjectReference Include="{Path.Combine(repository.FullName, "src", "Aspire.TypeSystem", "Aspire.TypeSystem.csproj")}" /> 49await File.WriteAllTextAsync(Path.Combine(_directory.FullName, "Program.cs"), HostProgram); 51["restore", project, $"--property:Configuration={BuildConfiguration}", "--configfile", Path.Combine(repository.FullName, "NuGet.config"), "--verbosity", "quiet"]); 54_hostAssembly = Path.Combine(_directory.FullName, "bin", BuildConfiguration, "net10.0", "LifetimeTestHost.dll"); 62var script = Path.Combine(directory.FullName, "host.js"); 64await File.WriteAllTextAsync(Path.Combine(directory.FullName, "appsettings.json"), JsonSerializer.Serialize(new 82await File.WriteAllTextAsync(Path.Combine(directory.FullName, "fail-startup"), ""); 86await File.WriteAllTextAsync(Path.Combine(directory.FullName, "skip-registration"), ""); 90await File.WriteAllTextAsync(Path.Combine(directory.FullName, "missing-command"), ""); 94await File.WriteAllTextAsync(Path.Combine(directory.FullName, "stall-discovery"), ""); 98await File.WriteAllTextAsync(Path.Combine(directory.FullName, "delay-host-pid-write"), ""); 342: Path.Combine(directory, "r", "s"); 343var executable = OperatingSystem.IsWindows() ? Path.ChangeExtension(hostAssembly, ".exe") : Path.ChangeExtension(hostAssembly, null); 436while (!File.Exists(Path.Combine(Directory, name))) 442public int[] HostProcessIds => File.ReadAllLines(Path.Combine(Directory, "host-pids")).Select(int.Parse).ToArray(); 447var path = Path.Combine(Directory, "host-pids"); 508await File.WriteAllTextAsync(Path.Combine(Directory, "stop-server"), "");
Aspire.Hosting.Rust (64)
RustCargoTargetResolver.cs (1)
68var path = Path.Combine([targetDirectory, .. Segments]);
RustDockerfileGenerator.cs (21)
61var workingDirectory = Path.GetFullPath(resource.WorkingDirectory); 66&& !File.Exists(Path.Combine(workingDirectory, ".dockerignore"))) 208if (Path.IsPathRooted(manifestPath)) 216? manifestPath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar) 219var filesystemWorkingDirectory = Path.GetFullPath(workingDirectory); 220var filesystemManifest = Path.GetFullPath(platformManifestPath, workingDirectory); 234var relativeManifest = Path.GetRelativePath(canonicalWorkingDirectory, canonicalManifest); 236if (Path.IsPathRooted(relativeManifest) 238|| relativeManifest.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal) 239|| relativeManifest.StartsWith($"..{Path.AltDirectorySeparatorChar}", StringComparison.Ordinal)) 255var relativePath = Path.GetRelativePath(workingDirectory, path); 261if (Path.IsPathRooted(relativePath) 263|| relativePath.StartsWith($"..{Path.DirectorySeparatorChar}", StringComparison.Ordinal) 264|| relativePath.StartsWith($"..{Path.AltDirectorySeparatorChar}", StringComparison.Ordinal)) 270[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 276var candidate = Path.Combine(current, segments[i]); 281current = Path.Combine(current, segments[i]); 306string.Equals(Path.GetFileName(entry), segments[i], StringComparison.Ordinal)) 309Path.GetFileName(entry).Normalize(NormalizationForm.FormC),
RustHostingExtensions.cs (13)
81appDirectory = Path.GetFullPath(appDirectory, builder.AppHostDirectory); 592workingDirectory = Path.TrimEndingDirectorySeparator(Path.GetFullPath(workingDirectory)); 597? Path.GetDirectoryName(Path.GetFullPath(path, workingDirectory)) 606if (File.Exists(Path.Combine(candidate, "Cargo.lock"))) 611directory = Path.GetDirectoryName(candidate); 626var prefix = Path.EndsInDirectorySeparator(directory) 628: directory + Path.DirectorySeparatorChar; 652var workingDirectory = Path.GetFullPath(resource.WorkingDirectory); 743var workingDirectory = Path.GetFullPath(resource.WorkingDirectory); 748if (File.Exists(Path.Combine(workingDirectory, "Dockerfile"))) 753Path.Combine(workingDirectory, "Dockerfile"),
src\Shared\PathNormalizer.cs (29)
19path = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 21return Path.GetFullPath(path); 65var root = Path.GetPathRoot(path); 72[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 83var candidate = Path.Combine(current, segment); 99Path.Exists(Path.Combine(current, caseVariant))) || 101Path.Exists(Path.Combine(current, normalizationVariant))); 171var entryName = Path.GetFileName(entry); 254var fullPath = Path.GetFullPath(path); 255var root = Path.GetPathRoot(fullPath); 287[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 297var candidate = Path.Combine(current, segment); 388var fullPath = Path.GetFullPath(path); 389var root = Path.GetPathRoot(fullPath); 399[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 405current = Path.Combine(current, segments[i]); 454current = Path.Combine(current, segments[j]); 477var fullPath = Path.GetFullPath(path); 478var root = Path.GetPathRoot(fullPath); 487[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 493current = Path.Combine(current, segments[i]); 506current = Path.Combine(current, segments[j]);
Aspire.Hosting.Rust.Tests (99)
AddRustAppPublishTests.cs (59)
38File.WriteAllText(Path.Combine(source, "rust-toolchain.toml"), """ 416Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 471Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 495File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n"); 501Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 513File.WriteAllText(Path.Combine(sourceDir.FullName, "Dockerfile"), "FROM scratch\n"); 519Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 529var customDockerfile = Path.Combine(customContext.FullName, "Dockerfile.prod"); 543Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 564Path.Combine(outputDir.FullName, "api.Dockerfile"), 588var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "Crates", "API")); 589File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n"); 591var differentlyCasedPath = Path.Combine("crates", "api", "cargo.toml"); 592if (!File.Exists(Path.Combine(sourceDir.FullName, differentlyCasedPath))) 602var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 615var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, decomposedDirectoryName)); 617File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n"); 619var composedManifestPath = Path.Combine(composedDirectoryName, "Cargo.toml"); 620if (!File.Exists(Path.Combine(sourceDir.FullName, composedManifestPath))) 625var storedDirectoryName = Path.GetFileName(Assert.Single(Directory.EnumerateDirectories(sourceDir.FullName))); 632var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 649var sourceDir = Directory.CreateDirectory(Path.Combine(restrictedAncestor.FullName, "source")); 650var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "Crates", "API")); 653File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n"); 677Path.Combine(outputDir.FullName, "api.Dockerfile"), 715var manifestDirectory = Directory.CreateDirectory(Path.Combine(source, @"crates\api")); 716File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n"); 744var canonicalManifest = Path.Combine(canonicalSourceDir, "crates", "api", "Cargo.toml"); 745var manifestPath = Path.GetRelativePath(sourceDir.FullName, canonicalManifest); 752var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 769var manifestDirectory = Directory.CreateDirectory(Path.Combine(sourceDir.FullName, "Crates", "API")); 771File.WriteAllText(Path.Combine(manifestDirectory.FullName, "Cargo.toml"), "[package]\nname = \"api\"\n"); 778var differentlyCasedCanonicalManifest = Path.Combine(canonicalSourceDir, "crates", "api", "cargo.toml"); 784var manifestPath = Path.GetRelativePath(sourceDir.FullName, differentlyCasedCanonicalManifest); 791var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 803File.WriteAllText(Path.Combine(outsideDir.FullName, "Cargo.toml"), "[package]\nname = \"outside\"\n"); 804CreateDirectorySymbolicLinkOrSkip(Path.Combine(sourceDir.FullName, "linked"), outsideDir.FullName); 811Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 820var firstLink = Path.Combine(sourceDir.FullName, "linked"); 821var secondLink = Path.Combine(sourceDir.FullName, "loop"); 834Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile"))); 861configureResource: app => app.WithCargoManifestPath(Path.Combine(Path.GetTempPath(), "Cargo.toml")))); 872File.WriteAllText(Path.Combine(source, "Cargo.lock"), "version = 4\n")); 881configureSource: source => File.WriteAllText(Path.Combine(source, "Cargo.lock"), "version = 4\n"), 925var first = await File.ReadAllTextAsync(Path.Combine(firstOutputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 926var second = await File.ReadAllTextAsync(Path.Combine(secondOutputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 943var first = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 944var second = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "worker.Dockerfile"), TestContext.Current.CancellationToken); 972var ignore = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"), TestContext.Current.CancellationToken); 986File.WriteAllText(Path.Combine(sourceDir.FullName, ".dockerignore"), "*.md\n"); 993Assert.False(File.Exists(Path.Combine(outputDir.FullName, "api.Dockerfile.dockerignore"))); 1008File.WriteAllText(Path.Combine(relocatedDir.FullName, "Dockerfile"), "FROM scratch\n"); 1029Assert.Equal(Path.Combine(relocatedDir.FullName, "Dockerfile"), dockerfile.DockerfilePath); 1051File.WriteAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "Cargo.lock"), "version = 4\n"); 1055File.WriteAllText(Path.Combine(sourceDir.FullName, "Cargo.lock"), "version = 4\n"); 1060builder.AddRustApp("api", sourceDir.FullName + Path.DirectorySeparatorChar) 1064var content = await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken); 1141return await File.ReadAllTextAsync(Path.Combine(outputDir.FullName, "api.Dockerfile"), TestContext.Current.CancellationToken);
CargoMetadataTests.cs (5)
290Directory.CreateDirectory(Path.Combine(crate.Path, "src")); 291crate.Write(Path.Combine("src", "main.rs"), "fn main() { println!(\"hello\"); }"); 309Assert.True(Path.IsPathFullyQualified(metadata.TargetDirectory)); 311TestPathNormalizer.ResolveSymlinks(Path.Combine(crate.Path, "target")), 315Assert.False(Directory.Exists(Path.Combine(crate.Path, "target")));
FakeCargoMetadataReader.cs (1)
65$"\"target_directory\": {JsonSerializer.Serialize(Path.GetFullPath(targetDirectory, workingDirectory))}",
RustCargoTargetResolverTests.cs (2)
130var expected = Path.Combine("/crates/target", "aarch64-unknown-linux-musl", "release", OperatingSystem.IsWindows() ? "my-service.exe" : "my-service"); 143var expected = Path.Combine("/crates/target", "release", OperatingSystem.IsWindows() ? "my-service.exe" : "my-service");
RustDockerfileShellTests.cs (16)
17var currentArtifact = Path.Combine(targetDirectory, "release", "api"); 19$"mkdir -p {ShellQuote(Path.GetDirectoryName(currentArtifact)!)} && " + 31Assert.Equal("current", File.ReadAllText(Path.Combine(artifactDirectory, "api"))); 41var cargoStub = Path.Combine(workspace.WorkspaceRoot.FullName, "cargo-stub"); 56Assert.False(File.Exists(Path.Combine(artifactDirectory, "api"))); 66var rootCandidate = Path.Combine(targetDirectory, "release", "api"); 67var staleTargetCandidate = Path.Combine(targetDirectory, "stale-target", "release", "api"); 68var currentTargetCandidate = Path.Combine(targetDirectory, "current-target", "release", "api"); 69Directory.CreateDirectory(Path.GetDirectoryName(rootCandidate)!); 70Directory.CreateDirectory(Path.GetDirectoryName(staleTargetCandidate)!); 74$"mkdir -p {ShellQuote(Path.GetDirectoryName(currentTargetCandidate)!)} && " + 87Assert.Equal("current", File.ReadAllText(Path.Combine(artifactDirectory, "api"))); 97var markerPath = Path.Combine(workspace.WorkspaceRoot.FullName, "command-substitution-ran"); 121var invocationLog = Path.Combine(workspace.WorkspaceRoot.FullName, "invocations"); 153var invocationLog = Path.Combine(workspace.WorkspaceRoot.FullName, "invocations"); 181var stubPath = Path.Combine(directory, name);
RustPublicApiTests.cs (12)
242Assert.Equal(Path.GetFullPath(builder.AppHostDirectory), launchConfig.WorkingDirectory); 296var expected = Path.Combine("/app/target", "debug", OperatingSystem.IsWindows() ? "my-service.exe" : "my-service"); 327var expected = Path.Combine( 328Path.GetFullPath("/elsewhere", builder.AppHostDirectory), 359Directory.CreateDirectory(Path.Combine(crate.Path, "src")); 360crate.Write(Path.Combine("src", "main.rs"), "fn main() {}"); 381Path.Combine("debug", OperatingSystem.IsWindows() ? "first.exe" : "first"), 384Path.Combine("debug", OperatingSystem.IsWindows() ? "second.exe" : "second"), 419Assert.StartsWith(Path.GetFullPath("/first-target", builder.AppHostDirectory), Assert.IsType<RustCargoLaunchTarget>(first.Cargo).ExecutablePath); 420Assert.StartsWith(Path.GetFullPath("/second-target", builder.AppHostDirectory), Assert.IsType<RustCargoLaunchTarget>(second.Cargo).ExecutablePath); 448Assert.EndsWith(Path.Combine("debug", OperatingSystem.IsWindows() ? "first.exe" : "first"), Assert.IsType<RustCargoLaunchTarget>(first.Cargo).ExecutablePath); 449Assert.EndsWith(Path.Combine("debug", OperatingSystem.IsWindows() ? "second.exe" : "second"), Assert.IsType<RustCargoLaunchTarget>(second.Cargo).ExecutablePath);
RustReadmeTests.cs (1)
14var readmePath = Path.Combine(MSBuildUtils.GetRepoRoot(), "src", "Aspire.Hosting.Rust", "README.md");
TempCrateDirectory.cs (1)
16=> File.WriteAllText(System.IO.Path.Combine(Path, fileName), content);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Aspire.Hosting.Sdk.Tests (210)
AppHostSdkTargetsTests.cs (204)
138var propsPath = SecurityElement.Escape(Path.Combine(GetRepoRoot(), 140await File.WriteAllTextAsync(Path.Combine(workspace.Path, "AppHost.csproj"), 239var projectDirectory = Path.Combine(workspace.Path, "AppHost"); 242var sdkTargetsPath = SecurityElement.Escape(Path.Combine(repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets")); 257await File.WriteAllTextAsync(Path.Combine(projectDirectory, "AppHost.csproj"), 331var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 360var repoRoot = Path.Combine(workspace.Path, "repo"); 363var repoTestingTargets = SecurityElement.Escape(Path.Combine(sourceRepoRoot, "tests", "Shared", "RepoTesting", "Aspire.RepoTesting.targets")); 364var artifactsPath = Path.Combine(workspace.Path, "artifacts"); 365var expectedAssembly = Path.Combine(workspace.Path, "custom-tasks-output", "Aspire.Hosting.Tasks.dll"); 366var overrideAssembly = Path.Combine(workspace.Path, "override", "Aspire.Hosting.Tasks.dll"); 376Path.Combine("src", "Aspire.Hosting.AppHost", "build", "Aspire.Hosting.AppHost.in.targets"), 377Path.Combine("src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets") 380var destination = Path.Combine(repoRoot, target); 381Directory.CreateDirectory(Path.GetDirectoryName(destination)!); 382File.Copy(Path.Combine(sourceRepoRoot, target), destination); 385var taskProject = Path.Combine(repoRoot, "src", "Aspire.Hosting.Tasks", "Aspire.Hosting.Tasks.csproj"); 386Directory.CreateDirectory(Path.GetDirectoryName(taskProject)!); 392<MakeDir Directories="{{SecurityElement.Escape(Path.GetDirectoryName(expectedAssembly))}}" /> 400Directory.CreateDirectory(Path.GetDirectoryName(overrideAssembly)!); 405Directory.CreateDirectory(Path.GetDirectoryName(expectedAssembly)!); 420var projectFile = Path.Combine(workspace.Path, "AppHost.csproj"); 427<RepoRoot>{{SecurityElement.Escape(Path.TrimEndingDirectorySeparator(repoRoot) + Path.DirectorySeparatorChar)}}</RepoRoot> 428<ArtifactsBinDir>{{SecurityElement.Escape(Path.TrimEndingDirectorySeparator(artifactsPath) + Path.DirectorySeparatorChar)}}</ArtifactsBinDir> 440var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 464Assert.True(File.Exists(Path.GetFullPath(properties["_AspireTasksAssembly"], workspace.Path))); 479var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 518var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 548var emptyPathDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-path")); 574var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 608var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 630var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 652var nonExecutableDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "non-executable")); 653var nonExecutableDnxPath = Path.Combine(nonExecutableDirectory.FullName, "dnx"); 660var executableDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "executable")); 663var path = $"{nonExecutableDirectory.FullName}{Path.PathSeparator}{CreatePathWithoutAspire(executableDirectory.FullName)}"; 681var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(project.ProjectDirectory, RelativeCliDirectory)); 692Assert.True(Path.IsPathFullyQualified(properties["_AspireResolvedCliPath"])); 700var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 721var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 736var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake cli !& (shim)^,;=+[]{}~@")); 754var emptyPathDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-path")); 761var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 785var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 826var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 855var appHostDirectory = Path.Combine(workspace.Path, "FileApp"); 857var appHostFile = Path.Combine(appHostDirectory, "apphost.cs"); 878var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 948await File.WriteAllTextAsync(Path.Combine(workspace.Path, "Directory.Build.props"), """ 1046var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1061var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "selected cli")); 1062var captureFile = Path.Combine(workspace.Path, "aspire-args.txt"); 1098var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "selected cli")); 1099var captureFile = Path.Combine(workspace.Path, "dnx-args.txt"); 1141var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "native aspire")); 1142var captureFile = Path.Combine(workspace.Path, "aspire-native-args.txt"); 1181var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake cli !& (shim)^,;=+[]{}~@")); 1182var captureFile = Path.Combine(workspace.Path, "aspire-args.txt"); 1218var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1219var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1234var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1241var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1267var staleCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "stale-cli")); 1273var dnxDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, dnxDirectoryName)); 1278var aspireHome = Path.Combine(workspace.Path, aspireHomeDirectoryName); 1301Assert.Equal(dnxBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1302Assert.Equal(dnxBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"])); 1304Assert.NotEqual(staleBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1314var dnxDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "dnx")); 1316var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1336Assert.Equal(pinnedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1337Assert.Equal(pinnedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"])); 1339Assert.NotEqual(sharedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1348var dnxDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "dnx")); 1350var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1369Assert.Equal(pinnedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1379var dnxDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "dnx")); 1381var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1382var setupArgumentsPath = Path.Combine(workspace.Path, "setup-arguments.txt"); 1408Assert.Equal(pinnedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1409Assert.Equal(pinnedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"])); 1425Assert.Equal(Path.Combine(workspace.Path, "dnx", "aspire.cli", expectedDirectoryName), directory); 1443var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "cli")); 1455["ASPIRE_HOME"] = Path.Combine(workspace.Path, "aspire-home"), 1467var layoutPathGuidance = $"with the ASPIRE_LAYOUT_PATH environment variable set to '{Path.Combine(workspace.Path, "aspire-home", "dnx", "aspire.cli")}"; 1478var dnxDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "dnx")); 1480var cliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "cli")); 1484await File.WriteAllTextAsync(Path.Combine(cliDirectory.FullName, "setup-exit-code"), "42"); 1487var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1509var directory = Path.Combine(workspace.Path, "bundle", "terminalhost"); 1511var path = Path.Combine(directory, OperatingSystem.IsWindows() ? "Aspire.TerminalHost.exe" : "Aspire.TerminalHost"); 1530var managedDir = Path.Combine(workspace.Path, "bundle", "managed"); 1533File.Move(bundle.DashboardPath, Path.Combine(managedDir, Path.GetFileName(bundle.DashboardPath))); 1563var managedDir = Path.Combine(workspace.Path, "bundle", "managed"); 1564var managedPath = Path.Combine(managedDir, OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"); 1570expectedDashboardPath = Path.Combine(managedDir, Path.GetFileName(bundle.DashboardPath)); 1588Assert.Equal(bundle.DcpDirectory + Path.DirectorySeparatorChar, task.DcpDir); 1589Assert.Equal(expectedDashboardDir + Path.DirectorySeparatorChar, task.AspireDashboardDir); 1591Assert.Equal(managedDir + Path.DirectorySeparatorChar, task.AspireTerminalHostDir); 1603Path.Combine(workspace.Path, "cli $HOME `aspire-test-command`")); 1605var aspireHome = Path.Combine(workspace.Path, "empty-aspire-home"); 1617Assert.Equal(selectedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1618Assert.Equal(selectedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"])); 1627var selectedCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "selected-cli")); 1629var staleCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "stale-cli")); 1632var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1645Assert.Equal(selectedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1646Assert.Equal(selectedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"])); 1648Assert.NotEqual(staleBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1658var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "native%ASPIRE_TEST_LITERAL%")); 1660var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1672Assert.Equal(selectedBundle.DcpDirectory, Path.TrimEndingDirectorySeparator(properties["DcpDir"])); 1673Assert.Equal(selectedBundle.DashboardDirectory, Path.TrimEndingDirectorySeparator(properties["AspireDashboardDir"])); 1676Assert.False(Directory.Exists(Path.Combine(workspace.Path, "nativeexpanded"))); 1684var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1687var aspireHome = Path.Combine(workspace.Path, "aspire-home"); 1713var fakeCommandDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-command")); 1715var commandShimPath = Path.Combine(fakeCommandDirectory.FullName, "aspire.cmd"); 1721var childPidPath = Path.Combine(workspace.Path, "child.pid"); 1723var projectPath = Path.Combine(workspace.Path, "RunAspireCliCommand.proj"); 1781var commandPath = Path.Combine(workspace.Path, OperatingSystem.IsWindows() ? "hang.cmd" : "hang"); 1850var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1852var environmentAspireHome = Path.Combine(workspace.Path, "environment-aspire-home"); 1853var propertyAspireHome = Path.Combine(workspace.Path, "property-aspire-home"); 1867Assert.False(Directory.Exists(Path.Combine(propertyAspireHome, "bundle"))); 1875var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1901var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1902var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1917var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1918var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1933var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1934var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1949var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1950var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1965var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "fake-cli")); 1966var cliPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1981var emptyPathDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "empty-path")); 1995var projectDirectory = Path.Combine(workspace.Path, "AppHost"); 1998var sdkTargetsPath = SecurityElement.Escape(Path.Combine(repoRoot, "src", "Aspire.AppHost.Sdk", "SDK", "Sdk.in.targets")); 1999var packageReferencesPath = Path.Combine(projectDirectory, "obj", "package-references.txt"); 2001await File.WriteAllTextAsync(Path.Combine(projectDirectory, "AppHost.csproj"), 2042var projectDirectory = Path.Combine(workspace, "AppHost"); 2045var appHostBuildDirectory = Path.Combine(repoRoot, "src", "Aspire.Hosting.AppHost", "build"); 2047File.Copy(Path.Combine(appHostBuildDirectory, appHostPropsFileName), Path.Combine(projectDirectory, "Aspire.Hosting.AppHost.Common.props"), overwrite: true); 2048var appHostPropsFile = Path.Combine(projectDirectory, appHostPropsFileName); 2049var appHostProps = await File.ReadAllTextAsync(Path.Combine(appHostBuildDirectory, "Aspire.Hosting.AppHost.in.props")); 2052var appHostTargetsFile = Path.Combine(projectDirectory, "Aspire.Hosting.AppHost.targets"); 2053var appHostTargets = await File.ReadAllTextAsync(Path.Combine(appHostBuildDirectory, "Aspire.Hosting.AppHost.in.targets")); 2056var projectFile = Path.Combine(projectDirectory, $"AppHost{projectExtension}"); 2091await File.WriteAllTextAsync(Path.Combine(projectDirectory, "Program.cs"), """ 2180var aspirePath = Path.Combine(fakeCliDirectory, "aspire"); 2196var aspirePath = Path.Combine(fakeCliDirectory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 2233Directory.CreateDirectory(Path.Combine(layoutRoot, "bundle", "managed")); 2235File.WriteAllText(Path.Combine(bundle.DcpDirectory, OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), ""); 2237Path.Combine(layoutRoot, "bundle", "managed", OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"), 2245var bundleRoot = Path.Combine(layoutRoot, "bundle"); 2246var dcpDirectory = Path.Combine(bundleRoot, "dcp"); 2247var dashboardDirectory = Path.Combine(bundleRoot, "dashboard"); 2248var dashboardPath = Path.Combine(dashboardDirectory, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"); 2254var aspirePath = Path.Combine(fakeCliDirectory, $"aspire{extension}"); 2290var dnxPath = Path.Combine(fakeCliDirectory, OperatingSystem.IsWindows() ? "dnx.cmd" : "dnx"); 2294var fakeSdkDirectory = Directory.CreateDirectory(Path.Combine(fakeCliDirectory, "sdk", AspireCliVersion)); 2295await File.WriteAllTextAsync(Path.Combine(fakeSdkDirectory.FullName, "dotnet.dll"), ""); 2360await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "setup-exit-code"), exitCode.ToString(CultureInfo.InvariantCulture)); 2368await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "fail-version"), ""); 2382var aspirePath = Path.Combine(fakeCliDirectory, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 2390var sourceDirectory = Path.GetDirectoryName(fakeCommandHostPath)!; 2393File.Copy(sourcePath, Path.Combine(destinationDirectory, Path.GetFileName(sourcePath)), overwrite: true); 2396return Path.Combine(destinationDirectory, Path.GetFileName(fakeCommandHostPath)); 2401var captureFile = Path.Combine(workingDirectory, $"{command}-shadow-invoked.txt"); 2405Path.Combine(workingDirectory, $"{command}.cmd"), 2420await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), $$""" 2432var aspirePath = Path.Combine(fakeCliDirectory, "aspire"); 2448await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), $$""" 2461var aspirePath = Path.Combine(fakeCliDirectory, "aspire"); 2482await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), """ 2495var aspirePath = Path.Combine(fakeCliDirectory, "aspire"); 2512await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), """ 2529var aspirePath = Path.Combine(fakeCliDirectory, "aspire"); 2550await File.WriteAllTextAsync(Path.Combine(fakeCliDirectory, "aspire.cmd"), """ 2566var aspirePath = Path.Combine(fakeCliDirectory, "aspire"); 2619var vswherePath = Path.Combine( 2631Path.GetDirectoryName(vswherePath)!, 2668=> OperatingSystem.IsWindows() ? Path.Combine(Path.GetDirectoryName(dnxPath)!, "dotnet.exe") : dnxPath; 2693? $"exec \"{Path.Combine(Path.GetDirectoryName(dnxPath)!, "sdk", AspireCliVersion, "dotnet.dll")}\" dnx " 2740=> Path.Combine(aspireHome, "dnx", "aspire.cli", version); 2745File.Exists(Path.Combine(aspireHome, "bundle", "dcp", OperatingSystem.IsWindows() ? "dcp.exe" : "dcp")), 2748File.Exists(Path.Combine(aspireHome, "bundle", "managed", OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed")), 2756return Path.Combine(project.ProjectDirectory, "bin", "Debug", "net10.0", executableName); 2765? $"{directory}{Path.PathSeparator}{Environment.GetEnvironmentVariable(pathEnvironmentVariable)}" 2785.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 2788return string.Join(Path.PathSeparator, firstDirectories.Concat(pathDirectories)); 2797return executableNames.Any(executableName => File.Exists(Path.Combine(directory.Trim().Trim('"'), executableName))); 2906while (directory is not null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
Aspire.Hosting.Seq.Tests (3)
AddSeqTests.cs (1)
160Assert.Equal(Path.Combine(builder.AppHostDirectory, "mydata"), volumeAnnotation.Source);
SeqFunctionalTests.cs (2)
96bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 178Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true);
Aspire.Hosting.SqlServer (3)
SqlServerBuilderExtensions.cs (1)
307var path = Path.Combine(source, dir);
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
Aspire.Hosting.Tasks (36)
CommandPathResolver.cs (4)
26foreach (var pathEntry in path.Split(Path.PathSeparator)) 36var candidate = Path.Combine(directory, executableName); 54return Path.GetFullPath(path); 102private static bool IsWindows() => Path.DirectorySeparatorChar == '\\';
ResolveAspireCliBundle.cs (27)
209var candidateCliPaths = EnumerateCandidateCliPaths(Path.GetFullPath(cliPath)); 212var cliDirectory = Path.GetDirectoryName(candidateCliPath); 245var fullPath = Path.GetFullPath(layoutPath); 251if (TryResolveBundleRoot(Path.Combine(fullPath, BundleDirectoryName), out resolution)) 263var dcpDir = Path.Combine(bundleRoot, "dcp"); 264var dcpPath = Path.Combine(dcpDir, IsWindows() ? "dcp.exe" : "dcp"); 265var managedDir = Path.Combine(bundleRoot, "managed"); 266var managedPath = Path.Combine(managedDir, IsWindows() ? "aspire-managed.exe" : "aspire-managed"); 272var dashboardDir = Path.Combine(bundleRoot, "dashboard"); 273var dashboardPath = Path.Combine(dashboardDir, IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"); 284dashboardPath = Path.Combine(managedDir, IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"); 292var terminalHostDir = Path.Combine(bundleRoot, "terminalhost"); 293var terminalHostPath = Path.Combine(terminalHostDir, IsWindows() ? "Aspire.TerminalHost.exe" : "Aspire.TerminalHost"); 316return path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) || 317path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal) 319: path + Path.DirectorySeparatorChar; 322private static bool IsWindows() => Path.DirectorySeparatorChar == '\\'; 365"script" or "pr" or "localhive" => Path.GetDirectoryName(cliDirectory) ?? cliDirectory, 369yield return Path.GetDirectoryName(cliDirectory); 374var storeRoot = Path.Combine(cliDirectory, ".store", "aspire.cli"); 410var versionsRoot = Path.Combine(layoutPath, VersionsDirectoryName); 416.ThenByDescending(Path.GetFileName, StringComparer.OrdinalIgnoreCase)) 431var directoryName = Path.GetFileName(path); 486var directoryName = Path.GetFileName(path); 506var sidecarPath = Path.Combine(cliDirectory, InstallSidecarFileName); 533? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire") 547return Path.Combine(aspireHomeDirectory, PinnedLayoutsDirectoryName, PinnedCliPackageDirectoryName, directoryName);
ResolveAspireCliInvocation.cs (4)
116var dotnetRoot = Path.GetDirectoryName(dnxPath); 122var dotnetPath = Path.Combine(dotnetRoot, "dotnet.exe"); 128var sdkPath = Path.Combine(dotnetRoot, "sdk", sdkVersion!, "dotnet.dll"); 215return Path.DirectorySeparatorChar == '\\'
RunAspireCliCommand.cs (1)
162ProcessStartInfoHelper.SetCommand(startInfo, FileName, arguments, Path.DirectorySeparatorChar == '\\');
Aspire.Hosting.Testing (3)
src\Shared\LaunchProfiles\LaunchSettingsReader.cs (3)
21? Path.Combine("Properties", "launchSettings.json") 22: Path.Combine(Path.GetFullPath(directoryPath), "Properties", "launchSettings.json");
Aspire.Hosting.Testing.Tests (10)
DashboardUrlTests.cs (1)
301var missingDashboardPath = Path.Combine(
TestingBuilderTests.cs (2)
70Path.Combine(MSBuildUtils.GetRepoRoot(), "artifacts", "bin", "TestProject.AppHost"), 76var appHostAssembly = Assembly.LoadFrom(Path.Combine(AppContext.BaseDirectory, testProjectAssemblyPath));
tests\Aspire.Hosting.TestUtilities\Utils\MSBuildUtils.cs (2)
13while (directory != null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
tests\Shared\DistributedApplicationTestingBuilderExtensions.cs (2)
72var uniqueFolder = Path.Combine(baseDcpLogFolder, folderName); 128_testOutputHelper.WriteLine($"=== DCP Log: {Path.GetFileName(logFile)} ===");
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")))
Aspire.Hosting.Tests (1057)
ApplicationModel\Docker\DockerfileBuildAnnotationTests.cs (18)
71var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 101var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 137var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 177var dockerfilePath = Path.Combine(Path.GetTempPath(), $"Dockerfile.{Guid.NewGuid()}"); 220var dockerfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Dockerfile"); 221var differentCasingDockerfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "DOCKERFILE"); 240var contextPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app"); 241var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "out"); 245var dockerfilePath = Path.Combine(outputPath, "Dockerfile"); 259await File.WriteAllTextAsync(Path.Combine(contextPath, ".dockerignore"), "secrets\n"); 270var contextPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app"); 271var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "out"); 275var dockerfilePath = Path.Combine(outputPath, "Dockerfile"); 277await File.WriteAllTextAsync(Path.Combine(contextPath, ".dockerignore"), "secrets\n");
AspireStoreTests.cs (10)
19Assert.True(Directory.Exists(Path.GetDirectoryName(store.BasePath))); 29Assert.True(Path.IsPathRooted(path)); 36builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath(); 42Assert.DoesNotContain($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}", path); 43Assert.Contains(Path.GetTempPath(), path); 69Assert.Equal(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire"), store.BasePath); 76builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath(); 94var tempFilename = Path.GetTempFileName(); 153builder.Configuration[AspireStore.AspireStorePathKeyName] = Path.GetTempPath();
Backchannel\AppHostBackchannelTests.cs (2)
21await CanConnectToBackchannelAsync(Path.Combine(root.FullName, "custom", "cli.sock")); 55File.GetUnixFileMode(Path.GetDirectoryName(backchannelReadyEvent.SocketPath)!));
Backchannel\AppHostRpcTargetUploadTests.cs (1)
70Assert.NotEqual(expectedFileName, Path.GetFileName(filePath));
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (4)
1714producerUdsPath: Path.Combine(baseDir, $"{pseudoId}.dcp.sock"), 1715consumerUdsPath: Path.Combine(baseDir, $"{pseudoId}.host.sock"), 1716controlUdsPath: Path.Combine(baseDir, $"{pseudoId}.ctrl.sock"), 1717metadataPath: Path.Combine(baseDir, $"{pseudoId}.metadata.json"));
Backchannel\AuxiliaryBackchannelTests.cs (12)
310Assert.True(Path.IsPathRooted(appHostInfo.AppHostPath), $"Expected absolute path but got: {appHostInfo.AppHostPath}"); 334var fileName = Path.GetFileName(service.SocketPath); 337var directory = Path.GetDirectoryName(service.SocketPath); 339Assert.EndsWith(Path.Combine(".aspire", "cli", "bch"), directory); 877var realDirectory = Directory.CreateDirectory(Path.Combine(tempRoot.FullName, "real")); 878var symlinkDirectory = Path.Combine(tempRoot.FullName, "link"); 881var appHostFileViaSymlink = Path.Combine(symlinkDirectory, "apphost.cs"); 889var socketAppHostId = Path.GetFileName(socket.SocketPath)[..BackchannelConstants.CompactAppHostIdLength]; 911var appHostFile = new FileInfo(Path.Combine(tempRoot.FullName, "AppHost.cs")); 913var differentlyCasedPath = Path.Combine(tempRoot.FullName, "APPHOST.CS"); 922var socketAppHostId = Path.GetFileName(socket.SocketPath)[..BackchannelConstants.CompactAppHostIdLength]; 943var appHostFile = Path.Combine(tempRoot.FullName, "apphost.cs");
Backchannel\GetTerminalInfoAsyncTests.cs (6)
339var producer = Path.Combine(baseDir, $"{pseudoId}.dcp.sock"); 340var consumer = Path.Combine(baseDir, $"{pseudoId}.host.sock"); 346: Path.Combine(baseDir, $"{pseudoId}.ctrl.sock"); 347var metadata = Path.Combine(baseDir, $"{pseudoId}.metadata.json"); 393var socketPath = Path.Combine(dir, "ctrl.sock"); 439var dir = Path.GetDirectoryName(SocketPath);
Cli\ProcessStartTimeHelperTests.cs (2)
114var statDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, pid.ToString(CultureInfo.InvariantCulture))); 118File.WriteAllText(Path.Combine(statDirectory.FullName, "stat"), $"{pid} (proc name) {string.Join(' ', fields)}");
Cli\TestingCollectorTests.cs (23)
66Assert.Equal(Path.Combine(builder.Configuration[KnownConfigNames.TestOutputPath]!, "late"), annotation.OutputPath); 207await File.WriteAllTextAsync(Path.Combine(context.OutputPath, "result.txt"), "artifact", context.CancellationToken); 223Assert.Equal("artifact", await File.ReadAllTextAsync(Path.Combine(context.OutputPath, "result.txt"))); 306await File.WriteAllTextAsync(Path.Combine(first.OutputPath!, "result.txt"), "artifact"); 313Path.Combine(context.OutputPath, "result.txt"), context.CancellationToken)); 421Assert.Equal(Path.Combine(context.TestingContext.OutputPath, "tests"), context.OutputPath); 422Assert.Equal(["tests"], Directory.GetDirectories(context.TestingContext.OutputPath).Select(Path.GetFileName)); 760Assert.Equal(Path.Combine(first.TestingContext!.OutputPath, "first"), first.OutputPath); 761Assert.Equal(Path.Combine(second.TestingContext!.OutputPath, "second"), second.OutputPath); 785var runPath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-output"); 787var launcher = Path.Combine(workspace.WorkspaceRoot.FullName, "with-umask"); 799Assert.Equal(Path.Combine(runPath, "tests"), annotation.OutputPath); 852var existingPath = Path.Combine(runPath, existingName); 860File.WriteAllText(Path.Combine(existingPath, "artifact.txt"), "existing"); 866Assert.Equal([existingName], Directory.GetFileSystemEntries(runPath).Select(Path.GetFileName)); 867Assert.Equal("existing", File.ReadAllText(isFile ? existingPath : Path.Combine(existingPath, "artifact.txt"))); 882Directory.CreateSymbolicLink(Path.Combine(runPath, "tests"), target.FullName); 889Assert.Equal(["tests"], Directory.GetFileSystemEntries(runPath).Select(Path.GetFileName)); 909Assert.Equal(name, Path.GetFileName(path)); 910Assert.Equal("test-output", Path.GetFileName(Path.GetDirectoryName(path))); 931Assert.Equal("tests", Path.GetFileName(outputDirectory), ignoreCase: true); 1042var path = Path.Combine(workspace.WorkspaceRoot.FullName, "test-output");
Cli\TestRunCoordinatorEndToEndTests.cs (1)
52await File.WriteAllTextAsync(Path.Combine(runnerOutput.FullName, "tests.cmd"),
Cli\TestRunStreamingTests.cs (2)
148var path = Path.Combine(workspace.WorkspaceRoot.FullName, "test-output"); 175Assert.Equal(Path.Combine(path, "tests"), annotation.OutputPath);
Dashboard\DashboardEventHandlersTests.cs (24)
533var appHostDirectory = Path.Combine(Path.GetTempPath(), "apphost-project"); 538[dataDirectoryKey] = Path.Combine(".", "dashboard-data") 544Path.Combine(appHostDirectory, "dashboard-data"), 551var absoluteDataDirectory = Path.Combine(Path.GetTempPath(), "shared-dashboard-data"); 555["AppHost:Directory"] = Path.Combine(Path.GetTempPath(), "apphost-project"), 743var tempDir = Path.GetTempFileName(); 749var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 750var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 832var tempDir = Path.GetTempFileName(); 838var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard.exe"); 839var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 840var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 901var tempDir = Path.GetTempFileName(); 907var dashboardExe = Path.Combine(tempDir, "Aspire.Dashboard"); 908var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 909var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 970var tempDir = Path.GetTempFileName(); 976var dashboardDll = Path.Combine(tempDir, "Aspire.Dashboard.dll"); 977var runtimeConfig = Path.Combine(tempDir, "Aspire.Dashboard.runtimeconfig.json"); 1041var dashboardExecutable = Path.Combine(tempDir.FullName, executableName); 1070var dashboardDll = Path.Combine(tempDirectory.FullName, "Aspire.Dashboard.dll");
Dashboard\DashboardResourceTests.cs (2)
42var dashboardPath = Path.Combine(dashboardDirectory.FullName, "dashboard"); 720var dashboardPath = Path.GetFullPath("dashboard");
Dashboard\DashboardServiceDataTerminalTests.cs (4)
216producerUdsPath: Path.Combine(baseDir, $"{pseudoId}.dcp.sock"), 217consumerUdsPath: Path.Combine(baseDir, $"{pseudoId}.host.sock"), 218controlUdsPath: Path.Combine(baseDir, $"{pseudoId}.ctrl.sock"), 219metadataPath: Path.Combine(baseDir, $"{pseudoId}.metadata.json"));
Dashboard\DashboardServiceTests.cs (5)
1045Assert.NotEqual(expectedFileName, Path.GetFileName(filePath)); 1708producerUdsPath: Path.Combine(directory.Path, "producer.sock"), 1709consumerUdsPath: Path.Combine(directory.Path, "consumer.sock"), 1710controlUdsPath: Path.Combine(directory.Path, "control.sock"), 1711metadataPath: Path.Combine(directory.Path, "metadata.json"));
Dashboard\InteractionFileUploadStoreTests.cs (4)
26Assert.NotEqual("test.txt", Path.GetFileName(filePath)); 357Assert.NotEqual(expectedLeafName, Path.GetFileName(filePath)); 375Assert.NotEqual(originalFileName, Path.GetFileName(filePath)); 391Assert.NotEmpty(Path.GetFileName(filePath));
Dcp\AppHostLocalStateStoreTests.cs (10)
35Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"), 37Assert.Matches("^[0-9a-f]{16}\\.json$", Path.GetFileName(stateFile)); 43Assert.Equal($"*{Environment.NewLine}", File.ReadAllText(Path.Combine(Path.GetDirectoryName(stateFile)!, ".gitignore"))); 65Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"), 85Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"), 120Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"), 144Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"), 175Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"), 190Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "state"),
Dcp\ConfigureDefaultDcpOptionsTests.cs (10)
243var managedPath = Path.Combine(Path.GetTempPath(), "aspire-fake-bundle", "managed", managedExe); 260var dashboardDll = Path.Combine(Path.GetTempPath(), "fake-dashboard", "Aspire.Dashboard.dll"); 285var managedPath = Path.Combine(Path.GetTempPath(), "aspire-fake-bundle", "managed", managedExe); 286var explicitTerminalHostPath = Path.Combine(Path.GetTempPath(), "custom-terminalhost", "Aspire.TerminalHost.exe"); 308var managedPath = Path.Combine(Path.GetTempPath(), "aspire-fake-bundle", "managed", managedExe);
Dcp\DcpCliArgsTests.cs (11)
93var explicitDcpPath = Path.Combine("explicit", "dcp"); 94var explicitDashboardPath = Path.Combine("explicit", "dashboard"); 96builder.Configuration[BundleDiscovery.DcpPathEnvVar] = Path.Combine("bundle", "dcp"); 97builder.Configuration[BundleDiscovery.DashboardPathEnvVar] = Path.Combine("bundle", "dashboard"); 104Assert.Equal(Path.Combine("explicit", "ext"), dcpOptions.ExtensionsPath); 112var bundleDcpPath = Path.Combine("bundle", "dcp"); 113var bundleDashboardPath = Path.Combine("bundle", "dashboard"); 123Assert.Equal(Path.Combine(bundleDcpPath, "ext"), dcpOptions.ExtensionsPath); 131var bundleDcpPath = Path.Combine("bundle", "dcp"); 132var bundleDashboardPath = Path.Combine("bundle", "dashboard"); 142Assert.Equal(Path.Combine(bundleDcpPath, "ext"), dcpOptions.ExtensionsPath);
Dcp\DcpExecutorTests.cs (29)
69Path.Combine(builder.AppHostDirectory, "application.csproj"))).Resource; 1898["AppHost:Directory"] = Path.Combine(workspace.WorkspaceRoot.FullName, "apphost-file"), 6295var artifactsPath = Path.Combine(Path.GetTempPath(), "aspire-artifacts"); 6332var artifactsPath = Path.Combine(Path.GetTempPath(), "aspire-artifacts"); 6883var expectedCertificatesRoot = Path.Join(aspireStoreDirectory.Path, ".aspire", "dcp", "executables", "TestExecutable-12345678", "certificates"); 6885Assert.Equal(Path.Join(expectedCertificatesRoot, "certs"), sslCertDir); 6886Assert.Equal(Path.Join(expectedCertificatesRoot, "cert.pem"), sslCertFile); 6931var certificatesRoot = Path.Join(aspireStoreDirectory.Path, ".aspire", "dcp", "executables", "TestExecutable-12345678", "certificates"); 6932var bundlesDirectory = Path.Join(certificatesRoot, "bundles"); 6984var sslCertDirs = sslCertDir.Split(Path.PathSeparator); 6985Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]); 6995options.StartInfo.Environment["SSL_CERT_DIR"] = string.Join(Path.PathSeparator, expectedExistingSslCertDirs); 7004var sslCertDirs = sslCertDir.Split(Path.PathSeparator); 7005Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]); 7006Assert.Equal(expectedExistingSslCertDir.Split(Path.PathSeparator), sslCertDirs.Skip(1)); 7007}, string.Join(Path.PathSeparator, expectedExistingSslCertDirs), options).Dispose(); 7021var sslCertDirs = sslCertDir.Split(Path.PathSeparator); 7023Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]); 7040var sslCertDirs = sslCertDir.Split(Path.PathSeparator); 7042Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]); 7054var sslCertDirs = sslCertDir.Split(Path.PathSeparator); 7055Assert.EndsWith($"{Path.DirectorySeparatorChar}certs", sslCertDirs[0]); 8570? Path.GetFullPath(Path.Combine("test-dotnet-root", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet")) 9205var projectPath = Path.Combine("src", "app.cs"); 9251var projectPath = Path.Combine("src", "app.cs"); 13365var aspireStore = new AspireStore(Path.Join(aspireStoreDirectory, ".aspire"), fileSystemService);
Dcp\DcpHostNotificationTests.cs (28)
550var terminalHostPath = Path.Combine(directory.FullName, "aspire-managed.exe"); 552File.WriteAllText(Path.Combine(directory.FullName, "conpty.dll"), ""); 553Directory.CreateDirectory(Path.Combine(directory.FullName, architectureDirectory)); 554File.WriteAllText(Path.Combine(directory.FullName, architectureDirectory, "OpenConsole.exe"), ""); 580var terminalHostPath = Path.Combine(directory.FullName, "aspire-managed.exe"); 582var nativeDirectory = Path.Combine(directory.FullName, "runtimes", runtimeIdentifier, "native"); 583Directory.CreateDirectory(Path.Combine(nativeDirectory, nativeHostDirectory)); 584File.WriteAllText(Path.Combine(nativeDirectory, "conpty.dll"), ""); 585File.WriteAllText(Path.Combine(nativeDirectory, nativeHostDirectory, "OpenConsole.exe"), ""); 610var terminalHostPath = Path.Combine(directory.FullName, "aspire-managed.exe"); 614File.WriteAllText(Path.Combine(directory.FullName, "conpty.dll"), ""); 620Directory.CreateDirectory(Path.Combine(directory.FullName, architectureDirectory)); 621File.WriteAllText(Path.Combine(directory.FullName, architectureDirectory, "OpenConsole.exe"), ""); 837var cliPath = Path.Combine(dcpDir.FullName, OperatingSystem.IsWindows() ? "dcp.cmd" : "dcp"); 899var scriptPath = Path.Combine(directory, "dcp.cmd"); 911var shellScriptPath = Path.Combine(directory, "dcp"); 929var scriptPath = Path.Combine(directory, "dcp.cmd"); 935var shellScriptPath = Path.Combine(directory, "dcp"); 961var scriptPath = Path.Combine(directory, "dcp.cmd"); 966var shellScriptPath = Path.Combine(directory, "dcp"); 1037Path.Combine(Directory.GetCurrentDirectory(), "tests", "Shared", "TestCertificates", "testCert.pfx"), 1038Path.Combine(AppContext.BaseDirectory, "shared", "TestCertificates", "testCert.pfx"), 1039Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "tests", "Shared", "TestCertificates", "testCert.pfx")) 1178var appHostDirectory = Path.Combine(Path.GetTempPath(), "aspire-apphost-test"); 1326var appHostDirectory = Path.Combine(Path.GetTempPath(), "aspire-apphost-test");
Dcp\DcpSocketTests.cs (1)
29var socketPath = Path.Combine(directory, "output.sock");
Dcp\ExecutableLaunchPlanTests.cs (3)
31new ProjectRebuilderResource("rebuilder", parent, Path.Combine(".", "app.csproj")), 305var projectPath = Path.Combine("tmp", "project.csproj"); 316Assert.Equal(Path.GetDirectoryName(projectPath), plan.WorkingDirectory);
Dcp\ProcessCaptureTests.cs (1)
121var missing = Path.Combine(workspace.Path, "missing-executable");
Dcp\ProcessUtilTests.cs (2)
157var dotnetDirectory = Path.GetDirectoryName(dotnetPath); 158var dotnetExecutableName = Path.GetFileName(dotnetPath);
DebugSupportExtensionsTests.cs (2)
377var appPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs"); 393var appPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs");
DistributedApplicationBuilderTests.cs (53)
126Path.Combine(projectDirectory, "appsettings.json"), 142Path.Combine(projectDirectory, "appsettings.PolyglotTest.json"), 155AppHostFilePath = Path.Combine(projectDirectory, "apphost.mts") 172Path.Combine(projectDirectory, "appsettings.json"), 186AppHostFilePath = Path.Combine(projectDirectory, "apphost.mts") 213var projectPath = Path.Combine(projectDirectory, "api", "Api.csproj"); 214Directory.CreateDirectory(Path.GetDirectoryName(projectPath)!); 220AppHostFilePath = Path.Combine(projectDirectory, "apphost.mts") 284Assert.Equal(Path.Combine(projectDirectory, "aspire-output"), outputService.GetOutputDirectory()); 296Assert.Equal(Path.GetFullPath(outputPath), outputService.GetOutputDirectory()); 307Assert.Equal(Path.Combine(Environment.CurrentDirectory, "aspire-output"), outputService.GetOutputDirectory()); 597var unrelatedFile = Path.Combine(tempDirectory.FullName, "unrelated.json"); 621var secretsFile = Path.Combine(tempDirectory.FullName, "Production.json"); 710var path = Path.Combine(directory.FullName, "state.json"); 763var legacyPath = Path.Combine(directory.FullName, "legacy.json"); 764var aspirePath = Path.Combine(directory.FullName, "Development.json"); 813var secretsFile = Path.Combine(tempDirectory.FullName, "Production.json"); 844var secretsFile = Path.Combine(tempDirectory.FullName, "Production.json"); 885var directory = Path.GetDirectoryName(userSecretsPath); 1039var appHostPath = Path.Combine(projectDirectory.FullName, "apphost.ts"); 1052AppHostFilePath = Path.Combine(projectDirectory.FullName, "AppHost.ts"), 1088var appHostPath = Path.Combine(realDirectory.FullName, "apphost.ts"); 1091var symlinkDirectory = Path.Combine(projectDirectory.FullName, "link"); 1093var appHostPathViaSymlink = Path.Combine(symlinkDirectory, "apphost.ts"); 1104var previousIdentityPath = PathNormalizer.ResolvePathCasing(Path.GetFullPath(appHostPathViaSymlink)); 1121var legacyAppHostPath = Path.GetFullPath(Path.Join(projectDirectory.FullName, projectName)); 1124var legacyDirectory = Path.Combine( 1129var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json"); 1141AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"), 1146canonicalDirectory = Path.Combine( 1189AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"), 1214AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"), 1220var deploymentsDirectory = Path.Combine( 1224var currentDirectory = Path.Combine(deploymentsDirectory, currentSha); 1225var legacyDirectory = Path.Combine(deploymentsDirectory, legacySha); 1226var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json"); 1227var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json"); 1273AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"), 1279var deploymentsDirectory = Path.Combine( 1283var currentDirectory = Path.Combine(deploymentsDirectory, currentSha); 1284var legacyDirectory = Path.Combine(deploymentsDirectory, legacySha); 1285var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json"); 1286var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json"); 1337AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"), 1343var deploymentsDirectory = Path.Combine( 1347var currentDirectory = Path.Combine(deploymentsDirectory, currentSha); 1348var legacyDirectory = Path.Combine(deploymentsDirectory, legacySha); 1349var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json"); 1350var legacyStatePath = Path.Combine(legacyDirectory, $"{environment}.json"); 1399AppHostFilePath = Path.Combine(projectDirectory.FullName, "apphost.ts"), 1404var currentDirectory = Path.Combine( 1409var currentStatePath = Path.Combine(currentDirectory, $"{environment}.json");
DistributedApplicationOptionsTests.cs (4)
84var expectedPath = Path.GetFullPath(Path.Join(projectDirectory, "CustomName")); 128var expectedPath = Path.GetFullPath(Path.Join(projectDirectory, "ExplicitlySetName"));
DistributedApplicationTests.cs (2)
1613var sourcePath = Path.GetFullPath("/etc/path-here"); 1659Assert.True(Path.IsPathRooted(redisContainer.Spec.VolumeMounts[0].Source));
DotnetProgramPublishingTests.cs (10)
143var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"); 322resource.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"))) 328context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 380.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "local.csproj"))); 382.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "archive.csproj"))) 386context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archive.tar"); 440var metadata = new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj")); 494var path = Path.Combine(workspace.WorkspaceRoot.FullName, name); 497path += Path.DirectorySeparatorChar; 513var path = Path.Combine(workspace.WorkspaceRoot.FullName, name);
ExecutableResourceBuilderExtensionTests.cs (2)
39var expectedPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory)); 66var expectedPath = PathNormalizer.NormalizePathForCurrentPlatform(Path.Combine(builder.AppHostDirectory, workingDirectory));
FileSystemServiceTests.cs (2)
124var parentDir = Path.GetDirectoryName(filePath); 390var parentDir = Path.GetDirectoryName(filePath)!;
ManifestExpressionTests.cs (1)
727Path.Combine(builder.AppHostDirectory, "manifest.json"), writer, cts.Token);
ManifestGenerationTests.cs (4)
704var manifestPath = Path.Combine(Path.GetTempPath(), "tempmanifests", Guid.NewGuid().ToString(), "manifest.json"); 710var manifestPath = Path.Combine(Path.GetTempPath(), "tempmanifests", Guid.NewGuid().ToString(), "manifest.json");
MSBuildTests.cs (131)
25File.WriteAllText(Path.Combine(directory, "Consumer.cs"), """ 54using var diagnostics = JsonDocument.Parse(File.ReadAllText(Path.Combine(directory, "diagnostics.sarif"))); 75File.WriteAllText(Path.Combine(directory, "Consumer.cs"), """ 114var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 117File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 146File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 171var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 174File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 202File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 212var metadataDirectory = Path.Combine(appHostDirectory, "obj", "Debug", "net10.0", "Aspire", "references"); 213var appHostMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "_AppHost.ProjectMetadata.g.cs")); 214var appMetadata = await File.ReadAllTextAsync(Path.Combine(metadataDirectory, "App.ProjectMetadata.g.cs")); 227.Replace(Path.DirectorySeparatorChar, '/'); 242File.WriteAllText(Path.Combine(directory, "Consumer.csproj"), $""" 269File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"), 283File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"), 299var libraryDirectory = Path.Combine(basePath, name); 302File.WriteAllText(Path.Combine(libraryDirectory, $"{name}.csproj"), 314File.WriteAllText(Path.Combine(libraryDirectory, "Class1.cs"), 326var appDirectory = Path.Combine(basePath, name); 329File.WriteAllText(Path.Combine(appDirectory, $"{name}.csproj"), 340File.WriteAllText(Path.Combine(appDirectory, "Program.cs"), 371var workingDirectory = Path.GetDirectoryName(projectFile); 457var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 459var artifactsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".artifacts"); 462File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 520var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Plain.AppHost.csproj"); 560var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 572var layoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "layout"); 584var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 596var layoutRoot = Path.Combine(workspace.WorkspaceRoot.FullName, "layout"); 608var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 631var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 643var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "bin")); 645var bundle = CreateFakeCliBundle(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home")); 655var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 667var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"); 668var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli")); 680var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 681var bundleRoot = Path.Combine(workspace.WorkspaceRoot.FullName, BundleDiscovery.BundleDirectoryName); 682var expectedDcpDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, "dcp")); 683var expectedDashboardDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DashboardDirectoryName)); 686Assert.Equal(Path.Combine(expectedDashboardDir, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"), resolvedPaths[2]); 687Assert.False(Directory.Exists(Path.Combine(aspireHome, BundleDiscovery.BundleDirectoryName))); 696var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"); 697var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli")); 715Assert.False(Directory.Exists(Path.Combine(aspireHome, BundleDiscovery.BundleDirectoryName))); 716Assert.False(Directory.Exists(Path.Combine(workspace.WorkspaceRoot.FullName, BundleDiscovery.BundleDirectoryName))); 725var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"); 726var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli")); 755var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"); 756var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli")); 785var aspireHome = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"); 787var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, literalSegment)); 804var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 805var bundleRoot = Path.Combine(workspace.WorkspaceRoot.FullName, BundleDiscovery.BundleDirectoryName); 806Assert.Equal(EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DcpDirectoryName)), resolvedPaths[0]); 807Assert.Equal(EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DashboardDirectoryName)), resolvedPaths[1]); 819var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, literalSegment)); 832["ASPIRE_HOME"] = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"), 847var bundle = CreateFakeCliBundle(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire-home")); 858var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 870var toolsDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, ".dotnet", "tools")); 872var nativeCliDirectory = Directory.CreateDirectory(Path.Combine( 883File.WriteAllText(Path.Combine(nativeCliDirectory.FullName, ".aspire-install.json"), """{"source":"dotnet-tool"}"""); 894var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 907var repoDcpDir = EnsureTrailingSeparator(Path.Combine(workspace.WorkspaceRoot.FullName, "repo-dcp")); 908var repoDashboardDir = EnsureTrailingSeparator(Path.Combine(workspace.WorkspaceRoot.FullName, "repo-dashboard")); 923var resolvedPaths = await File.ReadAllLinesAsync(Path.Combine(appHostDirectory, "obj", "resolved-aspire-paths.txt")); 926Assert.Contains(Path.Combine(repoDashboardDir, "Aspire.Dashboard"), resolvedPaths[2]); 935var missingBundlePath = Path.Combine(workspace.WorkspaceRoot.FullName, "missing-bundle"); 973var fakeCliDirectory = Directory.CreateDirectory(Path.Combine(workspace.WorkspaceRoot.FullName, "fake-cli")); 974var dnxPath = Path.Combine(fakeCliDirectory.FullName, OperatingSystem.IsWindows() ? "dnx.exe" : "dnx"); 979File.Copy(Path.Combine(Environment.SystemDirectory, "where.exe"), dnxPath); 991["ASPIRE_HOME"] = Path.Combine(workspace.WorkspaceRoot.FullName, "empty-aspire-home"), 1010var missingCliPath = Path.Combine(workspace.WorkspaceRoot.FullName, "missing-aspire"); 1032var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 1034File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.fsproj"), 1055var property = await File.ReadAllTextAsync(Path.Combine(appHostDirectory, "obj", "aspire-use-cli-bundle.txt")); 1079var metadataPath = Path.Combine(appHostDirectory, "obj", "Debug", "net10.0", "Aspire", "references", "App.ProjectMetadata.g.cs"); 1092var appHostDirectory = Path.Combine(basePath, "AppHost"); 1095File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 1133File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 1150File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"), 1160File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"), 1175return CreateFakeCliBundleAtLayoutRoot(Path.Combine(basePath, "layout")); 1180return CreateFakeCliBundleRoot(layoutRoot, Path.Combine(layoutRoot, "bundle")); 1185return CreateFakeCliBundleRoot(layoutRoot, Path.Combine(layoutRoot, "versions", versionId)); 1190var dcpDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, "dcp")); 1191var managedDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, "managed")); 1192var dashboardDir = EnsureTrailingSeparator(Path.Combine(bundleRoot, BundleDiscovery.DashboardDirectoryName)); 1197File.WriteAllText(Path.Combine(dcpDir, OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), ""); 1198var managedPath = Path.Combine(managedDir, OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"); 1200var dashboardPath = Path.Combine(dashboardDir, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"); 1208var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.exe" : "aspire"); 1215var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1253var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1279var cliPath = Path.Combine(directory, OperatingSystem.IsWindows() ? "aspire.cmd" : "aspire"); 1305return path.EndsWith(Path.DirectorySeparatorChar) ? path : path + Path.DirectorySeparatorChar; 1311var dotnetDirectory = Path.GetDirectoryName(dotnetPath); 1322.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 1325return string.Join(Path.PathSeparator, pathDirectories.Prepend(firstDirectory)); 1334return executableNames.Any(executableName => File.Exists(Path.Combine(directory.Trim().Trim('"'), executableName))); 1349var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 1352File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 1381File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 1408var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 1411File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 1440File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"), 1461var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "MyHostingExtension"); 1464File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"), 1481File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"), 1510var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "MyHostingExtension"); 1513File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"), 1530File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"), 1559var packageOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "packages"); 1563Path.Combine(repoRoot, "src", "Aspire.Hosting.Integration.Analyzers", "Aspire.Hosting.Integration.Analyzers.csproj"), 1586var packageOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "packages"); 1590Path.Combine(repoRoot, "src", "Aspire.Hosting.Blazor", "Aspire.Hosting.Blazor.csproj"), 1632var packageOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "packages"); 1636Path.Combine(repoRoot, "src", "Aspire.Hosting.Integration.Analyzers", "Aspire.Hosting.Integration.Analyzers.csproj"), 1642var projectDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "MyHostingExtension"); 1644var nuGetConfigPath = Path.Combine(projectDirectory, "NuGet.config"); 1688File.WriteAllText(Path.Combine(projectDirectory, "MyHostingExtension.csproj"), 1711File.WriteAllText(Path.Combine(projectDirectory, "Extensions.cs"), 1738File.WriteAllText(Path.Combine(basePath, "Directory.Build.props"), 1750File.WriteAllText(Path.Combine(basePath, "Directory.Build.targets"), 1775var appHostDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost"); 1778File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.csproj"), 1806File.WriteAllText(Path.Combine(appHostDirectory, "AppHost.cs"),
Orchestrator\ParameterProcessorTests.cs (1)
1968return factory.GetOrCreate(Path.Combine(directory.FullName, "secrets.json"));
PathLookupHelperTests.cs (56)
13var binPath = Path.Combine(workspace.WorkspaceRoot.FullName, "bin"); 17var executablePath = Path.Combine(binPath, executableName); 47var firstBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "first-bin"); 48var secondBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "second-bin"); 52var nonExecutablePath = Path.Combine(firstBinPath, "mycommand"); 56var executablePath = Path.Combine(secondBinPath, "mycommand"); 62new Dictionary<string, string> { ["PATH"] = string.Join(Path.PathSeparator, firstBinPath, secondBinPath) }); 74var binPath = Path.Combine(workspace.WorkspaceRoot.FullName, "bin"); 76File.WriteAllText(Path.Combine(binPath, "mycommand"), string.Empty); 94var binPath = Path.Combine(workspace.WorkspaceRoot.FullName, "bin"); 96File.WriteAllText(Path.Combine(binPath, "mycommand.exe"), string.Empty); 111Path.Combine("/usr/bin", "mycommand") 118Assert.Equal(Path.Combine("/usr/bin", "mycommand"), result); 166Path.Combine("/first/path", "mycommand"), 167Path.Combine("/second/path", "mycommand") 174Assert.Equal(Path.Combine("/first/path", "mycommand"), result); 180var firstPath = Path.Combine("/first/path", "mycommand"); 181var secondPath = Path.Combine("/second/path", "mycommand"); 212var firstBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "first-bin"); 213var secondBinPath = Path.Combine(workspace.WorkspaceRoot.FullName, "second-bin"); 217var nonExecutablePath = Path.Combine(firstBinPath, "mycommand"); 221var executablePath = Path.Combine(secondBinPath, "mycommand"); 243string.Join(Path.PathSeparator, firstBinPath, secondBinPath), 244Path.PathSeparator, 254var firstExePath = Path.Combine("first", "bin", "code.EXE"); 255var firstCmdPath = Path.Combine("first", "bin", "code.CMD"); 256var secondCmdPath = Path.Combine("second", "bin", "code.CMD"); 264var path = string.Join(';', Path.Combine("first", "bin"), Path.Combine("second", "bin")); 275var dir = Path.Combine("testdir", "bin"); 276var expectedPath = Path.Combine(dir, "mycommand"); 293var dir = Path.Combine("testdir", "bin"); 294var expectedPath = Path.Combine(dir, "code.CMD"); 312var dir = Path.Combine("testdir", "bin"); 313var exePath = Path.Combine(dir, "code.EXE"); 314var cmdPath = Path.Combine(dir, "code.CMD"); 336var dir = Path.Combine("testdir", "bin"); 337var exactPath = Path.Combine(dir, "code"); 338var cmdPath = Path.Combine(dir, "code.CMD"); 357var dir = Path.Combine("testdir", "bin"); 358var exactPath = Path.Combine(dir, "mytool"); 376var dir = Path.Combine("testdir", "bin"); 377var expectedPath = Path.Combine(dir, "code.CMD"); 395var dir = Path.Combine("testdir", "bin"); 410var dir = Path.Combine("testdir", "bin"); 411var cmdPath = Path.Combine(dir, "code.CMD"); 433Path.Combine(dir, "code.cmd") 450Path.Combine(dir, "code.cmd") 467var dir1 = Path.Combine("first", "bin"); 468var dir2 = Path.Combine("second", "bin"); 469var dir1CmdPath = Path.Combine(dir1, "code.CMD"); 470var dir2ExePath = Path.Combine(dir2, "code.EXE"); 489var dir1 = Path.Combine("first", "bin"); 490var dir2 = Path.Combine("second", "bin"); 491var dir1ExactPath = Path.Combine(dir1, "mytool"); 492var dir2ExePath = Path.Combine(dir2, "mytool.EXE");
Pipelines\DistributedApplicationPipelineTests.cs (1)
52Assert.StartsWith(_aspireHome.FullName + Path.DirectorySeparatorChar, statePath);
Pipelines\PipelineOutputChangeTests.cs (2)
37var path = Path.GetFullPath("deployment.yaml"); 38Assert.True(Path.IsPathRooted(path));
Pipelines\PipelineOutputComparisonTests.cs (12)
22var added = Path.Combine(root, "added.txt"); 23var changed = Path.Combine(root, "changed.txt"); 24var removed = Path.Combine(root, "removed.txt"); 25var unchanged = Path.Combine(root, "unchanged.txt"); 60var path = Path.Combine(root, "artifact.txt"); 88var path = Path.Combine(root, "artifact.txt"); 113var root = rootExists ? parent : Path.Combine(parent, "missing"); 116File.WriteAllText(Path.Combine(root, "artifact.txt"), "content"); 141var path = Path.Combine(root, "artifact.txt"); 163var root = Directory.CreateDirectory(Path.Combine(parent, "nested")).FullName; 164var path = Path.Combine(root, "artifact.txt"); 181Assert.Equal(Path.Combine("nested", "artifact.txt"), reverse.Path);
Pipelines\PipelineOutputDiffingTests.cs (67)
92var artifact = Path.Combine(generated, "deployment.yaml"); 136Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.Combine("generated", "deployment.yaml"), failure.Message); 166var artifact = Path.Combine(workspace.Path, "artifact.bin"); 167var control = Path.Combine(workspace.Path, "control.bin"); 222var artifact = Path.Combine(workspace.Path, "early.txt"); 250var artifact = Path.Combine(workspace.Path, "factory.txt"); 328var artifact = Path.Combine(workspace.Path, "late.txt"); 372var artifact = Path.Combine(workspace.Path, "ordinary.txt"); 388var artifact = Path.Combine(workspace.Path, "tracked.tmp"); 389await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "**/bin/\n**/obj/\n*.tmp\n", TestContext.Current.CancellationToken); 392await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 401Assert.False(Directory.Exists(Path.Combine(workspace.Path, "src", "Api", "bin"))); 402Assert.False(Directory.Exists(Path.Combine(workspace.Path, "src", "Api", "obj"))); 405await File.WriteAllTextAsync(Path.Combine(binaryDirectory.FullName, "Api.dll"), "build output", TestContext.Current.CancellationToken); 406await File.WriteAllTextAsync(Path.Combine(objectDirectory.FullName, "project.assets.json"), "{}", TestContext.Current.CancellationToken); 413Assert.False(Directory.Exists(Path.Combine(workspace.Path, "src"))); 418Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 426Assert.True(File.Exists(Path.Combine(workspace.Path, "src", "Api", "bin", "Release", "Api.dll"))); 427Assert.True(File.Exists(Path.Combine(workspace.Path, "src", "Api", "obj", "project.assets.json"))); 437var source = Path.Combine(sourceDirectory, "Program.cs"); 438var artifact = Path.Combine(workspace.CreateDirectory("generated").FullName, "deployment.yaml"); 443await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "**/bin/\n**/obj/\n", TestContext.Current.CancellationToken); 445await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 454Assert.False(Directory.Exists(Path.Combine(sourceDirectory, "bin"))); 455Assert.False(Directory.Exists(Path.Combine(sourceDirectory, "obj"))); 466Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 476Assert.False(Directory.Exists(Path.Combine(sourceDirectory, "bin"))); 477Assert.False(Directory.Exists(Path.Combine(sourceDirectory, "obj"))); 490var source = Path.Combine(workspace.CreateDirectory("src").FullName, "Program.cs"); 492var artifact = Path.Combine(generated, "deployment.yaml"); 493var temporary = Path.Combine(generated, "cache.tmp"); 547Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 566var artifact = Path.Combine(workspace.CreateDirectory("generated").FullName, "deployment.yaml"); 568await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "generated/\n", TestContext.Current.CancellationToken); 570await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 592Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 604var artifact = Path.Combine(workspace.CreateDirectory("generated").FullName, "deployment.yaml"); 608await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitattributes"), "*.yaml text eol=lf\n", TestContext.Current.CancellationToken); 609await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "generated/\n", TestContext.Current.CancellationToken); 613await PipelineOutputGitTestHelper.RunAsync(workspace.Path, "config", "core.excludesFile", Path.Combine(workspace.Path, ".git", "info", "exclude")); 632Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 643var artifact = Path.Combine(workspace.Path, "stable.txt"); 658Assert.False(Directory.Exists(Path.Combine(workspace.Path, ".git"))); 662Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.Message); 673var artifact = Path.Combine(external, "artifact.txt"); 696var changed = Path.Combine(workspace.Path, "changed.txt"); 697var removed = Path.Combine(workspace.Path, "removed.txt"); 698var added = Path.Combine(workspace.Path, "added.txt"); 718Added: {Path.GetRelativePath(workspace.Path, added)} 719Changed: {Path.GetRelativePath(workspace.Path, changed)} 720Removed: {Path.GetRelativePath(workspace.Path, removed)} 733var artifact = Path.Combine(workspace.Path, "unchanged.txt"); 752Assert.Contains("Changed: " + Path.GetRelativePath(workspace.Path, artifact), failure.ToString()); 774var artifact = Path.Combine(workspace.Path, "stable.txt"); 836var artifact = Path.Combine(workspace.Path, "result.txt"); 867var artifact = Path.Combine(workspace.Path, "custom.txt"); 891var artifact = Path.Combine(workspace.Path, "cancelled.txt"); 918var included = Path.Combine(workspace.Path, "included.txt"); 919var excluded = Path.Combine(workspace.Path, "excluded.tmp"); 958Assert.Equal("Pipeline output changed:" + Environment.NewLine + " Removed: " + Path.GetRelativePath(workspace.Path, included), failure.Message); 967var artifact = Path.Combine(workspace.Path, "tracked.txt"); 968var added = Path.Combine(workspace.Path, "untracked.txt"); 969var excluded = Path.Combine(workspace.Path, "excluded.tmp"); 991Changed: {Path.GetRelativePath(workspace.Path, artifact)} 992Added: {Path.GetRelativePath(workspace.Path, added)} 1005var artifact = Path.Combine(workspace.Path, "stable.txt"); 1189? [new(PipelineOutputChangeKind.Changed, Path.GetFileName(snapshotter.Artifact))] : []);
Pipelines\PipelineOutputGitFingerprintTests.cs (56)
33File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt " + attributes + "\n"); 35var path = Path.Combine(root, "model.txt"); 38var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 51Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 57Assert.Equal(Path.GetRelativePath(root, path), change.Path); 73File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "output*/**/*.txt filter=stripspace -text\n"); 77var path = Path.Combine(root, "model café name.txt"); 149var path = Path.Combine(root, "model.txt"); 157var indexPath = Path.Combine(workspace.Path, ".git", "index"); 177Assert.Equal(Path.GetRelativePath(root, path), change.Path); 204File.WriteAllText(Path.Combine(root, "model.txt"), "same content\n"); 208var indexPath = Path.Combine(workspace.Path, ".git", "index"); 235File.WriteAllText(Path.Combine(first, "model.txt"), "same content\n"); 236File.WriteAllText(Path.Combine(second, "model.txt"), "same content\n"); 237var link = Path.Combine(root, "link"); 242var indexPath = Path.Combine(workspace.Path, ".git", "index"); 281await PipelineOutputGitTestHelper.RunAsync(directory, "config", "core.excludesFile", Path.Combine(directory, ".git", "info", "exclude")); 295var target = Path.Combine(workspace.Path, "target.txt"); 297var link = Path.Combine(root, "link"); 301File.WriteAllText(Path.Combine(target, "content.txt"), "target content must not be hashed"); 318var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 323Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 329var contentPath = directoryLink ? Path.Combine(target, "content.txt") : target; 333var other = directoryLink ? workspace.CreateDirectory("other-target").FullName : Path.Combine(workspace.Path, "other-target.txt"); 334File.WriteAllText(directoryLink ? Path.Combine(other, "content.txt") : other, File.ReadAllText(contentPath)); 335Assert.Equal(File.ReadAllText(contentPath), File.ReadAllText(directoryLink ? Path.Combine(other, "content.txt") : other)); 352Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 364var path = Path.Combine(root, "model.txt"); 372var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 384Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 394var path = Path.Combine(root, "model.txt"); 400Assert.True(File.GetLastWriteTimeUtc(path) < File.GetLastWriteTimeUtc(Path.Combine(workspace.Path, ".git", "index"))); 401File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=reject\n"); 407var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 415Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 428File.WriteAllText(Path.Combine(root, $"model {i:D2} ü.txt"), $"content {i}\n"); 430var clean = Path.Combine(root, "clean.keep"); 434Assert.True(File.GetLastWriteTimeUtc(clean) < File.GetLastWriteTimeUtc(Path.Combine(workspace.Path, ".git", "index"))); 435var log = Path.Combine(workspace.Path, "filter-pids"); 436File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=record\n*.keep filter=reject\n"); 473var path = Path.Combine(root, "model.txt"); 491var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 500index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 514Assert.Equal(Path.GetRelativePath(root, path), change.Path); 515Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 529var target = Path.Combine(workspace.Path, "target.txt"); 531var path = Path.Combine(root, "model.txt"); 545var index = File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index")); 564Assert.Equal(Path.GetRelativePath(root, path), change.Path); 565Assert.Equal(index, File.ReadAllBytes(Path.Combine(workspace.Path, ".git", "index"))); 575var path = Path.Combine(root, "model.txt"); 588Assert.True(string.Equals(Path.GetRelativePath(requested, path), change.Path, PipelineOutputRoot.PathComparison)); 597File.WriteAllText(Path.Combine(root, "model.txt"), "untracked content\n"); 601File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=reject\n"); 611Directory.EnumerateFiles(Path.Combine(directory, ".git", "objects"), "*", SearchOption.AllDirectories) 612.ToDictionary(path => Path.GetRelativePath(directory, path), File.ReadAllBytes);
Pipelines\PipelineOutputGitTestHelper.cs (2)
34process.StartInfo.Environment["GIT_DIR"] = Path.Combine(directory, ".git"); 36process.StartInfo.Environment["GIT_INDEX_FILE"] = Path.Combine(directory, ".git", "index");
Pipelines\PipelineOutputResolutionTests.cs (5)
24var artifact = Path.Combine(workspace.Path, "artifact.txt"); 113var artifact = Path.Combine(root, "artifact.txt"); 119var administration = Path.Combine(workspace.Path, ".git"); 130Directory.Move(administration, Path.Combine(workspace.Path, "saved-git")); 245await File.ReadAllTextAsync(Path.Combine(outputDirectory, "artifact.txt"), ct));
Pipelines\PipelineOutputSelectionTests.cs (41)
28await File.WriteAllTextAsync(Path.Combine(root, ".gitignore"), "src/Ev2OutputRoot/**\n", TestContext.Current.CancellationToken); 62await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 64var artifact = Path.Combine(root, "artifacts", "model.json"); 88Assert.Equal(Path.GetRelativePath(root, artifact), change.Path); 125Assert.True(File.Exists(Path.Combine(workspace.Path, ".git", "HEAD"))); 168var child = Path.GetDirectoryName(tracked)!; 198var link = Path.Combine(root, "ignored"); 210Assert.Equal(File.ReadAllText(fileLink ? first : Path.Combine(first, "model.json")), 211File.ReadAllText(fileLink ? second : Path.Combine(second, "model.json"))); 276await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 292Assert.Equal(Path.GetRelativePath(root, artifact), change.Path); 307await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 314Assert.Equal(Path.GetRelativePath(root, artifact), change.Path); 367await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/**\n", TestContext.Current.CancellationToken); 368var root = Path.Combine(workspace.Path, "output", "new"); 377Assert.True(File.Exists(Path.Combine(root, "ignored.bin"))); 399Directory.Move(Path.Combine(workspace.Path, ".git"), Path.Combine(workspace.Path, "saved-git")); 400Assert.False(Directory.Exists(Path.Combine(workspace.Path, ".git"))); 527var link = Path.Combine(root, "link"); 537var expected = pattern == "**/*" ? new[] { Path.Combine(root, "artifact.txt"), link } : 568var expected = new List<string> { Path.Combine(root, ".gitignore") }; 632var git = Assert.IsType<GitPipelineOutputReader>(await GitPipelineOutputReader.TryCreateAsync(Path.Combine(root, "nested"), new DefaultProcessRunner(), TestContext.Current.CancellationToken)); 647var link = Path.Combine(root, "link"); 661Assert.Equal(Path.GetRelativePath(root, link), change.Path); 690change => { Assert.Equal(PipelineOutputChangeKind.Added, change.Kind); Assert.Equal(Path.GetRelativePath(root, original), change.Path); }, 691change => { Assert.Equal(PipelineOutputChangeKind.Removed, change.Kind); Assert.Equal(Path.GetRelativePath(root, tracked), change.Path); }); 706await File.WriteAllTextAsync(Path.Combine(workspace.Path, ".gitignore"), "output/*.tmp\noutput/ignored/\n", TestContext.Current.CancellationToken); 718Assert.NotEmpty(Directory.GetFiles(Path.Combine(workspace.Path, ".git"), "sharedindex.*")); 730"-c", "core.hooksPath=" + Path.Combine(workspace.Path, ".git", "no-hooks"), 733Assert.False(Directory.Exists(Path.Combine(workspace.Path, "excluded"))); 764Assert.Equal(new[] { tracked, direct }.Select(path => Path.GetRelativePath(root, path)).Order(PipelineOutputRoot.PathComparer), changes.Select(change => change.Path)); 784"-c", "core.hooksPath=" + Path.Combine(workspace.Path, ".git", "no-hooks"), 802var added = Path.Combine(cache, "new.tmp"); 841File.WriteAllText(Path.Combine(nested, ".git"), "not a repository"); 868Assert.Equal(Path.GetRelativePath(root, artifact), change.Path); 883Assert.False(File.Exists(Path.Combine(nested, ".git"))); 909await PipelineOutputGitTestHelper.RunAsync(directory, "config", "core.excludesFile", Path.Combine(directory, ".git", "info", "exclude")); 914var path = Path.Combine(root, relative.Replace('/', Path.DirectorySeparatorChar)); 915Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Pipelines\PipelineOutputSnapshotterTests.cs (38)
22var added = Path.Combine(root, "added.txt"); 39change => AssertChange(change, PipelineOutputChangeKind.Added, Path.GetRelativePath(root, added)), 40change => AssertChange(change, PipelineOutputChangeKind.Changed, Path.GetRelativePath(root, changed)), 41change => AssertChange(change, PipelineOutputChangeKind.Removed, Path.GetRelativePath(root, removed))); 48var path = Path.Combine(root, "large.bin"); 62AssertChange(Assert.Single(DefaultPipelineOutputComparer.Compare(before, after, root)), PipelineOutputChangeKind.Changed, Path.GetRelativePath(root, path)); 73var nested = Directory.CreateDirectory(Path.Combine(root, "nested")).FullName; 79File.WriteAllBytes(Path.Combine(index % 2 == 0 ? root : nested, $"{index:D2}.bin"), bytes); 222var missing = Path.Combine(root, "missing.txt"); 239var missing = Path.Combine(root, "missing"); 257var lower = Path.Combine(parent, "output"); 258var upper = Path.Combine(parent, "OUTPUT"); 278change => AssertChange(change, PipelineOutputChangeKind.Added, Path.GetRelativePath(parent, upperFile)), 279change => AssertChange(change, PipelineOutputChangeKind.Removed, Path.GetRelativePath(parent, lowerFile))); 314AssertChange(Assert.Single(DefaultPipelineOutputComparer.Compare(before, after, root)), PipelineOutputChangeKind.Changed, Path.GetRelativePath(root, first)); 469var target = Directory.CreateDirectory(Path.Combine(parent, "target")).FullName; 470var root = Directory.CreateDirectory(Path.Combine(parent, "output")).FullName; 471var link = Path.Combine(root, "link"); 489AssertChange(Assert.Single(DefaultPipelineOutputComparer.Compare(before, cyclic, root)), PipelineOutputChangeKind.Changed, Path.GetRelativePath(root, link)); 499var root = Directory.CreateDirectory(Path.Combine(parent, "output")).FullName; 500var target = Path.Combine(parent, "target.txt"); 505var link = Path.Combine(root, "link"); 521AssertChange(Assert.Single(DefaultPipelineOutputComparer.Compare(before, regularFile, root)), PipelineOutputChangeKind.Changed, Path.GetRelativePath(root, link)); 533var path = Path.Combine(root, "artifact.txt"); 560var directoryLink = Path.Combine(root, "directory-link"); 563var fileLink = Path.Combine(root, "file-link"); 564var missingTarget = Path.Combine(workspace.Path, "missing.txt"); 612var target = Path.Combine(root, "missing-target.txt"); 613var link = Path.Combine(root, "link"); 643var path = Path.Combine(directory, relativePath.Replace('/', Path.DirectorySeparatorChar)); 644Assert.True(Path.IsPathFullyQualified(path)); 652Assert.False(Path.IsPathFullyQualified(".")); 660var root = Path.GetPathRoot(CreateDirectory())!; 661Assert.True(Path.EndsInDirectorySeparator(root)); 683var path = Path.GetFullPath(Path.Combine(directory, relativePath)); 684Directory.CreateDirectory(Path.GetDirectoryName(path)!);
Pipelines\PipelineOutputStrategyTests.cs (28)
23var path = Path.Combine(workspace.Path, "artifact.txt"); 41var artifact = Path.Combine(workspace.Path, "artifact.txt"); 43var metadata = Path.Combine(workspace.Path, metadataPath.Replace('/', Path.DirectorySeparatorChar)); 44Directory.CreateDirectory(Path.GetDirectoryName(metadata)!); 92var path = Path.Combine(workspace.Path, "artifact.txt"); 112var missing = Path.Combine(workspace.Path, "missing"); 129var directory = Path.Combine(workspace.Path, "missing"); 138var path = Path.Combine(directory, "artifact.txt"); 143Assert.Equal(Path.GetRelativePath(directory, path), change.Path); 191var path = Path.Combine(workspace.Path, "bad" + delimiter + "name.txt"); 208var target = directoryLink ? workspace.CreateDirectory("target").FullName : Path.Combine(workspace.Path, "target.txt"); 213var path = Path.Combine(root, "link"); 267var path = Path.Combine(workspace.Path, gitPath.Replace('/', Path.DirectorySeparatorChar)); 268Directory.CreateDirectory(Path.GetDirectoryName(path)!); 289var path = Path.Combine(directory, "artifact.txt"); 455var fileHashes = await git.HashFilesAsync([new FileInfo(Path.Combine(workspace.Path, "artifact.txt"))], TestContext.Current.CancellationToken); 491await git.HashFilesAsync([new FileInfo(Path.Combine(workspace.Path, "artifact.txt"))], TestContext.Current.CancellationToken); 540var first = Path.Combine(workspace.Path, "first.txt"); 541var second = Path.Combine(workspace.Path, "second.txt"); 574var path = Path.Combine(child, "model.txt"); 577File.WriteAllText(Path.Combine(workspace.Path, ".gitignore"), "output/ignored-child*\n"); 580var external = Path.Combine(target, "model.txt"); 609Assert.Equal(Path.Combine("ignored-child", "model.txt"), change.Path); 632var path = Path.Combine(root, "model.txt"); 634File.WriteAllText(Path.Combine(root, "clean.txt"), "clean\n"); 638File.WriteAllText(Path.Combine(workspace.Path, ".gitattributes"), "*.txt filter=reject\n");
ProjectRebuilderResourceTests.cs (2)
98var artifactsPath = Path.Combine(Path.GetTempPath(), "aspire-artifacts");
ProjectResourceTests.cs (7)
64var projectFilePath = Path.Combine(projectDirectoryPath, "Project.csproj"); 65var propertiesDirectoryPath = Path.Combine(projectDirectoryPath, "Properties"); 66var launchSettingsFilePath = Path.Combine(propertiesDirectoryPath, "launchSettings.json"); 104var projectFilePath = Path.Combine(projectDirectoryPath, "Project.csproj"); 105var propertiesDirectoryPath = Path.Combine(projectDirectoryPath, "Properties"); 106var launchSettingsFilePath = Path.Combine(propertiesDirectoryPath, "launchSettings.json"); 1123Path.Combine(builder.AppHostDirectory, "app.cs"),
PublishAsDockerfileTests.cs (8)
218var projectPath = Path.Combine(path, "project.csproj"); 275var projectPath = Path.Combine(path, "project.csproj"); 294var projectPath = Path.Combine(path, "project.csproj"); 316var projectPath = Path.Combine(path, "project.csproj"); 341var projectPath = Path.Combine(path, "project.csproj"); 419var projectPath = Path.Combine(path, "project.csproj"); 439var projectPath = Path.Combine(path, "project.csproj"); 527File.WriteAllText(Path.Join(workspace.Path, "Dockerfile"), "this does not matter");
Publishing\ContainerImageArchiveRewriterTests.cs (24)
20var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 21var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 105var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 106var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 181var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 182var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 221var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 222var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 240var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 241var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 313var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 314var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 334var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 335var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 356var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 357var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 380var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 381var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 413var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 414var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 435var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 436var destinationArchive = Path.Combine(workspace.Path, "destination.tar"); 459var sourceArchive = Path.Combine(workspace.Path, "source.tar"); 460var compressedArchive = Path.Combine(workspace.Path, "custom-extension.archive");
Publishing\ContainerRuntimeBaseTests.cs (5)
28var rootPath = Path.GetPathRoot(Path.GetFullPath("context"))!; 30await runtime.BuildImageAsync(rootPath, Path.Combine(rootPath, "Dockerfile"), 43var contextPath = Path.GetFullPath("context with spaces"); 44var dockerfile = Path.Combine(contextPath, "Dockerfile");
Publishing\DeploymentStateManagerTests.cs (15)
390var stateDirectory = Path.GetDirectoryName(stateFilePath); 406var statePath = Path.Combine( 414var stateDirectory = Path.GetDirectoryName(statePath); 432Path.Combine(_aspireHome.FullName, "deployments", sha, "development.json"), 455Path.Combine( 591Directory.CreateDirectory(Path.GetDirectoryName(legacyStatePath)!); 618Directory.CreateDirectory(Path.GetDirectoryName(statePath)!); 994Assert.False(File.Exists(Path.Combine( 1017var legacyStatePath = Path.Combine( 1022Directory.CreateDirectory(Path.GetDirectoryName(legacyStatePath)!); 1195var legacyDirectory = Path.Combine(_aspireHome.FullName, "deployments", legacySha); 1202var canonicalPath = Path.Combine(_aspireHome.FullName, "deployments", Guid.NewGuid().ToString("N"), "production.json"); 1203var legacyDirectory = Path.Combine(_aspireHome.FullName, "deployments", Guid.NewGuid().ToString("N")); 1204var legacyPath = Path.Combine(legacyDirectory, "production.json"); 1216.GetOrCreate(Path.Combine(_aspireHome.FullName, "secrets.json"));
Publishing\DockerContainerRuntimeTests.cs (4)
74var archivePath = Path.Combine("Images", "worker.tar"); 534return Path.GetFullPath("context") 535.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Publishing\DotnetProgramArchiveTests.cs (18)
44var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 80var firstArchive = Path.Combine(firstWorkspace.WorkspaceRoot.FullName, "program.tar"); 81var secondArchive = Path.Combine(secondWorkspace.WorkspaceRoot.FullName, "program.tar"); 139var resource = AddArchiveResource(builder, workspace.WorkspaceRoot.FullName, Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar")); 185var resource = AddArchiveResource(builder, workspace.WorkspaceRoot.FullName, Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar")); 223var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar.gz"); 265var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 288var blockedDirectory = Path.Combine(workspace.WorkspaceRoot.FullName, "output"); 293Path.Combine(blockedDirectory, "program.tar.gz")); 321var resource = AddArchiveResource(builder, workspace.WorkspaceRoot.FullName, Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar")); 416var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, path); 480var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archives"); 487var archivePath = Path.Combine(outputPath, FlattenedArchiveName); 501var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, path); 507return trailingSeparator ? outputPath + Path.DirectorySeparatorChar : outputPath; 514return trailingSeparator || existingDirectory || !Path.HasExtension(path) 515? Path.Combine(outputPath, FlattenedArchiveName) 559return builder.AddProject("program", Path.Combine(workspacePath, "program.csproj"), static options => options.ExcludeLaunchProfile = true)
Publishing\PodmanSaveArgumentsTests.cs (16)
26OutputPath = Path.Combine("out", "archives"), 32var expectedPath = Path.Combine("out", "archives", "myapp-latest.tar"); 43OutputPath = Path.Combine("out", "archives"), 49var expectedPath = Path.Combine("out", "archives", "myapp-latest.tar"); 60OutputPath = Path.Combine("out", "archives") 65var expectedPath = Path.Combine("out", "archives", "myapp-latest.tar"); 74var outputPath = Path.Combine("out", "archives"); 97var outputPath = Path.Combine("out", "archives"); 138var archivePath = Path.Combine("Images", "worker.tar"); 166Assert.Contains($"--output \"{Path.Combine("out", "container-abc123.tar")}\"", arguments, StringComparison.Ordinal); 250Assert.Equal(Path.GetDirectoryName(archivePath), Path.GetDirectoryName(match.Groups["path"].Value)); 251Assert.Matches($"^\\.{Regex.Escape(Path.GetFileName(archivePath))}\\.[0-9a-f]{{32}}\\.save\\.tmp$", Path.GetFileName(match.Groups["path"].Value)); 256Assert.Equal([Path.GetFileName(archivePath)], Directory.EnumerateFiles(outputPath).Select(Path.GetFileName));
Publishing\ResourceContainerImageManagerTests.cs (53)
60var appPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs"); 66var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar.gz"); 95var appPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs"); 109var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar"); 352var tempOutputPath = Path.GetTempPath(); 396var tempOutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "NewFolder"); // tests that the folder is created if it doesn't exist 439var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Images", "worker.tar"); 613var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar; 769var contextPathWithTrailingSlash = tempContextPath + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar; 785Assert.False(buildCall.contextPath.EndsWith(Path.DirectorySeparatorChar.ToString())); 786Assert.False(buildCall.contextPath.EndsWith(Path.AltDirectorySeparatorChar.ToString())); 789Assert.Equal(Path.GetFullPath(tempContextPath), Path.GetFullPath(buildCall.contextPath)); 807? Path.Combine(workspace.WorkspaceRoot.FullName, "Images", "worker.tar") 808: Path.Combine(workspace.WorkspaceRoot.FullName, "Images"); 836: Path.Combine(outputPath, overrideLocalImage ? "team-worker-v1.tar" : $"worker-{generatedTag}.tar"); 842Assert.True(Directory.Exists(Path.GetDirectoryName(expectedArchivePath))); 893var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Images"); 922Assert.Equal(Path.Combine(outputPath, "localhost-5000-team-worker-v2.tar"), reportedPath); 941var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, path); 1012var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "Images"); 1042Assert.Equal(Path.Combine(outputPath, "custom-image-v1.0.0.tar"), reportedPath); 1094.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "missing.csproj"))) 1125.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"))) 1158.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "missing.csproj"))) 1205.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"))) 1215context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 1243var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"); 1256context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar"); 1272Assert.Equal(Path.GetDirectoryName(processSpec.ArgumentList![1]), processSpec.WorkingDirectory); 1297var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar.gz"); 1299var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"); 1387var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "program.tar.gz"); 1390.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "program.csproj"))) 1438.WithAnnotation(new TestProjectMetadata(Path.Combine(workspace.WorkspaceRoot.FullName, "app.cs"))) 1443context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar"); 1479var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "app.cs" : "app.csproj"); 1485context.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.tar"); 1519var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "app.cs" : "app.csproj"); 1549Assert.Equal(Path.GetDirectoryName(projectPath), query.WorkingDirectory); 1580var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, fileBased ? "app.cs" : "app.csproj"); 1646Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Build.props"), 1654var probePath = Path.Combine(workspace.WorkspaceRoot.FullName, "properties.proj"); 1708var projectPath = Path.Combine(workspace.WorkspaceRoot.FullName, "app.csproj"); 1709var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archive;100%.tar"); 1735var probePath = Path.Combine(workspace.WorkspaceRoot.FullName, "properties.proj"); 1852var tempFile = Path.GetTempFileName(); 2004var tempSecretFile = System.IO.Path.Combine(workspace.WorkspaceRoot.FullName, ".npmrc"); 2479ctx.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archives"); 2607ctx.OutputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archives"); 2678var dockerfilePath = Path.Combine(workspace.WorkspaceRoot.FullName, "Dockerfile"); 2741? string.Join(", ", Directory.EnumerateFiles(outputPath, "*.tar").Select(Path.GetFileName).Take(10))
Publishing\WslcContainerRuntimeTests.cs (3)
60Path.GetFullPath("context")], 94expected.Add(Path.GetFullPath("context")); 226var outputPath = Path.Combine(workspace.WorkspaceRoot.FullName, "archives");
PythonAppDeployPipelineTests.cs (2)
21File.WriteAllText(Path.Combine(appDirectory, "main.py"), "print('Hello from Python!')"); 22File.WriteAllText(Path.Combine(appDirectory, "Dockerfile"), "FROM scratch\nENTRYPOINT [\"python\", \"main.py\"]\n");
ResourceCommandServiceTests.cs (4)
1766var buildCountPath = Path.Combine(workspace.WorkspaceRoot.FullName, "build-count.txt"); 1798var keepAlivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "keep-alive.txt"); 1891var projectPath = Path.Combine(directoryPath, "BuildOutputProject.csproj"); 1892var programPath = Path.Combine(directoryPath, "Program.cs");
ResourceFailureLoggingTests.cs (1)
93var relativeWorkingDirectory = Path.Combine("missing-working-directories", Guid.NewGuid().ToString("N"));
Schema\SchemaTests.cs (16)
80var tempPath = Path.GetTempPath(); 81var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName()); 83var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 92var tempPath = Path.GetTempPath(); 93var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName()); 95var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 110var tempPath = Path.GetTempPath(); 111var tempContextPath = Path.Combine(tempPath, Path.GetRandomFileName()); 113var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 144var tempDockerfilePath = Path.Combine(tempContextPath, "Dockerfile"); 240var relativePath = Path.Combine("Schema", "aspire-8.0.json"); 241var schemaPath = Path.GetFullPath(relativePath); 253var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, outputPath: Path.Combine(manifestDir, "not-used.json"), step: "publish-json-manifest");
TerminalHostPathsTests.cs (3)
38Assert.Equal(Path.Combine(trmnlDirectory, $"{id}.{TerminalHostPaths.ControlSockPurpose}.sock"), control); 48Assert.Equal(Path.Combine(trmnlDirectory, $"{id}.{TerminalHostPaths.MetadataSuffix}"), metadata); 59Path.Combine(trmnlDirectory, $"{id}.{TerminalHostPaths.MetadataTemporarySuffix}"),
Terminals\Hex1bAspireTerminalTests.cs (1)
244await File.WriteAllTextAsync(Path.Combine(directory.Path, "working-directory-marker"), string.Empty);
Terminals\Hex1bPtySocketTests.cs (23)
32var directory = Path.Combine(root.FullName, "custom"); 63var directory = Path.Combine(root.FullName, "custom"); 70var originalOverride = Path.Combine(directory, "..", "custom"); 79EnvironmentVariables = { [Hex1bPtySocketHelper.SocketDirectoryEnvironmentVariable] = Path.Combine(root.FullName, "child") } 92Assert.Empty(Directory.EnumerateFileSystemEntries(Path.Combine(directory, "proxy"))); 117Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire")); 118var directory = Path.Combine(root.FullName, ".aspire", "pty"); 120var value = bool.Parse(sharedRootValue) ? Path.GetTempPath() : directory; 152var directory = Directory.CreateDirectory(Path.Combine(root.FullName, "custom")); 193Assert.Equal(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "pty", "proxy"), 194Path.GetDirectoryName(socketPath)); 195Assert.False(Path.Exists(socketPath)); 210var directory = Path.Combine(root.FullName, new string('a', 108)); 242var directory = Path.Combine(root.FullName, ".aspire", "pty"); 243_ = new UnixDomainSocketEndPoint(Path.Combine(directory, $"hex1bpty-{new string('0', 32)}.socket")); 262EnvironmentVariables = { [Hex1bPtySocketHelper.SocketDirectoryEnvironmentVariable] = Path.Combine(root.FullName, "child") }, 275var laterDirectory = Path.Combine(root.FullName, "later"); 277Assert.Empty(Directory.EnumerateFileSystemEntries(Path.Combine(directory, "proxy"))); 282var sockets = Directory.GetFiles(Path.Combine(directory, "proxy"), "*.socket"); 285Assert.False(Directory.Exists(Path.Combine(root.FullName, "child"))); 304Assert.Empty(Directory.EnumerateFileSystemEntries(Path.Combine(directory, "proxy"))); 305Assert.Equal(Path.Combine(root.FullName, "later"), Environment.GetEnvironmentVariable(Hex1bPtySocketHelper.SocketDirectoryEnvironmentVariable)); 321directory.MoveTo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), directory.Name));
Terminals\ResourceAspireTerminalTests.cs (3)
69var missingSocket = Path.Combine(_socketDirectory, "not-listening.sock"); 81var terminal = new ResourceAspireTerminal("resource:test:0", "test", Path.Combine(_socketDirectory, "unused.sock"), NullLogger.Instance).Handle; 149=> Path.Combine(_socketDirectory, $"{Guid.NewGuid().ToString("N")[..8]}.sock");
Terminals\ResourceTerminalCatalogTests.cs (1)
27private string _terminalDirectory => Path.Combine(_terminalRoot, ".aspire", "trmnl");
Terminals\TerminalKeyInputTests.cs (1)
38? await TestResourceTerminalHost.StartAsync(Path.Combine(_socketDirectory, "keys.sock"), workload)
Terminals\TerminalServiceTests.cs (2)
243var firstDirectory = Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory); 294options.WorkingDirectory = Path.Combine(secondDirectory, "must-not-be-used");
TestProgramModelTests.cs (1)
31Assert.True(Path.IsPathFullyQualified(project.GetProjectMetadata().ProjectPath));
tests\Shared\TestFileSystemService.cs (2)
33var resolvedName = fileName ?? System.IO.Path.GetRandomFileName(); 34var filePath = System.IO.Path.Combine(tempDir.FullName, resolvedName);
tests\Shared\TestInteractionFileUploadStore.cs (1)
33var filePath = Path.Combine("memory", fileId);
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
UserSecretsParameterDefaultTests.cs (1)
375var directoryName = Path.GetDirectoryName(secretsFilePath);
Utils\DotnetSdkVersionProviderTests.cs (8)
287File.WriteAllText(Path.Combine(workspace.Path, "global.json"), "{}"); 288var firstDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "First")).FullName; 289var secondDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "src", "Second")).FullName; 309var firstDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "First")).FullName; 310var secondDirectory = Directory.CreateDirectory(Path.Combine(workspace.Path, "Second")).FullName; 311File.WriteAllText(Path.Combine(firstDirectory, "global.json"), "{}"); 312File.WriteAllText(Path.Combine(secondDirectory, "global.json"), "{}"); 334var globalJsonPath = Path.Combine(workspace.Path, "global.json");
Utils\SocketPermissionHelperTests.cs (45)
25var directory = Path.Combine(root.FullName, "custom"); 31var socketPath = Path.Combine(directory, "s.sock"); 69var directory = Path.Combine(root.FullName, ".aspire", "pty"); 71var socketPath = Path.Combine(directory, "occupied"); 96var directory = Path.Combine(root.FullName, "custom"); 138var directory = SocketPermissionHelper.CreateDirectory(Path.Combine(root.FullName, "custom"), repairExisting: false); 164Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire")); 165var directory = Path.Combine(root.FullName, ".aspire", "pty"); 169Assert.ThrowsAny<IOException>(() => SocketPermissionHelper.Bind(socket, Path.Combine(directory, "s.sock"))); 191var target = Directory.CreateDirectory(Path.Combine(root.FullName, "target")); 192Directory.CreateDirectory(Path.Combine(target.FullName, "home")); 193var link = Path.Combine(root.FullName, "homes"); 195var profile = Path.Combine(link, "home"); 196var path = Path.Combine(profile, ".aspire", "cli", "bch"); 202AssertDirectoryPermissions(Path.Combine(target.FullName, "home", ".aspire", "cli", "bch")); 225var target = Directory.CreateDirectory(Path.Combine(root.FullName, "target")); 227var link = Path.Combine(root.FullName, "base"); 229var path = Path.Combine(link, ".aspire", "trmnl"); 230var targetDirectory = Path.Combine(target.FullName, ".aspire", "trmnl"); 274var home = Directory.CreateDirectory(Path.Combine(root.FullName, "home")); 275var profile = Path.Combine(root.FullName, "profile"); 277var target = Path.Combine(root.FullName, "target"); 280var link = Path.Combine(profile, linkedSuffix); 281Directory.CreateDirectory(Path.GetDirectoryName(link)!); 285Path.Combine(profile, ".aspire", "cli", "bch"), repairExisting, 310var target = Path.Combine(root.FullName, "target"); 315var profile = Path.Combine(root.FullName, "profile"); 319Path.Combine(profile, ".aspire", "trmnl"), repairExisting: true, 346var target = Path.Combine(root.FullName, "target"); 349Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire")); 350var link = Path.Combine(root.FullName, ".aspire", "pty"); 366Assert.Throws<IOException>(() => SocketPermissionHelper.CreateDirectory(Path.GetTempPath(), repairExisting: false)); 367Assert.Throws<IOException>(() => SocketPermissionHelper.CreateDirectory(Path.GetPathRoot(Path.GetTempPath())!, repairExisting: false)); 385var directory = Path.GetFullPath(Path.Combine(root.FullName, "base", relativePath)); 391var socketPath = Path.Combine(directory, "s.sock"); 418var directory = Path.Combine(root.FullName, ".aspire", "pty"); 451Assert.Equal(Path.Combine(root.FullName, "custom"), directory.FullName); 468var directory = Path.Combine(root.FullName, dcpLayout ? "aspire-dcp-test" : ".aspire/pty"); 499var target = Directory.CreateDirectory(Path.Combine(root.FullName, "target")); 500var directory = Path.Combine(target.FullName, "pty"); 503Directory.CreateSymbolicLink(Path.Combine(root.FullName, ".aspire"), target.FullName); 506Path.Combine(root.FullName, ".aspire", "pty"), repairExisting: false)); 527var directory = Directory.CreateDirectory(Path.Combine(root.FullName, ".aspire", "pty")).FullName;
WithBindMountTests.cs (16)
16var source = Path.GetFullPath("bind-source"); 32var absoluteSource = Path.GetFullPath("bind-source", builder.AppHostDirectory); 46var source = Path.GetFullPath("bind-source", builder.AppHostDirectory); 50.WithBindMount(Path.Combine(source, "."), "/mnt/data") 51.WithBindMount(source + Path.DirectorySeparatorChar, "/mnt/data"); 61var source = Path.GetFullPath("bind-source"); 75.WithBindMount(Path.GetFullPath("one"), "/mnt/data"); 77var ex = Assert.Throws<InvalidOperationException>(() => container.WithBindMount(Path.GetFullPath("two"), "/mnt/data")); 92var source = Path.GetFullPath("bind-source"); 111.WithBindMount(Path.GetFullPath("one"), "/mnt/data"); 113var ex = Assert.Throws<InvalidOperationException>(() => container.WithBindMount(Path.GetFullPath("two"), equivalentTarget)); 126var ex = Assert.Throws<InvalidOperationException>(() => container.WithBindMount(Path.GetFullPath("bind-source"), "/mnt/data")); 136var source = Path.GetFullPath("bind-source"); 162var source = Path.GetFullPath("bind-source"); 177var ex = Assert.Throws<InvalidOperationException>(() => container.WithBindMount(Path.GetFullPath("bind-source"), "/mnt/data")); 187var source = Path.GetFullPath("bind-source");
WithTerminalTests.cs (29)
21private string _terminalDirectory => Path.Combine(_terminalRoot, "terminals"); 555Assert.Equal(_terminalDirectory, Path.GetDirectoryName(host.Layout.MetadataPath)); 587var orphanMetadataPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.MetadataSuffix}"); 588var orphanProducerPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.ProducerSockPurpose}.sock"); 589var orphanConsumerPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.ConsumerSockPurpose}.sock"); 590var orphanControlPath = Path.Combine(trmnlDirectory, $"{orphanId}.{TerminalHostPaths.ControlSockPurpose}.sock"); 642var liveMetadataPath = Path.Combine(trmnlDirectory, $"{liveId}.{TerminalHostPaths.MetadataSuffix}"); 643var liveProducerPath = Path.Combine(trmnlDirectory, $"{liveId}.{TerminalHostPaths.ProducerSockPurpose}.sock"); 693var metadataPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.MetadataSuffix}"); 694var producerPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.ProducerSockPurpose}.sock"); 725var metadataPath = Path.Combine(trmnlDirectory, $"{fileReplicaId}.{TerminalHostPaths.MetadataSuffix}"); 731var sentinelPath = Path.Combine(trmnlDirectory, maliciousPrefix + "-sentinel.tmp"); 860var metadataPath = Path.Combine(trmnlDirectory, $"{invalidReplicaId}.{TerminalHostPaths.MetadataSuffix}"); 861var producerPath = Path.Combine(trmnlDirectory, $"{invalidReplicaId}.{TerminalHostPaths.ProducerSockPurpose}.sock"); 890var metadataPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.MetadataSuffix}"); 891var producerPath = Path.Combine(trmnlDirectory, $"{replicaId}.{TerminalHostPaths.ProducerSockPurpose}.sock"); 1073var publishDirectory = Path.Combine(_terminalDirectory, "publish"); 1245Assert.StartsWith(hosts[i].Layout.ReplicaId + ".", Path.GetFileName(hosts[i].Layout.ProducerUdsPath)); 1246Assert.StartsWith(hosts[i].Layout.ReplicaId + ".", Path.GetFileName(hosts[i].Layout.ConsumerUdsPath)); 1293Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.ProducerUdsPath)); 1294Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.ConsumerUdsPath)); 1295Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.ControlUdsPath)); 1296Assert.Equal(expectedDirectory, Path.GetDirectoryName(host.Layout.MetadataPath)); 1298Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.ProducerUdsPath)); 1299Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.ConsumerUdsPath)); 1300Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.ControlUdsPath)); 1301Assert.StartsWith(host.Layout.ReplicaId + ".", Path.GetFileName(host.Layout.MetadataPath)); 1470var directory = Path.Combine(_terminalRoot, "custom"); 1479Assert.Equal(directory, Path.GetDirectoryName(host.Layout.MetadataPath));
WithVolumeTests.cs (5)
88var storePrefix = Path.GetFullPath(app.Services.GetRequiredService<IAspireStore>().BasePath) + Path.DirectorySeparatorChar; 101var markerPath = Path.Combine(sessionPath, "marker.txt"); 107Assert.Equal("persisted", await File.ReadAllTextAsync(Path.Combine(persistentPath, "marker.txt"))); 142.WithBindMount(Path.GetFullPath("bind-source"), "/srv/bind");
Aspire.Hosting.TestUtilities (23)
tests\Shared\DistributedApplicationTestingBuilderExtensions.cs (2)
72var uniqueFolder = Path.Combine(baseDcpLogFolder, folderName); 128_testOutputHelper.WriteLine($"=== DCP Log: {Path.GetFileName(logFile)} ===");
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
Utils\DockerfileUtils.cs (1)
45var tempDockerfilePath = Path.Combine(tempContextPath, dockerfileName);
Utils\DotnetFileAppProcess.cs (5)
15var appPath = Path.Combine(directoryPath, fileName); 50var outputDirectory = Path.Combine(directoryPath, "bin"); 60var assemblyPath = Path.Combine(outputDirectory, "reject-input.dll"); 125var outputDirectory = Path.Combine(directoryPath, "bin"); 135var assemblyPath = Path.Combine(outputDirectory, "hold-streams.dll");
Utils\ManifestUtils.cs (3)
34var context = new ManifestPublishingContext(executionContext, Path.Combine(manifestDirectory, "manifest.json"), writer); 56var context = new ManifestPublishingContext(executionContext, Path.Combine(manifestDirectory, "manifest.json"), writer); 75var context = new ManifestPublishingContext(executionContext, Path.Combine(Environment.CurrentDirectory, "manifest.json"), writer);
Utils\MSBuildUtils.cs (2)
13while (directory != null && !Directory.Exists(Path.Combine(directory, ".git")) && !File.Exists(Path.Combine(directory, ".git")))
Utils\PersistentContainerTestHelpers.cs (1)
75if (Path.GetDirectoryName(userSecretsPath) is { } userSecretsDirectory && Directory.Exists(userSecretsDirectory))
Utils\UnixSocketHelper.cs (1)
14var aspireCliPath = Path.GetDirectoryName(socketPath)!;
Aspire.Hosting.Valkey.Tests (3)
AddValkeyTests.cs (1)
237Assert.Equal(Path.Combine(builder.AppHostDirectory, "myValkeydata"), volumeAnnotation.Source);
ValkeyFunctionalTests.cs (2)
85bindMountPath = Path.Combine(Directory.CreateTempSubdirectory().FullName, "data"); 191Directory.Delete(Path.GetDirectoryName(bindMountPath)!, recursive: true);
Aspire.Hosting.Yarp.Tests (3)
tests\Shared\TestModuleInitializer.cs (2)
27directory: Path.Combine( 29? Path.GetDirectoryName(Assembly.GetExecutingAssembly()!.Location) ?? string.Empty
YarpConfigGeneratorTests.cs (1)
292var composeFile = Path.Combine(workspace.Path, "docker-compose.yaml");
Aspire.Managed.Tests (49)
AppHostServerV2CodeGenerationTests.cs (16)
16var output = Path.Combine(workspace.Path, "generated"); 38var core = Path.Combine(workspace.Path, "core.json"); 39var request = Path.Combine(workspace.Path, "request.json"); 40var output = Path.Combine(workspace.Path, "generated"); 59var core = Path.Combine(workspace.Path, "core.json"); 60var metadata = Path.Combine(workspace.Path, "metadata.json"); 61var source = Path.Combine(workspace.Path, "provider.mts"); 62var request = Path.Combine(workspace.Path, "request.json"); 63var output = Path.Combine(workspace.Path, "generated"); 105var core = Path.Combine(workspace.Path, "core.json"); 106var metadata = Path.Combine(workspace.Path, "metadata.json"); 107var source = Path.Combine(workspace.Path, "provider.mts"); 108var request = Path.Combine(workspace.Path, "request.json"); 109var output = Path.Combine(workspace.Path, "generated"); 137Assert.Equal(File.ReadAllText(source), File.ReadAllText(Path.Combine(output, sdkFile))); 138await Verify(await File.ReadAllTextAsync(Path.Combine(output, "aspire.mts")), extension: "ts")
TerminalHostSignalTests.cs (27)
27var socketDirectory = new DirectoryInfo(Path.Combine(root.FullName, "terminals")); 28var producerPath = Path.Combine(socketDirectory.FullName, "p.sock"); 29var consumerPath = Path.Combine(socketDirectory.FullName, "h.sock"); 30var controlPath = Path.Combine(socketDirectory.FullName, "c.sock"); 111var controlPath = Path.Combine(root.FullName, "c.sock"); 185.Select(name => Path.Combine(root.FullName, "terminals", name)).ToArray(); 223var startInfo = CreateTerminalHostStartInfo(Path.Combine(root.FullName, "s", "p.sock"), "consumer", "control"); 227File.Delete(Path.Combine(root.FullName, "terminalhost", OperatingSystem.IsWindows() ? "Aspire.TerminalHost.exe" : "Aspire.TerminalHost")); 254var socketDirectory = new DirectoryInfo(Path.Combine(root.FullName, "terminals")); 255var parentProducerPath = Path.Combine(socketDirectory.FullName, "pp.sock"); 256var parentConsumerPath = Path.Combine(socketDirectory.FullName, "ph.sock"); 257var parentControlPath = Path.Combine(socketDirectory.FullName, "pc.sock"); 259var producerPath = Path.Combine(socketDirectory.FullName, "p.sock"); 260var consumerPath = Path.Combine(socketDirectory.FullName, "h.sock"); 261var controlPath = Path.Combine(socketDirectory.FullName, "c.sock"); 367var root = Path.GetDirectoryName(Path.GetDirectoryName(producerPath))!; 368var managed = Directory.CreateDirectory(Path.Combine(root, "managed")); 369var terminal = Directory.CreateDirectory(Path.Combine(root, "terminalhost")); 372var output = Path.Combine(AppContext.BaseDirectory, "ProcessFixtures", fixture); 375var target = Path.Combine(directory, Path.GetRelativePath(output, file)); 376Directory.CreateDirectory(Path.GetDirectoryName(target)!); 383var managedAssembly = Path.Combine(managed.FullName, "aspire-managed.dll"); 389var output = Path.Combine(AppContext.BaseDirectory, "ProcessFixtures", "terminalhost"); 390startInfo.ArgumentList.Add(Path.Combine(output, Path.GetFileName(hostAssemblyPath)));
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
Aspire.Playground.Tests (14)
Infrastructure\DistributedApplicationExtensions.cs (2)
233var projectDirectory = Path.GetDirectoryName(metadata.ProjectPath) ?? throw new UnreachableException(); 239var projectAssemblyPath = Path.Combine(projectDirectory, "bin", configuration, "net10.0", $"{projectName}.dll");
Infrastructure\ResourceExtensions.cs (1)
17return Path.GetFileNameWithoutExtension(metadata.ProjectPath);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
tests\Aspire.TestUtilities\TestcontainersPodmanConfiguration.cs (2)
291return string.IsNullOrEmpty(root) ? null : Path.Combine([root, .. parts]); 295=> string.IsNullOrEmpty(homeDirectory) ? null : Path.Combine([homeDirectory, .. parts]);
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")))
Aspire.Templates.Tests (89)
AppHostTemplateTests.cs (2)
37Assert.False(Directory.Exists(Path.Combine(appHostDirectory, "obj"))); 67var projectPath = Path.Combine(project.RootDir, $"{projectId}.csproj");
BuildAndRunTemplateTests.cs (1)
110var cpmFilePath = Path.Combine(project.RootDir, "Directory.Packages.props");
LocalhostTldHostnameTests.cs (4)
67"aspire-ts-cs-starter" or "aspire-starter" => Path.Combine(project.RootDir, $"{projectName}.AppHost", "Properties", "launchSettings.json"), 68"aspire" => Path.Combine(project.RootDir, $"{projectName}.AppHost", "Properties", "launchSettings.json"), 69"aspire-apphost" => Path.Combine(project.RootDir, "Properties", "launchSettings.json"), 70"aspire-apphost-singlefile" => Path.Combine(project.RootDir, "apphost.run.json"),
NewUpAndBuildStandaloneTemplateTests.cs (6)
110var webProjectDirectory = Path.Combine(project.RootDir, $"{project.Id}.Web"); 112var appContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "App.razor")); 116var importsContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "_Imports.razor")); 119var errorPageContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "Pages", "Error.razor")); 122var navMenuContent = await File.ReadAllTextAsync(Path.Combine(webProjectDirectory, "Components", "Layout", "NavMenu.razor")); 127Assert.True(File.Exists(Path.Combine(webProjectDirectory, "Components", "Layout", "NavMenu.razor.js")));
NewUpAndBuildSupportProjectTemplatesTests.cs (2)
15var topLevelDir = Path.Combine(BuildEnvironment.TestRootPath, id + "_root"); 42project.AppHostProjectDirectory = Path.Combine(topLevelDir, id + ".AppHost");
StarterTemplateRunTestsBase.cs (1)
120string screenshotPath = Path.Combine(logPath, "webfrontend-fail.png");
TemplateTestsBase.cs (9)
78var testProjectDir = Path.Combine(rootDirToUse, testProjectName); 81var testProjectPath = Path.Combine(testProjectDir, testProjectName + ".csproj"); 84var appHostProjectName = Path.GetFileName(project.AppHostProjectDirectory)!; 118var testCsPath = Path.Combine(projectDir, "IntegrationTest1.cs"); 173string screenshotPath = Path.Combine(logPath, $"dashboard-fail-{Guid.NewGuid().ToString()[..8]}.png"); 182=> (prefix is null ? "" : $"{prefix}_") + FixupSymbolName(Path.GetRandomFileName()); 205var solutionFiles = Directory.EnumerateFiles(project.RootDir, "*.sln*").Select(Path.GetFileName); 208var solution = XDocument.Load(Path.Combine(project.RootDir, solutionFileName)); 247Assert.All(projectPaths, projectPath => Assert.True(File.Exists(Path.Combine(project.RootDir, projectPath)), $"Solution references missing project '{projectPath}'."));
tests\Shared\Playwright\PlaywrightProvider.cs (1)
55var probePath = Path.Combine(repoRoot.FullName, "artifacts", "bin", "playwright-deps");
tests\Shared\Playwright\TestUtils.cs (2)
14if (Directory.Exists(Path.Combine(repoRoot.FullName, ".git")) || File.Exists(Path.Combine(repoRoot.FullName, ".git")))
tests\Shared\TemplatesTesting\AspireProject.cs (21)
23Path.Combine(BuildEnvironment.TestAssetsPath, "nuget8.config"); 32public string ServiceDefaultsProjectPath => Path.Combine(RootDir, $"{Id}.ServiceDefaults"); 33public string TestsProjectDirectory => Path.Combine(RootDir, $"{Id}.Tests"); 48LogPath = Path.Combine(_buildEnv.LogRootPath, Id); 50AppHostProjectDirectory = Path.Combine(RootDir, $"{Id}.AppHost"); 65File.WriteAllText(Path.Combine(dir, "Directory.Build.props"), "<Project />"); 66File.WriteAllText(Path.Combine(dir, "Directory.Build.targets"), "<Project />"); 72string targetNuGetConfigPath = Path.Combine(dir, "nuget.config"); 93projectDir = Path.Combine(rootDir, id); 97rootDir = projectDir = Path.Combine(BuildEnvironment.TestRootPath, id); 100string logPath = Path.Combine(BuildEnvironment.ForDefaultFramework.LogRootPath, id); 107File.WriteAllText(Path.Combine(rootDir, "Directory.Build.props"), "<Project />"); 108File.WriteAllText(Path.Combine(rootDir, "Directory.Build.targets"), "<Project />"); 115cmd.WithWorkingDirectory(Path.GetDirectoryName(projectDir)!) 153File.Copy(Path.Combine(BuildEnvironment.TestAssetsPath, "EndPointWriterHook_cs"), Path.Combine(project.AppHostProjectDirectory, "EndPointWriterHook.cs")); 154string programCsPath = Path.Combine(project.AppHostProjectDirectory, "AppHost.cs"); 257_testOutput.WriteLine($"----------- [{Path.GetFileName(AppHostProjectDirectory)}] app has exited -------------"); 336workingDirectory ??= Path.Combine(RootDir, $"{Id}.AppHost"); 340var res = await restoreCmd.ExecuteAsync($"restore \"-bl:{Path.Combine(LogPath!, $"{Id}-restore.binlog")}\" /p:TreatWarningsAsErrors=true"); 343var buildArgs = $"build \"-bl:{Path.Combine(LogPath!, $"{Id}-build.binlog")}\" /p:TreatWarningsAsErrors=true";
tests\Shared\TemplatesTesting\BuildEnvironment.cs (28)
26? Path.GetTempPath() 27: Environment.GetEnvironmentVariable("DEV_TEMP") is { } devTemp && Path.Exists(devTemp) 29: Path.GetTempPath(); 32public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets"); 33public static readonly string TestRootPath = Path.Combine(TempDir, "templates-testroot"); 79var sdkFromArtifactsPath = Path.Combine(RepoRoot!.FullName, "artifacts", "bin", sdkDirName); 82sdkForTemplatePath = Path.GetFullPath(sdkFromArtifactsPath); 87string workloadsProjString = Path.Combine("tests", "workloads.proj"); 98.Split(Path.PathSeparator) 99.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 105sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 111BuiltNuGetsPath = Path.Combine(RepoRoot.FullName, "artifacts", "packages", "Debug", "Shipping"); 121.Split(Path.PathSeparator) 122.Select(path => Path.Combine(path, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet")) 128sdkForTemplatePath = Path.GetDirectoryName(dotnetPath)!; 138string? baseDir = Path.GetDirectoryName(EnvironmentVariables.SdkForTemplateTestingPath); 144sdkForTemplatePath = Path.Combine(baseDir, sdkDirName); 159sdkForTemplatePath = Path.GetFullPath(sdkForTemplatePath); 163NuGetPackagesPath = UsesCustomDotNet ? Path.Combine(AppContext.BaseDirectory, $"nuget-cache-{Guid.NewGuid()}") : null; 171EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"; 183var runtimeRoot = Path.Combine(s_testRoot.Value, $"runtime-{Guid.NewGuid():N}"); 186var dashboardPath = Path.Combine(dashboardRoot, "tools", OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"); 187var dcpPath = Path.Combine(dcpRoot, "tools", OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"); 193EnvVars["DcpDir"] = Path.GetDirectoryName(dcpPath)!; 198var destination = Path.Combine(runtimeRoot, directory); 223DotNet = Path.Combine(sdkForTemplatePath!, "dotnet"); 231LogRootPath = Path.GetFullPath(EnvironmentVariables.TestLogPath); 236LogRootPath = 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.TerminalHost (39)
Hmp1UdsServerListenerFilter.cs (1)
215var directory = Path.GetDirectoryName(socketPath);
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\ProcessStartTimeHelper.cs (1)
340var statPath = Path.Combine(procRoot, pid.ToString(CultureInfo.InvariantCulture), "stat");
src\Shared\SocketPermissionHelper.cs (8)
39var directory = new DirectoryInfo(Path.GetFullPath(path, currentDirectory)); 40var tempRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(tempDirectory, currentDirectory)); 43: Path.TrimEndingDirectorySeparator(Path.GetFullPath(userProfileDirectory, currentDirectory)); 46var isWorkingDirectory = string.Equals(directory.FullName, Path.TrimEndingDirectorySeparator(currentDirectory), comparison); 48var isTemporaryRoot = string.Equals(Path.TrimEndingDirectorySeparator(directory.FullName), tempRoot, comparison); 113var directory = Path.GetDirectoryName(socketPath);
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
src\Shared\TerminalHost\TerminalHostPaths.cs (4)
87return Path.Combine(homeDirectory, DotAspireDirectoryName, TrmnlDirectoryName); 112return Path.Combine(trmnlDirectory, $"{replicaId}.{sockPurpose}.sock"); 123return Path.Combine(trmnlDirectory, $"{replicaId}.{MetadataSuffix}"); 149var fileName = Path.GetFileName(path);
TerminalHostControlListener.cs (1)
54var dir = Path.GetDirectoryName(_socketPath);
Aspire.TerminalHost.Tests (20)
TerminalHostAppTests.cs (14)
43var dcpDir = Path.Combine(workspace.Path, "terminals"); 48var producer = Path.Combine(dcpDir, "p.sock"); 49var consumer = Path.Combine(hostDir, "r.sock"); 50var control = Path.Combine(ctrlDir, "c.sock"); 765Directory.CreateDirectory(Path.Combine(workspace.Path, ".aspire")); 766var parentFile = Path.Combine(workspace.Path, ".aspire", "trmnl"); 771Path.Combine(parentFile, "consumer.sock"), 781var socketPath = Path.Combine(workspace.Path, ".aspire", "trmnl", "consumer.sock"); 1320Directory.CreateDirectory(Path.Combine(workspace.Path, ".aspire")); 1321var parentFile = Path.Combine(workspace.Path, ".aspire", "trmnl"); 1325Path.Combine(parentFile, "producer.sock"), CancellationToken.None)); 1360var directory = Path.GetDirectoryName(control)!; 1399var path = Path.GetDirectoryName(socketPath)!; 1422var directoryPath = Path.GetDirectoryName(socketPath)!;
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
Aspire.TestTools (7)
GitHubCli.cs (3)
63var outputExtension = Path.GetExtension(outputPath); 218var fixturePath = Path.Combine(fixtureDirectory, $"{name}{extension}"); 381fixturePath = Path.Combine(fixtureDirectory, $"{fileName}{extension}");
ProcessRunner.cs (4)
18if (!Path.IsPathRooted(executable) && environment is not null && environment.TryGetValue("PATH", out var searchPath)) 23var searchName = OperatingSystem.IsWindows() && !Path.HasExtension(executable) ? executable + ".exe" : executable; 24fileName = searchPath.Split(Path.PathSeparator).Select(path => Path.Combine(path, searchName))
Aspire.TestUtilities (8)
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
TestcontainersPodmanConfiguration.cs (2)
291return string.IsNullOrEmpty(root) ? null : Path.Combine([root, .. parts]); 295=> string.IsNullOrEmpty(homeDirectory) ? null : Path.Combine([homeDirectory, .. parts]);
Aspire.Tray.Tests (393)
AppHostIdTests.cs (5)
11var path = Path.GetFullPath(Path.Combine("MyWorktree", "Shop.AppHost", "AppHost.cs")); 22var path = Path.GetFullPath(Path.Combine("MyWorktree", "Shop.AppHost", "AppHost.cs")); 48var first = new AppHostId(Path.GetFullPath("AppHost.cs"), 42, 1000);
AppHostPresentationTests.cs (17)
13var host = new AppHostInfo(Path.GetFullPath("worktree-a/apphost/apphost.cs"), 42, null); 16Assert.Equal($"{Path.Combine("worktree-a", "apphost")} \u00b7 PID 42", AppHostPresentation.GetSubtitle(host)); 17Assert.Equal($"apphost - {Path.Combine("worktree-a", "apphost")} (PID 42)", AppHostPresentation.GetLabel(host)); 18Assert.Equal(Path.GetFullPath("worktree-a/apphost"), AppHostPresentation.GetDirectory(host)); 31var host = new AppHostInfo(Path.GetFullPath(path), 42, null); 40var first = new AppHostInfo(Path.GetFullPath("worktree-a/Shop.AppHost/Shop.AppHost.csproj"), 42, null); 41var second = new AppHostInfo(Path.GetFullPath("worktree-b/Shop.AppHost/Shop.AppHost.csproj"), 43, null); 45Assert.Equal($"{Path.Combine("worktree-a", "Shop.AppHost")} \u00b7 PID 42", AppHostPresentation.GetSubtitle(first)); 46Assert.Equal($"{Path.Combine("worktree-b", "Shop.AppHost")} \u00b7 PID 43", AppHostPresentation.GetSubtitle(second)); 58var host = new AppHostInfo(Path.GetFullPath($"{name}/apphost.cs"), 42, null); 76var path = Path.GetFullPath(Path.Combine(parent, directory, "apphost.cs")); 91var path = Path.GetFullPath($"worktree\nbranch/apphost/{name}.cs"); 93var location = Path.Combine("worktree branch", "apphost"); 100Assert.Equal(Path.GetDirectoryName(path), AppHostPresentation.GetDirectory(host)); 111Assert.Null(new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, url).DashboardUri); 118Assert.Equal(Url, new AppHostInfo(Path.GetFullPath("apphost.cs"), 42, Url).DashboardUri?.AbsoluteUri);
CliAppHostClientTests.cs (1)
18var executable = Path.GetFullPath("cli path/aspire");
CliAppHostCommandsTests.cs (20)
16var path = Path.GetFullPath(Path.Combine("MyWorktree", "Shop.AppHost", "AppHost.cs")); 19var startInfo = CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), host.Id); 27var executable = Path.GetFullPath("cli path/aspire"); 47CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), Host() with { AppHostPid = pid })); 55CliAppHostCommands.CreateStopStartInfo(Path.GetFullPath("aspire"), Host() with { AppHostPath = "apphost.cs" })); 65Path.GetFullPath("aspire"), Host() with { ProcessStartTimeUnixMilliseconds = startedAt })); 197var commands = new CliAppHostCommands(Path.GetFullPath("does-not-exist"), TimeSpan.FromSeconds(30)); 205Assert.Throws<ArgumentOutOfRangeException>(() => new CliAppHostCommands(Path.GetFullPath("aspire"), TimeSpan.Zero)); 206Assert.Throws<ArgumentOutOfRangeException>(() => new CliAppHostCommands(Path.GetFullPath("aspire"), Timeout.InfiniteTimeSpan)); 214var executable = Path.GetFullPath("configured cli path/aspire"); 220Assert.Equal(Path.GetDirectoryName(appHost), info.WorkingDirectory); 233var commands = new CliAppHostCommands(Path.GetFullPath("missing-cli"), TimeSpan.FromSeconds(60)); 235Assert.Throws<ArgumentException>(() => CliAppHostCommands.CreateStartStartInfo(Path.GetFullPath("aspire"), "apphost.cs")); 237CliAppHostCommands.CreateStartStartInfo(Path.GetFullPath("aspire"), Path.GetDirectoryName(appHost)!)); 337var commands = new CliAppHostCommands(Path.GetFullPath("missing-cli"), TimeSpan.FromSeconds(60)); 346var commands = new CliAppHostCommands(Path.GetFullPath("missing-cli"), TimeSpan.FromSeconds(60)); 349Path.GetFullPath("missing-apphost.cs"), new CancellationToken(canceled: true))); 352private static AppHostId Host() => new(Path.GetFullPath("project with spaces & apostrophe's/apphost.cs"), 42, 1000);
CliProtocolTests.cs (4)
60var path = JsonSerializer.Serialize(Path.GetFullPath("sample/apphost.cs")); 123Host(42) with { AppHostPath = Path.GetFullPath("apphost.cs") + "\0" } 130Assert.Throws<CliProtocolException>(() => Parse(Snapshot(Host(42), Host(42) with { AppHostPath = Path.GetFullPath("other.cs") }))); 176AppHostPath = Path.GetFullPath("sample/apphost.cs"),
Helpers\FixtureCli.cs (1)
21Path = System.IO.Path.Combine(_directory.FullName, "aspire");
Helpers\TestAppHostClient.cs (1)
112Path.GetFullPath("sample/apphost.cs"), pid, "https://localhost:1234/")
Helpers\TestMacTrayLogDirectory.cs (2)
11public string LogPath => Path.Combine(Root, "logs", "tray.log"); 20var directory = new DirectoryInfo(Path.Combine(Root, component));
Helpers\TestTrayBundle.cs (6)
12public string AppPath => Path.Combine(Root, "tray", "Aspire Tray.app"); 16Root = Path.Combine(_directory.FullName, "layout with spaces"); 17CliPath = Path.Combine(_directory.FullName, "aspire cli"); 18Directory.CreateDirectory(Path.Combine(AppPath, "Contents", "MacOS")); 20File.WriteAllText(Path.Combine(AppPath, "Contents", "Info.plist"), ""); 21File.WriteAllText(Path.Combine(AppPath, "Contents", "MacOS", "aspire-tray"), "");
Helpers\TestTrayStartupInstallation.cs (8)
15public string BundleRoot => Path.Combine(Root, "versions", "test-version"); 16public string MacCli => Path.Combine(Root, "aspire mac"); 17public string WindowsCli => Path.Combine(Root, "aspire.exe"); 18public string SourceGui => Path.Combine(BundleRoot, "tray", "aspire-tray.exe"); 19public string Bootstrap => Path.Combine(Root, "state", "aspire-tray-login.exe"); 20public string LaunchAgents => Path.Combine(Root, "isolated home", "Library", "LaunchAgents"); 24Root = Path.Combine(_directory.FullName, "i & s"); 31WindowsTrayTestPayload.Create(Path.GetDirectoryName(SourceGui)!, "win-x64");
Helpers\TestTrayStateDirectory.cs (8)
10public string StatePath => Path.Combine(_directory.FullName, "state", "history.json"); 11public string UserProfilePath => Path.Combine(_directory.FullName, "user"); 12public string LegacyDirectory => Path.Combine(_directory.FullName, "legacy"); 13public string UserStatePath => Path.Combine(UserProfilePath, ".aspire", "tray", "apphosts.json"); 19var path = Path.GetFullPath(Path.Combine(_directory.FullName, relativePath)); 20Directory.CreateDirectory(Path.GetDirectoryName(path)!); 27Directory.CreateDirectory(Path.GetDirectoryName(StatePath)!);
LinuxFolderApplicationTests.cs (9)
38var folder = Path.GetDirectoryName(directory.CreateAppHost("project 'quotes' & $var; %20 #/apphost.cs"))!; 40var application = Assert.Single(LinuxFolderApplication.Discover(Path.GetDirectoryName(executable)!)); 65Assert.Throws<DirectoryNotFoundException>(() => application.CreateStartInfo(Path.Combine(folder, "missing"))); 82var path = string.Join(Path.PathSeparator, "", ".", "relative", Path.GetDirectoryName(first), Path.GetDirectoryName(second)); 98var folder = Path.GetDirectoryName(directory.CreateAppHost("project $(echo expanded); 'quotes' & %20 #/apphost.cs"))!; 99var application = Assert.Single(LinuxFolderApplication.Discover(Path.GetDirectoryName(executable)!)); 106Assert.Equal([folder, "--working-directory", folder], File.ReadAllLines(Path.Combine(folder, "arguments.txt")));
LinuxTrayIconsTests.cs (5)
19var source = Path.Combine(AppContext.BaseDirectory, "Assets", "aspire.png"); 34var source = Path.Combine(AppContext.BaseDirectory, "Assets", "aspire.png"); 61var source = Path.Combine(AppContext.BaseDirectory, "Assets", "aspire.png"); 81var source = Path.Combine(AppContext.BaseDirectory, "Assets", "aspire.png"); 88directory = Path.GetDirectoryName(rendered)!;
LinuxTrayTests.cs (33)
75var offline = TrayPanelSamples.Offline(Path.GetFullPath("Offline.AppHost/apphost.cs")); 76var running = TrayPanelSamples.Running(Path.GetFullPath("Running.AppHost/apphost.cs"), 42) with { IsPinned = true }; 328var parent = Path.GetDirectoryName(path)!; 431var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 450var id = new AppHostId(Path.GetFullPath("Example.AppHost.csproj"), 42, 1000); 456var application = new LinuxFolderApplication("Visual Studio Code", Path.GetFullPath("code"), ["--"]); 480var path = Path.GetFullPath("home/developer/worktrees/worktree-a/Shop.AppHost/apphost.cs"); 487var location = Path.Combine("worktree-a", "Shop.AppHost"); 503var path = Path.GetFullPath($"{directory}/apphost.cs"); 509Assert.Equal($"{expected.Replace('/', Path.DirectorySeparatorChar)} \u00b7 PID 42", row.Children![^1].Label); 550new LinuxFolderApplication("Visual Studio Code", Path.GetFullPath("code"), ["--"]), 551new LinuxFolderApplication("Konsole", Path.GetFullPath("konsole"), ["--workdir"]) 582var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 593var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 611var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 0, null), 636var host = new AppHostMenuItem(new(Path.GetFullPath("apphost.cs"), 1, 2), 651var cli = Path.Combine(installation.Root, "aspire-tray"); 652var directory = Path.Combine(installation.Root, "autostart"); 660var registration = Path.Combine(directory, LinuxTrayStartupSettings.FileName); 672var cli = Path.Combine(installation.Root, "aspire-tray"); 673var directory = Path.Combine(installation.Root, "autostart"); 694File.WriteAllText(Path.Combine(installation.Root, "aspire-tray.runtimeconfig.json"), "{}"); 703var directory = Path.Combine(installation.Root, "runtime"); 709Assert.Equal(UnixFileMode.UserRead | UnixFileMode.UserWrite, File.GetUnixFileMode(Path.Combine(directory, "instance.lock"))); 711Assert.True(File.Exists(Path.Combine(directory, "instance.lock"))); 716var lockPath = Path.Combine(directory, "instance.lock"); 752var home = Path.Combine(installation.Root, "home"); 753var alias = Path.Combine(installation.Root, "alias"); 756var runtime = Path.Combine(alias, ".aspire", "tray", "runtime"); 760Assert.Null(LinuxTrayRuntime.TryAcquire(Path.Combine(home, ".aspire", "tray", "runtime"))); 762var linkedRuntime = Path.Combine(installation.Root, "linked-runtime"); 775LinuxTrayTestPayload.Create(Path.Combine(installation.BundleRoot, "tray"), "linux-x64"); 779Assert.Equal(Path.Combine(installation.BundleRoot, "tray", "aspire-tray"), start.FileName);
MacSingleInstanceTests.cs (4)
16var directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 19Assert.Equal(Path.Combine(directory, "control-v1.sock"), SingleInstance.ActivationPipeName); 20Assert.Equal(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 33var directory = Path.Combine(parent.FullName, "state");
MacTrayLauncherTests.cs (17)
20Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!); 42File.GetUnixFileMode(Path.GetDirectoryName(directory.LogPath)!)); 52var targetDirectory = Directory.CreateDirectory(Path.Combine(directory.Root, "target")).FullName; 53var target = Path.Combine(targetDirectory, "tray.log"); 57Directory.CreateSymbolicLink(Path.GetDirectoryName(directory.LogPath)!, targetDirectory); 61Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!); 74Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!); 75var target = Path.Combine(directory.Root, "target"); 91Directory.CreateDirectory(Path.GetDirectoryName(directory.LogPath)!); 103var leasePath = Path.Combine(directory.Root, "parent.lease"); 138var targetDirectory = Directory.CreateDirectory(Path.Combine(directory.Root, "target")).FullName; 139var target = Path.Combine(targetDirectory, "tray.log"); 145var moved = Path.Combine(directory.Root, "retained"); 146Directory.Move(Path.GetDirectoryName(directory.LogPath)!, moved); 147retained = Path.Combine(moved, "tray.log"); 148Directory.CreateSymbolicLink(Path.GetDirectoryName(directory.LogPath)!, targetDirectory); 152retained = Path.Combine(directory.Root, "retained.log");
MacTrayPayloadTests.cs (11)
31var script = Path.Combine(workspace.FullName, "tools", "CreateLayout", "verify-tray-payload.sh"); 32Directory.CreateDirectory(Path.GetDirectoryName(script)!); 33File.Copy(Path.Combine(AppContext.BaseDirectory, "verify-tray-payload.sh"), script); 34var app = Path.Combine(workspace.FullName, rid, "tray", "Aspire Tray.app"); 35Directory.CreateDirectory(Path.Combine(app, "Contents", "MacOS")); 36Directory.CreateDirectory(Path.Combine(app, "Contents", "Resources")); 37var executable = Path.Combine(app, "Contents", "MacOS", "aspire-tray"); 38var icon = Path.Combine(app, "Contents", "Resources", "Aspire.icns"); 40File.WriteAllText(Path.Combine(app, "Contents", "Info.plist"), """ 51var source = Path.Combine(workspace.FullName, "main.c"); 67var archive = Path.Combine(workspace.FullName, "payload.tar.gz");
MacTrayStartupSettingsTests.cs (7)
39var path = Path.Combine(installation.LaunchAgents, MacTrayStartupSettings.FileName); 68var path = Path.Combine(installation.LaunchAgents, MacTrayStartupSettings.FileName); 84var path = Path.Combine(installation.LaunchAgents, MacTrayStartupSettings.FileName); 85var changed = MacTrayStartupSettings.Serialize(Path.Combine(installation.Root, "another-cli")); 105File.GetUnixFileMode(Path.Combine(installation.LaunchAgents, MacTrayStartupSettings.FileName))); 113var outside = Path.Combine(installation.Root, "unrelated.plist"); 115File.CreateSymbolicLink(Path.Combine(installation.LaunchAgents, MacTrayStartupSettings.FileName), outside);
src\Aspire.Tray\Common\AppHostPresentation.cs (10)
12var name = Path.GetFileNameWithoutExtension(host.AppHostPath); 18name = Path.GetFileName(directory); 19directory = Path.GetDirectoryName(directory) ?? ""; 36=> ToSingleLine($"{Path.GetFileNameWithoutExtension(host.AppHostPath)} - {GetLocation(host)} (PID {host.AppHostPid})"); 38public static string GetDirectory(AppHostInfo host) => Path.GetDirectoryName(host.AppHostPath) ?? host.AppHostPath; 45var directory = Path.GetDirectoryName(appHostPath) ?? appHostPath; 46var parent = Path.GetDirectoryName(directory); 47return ToSingleLine(parent is null ? directory : Path.Combine(Path.GetFileName(parent), Path.GetFileName(directory)));
src\Aspire.Tray\Common\CliAppHostCommands.cs (2)
20if (!Path.IsPathFullyQualified(target.AppHostPath) || target.AppHostPath.Contains('\0')) 41startInfo.WorkingDirectory = Path.GetDirectoryName(path)!;
src\Aspire.Tray\Common\CliProcess.cs (1)
12if (!Path.IsPathFullyQualified(cliPath))
src\Aspire.Tray\Common\CliProtocol.cs (1)
41|| !Path.IsPathFullyQualified(item.AppHostPath) || item.AppHostPath.Contains('\0')
src\Aspire.Tray\Common\FileTraySavedStateStore.cs (4)
30_directory = Path.GetDirectoryName(_path) 37Path.Combine(TrayAppHostPath.Normalize(legacyDirectory), "apphosts.json")); 103var temporaryPath = Path.Combine(_directory, $".history-{Guid.NewGuid():N}.tmp"); 178|| !Path.IsPathFullyQualified(host.AppHostPath) || host.AppHostPath.Contains('\0'))
src\Aspire.Tray\Common\MacTrayStartupSettings.cs (2)
13: RegisteredTrayStartupSettings(new FileTrayStartupRegistrationStore(Path.Combine(launchAgentsDirectory, FileName))) 45return cli is not null && Path.IsPathFullyQualified(cli)
src\Aspire.Tray\Common\TrayConfiguration.cs (10)
21=> Path.Combine(GetAspireHome(cliPath, configuredAspireHome, userProfileDirectory), "aspire.config.json"); 28=> Path.Combine(GetAspireHome(cliPath, configuredAspireHome, userProfileDirectory), "tray", "apphosts.json"); 37? Path.Combine(userProfileDirectory, ".aspire") : configuredAspireHome); 139var directory = Path.GetDirectoryName(binary)!; 140using var stream = File.OpenRead(Path.Combine(directory, ".aspire-install.json")); 155return Path.GetDirectoryName(directory) ?? directory; 157var dogfood = Path.GetDirectoryName(Path.GetDirectoryName(directory)); 158return source.GetString() == "pr" && dogfood is not null && Path.GetFileName(dogfood) == "dogfood" 159? Path.GetDirectoryName(dogfood) : null;
src\Aspire.Tray\Common\TrayLaunchCommand.cs (7)
17if (!Path.IsPathFullyQualified(options.BundleRoot) || !Path.IsPathFullyQualified(options.CliPath)) 22var executable = Path.Combine(options.BundleRoot, "tray", "aspire-tray.exe"); 36WorkingDirectory = Path.GetDirectoryName(executable)! 88var appPath = Path.Combine(options.BundleRoot, "tray", "Aspire Tray.app"); 89var executable = Path.Combine(appPath, "Contents", "MacOS", "aspire-tray"); 90if (!File.Exists(executable) || !File.Exists(Path.Combine(appPath, "Contents", "Info.plist")))
src\Aspire.Tray\Common\TrayOptions.cs (3)
58if (cli is null || !Path.IsPathFullyQualified(cli) || !File.Exists(cli)) 63if (bundleRoot is not null && (!Path.IsPathFullyQualified(bundleRoot) || !Directory.Exists(bundleRoot))) 67if (startupCli is not null && !Path.IsPathFullyQualified(startupCli))
src\Aspire.Tray\Common\TraySavedState.cs (2)
108if (string.IsNullOrWhiteSpace(path) || !Path.IsPathFullyQualified(path) || path.Contains('\0')) 112return Path.GetFullPath(path);
src\Aspire.Tray\Common\TrayStartupBootstrap.cs (3)
20if (!Path.IsPathFullyQualified(sourceExecutable) || !File.Exists(sourceExecutable) 47var directory = Path.GetDirectoryName(bootstrapPath)!; 50var temporary = Path.Combine(directory, $".aspire-login-{Guid.NewGuid():N}.tmp");
src\Aspire.Tray\Common\TrayStartupEntry.cs (14)
20|| !Path.IsPathFullyQualified(startup) || !File.Exists(startup)) 53if (File.Exists(Path.ChangeExtension(path, ".runtimeconfig.json"))) 91var root = Path.TrimEndingDirectorySeparator(Path.GetFullPath(directory)); 92var full = Path.GetFullPath(path); 93return full.Equals(root, comparison) || full.StartsWith(root + Path.DirectorySeparatorChar, comparison); 97=> Path.GetFullPath(path).Split([Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar], 111var full = Path.GetFullPath(path); 112var current = Path.GetPathRoot(full)!; 113foreach (var component in full[current.Length..].Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) 115current = Path.Combine(current, component); 124return Path.GetFullPath(current);
src\Aspire.Tray\Common\TrayStartupRegistration.cs (4)
151var directory = Path.GetDirectoryName(path) 157var temporary = Path.Combine(directory, $".aspire-startup-{Guid.NewGuid():N}.tmp"); 184if (!Path.IsPathFullyQualified(path)) 188foreach (FileSystemInfo entry in new FileSystemInfo[] { new FileInfo(path), new DirectoryInfo(Path.GetDirectoryName(path)!) })
src\Aspire.Tray\Common\WindowsLoginBootstrap.cs (1)
15if (!Path.IsPathFullyQualified(cliPath) || !File.Exists(cliPath))
src\Aspire.Tray\Common\WindowsTrayStartupSettings.cs (1)
99return Path.IsPathFullyQualified(cli.ToString())
src\Aspire.Tray\Linux\LinuxFileManager.cs (1)
53var uri = new Uri(Path.GetFullPath(path)).AbsoluteUri;
src\Aspire.Tray\Linux\LinuxFolderApplication.cs (4)
15var directories = searchPath.Split(Path.PathSeparator).Where(Path.IsPathFullyQualified).ToArray(); 19var executable = directories.Select(directory => Path.Combine(directory, command)) 32directory = Path.GetFullPath(directory);
src\Aspire.Tray\Linux\LinuxPlasmaAnchor.cs (2)
106home = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config"); 117using var reader = File.OpenText(Path.Combine(directory, "kdeglobals"));
src\Aspire.Tray\Linux\LinuxTrayApplication.cs (3)
75var icon = Path.Combine(AppContext.BaseDirectory, "Aspire.png"); 529CopyPath(Path.GetDirectoryName(host!.Id.AppHostPath)!); 533application.Open(Path.GetDirectoryName(host!.Id.AppHostPath)!);
src\Aspire.Tray\Linux\LinuxTrayIcons.cs (1)
25path = Path.Combine(_directory.FullName, $"{status}.png");
src\Aspire.Tray\Linux\LinuxTrayPanel.cs (1)
304_logo = Gtk.cairo_image_surface_create_from_png(Path.Combine(AppContext.BaseDirectory, "Aspire.png"));
src\Aspire.Tray\Linux\LinuxTrayRuntime.cs (5)
19internal static string DirectoryPath => Path.Combine( 21internal static string PipeName => Path.Combine(DirectoryPath, "control-v1.sock"); 22internal static string LogPath => Path.Combine(DirectoryPath, "aspire-tray.log"); 27var handle = OpenPrivateFile(Path.Combine(directory, "instance.lock"), append: false); 127var executable = Path.Combine(options.BundleRoot, "tray", "aspire-tray");
src\Aspire.Tray\Linux\LinuxTrayStartupSettings.cs (5)
12: RegisteredTrayStartupSettings(new FileTrayStartupRegistrationStore(Path.Combine(directory, FileName))) 20return Path.Combine(config is not null && Path.IsPathFullyQualified(config) ? config 21: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config"), "autostart"); 31if (!Path.IsPathFullyQualified(cli) || cli.Any(char.IsControl))
src\Aspire.Tray\Mac\MacTrayLog.cs (2)
20if (!Path.IsPathFullyQualified(path)) 28var components = Path.GetFullPath(path).Split('/', StringSplitOptions.RemoveEmptyEntries);
src\Aspire.Tray\Mac\SingleInstance.cs (4)
20public static string ActivationPipeName => Path.Combine(DirectoryPath, "control-v1.sock"); 23=> Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 27=> Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 42stream = new FileStream(Path.Combine(directory, "instance.lock"), new FileStreamOptions
src\Aspire.Tray\Windows\SingleInstance.cs (2)
17if (!Path.IsPathFullyQualified(localAppData)) 22return Path.Combine(localAppData, "Aspire", "Tray");
src\Aspire.Tray\Windows\WindowsTrayLog.cs (6)
22public static string LogPath => Path.Combine(WindowsSingleInstance.DirectoryPath, "aspire-tray.log"); 41directory = Path.GetFullPath(directory); 42var current = Path.GetPathRoot(directory)!; 47foreach (var component in directory[current.Length..].Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) 49current = Path.Combine(current, component); 64var file = CreateFile(Path.Combine(directory, "aspire-tray.log"),
src\Shared\BundleDiscovery.cs (11)
161var dcpDir = Path.Combine(baseDirectory, DcpDirectoryName); 167dcpExtensionsPath = Path.Combine(dcpDir, "ext"); 168dcpBinPath = Path.Combine(dcpExtensionsPath, "bin"); 192var managedDir = Path.Combine(baseDirectory, ManagedDirectoryName); 193var managedExe = Path.Combine(managedDir, GetExecutableFileName(ManagedExecutableName)); 299var terminalHostPath = Path.Combine( 320return Path.Combine(dcpDirectory, exeName); 356var fileName = Path.GetFileNameWithoutExtension(path); 388return baseDir.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 406return Path.GetDirectoryName(processPath);
src\Shared\BundleVersionLease.cs (7)
98var fullVersionDirectory = Path.GetFullPath(versionDirectory); 104var leasesDirectory = Path.Combine(fullVersionDirectory, LeasesDirectoryName); 111var versionId = Path.GetFileName(fullVersionDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 157environmentVariables[BundleDiscovery.BundleVersionDirectoryEnvVar] = Path.GetFullPath(versionDirectory); 172var leasesDirectory = Path.Combine(versionDirectory, LeasesDirectoryName);
src\Shared\HeldFileLease.cs (3)
61var fullLeaseDirectory = Path.GetFullPath(leaseDirectory); 65var verifiedLeasePath = Path.Combine( 70: Path.Combine(
src\Shared\LinuxTrayPayload.cs (3)
24if (File.Exists(Path.ChangeExtension(path, ".runtimeconfig.json"))) 51var executable = Path.Combine(directory, ExecutableName); 60using var icon = File.OpenRead(Path.Combine(directory, IconName));
src\Shared\TemporaryStorage.cs (3)
47internal static string SystemTempPath => Path.GetTempPath(); 49public string GetTempPath() => Path.GetTempPath(); 51public string GetTempFileName() => Path.GetTempFileName();
tests\Shared\LinuxTrayTestPayload.cs (2)
18var executable = Path.Combine(directory, "aspire-tray"); 24File.WriteAllBytes(Path.Combine(directory, "Aspire.png"),
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\WindowsTrayTestPayload.cs (2)
13File.WriteAllText(Path.Combine(directory, "Aspire.ico"), "test icon"); 14using var stream = File.Create(Path.Combine(directory, "aspire-tray.exe"));
TrayConfigurationTests.cs (15)
122AssertConfigurationError(Path.GetDirectoryName(path)!); 136var root = Path.GetDirectoryName(marker)!; 138File.WriteAllText(Path.Combine(Path.GetDirectoryName(binary)!, ".aspire-install.json"), 141Assert.Equal(Path.Combine(root, expectedHome, "aspire.config.json"), 142TrayConfiguration.GetSettingsPath(binary, Path.Combine(root, "configured"), Path.Combine(root, "user"))); 143Assert.Equal(Path.Combine(root, expectedHome, "tray", "apphosts.json"), 144TrayConfiguration.GetSavedStatePath(binary, Path.Combine(root, "configured"), Path.Combine(root, "user"))); 152var user = Path.GetDirectoryName(binary)!; 154Assert.Equal(Path.Combine(user, ".aspire", "aspire.config.json"), 156Assert.Equal(Path.Combine(user, ".aspire", "tray", "apphosts.json"), 158Assert.Equal(Path.Combine(user, "custom-home", "tray", "apphosts.json"), 159TrayConfiguration.GetSavedStatePath(binary, Path.Combine(user, "custom-home"), user));
TrayControllerPinPruningTests.cs (3)
26Directory.Delete(Path.GetDirectoryName(missingFolder)!, recursive: true); 197var sourceDirectory = Path.GetDirectoryName(path)!; 237var sourceDirectory = Path.GetDirectoryName(restricted)!;
TrayControllerPreferencesTests.cs (2)
56.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), index == 19, true)).ToArray()); 70var paths = Enumerable.Range(0, 20).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray();
TrayControllerSavedStateTests.cs (3)
127var path = Path.Combine(workspace.Path, "apphost.cs"); 439Assert.Throws<InvalidOperationException>(() => controller.RequestStart(Path.Combine(Path.GetDirectoryName(first)!, ".", "apphost.cs")));
TrayLaunchCommandTests.cs (6)
23File.WriteAllText(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), ""); 24File.WriteAllText(Path.Combine(bundle.Root, "tray", "aspire-tray"), ""); 62Assert.False(Directory.Exists(Path.Combine(bundle.Root, BundleVersionLease.LeasesDirectoryName))); 73Assert.Equal(Path.Combine(bundle.AppPath, "Contents", "MacOS", "aspire-tray"), start.FileName); 88File.Delete(Path.Combine(bundle.AppPath, "Contents", "MacOS", "aspire-tray")); 98File.Delete(Path.Combine(bundle.AppPath, "Contents", "Info.plist"));
TrayPanelTests.cs (5)
966var location = Path.Combine("src", "eShop.AppHost"); 1435: Path.Combine(AppContext.BaseDirectory, "TrayPanelPreviews"); 1437var logo = File.ReadAllBytes(Path.Combine(AppContext.BaseDirectory, "Assets", "aspire.png")); 1456var path = Path.Combine(directory, $"{name}-{palette.Name}.svg"); 1460var guides = Path.Combine(directory, $"{name}-{palette.Name}-guides.svg");
TraySavedStateTests.cs (19)
17Assert.Equal(Path.GetFullPath(path), path); 37Assert.Equal([directory.StatePath], Directory.GetFiles(Path.GetDirectoryName(directory.StatePath)!)); 43var paths = Enumerable.Range(0, 30).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray(); 67var paths = Enumerable.Range(0, 52).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray(); 101var paths = Enumerable.Range(0, count).Select(index => Path.GetFullPath($"project-{index}/apphost.cs")).ToArray(); 113.Select(index => new SavedAppHost(Path.GetFullPath($"project-{index}/apphost.cs"), false, true)).ToArray()); 127var differentlyCased = Path.Combine(Path.GetDirectoryName(original)!, "APPHOST.CS"); 145var missing = Path.GetFullPath("deleted/apphost.cs"); 146var recent = Path.GetFullPath("other/apphost.cs"); 162var pinned = Path.GetFullPath("pinned/apphost.cs"); 163var recent = Path.GetFullPath("recent/apphost.cs"); 164var retained = Path.GetFullPath("retained/apphost.cs"); 190Assert.Throws<InvalidDataException>(() => store.Save(TraySavedState.Empty.Remember(Path.GetFullPath("apphost.cs")))); 202Assert.Throws<IOException>(() => store.Save(TraySavedState.Empty.Remember(Path.GetFullPath("apphost.cs")))); 217Assert.Equal([directory.StatePath], Directory.GetFiles(Path.GetDirectoryName(directory.StatePath)!)); 232File.GetUnixFileMode(Path.GetDirectoryName(directory.StatePath)!)); 251var link = Path.Combine(Path.GetDirectoryName(target)!, "linked.cs");
TrayStartupOptionsTests.cs (9)
18File.WriteAllText(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), ""); 19var startup = Path.Combine(bundle.Root, "installed & stable CLI"); 55File.WriteAllText(Path.ChangeExtension(options.CliPath, ".runtimeconfig.json"), "{}"); 68var cli = Path.Combine(installation.BundleRoot, "aspire"); 81var cli = Path.Combine(installation.Root, store, "aspire", "1.0.0", "aspire"); 82Directory.CreateDirectory(Path.GetDirectoryName(cli)!); 94var link = Path.Combine(installation.Root, "stable-installation"); 99var versioned = Path.Combine(installation.BundleRoot, "aspire"); 119File.WriteAllText(Path.ChangeExtension(installation.WindowsCli, ".runtimeconfig.json"), "{}");
TrayUserPreferencesTests.cs (3)
26var legacyPath = Path.Combine(directory.LegacyDirectory, "apphosts.json"); 44new FileTraySavedStateStore(Path.Combine(directory.LegacyDirectory, "apphosts.json")) 58var legacyPath = Path.Combine(directory.LegacyDirectory, "apphosts.json");
WindowsSingleInstanceTests.cs (1)
18Assert.Equal(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Aspire", "Tray"),
WindowsTrayLaunchCommandTests.cs (4)
15var executable = Path.Combine(bundle.Root, "tray", "aspire-tray.exe"); 21Assert.Equal(Path.Combine(bundle.Root, "tray"), start.WorkingDirectory); 36Assert.Equal(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), error.FileName); 43File.WriteAllText(Path.Combine(bundle.Root, "tray", "aspire-tray.exe"), "");
WindowsTrayLauncherTests.cs (4)
46var ping = Path.Combine(Environment.SystemDirectory, "ping.exe"); 99var executable = Path.Combine(Environment.SystemDirectory, $"aspire-tray-missing-{Guid.NewGuid():N}.exe"); 113var start = new ProcessStartInfo(Path.Combine(Environment.SystemDirectory, "ping.exe")) 141using var child = Process.Start(new ProcessStartInfo(Path.Combine(Environment.SystemDirectory, "cmd.exe"))
WindowsTrayLogTests.cs (14)
20var path = Path.Combine(directory.UserProfilePath, "Aspire", "Tray"); 31Assert.Equal("first\nsecond\n", File.ReadAllText(Path.Combine(path, "aspire-tray.log"))); 48link = Path.Combine(link, components[i]); 50Directory.CreateDirectory(Path.GetDirectoryName(link)!); 54targetLogDirectory = Path.Combine(targetLogDirectory, components[i]); 57var sentinel = Path.Combine(targetLogDirectory, "aspire-tray.log"); 59var result = await TestNativeCommand.RunAsync(Path.Combine(Environment.SystemDirectory, "cmd.exe"), 64Assert.Throws<IOException>(() => WindowsTrayLog.OpenLog(Path.Combine(root, Path.Combine(components)))); 81File.CreateSymbolicLink(Path.Combine(path, "aspire-tray.log"), target); 95var result = await TestNativeCommand.RunAsync(Path.Combine(Environment.SystemDirectory, "cmd.exe"), 96"/d", "/c", "mklink", "/H", Path.Combine(path, "aspire-tray.log"), target); 142var log = Path.Combine(path, "aspire-tray.log"); 145Assert.Throws<IOException>(() => File.Move(log, Path.Combine(path, "old.log")));
WindowsTrayStartupSettingsTests.cs (8)
55Assert.False(Directory.Exists(Path.GetDirectoryName(installation.Bootstrap))); 117store.Value = WindowsTrayStartupSettings.BuildRunCommand(installation.Bootstrap, Path.Combine(installation.Root, "different.exe")); 141Directory.CreateDirectory(Path.GetDirectoryName(installation.Bootstrap)!); 157File.WriteAllText(Path.ChangeExtension(installation.SourceGui, ".runtimeconfig.json"), "{}"); 171var cli = Path.Combine(installation.Root, "%INSTALL%.exe"); 211var bootstrap = Path.Combine(installation.Root, new string('a', 150), new string('b', 150), "aspire-tray-login.exe"); 227var cli = Path.Combine(installation.Root, new string('a', length - originalLength) + Path.GetFileName(installation.WindowsCli));
Binding.UDS.IntegrationTests (4)
UDSBindingTests.cs (4)
209return Path.Combine(Path.GetTempPath(), "unix1.txt"); 214return Path.Combine(Path.GetTempPath(), "invalid.txt");
blazor-devserver (6)
Server\Program.cs (5)
28var applicationDirectory = Path.GetDirectoryName(applicationPath)!; 29var name = Path.ChangeExtension(applicationPath, ".staticwebassets.runtime.json"); 30name = !File.Exists(name) ? Path.ChangeExtension(applicationPath, ".StaticWebAssets.xml") : name; 32var endpointsManifest = Path.ChangeExtension(applicationPath, ".staticwebassets.endpoints.json"); 45config.AddJsonFile(Path.Combine(applicationDirectory, "blazor-devserversettings.json"), optional: true, reloadOnChange: true);
Server\Startup.cs (1)
50var fileExtension = Path.GetExtension(ctx.Request.Path);
CatalogService (1)
CatalogApi.cs (1)
40var path = Path.Combine(environment.ContentRootPath, "Images", item.PictureFileName);
cdac-build-tool (4)
ComposeCommand.cs (3)
48baselinesDir = System.IO.Path.GetFullPath(baselinesDir); 60templateFilePath = System.IO.Path.GetFullPath(templateFilePath); 97var directory = System.IO.Path.GetDirectoryName(outputPath);
DirectoryBaselines.cs (1)
28var name = Path.GetFileNameWithoutExtension(file);
CodeStyleConfigFileGenerator (4)
Program.cs (3)
68var configDir = Path.Combine(outputDir, "config"); 91var configFilePath = Path.Combine(directory.FullName, configFileName); 205var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
ConfigurationSchemaGenerator (1)
ConfigSchemaGenerator.cs (1)
50var docPath = Path.ChangeExtension(path, "xml");
ConfigurationSchemaGenerator.Tests (2)
GeneratorTests.cs (2)
1595var outputPath = Path.Combine(Directory.GetCurrentDirectory(), "IntegrationTest.json"); 1606var baseline = File.ReadAllText(Path.Combine("Baselines", "IntegrationTest.baseline.json")).ReplaceLineEndings();
CreateLayout (59)
Program.cs (52)
163_outputPath = Path.GetFullPath(outputPath); 164_artifactsPath = Path.GetFullPath(artifactsPath); 225var destination = Path.Combine(_outputPath, "tray"); 229var source = Path.Combine(_trayDirectory, name); 230var target = Path.Combine(destination, name); 241var destination = Path.Combine(_outputPath, "tray"); 247File.Copy(Path.Combine(_trayDirectory, name), Path.Combine(destination, name), overwrite: true); 260var path = Path.Combine(_trayDirectory, relativePath); 267var executablePath = Path.Combine(_trayDirectory, "Contents", "MacOS", "aspire-tray"); 279CopyDirectory(_trayDirectory, Path.Combine(_outputPath, "tray", "Aspire Tray.app"), excludeSymbols: false); 293var managedDir = Path.Combine(_outputPath, "managed"); 301var managedExePath = Path.Combine(managedPublishPath, managedExeName); 307File.Copy(managedExePath, Path.Combine(managedDir, managedExeName), overwrite: true); 318var path = Path.Combine(publishPath, file); 325CopyDirectory(publishPath, Path.Combine(_outputPath, "terminalhost"), excludeSymbols: true); 332var destination = Path.Combine(_outputPath, "managed", file); 333Directory.CreateDirectory(Path.GetDirectoryName(destination)!); 334File.Copy(Path.Combine(publishPath, file), destination, overwrite: true); 345var source = Path.Combine(publishPath, "Aspire.Hosting.Native.Server" + extension); 346foreach (var requiredFile in new[] { source, Path.Combine(publishPath, "ats-contract.json") }) 353var destination = Path.Combine(_outputPath, "apphost-server"); 356File.Move(Path.Combine(destination, Path.GetFileName(source)), 357Path.Combine(destination, "aspire-apphost-server" + extension), overwrite: true); 387var dashboardExePath = Path.Combine(dashboardPublishPath, dashboardExeName); 393var wwwrootPath = Path.Combine(dashboardPublishPath, "wwwroot"); 399var blazorScriptPath = Path.Combine(wwwrootPath, "_framework", "blazor.web.js"); 408var sqliteLibraryPath = Path.Combine(dashboardPublishPath, sqliteLibraryName); 416var dashboardDir = Path.Combine(_outputPath, "dashboard"); 436var dcpDir = Path.Combine(_outputPath, "dcp"); 448var archivePath = Path.Combine(Path.GetDirectoryName(_outputPath)!, archiveName + ".tar.gz"); 464var topLevelDir = Path.GetFileName(_outputPath); 467var relativePath = Path.GetRelativePath(Path.GetDirectoryName(_outputPath)!, filePath).Replace('\\', '/'); 488Arguments = $"{(OperatingSystem.IsMacOS() ? "--no-xattrs " : "")}-czf \"{archivePath}\" -C \"{Path.GetDirectoryName(_outputPath)}\" \"{Path.GetFileName(_outputPath)}\"", 553Path.Combine(_artifactsPath, "bin", projectName, _configuration, targetFramework, "publish"), 570Path.Combine(_artifactsPath, "bin", projectName, _rid, _configuration, targetFramework, _rid, "publish"), 572Path.Combine(_artifactsPath, "bin", projectName, _configuration, targetFramework, _rid, "publish"), 574Path.Combine(_artifactsPath, "bin", projectName, _configuration, targetFramework, _rid, "native"), 582?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages"); 599var dcpPackagePath = Path.Combine(nugetPackages, dcpPackageName); 605.Select(d => (Path: d, Version: Version.TryParse(Path.GetFileName(d), out var v) ? v : null)) 612var toolsPath = Path.Combine(latestVersion.Path, "tools"); 623var oldPackagePath = Path.Combine(nugetPackages, oldPackageName); 633var toolsPath = Path.Combine(latestVersion, "tools"); 656var destFile = Path.Combine(destination, Path.GetFileName(file)); 673var destDir = Path.Combine(destination, Path.GetFileName(dir));
src\Shared\LinuxTrayPayload.cs (3)
24if (File.Exists(Path.ChangeExtension(path, ".runtimeconfig.json"))) 51var executable = Path.Combine(directory, ExecutableName); 60using var icon = File.OpenRead(Path.Combine(directory, IconName));
src\Shared\TerminalHostPayload.cs (2)
33=> GetRequiredFiles(rid).All(file => File.Exists(Path.Combine(directory, file)) && new FileInfo(Path.Combine(directory, file)).Length > 0);
src\Shared\WindowsTrayPayload.cs (2)
28var path = Path.Combine(directory, name); 38using var stream = File.OpenRead(Path.Combine(directory, ExecutableName));
crossgen2 (18)
parent\parent\Common\CommandLineHelpers.cs (12)
221zipFileName = zipFileName + "_" + Path.GetFileName(outputFilePath); 223zipFileName = Path.Combine(makeReproPath, Path.ChangeExtension(zipFileName, ".zip")); 341string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar; 342reproPackagePath = Path.Combine(reproFileDir, Path.GetFileName(originalPath)); 353string originalPdbPath = Path.ChangeExtension(originalPath, "pdb"); 357archive.CreateEntryFromFile(originalPdbPath, Path.ChangeExtension(reproPackagePath, "pdb")); 376string directoryName = Path.GetDirectoryName(pattern); 377string searchPattern = Path.GetFileName(pattern); 386string fullFileName = Path.GetFullPath(fileName); 388string simpleName = Path.GetFileNameWithoutExtension(fileName);
Program.cs (6)
203compositeRootPath = Path.GetDirectoryName(inputFile.Value); 224compositeRootPath = Path.GetDirectoryName(unrootedInputFile.Value); 356string inputFileExtension = Path.GetExtension(inFilePath); 359return Path.ChangeExtension(inFilePath, temporary ? ".ni.dll.tmp" : ".ni.dll"); 363return Path.ChangeExtension(inFilePath, temporary ? ".ni.exe.tmp" : ".ni.exe"); 518nonLocalGenericsModule = Path.GetFileNameWithoutExtension(nonLocalGenericsModule);
Crossgen2Tasks (52)
CommonFilePulledFromSdkRepo\RuntimeGraphCache.cs (1)
28if (!Path.IsPathRooted(runtimeJsonPath))
PrepareForReadyToRunCompilation.cs (20)
186outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb"); 187outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb"); 188crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\""; 209outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension); 210outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension); 211crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\""; 278MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec)); 281string compositeR2RImageBaseRelativePath = Path.ChangeExtension( 283"r2r" + Path.GetExtension(mainAssemblyRelativePath)); 307compositePDBImage = Path.ChangeExtension(compositeR2RImage, ".ni.pdb"); 308compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb"); 314compositePDBImage = Path.ChangeExtension(compositeR2RImage, perfmapExtension); 315compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension); 363: Path.ChangeExtension(relativePath, compilerExtension); 366: Path.ChangeExtension(relativePath, publishExtension); 368compilerOutputPath = Path.Combine(OutputPath, compilerOutputRelativePath); 369string publishOutputPath = Path.Combine(OutputPath, publishOutputRelativePath); 486bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec))); 487bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R; 491bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ResolveReadyToRunCompilers.cs (26)
300_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 301_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 302_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 307_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 308_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 309_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 316_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 317_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 318_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 328_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 329_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 330_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 335_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 336_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 339_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 343_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 353_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 354_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 359_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 360_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 369_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 370_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 381_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 382_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 417_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 424_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
RunReadyToRunCompiler.cs (5)
235if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 327result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 332result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 415Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
csc (18)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\';
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (9)
461Debug.Assert(Path.IsPathFullyQualified(clientDir)); 462var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 470commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 575Debug.Assert(Path.IsPathFullyQualified(clientDirectory)); 581if (Path.IsPathFullyQualified(serverInfo.processFilePath) && !File.Exists(serverInfo.processFilePath)) 715clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 819var result = Path.Combine(tempPath, ".roslyn"); 827FilePath = Path.Combine(mutexDirectory, name); 828GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (2)
118Debug.Assert(loggingFilePath is null || Path.IsPathFullyQualified(loggingFilePath)); 182loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\Csc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, CSharpCompiler.ResponseFileName);
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
54if (!Path.IsPathFullyQualified(dotNetHostPath)) 77var directoryName = Path.GetDirectoryName(dotNetHostPath);
src\roslyn\src\Compilers\Shared\StandardBuildEnvironment.cs (2)
20public string? GetTempPath() => Path.GetTempPath(); 21public string GetFullyQualifiedPath(string path) => Path.Combine(CurrentDirectory, path);
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 (2)
Csi.cs (2)
24string csiDirectory = Path.GetDirectoryName(typeof(Csi).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName); 32responseFile: Path.Combine(csiDirectory, InteractiveResponseFileName),
datacollector (4)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
datacollector.arm64 (4)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
dotnet (14)
Program.cs (14)
8Console.WriteLine($"13.5.0 [{Path.Combine(AppContext.BaseDirectory, "sdk")}]"); 45var setupExitCodePath = Path.Combine(AppContext.BaseDirectory, "setup-exit-code"); 66var dcpDirectory = Directory.CreateDirectory(Path.Combine(setupInstallPath, "bundle", "dcp")); 67var managedDirectory = Directory.CreateDirectory(Path.Combine(setupInstallPath, "bundle", "managed")); 68var dashboardDirectory = Directory.CreateDirectory(Path.Combine(setupInstallPath, "bundle", "dashboard")); 69File.WriteAllText(Path.Combine(dcpDirectory.FullName, OperatingSystem.IsWindows() ? "dcp.exe" : "dcp"), ""); 70File.WriteAllText(Path.Combine(managedDirectory.FullName, OperatingSystem.IsWindows() ? "aspire-managed.exe" : "aspire-managed"), ""); 71File.WriteAllText(Path.Combine(dashboardDirectory.FullName, OperatingSystem.IsWindows() ? "Aspire.Dashboard.exe" : "Aspire.Dashboard"), ""); 77if (File.Exists(Path.Combine(AppContext.BaseDirectory, "fail-version"))) 96aspireHome = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire"); 106Path.TrimEndingDirectorySeparator(Path.GetFullPath(path)), 107Path.TrimEndingDirectorySeparator(Path.GetFullPath(other)),
dotnet-aot (218)
AotResourceManagerProvider.cs (3)
46: Path.GetFullPath(sdkDirectory); 121string ownerAssemblyPath = Path.Join( 139string ownerAssemblyPath = Path.Join(
NativeEntryPoint.cs (2)
348string dotnetDll = Path.Join(sdkDir, "dotnet.dll"); 349string runtimeConfig = Path.Join(sdkDir, "dotnet.runtimeconfig.json");
parent\dotnet\CommandFactory\CommandResolution\AppBaseDllCommandResolver.cs (1)
21var localPath = Path.Combine(SdkPaths.SdkDirectory,
parent\dotnet\CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (4)
21return new DotnetToolsCommandResolver(Path.Combine(sdkRoot, "DotnetTools")); 32_dotnetToolPath = dotnetToolPath ?? Path.Combine(SdkPaths.SdkDirectory, "DotnetTools"); 44var packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, arguments.CommandName)); 48packageId = new DirectoryInfo(Path.Combine(_dotnetToolPath, aggregatePackageId));
parent\dotnet\CommandFactory\CommandResolution\PublishedPathCommandResolver.cs (2)
38var depsFilePath = Path.Combine(publishDirectory, $"{applicationName}.deps.json"); 48var runtimeConfigPath = Path.Combine(publishDirectory, $"{applicationName}.runtimeconfig.json");
parent\dotnet\CommandFactory\CommandResolution\PublishPathCommandSpecFactory.cs (1)
31var commandExtension = Path.GetExtension(commandPath);
parent\dotnet\CommandFactory\CommandResolution\RootedCommandResolver.cs (1)
20if (Path.IsPathRooted(commandResolverArguments.CommandName))
parent\dotnet\CommandFactory\CommandResolution\WindowsExePreferredCommandSpecFactory.cs (2)
20if (Path.GetExtension(commandPath).Equals(".cmd", StringComparison.OrdinalIgnoreCase)) 51var comSpec = Environment.GetEnvironmentVariable("ComSpec") ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
parent\dotnet\Commands\Format\FormatForwardingApp.cs (3)
16=> Path.Combine(SdkPaths.SdkDirectory, "DotnetTools", "dotnet-format", "dotnet-format.dll"); 19=> Path.Combine(SdkPaths.SdkDirectory, "DotnetTools", "dotnet-format", "dotnet-format.deps.json"); 22=> Path.Combine(SdkPaths.SdkDirectory, "DotnetTools", "dotnet-format", "dotnet-format.runtimeconfig.json");
parent\dotnet\Commands\Fsi\FsiForwardingApp.cs (2)
51var dllPath = Path.Combine(SdkPaths.SdkDirectory, FsiDirectoryName, FsiDllName); 58return Path.Combine(SdkPaths.SdkDirectory, FsiDirectoryName, FsiExeName);
parent\dotnet\Commands\MSBuild\MSBuildForwardingApp.cs (1)
58string loggerTypeLocation = Path.Combine(SdkPaths.SdkDirectory, "dotnet.dll");
parent\dotnet\Commands\Run\AotRunCommand.cs (3)
139?? Path.GetDirectoryName(entryPointFileFullPath)!; 309using var stream = File.OpenRead(Path.Join(SdkPaths.SdkDirectory, "dotnet.runtimeconfig.json")); 408entryPointFileFullPath = Path.GetFullPath(entryPointPath, currentDirectory);
parent\dotnet\Commands\Run\FileBasedAppRunPlan.cs (11)
93var successCacheFile = new FileInfo(Path.Join(artifactsPath, BuildSuccessCacheFileName)); 144string successCachePath = Path.Join(artifactsPath, BuildSuccessCacheFileName); 322FileSystemInfo implicitBuildFileInfo = new FileInfo(Path.Join(directory.FullName, implicitBuildFile.Name)); 346string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 347string binDirectory = Path.Join(artifactsPath, "bin", "debug"); 349Path.Join(binDirectory, fileNameWithoutExtension + FileNameSuffixes.CurrentPlatform.Exe), 350Path.Join(binDirectory, fileNameWithoutExtension + ".dll"), 351Path.Join(binDirectory, fileNameWithoutExtension + FileNameSuffixes.RuntimeConfigJson)); 419var successCacheFile = new FileInfo(Path.Join(inputs.ArtifactsPath, BuildSuccessCacheFileName)); 426var startCacheFile = new FileInfo(Path.Join(inputs.ArtifactsPath, BuildStartCacheFileName)); 462Path.IsPathFullyQualified(previousRunCommand) &&
parent\dotnet\Commands\Sdk\Check\SdkCheckCommand.cs (1)
34var configFilePath = Path.Combine(_dotnetPath, "sdk", dotnetVersion ?? Product.Version, "sdk-check-config.json");
parent\dotnet\Commands\Solution\List\SolutionListCommand.cs (1)
50.Select(folder => Path.GetDirectoryName(folder.Path.TrimStart('/')))];
parent\dotnet\Commands\Solution\Migrate\SolutionMigrateCommand.cs (1)
33string slnxFileFullPath = Path.ChangeExtension(slnFileFullPath, "slnx");
parent\dotnet\Commands\Solution\Remove\SolutionRemoveCommand.cs (5)
39.Select(p => Path.GetFullPath(p)) 40.Select(p => Path.GetRelativePath( 41Path.GetDirectoryName(solutionFileFullPath), 85if (project is null && !Path.HasExtension(projectPath)) 88.Where(p => projectPath.Equals(Path.GetFileNameWithoutExtension(p.DisplayName ?? p.FilePath)))
parent\dotnet\Commands\Test\MTP\ArtifactPostProcessingManager.cs (8)
175string tempDirectory = Path.Combine( 176Path.GetTempPath(), 184string manifestPath = Path.Combine(tempDirectory, "manifest.json"); 350return Path.GetFullPath(resultsDirectory); 359return Path.GetFullPath(artifactsResultsDirectory); 379return Path.GetDirectoryName(Path.GetFullPath(preferredInput.Path))!; 469string outputExtension = Path.GetExtension(processedArtifact.Path).ToLowerInvariant();
parent\dotnet\Commands\Test\MTP\ArtifactPostProcessingPlanner.cs (2)
79.GroupBy(artifact => Path.GetExtension(artifact.Path).ToLowerInvariant(), StringComparer.Ordinal) 169Path.GetExtension(artifact.Path),
parent\dotnet\Commands\Test\MTP\InvocationLifetimeCoordinator.cs (1)
94_ownerName = Path.GetFileNameWithoutExtension(owner.TargetPath);
parent\dotnet\Commands\Test\MTP\IPC\NamedPipeServer.cs (6)
18private static bool IsUnix => Path.DirectorySeparatorChar == '/'; 269Path.GetTempPath()); 270directory = Path.GetFullPath(directory); 294string path = Path.Combine(Path.GetFullPath(directory), name); 304string probePath = Path.Combine(directory, $"testingplatform.probe.{Guid.NewGuid():N}");
parent\dotnet\Commands\Test\MTP\Logger.cs (2)
59_traceFilePath = TraceEnabled ? Path.GetFullPath(traceFilePath!) : null; 61string? directoryPath = Path.GetDirectoryName(_traceFilePath);
parent\dotnet\Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (9)
417: Path.GetFullPath(directory, invocationWorkingDirectory)) 481string fullPath = Path.GetFullPath(responseFilePath, workingDirectory); 858if (configurationFilePath is not null && !Path.IsPathFullyQualified(configurationFilePath)) 860configurationFilePath = Path.GetFullPath(configurationFilePath, workingDirectory); 865configurationFilePath = Path.ChangeExtension( 866Path.GetFullPath(module.TargetPath, workingDirectory), 1149string fullPath = Path.GetFullPath(argument[1..], workingDirectory); 1282string name = Path.GetFileNameWithoutExtension(key.Assembly); 1284.Where(module => FileUtilities.PathComparer.Equals(Path.GetFileNameWithoutExtension(module.TargetPath), name) &&
parent\dotnet\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))
parent\dotnet\Commands\Test\MTP\Terminal\FileUtilities.cs (2)
22string pathWithUpperCase = Path.Combine(Path.GetTempPath(), "CASESENSITIVETEST" + Guid.NewGuid().ToString("N"));
parent\dotnet\Commands\Test\MTP\Terminal\TestProgressState.cs (1)
68public string AssemblyName { get; } = Path.GetFileName(assembly)!;
parent\dotnet\Commands\Test\MTP\TestApplication.cs (4)
467processStartInfo.Environment[Module.DotnetRootArchVariableName] = Path.GetDirectoryName(new Muxer().MuxerPath); 591string path = Path.Combine(Path.GetTempPath(), $"dotnet-test-http-{Guid.NewGuid():N}.rsp"); 669Path.GetFileNameWithoutExtension(module.RunProperties.Command),
parent\dotnet\Commands\Test\MTP\TestCommandOptions.cs (3)
88resultsDirectory = Path.GetFullPath(resultsDirectory); 94configFile = Path.GetFullPath(configFile); 100diagnosticOutputDirectory = Path.GetFullPath(diagnosticOutputDirectory);
parent\dotnet\Commands\Test\MTP\TestResultsDirectoryResolver.cs (25)
30[.. Path.GetInvalidFileNameChars(), Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 113string resolved = Path.GetFullPath( 114Path.Combine(resultsRoot, GetProjectDirectoryName(module), GetPivotDirectoryName(module))); 133return Path.Combine(artifactsPath, ArtifactsTestDirectoryName); 137? Path.Combine(workingDirectory, DefaultResultsDirectoryName) 154string normalizedRoot = Path.TrimEndingDirectorySeparator(Path.GetFullPath(root)); 155string relative = Path.GetRelativePath(normalizedRoot, candidate); 158&& !relative.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal) 159&& !relative.StartsWith(".." + Path.AltDirectorySeparatorChar, StringComparison.Ordinal) 160&& !Path.IsPathRooted(relative); 173string? moduleDirectory = Path.GetDirectoryName(GetProjectPath(module, workingDirectory)); 196string firstRoot = Path.GetPathRoot(first) ?? string.Empty; 197string secondRoot = Path.GetPathRoot(second) ?? string.Empty; 203char[] separators = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 215return Path.Combine(firstRoot, string.Join(Path.DirectorySeparatorChar, firstSegments, 0, shared)); 272? Path.GetFileNameWithoutExtension(module.TargetPath) 273: Path.GetFileNameWithoutExtension(module.ProjectFullPath); 290string relativePath = Path.GetRelativePath(identityRoot, path) 291.Replace(Path.DirectorySeparatorChar, '/'); 300return string.IsNullOrEmpty(path) ? string.Empty : Path.GetFullPath(path, basePath);
parent\dotnet\Commands\Test\VSTest\VSTestArtifactsDirectory.cs (5)
175throw new IOException($"Could not create a private artifacts directory for the test run under '{Path.GetDirectoryName(path)}'.", ex); 185throw new IOException($"Could not create a private artifacts directory for the test run under '{Path.GetDirectoryName(path)}'."); 372internal /*internal for testing*/ static string NewCandidatePath() => Path.GetFullPath(Path.Combine(GetBaseDirectory(), Guid.NewGuid().ToString())); 437return Path.GetTempPath();
parent\dotnet\Commands\Test\VSTest\VSTestForwardingApp.cs (2)
62return Path.Combine(SdkPaths.SdkDirectory, VstestAppName); 74["VSTEST_DOTNET_ROOT_PATH"] = Path.GetDirectoryName(new Muxer().MuxerPath),
parent\dotnet\Commands\Workload\FileBasedWorkloadInstallationRecordRepositoryFactory.cs (2)
27=> File.Exists(Path.Combine(dotnetDir, "metadata", "workloads", sdkFeatureBand.ToString(), "userlocal")); 37return new FileBasedInstallationRecordRepository(Path.Combine(workloadRootDir, "metadata", "workloads"));
parent\dotnet\Commands\Workload\Install\FileBasedManifestInstaller.cs (4)
45var extractionPath = Path.Combine(tempPackagesDir.Value, "dotnet-sdk-advertising-temp", $"{Path.GetFileName(nupkgPath)}-extracted"); 62Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!); 63FileAccessRetrier.RetryOnMoveAccessFailure(() => DirectoryPath.MoveDirectory(Path.Combine(extractionPath, "data"), targetPath));
parent\dotnet\Commands\Workload\Install\WorkloadAdvertisingManifestUpdater.cs (14)
107string path = Path.Combine(WorkloadInstallType.GetInstallStateFolder(sdkFeatureBand, dotnetDir), "default.json"); 118Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 134var workloadSetVersionFilePath = Path.Combine(advertisedPath, Constants.workloadSetVersionFileName); 178var overlayProvider = new TempDirectoryWorkloadManifestProvider(Path.Combine(_userProfileDir, "sdk-advertising", _sdkFeatureBand.ToString()), _sdkFeatureBand.ToString()); 210Path.GetFileName(path).StartsWith(manifestPackageId.ToString(), StringComparison.OrdinalIgnoreCase) && 233File.WriteAllText(Path.Combine(adManifestPath, "AdvertisedManifestFeatureBand.txt"), band.ToString()); 246File.WriteAllText(Path.Combine(adManifestPath, Constants.workloadSetVersionFileName), workloadSetVersion); 272var versionDir = Path.GetDirectoryName(packagePath); 277var idDir = Path.GetDirectoryName(versionDir); 312var manifestPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "WorkloadManifest.json"); 322var adManifestFeatureBandPath = Path.Combine(GetAdvertisingManifestPath(_sdkFeatureBand, manifestId), "AdvertisedManifestFeatureBand.txt"); 399private string GetAdvertisingManifestSentinelPath(SdkFeatureBand featureBand) => Path.Combine(_userProfileDir, $".workloadAdvertisingManifestSentinel{featureBand}"); 403internal static string GetAdvertisingWorkloadsFilePath(string userProfileDir, SdkFeatureBand featureBand) => Path.Combine(userProfileDir, $".workloadAdvertisingUpdates{featureBand}"); 405private string GetAdvertisingManifestPath(SdkFeatureBand featureBand, ManifestId manifestId) => Path.Combine(_userProfileDir, "sdk-advertising", featureBand.ToString(), manifestId.ToString());
parent\dotnet\Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any()) 22.Select(path => new SdkFeatureBand(Path.GetFileName(path))); 32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir); 36.Select(file => new WorkloadId(Path.GetFileName(file))); 46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString()); 49var pathDir = Path.GetDirectoryName(path); 60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
parent\dotnet\Commands\Workload\Install\WorkloadInstallRecords\WindowsWorkloadInstallationRecordReader.cs (1)
41using RegistryKey? workloadKey = baseKey.OpenSubKey(Path.Combine(basePath, $"{sdkFeatureBand}"));
parent\dotnet\Commands\Workload\Install\WorkloadManifestUpdater.cs (1)
35var dotnetPath = Path.GetDirectoryName(Environment.ProcessPath);
parent\dotnet\Commands\Workload\WorkloadInfoHelper.cs (3)
45DotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath)!; 167var useWorkloadSets = InstallStateContents.FromPath(Path.Combine(WorkloadInstallType.GetInstallStateFolder(_currentSdkFeatureBand, UserLocalPath), "default.json")).ShouldUseWorkloadSets(); 195var dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
parent\dotnet\Commands\Workload\WorkloadInstallDetector.cs (1)
36dotnetDir = string.IsNullOrWhiteSpace(dotnetDir) ? Path.GetDirectoryName(Environment.ProcessPath) : dotnetDir;
parent\dotnet\FirstRunExperience.cs (1)
76string toolPath = Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, s_toolPathSentinelFileName);
parent\dotnet\Installer\Windows\TrustedMachinePath.cs (6)
58public static string ProgramDataDotnetRoot { get; } = Path.Combine( 67string fullPath = Path.GetFullPath(path); 68string fullRoot = Path.GetFullPath(root).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 71fullPath.StartsWith(fullRoot + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase);
parent\dotnet\MsbuildProject.cs (2)
277string fullPath = Path.GetFullPath(reference); 279ret.Add(Path.GetRelativePath(ProjectDirectory, fullPath));
parent\dotnet\NuGetForwardingApp.cs (1)
42return Path.Combine(
parent\dotnet\NugetPackageDownloader\NuGetPackageDownloader.cs (15)
198Directory.CreateDirectory(Path.GetDirectoryName(nupkgPath)); 299_reporter.WriteLine(CliStrings.VerifyingNuGetPackageSignature, Path.GetFileNameWithoutExtension(nupkgPath)); 305_reporter.WriteLine(CliStrings.NuGetPackageShouldNotBeSigned, Path.GetFileNameWithoutExtension(nupkgPath)); 320return Path.Combine( 356Path.GetRelativePath(targetFolder.Value, p).Equals("data/UnixFilePermissions.xml", 364string fullPath = Path.GetFullPath(Path.Combine(targetFolder.Value, fileAndPermission.Path)); 369if (!fullPath.StartsWith(Path.GetFullPath(targetFolder.Value) + Path.DirectorySeparatorChar)) 440return Path.GetRelativePath(targetPath, p).StartsWith("tools" + Path.DirectorySeparatorChar) && 441(Path.GetFileName(p) == Path.GetFileNameWithoutExtension(p)); 461allowListNuspec.Contains(Path.GetFileName(f), comparer: StringComparer.OrdinalIgnoreCase))) 520string nugetConfigFileName = Path.GetFileName(packageSourceLocation.NugetConfig.Value.Value);
parent\dotnet\NugetPackageDownloader\PackageSourceLocation.cs (2)
47if (!Uri.IsWellFormedUriString(feed, UriKind.Absolute) && !Path.IsPathRooted(feed)) 49localFeedsThatIsRooted[index] = Path.GetFullPath(feed, basePath);
parent\dotnet\Parser.cs (1)
432var filePath = Path.GetFullPath(tokenToReplace);
parent\dotnet\SdkVulnerability\SdkReleaseMetadataCache.cs (7)
28Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, CacheDirectoryName), 52var sentinelPath = Path.Combine(_cacheDirectory, SentinelFileName); 78if (sdkVersion.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) 157var tempPath = Path.Combine(_cacheDirectory, Path.GetRandomFileName()); 174var sentinelPath = Path.Combine(_cacheDirectory, SentinelFileName); 192Path.Combine(_cacheDirectory, $"{SummaryFilePrefix}{sdkVersion}.json");
parent\dotnet\ShellShim\ZshDetector.cs (1)
24if (Path.GetFileName(environmentVariable).Equals(ZshFileName, StringComparison.OrdinalIgnoreCase))
parent\dotnet\SlnfFileHelper.cs (11)
35return path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 45return path.Replace(Path.DirectorySeparatorChar, '\\'); 71var slnfDirectory = Path.GetDirectoryName(Path.GetFullPath(slnfPath)) ?? string.Empty; 72var parentSolutionFullPath = Path.GetFullPath(parentSolutionPath, slnfDirectory); 73var relativeSolutionPath = Path.GetRelativePath(slnfDirectory, parentSolutionFullPath); 99var slnfDirectory = Path.GetDirectoryName(Path.GetFullPath(slnfPath)) ?? string.Empty; 103if (Path.IsPathRooted(parentSolutionPath)) 105relativeSolutionPath = Path.GetRelativePath(slnfDirectory, parentSolutionPath);
parent\dotnet\SlnFileFactory.cs (5)
24if (string.IsNullOrWhiteSpace(slnFileOrDirectory) || slnFileOrDirectory.IndexOfAny(Path.GetInvalidPathChars()) != -1) 30return Path.GetFullPath(slnFileOrDirectory); 47return Path.GetFullPath(files.Single()); 115originalSolutionPathAbsolute = Path.GetFullPath(originalSolutionPath, Path.GetDirectoryName(filteredSolutionPath));
parent\dotnet\Telemetry\DevDeviceIDGetter.cs (7)
56cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceid"); 60cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 71string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 104cacheFilePath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools", "deviceId"); 108cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 116string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 124string directory = Path.GetDirectoryName(filePath);
parent\dotnet\Telemetry\TelemetryClient.cs (1)
199Path.Join(CliFolderPathCalculator.DotnetUserProfileFolderPath, "internal-microsoft", "detector.json"),
parent\dotnet\Telemetry\TelemetryCommonProperties.cs (1)
77{ MachineId, _userLevelCacheWriter.RunWithCacheInFilePath(Path.Combine(CliFolderPathCalculator.DotnetUserProfileFolderPath, $"{MachineIdCacheKey}.v1.dotnetUserLevelCache"), GetMachineId) },
parent\dotnet\ToolManifest\ToolManifestFinder.cs (3)
232.Any(filename => Path.GetExtension(filename).Equals(".sln", StringComparison.OrdinalIgnoreCase) || Path.GetExtension(filename).Equals(".slnx", StringComparison.OrdinalIgnoreCase)) 253string manifestFileLocation = Path.Combine(folderPath.Value, Constants.ToolManifestFileName);
parent\dotnet\ToolPackage\LocalToolsResolverCache.cs (1)
28cacheDirectory ?? new DirectoryPath(Path.Combine(CliFolderPathCalculator.ToolsResolverCachePath));
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
dotnet-build-cache (12)
Program.cs (1)
87path = Path.GetFullPath(path);
src\runtime\src\tasks\Common\InvocationCache\InvocationCacheConfiguration.cs (8)
32return string.IsNullOrEmpty(localAppData) || !Path.IsPathRooted(localAppData) 34: Path.Combine(localAppData, cacheDirectoryName); 41if (!string.IsNullOrEmpty(cacheHome) && Path.IsPathRooted(cacheHome)) 42return Path.Combine(cacheHome, cacheDirectoryName); 46if (string.IsNullOrEmpty(home) || !Path.IsPathRooted(home)) 48if (string.IsNullOrEmpty(home) || !Path.IsPathRooted(home)) 52? Path.Combine(home, "Library", "Caches", cacheDirectoryName) 53: Path.Combine(home, ".cache", cacheDirectoryName);
src\runtime\src\tasks\Common\InvocationCache\InvocationCachePurge.cs (3)
20string entriesDirectory = Path.Combine(cacheDirectory, versionDirectory); 25if (!InvocationCacheEntry.IsEntryName(Path.GetFileName(entry))) 60string marker = Path.Combine(entry, InvocationCacheEntry.LastUsedFileName);
dotnet-dev-certs (37)
Program.cs (2)
447reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}"); 454reporter.Verbose($"The certificate was exported to {Path.GetFullPath(exportPath.Value())}");
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 156var tmpFile = Path.GetTempFileName(); 207var certificatePath = Path.GetTempFileName(); 347var certificatePath = Path.GetTempFileName(); 377Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 817return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 849var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 852var nssDb = Path.GetFullPath(path); 1056var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-format (25)
Analyzers\CodeStyleInformationProvider.cs (4)
14private static readonly string s_executingPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty; 16private readonly string _featuresPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.Features.dll"); 17private readonly string _featuresCSharpPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.CSharp.Features.dll"); 18private readonly string _featuresVisualBasicPath = Path.Combine(s_executingPath, "Microsoft.CodeAnalysis.VisualBasic.Features.dll");
Commands\FormatCommandCommon.cs (5)
213formatOptions = Path.GetExtension(binaryLogPath)?.Equals(".binlog") == false 214? (formatOptions with { BinaryLogPath = Path.ChangeExtension(binaryLogPath, ".binlog") }) 330var workspaceDirectory = Path.GetDirectoryName(workspaceFilePath); 342path[^1] != Path.DirectorySeparatorChar 343? path + Path.DirectorySeparatorChar
Formatters\OrganizeImportsFormatter.cs (1)
61logger.LogWarning(Resources.Unable_to_organize_imports_for_0_The_document_is_too_complex, Path.GetFileName(sourceDocument.FilePath));
ReportWriter.cs (3)
14var reportFolderPath = Path.GetDirectoryName(reportFilePath); 41return Path.Combine(Environment.CurrentDirectory, defaultReportName); 45return Path.Combine(reportPath, defaultReportName);
Utilities\EditorConfigFinder.cs (2)
17var directoryName = Path.GetDirectoryName(filePath); 30var editorConfigPath = Path.Combine(directory.FullName, ".editorconfig");
Utilities\GeneratedCodeUtilities.cs (3)
41var fileName = Path.GetFileName(filePath); 47var extension = Path.GetExtension(fileName); 50var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath);
Workspaces\FolderWorkspace_FolderSolutionLoader.cs (2)
18var absoluteFolderPath = Path.GetFullPath(folderPath, Directory.GetCurrentDirectory()); 78var filePath = Path.GetFullPath(paths[index], folderPath);
Workspaces\MSBuildWorkspaceFinder.cs (5)
27if (!Path.IsPathRooted(workspacePath)) 29workspacePath = Path.GetFullPath(workspacePath, searchDirectory); 60var workspaceExtension = Path.GetExtension(workspacePath); 72throw new FileNotFoundException(string.Format(Resources.The_file_0_does_not_appear_to_be_a_valid_project_solution_file_or_file_based_app, Path.GetFileName(workspacePath))); 93.Where(f => !DnxProjectExtension.Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase));
dotnet-getdocument (14)
Commands\InvokeCommand.cs (11)
43var thisPath = Path.GetFullPath(Path.GetDirectoryName(typeof(InvokeCommand).Assembly.Location)); 47var targetDirectory = Path.GetDirectoryName(assemblyPath); 60toolsDirectory = Path.Combine( 64var executableSource = Path.Combine(toolsDirectory, InsideManName + ".exe"); 65executable = Path.Combine(targetDirectory, InsideManName + ".exe"); 84toolsDirectory = Path.Combine(thisPath, $"net{targetFramework.Version}"); 91args.Add(Path.ChangeExtension(assemblyPath, ".deps.json")); 105args.Add(packageFolder.TrimEnd(Path.DirectorySeparatorChar)); 109var runtimeConfigPath = Path.ChangeExtension(assemblyPath, ".runtimeconfig.json"); 125args.Add(Path.Combine(toolsDirectory, InsideManName + ".dll"));
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-Microsoft.XmlSerializer.Generator (5)
Sgen.cs (5)
322outputDirectory ??= (gac ? Environment.CurrentDirectory : Path.GetDirectoryName(assembly.Location)); 337string codePath = Path.Combine(outputDirectory, serializerName + ".cs"); 479string path = Path.IsPathRooted(assemblyName) ? assemblyName : Path.GetFullPath(assemblyName); 592string filename = Path.GetFileNameWithoutExtension(reference);
dotnet-openapi (15)
Commands\BaseCommand.cs (12)
137return File.Exists(Path.GetFullPath(file)) && file.EndsWith(".csproj", StringComparison.Ordinal); 287var directory = Path.GetDirectoryName(fullPath); 288destinationPath = GetUniqueFileName(directory, Path.GetFileNameWithoutExtension(fileName), Path.GetExtension(fileName)); 354var filePath = Path.Combine(directory, fileName + extension); 368filePath = Path.Combine(directory, uniqueName + extension); 382var fileName = Path.GetFileName(contentDisposition.FileName); 383if (!Path.HasExtension(fileName)) 396if (!Path.HasExtension(lastSegment)) 449return Path.IsPathFullyQualified(path) 451: Path.GetFullPath(path, WorkingDirectory); 561var destinationDirectory = Path.GetDirectoryName(destinationPath);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-razorpagegenerator (4)
Program.cs (4)
63@class.ClassName = Path.GetFileNameWithoutExtension(document.Source.FilePath); 134var generatedCodeFilePath = Path.ChangeExtension(projectItem.PhysicalPath, ".Designer.cs"); 194var basePath = System.IO.Path.GetDirectoryName(_source.PhysicalPath); 214var includeFileContent = File.ReadAllText(System.IO.Path.Combine(basePath, includeFileName));
dotnet-sourcelink (1)
dotnet-sql-cache (3)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
dotnet-suggest (11)
DotnetMuxer.cs (1)
32var muxerCandidate = new FileInfo(System.IO.Path.Combine(muxerDir.FullName, muxerFileName));
DotnetProfileDirectory.cs (1)
30dotnetProfileDirectory = Path.Combine(home, DotnetProfileDirectoryName);
FileEnumerator.cs (1)
20.Select(p => Path.GetFileNameWithoutExtension(p.FullName));
FileSuggestionRegistration.cs (2)
28_registrationConfigurationFilePath = Path.Combine(testDirectoryOverride, RegistrationFileName); 34_registrationConfigurationFilePath = Path.Combine(userProfile, RegistrationFileName);
GlobalToolsSuggestionRegistration.cs (2)
25? Path.Combine(directory, "tools") 44new Registration(Path.Combine(_nullableToolsShimPath, p)));
SuggestionDispatcher.cs (2)
188var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(r.ExecutablePath); 209targetExeName = Path.GetFileName(targetExeName).RemoveExeExtension();
SuggestionShellScriptHandler.cs (2)
32var directory = Path.GetDirectoryName(assemblyLocation); 33string scriptContent = File.ReadAllText(Path.Combine(directory, scriptName));
dotnet-svcutil-lib (165)
Bootstrapper\SvcutilBootstrapper.cs (6)
99var projectFullPath = Path.Combine(this.Options.BootstrapPath.FullName, nameof(SvcutilBootstrapper), SvcutilBootstrapper.ProjectName); 104Directory.CreateDirectory(Path.GetDirectoryName(projectFullPath)); 117var svcutilPkgRef = ProjectDependency.FromAssembly(Path.Combine(Path.GetDirectoryName(Tool.FullPath), Tool.AssemblyName + ".dll")); 171string programFilePath = Path.Combine(this.MSBuildProj.DirectoryPath, "Program.cs"); 178var paramsFilePath = Path.Combine(this.MSBuildProj.DirectoryPath, s_bootstrapperParamsFileName);
CodeDomFixup\CodeDomHelpers.cs (1)
248name.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 &&
CodeSerializer.cs (3)
144if (!string.IsNullOrWhiteSpace(fileName) && fileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1) 158if (!string.IsNullOrWhiteSpace(fileName) && fileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1) 174if (!string.IsNullOrWhiteSpace(fileName) && fileName.IndexOfAny(Path.GetInvalidFileNameChars()) == -1)
CommandProcessorOptions.cs (23)
171fileOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(fileUri.LocalPath))); 395workingDirectory = Path.IsPathRooted(this.OutputFile.OriginalPath()) ? 396Path.GetDirectoryName(this.OutputFile.FullName) : Path.GetDirectoryName(Path.Combine(Directory.GetCurrentDirectory(), this.OutputFile.OriginalPath())); 403new DirectoryInfo(Path.Combine(workingDirectory, this.UpdateServiceReferenceFolder)) : 413if (!Path.IsPathRooted(originalDirSpec)) 416this.OutputDir = new DirectoryInfo(Path.Combine(workingDirectory, originalDirSpec)); 492var updateFileName = Path.GetFileName(this.UpdateServiceReferenceFolder); 497this.UpdateServiceReferenceFolder = Path.GetDirectoryName(this.UpdateServiceReferenceFolder); 506var paramsFiles = jsonFiles.Except(excludeJsonFiles).Where(fn => Path.GetFileName(fn).Equals(CommandProcessorOptions.SvcutilParamsFileName, RuntimeEnvironmentHelper.FileStringComparison) || 507Path.GetFileName(fn).Equals(CommandProcessorOptions.WCFCSParamsFileName, RuntimeEnvironmentHelper.FileStringComparison)); 521var svcRefNames = paramsFiles.Select(pf => { PathHelper.GetRelativePath(Path.GetDirectoryName(pf), new DirectoryInfo(projectDir), out var relPath); return relPath; }) 531var svcutilParmasFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.SvcutilParamsFileName); 534var wcfcsParamsFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.WCFCSParamsFileName); 542var relDir = Path.GetDirectoryName(fileRelPath); 551if (Path.GetFileName(paramsFilePath).Equals(CommandProcessorOptions.WCFCSParamsFileName)) 561updateOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(paramsFilePath))); 580var tempDir = Path.GetTempPath(); 584this.BootstrapPath = new DirectoryInfo(Path.Combine(tempDir, baseDirName, sessionDirName)); 704var projectFullPath = Path.Combine(this.BootstrapPath.FullName, "TFMResolver", "TFMResolver.csproj"); 710Directory.Delete(Path.GetDirectoryName(projectFullPath)); 853string projFolder = Path.Combine(this.BootstrapPath.FullName, nameof(SvcutilBootstrapper));
FrameworkFork\Microsoft.CodeDom\Compiler\CodeValidator.cs (1)
1024if (e.FileName.IndexOfAny(Path.GetInvalidPathChars()) != -1)
FrameworkFork\Microsoft.CodeDom\Compiler\RedistVersionInfo.cs (1)
52dir = Path.Combine(comPlus_InstallRoot, comPlus_Version);
FrameworkFork\Microsoft.CodeDom\Compiler\TempFiles.cs (4)
216string full = Path.GetFullPath(_basePath); 305if (String.IsNullOrEmpty(tempDir)) tempDir = Path.GetTempPath(); 307string randomFileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (3)
600string asmblFileDir = Path.GetDirectoryName(asmblFilePath); 610string fileName = Path.GetFileName(s); 3223if (!Path.GetExtension(outputAssemblyFile).Equals(extensionWithDot, StringComparison.OrdinalIgnoreCase))
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (1)
1894dumpFileName = Path.GetFullPath(string.Concat(dumpFileNameBase, i.ToString(), ".bmx"));
FrameworkFork\Microsoft.Xml\Xml\XmlResolver.cs (1)
49uri = new Uri(Path.GetFullPath(relativeUri));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (1)
127string assemblyName = System.IO.Path.GetFileName(assembly.Location);
Metadata\MetadataDocumentLoader.cs (7)
271!isUrl && Uri.TryCreate(Path.Combine(basePath, uri), UriKind.Absolute, out serviceUri)) 490if (Uri.TryCreate(Path.Combine(basePath, schemaLocation), UriKind.Absolute, out Uri schemaFile)) 532fullFileName = Path.Combine(basePath, schemaUri.Segments[schemaUri.Segments.Length - 1]); 544if (!File.Exists(fullFileName) && !Path.IsPathRooted(schemaLocation)) 546fullFileName = Path.Combine(basePath, schemaLocation); 550fullFileName = Path.Combine(basePath, Path.GetFileName(schemaLocation));
Metadata\MetadataDocumentSaver.cs (7)
146var updatedLocation = Path.Combine(this.DirectoryPath, Path.GetFileName(location)); 223wsdl.RetrievalUrl = Path.GetFileName(filePath); 245schema.SourceUri = Path.GetFileName(filePath); 285var filePath = Path.Combine(this.DirectoryPath, import.Location); 306this.FileNameMgr.AddFileName(this.DirectoryPath, Path.GetFileName(uri.LocalPath), extension); 313var dirPath = Path.GetDirectoryName(filePath);
Metadata\MetadataFileNameManager.cs (10)
53filePath = Path.IsPathRooted(uniqueFileNameWithExtension) ? uniqueFileNameWithExtension : Path.Combine(basePath, uniqueFileNameWithExtension); 83var filePath = Path.IsPathRooted(fileNameWithExtension) ? fileNameWithExtension : Path.Combine(basePath, fileNameWithExtension); 158if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1) 169if (!string.IsNullOrEmpty(extension) && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 188var dirPath = Path.GetDirectoryName(filePath); 237string dirPath = Path.GetDirectoryName(path); 252string filename = Path.GetFileName(path);
Metadata\ServiceDescriptor.cs (1)
105string toolPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
OutputPathHelper.cs (8)
28string combinedPath = Path.Combine(directoryPath, outputFileWithExtension); 36if (extension != null && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 55if (!directory.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 57return TryGetFullPath(directory + Path.DirectorySeparatorChar, null); 68string directoryPath = Path.GetDirectoryName(path); 88return Path.GetFullPath(path); 164if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
Shared\MSBuildProj.cs (31)
67public string FullPath { get { return Path.Combine(DirectoryPath, FileName); } } 161using (var safeLogger = await SafeLogger.WriteStartOperationAsync(logger, $"Parsing project {Path.GetFileName(projectFullPath)}").ConfigureAwait(false)) 163projectFullPath = Path.GetFullPath(projectFullPath); 167FileName = Path.GetFileName(projectFullPath), 168DirectoryPath = Path.GetDirectoryName(projectFullPath) 297if (!Path.IsPathRooted(binReference)) 316fullPath = new FileInfo(Path.Combine(msbuildProj.DirectoryPath, binReference)).FullName; 338fullPath = Path.Combine(fullPath, binReference); 340else if (Directory.Exists(Path.Combine(msbuildProj.DirectoryPath, fullPath))) 342fullPath = Path.Combine(msbuildProj.DirectoryPath, fullPath, binReference); 385fullPath = Path.GetFullPath(fullPath); 387string projectName = Path.GetFileNameWithoutExtension(fullPath); 388string projectExtension = Path.GetExtension(fullPath); 389string projectDir = Path.GetDirectoryName(fullPath); 427string filePath = Path.Combine(dirPath, DirBuildProps); 558basePath = dependency.FullPath.Substring(0, dependency.FullPath.LastIndexOf(Path.DirectorySeparatorChar)); 563new XAttribute("Include", Path.Combine(basePath, $"{framework}\\**")), 802var assetsFile = new FileInfo(Path.Combine(this.DirectoryPath, "obj", "project.assets.json")).FullName; 821if (Path.GetExtension(compiletimeAssembly.Path) == ".dll") 823var dependency = ProjectDependency.FromPackage(Path.GetFileNameWithoutExtension(compiletimeAssembly.Path), lib.Name, lib.Version.ToNormalizedString()); 879if (!Path.IsPathRooted(outputPath)) 881outputPath = Path.Combine(this.DirectoryPath, outputPath.Trim(new char[] { '\"' })); 885Path.Combine(outputPath, $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json") : 900var targetLib = Path.GetFileName(this._resolvedProperties["TargetPath"].Trim('\"')); 903targetLib = $"{Path.ChangeExtension(this.FileName, ".dll")}"; 917if (!Path.GetFileName(assetPath).Equals(targetLib, RuntimeEnvironmentHelper.FileStringComparison)) 919dependency = ProjectDependency.FromAssembly(Path.Combine(outputPath, assetPath)); 1001var fileName = $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json"; 1010.Where(d => Path.GetFileName(d).Equals(fileName, RuntimeEnvironmentHelper.FileStringComparison)) 1011.Where(f => PathHelper.GetFolderName(Path.GetDirectoryName(f)) == this.TargetFramework || Directory.GetParent(Directory.GetParent(f).FullName).Name == this.TargetFramework)
Shared\Options\UpdateOptions.cs (2)
110if (this.OutputFile != null && !Path.IsPathRooted(this.OutputFile.OriginalPath())) 112this.OutputFile = new FileInfo(Path.Combine(optionsFileDirectory.FullName, this.OutputFile.OriginalPath()));
Shared\Options\WCFCSUpdateOptions.cs (1)
127_deserializedCollectionAssemblies.Add(System.IO.Path.GetFileNameWithoutExtension(item2.Trim()));
Shared\ProjectDependency.cs (12)
75if (!string.IsNullOrWhiteSpace(filePath) && Path.GetInvalidPathChars().Intersect(filePath).Count() > 0) 80if (!string.IsNullOrWhiteSpace(packageName) && Path.GetInvalidFileNameChars().Intersect(packageName).Count() > 0) 108if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(AssemblyName), ext, StringComparison.OrdinalIgnoreCase) == 0)) 115(s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0)); 118if (s_exeExtensions.Any((ext) => String.Compare(Path.GetExtension(packageName), ext, StringComparison.OrdinalIgnoreCase) == 0)) 133fileHasKnownExtension = s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0); 137fileHasKnownExtension = s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0); 145this.FullPath = fileHasKnownExtension ? Path.GetFullPath(filePath) : filePath; 150fileHasKnownExtension ? Path.GetFileNameWithoutExtension(filePath) : Path.GetFileName(filePath); 310if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0)) 315else if (s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0))
Shared\ProjectPropertyResolver.cs (11)
32var workingDirectory = Path.GetDirectoryName(projectPath); 146var dotnetDir = Path.GetDirectoryName(typeof(int).Assembly.Location); 149while (dotnetDir != null && !(File.Exists(Path.Combine(dotnetDir, "dotnet")) || File.Exists(Path.Combine(dotnetDir, "dotnet.exe")))) 151dotnetDir = Path.GetDirectoryName(dotnetDir); 159s_sdkPath = Path.Combine(dotnetDir, "sdk", sdkVersion); 183if (Path.GetFileNameWithoutExtension(assemblyPath) == "Microsoft.Build") 202var projectDir = Path.GetDirectoryName(projectPath); 205var depsFiles = Directory.GetFiles(projectDir, $"{Path.GetFileNameWithoutExtension(projectPath)}.deps.json", SearchOption.AllDirectories) 217var projName = Path.GetFileNameWithoutExtension(projectPath); 242var chars = Path.GetInvalidFileNameChars();
Shared\Utilities\PathHelper.cs (21)
61if (!isUrl && (Uri.TryCreate(Path.Combine(basePath, input), UriKind.Absolute, out var uri)) && uri.Scheme == "file") 85filePath = Path.Combine(directory.FullName, relPath); 109if (Path.IsPathRooted(childPath)) 112var childFileName = Path.GetFileName(childPath); 113var childDirectory = childFileName.Contains("*") ? Path.GetDirectoryName(childPath) : childPath; 114var parentSegments = Path.GetFullPath(parentPath.FullName).Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); 115var childSegments = Path.GetFullPath(childDirectory).Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); 133builder.Append($"..{Path.AltDirectorySeparatorChar}"); 142builder.Append($"{childSegments[idx]}{Path.AltDirectorySeparatorChar}"); 151relativePath = builder.ToString().Trim(Path.AltDirectorySeparatorChar); 168return path.Split(new char[] { '/', '\\', Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); 178var directory = new DirectoryInfo(Path.Combine(parentDirInfo.FullName, directoryName)); 198directory = new DirectoryInfo(Path.Combine(parentDirInfo.FullName, directoryName + nextIndex)); 215var dstFilePath = Path.Combine(destinationDir, fileName); 253fullPath = EnumerateItems(workingDir).Where(item => Path.GetFileName(item).Equals(itemName, RuntimeEnvironmentHelper.FileStringComparison)).FirstOrDefault(); 259workingDir = Path.GetDirectoryName(workingDir);
Shared\Utilities\ProcessRunner.cs (5)
70proc.StartInfo.WorkingDirectory = Path.GetFullPath(currentDir); 114Console.WriteLine($"Starting process in the background: {Path.GetFileName(proc.ProcessName)}, ID: {proc.Id}."); 115Console.WriteLine($"{Path.GetFileName(currentDir)}>{processName} {processArgs}{Environment.NewLine}"); 150var exitCode = Path.GetFileName(processName) == Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName) ? proc.ExitCode : -1;
Shared\Utilities\RuntimeEnvironmentHelper.cs (3)
47if (!File.Exists(Path.Combine(destinationDirectory, "global.json"))) 53if (!File.Exists(Path.Combine(destinationDirectory, "nuget.config"))) 87.Select(e => e.Attribute("value").Value.TrimEnd(Path.DirectorySeparatorChar))
Tool.cs (1)
314var paramsFile = Path.Combine(options.OutputDir.FullName, CommandProcessorOptions.SvcutilParamsFileName);
dotnet-svcutil-lib.Tests (142)
E2ETests.cs (27)
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", "mcMemberNamedSystem.wsdl"); 523string 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 (36)
64var wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl"); 84var wsdlFile = Path.Combine(g_TestCasesDir, "wsdl", "InternalTypes_DataSetWrapper.wsdl"); 135Directory.CreateDirectory(Path.Combine(this_TestCaseOutputDir, "SvcutilBootstrapper")); 137var uri = $"\"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}\""; 158File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.cs"), Path.Combine(this_TestCaseOutputDir, "FullFramework.cs"), true); 159File.Copy(Path.Combine(g_TestCasesDir, "FullFramework", "FullFramework.csproj"), Path.Combine(this_TestCaseOutputDir, "FullFramework.csproj"), true); 161var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl"); 162var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference"); 179this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testCaseName); 181this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName); 182this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{testCaseName}.log"); 183this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testCaseName); 186File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, "Program.cs"), Path.Combine(this_TestCaseOutputDir, "Program.cs"), true); 187File.Copy(Path.Combine(g_TestCasesDir, this_TestCaseName, testCaseName, $"{testCaseName}.csproj"), Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), true); 188this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"), null, CancellationToken.None); 193var uri = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl"); 194var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference"); 207this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testClientFolder); 210this_TestGroupOutputDir = Path.Combine(Path.GetTempPath(), this_TestCaseName); 211this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{this_TestCaseName}.log"); 212this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testClientFolder); 215FileUtil.CopyDirectory(Path.Combine(g_TestCasesDir, this_TestCaseName), this_TestGroupOutputDir, true); 216this_TestCaseProject = await MSBuildProj.FromPathAsync(Path.Combine(this_TestCaseOutputDir, $"{testClientFolder}.csproj"), null, CancellationToken.None); 223var uri = Path.Combine(g_TestCasesDir, "wsdl", "TypeReuseSvc.wsdl"); 224var outDir = Path.Combine(this_TestCaseOutputDir, "ServiceReference"); 242var url = $"{Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl")}"; 246var paramsFilePath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.params.json"); 277var uri = Path.Combine(g_TestCasesDir, "TypeReuse", "TypeReuseIXmlSerializable.wsdl"); 278var refs = Path.Combine(g_TestCasesDir, "TypeReuse", "CommonTypes.dll"); 300var uri = Path.Combine(g_TestCasesDir, "wsdl", "CollectionTypes.wsdl");
ProjectUtils.cs (10)
23var projectDir = Path.GetDirectoryName(filePath); 24var srcProgramFile = Path.Combine(projectDir, "Program.cs"); 25var dstProgramFile = Path.Combine(projectDir, $"{Path.GetFileNameWithoutExtension(filePath)}.cs"); 27Directory.CreateDirectory(Path.GetDirectoryName(filePath)); 33FileUtil.TryDeleteDirectory(Path.Combine(Path.GetDirectoryName(filePath), "obj")); 177var outputDir = Path.Combine(project.DirectoryPath, referenceFolderName); 180var dstParamsFile = Path.Combine(outputDir, Path.GetFileName(srcParamsFile));
TestInit.cs (47)
60File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.props"), "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" />"); 61File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.targets"), "<Project></Project>"); 62var projectPath = Path.Combine(g_TestOutputDir, "TestStarterProject", "TestStarterProject.csproj"); 92var fileName = Path.GetFileNameWithoutExtension(this_TestGroupProjectName); 93var filePath = Path.Combine(this_TestGroupProjDir, this_TestGroupProjectName); 111var projectPath = Path.Combine(outputDir, $"{projectName}.csproj"); 112var programPath = Path.Combine(outputDir, $"{projectName}.cs"); 119.Replace(Path.GetFileNameWithoutExtension(project.FileName), projectName)); 143g_TestOutputDir = Path.Combine(g_RepositoryRoot, "artifacts", "TestOutput"); 144g_TestResultsDir = Path.Combine(g_TestOutputDir, "TestResults"); 145g_TestBootstrapDir = Path.Combine(g_TestOutputDir, "TestBootstrap"); 146g_TestCasesDir = Path.Combine(vsTestsRoot, "TestCases"); 147g_BaselinesDir = Path.Combine(vsTestsRoot, "Baselines"); 173File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.props"), "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" />"); 174File.WriteAllText(Path.Combine(g_TestOutputDir, "Directory.Build.targets"), "<Project></Project>"); 179string pkgPath = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "Shipping"); 182pkgPath = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "NonShipping"); 210var projectPath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"); 234var projectPath = Path.Combine(this_TestCaseOutputDir, $"{testCaseName}.csproj"); 242this_TestCaseOutputDir = Path.Combine(this_TestGroupOutputDir, testCaseName); 247this_TestCaseBootstrapDir = Path.Combine(this_TestGroupBootstrapDir, testCaseName); 250this_TestCaseLogFile = Path.Combine(this_TestGroupOutputDir, $"{testCaseName}.log"); 266this_TestCaseBaselinesDir = Path.Combine(this_TestGroupBaselinesDir, testCaseName); 267var linuxBaselinePath = Path.Combine(this_TestCaseBaselinesDir, "Linux"); 268if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && File.Exists(Path.Combine(linuxBaselinePath, Path.GetFileName(this_TestCaseLogFile)))) 353var linuxBaselinePath = Path.Combine(this_TestCaseBaselinesDir, "Linux"); 354if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && File.Exists(Path.Combine(linuxBaselinePath, Path.GetFileName(this_TestCaseLogFile)))) 365var nonRefbaselineFiles = baselineFiles.Where(f => f.EndsWith(".cs") && !f.EndsWith(Path.DirectorySeparatorChar + "reference.cs", StringComparison.OrdinalIgnoreCase)).ToList(); 375.Any(e => e.Equals(Path.GetExtension(f), RuntimeEnvironmentHelper.FileStringComparison))).ToList(); 377var nonRefGeneratedFiles = generatedFiles.Where(f => f.EndsWith(".cs") && !f.EndsWith(Path.DirectorySeparatorChar + "reference.cs", StringComparison.OrdinalIgnoreCase)).ToList(); 428var expected = Path.Combine(baselineDir, relativePath); 429Directory.CreateDirectory(Path.GetDirectoryName(expected)); 445var scriptPath = Path.Combine(g_TestOutputDir, @"TestScripts", $"{this_TestCaseName}.cmd"); 446var globalScriptPath = Path.Combine(g_TestOutputDir, @"TestScripts\deleteAll.cmd"); 457Directory.CreateDirectory(Path.GetDirectoryName(scriptPath)); 479var isLogFile = Path.GetExtension(baselineFile).Equals(".log", StringComparison.OrdinalIgnoreCase); 537if (!Directory.Exists(Path.Combine(vstestDir, "TestCases"))) 539vstestDir = new DirectoryInfo(Path.Combine(g_RepositoryRoot, "src", "dotnet-svcutil", "lib", "tests")).FullName; 555var binDir = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "Shipping"); 558binDir = Path.Combine(g_RepositoryRoot, "artifacts", "packages", buildType, "NonShipping"); 568nugetId = Path.GetFileNameWithoutExtension(nugetFile.Name); 573nugetId = Path.GetFileNameWithoutExtension(nugetFiles[0]); 592g_RepositoryRoot = Path.GetDirectoryName(rootSolutionFolder); 606File.WriteAllText(Path.Combine(directory, "global.json"), globalConfig); 624File.WriteAllText(Path.Combine(g_TestOutputDir, "nuget.config"), nugetConfigText.Replace("$svcutilTestFeed$", g_SvcutilNugetFeed));
UnitTest.cs (16)
61var uri = Path.Combine(g_TestCasesDir, "wsdl", "brokenWsdl.wsdl"); 128var uri = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService", "tempuri.org.wsdl"); 150var uri = Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl"); 218var wsdlFilesDstDir = Path.Combine(this_TestGroupOutputDir, "wsdl"); 221var wsdlFilesSrcDir = Path.Combine(g_TestCasesDir, "wsdl", "WcfProjectNService"); 222FileUtil.CopyDirectory(wsdlFilesSrcDir.Replace("$testCasesDir$", g_TestCasesDir), Path.Combine(wsdlFilesDstDir, "WcfProjectNService"), overwrite: true); 224Directory.CreateDirectory(Path.Combine(this_TestGroupOutputDir, "wsdl")); 225File.Copy(Path.Combine(g_TestCasesDir, "wsdl", "Simple.wsdl"), Path.Combine(this_TestGroupOutputDir, "wsdl", "Simple.wsdl")); 327var jsonFilesRoot = Path.Combine(g_TestCasesDir, "options", "JSON"); 329var jsonFileSrcPath = Path.Combine(jsonFilesRoot, jsonFile); 330var jsonFileDstPath = Path.Combine(this_TestCaseOutputDir, Path.GetFileName(jsonFileSrcPath)); 347var outputDir = Path.GetTempPath(); 353var outJsonFile = Path.Combine(outputDir, Path.GetFileName(jsonFileSrcPath));
dotnet-svcutil.xmlserializer (18)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (4)
156char[] invalidPathChars = Path.GetInvalidPathChars(); 164string dirPath = Path.GetDirectoryName(path); 166dirPath = "." + Path.DirectorySeparatorChar; 174string filename = Path.GetFileName(path);
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (4)
193if (!directoryArgValue.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 194directoryArgValue += Path.DirectorySeparatorChar; 196_parent._directoryArg = Path.GetFullPath(directoryArgValue); 227int invalidCharacterIndex = value.IndexOfAny(Path.GetInvalidPathChars());
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (9)
41string combinedPath = Path.Combine(directoryPath, outputFileWithExtension); 49if (extension != null && (!Path.HasExtension(outputFile) || !Path.GetExtension(outputFile).Equals(extension, StringComparison.OrdinalIgnoreCase))) 63return "." + Path.DirectorySeparatorChar; 66if (!directory.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 67return TryGetFullPath(directory + Path.DirectorySeparatorChar, null); 77return Path.GetFullPath(path); 105string directoryPath = Path.GetDirectoryName(path); 215if (Array.IndexOf(Path.GetInvalidFileNameChars(), c) == -1)
Microsoft\Tools\ServiceModel\SvcUtil\XmlSerializerGenerator.cs (1)
66string codePath = Path.GetTempFileName();
dotnet-svcutil.xmlserializer.IntegrationTests (1)
SvcutilTests.cs (1)
21string outputFile = Path.GetTempFileName() + ".cs";
dotnet-user-jwts (38)
Commands\ClearCommand.cs (2)
73var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\CreateCommand.cs (2)
267var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Commands\RemoveCommand.cs (2)
64var appsettingsFilePath = Path.Combine(Path.GetDirectoryName(project), appsettingsFile);
Helpers\DevJwtCliHelpers.cs (10)
88var fullPath = Path.GetFullPath(filePath); 89if (!string.Equals(Path.GetExtension(fullPath), ".cs", StringComparison.OrdinalIgnoreCase)) 116else if (!File.Exists(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))) 118reporter.Error(Resources.FormatRemoveCommand_AppsettingsFileNotFound_Error(Path.Combine(Path.GetDirectoryName(projectPath), appsettingsFile))); 133var projectDirectory = Path.GetDirectoryName(project)!; 138var fileBasedAppLaunchSettingsFilePath = Path.Combine(projectDirectory, Path.GetFileNameWithoutExtension(project) + ".run.json"); 146var launchSettingsFilePath = Path.Combine(projectDirectory, "Properties", "launchSettings.json");
Helpers\JwtStore.cs (3)
17_filePath = Path.Combine(Path.GetDirectoryName(PathHelper.GetSecretsPathFromSecretsId(userSecretsId)), FileName); 45var tempFilename = Path.GetTempFileName();
Helpers\SigningKeysHandler.cs (1)
63Directory.CreateDirectory(Path.GetDirectoryName(secretsFilePath));
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\aspnetcore\src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (11)
56var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 116var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 179string.Equals(Path.GetExtension(projectFile), ".cs", StringComparison.OrdinalIgnoreCase); 192Path.Combine(AppContext.BaseDirectory, "assets"), 199var assemblyDir = Path.GetDirectoryName(assemblyLocation); 203searchPaths.Insert(1, Path.Combine(assemblyDir, "assets")); 208var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\aspnetcore\src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-user-secrets (22)
CommandLineOptions.cs (1)
82if (options.File is not null && !string.Equals(Path.GetExtension(options.File), ".cs", StringComparison.OrdinalIgnoreCase))
Internal\SecretsStore.cs (3)
34var secretDir = Path.GetDirectoryName(_secretsFilePath); 72Directory.CreateDirectory(Path.GetDirectoryName(_secretsFilePath)); 79var tempFilename = Path.GetTempFileName();
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
src\aspnetcore\src\Tools\Shared\SecretsHelpers\MsBuildProjectFinder.cs (3)
23if (!Path.IsPathRooted(projectPath)) 25projectPath = Path.Combine(_directory, projectPath); 31.Where(f => !".xproj".Equals(Path.GetExtension(f), StringComparison.OrdinalIgnoreCase))
src\aspnetcore\src\Tools\Shared\SecretsHelpers\ProjectIdResolver.cs (11)
56var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 116var outputFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 179string.Equals(Path.GetExtension(projectFile), ".cs", StringComparison.OrdinalIgnoreCase); 192Path.Combine(AppContext.BaseDirectory, "assets"), 199var assemblyDir = Path.GetDirectoryName(assemblyLocation); 203searchPaths.Insert(1, Path.Combine(assemblyDir, "assets")); 208var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists);
src\aspnetcore\src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
26if (Path.GetInvalidPathChars().Any(newSecretsId.Contains))
dotnet-watch (18)
Program.cs (10)
40sdkRootDirectory = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", ".."); 122project = new ProjectRepresentation(projectPath: null, entryPointFilePath: Path.GetFullPath(Path.Combine(workingDirectory, options.FilePath))); 170entryPointPath = Path.GetFullPath(Path.Combine(workingDirectory, firstArg)); 191projectPath = Path.GetFullPath(Path.Combine(workingDirectory, projectPath)); 205.Where(p => !PathUtilities.OSSpecificPathComparer.Equals(Path.GetExtension(p), ".shproj"))]; 378var roslynPath = Path.Combine(sdkRootDirectory, "Roslyn", "bincore"); 384var loadedAssembly = context.LoadFromAssemblyPath(Path.Combine(roslynPath, assembly.Name + ".dll"));
Watch\BuildEvaluator.cs (1)
206var extension = Path.GetExtension(fileName.AsSpan());
Watch\MsBuildFileSetFactory.cs (7)
49var watchList = Path.GetTempFileName(); 52var projectDir = Path.GetDirectoryName(rootProjectFile); 79logger.LogError("Error(s) finding watch items project file '{FileName}'.", Path.GetFileName(rootProjectFile)); 185var assemblyDir = Path.GetDirectoryName(typeof(MSBuildFileSetFactory).Assembly.Location); 190Path.Combine(AppContext.BaseDirectory, "assets"), 191Path.Combine(assemblyDir, "assets"), 196var targetPath = searchPaths.Select(p => Path.Combine(p, WatchTargetsFileName)).FirstOrDefault(File.Exists);
DotnetTool.AppHost (4)
AppHost.cs (4)
56var fakeSourcesPath = Path.Combine(Path.GetTempPath(), "does-not-exist", Guid.NewGuid().ToString()); 85.WithWorkingDirectory(Path.Combine(Projects.DotnetTool_AppHost.ProjectPath, "IncompatibleSdk")); 91var nugetPackagesPath = Path.Join(evt.Services.GetRequiredService<IAspireStore>().BasePath, "nuget");
GenerateAnalyzerNuspec (32)
Program.cs (32)
142string assemblyNameWithoutExtension = Path.GetFileNameWithoutExtension(assembly); 146string assemblyFolder = Path.Combine(artifactsBinDir, assemblyNameWithoutExtension, configuration, tfm); 147string assemblyPathForNuspec = Path.Combine(assemblyFolder, assembly); 158var resourceAssemblyFullPath = Path.Combine(directory, resourceAssemblyName); 161var directoryName = Path.GetFileName(directory); 162string resourceAssemblyPathForNuspec = Path.Combine(artifactsBinDir, assemblyNameWithoutExtension, configuration, tfm, directoryName, resourceAssemblyName); 163string targetForNuspec = Path.Combine(target, directoryName); 174var fileWithPath = Path.IsPathRooted(file) ? file : Path.Combine(projectDir, file); 180readmeFile = Path.IsPathRooted(readmeFile) ? readmeFile : Path.GetFullPath(Path.Combine(projectDir, readmeFile)); 181var directoryName = Path.GetDirectoryName(readmePackageLocation) ?? string.Empty; 189var fileWithPath = Path.Combine(artifactsBinDir, Path.GetFileNameWithoutExtension(file), configuration, tfm, file); 194result.AppendLine(FileElement(fileWithPath, Path.Combine("lib", tfm))); 206string folderPath = Path.Combine(artifactsBinDir, folder, configuration, tfm); 209var fileExtension = Path.GetExtension(file); 212var fileName = Path.GetFileName(file); 216var fileWithPath = Path.Combine(folderPath, file); 217var targetPath = tfms.Length > 1 ? Path.Combine(folder, tfm) : folder; 224result.AppendLine(FileElement(Path.Combine(assetsDir, "Install.ps1"), "tools")); 225result.AppendLine(FileElement(Path.Combine(assetsDir, "Uninstall.ps1"), "tools")); 232if (Path.GetExtension(ruleset) == ".ruleset") 234result.AppendLine(FileElement(Path.Combine(rulesetsDir, ruleset), "rulesets")); 246result.AppendLine(FileElement(Path.Combine(directory, editorconfig), $"editorconfig\\{directoryName}")); 255if (Path.GetExtension(globalconfig) == ".globalconfig") 257result.AppendLine(FileElement(Path.Combine(globalAnalyzerConfigsDir, globalconfig), $"buildTransitive\\config")); 268var fileWithPath = Path.Combine(analyzerDocumentationFileDir, analyzerDocumentationFileName); 277var fileWithPath = Path.Combine(analyzerSarifFileDir, analyzerSarifFileName); 286var fileWithPath = Path.Combine(analyzerConfigurationFileDir, analyzerConfigurationFileName); 293result.AppendLine(FileElement(Path.Combine(assetsDir, "ThirdPartyNotices.txt"), ""));
GenerateDocumentationAndConfigFiles (47)
Program.cs (21)
273var assemblyName = Path.GetFileNameWithoutExtension(assembly); 274string path = Path.Combine(args.BinDirectory, assemblyName, args.Configuration, args.Tfm, assembly); 433var fileWithPath = Path.Combine(directory.FullName, args.PropsFileName); 442fileWithPath = Path.Combine(directory.FullName, args.PropsFileToDisableNetAnalyzersInNuGetPackageName); 544var fileWithPath = Path.Combine(directory.FullName, args.AnalyzerDocumentationFileName); 548var fileTitle = Path.GetFileNameWithoutExtension(args.AnalyzerDocumentationFileName); 640var fileWithPath = Path.Combine(directory.FullName, args.AnalyzerSarifFileName); 734Validate(Path.Combine(directory.FullName, args.AnalyzerSarifFileName), stringWriter.ToString(), fileNamesWithValidationFailures); 776var fileWithPath = Path.Combine(directory.FullName, "RulesMissingDocumentation.md"); 899var assemblyDir = Path.GetDirectoryName(assemblyPath); 905var assemblyName = Path.GetFileNameWithoutExtension(assembly); 906var shippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.ShippedFileName); 907var unshippedFile = Path.Combine(assemblyDir, "AnalyzerReleases", assemblyName, ReleaseTrackingHelper.UnshippedFileName); 1079var assemblyName = Path.GetFileNameWithoutExtension(assembly); 1080var assemblyDir = Path.Combine(args.BinDirectory, assemblyName, args.Configuration, args.Tfm); 1081return Path.Combine(assemblyDir, assembly); 1112var rulesetFilePath = Path.Combine(directory.FullName, rulesetFileName); 1176var directory = Directory.CreateDirectory(Path.Combine(analyzerEditorconfigsDir, editorconfigFolder)); 1177var editorconfigFilePath = Path.Combine(directory.FullName, ".editorconfig"); 1400var configFilePath = Path.Combine(directory.FullName, fileName.ToLowerInvariant()); 1612var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
GenerateTemplateManifest (50)
Program.cs (17)
27var packagePath = Path.Combine(Path.GetDirectoryName(lockPath)!, "package.json"); 77if (!File.Exists(Path.Combine(Path.GetDirectoryName(packagePath)!, "package-lock.json"))) 84File.WriteAllText(Path.Combine(restoreDirectory, "Directory.Build.props"), "<Project />"); 85File.WriteAllText(Path.Combine(restoreDirectory, "Directory.Build.targets"), "<Project />"); 86File.WriteAllText(Path.Combine(restoreDirectory, "Directory.Packages.props"), "<Project />"); 138Settings.LoadSpecificSettings(Path.GetDirectoryName(nugetConfigPath)!, Path.GetFileName(nugetConfigPath))); 139var privateCache = Path.Combine(restoreDirectory, "packages"); 143var packagePath = Path.GetFullPath(Path.Combine(privateCache, package.ToLowerInvariant().Replace('/', Path.DirectorySeparatorChar))); 144if (!packagePath.StartsWith(privateCache + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) 174var restoreConfigPath = Path.Combine(restoreDirectory, "nuget.config"); 214var assetsPath = Path.Combine(restoreDirectory, project.Name, "obj", "project.assets.json"); 219Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!);
TemplateRestorePlan.cs (33)
27var snapshot = Path.Combine(workDirectory, "template-inputs"); 32var templateRoot = Path.GetDirectoryName(Path.GetDirectoryName(configPath))!; 33var relativeRoot = Path.GetRelativePath(sourceDirectory, templateRoot); 34var destination = Path.Combine(snapshot, relativeRoot); 35Directory.CreateDirectory(Path.Combine(destination, ".template.config")); 41if (Path.GetExtension(sourcePath) is ".props" or ".targets") 45var relative = Path.GetRelativePath(sourceDirectory, sourcePath); 46var output = Path.Combine(snapshot, relative); 47Directory.CreateDirectory(Path.GetDirectoryName(output)!); 48File.Copy(Path.Combine(processedDirectory, relative), output, overwrite: true); 50File.Copy(Path.Combine(processedDirectory, Path.GetRelativePath(sourceDirectory, configPath)), 51Path.Combine(destination, ".template.config", "template.json"), overwrite: true); 58settingsLocation: Path.Combine(workDirectory, "template-hive")); 73var configPath = Path.Combine(snapshot, template.ConfigPlace.TrimStart('/', '\\').Replace('/', Path.DirectorySeparatorChar)); 75var templateRoot = Path.GetDirectoryName(Path.GetDirectoryName(configPath))!; 82var output = Path.Combine(workDirectory, "rendered", ConfigurationCount.ToString("D4", CultureInfo.InvariantCulture)); 142documents.Add(Path.GetFullPath(path), XDocument.Load(path).Root!); 179documents.Add(Path.ChangeExtension(path, ".csproj"), project); 202var relative = reference.Attribute("Include")!.Value.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 203var referencedPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path)!, relative)); 302var projectDirectory = Path.Combine(directory, project.Name); 304new XDocument(root).Save(Path.Combine(projectDirectory, $"{project.Name}.csproj")); 306var solutionPath = Path.Combine(directory, "TemplateDependencies.slnx"); 312private static bool IsProject(string path) => Path.GetExtension(path) is ".csproj" or ".esproj"; 313private static bool IsDependencyInput(string path) => IsProject(path) || Path.GetExtension(path) is ".props" or ".targets" || 314Path.GetExtension(path) == ".cs" && File.ReadLines(path).Any(line => line.StartsWith("#:", StringComparison.Ordinal));
GetDocument.Insider (8)
Commands\GetDocumentCommand.cs (3)
69.Except([Path.GetFullPath(thisAssembly.Location)]) 70.ToDictionary(Path.GetFileNameWithoutExtension, path => new AssemblyInfo(path)); 142AssemblyName = Path.GetFileNameWithoutExtension(assemblyPath),
Commands\GetDocumentCommandWorker.cs (2)
32private static readonly char[] _invalidFilenameCharacters = Path.GetInvalidFileNameChars(); 437path = Path.Combine(outputDirectory, path);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
HelixTestTasks (1)
GroupWorkItems.cs (1)
120string name = Path.GetFileName(itemSpec);
ilasm (19)
OutputFileWriter.cs (7)
51public static string GetPdbPath(string outputPath) => Path.GetFullPath(Path.ChangeExtension(outputPath, ".pdb")); 87string? path = Path.GetFullPath(outputPath); 135Path.Combine(Path.GetDirectoryName(pdbPath)!, $"{Path.GetFileName(pdbPath)}.{Path.GetRandomFileName()}.tmp");
Program.cs (12)
75$"{Path.GetFileNameWithoutExtension(inputFiles[0])}{(isDll ? ".dll" : ".exe")}"; 100documents.Add(new SourceText(File.ReadAllText(file), Path.GetFullPath(file))); 189options.OutputFileName = Path.GetFileName(outputPath); 190options.PdbFilePath = options.Deterministic ? Path.GetFileName(pdbPath) : pdbPath; 194string baseDir = Path.GetDirectoryName(Path.GetFullPath(inputFiles[0])) ?? "."; 203return new SourceText(File.ReadAllText(path), Path.GetFullPath(path)); 207string fullPath = Path.Combine(baseDir, path); 210return new SourceText(File.ReadAllText(fullPath), Path.GetFullPath(fullPath)); 216fullPath = Path.Combine(includePath, path); 219return new SourceText(File.ReadAllText(fullPath), Path.GetFullPath(fullPath)); 235string fullPath = Path.Combine(baseDir, path);
ilc (13)
parent\parent\Common\CommandLineHelpers.cs (12)
221zipFileName = zipFileName + "_" + Path.GetFileName(outputFilePath); 223zipFileName = Path.Combine(makeReproPath, Path.ChangeExtension(zipFileName, ".zip")); 341string reproFileDir = prefix + originalToReproPackageFileName.Count.ToString() + Path.DirectorySeparatorChar; 342reproPackagePath = Path.Combine(reproFileDir, Path.GetFileName(originalPath)); 353string originalPdbPath = Path.ChangeExtension(originalPath, "pdb"); 357archive.CreateEntryFromFile(originalPdbPath, Path.ChangeExtension(reproPackagePath, "pdb")); 376string directoryName = Path.GetDirectoryName(pattern); 377string searchPattern = Path.GetFileName(pattern); 386string fullFileName = Path.GetFullPath(fileName); 388string simpleName = Path.GetFileNameWithoutExtension(fileName);
Program.cs (1)
365string compilationUnitPrefix = multiFile ? Path.GetFileNameWithoutExtension(outputFilePath) : "";
ILCompiler.Build.Tasks (3)
ComputeManagedAssembliesToCompileToNative.cs (3)
93var fileName = Path.GetFileName(taskItem.ItemSpec); 100var fileName = Path.GetFileName(taskItem.ItemSpec); 109string assemblyFileName = Path.GetFileName(itemSpec);
ILCompiler.Compiler (12)
Compiler\MstatObjectDumper.cs (1)
48var asmName = new AssemblyNameInfo(Path.GetFileName(fileName),
Compiler\ObjectWriter\Dwarf\DwarfBuilder.cs (2)
555new DwarfFileName(Path.GetFileName(sequencePoint.FileName), Path.GetDirectoryName(sequencePoint.FileName));
Compiler\UsageBasedMetadataManager.cs (1)
112string simpleName = Path.GetFileNameWithoutExtension(filePath);
parent\parent\Common\Compiler\CompilerTypeSystemContext.cs (7)
139filePath = Path.GetFullPath(filePath); 195filePath = Path.GetFullPath(filePath); 346if (!Path.IsPathRooted(candidatePath) || !File.Exists(candidatePath)) 349candidatePath = Path.Combine(Path.GetDirectoryName(peFilePath), Path.GetFileName(candidatePath)); 365reader ??= UnmanagedPdbSymbolReader.TryOpenSymbolReaderForMetadataFile(peFilePath, Path.GetDirectoryName(pdbFileName));
parent\parent\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
611Utf8String moduleName = new Utf8String(Path.GetFileName(_outputPath));
ILCompiler.Diagnostics (8)
PdbWriter.cs (8)
167string dllNameWithoutExtension = Path.GetFileNameWithoutExtension(dllPath); 168_pdbFilePath = Path.Combine(_pdbPath, dllNameWithoutExtension + ".pdb"); 180_tempSourceDllName = Path.Combine(Path.GetDirectoryName(dllPath), dllNameWithoutExtension + ".ni" + Path.GetExtension(dllPath)); 183_pdbFilePath = Path.Combine(_pdbPath, dllNameWithoutExtension + ".ni.pdb"); 208_ngenWriter.OpenModW(originalDllPath, Path.GetFileName(originalDllPath), out _pdbMod); 243WriteMethodPDBData(iCodeSection.Value, method, Path.GetFileNameWithoutExtension(originalDllPath), rvaOfTextSection, isILPDBProvided);
ILCompiler.ReadyToRun (36)
CodeGen\ReadyToRunObjectWriter.cs (7)
181? Path.ChangeExtension(_objectFilePath, ".symbols") 238string mapFileName = Path.ChangeExtension(_objectFilePath, ".map"); 244string nodeStatsCsvFileName = Path.ChangeExtension(_objectFilePath, ".nodestats.csv"); 245string mapCsvFileName = Path.ChangeExtension(_objectFilePath, ".map.csv"); 254path = Path.GetDirectoryName(_objectFilePath); 264path = Path.GetDirectoryName(_objectFilePath); 271string path = Path.ChangeExtension(_objectFilePath, ".profile");
Compiler\CallChainProfile.cs (1)
150string moduleSimpleName = Path.ChangeExtension(splitMethodName[0], null);
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryNode.cs (1)
38string pdbNameRoot = Path.GetFileNameWithoutExtension(outputFileName);
Compiler\ReadyToRunCodegenCompilation.cs (9)
433private readonly static string s_folderUpPrefix = ".." + Path.DirectorySeparatorChar; 475string outputDirectory = Path.GetDirectoryName(outputFile); 476string ownerExecutableName = Path.GetFileName(outputFile); 481ownerExecutableName = Path.ChangeExtension(ownerExecutableName, ".dylib"); 492string relativeMsilPath = Path.GetRelativePath(_compositeRootPath, inputFile); 496relativeMsilPath = Path.GetFileName(inputFile); 498string standaloneMsilOutputFile = Path.Combine(outputDirectory, relativeMsilPath); 503standaloneMsilOutputFile = Path.ChangeExtension(standaloneMsilOutputFile, ".wasm"); 516Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
IBC\MIbcProfileParser.cs (1)
107ZipArchiveEntry mibcDataEntry = zipFile.GetEntry(Path.GetFileName(filename) + ".dll");
ObjectWriter\SymbolFileBuilder.cs (4)
30Console.WriteLine("Emitting PDB file: {0}", Path.Combine(pdbPath, Path.GetFileNameWithoutExtension(dllFileName) + ".ni.pdb")); 60string perfMapFileName = Path.Combine(perfMapPath, Path.GetFileNameWithoutExtension(dllFileName) + perfMapExtension);
parent\parent\Common\Compiler\CompilerTypeSystemContext.cs (7)
139filePath = Path.GetFullPath(filePath); 195filePath = Path.GetFullPath(filePath); 346if (!Path.IsPathRooted(candidatePath) || !File.Exists(candidatePath)) 349candidatePath = Path.Combine(Path.GetDirectoryName(peFilePath), Path.GetFileName(candidatePath)); 365reader ??= UnmanagedPdbSymbolReader.TryOpenSymbolReaderForMetadataFile(peFilePath, Path.GetDirectoryName(pdbFileName));
parent\parent\Common\Compiler\ObjectWriter\PEObjectWriter.cs (1)
611Utf8String moduleName = new Utf8String(Path.GetFileName(_outputPath));
PortableCallHelpers\PortableCallHelpersGenerator.cs (5)
130WriteIfDifferent(Path.Combine(options.OutputDirectory, PInvokeFileName), log, 133WriteIfDifferent(Path.Combine(options.OutputDirectory, ReversePInvokeFileName), log, 139WriteIfDifferent(Path.Combine(options.OutputDirectory, InterpToNativeFileName), log, 160Directory.CreateDirectory(Path.GetDirectoryName(Path.GetFullPath(path)));
ILCompiler.RyuJit (1)
parent\ILCompiler.ReadyToRun\IBC\MIbcProfileParser.cs (1)
107ZipArchiveEntry mibcDataEntry = zipFile.GetEntry(Path.GetFileName(filename) + ".dll");
illink (27)
ILLink.Tasks (68)
LinkTask.cs (15)
269protected override string ToolName => Path.GetFileName(DotNetPath); 327string extension = Path.GetExtension(file); 350void AddFile(string path) => files.Add(Path.GetFullPath(TaskEnvironment.GetAbsolutePath(path))); 360path = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(path)); 367AddOptionalFile(Path.ChangeExtension(path, ".pdb")); 368string directory = Path.GetDirectoryName(path); 369string satelliteName = Path.GetFileNameWithoutExtension(path) + ".resources.dll"; 371AddOptionalFile(Path.Combine(satelliteDirectory, satelliteName)); 381string filePath = Path.Combine(directory, metadata.GetString(file.Name)); 450string fullPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(path)); 516var taskDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 520_illinkPath = Path.Combine(Path.GetDirectoryName(taskDirectory), "net", "illink.dll"); 607var assemblyName = Path.GetFileNameWithoutExtension(assemblyPath); 669var assemblyName = Path.GetFileNameWithoutExtension(assemblyPath);
src\runtime\src\tasks\Common\InvocationCache\InvocationCache.Configuration.cs (2)
63string fullPath = Path.GetFullPath(baseDirectory is null ? cacheDirectory : Path.Combine(baseDirectory, cacheDirectory));
src\runtime\src\tasks\Common\InvocationCache\InvocationCache.cs (25)
124Directory.CreateDirectory(Path.GetDirectoryName(destination)!); 125File.Copy(Path.Combine(entryDirectory, "outputs", files[i].Name), destination, overwrite: true); 185string parentDirectory = Path.GetDirectoryName(entryDirectory)!; 187stagingDirectory = Path.Combine(parentDirectory, inputHash + "." + Guid.NewGuid().ToString("N") + ".tmp"); 190string diagnosticsPath = Path.Combine(stagingDirectory, "diagnostics"); 197using (var manifest = new BinaryWriter(File.Create(Path.Combine(stagingDirectory, "manifest")))) 205string cachedFile = Path.Combine(stagingDirectory, "outputs", relativePath); 206Directory.CreateDirectory(Path.GetDirectoryName(cachedFile)!); 227File.WriteAllBytes(Path.Combine(stagingDirectory, "manifest.sha256"), HashFile(Path.Combine(stagingDirectory, "manifest"))); 229InvocationCacheEntry.WriteLastUsed(Path.Combine(stagingDirectory, InvocationCacheEntry.LastUsedFileName)); 274InvocationCacheEntry.WriteLastUsed(Path.Combine(entryDirectory, InvocationCacheEntry.LastUsedFileName)); 287return Path.Combine(CacheDirectory, InvocationCacheEntry.VersionDirectory, inputHash); 292string directory = CacheDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 310if (!File.ReadAllBytes(Path.Combine(entryDirectory, "manifest.sha256")).SequenceEqual(HashFile(Path.Combine(entryDirectory, "manifest")))) 313using var manifest = new BinaryReader(File.OpenRead(Path.Combine(entryDirectory, "manifest"))); 327string outputsDirectory = Path.Combine(entryDirectory, "outputs"); 342string cachedFile = Path.Combine(outputsDirectory, relativePath); 352string diagnosticsPath = Path.Combine(entryDirectory, "diagnostics"); 383if (string.IsNullOrEmpty(path) || Path.IsPathRooted(path)) 386foreach (string component in path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 388if (component is "" or "." or ".." || component.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0 ||
src\runtime\src\tasks\Common\InvocationCache\InvocationCache.Outputs.cs (15)
20string cachePrefix = CacheDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar; 23string outputPrefix = outputs.DirectoryPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar; 33string filePrefix = file.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar; 36string existingPrefix = existing.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar; 66string relativePath = Path.Combine(relativeDirectory, Path.GetFileName(path)); 76outputs.DirectoryPath is not null ? Path.Combine(outputs.DirectoryPath, name) : outputs.Files[index];
src\runtime\src\tasks\Common\InvocationCache\InvocationCacheConfiguration.cs (8)
32return string.IsNullOrEmpty(localAppData) || !Path.IsPathRooted(localAppData) 34: Path.Combine(localAppData, cacheDirectoryName); 41if (!string.IsNullOrEmpty(cacheHome) && Path.IsPathRooted(cacheHome)) 42return Path.Combine(cacheHome, cacheDirectoryName); 46if (string.IsNullOrEmpty(home) || !Path.IsPathRooted(home)) 48if (string.IsNullOrEmpty(home) || !Path.IsPathRooted(home)) 52? Path.Combine(home, "Library", "Caches", cacheDirectoryName) 53: Path.Combine(home, ".cache", cacheDirectoryName);
src\runtime\src\tasks\Common\InvocationCache\InvocationInputs.cs (1)
21new InvocationInputs(Array.ConvertAll(files, Path.GetFullPath));
src\runtime\src\tasks\Common\InvocationCache\InvocationOutputs.cs (2)
23new InvocationOutputs(Path.GetFullPath(path), Array.Empty<string>()); 26new InvocationOutputs(null, Array.ConvertAll(files, Path.GetFullPath));
Infrastructure.Common (3)
CertificateManager.cs (3)
74return Path.Combine(Environment.CurrentDirectory, "wcfLocal.keychain"); 251string pemPath = Path.Combine(Path.GetTempPath(), "wcf-root-" + certificate.Thumbprint + ".pem");
Infrastructure.Tests (1121)
BuildWarningPolicyTests.cs (18)
21var script = Path.Combine(workspace.Path, "evaluate.ps1"); 22var resultPath = Path.Combine(workspace.Path, "evaluation_results.json"); 93var common = Directory.CreateDirectory(Path.Combine(root, "eng", "common")).FullName; 96File.Copy(Path.Combine(RepoRoot.Path, "eng", file), Path.Combine(root, "eng", file)); 101File.Copy(Path.Combine(RepoRoot.Path, file), Path.Combine(root, file)); 105await File.WriteAllTextAsync(Path.Combine(root, "Directory.Build.props"), scenario == "invalid-policy" || clean ? "<Project>" : """ 117await File.WriteAllTextAsync(Path.Combine(root, "eng", "Logger.proj"), """ 124await File.WriteAllTextAsync(Path.Combine(common, "tools.ps1"), """ 136await File.WriteAllTextAsync(Path.Combine(common, "tools.sh"), """ 149await File.WriteAllTextAsync(Path.Combine(common, "build.ps1"), """ 169var commonBash = Path.Combine(common, "build.sh"); 207File.SetUnixFileMode(Path.Combine(root, "eng", "build.sh"), UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); 272var harness = Path.Combine(root, "run.ps1"); 282var report = Path.Combine(root, "report.txt"); 283var bootstrap = Path.Combine(root, "bootstrap.txt"); 324var dotnet = Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
CITimeline\GenerateCITimelineTests.cs (1)
12Path.Combine(AppContext.BaseDirectory, "CITimeline", "TestData", filename);
CreateFailingTestIssue\CreateFailingTestIssueFixture.cs (1)
18ToolProjectPath = Path.Combine(RepoRoot.Path, "tools", "CreateFailingTestIssue", "CreateFailingTestIssue.csproj");
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (23)
72var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 84Path.Combine(fixtureDirectory, "search-issue.json"), 89Path.Combine(fixtureDirectory, "create-issue.json"), 123Path.Combine(fixtureDirectory, "search-issue.json"), 133File.WriteAllText(Path.Combine(fixtureDirectory, "add-issue-comment.json"), "{}"); 153var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 164Path.Combine(fixtureDirectory, "search-issue.json"), 174File.WriteAllText(Path.Combine(fixtureDirectory, "reopen-issue.json"), "{}"); 175File.WriteAllText(Path.Combine(fixtureDirectory, "add-issue-comment.json"), "{}"); 195var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 206Path.Combine(fixtureDirectory, "search-issue.json"), 211Path.Combine(fixtureDirectory, "create-issue.json"), 237var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 248Path.Combine(fixtureDirectory, "search-issue.json"), 258Path.Combine(fixtureDirectory, "create-issue.json"), 285var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 431var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 530var diagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 560var queuedDiagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 586var failedDiagnosticsLog = File.ReadAllText(Path.Combine(fixtureDirectory, "diagnostics.log")); 691var fixtureDirectory = Path.Combine(_workspace.Path, Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture)); 832var fixtureDirectory = Path.Combine(_workspace.Path, Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture)); 988return Path.Combine(fixtureDirectory, $"{fileName}{extension}");
CreateLayout\CreateLayoutTests.cs (89)
28var stale = Path.Combine(workspace.Path, "bin", project, "Debug", "net11.0", "linux-x64", "publish"); 30var discovered = Path.Combine(workspace.Path, "bin", project, "Debug", 33var selected = Path.Combine(workspace.Path, "selected payload"); 35var output = Path.Combine(workspace.Path, "layout"); 52Assert.Equal("selected", File.ReadAllText(Path.Combine(output, destination, executable))); 54File.Delete(Path.Combine(selected, sourceExecutable)); 57Assert.Contains(Path.Combine(selected, sourceExecutable), missingPayload.Message, StringComparison.Ordinal); 63Assert.True(File.Exists(Path.Combine(discovered, sourceExecutable))); 64Assert.True(File.Exists(Path.Combine(stale, sourceExecutable))); 77var discovered = Path.Combine(workspace.Path, "bin", project, "Debug", 80using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "linux-x64", "Debug", "1.0", false, 103var source = Path.Combine(workspace.Path, "bin", "Aspire.Managed", "Debug", 106var output = Path.Combine(workspace.Path, "layout"); 112Assert.Equal("managed", File.ReadAllText(Path.Combine(output, "managed", "aspire-managed"))); 122var source = Path.Combine(workspace.Path, "bin", "Aspire.Hosting.Native.Server", "Debug", 124var symbolDirectory = Path.Combine(source, "Aspire.Hosting.Native.Server.dSYM"); 126File.WriteAllText(Path.Combine(source, "Aspire.Hosting.Native.Server" + extension), "server"); 127File.WriteAllText(Path.Combine(source, "ats-contract.json"), "contract"); 128File.WriteAllText(Path.Combine(source, "sidecar.json"), "sidecar"); 129File.WriteAllText(Path.Combine(source, "Aspire.Hosting.Native.Server.pdb"), "symbols"); 130File.WriteAllText(Path.Combine(symbolDirectory, "symbols"), "symbols"); 131var output = Path.Combine(workspace.Path, "layout"); 137var destination = Path.Combine(output, "apphost-server"); 139Directory.GetFiles(destination, "*", SearchOption.AllDirectories).Select(Path.GetFileName).Order(StringComparer.Ordinal)); 140Assert.Equal("server", File.ReadAllText(Path.Combine(destination, "aspire-apphost-server" + extension))); 141Assert.Equal("contract", File.ReadAllText(Path.Combine(destination, "ats-contract.json"))); 142Assert.Equal("sidecar", File.ReadAllText(Path.Combine(destination, "sidecar.json"))); 153var source = Path.Combine(workspace.Path, "bin", "Aspire.Hosting.Native.Server", "Debug", 156File.WriteAllText(Path.Combine(source, "Aspire.Hosting.Native.Server"), "server"); 159File.WriteAllText(Path.Combine(source, "ats-contract.json"), contract); 161var output = Path.Combine(workspace.Path, "layout"); 168Assert.False(Directory.Exists(Path.Combine(output, "apphost-server"))); 182var publish = Path.Combine(workspace.Path, "bin", "Aspire.TerminalHost", "Debug", 187var path = Path.Combine(publish, file); 188Directory.CreateDirectory(Path.GetDirectoryName(path)!); 191File.WriteAllText(Path.Combine(publish, "Aspire.TerminalHost.pdb"), "symbols"); 192using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, rid, "Debug", "1.0", false, 195var target = Path.Combine(workspace.Path, "layout", "terminalhost"); 197.Select(path => Path.GetRelativePath(target, path).Replace('\\', '/')).Order(StringComparer.Ordinal)); 199File.Delete(Path.Combine(publish, files[^1])); 213var path = Path.Combine(workspace.Path, file); 214Directory.CreateDirectory(Path.GetDirectoryName(path)!); 221File.WriteAllText(Path.Combine(workspace.Path, files[^1]), string.Empty); 234using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "win-x64", configuration, "1.0.0", verbose: false, 256using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "win-x64", "Debug", "1.0.0", verbose: false, 269var outputPath = Path.Combine(workspace.Path, "layout"); 288var explicitPath = Path.Combine(workspace.Path, "missing prepared Dashboard"); 289var outputPath = Path.Combine(workspace.Path, "layout"); 297Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard"))); 333var filePath = Path.Combine(publishPath, relativePath); 334Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 338var outputPath = Path.Combine(workspace.Path, "layout"); 344var dashboardPath = Path.Combine(outputPath, "dashboard"); 346.Select(path => Path.GetRelativePath(dashboardPath, path).Replace(Path.DirectorySeparatorChar, '/')); 350Assert.Equal(File.ReadAllBytes(Path.Combine(publishPath, relativePath)), File.ReadAllBytes(Path.Combine(dashboardPath, relativePath))); 359var wwwrootPath = Path.Combine(publishPath, "wwwroot"); 361var outputPath = Path.Combine(workspace.Path, "layout"); 368Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard"))); 378var blazorScriptPath = Path.Combine(publishPath, "wwwroot", "_framework", "blazor.web.js"); 388var outputPath = Path.Combine(workspace.Path, "layout"); 395Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard"))); 409var sqliteLibraryPath = Path.Combine(publishPath, sqliteLibraryName); 419var outputPath = Path.Combine(workspace.Path, "layout"); 426Assert.False(Directory.Exists(Path.Combine(outputPath, "dashboard"))); 434var explicitPath = Path.Combine(workspace.Path, "prepared dashboard outside artifacts"); 436File.WriteAllText(Path.Combine(explicitPath, "Aspire.Dashboard.exe"), "explicit executable"); 437File.WriteAllText(Path.Combine(explicitPath, "Aspire.Dashboard.pdb"), "symbols"); 438Directory.CreateDirectory(Path.Combine(explicitPath, "nested.dSYM")); 439File.WriteAllText(Path.Combine(explicitPath, "nested.dSYM", "symbols"), "symbols"); 440File.WriteAllText(Path.Combine(explicitPath, "Aspire.Dashboard.dbg"), "symbols"); 441var output = Path.Combine(workspace.Path, "layout"); 447var dashboard = Path.Combine(output, "dashboard"); 450.Select(path => Path.GetRelativePath(dashboard, path).Replace('\\', '/')).Order(StringComparer.Ordinal)); 451Assert.Equal("explicit executable", File.ReadAllText(Path.Combine(dashboard, "Aspire.Dashboard.exe"))); 462using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, 475using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, 501var filePath = Path.Combine(path, file); 502Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 509var publishPath = Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", rid, "Debug", 511var frameworkPath = Path.Combine(publishPath, "wwwroot", "_framework"); 514File.WriteAllText(Path.Combine(publishPath, executableName), "executable"); 515File.WriteAllText(Path.Combine(publishPath, sqliteLibraryName), "sqlite"); 516File.WriteAllText(Path.Combine(frameworkPath, "blazor.web.js"), "static asset"); 523Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", "win-x64", configuration, LayoutBuilder.GetComponentTargetFramework("Aspire.Dashboard"), "win-x64", "publish"), 524Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", configuration, LayoutBuilder.GetComponentTargetFramework("Aspire.Dashboard"), "win-x64", "publish"), 525Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", configuration, LayoutBuilder.GetComponentTargetFramework("Aspire.Dashboard"), "win-x64", "native"), 526Path.Combine(artifactsPath, "bin", "Aspire.Dashboard", configuration, LayoutBuilder.GetComponentTargetFramework("Aspire.Dashboard"), "publish")
DownloadFailingJobLogs\DownloadFailingJobLogsFixture.cs (2)
19ToolPath = Path.Combine(RepoRoot.Path, "tools", "scripts", "DownloadFailingJobLogs.cs"); 20DotNetPath = Path.Combine(RepoRoot.Path, "dotnet.sh");
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (5)
46var fixtureDirectory = Path.Combine(_workspace.Path, "fixtures-success"); 62var logPath = Path.Combine(_workspace.Path, "failed_job_0_Tests___Linux___Sample__Sample____Sample__linux-latest_.log"); 66var extractedTrx = Path.Combine(_workspace.Path, "artifact_0_Sample_linux-latest", "testresults", "Sample_net10.0.trx"); 73var fixtureDirectory = Path.Combine(_workspace.Path, "fixtures-missing-artifact"); 205return Path.Combine(fixtureDirectory, $"{fileName}{extension}");
ExecutableFileTests.cs (2)
38var path = Path.Combine(_workspace.Path, $"stub-{i}"); 68var path = Path.Combine(_workspace.Path, "tool");
ExtractTestPartitions\ExtractTestPartitionsFixture.cs (1)
54var projectPath = Path.Combine(RepoRoot.Path, "tools", "ExtractTestPartitions", "ExtractTestPartitions.csproj");
ExtractTestPartitions\ExtractTestPartitionsTests.cs (22)
31var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 37var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 56var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 62var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 77var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 83var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 101var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 104var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 119var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 126var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 144var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 151var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 167var nonExistentPath = Path.Combine(_workspace.Path, "DoesNotExist.dll"); 168var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 193var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 199var outputFile = Path.Combine(_workspace.Path, "nested", "dir", "partitions.txt"); 213var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 218var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 235var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 242var outputFile = Path.Combine(_workspace.Path, "partitions.txt"); 260var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 267var outputFile = Path.Combine(_workspace.Path, "partitions.txt");
ExtractTestPartitions\MockAssemblyBuilder.cs (6)
241var netstandardPath = Path.Combine( 242Path.GetDirectoryName(typeof(object).Assembly.Location)!, 250var runtimePath = Path.Combine( 251Path.GetDirectoryName(typeof(object).Assembly.Location)!, 259Path.GetFileNameWithoutExtension(outputPath), 264var outputDir = Path.GetDirectoryName(outputPath);
GenerateTestSummary\GenerateTestSummaryFixture.cs (1)
18ToolProjectPath = Path.Combine(RepoRoot.Path, "tools", "GenerateTestSummary", "GenerateTestSummary.csproj");
GenerateTestSummary\GenerateTestSummaryToolTests.cs (20)
32var trxPath = Path.Combine(_workspace.Path, "sample.trx"); 54var trxPath = Path.Combine(_workspace.Path, "mixed.trx"); 61var jsonPath = Path.Combine(_workspace.Path, "failed.json"); 82var trxPath = Path.Combine(_workspace.Path, "aborted.trx"); 88var jsonPath = Path.Combine(_workspace.Path, "failed.json"); 105var trxPath = Path.Combine(_workspace.Path, "allpass.trx"); 111var jsonPath = Path.Combine(_workspace.Path, "failed.json"); 134var trxDir = Path.Combine(_workspace.Path, "corrupt"); 136await File.WriteAllTextAsync(Path.Combine(trxDir, "broken.trx"), "this is not valid trx xml <<<"); 138var jsonPath = Path.Combine(_workspace.Path, "failed.json"); 161var trxDir = Path.Combine(_workspace.Path, "partial"); 164Path.Combine(trxDir, "clean.trx"), 166await File.WriteAllTextAsync(Path.Combine(trxDir, "broken.trx"), "this is not valid trx xml <<<"); 168var jsonPath = Path.Combine(_workspace.Path, "failed.json"); 188var trxDir = Path.Combine(_workspace.Path, "partial-with-failure"); 191Path.Combine(trxDir, "failed.trx"), 193await File.WriteAllTextAsync(Path.Combine(trxDir, "broken.trx"), "this is not valid trx xml <<<"); 195var jsonPath = Path.Combine(_workspace.Path, "failed.json"); 217var trxPath = Path.Combine(_workspace.Path, "timestamped.trx"); 226var jsonPath = Path.Combine(_workspace.Path, "failed.json");
Hex1bNativePublishingTests.cs (60)
21Path.Combine(RepoRoot.Path, "artifacts", "tests", nameof(Hex1bNativePublishingTests), Guid.NewGuid().ToString("N")))); 42var project = Path.Combine(RepoRoot.Path, "src", projectName, $"{projectName}.csproj"); 59using var reader = File.OpenText(Path.Combine(RepoRoot.Path, ".github", "workflows", "build-cli-native-archives.yml")); 70["msbuild", Path.Combine(RepoRoot.Path, "eng", "Bundle.proj"), "-nologo", "-getProperty:Configuration"]); 76var project = Path.Combine(RepoRoot.Path, "src", projectName, $"{projectName}.csproj"); 97["msbuild", Path.Combine(RepoRoot.Path, "eng", "Bundle.proj"), "-nologo", "-t:_ShowBanner", 99$"-p:_ArtifactsLogDir={Path.Combine(_workspace.Path, "logs")}"]); 112["msbuild", Path.Combine(RepoRoot.Path, "src", "Aspire.TerminalHost", "Aspire.TerminalHost.csproj"), 121Path.GetFullPath(Path.Combine(RepoRoot.Path, "artifacts", "bin", "Aspire.TerminalHost", "Debug", framework!)), 122Path.GetFullPath(properties.GetProperty("AspireTerminalHostDir").GetString()!).TrimEnd(Path.DirectorySeparatorChar)); 166var destination = Path.Combine(_workspace.Path, "publish", relativePath); 207var artifacts = Path.Combine(_workspace.Path, "artifacts"); 208var publish = Path.Combine(artifacts, "bin", "Aspire.Managed", "Release", "net10.0", rid, "publish"); 215WriteFile(Path.Combine(publish, file), file); 219var serverPublish = Path.Combine(artifacts, "bin", "Aspire.Hosting.Native.Server", "Release", "net11.0", rid, "publish"); 227WriteFile(Path.Combine(serverPublish, file), file); 230var terminalPublish = Path.Combine(artifacts, "bin", "Aspire.TerminalHost", "Release", "net11.0", rid, "publish"); 236WriteFile(Path.Combine(terminalPublish, file), file); 240var dashboardPublish = Path.Combine(artifacts, "bin", "Aspire.Dashboard", rid, "Release", "net11.0", rid, "publish"); 252WriteFile(Path.Combine(dashboardPublish, file), file); 266var packages = Path.Combine(_workspace.Path, "packages"); 267WriteFile(Path.Combine(packages, $"microsoft.developercontrolplane.{packageRid}", "1.0.0", "tools", "dcp"), "dcp"); 268var layout = Path.Combine(_workspace.Path, "layout"); 271["exec", "--runtimeconfig", Path.ChangeExtension(testAssembly, ".runtimeconfig.json"), 272"--depsfile", Path.ChangeExtension(testAssembly, ".deps.json"), 279var tray = Path.Combine(_workspace.Path, "windows-tray"); 289var tray = Path.Combine(_workspace.Path, "linux-tray"); 300Assert.Contains(Path.GetFileName(missingSidecar), result.Output); 312var managed = Path.Combine(layout, "managed"); 314.Select(path => Path.GetRelativePath(managed, path).Replace('\\', '/')).Order(StringComparer.Ordinal)); 317Assert.True(File.ReadAllBytes(Path.Combine(publish, file)).SequenceEqual(File.ReadAllBytes(Path.Combine(managed, file))), file); 321Assert.Equal(File.ReadAllBytes(Path.Combine(terminalPublish, file)), File.ReadAllBytes(Path.Combine(managed, file))); 324var terminal = Path.Combine(layout, "terminalhost"); 326.Select(path => Path.GetRelativePath(terminal, path).Replace('\\', '/')).Order(StringComparer.Ordinal)); 329Assert.Equal(File.ReadAllBytes(Path.Combine(terminalPublish, file)), File.ReadAllBytes(Path.Combine(terminal, file))); 332var server = Path.Combine(layout, "apphost-server"); 338Assert.Equal(File.ReadAllBytes(Path.Combine(serverPublish, file)), File.ReadAllBytes(Path.Combine(server, bundledFile))); 341var dashboard = Path.Combine(layout, "dashboard"); 343.Select(path => Path.GetRelativePath(dashboard, path).Replace('\\', '/')).Order(StringComparer.Ordinal)); 346Assert.True(File.ReadAllBytes(Path.Combine(dashboardPublish, file)).SequenceEqual(File.ReadAllBytes(Path.Combine(dashboard, file))), file); 357var layout = Path.Combine(_workspace.Path, "layout"); 358var marker = Path.Combine(layout, "existing.txt"); 366["exec", "--runtimeconfig", Path.ChangeExtension(testAssembly, ".runtimeconfig.json"), 367"--depsfile", Path.ChangeExtension(testAssembly, ".deps.json"), 369"--output", layout, "--artifacts", Path.Combine(_workspace.Path, "missing-artifacts"), "--rid", rid, "--configuration", "Release"]); 389var source = Path.Combine(_workspace.Path, "package", pathInPackage); 395new XElement("DestinationSubPath", rid.Length == 0 ? pathInPackage : Path.GetFileName(pathInPackage)), 399var unrelatedSource = Path.Combine(_workspace.Path, "other", "OpenConsole.exe"); 414new XAttribute("Include", Path.Combine(_workspace.Path, "duplicate", "OpenConsole.exe")), 432new XElement("Import", new XAttribute("Project", Path.Combine(RepoRoot.Path, "src", "Aspire.Hosting", "buildTransitive", "Aspire.Hosting.targets"))), 448var projectPath = Path.Combine(_workspace.Path, "Publish.proj"); 465Directory.CreateDirectory(Path.GetDirectoryName(path)!); 474var resultPath = Path.Combine(_workspace.Path, $"msbuild-result-{Guid.NewGuid():N}.json");
MacTrayTestPayload.cs (4)
10var source = Path.Combine(workspace, "source with spaces", "Aspire Tray.app"); 20var path = Path.Combine(source, file); 21Directory.CreateDirectory(Path.GetDirectoryName(path)!); 26File.SetUnixFileMode(Path.Combine(source, "Contents/MacOS/aspire-tray"),
MicrosoftTestingPlatformTests.cs (6)
21var script = Path.Combine(workspace.Path, "evaluate.ps1"); 22var resultPath = Path.Combine(workspace.Path, "evaluation_results.json"); 39.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet")) 68var script = Path.Combine(workspace.Path, "runner-help.ps1"); 75.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet")) 80var target = XDocument.Load(Path.Combine(RepoRoot.Path, "eng", "Xunit3", "Microsoft.Testing.Platform.targets"));
Pipelines\BundleBuildWrapperTests.cs (17)
54var scripts = Directory.CreateDirectory(Path.Combine(root, "eng", "scripts")).FullName; 55var script = Path.Combine(scripts, "stabilization-smoke-init-restore.sh"); 56File.Copy(Path.Combine(RepoRoot.Path, "eng", "scripts", "stabilization-smoke-init-restore.sh"), script); 60await File.WriteAllTextAsync(Path.Combine(feed, $"{package}.17.0.0.nupkg"), ""); 63var dotnet = Path.Combine(root, "dotnet.sh"); 96var common = Directory.CreateDirectory(Path.Combine(root, "eng", "common")).FullName; 97var sdk = Directory.CreateDirectory(Path.Combine(root, ".dotnet")).FullName; 102File.Copy(Path.Combine(RepoRoot.Path, "eng", name), Path.Combine(root, "eng", name)); 104await File.WriteAllTextAsync(Path.Combine(common, "build.sh"), """ 108await File.WriteAllTextAsync(Path.Combine(common, "build.ps1"), """ 112await File.WriteAllTextAsync(Path.Combine(sdk, "dotnet"), """ 118foreach (var path in new[] { Path.Combine(common, "build.sh"), Path.Combine(sdk, "dotnet") }) 123var launcher = Path.Combine(root, "launch.ps1"); 124await File.WriteAllTextAsync(Path.Combine(root, "arguments.json"), JsonSerializer.Serialize(arguments)); 150File.ReadAllLines(Path.Combine(workspace.Path, name))
Pipelines\CliE2EImageBuildTests.cs (2)
32Path.Combine(RepoRoot.Path, "tests", "Infrastructure.Tests", "Pipelines", "cli-e2e-image-build.harness.ts"), 44Path.Combine(RepoRoot.Path, "tests", "Infrastructure.Tests", "Pipelines", "cli-e2e-image-build.harness.ts"),
Pipelines\MacOSStaplerRetryTests.cs (8)
34await File.WriteAllTextAsync(Path.Combine(workspace.Path, "attempt"), "0\n"); 35await File.WriteAllTextAsync(Path.Combine(workspace.Path, "delays"), ""); 38var stub = Path.Combine(bin, name); 63var app = Path.Combine(workspace.Path, "Aspire app.app"); 67[Path.Combine(RepoRoot.Path, "tools", "CreateLayout", "macos-stapler-with-retry.sh"), operation, app], 71["PATH"] = bin + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH"), 81Assert.Equal(expectedDelays.Length + 1, int.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.Path, "attempt")))); 82Assert.Equal(expectedDelays, (await File.ReadAllLinesAsync(Path.Combine(workspace.Path, "delays"))).Select(int.Parse));
Pipelines\NixCliPackageTests.cs (22)
44var recordedArguments = Path.Combine(_workspace.Path, "new-arguments.txt"); 45await File.WriteAllTextAsync(Path.Combine(packages, $"Aspire.ProjectTemplates.{packageVersion}.nupkg"), ""); 68await ExecutableFile.WriteAsync(Path.Combine(fakeBin, name), contents.Replace("\r\n", "\n")); 70var launcher = Path.Combine(_workspace.Path, "launch.sh"); 83[launcher, Path.Combine(RepoRoot.Path, "eng", "nix", "runtime-smoke", "run.sh"), expectedCommit, packages, buildEvent], 87["PATH"] = fakeBin + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH"), 88["NIX_ASPIRE_PACKAGE"] = Path.Combine(_workspace.Path, "readonly-package"), 89["ASPIRE_HOME"] = Path.Combine(_workspace.Path, "aspire-home"), 117var outputPath = Path.Combine(_workspace.Path, "versions.json"); 118var fakeBinPath = Path.Combine(_workspace.Path, "bin"); 121var curlPath = Path.Combine(fakeBinPath, "curl"); 133Path.Combine(RepoRoot.Path, "eng", "nix", "update-versions.sh"), 137["PATH"] = fakeBinPath + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 157var outputPath = Path.Combine(_workspace.Path, "versions.json"); 158var fakeBinPath = Path.Combine(_workspace.Path, "bin"); 163var curlPath = Path.Combine(fakeBinPath, "curl"); 190Path.Combine(RepoRoot.Path, "eng", "nix", "update-versions.sh"), 194["PATH"] = fakeBinPath + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH") 214var outputPath = Path.Combine(_workspace.Path, "versions.json"); 219Path.Combine(RepoRoot.Path, "eng", "nix", "update-versions.sh"), 270=> Path.IsPathRooted(relativePath) 272: File.ReadAllTextAsync(Path.Combine(RepoRoot.Path, relativePath));
Pipelines\NpmCliPackageTests.cs (37)
35_packScriptPath = Path.Combine(_repoRoot, "eng", "scripts", "pack-cli-npm-package.ps1"); 50Path.Combine(pointerPackageRoot, "bin", "aspire.js"), 61var testScriptPath = Path.Combine(_workspace.Path, $"{Path.GetRandomFileName()}.js"); 83Path.Combine(pointerPackageRoot, "bin", "aspire.js"), 101var testScriptPath = Path.Combine(_workspace.Path, $"{Path.GetRandomFileName()}.js"); 117Path.Combine(pointerPackageRoot, "bin", "aspire.js"), 130var packageJson = ReadJsonObject(Path.Combine(package.PointerPackageRoot, "package.json")); 146var packageMap = ReadJsonObject(Path.Combine(package.PointerPackageRoot, "bin", "aspire-package-map.json")); 151var readme = await File.ReadAllTextAsync(Path.Combine(package.PointerPackageRoot, "README.md")); 203var packageJson = ReadJsonObject(Path.Combine(package.RidPackageRoot, "package.json")); 221Assert.True(File.Exists(Path.Combine(package.RidPackageRoot, "bin", expectation.BinaryName))); 223var readme = await File.ReadAllTextAsync(Path.Combine(package.RidPackageRoot, "README.md")); 238=> File.ReadAllTextAsync(Path.Combine(_repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar))); 242var testRoot = Path.Combine(_workspace.Path, Path.GetRandomFileName()); 243var nodeModulesRoot = Path.Combine(testRoot, "node_modules"); 244var pointerPackageRoot = Path.Combine(nodeModulesRoot, "@microsoft", "aspire-cli"); 245var pointerBinRoot = Path.Combine(pointerPackageRoot, "bin"); 249Path.Combine(_repoRoot, "eng", "clipack", "npm", "aspire.js"), 250Path.Combine(pointerBinRoot, "aspire.js")); 253Path.Combine(pointerPackageRoot, "package.json"), 267await File.WriteAllTextAsync(Path.Combine(pointerBinRoot, "aspire-package-map.json"), packageMap.ToJsonString()); 273var ridPackageRoot = Path.Combine(nodeModulesRoot, "@microsoft", $"aspire-cli-{rid.Rid}"); 274var ridBinRoot = Path.Combine(ridPackageRoot, "bin"); 278Path.Combine(ridPackageRoot, "package.json"), 286await File.WriteAllTextAsync(Path.Combine(ridBinRoot, "aspire"), "native binary stub"); 287await File.WriteAllTextAsync(Path.Combine(ridBinRoot, "aspire.exe"), "native binary stub"); 307var testRoot = Path.Combine(_workspace.Path, Path.GetRandomFileName()); 308var stagingRoot = Path.Combine(testRoot, "staging"); 309var outputPath = Path.Combine(testRoot, "output"); 310var nativeBinaryPath = Path.Combine(testRoot, "native-aspire-stub"); 331Path.Combine(stagingRoot, "rid"), 332Path.Combine(stagingRoot, "pointer"));
Pipelines\TrayBundleTests.cs (66)
61var source = Path.Combine(workspace.Path, "publish"); 63File.WriteAllText(Path.Combine(source, "aspire-tray.dbg"), "symbols"); 64var layout = Path.Combine(workspace.Path, rid); 80var original = Path.Combine(source, Path.GetFileName(entry.Name)); 125File.Delete(Path.Combine(source, missingFile)); 126using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "osx-arm64", "Debug", "test", false, 131Assert.Contains(Path.Combine(source, missingFile), error.Message); 141File.SetUnixFileMode(Path.Combine(source, "Contents/MacOS/aspire-tray"), UnixFileMode.UserRead); 142using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, "osx-arm64", "Debug", "test", false, 157var layout = Path.Combine(workspace.Path, "osx-arm64"); 158var destination = Path.Combine(layout, "tray", "Aspire Tray.app"); 165.Select(file => Path.GetRelativePath(source, file)).Order().ToArray(); 167.Select(file => Path.GetRelativePath(destination, file)).Order().ToArray()); 170Assert.Equal(File.ReadAllBytes(Path.Combine(source, file)), File.ReadAllBytes(Path.Combine(destination, file))); 171Assert.Equal(File.GetUnixFileMode(Path.Combine(source, file)), File.GetUnixFileMode(Path.Combine(destination, file))); 189Assert.Equal(File.GetUnixFileMode(Path.Combine(source, relativePath)), entry.Mode); 192Assert.Equal(File.ReadAllBytes(Path.Combine(source, relativePath)), content.ToArray()); 206var archivePath = Path.Combine(workspace.Path, "signing", "AspireTray.zip"); 207var scriptPath = Path.Combine(workspace.Path, "prepare-signing.ps1"); 228.Select(file => $"{Path.GetFileName(source)}/{Path.GetRelativePath(source, file)}").Order().ToArray(); 232var file = Path.Combine(Path.GetDirectoryName(source)!, entry.FullName); 248Path.Combine(RepoRoot.Path, "eng/github-ci/test-trigger-map.yml"), 275var source = Path.Combine(workspace.Path, "publish with spaces"); 277File.WriteAllText(Path.Combine(source, "smoke.stdout.log"), "not runtime content"); 278var layout = Path.Combine(workspace.Path, rid); 298Assert.Equal(File.ReadAllBytes(Path.Combine(source, Path.GetFileName(entry.Name))), content.ToArray()); 313var source = Path.Combine(workspace.Path, "publish"); 317File.Delete(Path.Combine(source, "Aspire.ico")); 321File.Delete(Path.Combine(source, "aspire-tray.exe")); 325File.Copy(typeof(TrayBundleTests).Assembly.Location, Path.Combine(source, "aspire-tray.exe"), overwrite: true); 327using var builder = new LayoutBuilder(Path.Combine(workspace.Path, "layout"), workspace.Path, 354var source = Path.Combine(workspace.Path, "source"); 356File.Copy(Path.Combine(RepoRoot.Path, "src/Shared/Aspire.ico"), Path.Combine(source, "Aspire.ico"), overwrite: true); 357var layout = Path.Combine(workspace.Path, rid); 361var tray = Path.Combine(layout, "tray"); 366File.Copy(Path.Combine(source, "Aspire.ico"), Path.Combine(tray, "Aspire.ico"), overwrite: true); 369File.Delete(Path.Combine(tray, "Aspire.ico")); 372File.WriteAllText(Path.Combine(tray, "Aspire.ico"), "wrong icon"); 375File.WriteAllText(Path.Combine(tray, "smoke.log"), "unexpected runtime content"); 378File.Copy(typeof(TrayBundleTests).Assembly.Location, Path.Combine(tray, "aspire-tray.exe"), overwrite: true); 382using var command = new PowerShellCommand(Path.Combine(RepoRoot.Path, "tools/CreateLayout/verify-windows-tray-payload.ps1"), output) 411var source = Path.Combine(workspace.Path, "publish with spaces"); 413var layout = Path.Combine(workspace.Path, rid); 417var tray = Path.Combine(layout, "tray"); 424File.Delete(Path.Combine(tray, "Aspire.png")); 427File.WriteAllText(Path.Combine(tray, "Aspire.png"), "wrong icon"); 430File.SetUnixFileMode(Path.Combine(tray, "aspire-tray"), UnixFileMode.UserRead | UnixFileMode.UserWrite); 433File.WriteAllText(Path.Combine(tray, "smoke.log"), "unexpected runtime content"); 436Directory.CreateDirectory(Path.Combine(tray, "empty")); 441File.Delete(Path.Combine(tray, name)); 442File.CreateSymbolicLink(Path.Combine(tray, name), Path.Combine(source, name)); 446var script = Path.Combine(workspace.Path, "verify.ps1"); 456"-Verifier", $"\"{Path.Combine(RepoRoot.Path, "tools/CreateLayout/verify-linux-tray-payload.sh")}\"", 480var layout = Path.Combine(workspace.Path, "linux-x64"); 481var tray = Path.Combine(layout, "tray"); 483var executable = Path.Combine(tray, "aspire-tray"); 513using var command = new PowerShellCommand(Path.Combine(RepoRoot.Path, "eng/scripts/test-native-tray.ps1"), output)
PowerShellScripts\BuildTestMatrixTests.cs (75)
23_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "build-test-matrix.ps1"); 33var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 37Path.Combine(artifactsDir, "MyProject.tests-metadata.json"), 42var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 62var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 66Path.Combine(artifactsDir, "NonGating.tests-metadata.json"), 71var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 85var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 89Path.Combine(artifactsDir, "ProjectA.tests-metadata.json"), 94Path.Combine(artifactsDir, "ProjectB.tests-metadata.json"), 98var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 117var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 121Path.Combine(artifactsDir, "SplitProject.tests-metadata.json"), 127Path.Combine(artifactsDir, "SplitProject.tests-partitions.json"), 130var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 158var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 162Path.Combine(artifactsDir, "ClassSplitProject.tests-metadata.json"), 168Path.Combine(artifactsDir, "ClassSplitProject.tests-partitions.json"), 171var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 194var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 199Path.Combine(artifactsDir, "NoTimeouts.tests-metadata.json"), 203var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 221var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 225Path.Combine(artifactsDir, "CustomTimeouts.tests-metadata.json"), 230var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 248var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 252Path.Combine(artifactsDir, "NeedsNugets.tests-metadata.json"), 258Path.Combine(artifactsDir, "NoNugets.tests-metadata.json"), 263var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 282var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 286Path.Combine(artifactsDir, "FilterTest.tests-metadata.json"), 291Path.Combine(artifactsDir, "FilterTest.tests-partitions.json"), 294var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 312var emptyArtifactsDir = Path.Combine(_workspace.Path, "empty-artifacts"); 315var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 332var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 336Path.Combine(artifactsDir, "SplitProject.tests-metadata.json"), 344Path.Combine(artifactsDir, "SplitProject.tests-partitions.json"), 347var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 373var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 377Path.Combine(artifactsDir, "SdkProject.tests-metadata.json"), 382var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 400var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 404Path.Combine(artifactsDir, "LinuxOnly.tests-metadata.json"), 409var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 428var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 432Path.Combine(artifactsDir, "OsRestrictedSplit.tests-metadata.json"), 439Path.Combine(artifactsDir, "OsRestrictedSplit.tests-partitions.json"), 442var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 465var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 469Path.Combine(artifactsDir, "CustomRunner.tests-metadata.json"), 474var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 494var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 498Path.Combine(artifactsDir, "NoRunner.tests-metadata.json"), 502var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 520var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 524Path.Combine(artifactsDir, "SplitRunner.tests-metadata.json"), 531Path.Combine(artifactsDir, "SplitRunner.tests-partitions.json"), 534var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 556var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 560Path.Combine(artifactsDir, "ClassRunner.tests-metadata.json"), 571Path.Combine(artifactsDir, "ClassRunner.tests-partitions.json"), 574var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 599var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 603Path.Combine(artifactsDir, "DefaultProps.tests-metadata.json"), 607var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 634var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 650Path.Combine(artifactsDir, "PartialProps.tests-metadata.json"), 653var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 680var propsPath = Path.Combine(RepoRoot.Path, "eng", "testing", "CITestsProperties.props"); 721var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 725Path.Combine(artifactsDir, "SplitProps.tests-metadata.json"), 732Path.Combine(artifactsDir, "SplitProps.tests-partitions.json"), 735var outputFile = Path.Combine(_workspace.Path, "matrix.json"); 779var propsPath = Path.Combine(RepoRoot.Path, "eng", "testing", "CITestsProperties.props");
PowerShellScripts\CiResourceMonitorTests.cs (8)
24_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "ci-resource-monitor.ps1"); 25_outputDirectory = Path.Combine(_workspace.Path, "resource-monitor"); 26_summaryPath = Path.Combine(_workspace.Path, "step-summary.md"); 36File.WriteAllLines(Path.Combine(_outputDirectory, "resources.csv"), 67File.WriteAllLines(Path.Combine(_outputDirectory, "resources.csv"), 100var pidFile = Path.Combine(_outputDirectory, "sampler.pid"); 106var csvPath = Path.Combine(_outputDirectory, "resources.csv"); 107var processesPath = Path.Combine(_outputDirectory, "processes.log");
PowerShellScripts\CliStarterValidationTests.cs (8)
27var wrapperPath = Path.Combine(workspace.Path, "validate.ps1"); 28var validationRoot = Path.Combine(workspace.Path, "validation"); 29var eventsPath = Path.Combine(workspace.Path, "events.jsonl"); 135.WithEnvironmentVariable("TEST_SCRIPT", Path.Combine(RepoRoot.Path, "eng", "scripts", "cli-starter-validation.ps1")) 200var goProject = Path.Combine(validationRoot, "aspire-go-starter", "AspireCliGoStarterSmoke"); 206var logPath = Path.Combine(validationRoot, "aspire-go-starter", "diagnostics", logFile); 210foreach (var relativePath in new[] { "node_modules", Path.Combine("frontend", "node_modules") }) 212Assert.False(Directory.Exists(Path.Combine(goProject, relativePath)));
PowerShellScripts\DownloadNativeArchivesTests.cs (20)
25_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "download-native-archives.ps1"); 159.Select(p => Path.GetRelativePath(archivesDir, p).Replace(Path.DirectorySeparatorChar, '/')) 171.Select(p => Path.GetRelativePath(nupkgsDir, p).Replace(Path.DirectorySeparatorChar, '/')) 185var dashboardArtifactsDir = Path.Combine(Path.GetDirectoryName(archivesDir)!, "dashboard-artifacts"); 187.Select(p => Path.GetRelativePath(dashboardArtifactsDir, p).Replace(Path.DirectorySeparatorChar, '/')) 224File.Exists(Path.Combine(_workspace.Path, "escaped", "aspire-cli-linux-x64-13.4.0.tar.gz")), 263Assert.True(File.Exists(Path.Combine( 299Assert.True(File.Exists(Path.Combine( 362Assert.True(File.Exists(Path.Combine( 400Assert.True(File.Exists(Path.Combine( 431"-DashboardArtifactsTargetDir", $"\"{Path.Combine(Path.GetDirectoryName(archivesTargetDir)!, "dashboard-artifacts")}\"", 452var unique = Path.GetRandomFileName(); 453var archives = Path.Combine(_workspace.Path, unique, "archives"); 454var nupkgs = Path.Combine(_workspace.Path, unique, "nupkgs"); 673var fileName = Path.GetFileNameWithoutExtension(path); // strip .zip
PowerShellScripts\ExpandTestMatrixGitHubTests.cs (46)
23_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "expand-test-matrix-github.ps1"); 39var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 42var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 66var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 69var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 92var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 95var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 116var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 119var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 142var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 145var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 169var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 172var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 200var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 203var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 238var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 241var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 265var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 268var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 282var nonExistentFile = Path.Combine(_workspace.Path, "does-not-exist.json"); 283var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 301var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 304var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 327var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 330var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 353var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 356var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 386var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 389var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 413var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 416var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 452var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 455var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 486var canonicalMatrix = Path.Combine(_workspace.Path, "canonical.json"); 489var outputFile = Path.Combine(_workspace.Path, "expanded.json"); 509var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 513Path.Combine(artifactsDir, "RegularProject.tests-metadata.json"), 519Path.Combine(artifactsDir, "SplitMultiOS.tests-metadata.json"), 526Path.Combine(artifactsDir, "SplitMultiOS.tests-partitions.json"), 530Path.Combine(artifactsDir, "LinuxE2E.tests-metadata.json"), 538Path.Combine(artifactsDir, "CliE2E.tests-metadata.json"), 547var buildMatrixScript = Path.Combine(RepoRoot.Path, "eng", "scripts", "build-test-matrix.ps1"); 548var canonicalFile = Path.Combine(_workspace.Path, "canonical.json"); 558var expandedFile = Path.Combine(_workspace.Path, "expanded.json"); 563var splitScriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "split-test-matrix-by-deps.ps1"); 564var githubOutputFile = Path.Combine(_workspace.Path, "github_output.txt");
PowerShellScripts\PowerShellStartupProfileTests.cs (2)
38var cacheRoot = Path.Combine(_workspace.Path, "cache"); 41var scriptPath = Path.Combine(_workspace.Path, "noop.ps1");
PowerShellScripts\ScanTestPartitionsFromSourceGuardTests.cs (7)
43var testsRoot = Path.Combine(RepoRoot.Path, "tests"); 49if (file.Contains($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}", StringComparison.Ordinal) || 50file.Contains($"{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}", StringComparison.Ordinal)) 57if (Path.GetFileName(file) == "ScanTestPartitionsFromSourceGuardTests.cs") 79var rel = Path.GetRelativePath(RepoRoot.Path, file).Replace('\\', '/');
PowerShellScripts\SplitTestMatrixByDepsTests.cs (5)
24_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "split-test-matrix-by-deps.ps1"); 25_githubOutputFile = Path.Combine(_workspace.Path, "github_output.txt"); 185var matrixFile = Path.Combine(_workspace.Path, "matrix.json"); 214var nonExistentFile = Path.Combine(_workspace.Path, "nonexistent.json"); 240var tempMatrixFile = Path.Combine(_workspace.Path, $"matrix_input_{Guid.NewGuid():N}.json");
PowerShellScripts\SplitTestProjectsTests.cs (11)
32_scriptPath = Path.Combine(_repoRoot, "eng", "scripts", "split-test-projects-for-ci.ps1"); 42var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 48var outputFile = Path.Combine(_workspace.Path, "partitions.json"); 72var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 77var outputFile = Path.Combine(_workspace.Path, "partitions.json"); 100var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 106var outputFile = Path.Combine(_workspace.Path, "partitions.json"); 131var assemblyPath = Path.Combine(_workspace.Path, "TestAssembly.dll"); 138var outputFile = Path.Combine(_workspace.Path, "partitions.json"); 166var nonExistentPath = Path.Combine(_workspace.Path, "DoesNotExist.dll"); 167var outputFile = Path.Combine(_workspace.Path, "partitions.json");
PowerShellScripts\StageCliStarterValidationDiagnosticsTests.cs (21)
23_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "stage-cli-starter-validation-diagnostics.ps1"); 32var sourceRoot = Path.Combine(_workspace.Path, "validation with spaces"); 33var destinationRoot = Path.Combine(_workspace.Path, "upload with spaces"); 70var sourceRoot = Path.Combine(_workspace.Path, "validation"); 71var destinationRoot = Path.Combine(_workspace.Path, "upload"); 72var outsideDirectory = Path.Combine(_workspace.Path, "outside"); 77Path.Combine(sourceRoot, "aspire-ts-starter", "removed.log"), 78Path.Combine(_workspace.Path, "missing.log")); 79Directory.CreateSymbolicLink(Path.Combine(sourceRoot, "aspire-ts-starter", "linked"), outsideDirectory); 88using var archive = File.OpenRead(Path.Combine(destinationRoot, "starter-validation.tar")); 105var destinationRoot = Path.Combine(_workspace.Path, "upload"); 111"-SourceRoot", $"\"{Path.Combine(_workspace.Path, "missing")}\"", 124var sourceRoot = Path.Combine(_workspace.Path, "validation"); 125var destinationRoot = Path.Combine(_workspace.Path, "upload"); 131var wrapper = Path.Combine(_workspace.Path, "fail-tar.ps1"); 155var path = Path.Combine(root, relativePath); 156Directory.CreateDirectory(Path.GetDirectoryName(path)!); 162.Select(path => Path.GetRelativePath(root, path).Replace(Path.DirectorySeparatorChar, '/')) 168using var archive = File.OpenRead(Path.Combine(root, "starter-validation.tar")); 179var prefix = Path.GetFileName(sourceRoot) + "/";
PowerShellScripts\StageNativeCliToolPackagesTests.cs (8)
33_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "stage-native-cli-tool-packages.ps1"); 303var path = Path.Combine(_workspace.Path, Path.GetRandomFileName(), "download"); 310return Path.Combine(_workspace.Path, Path.GetRandomFileName(), "shipping"); 332var path = Path.Combine([downloadRoot, .. pathParts]); 333Directory.CreateDirectory(Path.GetDirectoryName(path)!); 340.Select(Path.GetFileName)
PowerShellScripts\ValidateNpmPackageSignaturesTests.cs (13)
28_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "validate-npm-package-signatures.ps1"); 37var missing = Path.Combine(_workspace.Path, "does-not-exist"); 54var filePath = Path.Combine(_workspace.Path, "not-a-directory.txt"); 71File.WriteAllText(Path.Combine(shipping, "Aspire.Hosting.13.4.0.nupkg"), "decoy"); 84var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz"); 100var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz"); 118var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz"); 137var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz"); 163var tgz = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz"); 187var tgzMissing = Path.Combine(shipping, "microsoft-aspire-cli-linux-x64-13.4.0.tgz"); 188var tgzBadPrefix = Path.Combine(shipping, "microsoft-aspire-cli-win-x64-13.4.0.tgz"); 213var unique = Path.GetRandomFileName(); 214var path = Path.Combine(_workspace.Path, unique, "Shipping");
PowerShellScripts\ValidateNpmReleaseAliasesTests.cs (1)
26_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "validate-npm-release-aliases.ps1");
PowerShellScripts\VerifyNonBlockingTestResultsTests.cs (10)
19_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "verify-nonblocking-test-results.ps1"); 64File.WriteAllText(Path.Combine(testResultsPath, artifactName), ""); 97var exitCodePath = Path.Combine(_workspace.Path, "missing-exit-code.txt"); 174File.WriteAllText(Path.Combine(testResultsPath, "malformed.trx"), "<TestRun>"); 188Path.Combine(testResultsPath, "incomplete.trx"), 209Path.Combine(testResultsPath, "invalid-count.trx"), 230Path.Combine(testResultsPath, "missing-executed-count.trx"), 254Path.Combine(testResultsPath, "invalid-executed-count.trx"), 272var exitCodePath = Path.Combine(testResultsPath, "test-exit-code.txt"); 279Path.Combine(testResultsPath, "results.trx"),
PowerShellScripts\WriteClassModeTestPropsTests.cs (14)
19_scriptPath = Path.Combine(RepoRoot.Path, "eng", "scripts", "write-class-mode-test-props.ps1"); 28var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 32Path.Combine(artifactsDir, "RegularProject.tests-metadata.json"), 37Path.Combine(artifactsDir, "PartitionSplitProject.tests-metadata.json"), 42Path.Combine(artifactsDir, "PartitionSplitProject.tests-partitions.json"), 46Path.Combine(artifactsDir, "ClassSplitProject.tests-metadata.json"), 50var outputPropsPath = Path.Combine(_workspace.Path, "ClassModeProjects.props"); 67var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 71Path.Combine(artifactsDir, "PartitionSplitProject.tests-metadata.json"), 76Path.Combine(artifactsDir, "PartitionSplitProject.tests-partitions.json"), 79var outputPropsPath = Path.Combine(_workspace.Path, "ClassModeProjects.props"); 94var artifactsDir = Path.Combine(_workspace.Path, "artifacts"); 98Path.Combine(artifactsDir, "Broken.tests-metadata.json"), 106var outputPropsPath = Path.Combine(_workspace.Path, "ClassModeProjects.props");
ResourceGeneratorMetadataTests.cs (32)
46var projectDirectory = Path.Combine(RepoRoot.Path, "src", projectName); 47var source = XDocument.Load(Path.Combine(RepoRoot.Path, "Directory.Build.targets")); 48var configuration = XDocument.Load(Path.Combine(projectDirectory, $"{projectName}.csproj")); 49var neutralResources = Directory.GetFiles(Path.Combine(projectDirectory, resourceDirectory), "*.resx") 50.Select(Path.GetFileName) 53.Select(name => Path.Combine(resourceDirectory, name!)) 58Path.Combine(resourceDirectory, "NewResource.fr.resx"), 59Path.Combine(resourceDirectory, "NewResource.zh-Hans.resx"), 60Path.Combine(resourceDirectory, "WithoutDesigner.resx"), 61Path.Combine("Other", "Unrelated.resx"), 62Path.Combine(resourceDirectory, "xlf", "Unrelated.resx"), 63Path.Combine("..", "Shared", "Linked.resx") 65var designers = neutralResources.Select(path => Path.ChangeExtension(path, ".Designer.cs")).ToArray(); 66var settingsDesignerPath = Path.Combine(resourceDirectory, "Settings.Designer.cs"); 69Path.Combine(resourceDirectory, "Unrelated.cs"), 70Path.Combine(resourceDirectory, "Unrelated.Designer.cs"), 72Path.Combine("Other", "Unrelated.Designer.cs"), 73Path.Combine(resourceDirectory, "Nested", "Unrelated.Designer.cs"), 74Path.Combine("..", "Shared", "Linked.Designer.cs") 78Directory.CreateDirectory(Path.Combine(workspace.Path, resourceDirectory)); 79foreach (var path in neutralResources.Concat(designers).Append(Path.Combine(resourceDirectory, "WithoutDesigner.resx")) 80.Append(settingsDesignerPath).Append(Path.Combine(resourceDirectory, "Settings.settings"))) 82await File.WriteAllTextAsync(Path.Combine(workspace.Path, path), string.Empty); 103linkedResource.Add(new XElement("Link", Path.Combine(resourceDirectory, "Linked.resx"))); 105var projectPath = Path.Combine(workspace.Path, "Resources.proj"); 107var script = Path.Combine(workspace.Path, "evaluate.ps1"); 110var resultPath = Path.Combine(workspace.Path, "evaluation_results.json"); 131var name = Path.GetFileNameWithoutExtension(resource.GetProperty("Identity").GetString()!); 144Assert.Equal(Path.Combine(resourceDirectory, "Linked.resx"), resources[^1].GetProperty("Link").GetString()); 151var name = Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(designer.GetProperty("Identity").GetString()!)); 175private static string DotNetPath => Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet");
Shared\MSBuildServerFallbackDiagnostic.cs (2)
26var wrapper = Path.Combine(directory, "dotnet-with-diagnostic.cmd"); 37var script = Path.Combine(directory, "dotnet-with-diagnostic.sh");
Shared\ProcessRunnerTests.cs (6)
18File.WriteAllText(Path.Combine(workspace.Path, "marker.txt"), "working directory"); 74var file = Path.Combine(workspace.Path, "artifact.zip"); 94var directory = originalPath!.Split(Path.PathSeparator) 95.First(path => File.Exists(Path.Combine(path, executable))); 115var directory = originalPath!.Split(Path.PathSeparator) 116.First(path => File.Exists(Path.Combine(path, executable)));
Shared\RepoRoot.cs (1)
27if (File.Exists(System.IO.Path.Combine(directory.FullName, "Aspire.slnx")))
Shared\TestDataBuilder.cs (5)
59var outputDir = Path.GetDirectoryName(outputPath); 107var outputDir = Path.GetDirectoryName(outputPath); 132var outputDir = Path.GetDirectoryName(outputPath); 151var outputDir = Path.GetDirectoryName(outputPath); 173var outputDir = Path.GetDirectoryName(outputPath);
Shared\TestTrxBuilder.cs (4)
20var outputDirectory = Path.GetDirectoryName(outputPath); 64var trxPath = Path.Combine(tempDirectory, Path.GetFileName(trxEntryPath)); 67var outputDirectory = Path.GetDirectoryName(outputPath);
src\Shared\PathLookupHelper.cs (6)
44return FindFullPathFromPath(executablePath, path, Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions) 84return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 98return FindAllFullPathsFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, FileExistsAndIsExecutable, pathExtensions); 194path = Path.Combine(directory, fileName); 222return !string.Equals(Path.GetFileName(executablePath), executablePath, StringComparison.Ordinal) 223|| Path.IsPathRooted(executablePath);
TemplateManifest\TemplateManifestBuildTargetTests.cs (15)
20var intermediate = Path.Combine(root, "artifacts", "obj"); 21var restore = Directory.CreateDirectory(Path.Combine(intermediate, "template-cg-restore")).FullName; 22File.WriteAllText(Path.Combine(restore, "project.assets.json"), "{}"); 23var sibling = Path.Combine(intermediate, "keep.txt"); 25var manifest = Path.Combine(root, "artifacts", "cg", "templates", "cgmanifest.json"); 26Directory.CreateDirectory(Path.GetDirectoryName(manifest)!); 31var templateProject = XDocument.Load(Path.Combine(RepoRoot.Path, "src", "Aspire.ProjectTemplates", "Aspire.ProjectTemplates.csproj")); 32var projectPath = Path.Combine(root, "cleanup.proj"); 33var generator = Path.Combine(root, "generator.ps1"); 36new XElement("RepoRoot", root + Path.DirectorySeparatorChar), 37new XElement("IntermediateOutputPath", Path.Combine(intermediate, "unused", "..")), 38new XElement("ArtifactsShippingPackagesDir", Path.Combine(root, "artifacts", "packages") + Path.DirectorySeparatorChar)), 56var runner = Path.Combine(root, "run.ps1"); 64.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"))
TemplateManifest\TemplateManifestCacheTests.cs (8)
26File.WriteAllText(Path.Combine(environment.TemplateDirectory, $"Project{i}.csproj"), $$""" 66Assert.Equal([Path.GetFileName(staleSharedPackage)], Directory.GetFiles(environment.SharedCache).Select(Path.GetFileName)); 72var solution = XDocument.Load(Path.Combine(restoreDirectory, "TemplateDependencies.slnx")); 77var path = project.Attribute("Path")!.Value.Replace('/', Path.DirectorySeparatorChar); 78var directory = Path.GetDirectoryName(Path.Combine(restoreDirectory, path))!; 79using var assets = JsonDocument.Parse(File.ReadAllText(Path.Combine(directory, "obj", "project.assets.json")));
TemplateManifest\TemplateManifestCommandTests.cs (7)
61arguments[0] = Path.Combine(workspace.Path, "missing"); 64arguments[1] = Path.Combine(workspace.Path, "missing"); 67arguments[3] = Path.Combine(workspace.Path, "missing.config"); 106var config = Path.Combine(workspace.Path, "nuget.config"); 110source, processed, Path.Combine(workspace.Path, "cgmanifest.json"), config, 111Path.Combine(workspace.Path, "package feed"), Path.Combine(workspace.Path, "restore directory")
TemplateManifest\TemplateManifestGenerationTests.cs (11)
21var feed = customFeed ? Path.Combine(root, "custom feed") : Path.Combine(root, "artifacts", "packages", configuration, "Shipping"); 25var report = Path.Combine(root, "invocations.txt"); 39var manifestPath = Path.Combine(root, "artifacts", "cg", "templates", "cgmanifest.json"); 40Directory.CreateDirectory(Path.GetDirectoryName(manifestPath)!); 65var feed = Path.Combine(root, "artifacts", "packages", "Debug", "Shipping"); 80.WithEnvironmentVariable("TEMPLATE_CG_REPORT", Path.Combine(root, "invocations.txt")) 90new PowerShellCommand(Path.Combine(RepoRoot.Path, "eng", "scripts", "generate-template-cgmanifest.ps1"), output) 95using var archive = ZipFile.Open(Path.Combine(directory, $"Aspire.ProjectTemplates.{version}.nupkg"), ZipArchiveMode.Create); 108File.WriteAllText(Path.Combine(root, "dotnet.cmd"), """ 116ExecutableFile.Write(Path.Combine(root, "dotnet.sh"), """
TemplateManifest\TemplateManifestNpmTests.cs (5)
41var lockPath = Path.Combine(environment.TemplateDirectory, "package-lock.json"); 77var lockPath = Path.Combine(environment.TemplateDirectory, "package-lock.json"); 101File.WriteAllText(Path.Combine(environment.TemplateDirectory, "App.csproj"), """ 107File.WriteAllText(Path.Combine(environment.TemplateDirectory, "package.json"), PackageJson); 108File.WriteAllText(Path.Combine(environment.TemplateDirectory, "package-lock.json"), PackageLockJson);
TemplateManifest\TemplateManifestNuGetTests.cs (2)
23File.WriteAllText(Path.Combine(environment.TemplateDirectory, "App.csproj"), """ 36using var assets = JsonDocument.Parse(File.ReadAllText(Path.Combine(environment.RestoreDirectory, "Graph000", "obj", "project.assets.json")));
TemplateManifest\TemplateManifestTestEnvironment.cs (12)
30TemplateDirectory = Directory.CreateDirectory(Path.Combine(SourceDirectory, "template")).FullName; 34RestoreDirectory = Path.Combine(workspace.Path, "restore"); 35ManifestPath = Path.Combine(workspace.Path, "cgmanifest.json"); 36ConfigPath = Path.Combine(workspace.Path, "nuget.config"); 38Directory.CreateDirectory(Path.Combine(TemplateDirectory, ".template.config")); 39File.WriteAllText(Path.Combine(TemplateDirectory, ".template.config", "template.json"), """ 91var dotnet = Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet"); 93var script = Path.Combine(_workspace.Path, scriptName); 100.WithEnvironmentVariable("PATH", Path.GetDirectoryName(dotnet) + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH")) 103.WithEnvironmentVariable("NUGET_HTTP_CACHE_PATH", Path.Combine(_workspace.Path, "http-cache")) 118var path = Path.Combine(feed, $"{name}.{version}.nupkg");
TemplateManifest\TemplateRestorePlanTests.cs (14)
71var configPath = Path.Combine(source, "choices", ".template.config", "template.json"); 102File.WriteAllText(Path.Combine(source, "edges", "Child.csproj"), """ 160var path = Path.Combine(directory, "App.csproj"); 167using var assets = JsonDocument.Parse(File.ReadAllText(Path.Combine(directory, "obj", "project.assets.json"))); 196var path = Path.Combine(workspace.Path, "normalized.proj"); 198var script = Path.Combine(workspace.Path, "evaluate.ps1"); 205.WithEnvironmentVariable("TEST_DOTNET", Path.Combine(RepoRoot.Path, ".dotnet", OperatingSystem.IsWindows() ? "dotnet.exe" : "dotnet")) 252var configPath = Path.Combine(source, "host", ".template.config", "template.json"); 287File.Delete(Path.Combine(source, "single", "App.csproj")); 288File.WriteAllText(Path.Combine(source, "single", "apphost.cs"), """ 323var directory = Path.Combine(source, identity); 324Directory.CreateDirectory(Path.Combine(directory, ".template.config")); 325File.WriteAllText(Path.Combine(directory, "App.csproj"), project); 342File.WriteAllText(Path.Combine(directory, ".template.config", "template.json"), config.ToJsonString());
TemporaryStorageTests.cs (4)
23var directory = Path.Combine(AppContext.BaseDirectory, "BannedApiAnalyzers"); 24Assembly.LoadFrom(Path.Combine(directory, "Microsoft.CodeAnalysis.BannedApiAnalyzers.dll")); 25var assembly = Assembly.LoadFrom(Path.Combine(directory, "Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers.dll")); 34var options = new AnalyzerOptions([new PolicyFile(Path.Combine(RepoRoot.Path, "src", "BannedSymbols.txt"))]);
tests\Shared\LinuxTrayTestPayload.cs (2)
18var executable = Path.Combine(directory, "aspire-tray"); 24File.WriteAllBytes(Path.Combine(directory, "Aspire.png"),
tests\Shared\TemporaryWorkspace.cs (6)
7using IOPath = System.IO.Path; 184var tempPath = IOPath.GetTempPath(); 185var parentDir = Directory.CreateDirectory(IOPath.Combine(tempPath, typeof(TemporaryWorkspace).Assembly.GetName().Name!, "Workspace")); 193var workspaceDirectory = parentDir.CreateSubdirectory(IOPath.GetRandomFileName()); 218var aspireDir = IOPath.Combine(workspace.Path, ".aspire"); 219var settingsPath = IOPath.Combine(aspireDir, "settings.json");
tests\Shared\WindowsTrayTestPayload.cs (2)
13File.WriteAllText(Path.Combine(directory, "Aspire.ico"), "test icon"); 14using var stream = File.Create(Path.Combine(directory, "aspire-tray.exe"));
TestTriggerMap\GraphAffectedProjectsTests.cs (17)
318var changedFilesPath = System.IO.Path.Combine(_workspace.Path, "changed.txt"); 320return GraphAffectedProjects.Compute(_workspace.Path, System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), from: null, to: null, changedFilesPath: changedFilesPath).AffectedProjects; 325var changedFilesPath = System.IO.Path.Combine(_workspace.Path, "changed.txt"); 327return GraphAffectedProjects.Compute(_workspace.Path, System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), from: null, to: null, changedFilesPath: changedFilesPath); 334System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), 348var fullPath = System.IO.Path.Combine(_workspace.Path, relativePath.Replace('\\', System.IO.Path.DirectorySeparatorChar)); 349Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!); 356compiles.Select(c => $""" <Compile Include="{c}" Link="{System.IO.Path.GetFileName(c)}" />""") 440var newFull = System.IO.Path.Combine(_workspace.Path, newRelativePath.Replace('/', System.IO.Path.DirectorySeparatorChar)); 441Directory.CreateDirectory(System.IO.Path.GetDirectoryName(newFull)!); 445return GraphAffectedProjects.Compute(_workspace.Path, System.IO.Path.Combine(_workspace.Path, "Aspire.slnx"), from: baseSha, to: "HEAD", changedFilesPath: null).AffectedProjects; 450var fullPath = System.IO.Path.Combine(_workspace.Path, relativePath.Replace('\\', System.IO.Path.DirectorySeparatorChar)); 451Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!); 458compiles.Select(c => $""" <Compile Include="{c}" Link="{System.IO.Path.GetFileName(c)}" />""")
TestTriggerMap\PathRuleExclusionTests.cs (3)
21var path = Path.Combine(_workspace.Path, "map.yml"); 50var path = Path.Combine(_workspace.Path, "map.yml"); 73var path = Path.Combine(_workspace.Path, "map.yml");
TestTriggerMap\PrComparisonBaseTests.cs (9)
32checkout = Path.Combine(workspace.Path, "checkout"); 86Directory.CreateDirectory(Path.Combine(repo, "src")); 90var productionFile = Path.Combine(repo, "src", "Production.cs"); 107Directory.CreateDirectory(Path.Combine(repo, "docs")); 133var checkout = Path.Combine(workspace.Path, "checkout"); 171var checkout = Path.Combine(workspace.Path, "checkout"); 192var productionFile = Path.Combine(repo, "Production.cs"); 295[Path.Combine(RepoRoot.Path, "eng", "github-ci", "resolve-comparison-base.sh"), eventBase, head], 328File.WriteAllText(Path.Combine(repo, path), path);
TestTriggerMap\SelectTestsAcceptanceTests.cs (35)
124var path = Path.Combine(NewMapDir(), "map.yml"); 809var mapPath = Path.Combine(NewMapDir(), "map.yml"); 830var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 861var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 886var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 974var mapPath = Path.Combine(NewMapDir(), "map.yml"); 998var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1019var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1035var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1048var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1059var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1087var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1107var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1119var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1138var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1159var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1182var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1211var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1234var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1249var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1274var srcDir = Path.Combine(RepoRoot.Path, "src"); 1275var polyglotRoot = Path.Combine(RepoRoot.Path, "tests", "PolyglotAppHosts"); 1283var name = Path.GetFileName(projectDir); 1289var baseline = Path.Combine(projectDir, "api", $"{name}.ats.txt"); 1290if (File.Exists(baseline) && Directory.Exists(Path.Combine(polyglotRoot, name))) 1301var polyglotRoot = Path.Combine(RepoRoot.Path, "tests", "PolyglotAppHosts"); 1303.Select(Path.GetFileName) 1330var componentsRoot = Path.Combine(RepoRoot.Path, "src", "Components"); 1331foreach (var dir in Directory.EnumerateDirectories(componentsRoot).Select(Path.GetFileName).Order(StringComparer.Ordinal)) 1345var testsDir = Path.Combine(RepoRoot.Path, "tests"); 1347.Select(Path.GetFileName) 1348.Where(name => name is not null && File.Exists(Path.Combine(testsDir, name!, $"{name}.csproj"))) 1355var testsDir = Path.Combine(RepoRoot.Path, "tests"); 1357.Select(path => Path.GetFileNameWithoutExtension(path)) 1365var slnx = File.ReadAllText(Path.Combine(RepoRoot.Path, "Aspire.slnx"));
TestTriggerMap\SelectTestsCliTests.cs (51)
101Assert.Contains("## SelectTests", File.ReadAllText(Path.Combine(repoRoot, "summary"))); 166var slnxPath = Path.Combine(dir.FullName, "custom", "MyApp.slnx"); 167Directory.CreateDirectory(Path.GetDirectoryName(slnxPath)!); 169File.WriteAllText(Path.Combine(dir.FullName, "map.yml"), Map); 173var propsPath = Path.Combine(dir.FullName, "BeforeBuildProps.props"); 222var commentPath = Path.Combine(repoRoot, "comment.md"); 274var commentPath = Path.Combine(repoRoot, "comment.md"); 330var commentPath = Path.Combine(repoRoot, "comment.md"); 371var commentPath = Path.Combine(repoRoot, "comment.md"); 402var commentPath = Path.Combine(repoRoot, "comment.md"); 448var commentPath = Path.Combine(repoRoot, "comment.md"); 464var summary = File.ReadAllText(Path.Combine(repoRoot, "summary")); 501var commentPath = Path.Combine(repoRoot, "comment.md"); 526var solution = File.ReadAllText(Path.Combine(RepoRoot.Path, "Aspire.slnx")); 534var project = File.ReadAllText(Path.Combine(RepoRoot.Path, projectPath)); 539.Select(Path.GetFileNameWithoutExtension) 542var runsheetTargets = File.ReadAllText(Path.Combine( 577var commentPath = Path.Combine(repoRoot, "comment.md"); 620var jsonPath = Path.Combine(repoRoot, "selection.json"); 662var jsonPath = Path.Combine(temporaryRoot, "selection.json"); 669MapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml") 701var missing = Path.Combine(repoRoot, "does-not-exist.txt"); 703var unwritableSummary = Path.Combine(repoRoot, "no", "such", "dir", "summary.md"); 827var workflow = File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml")); 833MapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml") 1088var missing = Path.Combine(repoRoot, "does-not-exist.txt"); 1095var summary = File.ReadAllText(Path.Combine(repoRoot, "summary")); 1133var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props"); 1171var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props"); 1197var summary = File.ReadAllText(Path.Combine(repoRoot, "summary")); 1220var commentPath = Path.Combine(repoRoot, "comment.md"); 1221var jsonPath = Path.Combine(repoRoot, "selection.json"); 1234var summary = File.ReadAllText(Path.Combine(repoRoot, "summary")); 1275var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props"); 1316var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props"); 1354var propsPath = Path.Combine(repoRoot, "BeforeBuildProps.props"); 1370var changed = Path.Combine(repoRoot, "changed.txt"); 1475File.WriteAllText(Path.Combine(repoRoot, "skip-patterns.txt"), "# docs\n**.md\n"); 1481var summary = File.ReadAllText(Path.Combine(repoRoot, "summary")); 1489File.WriteAllText(Path.Combine(repoRoot, "skip-patterns.txt"), ".github/workflows/**\n"); 1512MapPath: Path.Combine(repoRoot, "map.yml"), 1513SlnxPath: slnxPath ?? Path.Combine(repoRoot, "Aspire.slnx"), 1526var changed = Path.Combine(repoRoot, "changed.txt"); 1542File.WriteAllText(Path.Combine(dir.FullName, "Aspire.slnx"), slnx); 1543File.WriteAllText(Path.Combine(dir.FullName, "map.yml"), map); 1546body(dir.FullName, Path.Combine(dir.FullName, "BeforeBuildProps.props"), output)); 1580var outputPath = Path.Combine(dir, "output"); 1582Environment.SetEnvironmentVariable("GITHUB_STEP_SUMMARY", Path.Combine(dir, "summary")); 1625var fullPath = Path.Combine(repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)); 1626Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
TestTriggerMap\SelectTestsLayer1IntegrationTests.cs (27)
39var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props"); 45MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"), 46SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"), 79var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props"); 85MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"), 86SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"), 134var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props"); 139MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"), 140SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"), 170var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props"); 174var commentPath = System.IO.Path.Combine(fixture.Path, "comment.md"); 175var jsonPath = System.IO.Path.Combine(fixture.Path, "selection.json"); 184MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"), 185SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"), 197var summary = File.ReadAllText(System.IO.Path.Combine(fixture.Path, "summary")); 233var propsPath = System.IO.Path.Combine(fixture.Path, "BeforeBuildProps.props"); 237var commentPath = System.IO.Path.Combine(fixture.Path, "comment.md"); 238var jsonPath = System.IO.Path.Combine(fixture.Path, "selection.json"); 247MapPath: System.IO.Path.Combine(fixture.Path, "map.yml"), 248SlnxPath: System.IO.Path.Combine(fixture.Path, "Aspire.slnx"), 381var changed = System.IO.Path.Combine(_workspace.Path, "changed.txt"); 412var outputPath = System.IO.Path.Combine(_workspace.Path, "output"); 414Environment.SetEnvironmentVariable("GITHUB_STEP_SUMMARY", System.IO.Path.Combine(_workspace.Path, "summary")); 445var fullPath = System.IO.Path.Combine(_workspace.Path, relativePath.Replace('\\', System.IO.Path.DirectorySeparatorChar)); 446Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fullPath)!); 453compiles.Select(c => $""" <Compile Include="{c}" Link="{System.IO.Path.GetFileName(c)}" />""")
TestTriggerMap\TestTriggerMapTests.cs (14)
186var slnx = File.ReadAllText(Path.Combine(RepoRoot.Path, "Aspire.slnx")); 547Assert.False(File.Exists(Path.Combine(RepoRoot.Path, path))); 1166var consumers = LoadArtifactConsumingTestProjectMetadata(Path.Combine(RepoRoot.Path, "Aspire.slnx")) 1188using (var reader = new StringReader(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "tests.yml")))) 1250.Select(projectPath => Path.GetFileNameWithoutExtension(projectPath)!) 1266.Select(projectPath => Path.GetFileNameWithoutExtension(projectPath)!) 1270Path.Combine(RepoRoot.Path, "tests"), "*.csproj", SearchOption.AllDirectories) 1271.Select(Path.GetFileNameWithoutExtension) 1279.Select(projectPath => Path.GetDirectoryName(projectPath)!.Replace('\\', '/')) 1281var mapPath = Path.Combine(RepoRoot.Path, "eng", "github-ci", "test-trigger-map.yml"); 1344var solutionPath = Path.Combine(RepoRoot.Path, "Aspire.slnx"); 1376Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath)!, 1387var relativePath = Path.GetRelativePath(RepoRoot.Path, projectPath).Replace('\\', '/'); 1389&& Path.GetFileNameWithoutExtension(relativePath).EndsWith(".Tests", StringComparison.Ordinal);
TypeScriptApiCompat\TypeScriptApiCompatTests.cs (19)
126var baselineRoot = Path.Combine(workspace.Path, "baseline"); 127var currentRoot = Path.Combine(workspace.Path, "current"); 197var suppressionPath = Path.Combine(workspace.Path, "Pkg.tscompat.suppression.txt"); 227var currentSuppressionPath = Path.Combine(workspace.Path, "current", "Pkg.tscompat.suppression.txt"); 228var baselineSuppressionPath = Path.Combine(workspace.Path, "baseline", "Pkg.tscompat.suppression.txt"); 229Directory.CreateDirectory(Path.GetDirectoryName(currentSuppressionPath)!); 230Directory.CreateDirectory(Path.GetDirectoryName(baselineSuppressionPath)!); 240var currentSuppressions = ApiCompatSuppressionLoader.Load(Path.Combine(workspace.Path, "current")); 241var baselineSuppressions = ApiCompatSuppressionLoader.Load(Path.Combine(workspace.Path, "baseline")); 253var baselineRoot = Path.Combine(workspace.Path, "baseline"); 254var currentRoot = Path.Combine(workspace.Path, "current"); 255var reportPath = Path.Combine(workspace.Path, "report.md"); 289var baselineRoot = Path.Combine(workspace.Path, "baseline"); 290var currentRoot = Path.Combine(workspace.Path, "current"); 291var reportPath = Path.Combine(workspace.Path, "report.md"); 292var excludedPackagesPath = Path.Combine(workspace.Path, "excluded-packages.txt"); 293var suppressionPath = Path.Combine(workspace.Path, "Excluded.tscompat.suppression.txt"); 328var apiDirectory = Path.Combine(rootPath, "src", packageName, "api"); 330File.WriteAllText(Path.Combine(apiDirectory, $"{packageName}.ats.txt"), content);
WorkflowScripts\AutoRerunTransientCiFailuresTests.cs (5)
28_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "auto-rerun-transient-ci-failures.harness.js"); 2652string configPath = Path.Combine(_repoRoot, "eng", "test-retry-patterns.json"); 3596string inputPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json"); 3708=> File.ReadAllTextAsync(Path.Combine(_repoRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)));
WorkflowScripts\AutoSecWorkflowTests.cs (14)
3258AssertPublicationGuards(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "auto-sec.lock.yml"))); 3685=> AssertSafeUploadPaths(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "auto-sec.lock.yml"))); 3690var steps = PublicationSteps(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "auto-sec.lock.yml"))); 3704var steps = AgentSteps(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "auto-sec.lock.yml"))); 3748=> new(PublicationSteps(File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", "auto-sec.lock.yml"))) 4184var ecosystem = Path.GetFileName(path) switch 4284["nugetConfigText"] = File.ReadAllText(Path.Combine(RepoRoot.Path, "NuGet.config")), 4393["nugetConfigText"] = File.ReadAllText(Path.Combine(RepoRoot.Path, "NuGet.config")), 4635ReadWorkflow(Path.Combine("auto-sec", "collect-prs.js")), StringComparison.Ordinal); 4637ReadWorkflow(Path.Combine("auto-sec", "collect.sh")), StringComparison.Ordinal); 4853var requestPath = Path.Combine(workspace.Path, "request.json"); 4854var resultPath = Path.Combine(workspace.Path, "result.json"); 4860Path.Combine(RepoRoot.Path, "tests", "Infrastructure.Tests", "WorkflowScripts", "auto-sec.harness.js"), 4871=> File.ReadAllText(Path.Combine(RepoRoot.Path, ".github", "workflows", fileName));
WorkflowScripts\BackportWorkflowTests.cs (3)
19var scriptPath = Path.Combine(workspace.Path, "cleanup-script.js"); 25Path.Combine(RepoRoot.Path, "tests", "Infrastructure.Tests", "WorkflowScripts", "backport-cleanup.harness.mjs"), 41using var reader = File.OpenText(Path.Combine(RepoRoot.Path, WorkflowRelativePath));
WorkflowScripts\CreateFailingTestIssueWorkflowTests.cs (2)
27_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "create-failing-test-issue.harness.js"); 270var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\CreatePullRequestActionTests.cs (4)
16var action = ReadYaml(Path.Combine(RepoRoot.Path, ".github", "actions", "create-pull-request", "action.yml")); 50var outputPath = Path.Combine(workingDirectory, $"github-output-{Guid.NewGuid():N}.txt"); 51var editArgumentsPath = Path.Combine(workingDirectory, $"edit-arguments-{Guid.NewGuid():N}.txt"); 52var editBodyPath = Path.Combine(workingDirectory, $"edit-body-{Guid.NewGuid():N}.txt");
WorkflowScripts\DashboardExperienceScriptTests.cs (1)
18var result = await command.ExecuteScriptAsync(Path.Combine(RepoRoot.Path,
WorkflowScripts\DashboardResourceGraphScriptTests.cs (2)
18var result = await command.ExecuteScriptAsync(Path.Combine(RepoRoot.Path, 31var result = await command.ExecuteScriptAsync(Path.Combine(RepoRoot.Path,
WorkflowScripts\DashboardResourceNavigationScriptTests.cs (1)
20var result = await command.ExecuteScriptAsync(Path.Combine(RepoRoot.Path,
WorkflowScripts\DashboardTerminalScriptTests.cs (1)
58var result = await command.ExecuteScriptAsync(Path.Combine(RepoRoot.Path,
WorkflowScripts\DeploymentTestScriptTests.cs (5)
15private static readonly string s_runnerPath = Path.Combine( 31var outputFile = Path.Combine(_workspace.Path, "github-output.txt"); 32var argumentsFile = Path.Combine(_workspace.Path, "dotnet-arguments.txt"); 33var fakeDotnetScript = Path.Combine(_workspace.Path, "dotnet.sh"); 42var resultsDirectory = Path.Combine(_workspace.Path, "test results");
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (11)
246var changelogPath = Path.Combine(_workspace.Path, "extension", "CHANGELOG.md"); 247Directory.CreateDirectory(Path.GetDirectoryName(changelogPath)!); 257var scriptPath = Path.Combine(RepoRoot.Path, ScriptRelativePath); 300await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("extension", "src", "baseline.txt"), "baseline"); 319await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("extension", "src", "feature.txt"), "feature-one"); 346await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("extension", "src", "late-main.txt"), "late extension change"); 350await WriteWorkspaceFileAsync(_workspace.Path, Path.Combine("docs", "late-main.md"), "non-extension main change"); 383Path.Combine("extension", "package.json"), 393=> await WriteWorkspaceFileAsync(workingDirectory, Path.Combine("extension", "CHANGELOG.md"), content); 397var fullPath = Path.Combine(workingDirectory, relativePath); 398Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (11)
13private static readonly string s_releaseNotesGeneratorPath = Path.Combine( 19private static readonly string s_applyTriggerLabelScriptPath = Path.Combine( 25private static readonly string s_prBodyValidatorPath = Path.Combine( 305var bodyPath = Path.Combine(tempDirectory.FullName, "pr_body.md"); 324var bodyPath = Path.Combine(tempDirectory.FullName, "pr_body.md"); 345var commitsPath = Path.Combine(tempDirectory.FullName, "commits.txt"); 346var outputPath = Path.Combine(tempDirectory.FullName, "release_notes.md"); 469var binDirectory = Path.Combine(rootDirectory, "bin"); 472var callLogPath = Path.Combine(rootDirectory, "gh-call-log.txt"); 473var fakeGhPath = Path.Combine(binDirectory, "gh"); 503return new FakeGhFixture(callLogPath, $"{binDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
WorkflowScripts\FilterNonBlockingTestArtifactsTests.cs (27)
11private static readonly string s_scriptPath = Path.Combine( 22var allLogsPath = Path.Combine(workspace.Path, "all-logs"); 23var advisoryResultsPath = Path.Combine(allLogsPath, "logs-advisory", "testresults"); 24var gatingResultsPath = Path.Combine(allLogsPath, "logs-gating", "testresults"); 27File.WriteAllText(Path.Combine(advisoryResultsPath, "ignore-test-failures.marker"), "Dashboard Playwright"); 28File.WriteAllText(Path.Combine(advisoryResultsPath, "advisory.trx"), "advisory failure"); 29File.WriteAllText(Path.Combine(gatingResultsPath, "gating.trx"), "gating failure"); 37.Select(Path.GetFileName) 43.Select(Path.GetFileName) 54var allLogsPath = Path.Combine(workspace.Path, "all-logs"); 55var advisoryResultsPath = Path.Combine(allLogsPath, "logs-advisory", "testresults"); 56var unexpectedResultsPath = Path.Combine(allLogsPath, "unexpected", "testresults"); 59File.WriteAllText(Path.Combine(advisoryResultsPath, "ignore-test-failures.marker"), "Dashboard Playwright"); 60var markerPath = Path.Combine(unexpectedResultsPath, "ignore-test-failures.marker"); 70.Select(Path.GetFileName) 80var allLogsPath = Path.Combine(workspace.Path, "all-logs"); 81var advisoryResultsPath = Path.Combine(allLogsPath, "logs-advisory", "testresults"); 82var misplacedResultsPath = Path.Combine(allLogsPath, "logs-gating", "not-testresults"); 85File.WriteAllText(Path.Combine(advisoryResultsPath, "ignore-test-failures.marker"), "Dashboard Playwright"); 86var markerPath = Path.Combine(misplacedResultsPath, "ignore-test-failures.marker"); 96.Select(Path.GetFileName) 106var allLogsPath = Path.Combine(workspace.Path, "all-logs"); 107var advisoryResultsPath = Path.Combine(allLogsPath, "logs-advisory", "testresults"); 108var nestedResultsPath = Path.Combine(allLogsPath, "logs-gating", "nested", "testresults"); 111File.WriteAllText(Path.Combine(advisoryResultsPath, "ignore-test-failures.marker"), "Dashboard Playwright"); 112var markerPath = Path.Combine(nestedResultsPath, "ignore-test-failures.marker"); 122.Select(Path.GetFileName)
WorkflowScripts\LabelerPredictPullsWorkflowTests.cs (3)
26_harnessPath = Path.Combine( 133var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json"); 134var outputPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.result.json");
WorkflowScripts\LintHandwrittenWorkflowsScriptTests.cs (8)
16private static readonly string s_scriptPath = Path.Combine( 74private string ArgumentsPath => Path.Combine(_workspace.Path, "actionlint-arguments.txt"); 80var path = Path.Combine(_workspace.Path, "repo", relativePath); 81Directory.CreateDirectory(Path.GetDirectoryName(path)!); 92var binDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, "bin")).FullName; 93var fakeActionlint = Path.Combine(binDirectory, "actionlint"); 106Path.Combine(_workspace.Path, "repo"), 109["PATH"] = $"{binDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}",
WorkflowScripts\MonitorScheduledWorkflowsIntegrationTests.cs (2)
39_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "monitor-scheduled-workflows.integration.harness.js"); 392var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\MonitorScheduledWorkflowsTests.cs (2)
28_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "monitor-scheduled-workflows.harness.js"); 245var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\MtpExitCodeScriptTests.cs (2)
12private static readonly string s_unixNormalizerPath = Path.Combine( 17private static readonly string s_windowsNormalizerPath = Path.Combine(
WorkflowScripts\ReportCiFailureIntegrationTests.cs (2)
35_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "report-ci-failure.integration.harness.js"); 284var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\ReportCiFailureTests.cs (2)
29_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "report-ci-failure.harness.js"); 81var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\ReportPipelineFailureIntegrationTests.cs (2)
35_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "report-pipeline-failure.integration.harness.js"); 290var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\ReportPipelineFailureTests.cs (2)
28_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "report-pipeline-failure.harness.js"); 139var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\ReportSpecializedTestFailuresTests.cs (2)
28_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "report-specialized-test-failures.harness.js"); 228var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\SpecializedTestFailureRunnerTests.cs (2)
36_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "specialized-test-failure-runner.harness.js"); 228var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\TestReportReaderTests.cs (6)
15var file = Path.Combine(workspace.Path, "mocha.json"); 60var file = Path.Combine(workspace.Path, "mocha.json"); 70var file = Path.Combine(workspace.Path, "mocha.json"); 85var file = Path.Combine(workspace.Path, "results.trx"); 121var file = Path.Combine(workspace.Path, "results.trx"); 133var file = Path.Combine(workspace.Path, "results.trx");
WorkflowScripts\TrackingIssueTests.cs (2)
30_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "tracking-issue.harness.js"); 286var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\UpdateActionlintTests.cs (9)
34_harnessPath = Path.Combine(_repoRoot, "tests", "Infrastructure.Tests", "WorkflowScripts", "update-actionlint.harness.js"); 43var content = await File.ReadAllTextAsync(Path.Combine(_repoRoot, ".github", "actionlint-version.json")); 264var pinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, ".github")); 265var pinPath = Path.Combine(pinDirectory.FullName, "actionlint-version.json"); 271Path.Combine(_repoRoot, ".github", "workflows", "update-actionlint.js"), 292var pinDirectory = Directory.CreateDirectory(Path.Combine(_workspace.Path, ".github")); 293var pinPath = Path.Combine(pinDirectory.FullName, "actionlint-version.json"); 300Path.Combine(_repoRoot, ".github", "workflows", "update-actionlint.js"), 344var requestPath = Path.Combine(_workspace.Path, $"{Guid.NewGuid():N}.json");
WorkflowScripts\UpdateDependenciesVersionPropertiesTests.cs (7)
56private static readonly string s_appPath = Path.Combine(RepoRoot.Path, ".github", "workflows", "update-dependencies-version-properties.cs"); 168var originalPath = Path.Combine(_workspace.Path, "original.props"); 170await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "Directory.Packages.props"), updatedPackagesProps); 171Directory.CreateDirectory(Path.Combine(_workspace.Path, "eng")); 172await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "eng", "Versions.props"), VersionsProps); 173await File.WriteAllTextAsync(Path.Combine(_workspace.Path, "eng", "Version.Details.xml"), VersionDetailsXml); 181File.ReadAllText(Path.Combine([_workspace.Path, .. relativePath]));
installer.tasks (10)
FileUtilities.cs (1)
32if (!s_assemblyExtensions.Contains(Path.GetExtension(path)))
GenerateFileVersionProps.cs (3)
59var fileName = Path.GetFileName(file.ItemSpec); 131var manifestFileName = Path.GetFileName(PlatformManifestFile); 135Directory.CreateDirectory(Path.GetDirectoryName(PlatformManifestFile));
GenerateRunScript.cs (3)
41Directory.CreateDirectory(Path.GetDirectoryName(OutputPath)); 45string extension = Path.GetExtension(Path.GetFileName(OutputPath)).ToLowerInvariant();
GenerateTestSharedFrameworkDepsFile.cs (3)
58if (ignoredExtensions.Contains(Path.GetExtension(filePath))) 61string fileName = Path.GetFileName(filePath); 101using (var depsFileStream = File.Create(Path.Combine(SharedFrameworkDirectory, $"{sharedFxName}.deps.json")))
Microsoft.Agents.AI.ProjectTemplates.Tests (21)
test\ProjectTemplates\Infrastructure\Project.cs (1)
28StartupProjectFullPath = Path.Combine(rootPath, field);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestClassFixtureBase.cs (5)
42_sandboxInstallPath = Path.Combine(_sandboxOutput, "install"); 43_sandboxProjectsPath = Path.Combine(_sandboxOutput, "projects"); 84file.CopyTo(Path.Combine(testSandbox, file.Name)); 89CopySandboxDirectory(subDir.FullName, Path.Combine(testSandbox, subDir.Name)); 95var outputFolderPath = Path.Combine(_sandboxProjectsPath, projectName);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestConfiguration.cs (3)
13private string TemplateSandboxRoot => Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, TemplatePackageName, "Sandbox"); 14public string TemplateSandboxPackages => Path.Combine(TemplateSandboxRoot, "packages"); 15public string TemplateSandboxOutput => Path.Combine(TemplateSandboxRoot, TemplateName);
test\ProjectTemplates\Infrastructure\TemplateSnapshotTestBase.cs (5)
26string workingDir = Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, templatePackageName, "Snapshots", templateName, $"{templateName}.{scenarioName}"); 35string templateLocation = Path.Combine(WellKnownPaths.LocalShippingPackagesPath, $"{templatePackageName}.*.nupkg"); 37string[]? excludePatterns = Path.DirectorySeparatorChar is '/' 39: verificationExcludePatterns?.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray(); 45SnapshotsDirectory = Path.Combine("Snapshots", templateName),
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
50if (Path.GetFileName(path).Equals("launchSettings.json", StringComparison.OrdinalIgnoreCase))
test\ProjectTemplates\Infrastructure\WellKnownPaths.cs (6)
33ProjectTemplatesArtifactsRoot = Path.Combine(RepoRoot, "artifacts", "ProjectTemplates"); 34TemplateSandboxSource = Path.Combine(RepoRoot, "test", "ProjectTemplates", "Infrastructure", "TemplateSandbox"); 35TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxSource, "nuget.config"); 37LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping"); 46var gitPath = Path.Combine(directory, ".git"); 66var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
Microsoft.Analyzers.Extra.Tests (4)
Resources\FileVisibleToAnalyzer.cs (1)
24public override string Path => System.IO.Path.Combine(Directory.GetCurrentDirectory(), _fileName);
Resources\RoslynTestUtils.cs (3)
36var runtimeDir = Path.GetDirectoryName(corelib)!; 42refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 43refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Analyzers.Local (2)
ApiLifecycle\ModelLoader.cs (2)
29var fileName = Path.GetFileNameWithoutExtension(filePath); 30var fileExtension = Path.GetExtension(filePath);
Microsoft.Analyzers.Local.Tests (4)
Resources\FileVisibleToAnalyzer.cs (1)
24public override string Path => System.IO.Path.Combine(Directory.GetCurrentDirectory(), _fileName);
Resources\RoslynTestUtils.cs (3)
36var runtimeDir = Path.GetDirectoryName(corelib)!; 42refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 43refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Arcade.Common (13)
CommandFactory.cs (4)
56var extension = Path.GetExtension(executable); 61else if (executable.Contains(Path.DirectorySeparatorChar)) 73foreach (var path in System.Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 75var candidate = Path.Combine(path, executable + ".exe");
FileSystem.cs (8)
21public string? GetDirectoryName(string? path) => Path.GetDirectoryName(path); 23public string? GetFileName(string? path) => Path.GetFileName(path); 25public string? GetFileNameWithoutExtension(string? path) => Path.GetFileNameWithoutExtension(path); 27public string? GetExtension(string? path) => Path.GetExtension(path); 29public string GetFullPath(string path) => Path.GetFullPath(path); 31public string PathCombine(string path1, string path2) => Path.Combine(path1, path2); 33public string PathCombine(string path1, string path2, string path3) => Path.Combine(path1, path2, path3); 37string? dirPath = Path.GetDirectoryName(path);
ZipArchiveManager.cs (1)
30string entryName = Path.GetFileName(filePath);
Microsoft.AspNetCore (8)
HostingPathResolver.cs (8)
15Path.EndsInDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 21return Path.GetFullPath(basePath); 23if (Path.IsPathRooted(contentRootPath)) 25return Path.GetFullPath(contentRootPath); 27return Path.GetFullPath(Path.Combine(Path.GetFullPath(basePath), contentRootPath));
Microsoft.AspNetCore.Components.Testing (13)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\StartupHook.g.cs (2)
12var testBinDirectory = Path.GetDirectoryName(startupHookAssembly.Location); 16var candidatePath = Path.Combine(testBinDirectory, assemblyName.Name + ".dll");
Infrastructure\E2EManifest.cs (1)
22var manifestPath = Path.Combine(AppContext.BaseDirectory, $"{assemblyName}.e2e-manifest.json");
Infrastructure\ServerInstance.cs (5)
152var stdoutPath = Path.Combine(directory, $"{AppName}-{Id}.stdout.log"); 153var stderrPath = Path.Combine(directory, $"{AppName}-{Id}.stderr.log"); 168var startupPath = Path.Combine(directory, $"{AppName}-{Id}.startup.log"); 275workingDir = Path.Combine(AppContext.BaseDirectory, appEntry.WorkingDirectory); 280executable = Path.Combine(workingDir, executable);
Infrastructure\TestArtifactDirectory.cs (4)
53return Path.Combine(s_root, sanitizedTestName); 67return Path.IsPathRooted(configuredPath) 69: Path.Combine(AppContext.BaseDirectory, configuredPath); 72return Path.Combine(AppContext.BaseDirectory, DefaultFolderName);
Infrastructure\TracingSession.cs (1)
85var tracePath = Path.Combine(_artifactDir, "trace.zip");
Microsoft.AspNetCore.Components.Testing.Tasks (8)
GenerateE2EManifest.cs (8)
112entry.WorkingDirectory = Path.Combine(E2EAppsRelativeDir, name); 117entry.WorkingDirectory = Path.GetDirectoryName(projectPath) ?? ""; 127? Path.Combine("publish", name) 129var relativeDir = Path.Combine(E2EAppsRelativeDir, subPath); 130var absoluteDir = Path.Combine(E2EAppsOutputDir, subPath); 135var appHostPath = Path.Combine(absoluteDir, name + exeSuffix); 136var appDllPath = Path.Combine(absoluteDir, name + ".dll"); 177var manifestDir = Path.GetDirectoryName(ManifestPath);
Microsoft.AspNetCore.Components.WebAssembly (2)
Services\LazyAssemblyLoader.cs (2)
56loadedAssemblies.Add(Assembly.Load(Path.GetFileNameWithoutExtension(assemblyName))); 84var assemblyName = Path.GetFileNameWithoutExtension(newAssembliesToLoad[i]);
Microsoft.AspNetCore.Components.WebAssembly.Server (11)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (2)
110var fileExtension = Path.GetExtension(requestPath.Value); 120var originalPath = Path.GetFileNameWithoutExtension(requestPath.Value);
DebugProxyLauncher.cs (2)
110var debugProxyPath = Path.Combine( 111Path.GetDirectoryName(assembly.Location)!,
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (3)
66var mainModuleFileName = Path.GetFileName(mainModuleFullPath); 77var candidateDotNetExePath = Path.Combine(runtimeDirectory, "..", "..", "..", expectedFileName); 80var normalizedPath = Path.GetFullPath(candidateDotNetExePath);
TargetPickerUi.cs (4)
402var profilePath = Path.Combine(Path.GetTempPath(), "blazor-chrome-debug"); 428var profilePath = Path.Combine(Path.GetTempPath(), "blazor-edge-debug");
Microsoft.AspNetCore.Components.WebView (3)
WebViewManager.cs (3)
306var name = Path.GetFileNameWithoutExtension(assembly.Location); 308return Path.Combine(Path.GetDirectoryName(assembly.Location)!, $"{name}.staticwebassets.runtime.json");
Microsoft.AspNetCore.Components.WebView.Maui (4)
Extensions\UriExtensions.cs (1)
10 if (Path.HasExtension(uriString))
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
Microsoft.AspNetCore.Components.WebView.WindowsForms (10)
BlazorWebView.cs (6)
180 appRootDir = Path.GetDirectoryName(entryAssemblyLocation)!; 186 var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage!)); // HostPage is nonnull because RequiredStartupPropertiesSet is checked above 187 var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!; 188 var contentRootRelativePath = Path.GetRelativePath(appRootDir, contentRootDirFullPath); 189 var hostPageRelativePath = Path.GetRelativePath(contentRootDirFullPath, hostPageFullPath);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
415 var result = Path.Combine(
Microsoft.AspNetCore.Components.WebView.Wpf (10)
BlazorWebView.cs (6)
263 appRootDir = Path.GetDirectoryName(entryAssemblyLocation)!; 269 var hostPageFullPath = Path.GetFullPath(Path.Combine(appRootDir, HostPage)); 270 var contentRootDirFullPath = Path.GetDirectoryName(hostPageFullPath)!; 271 var hostPageRelativePath = Path.GetRelativePath(contentRootDirFullPath, hostPageFullPath); 272 var contentRootDirRelativePath = Path.GetRelativePath(appRootDir, contentRootDirFullPath);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (3)
118 return (ApplicationAssemblyName, Path.Combine(appContentRoot, requestPath).Replace('\\', '/')); 158 if (string.Equals(".css", Path.GetExtension(relativePath), StringComparison.Ordinal)) 166 string matchPathSuffix = "/" + Path.GetFileName(relativePath);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (1)
415 var result = Path.Combine(
Microsoft.AspNetCore.DataProtection (10)
Internal\ContainerUtils.cs (2)
65var fs_file = new DirectoryInfo(fields[1].TrimEnd(Path.DirectorySeparatorChar)).FullName; 70if (fs_file.Equals(dir.FullName.TrimEnd(Path.DirectorySeparatorChar), StringComparison.Ordinal))
Internal\HostingApplicationDiscriminator.cs (2)
14private readonly string DirectorySeparator = Path.DirectorySeparatorChar.ToString(); 15private readonly string AltDirectorySeparator = Path.AltDirectorySeparatorChar.ToString();
Repositories\DefaultKeyStorageDirectories.cs (3)
55retVal = GetKeyStorageDirectoryFromBaseAppDataPath(Path.Combine(homePath, "AppData", "Local")); 60retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName)); 110return new DirectoryInfo(Path.Combine(basePath, "ASP.NET", DataProtectionKeysFolderName));
Repositories\FileSystemXmlRepository.cs (3)
140var tempFilename = Path.Combine(Directory.FullName, Guid.NewGuid().ToString() + ".tmp"); 141var finalFilename = Path.Combine(Directory.FullName, filename + ".xml"); 146var tempTempFilename = Path.GetTempFileName();
Microsoft.AspNetCore.DeveloperCertificates.XPlat (32)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 156var tmpFile = Path.GetTempFileName(); 207var certificatePath = Path.GetTempFileName(); 347var certificatePath = Path.GetTempFileName(); 377Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 817return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 849var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 852var nssDb = Path.GetFullPath(path); 1056var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (2)
402Write(System.IO.Path.GetFileName(firstFrame.File)); 650Write(System.IO.Path.GetFileName(frame.File));
Microsoft.AspNetCore.Hosting (13)
Internal\HostingEnvironmentExtensions.cs (6)
30var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 38hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 43hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath); 81var wwwroot = Path.Combine(hostingEnvironment.ContentRootPath, "wwwroot"); 89hostingEnvironment.WebRootPath = Path.Combine(hostingEnvironment.ContentRootPath, webRoot); 94hostingEnvironment.WebRootPath = Path.GetFullPath(hostingEnvironment.WebRootPath);
src\aspnetcore\src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StaticWebAssets\StaticWebAssetsLoader.cs (2)
77var basePath = string.IsNullOrEmpty(assemblyLocation) ? AppContext.BaseDirectory : Path.GetDirectoryName(assemblyLocation); 78return Path.Combine(basePath!, $"{environment.ApplicationName}.staticwebassets.runtime.json");
WebHostBuilder.cs (3)
370if (Path.IsPathRooted(contentRootPath)) 374return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
Microsoft.AspNetCore.Http (2)
BindingAddress.cs (1)
246if (isUnixPipe && !Path.IsPathRooted(GetUnixPipePath(host)))
parent\parent\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
Microsoft.AspNetCore.Http.Results (2)
PhysicalFileHttpResult.cs (1)
143if (!Path.IsPathRooted(fileName))
Results.cs (1)
481=> Path.IsPathRooted(path)
Microsoft.AspNetCore.HttpLogging (4)
FileLoggerProcessor.cs (4)
53_path = Path.Join(environment.ContentRootPath, "logs"); 55else if (!Path.IsPathRooted(_path)) 57_path = Path.Join(environment.ContentRootPath, _path); 329return Path.Combine(_path, FormattableString.Invariant($"{_fileName}{date.Year:0000}{date.Month:00}{date.Day:00}.{_fileNumber:0000}.txt"));
Microsoft.AspNetCore.Identity.UI (4)
Areas\Identity\Pages\V4\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Areas\Identity\Pages\V5\Account\Manage\ManageNavPages.cs (2)
117?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName); 176?? Path.GetFileNameWithoutExtension(viewContext.ActionDescriptor.DisplayName);
Microsoft.AspNetCore.InternalTesting (16)
AssemblyTestLog.cs (5)
120logOutputDirectory = Path.Combine(_baseDirectory, className); 140var testOutputFile = Path.Combine(logOutputDirectory, $"{testName}{LogFileExtension}"); 148testOutputFile = Path.Combine(logOutputDirectory, $"{testName}.{i}{LogFileExtension}"); 191var globalLogFileName = Path.Combine(baseDirectory, "global.log"); 274var dir = Path.GetDirectoryName(fileName);
CollectDumpAttribute.cs (1)
30var path = Path.Combine(context.FileOutput.TestClassOutputDirectory, context.FileOutput.GetUniqueFileName(context.FileOutput.TestName, ".dmp"));
HelixHelper.cs (3)
20? Path.Combine(Path.GetTempPath(), uploadFileName) 21: Path.Combine(uploadRoot, uploadFileName);
TestFileOutputContext.cs (4)
43TestClassOutputDirectory = Path.Combine(AssemblyOutputDirectory, TestClassName); 64var path = Path.Combine(TestClassOutputDirectory, $"{prefix}{extension}"); 69path = Path.Combine(TestClassOutputDirectory, $"{prefix}{i++}{extension}"); 91return Path.Combine(baseDirectory, assembly.GetName().Name, attribute.TargetFramework);
TestPathUtilities.cs (3)
19var projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, $"{solution}.slnf")); 25projectFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "AspNetCore.slnx")); 29directoryInfo = new DirectoryInfo(Path.Combine(directoryInfo.FullName, "src"));
Microsoft.AspNetCore.Mvc.Core (3)
ApplicationParts\RelatedAssemblyAttribute.cs (2)
72Path.GetDirectoryName(assembly.Location); 90var relatedAssemblyLocation = Path.Combine(assemblyDirectory, attribute.AssemblyFileName + ".dll");
Infrastructure\PhysicalFileResultExecutor.cs (1)
79if (!Path.IsPathRooted(result.FileName))
Microsoft.AspNetCore.Mvc.Localization (1)
ViewLocalizer.cs (1)
97var extension = Path.GetExtension(path);
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
FileProviderRazorProjectFileSystem.cs (1)
64else if (string.Equals(RazorFileExtension, Path.GetExtension(fileInfo.Name), StringComparison.OrdinalIgnoreCase))
FileProviderRazorProjectItem.cs (2)
83(PhysicalPath[_root.Length] == Path.DirectorySeparatorChar || PhysicalPath[_root.Length] == Path.AltDirectorySeparatorChar))
parent\parent\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
RuntimeViewCompiler.cs (1)
339var assemblyName = Path.GetRandomFileName();
Microsoft.AspNetCore.Mvc.RazorPages (1)
ApplicationModels\PageRouteModelFactory.cs (1)
63var fileName = Path.GetFileName(model.RelativePath);
Microsoft.AspNetCore.Mvc.Testing (5)
WebApplicationFactory.cs (5)
484var contentRootCandidate = Path.Combine( 488var contentRootMarker = Path.Combine( 490Path.GetFileName(contentRootAttribute.ContentRootTest)); 593var depsFile = new FileInfo(Path.Combine(AppContext.BaseDirectory, depsFileName)); 598Path.GetFileName(depsFile.FullName)));
Microsoft.AspNetCore.Razor.Utilities.Shared (12)
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\FileUtilities.cs (3)
95var directoryName = Path.GetDirectoryName(path).AssumeNotNull(); 96var baseFileName = Path.GetFileNameWithoutExtension(path); 104uniquePath = Path.Combine(directoryName, $"{baseFileName}{identifier}{extension}");
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PathUtilities.cs (9)
43return Path.GetDirectoryName(path); 58return Path.GetDirectoryName(path); 323=> Path.GetExtension(path); 328return Path.GetExtension(path); 357=> Path.HasExtension(path); 362return Path.HasExtension(path); 393return Path.IsPathFullyQualified(path); 438return Path.IsPathRooted(path); 447return Path.IsPathRooted(path);
Microsoft.AspNetCore.Server.IIS (4)
src\aspnetcore\src\Shared\ErrorPage\ErrorPage.Designer.cs (2)
348Write(System.IO.Path.GetFileName(firstFrame.File)); 549Write(System.IO.Path.GetFileName(frame.File));
StartupHook.cs (1)
50var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
WebHostBuilderIISExtensions.cs (1)
36var contentRoot = iisConfigData.pwzFullApplicationPath.TrimEnd(Path.DirectorySeparatorChar);
Microsoft.AspNetCore.Server.IntegrationTesting (22)
ApplicationPublisher.cs (1)
132var 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(); 126var pidFile = Path.Combine(DeploymentParameters.ApplicationPath, $"{Guid.NewGuid()}.nginx.pid"); 127var errorLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.error.log"); 128var accessLog = Path.Combine(DeploymentParameters.ApplicationPath, "nginx.access.log");
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (9)
91_deployedFolderPathInFileShare = Path.Combine(_deploymentParameters.RemoteServerFileSharePath, folderId); 153var webConfigFilePath = Path.Combine(_deploymentParameters.PublishedApplicationRootPath, "web.config"); 163Path.Combine(_deploymentParameters.DotnetRuntimePath, "dotnet.exe")); 204executableParameters = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".dll"); 208executablePath = Path.Combine(_deployedFolderPathInFileShare, applicationName + ".exe"); 289var temppath = Path.Combine(destDirName, file.Name); 297var temppath = Path.Combine(destDirName, subdir.Name); 318var physicalFilePath = Path.Combine(Path.GetTempPath(), embeddedFileName);
Deployers\SelfHostDeployer.cs (2)
98workingDirectory = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework); 103var executable = Path.Combine(workingDirectory, DeploymentParameters.ApplicationName + executableExtension);
xunit\IISExpressAncmSchema.cs (1)
21var ancmConfigPath = Path.Combine(
Microsoft.AspNetCore.Server.Kestrel.Core (49)
Internal\CertificatePathWatcher.cs (7)
115var path = Path.Combine(_contentRootDir, certificateConfig.Path); 116var dir = Path.GetDirectoryName(path)!; 141() => dirMetadata.FileProvider.Watch(Path.GetFileName(path)), 176var dirMetadata = _metadataForDirectory[Path.GetDirectoryName(path)!]; 185var fileInfo = dirMetadata.FileProvider.GetFileInfo(Path.GetFileName(path)); 218var path = Path.Combine(_contentRootDir, certificateConfig.Path); 219var dir = Path.GetDirectoryName(path)!;
Internal\Certificates\CertificateConfigLoader.cs (3)
40var certificatePath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!); 46var certificateKeyPath = Path.Combine(HostEnvironment.ContentRootPath, certInfo.KeyPath); 75return (new X509Certificate2(Path.Combine(HostEnvironment.ContentRootPath, certInfo.Path!), certInfo.Password), fullChain);
KestrelServerOptions.cs (1)
616if (!Path.IsPathRooted(socketPath))
ListenOptionsHttpsExtensions.cs (3)
43return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName))); 57return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password)); 72return listenOptions.UseHttps(new X509Certificate2(Path.Combine(env.ContentRootPath, fileName), password), configureOptions);
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 156var tmpFile = Path.GetTempFileName(); 207var certificatePath = Path.GetTempFileName(); 347var certificatePath = Path.GetTempFileName(); 377Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 817return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 849var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 852var nssDb = Path.GetFullPath(path); 1056var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
TlsConfigurationLoader.cs (3)
192var basePath = appData != null ? Path.Combine(appData, "ASP.NET", "https") : null; 193basePath = basePath ?? (home != null ? Path.Combine(home, ".aspnet", "https") : null); 194path = basePath != null ? Path.Combine(basePath, $"{applicationName}.pfx") : null;
Microsoft.AspNetCore.SpaProxy (6)
SpaHostingStartup.cs (1)
20var spaProxyConfigFile = Path.Combine(AppContext.BaseDirectory, "spa.proxy.json");
SpaProxyLaunchManager.cs (5)
178if (OperatingSystem.IsWindows() && !Path.HasExtension(command)) 197WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 244WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory) 269var scriptPath = Path.Combine(AppContext.BaseDirectory, fileName); 307WorkingDirectory = Path.Combine(AppContext.BaseDirectory, _options.WorkingDirectory)
Microsoft.AspNetCore.SpaServices.Extensions (1)
StaticFiles\DefaultSpaStaticFileProvider.cs (1)
31var absoluteRootPath = Path.Combine(
Microsoft.AspNetCore.StaticAssets (5)
Infrastructure\StaticAssetsEndpointDataSourceHelper.cs (3)
60return Path.Combine(AppContext.BaseDirectory, $"{environment.ApplicationName}.staticwebassets.endpoints.json"); 63return Path.IsPathRooted(staticAssetsManifestPath) ? staticAssetsManifestPath : Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath);
StaticAssetsEndpointRouteBuilderExtensions.cs (2)
33staticAssetsManifestPath = !Path.IsPathRooted(staticAssetsManifestPath) ? 34Path.Combine(AppContext.BaseDirectory, staticAssetsManifestPath) :
Microsoft.AspNetCore.StaticFiles (2)
StaticFileMiddleware.cs (2)
49_logger.WebRootPathNotFound(Path.GetFullPath(Path.Combine(hostingEnv.ContentRootPath, hostingEnv.WebRootPath ?? "wwwroot")));
Microsoft.AspNetCore.TestHost (2)
WebHostBuilderExtensions.cs (2)
199builder.UseContentRoot(Path.GetFullPath(Path.Combine(directoryInfo.FullName, solutionRelativePath)));
Microsoft.AspNetCore.WebUtilities (6)
AspNetCoreTempDirectory.cs (1)
20Path.GetTempPath(); // Fall back.
FileBufferingReadStream.cs (2)
238_tempFileName = Path.Combine(_tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid().ToString() + ".tmp"); 243var tempTempFileName = Path.GetTempFileName();
FileBufferingWriteStream.cs (3)
37/// uses the value returned by <see cref="Path.GetTempPath"/>. 270var tempFileName = Path.Combine(tempFileDirectory, "ASPNETCORE_" + Guid.NewGuid() + ".tmp"); 275var tempTempFileName = Path.GetTempFileName();
Microsoft.Build (268)
BackEnd\BuildManager\BuildManager.cs (1)
1826submission.BuildRequestData.ProjectFullPath = Path.Combine(
BackEnd\BuildManager\CacheSerialization.cs (1)
34Directory.CreateDirectory(Path.GetDirectoryName(fullPath));
BackEnd\BuildManager\CoordinatorClient.cs (2)
545string coordinatorDll = Path.Combine(msbuildDir, "MSBuild.Coordinator.dll"); 546string coordinatorExe = Path.Combine(msbuildDir, "MSBuild.Coordinator.exe");
BackEnd\BuildManager\MultiThreadedStrictModeScope.cs (3)
78string sentinelDirectory = Path.Combine(temporaryDirectory, SentinelDirectoryName); 91FileUtilities.PathComparer.Equals(Path.GetDirectoryName(sentinelDirectory), canonicalTemporaryDirectory), 323string name = Path.GetFileName(entry);
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (2)
161_debugDumpFilePath = Path.Combine(_debugDumpDirectory, $"EngineTrace_{EnvironmentUtilities.CurrentProcessId}.txt"); 421string projectDirectoryFullPath = Path.GetDirectoryName(config.ProjectFullPath);
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (1)
154(_projectRootDirectory = Path.GetDirectoryName(RequestConfiguration.ProjectFullPath));
BackEnd\Components\Communications\CurrentHost.cs (3)
31string dotnetExe = Path.Combine( 41&& Path.GetFileName(processPath) == Constants.DotnetProcessName) 51dotnetExe = Path.Combine(
BackEnd\Components\Communications\NodeLauncher.cs (1)
102string fileName = Path.GetFileName(msbuildLocation);
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (10)
179nodeProcesses.AddRange(Process.GetProcessesByName(Path.GetFileNameWithoutExtension(msbuildtaskhostExeName))); 282msbuildLocation = Path.Combine(msbuildExeName, ".exe"); 598: (Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost()) ?? Constants.MSBuildAppName); 601? Path.GetFileNameWithoutExtension(CurrentHost.GetCurrentHost()) 611bool isAppHost = Path.GetFileName(location) 614return Path.GetFileNameWithoutExtension( 637|| !Path.GetFileName(msbuildLocation).Equals(Constants.MSBuildExecutableName, StringComparison.OrdinalIgnoreCase) 638|| !string.Equals(Path.GetFileName(EnvironmentUtilities.ProcessPath), Constants.DotnetProcessName, StringComparison.OrdinalIgnoreCase)) 643string dllPath = Path.Combine(Path.GetDirectoryName(msbuildLocation), Constants.MSBuildAssemblyName);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (10)
768? Path.Combine(GetOrInitializeX64Clr2Path(toolName, basePath64), toolName) 769: Path.Combine(GetOrInitializeX32Clr2Path(toolName, basePath), toolName); 774return Path.Combine(s_pathToX64Clr4 ??= basePath64, toolName); 779return Path.Combine(s_pathToArm64Clr4 ??= basePathArm64, toolName); 782return Path.Combine(s_pathToX32Clr4 ??= basePath, toolName); 860string lastDirectoryName = Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar)); 894string fullPath = Path.Combine(envPath, toolName); 1282string appHostPath = Path.Combine(msbuildAssemblyPath, Constants.MSBuildExecutableName); 1285: (Path.Combine(msbuildAssemblyPath, Constants.MSBuildAssemblyName), false);
BackEnd\Components\Communications\RarNodeLauncher.cs (1)
64return pipeNames.Contains(Path.Combine(NamedPipeRoot, _pipeName));
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
187string pluginPath = FileUtilities.NormalizePath(Path.Combine(item.Project.Directory, item.EvaluatedInclude));
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (2)
547projectDirectory[i] = Path.GetDirectoryName(projectPath); 684outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
360if (!Path.IsPathRooted(projectFiles[i])) 362projectFiles[i] = Path.Combine(_requestEntry.ProjectRootDirectory, projectFiles[i]);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (5)
993string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); 1018string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); 1053string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); 1208path1 = Path.Combine(_project.Directory, path1); 1211path2 = Path.Combine(_project.Directory, path2);
BackEnd\Components\Scheduler\Scheduler.cs (2)
275_debugDumpTraceFilePath = Path.Combine(_debugDumpDirectory, $"SchedulerTrace_{EnvironmentUtilities.CurrentProcessId}.txt"); 276_debugDumpStateFilePath = Path.Combine(_debugDumpDirectory, $"SchedulerState_{EnvironmentUtilities.CurrentProcessId}.txt");
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
31string sdkPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildSDKsPath, sdk.Name, "Sdk");
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (4)
69Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, "SdkResolvers"), location); 96Path.Combine(BuildEnvironmentHelper.Instance.MSBuildToolsDirectoryRoot, "SdkResolvers"), location); 132var manifest = Path.Combine(subfolder.FullName, $"{subfolder.Name}.xml"); 133var assembly = Path.Combine(subfolder.FullName, $"{subfolder.Name}.dll");
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (3)
84if (!System.IO.Path.IsPathRooted(manifest.Path)) 86manifest.Path = System.IO.Path.Combine(manifestFolder, manifest.Path); 87manifest.Path = System.IO.Path.GetFullPath(manifest.Path);
BackEnd\Shared\BuildRequestConfiguration.cs (4)
389if (MemoryExtensions.Equals(Path.GetFileName(ProjectFullPath.AsSpan()), "dirs.proj", StringComparison.OrdinalIgnoreCase)) 847Directory.CreateDirectory(Path.GetDirectoryName(cacheFile)); 953Assumed.True(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases"); 1132string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, "Configuration{0}.cache", _configId));
BackEnd\Shared\TargetResult.cs (4)
282string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, Path.Combine("Results{0}", "{1}.cache"), configId, targetToCache)); 292string directoryName = Path.GetDirectoryName(filename); 316Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));
BuildCheck\Acquisition\BuildCheckAcquisitionModule.cs (1)
77checkContext.DispatchFailedAcquisitionTelemetry(System.IO.Path.GetFileName(checkAcquisitionData.AssemblyPath), ex);
BuildCheck\Checks\CopyAlwaysCheck.cs (1)
85Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\DoubleWritesCheck.cs (5)
104CheckWrite(context, Path.Combine(destinationFolderPath, Path.GetFileName(sourceFilePath))); 122fileBeingWritten = Path.GetFullPath(fileBeingWritten, context.Data.ProjectFileDirectory); 131Path.GetFileName(context.Data.ProjectFilePath), 132Path.GetFileName(existingEntry.projectFilePath),
BuildCheck\Checks\EmbeddedResourceCheck.cs (3)
80Path.GetFileName(context.Data.ProjectFilePath), 109string extension = Path.GetExtension(Path.GetFileNameWithoutExtension(s));
BuildCheck\Checks\ExecCliBuildCheck.cs (2)
87Path.GetFileName(context.Data.ProjectFilePath), 103Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\PreferProjectReferenceCheck.cs (4)
75Path.GetFileName(context.Data.ProjectFilePath), 76Path.GetFileName(projectProducingOutput.Item1), 103Path.GetFileName(projectReferencedViaOutput), 104Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\SharedOutputPathCheck.cs (2)
81Path.GetFileName(projectPath), 82Path.GetFileName(conflictingProject),
BuildCheck\Checks\TargetFrameworkConfusionCheck.cs (1)
59Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\TargetFrameworkUnexpectedCheck.cs (1)
99Path.GetFileName(context.Data.ProjectFilePath),
BuildCheck\Checks\UntrustedLocationCheck.cs (1)
104return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
BuildCheck\Checks\WriteLinesToFileBuildCheck.cs (1)
54Path.GetFileName(context.Data.ProjectFilePath)));
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (2)
195else if (Path.DirectorySeparatorChar == '/') 201else if (!sawStartChar && Path.DirectorySeparatorChar == '\\')
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (5)
48var directoryOfTheProject = Path.GetDirectoryName(filePath)!; 67editorConfigFilePath = FileUtilities.GetPathOfFileAbove(EditorconfigFile, Path.GetDirectoryName(Path.GetDirectoryName(editorConfigFilePath))!); 104internal static string NormalizeWithForwardSlash(string p) => Path.DirectorySeparatorChar == '/' ? p : p.Replace(Path.DirectorySeparatorChar, '/');
BuildCheck\OM\BuildCheckDataContext.cs (1)
49_projectFileDirectory ??= Path.GetDirectoryName(ProjectFilePath)!;
BuildCheck\Utilities\BuildCheckUtilities.cs (3)
13if (!Path.IsPathRooted(path)) 15path = Path.Combine(Path.GetDirectoryName(projectFilePath)!, path);
Construction\ProjectRootElement.cs (2)
440_directory = Path.GetDirectoryName(newFullPath); 2105_directory = Path.GetDirectoryName(fullPath);
Construction\Solution\ProjectInSolution.cs (2)
183_absolutePath = Path.Combine(ParentSolution.SolutionFileDirectory, _relativePath); 238internal string Extension => Path.GetExtension(_relativePath);
Construction\Solution\SolutionFile.cs (7)
250SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 644SolutionFileDirectory = Path.GetDirectoryName(_solutionFile); 672return FileUtilities.GetFullPath(solution.GetProperty("path").GetString(), Path.GetDirectoryName(solutionFilterFile), escape: false); 919ElementLocation.Create(FileUtilities.GetFullPath(project, Path.GetDirectoryName(_solutionFile))), 1162string fullPathToEtpProj = Path.Combine(SolutionFileDirectory, etpProj.RelativePath); 1163string etpProjectRelativeDir = Path.GetDirectoryName(etpProj.RelativePath); 1216RelativePath = Path.Combine(etpProjectRelativeDir, fileElementValue)
Construction\Solution\SolutionProjectGenerator.cs (11)
1077string escapedSolutionFileName = EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath)); 1085string localFile = Path.Combine(escapedSolutionDirectory, $"before.{escapedSolutionFileName}.targets"); 1089localFile = Path.Combine(escapedSolutionDirectory, $"after.{escapedSolutionFileName}.targets"); 1364baseName = Path.Combine(_solutionFile.SolutionFileDirectory, MakeIntoSafeItemName(project.GetUniqueProjectName())); 2353if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 2355directoryName += Path.DirectorySeparatorChar; 2359globalProperties.AddProperty("SolutionExt", EscapingUtilities.Escape(Path.GetExtension(_solutionFile.FullPath))); 2360globalProperties.AddProperty("SolutionFileName", EscapingUtilities.Escape(Path.GetFileName(_solutionFile.FullPath))); 2361globalProperties.AddProperty("SolutionName", EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_solutionFile.FullPath))); 2363globalProperties.AddProperty(SolutionPathPropertyName, EscapingUtilities.Escape(Path.Combine(_solutionFile.SolutionFileDirectory, Path.GetFileName(_solutionFile.FullPath))));
Definition\Toolset.cs (4)
371string rootPath = Path.GetPathRoot(Path.GetFullPath(toolsPathToUse)); 895if (Path.IsPathRooted(_overrideTasksPath)) 997yield return (usingTask, Path.GetDirectoryName(defaultTasksFile));
Definition\ToolsetLocalReader.cs (1)
40System.IO.Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "Roslyn"),
Definition\ToolsetReader.cs (8)
179var currentDir = BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory.TrimEnd(Path.DirectorySeparatorChar); 205var xbuildToolsetsDir = Path.Combine(libraryPath, $"xbuild{Path.DirectorySeparatorChar}"); 211var version = Path.GetFileName(d); 212var binPath = Path.Combine(d, "bin"); 633if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) 635path = Path.GetFullPath( 636Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, trimmedValue));
ElementLocation\XmlDocumentWithLocation.cs (3)
358if (Path.GetFileName(fullPath).StartsWith("Microsoft.", StringComparison.OrdinalIgnoreCase)) 361Assumed.True(Path.IsPathRooted(fullPath), "should be full path"); 362string directory = Path.GetDirectoryName(fullPath);
Evaluation\Conditionals\FunctionCallExpressionNode.cs (5)
86return lastCharacter == Path.DirectorySeparatorChar || lastCharacter == Path.AltDirectorySeparatorChar || lastCharacter == '\\'; 172if (state.EvaluationDirectory != null && !Path.IsPathRooted(item.ItemSpec)) 174list.Add(Path.GetFullPath(Path.Combine(state.EvaluationDirectory, item.ItemSpec)));
Evaluation\Evaluator.cs (9)
1334string projectFileWithoutExtension = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(_projectRootElement.FullPath)); 1335string projectExtension = EscapingUtilities.Escape(Path.GetExtension(_projectRootElement.FullPath)); 1338string projectFullPath = Path.Combine(projectDirectory, projectFile); 1340int rootLength = Path.GetPathRoot(projectDirectory).Length; 2003ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(sdkResult.Path, project), 2016ExpandAndLoadImportsFromUnescapedImportExpression(directoryOfImportingFile, importElement, Path.Combine(additionalPath, project), 2053string dotnetExe = Path.Combine(FileUtilities.GetFolderAbove(sdkResult.Path, 5), Constants.DotnetProcessName); 2267if (directoryOfImportingFile != null && !Path.IsPathRooted(importFileUnescaped)) 2269importFileUnescaped = Path.Combine(directoryOfImportingFile, importFileUnescaped);
Evaluation\Expander.Function.cs (2)
432|| _receiverType == typeof(System.IO.Path) || isFileSystemInfoConstructor) 493string startingDirectory = String.IsNullOrWhiteSpace(elementLocation.File) ? String.Empty : Path.GetDirectoryName(elementLocation.File);
Evaluation\Expander.ItemExpander.Transforms.cs (10)
176if (Path.IsPathRooted(unescapedPath)) 188rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 226string combinedPath = Path.Combine(unescapedPath, relativePath); 266if (Path.IsPathRooted(unescapedPath)) 278rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 285directoryName = Path.GetDirectoryName(rootedPath); 301directoryName = Path.GetDirectoryName(directoryName); 351if (Path.IsPathRooted(unescapedPath)) 363rootedPath = Path.Combine(baseDirectoryToUse, unescapedPath); 366directoryName = Path.GetDirectoryName(rootedPath);
Evaluation\Expander.PropertyExpander.cs (6)
637return Path.GetFileName(file); 640return Path.GetFileNameWithoutExtension(file); 646return Path.GetExtension(file); 649return FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(file)); 652string directory = Path.GetDirectoryName(file); 653int rootLength = Path.GetPathRoot(directory).Length;
Evaluation\Expander\WellKnownFunctions.cs (24)
35var logFile = Path.Combine(Directory.GetCurrentDirectory(), fileName); 47if (string.Equals(methodName, nameof(Path.Combine), StringComparison.OrdinalIgnoreCase)) 59returnVal = Path.Combine(arg0); 66returnVal = Path.Combine(arg0, arg1); 73returnVal = Path.Combine(arg0, arg1, arg2); 80returnVal = Path.Combine(arg0, arg1, arg2, arg3); 87returnVal = Path.Combine(Array.ConvertAll(args, o => (string)o)); 93else if (string.Equals(methodName, nameof(Path.DirectorySeparatorChar), StringComparison.OrdinalIgnoreCase)) 97returnVal = Path.DirectorySeparatorChar; 101else if (string.Equals(methodName, nameof(Path.GetFullPath), StringComparison.OrdinalIgnoreCase)) 106? Path.GetFullPath(Path.Combine(FileUtilities.CurrentThreadWorkingDirectory, arg0)) 107: Path.GetFullPath(arg0); 111else if (string.Equals(methodName, nameof(Path.IsPathRooted), StringComparison.OrdinalIgnoreCase)) 115returnVal = Path.IsPathRooted(arg0); 119else if (string.Equals(methodName, nameof(Path.GetTempPath), StringComparison.OrdinalIgnoreCase)) 123returnVal = Path.GetTempPath(); 127else if (string.Equals(methodName, nameof(Path.GetFileName), StringComparison.OrdinalIgnoreCase)) 131returnVal = Path.GetFileName(arg0); 135else if (string.Equals(methodName, nameof(Path.GetDirectoryName), StringComparison.OrdinalIgnoreCase)) 139returnVal = Path.GetDirectoryName(arg0); 143else if (string.Equals(methodName, nameof(Path.GetFileNameWithoutExtension), StringComparison.OrdinalIgnoreCase)) 147returnVal = Path.GetFileNameWithoutExtension(arg0); 853else if (receiverType == typeof(Path))
Evaluation\IntrinsicFunctions.cs (3)
296return Path.Combine(NativeMethodsShared.FrameworkBasePath, m.Groups[0].Value) + Path.DirectorySeparatorChar; 574return FileUtilities.NormalizePath(ResolveAgainstThreadWorkingDirectory(Path.Combine(path)));
Evaluation\ParserIgnoreConfiguration.cs (1)
204string[] paths = envValue.Split(new[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries);
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (1)
101evaluationLocation.File == null ? string.Empty : System.IO.Path.GetFileName(evaluationLocation.File),
FileSystem\DirectoryCacheFileSystemWrapper.cs (1)
93FindTransform<string> transform = (ref ReadOnlySpan<char> fileName) => Path.Join(path.AsSpan(), fileName);
Globbing\MSBuildGlob.cs (3)
143var rootedInput = Path.Combine(_state.Value.GlobRoot, stringToMatch); 150normalizedInput += Path.DirectorySeparatorChar; 237var parentedFixedPart = Path.Combine(globRoot, fixedDirPart);
Graph\GraphBuilder.cs (7)
316if (!solutionDirectoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 318solutionDirectoryName += Path.DirectorySeparatorChar; 322solutionGlobalPropertiesBuilder["SolutionExt"] = EscapingUtilities.Escape(Path.GetExtension(Solution.FullPath)); 323solutionGlobalPropertiesBuilder["SolutionFileName"] = EscapingUtilities.Escape(Path.GetFileName(Solution.FullPath)); 324solutionGlobalPropertiesBuilder["SolutionName"] = EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(Solution.FullPath)); 325solutionGlobalPropertiesBuilder[SolutionProjectGenerator.SolutionPathPropertyName] = EscapingUtilities.Escape(Path.Combine(Solution.SolutionFileDirectory, Path.GetFileName(Solution.FullPath)));
Graph\ProjectGraph.cs (1)
547var nodeName = Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
Instance\ProjectInstance.cs (3)
390_directory = Path.GetDirectoryName(projectPath); 443_directory = Path.GetDirectoryName(projectPath); 3171DirectoryPath = Path.GetDirectoryName(projectFile)
Instance\ProjectItemInstance.cs (1)
2454if (Path.DirectorySeparatorChar != '\\' && includeEscaped?.IndexOf('\\') > -1)
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
266string assemblyName = loadInfo.AssemblyName ?? Path.GetFileName(loadInfo.AssemblyFile); 665netCoreSdkRoot = Path.GetDirectoryName(ridGraphPath);
Instance\TaskRegistry.cs (1)
997!FileClassifier.IsMicrosoftAssembly(Path.GetFileName(_taskFactoryAssemblyLoadInfo.AssemblyFile)) &&
Instance\TaskRegistry.UsingTaskInfo.cs (9)
75Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, TasksV4Filename); 81Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, TasksV12Filename); 99Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, TasksCoreFilename); 401if (assemblyFile != null && !Path.IsPathRooted(assemblyFile)) 403assemblyFile = Strings.WeakIntern(Path.Combine(directoryOfImportingFile, assemblyFile)); 516string replacedAssemblyFile = Path.Combine(Path.GetDirectoryName(assemblyFile)!, TasksCoreFilename); 569string replacedAssemblyFile = Path.Combine(Path.GetDirectoryName(assemblyFile)!, TasksCoreFilename);
Logging\BinaryLogger\BinaryLogger.cs (6)
467logDirectory = Path.GetDirectoryName(FilePath); 692string directory = Path.GetDirectoryName(additionalPath); 792string fullPath = Path.GetFullPath(generatedFileUsedEventArgs.FilePath); 850FilePath = Path.GetFullPath(FilePath); 884return Path.GetFullPath(DefaultBinlogFileName); 906return Path.GetFullPath(filePath);
Logging\BinaryLogger\BuildEventArgsReader.cs (4)
519new ProjectImportsCollector(Path.GetRandomFileName(), false, runOnBackground: false); 596Path.Combine(FileUtilities.TempFileDirectory, Path.GetRandomFileName()), 2182filePath = Path.GetTempFileName();
Logging\BinaryLogger\BuildEventArgsWriter.cs (3)
1334if (Path.IsPathRooted(itemSpec) || string.IsNullOrEmpty(projectFile)) 1339string projectDirectory = Path.GetDirectoryName(projectFile); 1342: FileUtilities.GetFullPathNoThrow(Path.Combine(projectDirectory, itemSpec));
Logging\BinaryLogger\ProjectImportsCollector.cs (4)
52=> Path.ChangeExtension(logFilePath, sourcesArchiveExtension); 70_archiveFilePath = Path.Combine( 73Path.GetFileName(logFilePath), 232filePath = Path.GetFullPath(filePath);
Logging\DistributedLoggers\DistributedFileLogger.cs (1)
105string extension = Path.GetExtension(_logFile);
Logging\FileLogger.cs (3)
103logDirectory = Path.GetDirectoryName(Path.GetFullPath(_logFileName)); 244internal string FilePath => Path.GetFullPath(_logFileName);
Logging\LoggerDescription.cs (2)
60if (loggerAssemblyFile != null && !Path.IsPathRooted(loggerAssemblyFile)) 254AssemblyLoadInfo.Create(_loggerAssembly.AssemblyName, Path.GetFullPath(_loggerAssembly.AssemblyFile));
Logging\ProfilerLogger.cs (1)
292var content = System.IO.Path.GetExtension(FileToLog) == ".md"
Logging\TerminalLogger\TerminalLogger.cs (14)
944Uri.TryCreate(new(Path.GetDirectoryName(outputPathSpan)), UriKind.Absolute, out Uri? uri); 962&& (outputPathSpan[workingDirectorySpan.Length] == Path.DirectorySeparatorChar 963|| outputPathSpan[workingDirectorySpan.Length] == Path.AltDirectorySeparatorChar)) 971var relativePathFromWorkingDirToSourceRoot = Path.GetRelativePath(workingDirectorySpan.ToString(), sourceRootSpan.ToString()).AsSpan(); 976&& (outputPathSpan[sourceRootSpan.Length - 1] == Path.DirectorySeparatorChar 977|| outputPathSpan[sourceRootSpan.Length - 1] == Path.AltDirectorySeparatorChar)) 980projectDisplayPathSpan = Path.Combine(relativePathFromWorkingDirToSourceRoot.ToString(), outputPathSpan.Slice(sourceRootSpan.Length).ToString()).AsSpan(); 1002Path.GetFileNameWithoutExtension(project.ProjectFile) : 1068string projectFile = Path.GetFileNameWithoutExtension(e.ProjectFile); 1191string projectFile = Path.GetFileNameWithoutExtension(e.ProjectFile); 1228var projectFileName = Path.GetFileName(e.ProjectFile.AsSpan()); 1231message.AsSpan().StartsWith(Path.GetFileNameWithoutExtension(projectFileName))) 1687int index = path.AsSpan().LastIndexOfAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Resources\Constants.cs (2)
179[DynamicDependency(PropertyFunctionMembers, typeof(Path))] 292availableStaticMethods.TryAdd("System.IO.Path", new Tuple<string, Type>(null, typeof(Path)));
Utilities\FileSpecMatchTester.cs (3)
69fileToMatch = FileUtilities.GetFullPathNoThrow(Path.Combine(_currentDirectory, fileToMatch)); 90string filename = Path.GetFileName(normalizedFileToMatch); 129var absoluteFixedDirPart = Path.Combine(currentDirectory, fixedDirPart);
Utilities\Utilities.cs (1)
577string userExtensionsPath = Path.Combine(localAppData, ReservedPropertyNames.UserExtensionsPathSuffix);
Xml\ProjectXmlUtilities.cs (1)
93if (Path.GetExtension(element.Location.File).Equals(".dwproj", StringComparison.OrdinalIgnoreCase))
Microsoft.Build.Framework (240)
BackEnd\CommunicationsUtilities.cs (1)
810string filePath = Path.Combine(s_debugDumpPath, fileName);
BackEnd\NamedPipeUtil.cs (1)
31return Path.Combine("/tmp", pipeName);
BuildEnvironmentHelper.cs (13)
165return TryFromStandaloneMSBuildExe(Path.Combine(sdkRoot, Constants.MSBuildExecutableName)) 166?? TryFromStandaloneMSBuildExe(Path.Combine(sdkRoot, Constants.MSBuildAssemblyName)); 240var msBuildExecutableCandidate = Path.Combine(Path.GetDirectoryName(buildAssembly), Constants.MSBuildExecutableName); 368return TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildExecutableName)) 370?? TryFromStandaloneMSBuildExe(Path.Combine(appContextBaseDirectory, Constants.MSBuildAssemblyName)); 392string directory = Path.GetDirectoryName(msBuildAssembly); 430var processFileName = Path.GetFileNameWithoutExtension(processName); 606CurrentMSBuildConfigurationFile = Path.ChangeExtension(currentMSBuildExePath, configFileExtension); 656MSBuildToolsDirectory64 = existsCheck(potentialAmd64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "amd64") : CurrentMSBuildToolsDirectory; 660MSBuildToolsDirectoryArm64 = existsCheck(potentialARM64FromX86) ? Path.Combine(MSBuildToolsDirectoryRoot, "arm64") : CurrentMSBuildToolsDirectory; 667? Path.Combine(VisualStudioInstallRootDirectory, "MSBuild") 725defaultSdkPath = Path.Combine(CurrentMSBuildToolsDirectory, "Sdks");
Debugging\DebugUtils.cs (8)
93debugDirectory = Path.Combine(debugDirectory, ".MSBuild_Logs"); 97debugDirectory = Path.Combine(Directory.GetCurrentDirectory(), ".MSBuild_Logs"); 101debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, ".MSBuild_Logs"); 208var extension = Path.GetExtension(fileName); 209var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 211var fullPath = Path.Combine(DebugPath, fileName); 217fullPath = Path.Combine(DebugPath, fileName); 272s_dumpFileName = Path.Combine(DebugDumpPath, $"MSBuild_pid-{pid}_{guid:n}.failure.txt");
Debugging\PrintLineDebuggerWriters.cs (3)
27var file = Path.Combine(LogFileRoot, string.IsNullOrEmpty(id) ? "NoId" : id) + ".csv"; 32var errorFile = Path.Combine(LogFileRoot, $"LoggingException_{Guid.NewGuid()}"); 83: Path.Combine(artifactsPart, "log", "Debug");
DotnetHostEnvironmentHelper.cs (1)
139return Path.GetDirectoryName(dotnetHostPath);
ErrorUtilities.cs (1)
26if (!Path.IsPathRooted(value))
FileClassifier.cs (5)
125RegisterImmutableDirectory(Path.Combine(programFiles, "Reference Assemblies", "Microsoft"), false); 331return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); // .Replace("//", "/"); 351return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 358fileSpec += Path.DirectorySeparatorChar;
FileUtilities_TempFiles.cs (5)
89string temporaryDirectory = Path.Combine(TempFileDirectory, $"Temporary{Guid.NewGuid():N}", subfolder ?? string.Empty); 194string file = Path.Combine(directory, $"{fileName}{extension}"); 218string destFile = Path.Combine(dest, fileInfo.Name); 223string destDir = Path.Combine(dest, subdirInfo.Name); 236: System.IO.Path.Combine(TempFileDirectory, name);
FileUtilities.cs (40)
25using NewPath = System.IO.Path; 26using Path = System.IO.Path; 113internal static readonly string DirectorySeparatorString = Path.DirectorySeparatorChar.ToString(); 126cacheDirectory = Path.Combine(TempFileDirectory, string.Format(CultureInfo.CurrentUICulture, "MSBuild{0}-{1}", EnvironmentUtilities.CurrentProcessId, AppDomain.CurrentDomain.Id)); 152return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); 173=> path.IsNullOrEmpty() || Path.DirectorySeparatorChar == WindowsDirectorySeparator 188fileSpec += Path.DirectorySeparatorChar; 275path.Value + Path.DirectorySeparatorChar, 331return new AbsolutePath(FixFilePath(NewPath.GetFullPath(path.Value)), 378if (NewPath.IsPathFullyQualified(path)) 388return new AbsolutePath(NewPath.GetFullPath(path, workingDir!)); 443string testFilePath = Path.Combine(directory, $"MSBuild_{Guid.NewGuid():N}_testFile.txt"); 492string.Concat(path.AsSpan(start), new(in Path.DirectorySeparatorChar))); 582while (i > 0 && fullPath[--i] != Path.DirectorySeparatorChar && fullPath[i] != Path.AltDirectorySeparatorChar) 681string fullPath = NewPath.GetFullPath(path); 687return NormalizePath(Path.Combine(directory, file)); 692return NormalizePath(Path.Combine(paths)); 844return (shouldCheckDirectory && DefaultFileSystem.DirectoryExists(Path.Combine(baseDirectory, directory.ToString()))) 855string? directory = Path.GetDirectoryName(FixFilePath(fileSpec)); 867directory += Path.DirectorySeparatorChar; 912if (allowedExtensions != null && Path.HasExtension(fileName)) 944string fullPath = NormalizePath(Path.Combine(currentDirectory, fileSpec)); 958fullPath += Path.DirectorySeparatorChar; 1022var fullPath = GetFullPathNoThrow(Path.Combine(currentDirectory, normalizedPath)); 1356string fullBase = NewPath.GetFullPath(basePath); 1357string fullPath = NewPath.GetFullPath(path); 1366while (path[indexOfFirstNonSlashChar] == Path.DirectorySeparatorChar) 1397sb.Append("..").Append(Path.DirectorySeparatorChar); 1401sb.Append(splitPath[i]).Append(Path.DirectorySeparatorChar); 1404if (fullPath[fullPath.Length - 1] != Path.DirectorySeparatorChar) 1441return Path.IsPathRooted(FixFilePath(path)); 1487return paths.Aggregate(root, Path.Combine); 1515var separator = Path.DirectorySeparatorChar; 1656string? lookInDirectory = NewPath.GetFullPath(startingDirectory); 1661string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); 1675lookInDirectory = Path.GetDirectoryName(lookInDirectory); 1695if (file.Any(i => i.Equals(Path.DirectorySeparatorChar) || i.Equals(Path.AltDirectorySeparatorChar)))
Globbing\MSBuildPathMatcher.cs (2)
730value == Path.DirectorySeparatorChar || value == Path.AltDirectorySeparatorChar;
IMultiThreadableTask.cs (1)
17/// <item>Use <see cref="TaskEnvironment.GetAbsolutePath(string)"/> instead of <see cref="System.IO.Path.GetFullPath(string)"/> for path resolution</item>
InterningWriteTranslator.cs (2)
28private static readonly char[] DirectorySeparatorChars = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
ItemSpecModifiers.cs (9)
86Directory = Path.Combine(rootDir, directory); 511string? root = Path.GetPathRoot(fullPath)!; 521root += Path.DirectorySeparatorChar; 539return Path.GetFileNameWithoutExtension(FileUtilities.FixFilePath(itemSpec)); 554return Path.GetExtension(itemSpec); 633if (!Path.IsPathRooted(path)) 666return Path.GetDirectoryName(path) == null; 679_ = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec));
Loader\CoreCLRAssemblyLoader.cs (2)
56Debug.Assert(Path.IsPathRooted(fullPath)); 186var candidatePath = Path.Combine(searchPath,
Loader\MSBuildLoadContext.cs (3)
45_resolver = FileSystems.Default.FileExists(assemblyPath) && FileSystems.Default.FileExists(Path.ChangeExtension(assemblyPath, ".deps.json")) 85var candidatePath = Path.Combine(_directory, 108var assemblyNameInExecutableDirectory = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory,
Loader\TypeLoader.cs (5)
83string msbuildDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 84microsoftBuildFrameworkPath = Path.Combine(msbuildDirectory, "Microsoft.Build.Framework.dll"); 253string baseDir = Path.GetDirectoryName(assemblyLoadInfo.AssemblyFile); 278string assemblyDirectory = Path.GetDirectoryName(assemblyFilePath); 555assembliesDictionary[Path.GetFileName(path)] = path;
MSBuildConstants.cs (3)
129internal static readonly char[] DirectorySeparatorChar = [Path.DirectorySeparatorChar]; 133internal static readonly char[] PathSeparatorChar = [Path.PathSeparator]; 136internal static readonly SearchValues<char> InvalidPathChars = SearchValues.Create(Path.GetInvalidPathChars());
MultiProcessTaskEnvironmentDriver.cs (1)
49return GetAbsolutePath(Path.GetTempPath());
MultiThreadedTaskEnvironmentDriver.cs (2)
113systemTempDirectory = Path.Combine(GetWindowsDirectory(), "SystemTemp"); 146return Path.GetDirectoryName(Environment.SystemDirectory)!;
NativeMethods.cs (3)
560Path.GetDirectoryName(baseTypeLocation) 581dir = Path.GetDirectoryName(dir); 1257/// Unlike <see cref="System.IO.Path.GetFullPath(string)"/>, this resolves symlinks against the real
PathHelpers\AbsolutePath.cs (8)
92if (!Path.IsPathFullyQualified(path)) 112string combined = Path.Combine(basePath.Value, path); 138|| Path.IsPathFullyQualified(combined)) 147string? root = Path.GetPathRoot(basePath); 156return Path.Combine(basePath, combined.Substring(2)); 170/// Returns the canonical form of this path, equivalent to calling <see cref="System.IO.Path.GetFullPath(string)"/>. 177/// The canonical form of a path is exactly what <see cref="System.IO.Path.GetFullPath(string)"/> would produce, 191return new AbsolutePath(System.IO.Path.GetFullPath(Value), OriginalValue, ignoreRootedCheck: true);
ProjectFinishedEventArgs.cs (1)
114RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(ProjectFile));
ProjectStartedEventArgs.cs (1)
537string? projectFilePath = Path.GetFileName(ProjectFile);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
TargetFinishedEventArgs.cs (1)
181RawMessage = FormatResourceStringIgnoreCodeAndKeyword(Succeeded ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile));
Telemetry\BuildTelemetry.cs (1)
246AddIfNotNull(ProjectPath != null ? Path.GetFileName(ProjectPath) : null, nameof(ProjectPath));
Telemetry\CrashTelemetry.cs (1)
848string project = projectFile is null ? "?" : TelemetryDataUtils.GetHashed(Path.GetFileName(projectFile));
Utilities\AssemblyLoadInfo.cs (1)
202Assumed.True(Path.IsPathRooted(assemblyFile), "Assembly file path should be rooted");
Utilities\FileMatcher.cs (28)
127private static readonly string s_directorySeparatorString = Path.DirectorySeparatorChar.ToString(); 390Path.GetExtension(searchPattern).Length == (3 + 1 /* +1 for the period */) && 594longPath = Path.Combine(longPath, parts[i]); 622longParts[i - startingElement] = Path.GetFileName(longPath); 788return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 1584return GlobPattern.MatchesName(Path.GetFileName(path.AsSpan()), pattern); 1754Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 1850fixedDirectoryPart = Path.Combine(projectDirectoryUnescaped, fixedDirectoryPart); 2175|| (projectDirectory is null && !Path.IsPathRooted(excludeSpec))) 2186&& (FileUtilities.IsAnySlash(spec[0]) || Path.IsPathRooted(spec)); 2199string? root = Path.GetPathRoot(directory); 2214if (isLegalFileSpec && projectRoot is not null && !Path.IsPathRooted(fixedDirectoryPart)) 2218fixedDirectoryPart = Path.Combine(projectRoot, fixedDirectoryPart); 2273&& !Path.IsPathRooted(fileSpec)) 2421includeBaseDirectory = Path.Combine(projectDirectory, includeBaseDirectory); 2422excludeBaseDirectory = Path.Combine(projectDirectory, excludeBaseDirectory); 2474bool includeIsRooted = Path.IsPathRooted(fileSpec); 2488Path.IsPathRooted(excludeSpec), 2531: Path.Combine(projectDirectory, includeBaseDirectory.ToString()); 2534: Path.Combine(projectDirectory, excludeBaseDirectory.ToString()); 2865string directoryName = Path.GetFileName(subdirectory); 2868: Path.Combine(parentRelativeDirectory, directoryName); 3040&& Path.IsPathFullyQualified(directory) 3041&& directory[1] == Path.VolumeSeparatorChar 3132Path.Combine(_enumerationRoot, relativeDirectory.ToString()), 3232FileMatcher.Normalize(Path.GetFullPath(string.IsNullOrEmpty(directory) ? "." : directory)); 3368builder.Append(Path.DirectorySeparatorChar);
Utilities\FrameworkLocationHelper.cs (30)
425? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 435? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 445? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV30) 455? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV35) 465? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV40) 475? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV45) 485? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV11) 495? Path.Combine(NativeMethods.FrameworkBasePath, dotNetFrameworkVersionFolderPrefixV20) 572Path.DirectorySeparatorChar.ToString(), 576Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin"); 581s_pathToV35ToolsInFallbackDotNetFrameworkSdk += Path.DirectorySeparatorChar; 621s_pathToV4ToolsInFallbackDotNetFrameworkSdk = Path.Combine(FallbackDotNetFrameworkSdkInstallPath, "bin", "NetFX 4.0 Tools"); 816var frameworkPath = Path.Combine(NativeMethods.FrameworkBasePath, prefix ?? string.Empty); 826return Path.Combine(complusInstallRoot, complusVersion); 831string leaf = Path.GetFileName(currentRuntimePath); 839string baseLocation = Path.GetDirectoryName(currentRuntimePath); 959combinedPath = Path.GetFullPath(combinedPath); 967? Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework") 968: Path.Combine(NativeMethods.FrameworkBasePath, "xbuild-frameworks"); 970return Path.GetFullPath(combinedPath); 1018string path = Path.Combine(targetFrameworkRootPath, frameworkName.Identifier, "v" + frameworkName.Version.ToString()); 1021path = Path.Combine(path, "Profile", frameworkName.Profile); 1024return Path.GetFullPath(path); 1046var endedWithASlash = path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) 1048Path.AltDirectorySeparatorChar.ToString(), 1067fixedPath += Path.DirectorySeparatorChar; 1125string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); 1448(!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, Constants.MSBuildExecutableName)) && 1449!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) 1481frameworkPath = Path.Combine(frameworkPath, this.Version.ToString());
Utilities\PlatformManifest.cs (1)
95string platformManifestPath = Path.Combine(_pathToManifest, "Platform.xml");
Utilities\SDKManifest.cs (1)
290string sdkManifestPath = Path.Combine(_pathToSdk, "SDKManifest.xml");
Utilities\TaskFactoryUtilities.cs (5)
143string? directory = Path.GetDirectoryName(assemblyPath); 262path = Path.Combine(directory, assemblyName.CultureName, assemblyName.Name + ".dll"); 270path = Path.Combine(directory, assemblyName.Name + ".dll"); 298if (!isMultiThreadedBuild || Path.IsPathFullyQualified(path)) 304return Path.Combine(projectDirectory, path);
Utilities\ToolLocationHelper_FrameworkPaths.cs (10)
315pathToSdk = Path.Combine(pathToSdk, "x64"); 319pathToSdk = Path.Combine(pathToSdk, "ia64"); 328string filePath = Path.Combine(pathToSdk, fileName); 437pathToSdk = Path.Combine(pathToSdk, "bin"); 478pathToSdk = Path.Combine(pathToSdk, "x86"); 482pathToSdk = Path.Combine(pathToSdk, "x64"); 491string filePath = Path.Combine(pathToSdk, fileName); 557toolPath = Path.Combine(toolPath, fileName); 588return pathToFx == null ? null : Path.Combine(pathToFx, fileName); 596public static string GetPathToSystemFile(string fileName) => Path.Combine(PathToSystem, fileName);
Utilities\ToolLocationHelper_InstalledFrameworks.cs (6)
220string frameworkIdentifierPath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 278string frameworkProfilePath = Path.Combine(frameworkReferenceRoot, frameworkIdentifier); 279frameworkProfilePath = Path.Combine(frameworkProfilePath, frameworkVersion); 280frameworkProfilePath = Path.Combine(frameworkProfilePath, "Profiles"); 325string dotNextFx30RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV30); 332string dotNextFx35RefPath = Path.Combine(frameworkReferenceRoot, FrameworkLocationHelper.dotNetFrameworkVersionFolderPrefixV35);
Utilities\ToolLocationHelper_PlatformSDKs.cs (5)
108propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName); 112propsFileLocation = Path.Combine(sdkRoot, designTimeFolderName, commonConfigurationFolderName, neutralArchitectureName, targetPlatformIdentifier, targetPlatformVersion); 190winmdLocation = Path.Combine(sdkRoot, referencesFolderName, commonConfigurationFolderName, neutralArchitectureName); 284string referencesRoot = Path.Combine(targetPlatformSdkRoot, referencesFolderName, targetPlatformSdkVersion); 289string contractPath = Path.Combine(referencesRoot, contract.Name, contract.Version);
Utilities\ToolLocationHelper_ReferenceAssemblies.cs (10)
68if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 142if (legacyMsCorlib20Path != null && FileSystems.Default.FileExists(Path.Combine(legacyMsCorlib20Path, "mscorlib.dll"))) 159if (FileSystems.Default.FileExists(Path.Combine(referenceAssemblyDirectory, "mscorlib.dll"))) 466Path.DirectorySeparatorChar.ToString(), 469dotNetFrameworkReferenceAssemblies[i] += Path.DirectorySeparatorChar; 587string path = Path.GetFullPath(targetFrameworkDirectory); 608string redistListFolder = Path.Combine(path, "RedistList"); 609string redistFilePath = Path.Combine(redistListFolder, "FrameworkList.xml"); 693pathToReturn = Path.Combine(pathToReturn, includeFramework); 694pathToReturn = Path.GetFullPath(pathToReturn);
Utilities\ToolLocationHelper_SDKDiscovery.cs (10)
165string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml"); 241string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version); 242string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 265string sdkFolderPath = Path.Combine(platformSDKDirectory, "ExtensionSDKs"); 361string platformSDKManifest = Path.Combine(platformSDKDirectory, "SDKManifest.xml"); 439string sdkManifestFileLocation = Path.Combine(directoryName, "SDKManifest.xml"); 517string localAppdataFolder = Path.Combine(userLocalAppData, "Microsoft SDKs"); 524string defaultProgramFilesLocation = Path.Combine( 644string platformsRoot = Path.Combine(sdk.Path, platformsFolderName); 672string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml");
Utilities\ToolLocationHelper_SDKFolders.cs (5)
50string legacyWindowsMetadataLocation = Path.Combine(sdkRoot, "Windows Metadata"); 179return Path.Combine(sdkLocation, folderName); 192? Path.Combine(matchingSdk.Path, folderName, targetPlatformVersion) 193: Path.Combine(matchingSdk.Path, folderName); 223string referenceAssemblyPath = Path.Combine(sdkRoot, contentFolderName, targetConfiguration, targetArchitecture);
Utilities\ToolLocationHelper_VisualStudio.cs (2)
53var folders = string.IsNullOrEmpty(subFolder) ? vsInstallFolders : vsInstallFolders.Select(i => Path.Combine(i, subFolder)); 118string fullPath = Path.Combine(root, file);
Utilities\TypeExtensions.cs (1)
38return location.Length == 0 ? location : Path.GetFullPath(location);
Microsoft.Build.NuGetSdkResolver (6)
GlobalJsonReader.cs (1)
140candidatePath = new FileInfo(Path.Combine(currentDirectory.FullName, file));
NuGetSdkResolver.cs (2)
305installedPath = Path.Combine(packageInfo.PathResolver.GetInstallPath(packageInfo.Id, packageInfo.Version), "Sdk"); 311installedPath = Path.Combine(packageInfo.PathResolver.GetInstallPath(packageInfo.Id, packageInfo.Version), "sdk");
RestoreRunnerEx.cs (3)
48var projectDirectory = Path.Combine(Path.GetTempPath(), $"NuGet-{Guid.NewGuid():N}"); 53var projectFullPath = Path.Combine(projectDirectory, $"{projectName}.proj");
Microsoft.Build.TaskAuthoring.Analyzer (2)
PathDefaultClassifier.cs (2)
29if (string.IsNullOrEmpty(value) || value.IndexOfAny(System.IO.Path.GetInvalidPathChars()) >= 0) 84value.IndexOfAny(System.IO.Path.GetInvalidPathChars()) < 0 &&
Microsoft.Build.Tasks.CodeAnalysis (33)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (2)
543var clientDirectory = Path.GetDirectoryName(PathToBuiltInTool); 866OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(Sources[0].ItemSpec));
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (6)
75internal string PathToBuiltInTool => Path.Combine(GetToolDirectory(), ToolName); 86_useAppHost = useAppHost = TaskEnvironment.FileExists(Path.Combine(GetToolDirectory(), AppHostToolName)); 179return Path.Combine(ToolPath ?? "", ToolExe); 268return Path.Combine(buildTaskDirectory, "bincore"); 309return Path.Combine(sdkDirectory, "Roslyn"); 316if (Path.GetDirectoryName(typeof(ManagedToolTask).Assembly.Location) is { Length: > 0 } buildTaskDirectory)
src\roslyn\src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (3)
86=> EndsWithDirectorySeparator(path) ? path : path + Path.DirectorySeparatorChar; 96return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
src\roslyn\src\Compilers\Core\MSBuildTask\TaskEnvironmentExtensions.cs (2)
28public string? GetTempPath() => Path.GetTempPath(); 37return Path.GetFullPath(absolutePath.Value);
src\roslyn\src\Compilers\Core\MSBuildTask\Utilities.cs (2)
26=> string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 117combined = Path.Combine(path1, path2);
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (1)
307string actualPdb = Path.ChangeExtension(outputAssembly, ".pdb"); // This is the pdb that the compiler generated
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (9)
461Debug.Assert(Path.IsPathFullyQualified(clientDir)); 462var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 470commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 575Debug.Assert(Path.IsPathFullyQualified(clientDirectory)); 581if (Path.IsPathFullyQualified(serverInfo.processFilePath) && !File.Exists(serverInfo.processFilePath)) 715clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 819var result = Path.Combine(tempPath, ".roslyn"); 827FilePath = Path.Combine(mutexDirectory, name); 828GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (2)
118Debug.Assert(loggingFilePath is null || Path.IsPathFullyQualified(loggingFilePath)); 182loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
54if (!Path.IsPathFullyQualified(dotNetHostPath)) 77var directoryName = Path.GetDirectoryName(dotNetHostPath);
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Build.Tasks.Core (323)
AddToWin32Manifest.cs (2)
150SaveManifest(document, Path.GetFileName(ApplicationManifest?.ItemSpec) ?? DefaultManifestName); 182string originalPath = Path.Combine(OutputDirectory, manifestName);
AssemblyDependency\Reference.cs (3)
538_directoryName = Path.GetDirectoryName(_fullPath); 558_fileNameWithoutExtension = Path.GetFileNameWithoutExtension(_fullPath); 573_fullPathWithoutExtension = Path.Combine(DirectoryName, FileNameWithoutExtension);
AssemblyDependency\ReferenceTable.cs (16)
487if (!Path.IsPathRooted(assemblyFileName)) 537string simpleName = Path.GetFileNameWithoutExtension(assemblyFileName); 776pathRooted = Path.IsPathRooted(finalName); 914Path.GetExtension(itemSpec)); 974if (!String.IsNullOrEmpty(implementationFile) && Path.GetExtension(implementationFile) == ".dll") 976companionFile = Path.Combine(Path.GetDirectoryName(baseName), implementationFile); 1014string cultureName = Path.GetFileName(subDirectory); 1020string satelliteAssembly = Path.Combine(subDirectory, satelliteFilename); 1024reference.AddSatelliteFile(Path.Combine(cultureName, satelliteFilename)); 1043string serializationAssemblyPath = Path.Combine(reference.DirectoryName, serializationAssemblyFilename); 2828AddRelatedItem(serializationAssemblyItems, relatedItemBase, Path.Combine(reference.DirectoryName, serializationAssemblyFile)); 2834AddRelatedItem(scatterItems, relatedItemBase, Path.Combine(reference.DirectoryName, scatterFile)); 2846relatedItemBase.SetMetadata(ItemMetadataNames.destinationSubDirectory, FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(satelliteFile))); 2847AddRelatedItem(satelliteItems, relatedItemBase, Path.Combine(reference.DirectoryName, satelliteFile)); 2913yield return new KeyValuePair<string, string>(ItemMetadataNames.winmdImplmentationFile, Path.GetFileName(reference.ImplementationAssembly));
AssemblyDependency\ResolveAssemblyReference.cs (1)
3427string fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName);
AssemblyDependency\Resolver.cs (5)
172string candidateBaseName = Path.GetFileNameWithoutExtension(fullPathToCandidateAssembly); 337fullPath = Path.Combine(fullPathToDirectory, baseName); 384string weakNameBaseExtension = Path.GetExtension(weakNameBase); 385string weakNameBaseFileName = Path.GetFileNameWithoutExtension(weakNameBase); 393string fullPath = Path.Combine(fullPathToDirectory, weakNameBase);
AssignTargetPath.cs (6)
86Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FileUtilities.EnsureTrailingSlash(RootFolder))); 118: Files[i].ItemSpec.Contains("." + Path.DirectorySeparatorChar); 121!Path.IsPathRooted(Files[i].ItemSpec) && 148targetPath = Path.GetFileName(Files[i].ItemSpec); 155Path.GetFullPath(TaskEnvironment.GetAbsolutePath(Files[i].ItemSpec)); 166targetPath = Path.GetFileName(Files[i].ItemSpec);
BootstrapperUtil\BootstrapperBuilder.cs (27)
176string strOutputExe = System.IO.Path.Combine(settings.OutputPath, SETUP_EXE); 363string setupSourceFile = System.IO.Path.Combine(bootstrapperPath, SETUP_BIN); 432invariantPath = Util.AddTrailingChar(invariantPath, System.IO.Path.DirectorySeparatorChar); 455packagePaths.AddRange(Util.AdditionalPackagePaths.Select(p => Util.AddTrailingChar(p.ToLowerInvariant(), System.IO.Path.DirectorySeparatorChar))); 459string folder = System.IO.Path.GetDirectoryName(file); 505private string BootstrapperPath => System.IO.Path.Combine(Path, ENGINE_PATH); 507private string PackagePath => System.IO.Path.Combine(Path, PACKAGE_PATH); 509private string SchemaPath => System.IO.Path.Combine(Path, SCHEMA_PATH); 530string startDirectory = System.IO.Path.Combine(BootstrapperPath, RESOURCES_PATH); 537string resourceDirectory = System.IO.Path.Combine(startDirectory, subDirectory); 538string resourceFilePath = System.IO.Path.Combine(resourceDirectory, SETUP_RESOURCES_FILE); 608if (strSubDirectory[nStartIndex] == System.IO.Path.DirectorySeparatorChar) 882string strSubDirectoryFullPath = System.IO.Path.Combine(packagePath, strSubDirectory); 885string strBaseManifestFilename = System.IO.Path.Combine(strSubDirectoryFullPath, ROOT_MANIFEST_FILE); 886string strBaseManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 924UpdatePackageFileNodes(packageFilesNode, System.IO.Path.Combine(packagePath, strSubDirectory), strSubDirectory); 937string strLangManifestFilename = System.IO.Path.Combine(strLanguageDirectory, CHILD_MANIFEST_FILE); 938string strLangManifestSchemaFileName = System.IO.Path.Combine(SchemaPath, MANIFEST_FILE_SCHEMA); 969System.IO.Path.DirectorySeparatorChar) 1174string strSourceFile = System.IO.Path.Combine(strSourcePath, relativePath); 1178targetPathAttribute.Value = System.IO.Path.Combine(strTargetPath, relativePath); 1181string newNameValue = System.IO.Path.Combine(strTargetPath, relativePath); 1470string strDestinationFileName = System.IO.Path.Combine(settings.OutputPath, packageFileDestination.Value); 1479EnsureFolderExists(System.IO.Path.GetDirectoryName(strDestinationFileName)); 2005using (var xmlwriter = new XmlTextWriter(System.IO.Path.Combine(s_logPath, fileName), Encoding.UTF8)) 2047using (var fileWriter = new StreamWriter(System.IO.Path.Combine(s_logPath, fileName), append)) 2208string logPath = System.IO.Path.Combine(
BootstrapperUtil\Util.cs (1)
225string msbuildExtensionPackagesPath = Path.Combine(BuildEnvironmentHelper.Instance.MSBuildExtensionsPath, BOOTSTRAPPER_MSBUILD_ADDITIONAL_PACKAGES_PATH);
CombinePath.cs (1)
70combinedPath.ItemSpec = Path.Combine(BasePath, path.ItemSpec);
ConvertToAbsolutePath.cs (1)
57if (!Path.IsPathRooted(path.ItemSpec))
Copy.cs (7)
274string destinationFolder = Path.GetDirectoryName(destinationFileState.Path); 275string originalDestinationFolder = Path.GetDirectoryName(destinationFileState.Path.OriginalValue); 819() => Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)), 847string srcName = Path.GetFileName(src); 858() => Path.Combine(src, file), 868() => Path.Combine(DestinationFolder.ItemSpec, srcName, file),
CreateCSharpManifestResourceName.cs (10)
165string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 166string directoryName = Path.GetDirectoryName(info.cultureNeutralFilename); 183manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 186manifestName.Replace(Path.DirectorySeparatorChar, '.'); 187manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 208manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 211manifestName.Replace(Path.DirectorySeparatorChar, '.'); 212manifestName.Replace(Path.AltDirectorySeparatorChar, '.'); 219manifestName.Insert(0, Path.DirectorySeparatorChar); 236string extension = Path.GetExtension(fileName);
CreateManifestResourceName.cs (8)
163string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName); 175isResxFile = Path.GetExtension(fileName) == resxFileExtension; 182string conventionDependentUpon = Path.ChangeExtension(Path.GetFileName(fileName), SourceFileExtension); 197AbsolutePath dependentPath = TaskEnvironment.GetAbsolutePath(Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon)); 222AbsolutePath pathToDependent = TaskEnvironment.GetAbsolutePath(Path.Combine(Path.GetDirectoryName(fileName), dependentUpon));
CreateVisualBasicManifestResourceName.cs (5)
170string sourceExtension = Path.GetExtension(info.cultureNeutralFilename); 178manifestName.Append(Path.GetFileNameWithoutExtension(info.cultureNeutralFilename)); 194manifestName.Append(Path.GetFileName(info.cultureNeutralFilename)); 201manifestName.Insert(0, Path.DirectorySeparatorChar); 218string extension = Path.GetExtension(fileName);
Culture.cs (8)
40if (treatAsCultureNeutral || string.Equals(Path.GetFileNameWithoutExtension(parentName), 41Path.GetFileNameWithoutExtension(name), 55string baseFileNameWithCulture = Path.GetFileNameWithoutExtension(name); 58string cultureName = Path.GetExtension(baseFileNameWithCulture); 75string extension = Path.GetExtension(name); 76string baseFileName = Path.GetFileNameWithoutExtension(baseFileNameWithCulture); 77string baseFolder = Path.GetDirectoryName(name); 79info.cultureNeutralFilename = Path.Combine(baseFolder, fileName);
DownloadFile.cs (2)
186var destinationFile = new FileInfo(Path.Combine(destinationDirectory.FullName, filename)); 332: Path.GetFileName(requestUri.LocalPath); // Otherwise attempt to get a file name from the URI
FileIO\WriteLinesToFile.cs (4)
122string directoryPath = Path.GetDirectoryName(filePath); 177string directoryPath = Path.GetDirectoryName(filePath); 180temporaryFilePath = Path.Combine(directoryPath, Path.GetRandomFileName() + "~");
FindAppConfigFile.cs (1)
125string filename = (matchWholeItemSpec ? item.ItemSpec : Path.GetFileName(item.ItemSpec));
FindInList.cs (1)
108string filename = (MatchFileNameOnly ? Path.GetFileName(path) : path);
FormatUrl.cs (1)
50Path.GetFullPath(InputUrl);
GenerateApplicationManifest.cs (2)
239name = Path.GetFileName(item.ItemSpec); 400manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateDeploymentManifest.cs (1)
139manifest.Product = Path.GetFileNameWithoutExtension(manifest.AssemblyIdentity.Name);
GenerateLauncher.cs (4)
59LauncherPath = Path.Combine( 73string entryPointFileName = Path.GetFileName(EntryPoint.ItemSpec); 106string outputEntryPoint = Path.Combine(Path.GetDirectoryName(EntryPoint.ItemSpec), results.KeyFile);
GenerateManifestBase.cs (5)
190name = Path.GetFileNameWithoutExtension(entryPointIdentity.Name) + ".application"; 564file.TargetPath = Path.IsPathRooted(file.SourcePath) || file.SourcePath.StartsWith("..", StringComparison.Ordinal) ? Path.GetFileName(file.SourcePath) : file.SourcePath; 615string manifestFileName = Path.GetFileName(OutputManifest.ItemSpec); 654Util.WriteLog($"Total time to generate manifest '{Path.GetFileName(OutputManifest.ItemSpec)}': t={Environment.TickCount - _startTime}");
GenerateResource.cs (17)
578commandLineBuilder.AppendFileNameIfNotNull(Path.Combine(_resgenPath, "resgen.exe")); 1600string extension = Path.GetExtension(sourceFilePath); 2142OutputResources[i] = new TaskItem(Path.ChangeExtension(Sources[i].ItemSpec, ".resources")); 2620_assemblyNames[i] = new AssemblyNameExtension(Path.GetFileNameWithoutExtension(assemblyFile.ItemSpec)); 2751string priDirectory = Path.Combine(outFileOrDir ?? String.Empty, 2753currentOutputDirectory = Path.Combine(priDirectory, 2761currentOutputFile = Path.Combine(currentOutputDirectory, currentOutputFileNoPath); 2904return Path.GetFullPath(currentOutputFile); 2915currentOutputFile = Path.GetFullPath(currentOutputFile); 2925string shorterPath = Path.Combine(outputDirectory ?? String.Empty, cultureName ?? String.Empty); 2930currentOutputFile = Path.Combine(shorterPath, currentOutputFileNoPath); 2935currentOutputFile = Path.GetFullPath(currentOutputFile); 2987extension = Path.GetExtension(filename); 3017_logger.LogErrorWithCodeFromResources("GenerateResource.UnknownFileExtension", Path.GetExtension(filename), filename); 3516_stronglyTypedClassName = Path.GetFileNameWithoutExtension(outFile); 3561_logger.LogWarningWithCodeFromResources(null, Path.GetFullPath(inputFileName), 0, 0, 0, 0, messageKey, [skipped.Key, .. skipped.AdditionalMessageArgs]); 3584return Path.ChangeExtension(outputResourcesFile, provider.FileExtension);
GetSDKReferenceFiles.cs (12)
512string directory = Path.GetDirectoryName(reference.AssemblyLocation); 513string fileNameNoExtension = Path.GetFileNameWithoutExtension(reference.AssemblyLocation); 514string xmlFile = Path.Combine(directory, fileNameNoExtension + ".xml"); 553if (Path.GetExtension(file.RedistFile).Equals(".PRI", StringComparison.OrdinalIgnoreCase)) 578string fileExtension = Path.GetExtension(file); 630string targetPath = Path.Combine(targetPathRoot, relativeToBase); 731FileName = Path.GetFileNameWithoutExtension(assemblyLocation); 960referencesCacheFile = Path.Combine(_cacheFileDirectory, GetCacheFileName(saveContext.SdkIdentity, saveContext.SdkRoot, cacheFileInfo.Hash.ToString("X", CultureInfo.InvariantCulture))); 1030group reference by Path.GetDirectoryName(reference); 1085string referencesCacheFile = Path.Combine(cacheFileFolder, GetCacheFileName(sdkIdentity, sdkRoot, hash.ToString("X", CultureInfo.InvariantCulture))); 1165string redistPath = Path.Combine(sdkRoot, "Redist"); 1179string referencesPath = Path.Combine(sdkRoot, "References");
InstalledSDKResolver.cs (4)
60string referenceAssemblyFilePath = Path.Combine(sdkDirectory, "References", configuration, architecture); 61string referenceAssemblyCommonArchFilePath = Path.Combine(sdkDirectory, "References", "CommonConfiguration", architecture); 62string referenceAssemblyPathNeutral = Path.Combine(sdkDirectory, "References", configuration, "Neutral"); 63string referenceAssemblyArchFilePathNeutral = Path.Combine(sdkDirectory, "References", "CommonConfiguration", "Neutral");
LC.cs (1)
180outputPath = Path.Combine(OutputDirectory, outputPath);
ListOperators\FindUnderPath.cs (2)
77System.IO.Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FileUtilities.FixFilePath(Path.ItemSpec)))); 110System.IO.Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FileUtilities.FixFilePath(item.ItemSpec))));
ManifestUtil\ApplicationManifest.cs (7)
432string outputFileName = Path.GetFileName(SourcePath); 630Path.GetFileNameWithoutExtension(assembly.TargetPath), 633OutputMessages.AddErrorMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath)); 738OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 749OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 759OutputMessages.AddWarningMessage("GenerateManifest.AllowPartiallyTrustedCallers", Path.GetFileNameWithoutExtension(path)); 766OutputMessages.AddWarningMessage("GenerateManifest.UnmanagedCodePermission", Path.GetFileNameWithoutExtension(path));
ManifestUtil\AssemblyIdentity.cs (2)
534string path = Path.Combine(searchPath, file); 541path = Path.Combine(searchPath, file);
ManifestUtil\AssemblyReferenceCollection.cs (1)
140String.Equals(identity.Name, System.IO.Path.GetFileNameWithoutExtension(a.SourcePath), StringComparison.OrdinalIgnoreCase))
ManifestUtil\BaseReference.cs (2)
54if (!Path.IsPathRooted(path)) 59return Path.GetFileName(path);
ManifestUtil\DeployManifest.cs (4)
182string redistListPath = Path.Combine(referenceAssemblyPath, _redistListFolder); 183return Path.Combine(redistListPath, _redistListFile); 588manifestPath = Path.Combine(Path.GetDirectoryName(SourcePath), _entryPoint.TargetPath);
ManifestUtil\LauncherBuilder.cs (4)
67string launcherFilename = Path.GetFileName(LauncherPath); 71Path.Combine(outputPath, launcherFilename), 72Path.Combine(outputPath.OriginalValue, launcherFilename), 108EnsureFolderExists(Path.GetDirectoryName(outputExe));
ManifestUtil\Manifest.cs (14)
220defaultDir = Path.GetDirectoryName(_sourcePath); 223if (!Path.IsPathRooted(defaultDir)) 225defaultDir = Path.Combine(Directory.GetCurrentDirectory(), defaultDir); 317if (Path.IsPathRooted(path)) 334string resolvedPath = Path.Combine(searchPath, path); 335resolvedPath = Path.GetFullPath(resolvedPath); 517string fileName = Path.GetFileName(f.ResolvedPath); 523f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), f.TargetPath); 527f.ResolvedPath = Path.Combine(Path.GetDirectoryName(f.ResolvedPath), AssemblyName); 545f.TargetPath = BaseReference.GetDefaultTargetPath(Path.GetFileName(f.ResolvedPath)); 655Path.GetFileNameWithoutExtension(assembly.TargetPath), 658OutputMessages.AddWarningMessage("GenerateManifest.IdentityFileNameMismatch", assembly.ToString(), assembly.AssemblyIdentity.Name, assembly.AssemblyIdentity.Name + Path.GetExtension(assembly.TargetPath));
ManifestUtil\ManifestReader.cs (2)
28string manifestFileName = Path.GetFileName(path); 100Util.WriteLogFile(Path.GetFileNameWithoutExtension(path) + ".embedded.xml", m);
ManifestUtil\ManifestWriter.cs (1)
147File.Copy(temp, Path.Combine(Util.logPath, n + ".trust-file.xml"), true);
ManifestUtil\PathUtil.cs (9)
24path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 25path = path.TrimEnd(Path.DirectorySeparatorChar); 39path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 40path = path.TrimEnd(Path.DirectorySeparatorChar); 82if (String.Equals(Path.GetExtension(path), ".application", StringComparison.Ordinal)) 87if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal)) 157if (String.Equals(Path.GetExtension(path), ".manifest", StringComparison.Ordinal))
ManifestUtil\SecurityUtil.cs (3)
908toolPath = Path.Combine(pathToDotNetFrameworkSdk, "bin", ToolName); 917toolPath = Path.Combine(Directory.GetCurrentDirectory(), ToolName); 982return versionIndependentToolPath != null ? Path.Combine(versionIndependentToolPath, toolName) : null;
ManifestUtil\Util.cs (5)
111return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); 267string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\VisualStudio\8.0\VSPLOG"); 482s_logFileWriter = new StreamWriter(Path.Combine(logPath, "Microsoft.Build.Tasks.log"), false); 513string path = Path.Combine(logPath, filename); 543string path = Path.Combine(logPath, filename);
ManifestUtil\XmlUtil.cs (1)
155if (!uri.LocalPath.StartsWith(Path.GetTempPath(), StringComparison.Ordinal))
Move.cs (3)
131destinationFile = Path.Combine(DestinationFolder.ItemSpec, Path.GetFileName(SourceFiles[i].ItemSpec)); 238string destinationFolder = Path.GetDirectoryName(destinationFile);
MSBuild.cs (2)
497projectDirectory[i] = Path.GetDirectoryName(projectPath); 626outputItemFromTarget.ItemSpec = Path.Combine(projectDirectory[i], outputItemFromTarget.ItemSpec);
NativeMethods.cs (5)
230private static readonly string s_gacPath = Path.Combine(NativeMethodsShared.FrameworkBasePath, "gac"); 372var assemblyName = Path.GetFileName(dir); 377var versionString = Path.GetFileName(version); 489var path = Path.Combine(s_gacPath, assemblyNameVersion.Name); 495path = Path.Combine(
RedistList.cs (3)
306string redistDirectory = Path.Combine(frameworkDirectory, RedistListFolder); 1103string subsetDirectory = Path.Combine(frameworkDirectory, subsetListFolder); 1110string subsetFilePath = Path.Combine(subsetDirectory, subsetName + ".xml");
ResolveCodeAnalysisRuleSet.cs (5)
84if (CodeAnalysisRuleSet == Path.GetFileName(CodeAnalysisRuleSet)) 90string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet); 103string fullName = Path.Combine(directory, CodeAnalysisRuleSet); 112else if (!Path.IsPathRooted(CodeAnalysisRuleSet)) 117string fullName = Path.Combine(MSBuildProjectDirectory, CodeAnalysisRuleSet);
ResolveKeySource.cs (1)
103keyFileExtension = Path.GetExtension(KeyFile);
ResolveManifestFiles.cs (7)
304targetPath = Path.GetFileName(item.ItemSpec); 382targetPath = Path.GetFileName(item.ItemSpec); 390targetPath = Path.Combine(itemCulture.ToString(), targetPath); 600string fileExtension = Path.GetExtension(entry.item.ItemSpec); 878fusionName = Path.Combine(destSubDir, Path.GetFileNameWithoutExtension(item.ItemSpec)); 882fusionName = Path.GetFileNameWithoutExtension(item.ItemSpec);
ResolveSDKReference.cs (1)
1015_sdkManifestPath = Path.Combine(ResolvedPath, "SDKManifest.xml");
ResourceHandling\MSBuildResXReader.cs (1)
237fileName = Path.Combine(
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (6)
98private static string GetThisAssemblyDirectory() => Path.GetDirectoryName(typeof(RoslynCodeTaskFactory).Assembly.ManifestModule.FullyQualifiedName); 530string projectDirectory = !string.IsNullOrEmpty(projectFilePath) ? Path.GetDirectoryName(projectFilePath) : null; 643string fullPath = Path.GetFullPath(reference); 655Path.Combine(ThisAssemblyDirectoryLazy.Value, ReferenceAssemblyDirectoryName), 658.FirstOrDefault(p => FileSystems.Default.FileExists(Path.Combine(p, assemblyFileName))); 662resolvedAssemblyReferences.Add(Path.Combine(resolvedDir, assemblyFileName));
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (5)
41() => Path.Combine(pathToBuildTools, "Roslyn", "bincore", Path.ChangeExtension(ToolName, ".dll")), 43() => Path.Combine(pathToBuildTools, "Roslyn", Path.ChangeExtension(ToolName, ".dll")), 124if (!String.IsNullOrWhiteSpace(ToolExe) && Path.IsPathRooted(ToolExe))
SdkToolsPathUtility.cs (5)
60pathToTool = Path.Combine(processorSpecificToolDirectory, toolName); 67pathToTool = Path.Combine(sdkToolsPath, toolName); 126ProcessorArchitecture.ARM => Path.Combine(sdkToolsPath, "arm"), 127ProcessorArchitecture.AMD64 => Path.Combine(sdkToolsPath, "x64"), 128ProcessorArchitecture.IA64 => Path.Combine(sdkToolsPath, "ia64"),
SystemState.cs (6)
464string filename = Path.GetFileName(path); 466foreach (AssemblyEntry a in redistList.FindAssemblyNameFromSimpleName(Path.GetFileNameWithoutExtension(path))) 468string pathFromRedistList = Path.Combine(a.FrameworkDirectory, filename); 615string stateFileDirectory = Path.GetDirectoryName(stateFilePath); 622AbsolutePath fullPath = taskEnvironment.GetAbsolutePath(Path.Combine(stateFileDirectory, relativePath)).GetCanonicalForm(); 647instanceLocalOutgoingFileStateCache = instanceLocalFileStateCache.ToDictionary(kvp => FileUtilities.MakeRelative(Path.GetDirectoryName(stateFile), kvp.Key), kvp => kvp.Value);
TarDirectory.cs (6)
111if (Path.DirectorySeparatorChar != '/') 113relativePath = relativePath.Replace(Path.DirectorySeparatorChar, '/'); 129location = Path.Join(enumeratedLocations[^1], info.Name); 164ReadOnlySpan<char> directorySpan = directory.AsSpan().TrimEnd(Path.DirectorySeparatorChar); 165ReadOnlySpan<char> pathSpan = path.AsSpan().TrimEnd(Path.DirectorySeparatorChar); 168&& (pathSpan.Length == directorySpan.Length || pathSpan[directorySpan.Length] == Path.DirectorySeparatorChar)
TarFiles.cs (7)
92ReadOnlySpan<char> name = Path.GetFileName(Path.TrimEndingDirectorySeparator(item.ItemSpec.AsSpan())); 112static string ResolveParent(FileInfo file) => Path.Combine(GetResolvedDirectoryPath(file.Directory!), file.Name); 115private string GetSourcePath(ITaskItem item) => Path.TrimEndingDirectorySeparator(TaskEnvironment.GetAbsolutePath(item.ItemSpec).GetCanonicalForm()); 149(sourcePath.Equals(DestinationFileInfo.FullName, FileUtilities.PathComparison) && !Path.Exists(sourcePath))) 165if (Path.DirectorySeparatorChar != '/') 167archivePath = archivePath.Replace(Path.DirectorySeparatorChar, '/');
TarTaskBase.cs (7)
429return Path.Join(target.FullName, directory.FullName.AsSpan(ancestor.FullName.Length).TrimStart(Path.DirectorySeparatorChar)); 447if (!left.Equals(right, StringComparison.OrdinalIgnoreCase) || !Path.Exists(left.ToString()) || !Path.Exists(right.ToString())) 454int start = Path.GetPathRoot(left).Length; 457int separator = left.Slice(start).IndexOf(Path.DirectorySeparatorChar); 483ReadOnlySpan<char> candidate = Path.GetFileName(path.AsSpan());
TaskEnvironmentExtensions.cs (1)
18/// <see cref="System.IO.Path.GetFullPath(string)"/> on .NET Framework validates path characters and throws
Untar.cs (32)
308AbsolutePath fullDestinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destinationDirectory.FullName, entryName)).GetCanonicalForm(); 322if (tarEntry.EntryType is TarEntryType.Directory || Path.GetFileName(destinationPath.FullName).Length == 0) 441AbsolutePath fullTargetPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destinationDirectory.FullName, linkName)).GetCanonicalForm(); 543string linkTarget = Path.DirectorySeparatorChar == '/' ? linkName : linkName.Replace('/', Path.DirectorySeparatorChar); 687if (Path.IsPathRooted(linkTarget) && !Path.IsPathFullyQualified(linkTarget)) 695if (Path.IsPathFullyQualified(linkTarget)) 699string fullTarget = Path.GetFullPath(linkTarget); 708string root = Path.GetPathRoot(linkTarget)!; 718ReadOnlySpan<char> relativeLinkDirectory = GetPathRelativeToDestination(Path.GetDirectoryName(linkFullPath)!, destination); 720string? windowsLinkDirectory = ResolveWindowsPath(Path.Join(destination.WindowsPath, relativeLinkDirectory), ref remainingWindowsLinkHops); 730ResolveWindowsPath(Path.GetFullPath(linkTarget, windowsLinkDirectory!), ref remainingWindowsLinkHops), 750ResolveWindowsPath(Path.Join(destination.WindowsPath, relativePath), ref remainingWindowsLinkHops), 763string root = Path.GetPathRoot(fullPath)!; 815foreach (Range range in relativePath.SplitAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 826current = Path.GetDirectoryName(current) ?? current; 830current = Path.Join(current, component); 845if (Path.IsPathFullyQualified(linkTarget)) 847string root = Path.GetPathRoot(linkTarget)!; 852resolvedLink = ResolvePosixPath(Path.GetDirectoryName(current)!, linkTarget, ref remainingLinkHops); 875string root = Path.GetPathRoot(fullPath)!; 879foreach (Range range in relativePath.SplitAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 888current = Path.Join(current, component); 902string? resolvedLink = ResolveWindowsPath(Path.GetFullPath(linkTarget, Path.GetDirectoryName(current)!), ref remainingLinkHops); 919ReadOnlySpan<char> directorySpan = directory.AsSpan().TrimEnd(Path.DirectorySeparatorChar); 920ReadOnlySpan<char> pathSpan = path.AsSpan().TrimEnd(Path.DirectorySeparatorChar); 923&& (pathSpan.Length == directorySpan.Length || pathSpan[directorySpan.Length] == Path.DirectorySeparatorChar); 1050static bool IsDirectorySeparator(char c) => c == '/' || c == Path.DirectorySeparatorChar;
Unzip.cs (2)
192AbsolutePath fullDestinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destinationDirectory.FullName, zipArchiveEntry.FullName)).GetCanonicalForm(); 200if (Path.GetFileName(destinationPath.FullName).Length == 0)
WriteCodeFragment.cs (5)
115if (OutputFile != null && OutputDirectory != null && !Path.IsPathRooted(OutputFile.ItemSpec)) 117OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, OutputFile.ItemSpec)); 128OutputFile = new TaskItem(Path.Combine(OutputDirectory.ItemSpec, Path.GetFileName(outputFilePath))); 131FileUtilities.EnsureDirectoryExists(Path.GetDirectoryName(outputFilePath));
Microsoft.Build.Tasks.Git (61)
GitDataReader\GitConfig.Reader.cs (12)
103return Path.Combine(xdgConfigHome, "git"); 108return Path.Combine(_environment.HomeDirectory, ".config", "git"); 119var programDataConfig = Path.Combine(_environment.ProgramDataDirectory, "git", "config"); 130var systemConfig = Path.Combine(systemDir, "gitconfig"); 141var xdgConfig = Path.Combine(xdgDir, "config"); 151var globalConfig = Path.Combine(_environment.HomeDirectory, ".gitconfig"); 159var localConfig = Path.Combine(_commonDirectory, "config"); 180var mingwEtc = Path.Combine(_environment.SystemDirectory, "..", "mingw64", "etc"); 283root = Path.GetDirectoryName(basePath) ?? ""; 288return Path.GetFullPath(Path.Combine(root, relativePath)); 334pattern = PathUtils.CombinePosixPaths(PathUtils.ToPosixPath(Path.GetDirectoryName(configFilePath)!), pattern[2..]);
GitDataReader\GitEnvironment.cs (4)
121return Path.Combine(gitInstallDir, "etc"); 136var paths = pathList.Split(Path.PathSeparator); 141return Path.GetDirectoryName(gitExe); 147return Path.GetDirectoryName(gitCmd);
GitDataReader\GitIgnore.cs (2)
122var directory = PathUtils.ToPosixDirectoryPath(Path.GetFullPath(Path.GetDirectoryName(path)!));
GitDataReader\GitIgnore.Matcher.cs (1)
103var fullPathNoSlash = PathUtils.TrimTrailingSlash(PathUtils.ToPosixPath(Path.GetFullPath(fullPath)));
GitDataReader\GitReferenceResolver.cs (6)
71var packedRefsPath = Path.Combine(commonDirectory, PackedRefsFileName); 187var refTableDirectory = Path.Combine(commonDirectory, RefTableDirectoryName); 188var tablesFilePath = Path.Combine(refTableDirectory, TablesListFileName); 199var path = Path.Combine(refTableDirectory, fileName); 312ReferenceStorageFormat.LooseFiles => ParseObjectNameOrReference(ReadReferenceFromFile(Path.Combine(_gitDirectory, GitRepository.GitHeadFileName))), 355path = Path.Combine(_commonDirectory, referenceName);
GitDataReader\GitRepository.cs (18)
139return Path.GetFullPath(Path.Combine(location.GitDirectory, value)); 182var dotGitPath = Path.Combine(submoduleWorkingDirectoryFullPath, GitDirName); 244fullPath = Path.GetFullPath(Path.Combine(workingDirectory, path)); 281var submodulesConfigFile = Path.Combine(workingDirectory, GitModulesFileName); 323var commonInfoExclude = Path.Combine(CommonDirectory, "info", "exclude"); 341directory = Path.GetFullPath(directory); 364dir = Path.GetFullPath(dir); 381dir = Path.GetDirectoryName(dir); 391var dotGitPath = Path.Combine(directory, GitDirName); 449return Path.GetFullPath(Path.Combine(Path.GetDirectoryName(path)!, link)); 460if (!File.Exists(Path.Combine(directory, GitHeadFileName))) 467var commonLinkPath = Path.Combine(directory, CommonDirFileName); 472commonDirectory = Path.Combine(directory, File.ReadAllText(commonLinkPath).TrimEnd(CharUtils.AsciiWhitespace)); 474commonDirectory = Path.GetFullPath(commonDirectory);
GitDataReader\PathUtils.cs (8)
14public static bool IsUnixLikePlatform => Path.DirectorySeparatorChar == '/'; 16public static readonly string DirectorySeparatorStr = Path.DirectorySeparatorChar.ToString(); 36=> (Path.DirectorySeparatorChar == '\\') ? path.Replace('\\', '/') : path; 42=> Path.DirectorySeparatorChar == '/' || path.IndexOf('\\') < 0; 64=> c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; 67=> Path.GetFullPath(path) == path; 81return path[0] == Path.DirectorySeparatorChar;
GitOperations.cs (3)
229=> Path.DirectorySeparatorChar == '\\' && 374var fullPath = Path.GetFullPath(Path.Combine(projectDirectory, file.ItemSpec));
parent\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.Build.Utilities.Core (10)
CommandLineBuilder.cs (1)
342AppendTextWithQuoting("." + Path.DirectorySeparatorChar + fileName);
ToolTask.cs (7)
527pathToTool = Path.Combine(ToolPath, ToolExe); 539string directory = Path.GetDirectoryName(pathToTool); 540pathToTool = Path.Combine(directory, ToolExe); 548bool isOnlyFileName = Path.GetFileName(pathToTool).Length == pathToTool.Length; 663bool isOnlyFileName = string.IsNullOrEmpty(pathToTool) || Path.GetFileName(pathToTool).Length == pathToTool.Length; 1440.Select(folderPath => Path.Combine(folderPath, filename)) 1760sb[i] = Path.DirectorySeparatorChar;
TrackedDependencies\TrackedDependencies.cs (2)
39string? directoryName = Path.GetDirectoryName(item.ItemSpec); 40string searchPattern = Path.GetFileName(item.ItemSpec);
Microsoft.CodeAnalysis (86)
AssemblyUtilities.cs (4)
30string? directory = Path.GetDirectoryName(filePath); 32string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); 38string satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithExtension); 44satelliteAssemblyPath = Path.Combine(subDirectory, resourcesNameWithoutExtension, resourcesNameWithExtension);
CommandLine\AnalyzerConfig.cs (4)
167_hasGlobalFileName = Path.GetFileName(pathToFile).Equals(UserGlobalConfigName, StringComparison.OrdinalIgnoreCase); 170string directory = Path.GetDirectoryName(pathToFile) ?? pathToFile; 189if (pathToFile is null || !Path.IsPathRooted(pathToFile) || string.IsNullOrEmpty(Path.GetFileName(pathToFile)))
CommandLine\AnalyzerConfig.SectionNameMatching.cs (2)
200else if (Path.DirectorySeparatorChar == '/') 206else if (!sawStartChar && Path.DirectorySeparatorChar == '\\')
CommandLine\CommandLineArguments.cs (3)
345return Path.Combine(OutputDirectory, outputFileName); 365return PdbPath ?? Path.Combine(OutputDirectory, Path.ChangeExtension(outputFileName, ".pdb"));
CommandLine\CommandLineParser.cs (6)
297resolvedPath = Path.GetFullPath(resolvedPath); 301outputFileName = Path.GetFileName(resolvedPath); 302outputDirectory = Path.GetDirectoryName(resolvedPath); 469pdbPath = Path.ChangeExtension(Path.Combine(outputDirectory, outputFileName), ".pdb"); 494genericPath = Path.Combine(outputDirectory!, outputFileName);
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (3)
81var newFilePath = Path.Combine(Path.GetDirectoryName(_filePath)!, Guid.NewGuid().ToString() + "_" + Path.GetFileName(_filePath));
CommandLine\CommonCompiler.cs (4)
307var directory = Path.GetDirectoryName(normalizedPath) ?? normalizedPath; 1189Directory.CreateDirectory(Path.GetDirectoryName(path)!); 1271emitOptions = emitOptions.WithPdbFilePath(Path.GetFileName(emitOptions.PdbFilePath)); 1829var 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)
148tempFilePath = Path.Combine(signingDirectory, $"legacy-sign.{Guid.NewGuid():N}.dll");
Compilation\DeterministicKeyBuilder.cs (2)
52filePath = Path.GetFileName(filePath); 549writer.Write("cryptoKeyFile", options.CryptoKeyFile is { } keyFile ? Path.GetFileName(keyFile) : null);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (5)
85var fullDirectoryPath = Path.GetDirectoryName(resolvedPath) ?? throw new ArgumentException(message: null, paramName: nameof(resolvedPath)); 118var assemblyPath = Path.Combine(directory, simpleName + ".dll"); 134var analyzerFileName = Path.ChangeExtension(simpleName, ".dll"); 135var analyzerFilePath = Path.Combine(directory, analyzerFileName); 204var assemblyPath = Path.Combine(Directory, unmanagedDllName + ".dll");
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (4)
308var assemblyFileName = Path.GetFileName(assemblyFilePath); 309var satelliteAssemblyName = Path.ChangeExtension(assemblyFileName, ".resources.dll"); 310var path = Path.GetDirectoryName(assemblyFilePath); 318var filePath = Path.Combine(path, cultureInfo.Name, satelliteAssemblyName);
DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (18)
113if (!Path.IsPathRooted(baseDirectory)) 123var versionDirectory = Path.Combine(baseDirectory, DirectoryVersion); 124ShadowDirectory = Path.Combine(versionDirectory, "shadow"); 125CacheDirectory = Path.Combine(versionDirectory, "cache"); 128SessionDirectory = Path.Combine(ShadowDirectory, sessionDirectoryName); 182string name = Path.GetFileName(subDirectory).ToLowerInvariant(); 306var analyzerShadowPath = Path.Combine(analyzerShadowDir, Path.GetFileName(originalAnalyzerPath)); 320var satelliteFileName = Path.GetFileName(satelliteFilePath); 321var satelliteDirectoryName = Path.GetFileName(Path.GetDirectoryName(satelliteFilePath)); 322var shadowSatellitePath = Path.Combine(analyzerShadowDir, satelliteDirectoryName!, satelliteFileName); 332var originalDirName = Path.GetDirectoryName(analyzerFilePath)!; 334return Path.Combine(SessionDirectory, shadowDirName); 375var directory = Path.GetDirectoryName(shadowCopyPath); 399? Path.Combine(@this.CacheDirectory, cacheKey) 465return $"{Path.GetFileNameWithoutExtension(originalPath)}-{hexHash}-{mvid:N}-{length}{Path.GetExtension(originalPath)}";
DiaSymReader\SymUnmanagedFactory.cs (1)
120var moduleHandle = LoadLibrary(Path.Combine(dir, DiaSymReaderModuleName));
FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
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>
MetadataReference\AssemblyMetadata.cs (2)
170return new AssemblyMetadata(manifestModule, moduleName => ModuleMetadata.CreateFromFile(Path.Combine(Path.GetDirectoryName(path) ?? "", moduleName)));
RuleSet\RuleSetInclude.cs (4)
90return Path.GetFullPath(resolvedIncludePath); 98includePath = includePath.Replace('\\', Path.DirectorySeparatorChar); 110if (Path.IsPathRooted(includePath)) 120includePath = PathUtilities.CombinePathsUnchecked(Path.GetDirectoryName(parentRulesetPath) ?? "", includePath);
SourceGeneration\GeneratorDriver.cs (3)
518var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 564var tree = ParseGeneratedSourceText(source, Path.Combine(prefix, source.HintName), cancellationToken); 665return Path.Combine(baseDirectory ?? "", type.Assembly.GetName().Name ?? string.Empty, type.FullName!);
src\roslyn\src\Dependencies\Collections\Extensions\FixedSizeArrayBuilder.cs (1)
60var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.Analyzers (36)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (4)
130string arg4 = Path.GetFileName(additionalText.Path); 184string arg2 = Path.GetFileName(additionalText.Path); 218string fileName = Path.GetFileName(textFile.Path); 336string arg2 = Path.GetFileName(additionalText.Path);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (4)
203string arg3 = Path.GetFileName(path); 234string arg1 = Path.GetFileName(path); 257string fileName = Path.GetFileName(text.Path); 466string arg1 = Path.GetFileName(releaseTrackingLine.Path);
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (2)
27if (string.Equals(".resx", Path.GetExtension(file.Path), StringComparison.OrdinalIgnoreCase)) 59var fileName = Path.GetFileName(file.Path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
Microsoft.CodeAnalysis.BuildClient.Package (18)
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (9)
461Debug.Assert(Path.IsPathFullyQualified(clientDir)); 462var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 470commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 575Debug.Assert(Path.IsPathFullyQualified(clientDirectory)); 581if (Path.IsPathFullyQualified(serverInfo.processFilePath) && !File.Exists(serverInfo.processFilePath)) 715clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 819var result = Path.Combine(tempPath, ".roslyn"); 827FilePath = Path.Combine(mutexDirectory, name); 828GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (2)
118Debug.Assert(loggingFilePath is null || Path.IsPathFullyQualified(loggingFilePath)); 182loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
54if (!Path.IsPathFullyQualified(dotNetHostPath)) 77var directoryName = Path.GetDirectoryName(dotNetHostPath);
src\roslyn\src\Compilers\Shared\StandardBuildEnvironment.cs (2)
20public string? GetTempPath() => Path.GetTempPath(); 21public string GetFullyQualifiedPath(string path) => Path.Combine(CurrentDirectory, path);
Microsoft.CodeAnalysis.CodeStyle (19)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
76var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\roslyn\src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
158var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Microsoft.CodeAnalysis.CSharp (3)
CommandLine\CSharpCommandLineParser.cs (1)
1459metadataReferences.Insert(0, new CommandLineReference(Path.Combine(sdkDirectory, "mscorlib.dll"), MetadataReferenceProperties.Assembly));
CommandLine\CSharpCompiler.cs (1)
261return Path.ChangeExtension(entryPointFileName, ".exe");
Utilities\InterceptableLocation.cs (1)
106var displayFileName = Path.GetFileName(_path);
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
FileBasedPrograms\FileBasedProgramService.cs (1)
45var entryPointFileFullPath = Path.GetFullPath(entryPointFilePath);
SyncedSource\FileBasedPrograms\ExternalHelpers.cs (2)
25=> Path.GetRelativePath(relativeTo, path); 28=> Path.IsPathFullyQualified(path);
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (5)
1076var sourceDirectory = Path.GetDirectoryName(sourcePath) 1079var resolvedProjectPath = Path.Combine(sourceDirectory, resolvedName.Replace('\\', '/')); 1204var sourceDirectory = Path.GetDirectoryName(sourcePath) 1207var resolvedFilePath = Path.GetFullPath(Path.Combine(sourceDirectory, Name.Replace('\\', '/')));
SyncedSource\FileBasedPrograms\VirtualProjectBuilder.cs (12)
114string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 162? Path.GetTempPath() 170return Path.Combine(directory, "dotnet", dotNetSubdirectory ?? "runfile"); 178return Path.Combine(GetTempSubdirectory(dotNetSubdirectory), name); 260var fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(includeOrExcludeDirective.Info.SourceFile.Path)!, expandedPath)); 351var entryPointDirectory = Path.GetDirectoryName(EntryPointFileFullPath)!; 411var compilePath = Path.GetFullPath(Path.Combine( 649<AssemblyName>{EscapeValue(Path.GetFileNameWithoutExtension(entryPointFilePath))}</AssemblyName> 943var entryPointDirectory = Path.GetDirectoryName(entryPointFilePath) ?? "";
Microsoft.CodeAnalysis.Extensions.Package (1)
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Api\HotReloadMSBuildWorkspace.cs (1)
58Contract.ThrowIfFalse(projectPaths.All(Path.IsPathFullyQualified));
Microsoft.CodeAnalysis.Features (56)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (2)
102var fileName = IOUtilities.PerformIO(() => Path.GetFileName(document.FilePath)); 111var fileName = IOUtilities.PerformIO(() => Path.GetFileName(document.FilePath));
AddFileBanner\AddFileBannerHelpers.cs (2)
54var sourceName = IOUtilities.PerformIO(() => Path.GetFileName(sourceDocument.FilePath)); 55var destinationName = IOUtilities.PerformIO(() => Path.GetFileName(destinationFilePath));
AddImport\References\MetadataSymbolReference.cs (1)
46return (string.Format(FeaturesResources.Add_reference_to_0, Path.GetFileName(_reference.FilePath)),
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (2)
51var fullPath = Path.GetFullPath(_project.FilePath); 79var fullPath = !string.IsNullOrEmpty(filePath) ? Path.GetFullPath(filePath) : filePath;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
165=> Path.GetFileNameWithoutExtension(document.Document.Name); 220var fileExtension = Path.GetExtension(documentNameWithExtension);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
65Debug.Assert(parts.IsEmpty || parts.Any(static s => s.IndexOfAny(Path.GetInvalidPathChars()) < 0));
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
161var folderPath = Path.Combine([.. document.Folders]);
EditAndContinue\TraceLog.cs (6)
44path = Path.Combine(_logDirectory, _traceLog._name + ".log"); 56var directory = Path.Combine(_logDirectory, sessionId.Ordinal.ToString(), relativePath); 74var directory = CreateSessionDirectory(updateId.SessionId, Path.Combine(document.Project.Name, relativeDir)); 75return Path.Combine(directory, $"{fileName}.{updateId.Ordinal}.{generation?.ToString() ?? "-"}.{suffix}{extension}"); 83path = Path.Combine(CreateSessionDirectory(sessionId, directory), fileName); 97path = Path.Combine(CreateSessionDirectory(sessionId, directory), fileName);
Emit\CompilationOutputFilesWithImplicitPdbPath.cs (3)
35public override string PdbDisplayPath => Path.GetFileNameWithoutExtension(AssemblyFilePath) + ".pdb"; 75TryOpenFileStream(Path.Combine(Path.GetDirectoryName(AssemblyFilePath)!, PathUtilities.GetFileName(pdbPath)));
Extensions\ExtensionMessageHandlerService.cs (1)
62return Path.GetDirectoryName(assemblyFilePath)
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
277var fileName = filePath == null ? null : IOUtilities.PerformIO(() => Path.GetFileName(filePath)) ?? filePath;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
160var directoryToCreate = Path.GetDirectoryName(fileInfo.TemporaryFilePath)!; 367Path.GetFileName(fileInfo.TemporaryFilePath),
MetadataAsSource\MetadataAsSourceFileService.cs (3)
54private readonly string _rootTemporaryPath = Path.Combine(TempPathUtilities.GetTempPath(), MetadataAsSource); 64_rootTemporaryPathWithGuid = Path.Combine(_rootTemporaryPath, guidString); 109var providerTempPath = Path.Combine(_rootTemporaryPathWithGuid, provider.GetType().Name);
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
34this.TemporaryFilePath = Path.Combine(rootPath, directoryName, topLevelNamedType.Name + Extension);
NavigateTo\RoslynNavigateToItem.cs (1)
227var fileName = Path.GetFileNameWithoutExtension(_itemDocument.FilePath ?? "");
PdbSourceDocument\ImplementationAssemblyLookupService.cs (10)
29private static readonly string PathSeparatorString = Path.DirectorySeparatorChar.ToString(); 44var pathParts = referencedDllPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 58var basePath = Path.GetDirectoryName(dllPath); 81dllPath = Path.Combine(basePath, $"{assemblyName}.dll"); 132var pathToTry = Path.Combine( 156var frameworkXml = Path.Combine(referencedDllPath, "..", "..", "..", "data", "FrameworkList.xml"); 180var basePath = Path.GetFullPath(Path.Combine(referencedDllPath, "..", "..", "..", "..", "..", "..")); 181var dllPath = Path.Combine(basePath, "shared", sdkName, packVersion, dllFileName);
PdbSourceDocument\PdbSourceDocumentLoaderService.cs (3)
46var filePath = Path.Combine(tempFilePath, Path.GetFileName(sourceDocument.FilePath)); 127var relativePath = Path.GetFileName(sourceDocument.FilePath);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (3)
105telemetryMessage.SetDll(Path.GetFileName(dllPath)); 230var tempFilePath = Path.Combine(tempPath, projectId.Id.ToString()); 351name: Path.GetFileName(info.FilePath),
SemanticSearch\SemanticSearchWorkspace.cs (2)
21public static readonly string ReferenceAssembliesDirectory = Path.Combine(Path.GetDirectoryName(typeof(SemanticSearchWorkspace).Assembly.Location)!, "SemanticSearchRefs");
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (1)
76var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(tree.FilePath));
src\roslyn\src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
158var folders = relativeDirectoryPath.Split([Path.DirectorySeparatorChar], StringSplitOptions.RemoveEmptyEntries);
src\roslyn\src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
75var expectedFileHeader = fileHeaderTemplate.Replace("{fileName}", Path.GetFileName(document.FilePath));
StackTraceExplorer\StackTraceExplorerService.cs (2)
96var documentName = Path.GetFileName(fileName); 108var name = Path.GetFileName(document.Name);
UnusedReferences\ProjectAssets\ProjectAssetsReader.cs (3)
78? Path.GetFileNameWithoutExtension(referenceInfo.ItemSpecification) 150compilationAssemblies.Add(Path.GetFullPath(Path.Combine(packagesPath, library.Path ?? "", assemblyPath)));
UnusedReferences\UnusedReferencesRemover.cs (1)
149.SelectAsArray(assemblyPath => Path.GetFileName(assemblyPath));
Microsoft.CodeAnalysis.NetAnalyzers (10)
Microsoft.CodeQuality.Analyzers\Maintainability\CodeMetricsAnalyzer.cs (2)
307string fileName = Path.GetFileName(textFile.Path); 431string arg2 = Path.GetFileName(additionalText.Path);
Microsoft.NetCore.Analyzers\Security\UseDefaultDllImportSearchPathsAttribute.cs (1)
119Path.IsPathRooted(value.ToString()))
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\AdditionalFileProvider.cs (2)
42=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 50=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PathHelper.cs (2)
11private static readonly char[] DirectorySeparatorCharacters = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
34editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 51var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 52var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
Microsoft.CodeAnalysis.Razor.Compiler (9)
Language\Components\ComponentDiagnosticFactory.cs (1)
110var fileName = Path.GetFileName(source.FilePath);
Language\Components\ComponentDocumentClassifierPass.cs (1)
146className = CSharpIdentifier.SanitizeIdentifier(Path.GetFileNameWithoutExtension(relativePath).AsSpanOrDefault());
Language\DefaultRazorProjectFileSystem.cs (2)
76var physicalPath = Path.GetFullPath(path); 79var filePath = "/" + relativePhysicalPath.Replace(Path.DirectorySeparatorChar, '/');
Language\RazorCodeDocumentExtensions.cs (1)
56(codeDocument.FileKind.IsLegacy() && string.Equals(Path.GetFileName(codeDocument.Source.FilePath), MvcImportProjectFeature.ImportsFileName, StringComparison.OrdinalIgnoreCase));
Mvc\RazorExtensionsDiagnosticFactory.cs (1)
85var fileName = Path.GetFileName(source.FilePath);
SourceGenerators\RazorSourceGenerator.cs (2)
66var fileName = Path.GetFileNameWithoutExtension(path); 71var fileName = Path.GetFileNameWithoutExtension(path);
SourceGenerators\RazorSourceGenerator.RazorProviders.cs (1)
155.Replace(Path.DirectorySeparatorChar, '/')
Microsoft.CodeAnalysis.Razor.DotNetFormat (9)
RazorFormatter.cs (1)
81Path.GetExtension(filePath) is var extension &&
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Formatting\FormattingLogger.cs (1)
32var filePath = Path.Combine(_logFolder, fileName);
src\roslyn\src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Formatting\FormattingLoggerFactory.cs (2)
33var fileName = Path.GetFileName(documentFilePath).Replace(".", "_"); 35var logFolder = Path.Combine(logDirectory, folder);
src\roslyn\src\Razor\src\Razor\src\Microsoft.VisualStudioCode.RazorExtension\ExternalAccess\Razor\RazorAnalyzerAssemblyResolver.cs (5)
60var onDiskName = Path.Combine(directory, $"{fileName}.dll"); 83if (!Path.GetFileName(directory.AsSpan().TrimEnd(Path.DirectorySeparatorChar)).Equals(ServiceHubCoreFolderName, StringComparison.OrdinalIgnoreCase)) 85var serviceHubCoreDirectory = Path.Combine(directory, ServiceHubCoreFolderName); 94var assemblyPath = Path.Combine(directory, assemblyFileName);
Microsoft.CodeAnalysis.Rebuild (2)
CSharpCompilationFactory.cs (1)
52Path.GetFileNameWithoutExtension(AssemblyFileName),
VisualBasicCompilationFactory.cs (1)
52Path.GetFileNameWithoutExtension(AssemblyFileName),
Microsoft.CodeAnalysis.ResxSourceGenerator (30)
AbstractResxGenerator.cs (6)
82var resourceHintName = Path.GetFileNameWithoutExtension(resourceFile.Path); 86resourceHintName = Path.GetFileNameWithoutExtension(link); 87string linkRelativeDir = Path.GetDirectoryName(link); 95else if (options.TryGetValue("build_metadata.AdditionalFiles.RelativeDir", out var relativeDir) && !relativeDir.StartsWith("..", StringComparison.Ordinal) && !Path.IsPathRooted(relativeDir)) 108string candidate = relativeDir.Replace(Path.DirectorySeparatorChar, '.').Replace(Path.AltDirectorySeparatorChar, '.') + hintName;
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
Microsoft.CodeAnalysis.Scripting (29)
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 (17)
87_baseDirectory = Path.Combine(TempPathUtilities.GetTempPath(), Guid.NewGuid().ToString()); 385string directory = Path.GetDirectoryName(fullPath); 410string shadowCopyPath = Path.Combine(assemblyCopyDir, Path.GetFileName(originalPath)); 467originalDirectory = Path.GetDirectoryName(originalPath); 468shadowCopyDirectory = Path.GetDirectoryName(shadowCopyPath); 472originalPath: Path.Combine(originalDirectory, moduleName), 473shadowCopyPath: Path.Combine(shadowCopyDirectory, moduleName)); 512string dir = Path.Combine(basePath, Guid.NewGuid().ToString()); 545string assemblyDirectory = Path.GetDirectoryName(originalAssemblyPath); 546string assemblyFileName = Path.GetFileName(originalAssemblyPath); 560Directory.CreateDirectory(Path.Combine(assemblyCopyDirectory, xmlSubdirectory)); 568string xmlCopyPath = Path.Combine(assemblyCopyDirectory, xmlSubdirectory, xmlFileName); 569string xmlOriginalPath = Path.Combine(assemblyDirectory, xmlSubdirectory, xmlFileName); 588docFileName = Path.ChangeExtension(assemblyFileName, ".xml"); 593if (File.Exists(Path.Combine(assemblyDirectory, docSubdirectory, docFileName))) 603if (File.Exists(Path.Combine(assemblyDirectory, docFileName)))
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (1)
201=> ((AppContext.GetData("TRUSTED_PLATFORM_ASSEMBLIES") as string)?.Split(Path.PathSeparator)).ToImmutableArrayOrEmpty();
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\MonoGlobalAssemblyCache.cs (7)
31s_corlibDirectory = Path.GetDirectoryName(corlibAssemblyFile); 34s_gacDirectory = Directory.GetParent(Path.GetDirectoryName(systemAssemblyFile)).Parent.FullName; 45var corlibFriendPath = Path.Combine(s_corlibDirectory, fileName); 49corlibFriendPath = Path.Combine(s_corlibDirectory, "Facades", fileName); 65yield return Path.Combine(gacPath, name, version + "__" + publicKeyToken, fileName); 70var gacAssemblyRootDir = new DirectoryInfo(Path.Combine(gacPath, name)); 88var assemblyPath = Path.Combine(assemblyDir.ToString(), fileName);
Microsoft.CodeAnalysis.Workspaces (91)
Diagnostics\DiagnosticDataLocation.cs (1)
90return Path.GetFullPath(combined);
Rename\ConflictEngine\MutableConflictResolution.cs (5)
95var extension = Path.GetExtension(document.Name); 96var newName = Path.ChangeExtension(ReplacementText, extension); 106var newDocumentFilePath = Path.Combine(directory, newName); 120newName = Path.ChangeExtension(nameWithoutExtension, extension); 121newDocumentFilePath = Path.Combine(directory, newName);
Serialization\AbstractOptionsSerializationService.cs (1)
162var strongNameProvider = new DesktopStrongNameProvider([], Path.GetTempPath());
Serialization\SerializationExtensions.cs (1)
39.WithStrongNameProvider(new DesktopStrongNameProvider(GetStrongNameKeyPaths(info), Path.GetTempPath()));
Shared\TestHooks\AsynchronousOperationListener+DiagnosticAsyncToken.cs (1)
32public override string ToString() => $"{Name} {Path.GetFileName(FilePath)} {LineNumber}";
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.Core.cs (5)
85var fullDirectoryPath = Path.GetDirectoryName(resolvedPath) ?? throw new ArgumentException(message: null, paramName: nameof(resolvedPath)); 118var assemblyPath = Path.Combine(directory, simpleName + ".dll"); 134var analyzerFileName = Path.ChangeExtension(simpleName, ".dll"); 135var analyzerFilePath = Path.Combine(directory, analyzerFileName); 204var assemblyPath = Path.Combine(Directory, unmanagedDllName + ".dll");
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (4)
308var assemblyFileName = Path.GetFileName(assemblyFilePath); 309var satelliteAssemblyName = Path.ChangeExtension(assemblyFileName, ".resources.dll"); 310var path = Path.GetDirectoryName(assemblyFilePath); 318var filePath = Path.Combine(path, cultureInfo.Name, satelliteAssemblyName);
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (1)
35DotNetPath = Path.Combine(programFilesPath, "dotnet");
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (18)
113if (!Path.IsPathRooted(baseDirectory)) 123var versionDirectory = Path.Combine(baseDirectory, DirectoryVersion); 124ShadowDirectory = Path.Combine(versionDirectory, "shadow"); 125CacheDirectory = Path.Combine(versionDirectory, "cache"); 128SessionDirectory = Path.Combine(ShadowDirectory, sessionDirectoryName); 182string name = Path.GetFileName(subDirectory).ToLowerInvariant(); 306var analyzerShadowPath = Path.Combine(analyzerShadowDir, Path.GetFileName(originalAnalyzerPath)); 320var satelliteFileName = Path.GetFileName(satelliteFilePath); 321var satelliteDirectoryName = Path.GetFileName(Path.GetDirectoryName(satelliteFilePath)); 322var shadowSatellitePath = Path.Combine(analyzerShadowDir, satelliteDirectoryName!, satelliteFileName); 332var originalDirName = Path.GetDirectoryName(analyzerFilePath)!; 334return Path.Combine(SessionDirectory, shadowDirName); 375var directory = Path.GetDirectoryName(shadowCopyPath); 399? Path.Combine(@this.CacheDirectory, cacheKey) 465return $"{Path.GetFileNameWithoutExtension(originalPath)}-{hexHash}-{mvid:N}-{length}{Path.GetExtension(originalPath)}";
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
Storage\AbstractPersistentStorageService.cs (1)
109IOUtilities.PerformIO(() => Directory.Delete(Path.GetDirectoryName(databaseFilePath)!, recursive: true));
Utilities\WorkspacePathUtilities.cs (2)
35/// such that <see cref="Path.GetFileNameWithoutExtension(string?)"/> would throw. 44return IOUtilities.PerformIO(() => Path.GetFileNameWithoutExtension(document.Name));
Workspace\CommandLineProject.cs (10)
47var strongNameProvider = new DesktopStrongNameProvider(commandLineArguments.KeyFileSearchPaths, Path.GetTempPath()); 111Path.GetFileNameWithoutExtension(commandLineArguments.OutputFileName) : "<anonymous>"; 151var absolutePath = Path.IsPathRooted(fileArg.Path) || string.IsNullOrEmpty(projectDirectory) 152? Path.GetFullPath(fileArg.Path) 153: Path.GetFullPath(Path.Combine(projectDirectory, fileArg.Path)); 158var folderRoot = isWithinProject ? Path.GetDirectoryName(relativePath) : ""; 160var name = Path.GetFileName(relativePath); 189private static readonly char[] s_folderSplitters = [Path.DirectorySeparatorChar]; 193var directory = Path.GetDirectoryName(path);
Workspace\Host\Documentation\DocumentationProviderService.cs (1)
26return XmlDocumentationProvider.CreateFromFile(Path.ChangeExtension(assemblyPath, "xml"));
Workspace\Host\Metadata\IAnalyzerAssemblyLoaderProvider.cs (4)
55AnalyzerAssemblyLoader.CleanLegacyShadowCopyDirectoryIfNeeded(Path.Combine(Path.GetTempPath(), nameof(Roslyn), "AnalyzerAssemblyLoader")); 57Path.Combine(Path.GetTempPath(), nameof(Roslyn), "AnalyzerPathResolver"),
Workspace\Host\PersistentStorage\AbstractPersistentStorage.cs (1)
21public string DatabaseDirectory => Path.GetDirectoryName(DatabaseFile) ?? throw ExceptionUtilities.UnexpectedValue(DatabaseFile);
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (4)
39private static readonly ImmutableArray<char> s_invalidPathChars = [.. Path.GetInvalidPathChars(), '/']; 51s_cacheDirectory = Path.Combine(appDataFolder, "Microsoft", "VisualStudio", "Roslyn", "Cache"); 73return Path.Combine( 81var fileName = Path.GetFileName(fullPath);
Workspace\ProjectSystem\IFileChangeWatcher.cs (2)
34if (!path.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString())) 36path += System.IO.Path.DirectorySeparatorChar;
Workspace\ProjectSystem\ProjectSystemProject.cs (4)
182var rootPath = Path.GetDirectoryName(filePath); 983fullPath = Path.GetFullPath(fullPath); 1014private static string CreateDirectoryPathFragment(params string[] paths) => Path.Combine([" ", .. paths, " "]).Trim(); 1017fullPath.LastIndexOf(Path.DirectorySeparatorChar);
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (3)
133_commandLineArgumentsForCommandLine = _commandLineParserService.Parse(arguments, Path.GetDirectoryName(_project.FilePath), isInteractive: false, sdkDirectory: null); 174.WithStrongNameProvider(new DesktopStrongNameProvider([.. _commandLineArgumentsForCommandLine.KeyFileSearchPaths.WhereNotNull()], Path.GetTempPath())); 192? Path.Combine(_commandLineArgumentsForCommandLine.OutputDirectory, _commandLineArgumentsForCommandLine.OutputFileName)
Workspace\ProjectSystem\ReferenceFileChangeTracker.cs (3)
74referenceDirectories.Add(Path.Combine(dotnetRoot, "packs")); 79referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies", "Microsoft", "Framework")); 80referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "dotnet", "packs"));
Microsoft.CodeAnalysis.Workspaces.MSBuild (39)
MSBuild\BuildHostProcessManager.cs (8)
37private static string MSBuildWorkspaceDirectory => Path.GetDirectoryName(typeof(BuildHostProcessManager).Assembly.Location) ?? AppContext.BaseDirectory; 38private static bool IsLoadedFromNuGetPackage => File.Exists(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "microsoft.codeanalysis.workspaces.msbuild.nuspec")); 166dotnetPath = Path.GetFullPath(Path.Combine(msbuildLocation.Path, $"../../{DotnetExecutable}")); 269processStartInfo.Environment["DOTNET_ROOT"] = Path.GetDirectoryName(dotnetPath); 338buildHostPath = Path.GetFullPath(Path.Combine(MSBuildWorkspaceDirectory, "..", "..", "contentFiles", "any", "any", contentFolderName, assemblyName)); 343buildHostPath = Path.Combine(MSBuildWorkspaceDirectory, contentFolderName, assemblyName);
MSBuild\MSBuildProjectLoader.cs (7)
185var solutionDir = Path.GetDirectoryName(absoluteSolutionPath)!; 365_directory = Path.GetDirectoryName(logFilePath) ?? "."; 366_filename = Path.GetFileNameWithoutExtension(logFilePath) is { Length: > 0 } fileName 369_extension = Path.GetExtension(logFilePath) is { Length: > 0 } extension 379? Path.Combine(_directory, _filename + _extension) 380: Path.Combine(_directory, $"{_filename}-{suffix}{_extension}"); 382return Path.GetFullPath(newPath);
MSBuild\MSBuildProjectLoader.Worker.cs (6)
192var projectName = Path.GetFileNameWithoutExtension(projectPath) ?? string.Empty; 202var projectDirectory = Path.GetDirectoryName(projectPath); 242.WithStrongNameProvider(new DesktopStrongNameProvider(commandLineArgs.KeyFileSearchPaths, Path.GetTempPath())) 313var assemblyName = Path.GetFileNameWithoutExtension(projectFilePath); 390private static readonly char[] s_directorySplitChars = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
MSBuild\MSBuildWorkspace.cs (10)
181return Path.GetFullPath(FileUtilities.ResolveRelativePath(path, baseDirectoryPath) ?? path); 498var fileName = Path.ChangeExtension(info.Name, extension); 501? Path.Combine(Path.Combine([.. info.Folders]), fileName) 504var fullPath = GetAbsolutePath(relativePath, Path.GetDirectoryName(project.FilePath)!); 527var dir = Path.GetDirectoryName(fullPath); 594s_frameworkRoot = Path.GetDirectoryName(runtimeDir); // back out one directory level to be root path of all framework versions 628var fileName = identity != null ? identity.Name : Path.GetFileNameWithoutExtension(peRef.FilePath); 633var relativePath = PathUtilities.GetRelativePath(Path.GetDirectoryName(CurrentSolution.GetRequiredProject(projectId).FilePath)!, peRef.FilePath); 634var fileName = Path.GetFileNameWithoutExtension(peRef.FilePath);
MSBuild\ProjectFileExtensionRegistry.cs (1)
90var projectFileExtension = Path.GetExtension(projectFilePath);
MSBuild\SolutionFileReader.cs (1)
52var baseDirectory = Path.GetDirectoryName(solutionFilePath);
MSBuild\SolutionFileReader.SolutionFilterReader.cs (5)
20return Path.GetExtension(filename).Equals(".slnf", StringComparison.OrdinalIgnoreCase); 30var solutionPath = solution.GetProperty("path").GetString()?.Replace('\\', Path.DirectorySeparatorChar); 31if (solutionPath is null || Path.GetDirectoryName(filterFilename) is not string baseDirectory) 47baseDirectory = Path.GetDirectoryName(solutionFilename)!; 54var projectPath = project.GetString()?.Replace('\\', Path.DirectorySeparatorChar);
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (18)
MSBuild\ProjectFile\ProjectFile.cs (1)
137var fileName = Path.GetFileNameWithoutExtension(filePath);
MSBuild\ProjectFile\ProjectInstanceReader.cs (1)
186=> !Path.GetFileName(item.ItemSpec).StartsWith("TemporaryGeneratedFile_", StringComparison.Ordinal);
NetCoreBuildHost.cs (1)
29WorkingDirectory = Path.GetDirectoryName(projectOrSolutionFilePath),
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (10)
MonoMSBuildDiscovery.cs (9)
23=> Contract.ThrowIfTrue(Path.DirectorySeparatorChar == '\\'); 36.Split(Path.PathSeparator) 77.Select(p => Path.Combine(p, "mono")) 115var monoDirPath = Path.GetDirectoryName(monoRuntimePath)!; 117var monoLibDirPath = Path.Combine(monoDirPath, "..", "lib", "mono"); 118monoLibDirPath = Path.GetFullPath(monoLibDirPath); 141var monoMSBuildDirPath = Path.Combine(monoLibDirPath, "msbuild"); 142var monoMSBuildDir = new DirectoryInfo(Path.GetFullPath(monoMSBuildDirPath)); 178var monoMSBuildPath = Path.Combine(monoMSBuildDirectory, "Microsoft.Build.dll");
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
Microsoft.Data.Analysis.Tests (7)
DataFrame.IOTests.cs (1)
1338Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "/";
parent\Microsoft.ML.TestFramework\BaseTestClass.cs (6)
39DataDir = Path.Combine(RootDir, "test", "data"); 57OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput"); 108return Path.GetFullPath(Path.Combine(DataDir, name)); 115return Path.GetFullPath(Path.Combine(DataDir, subDir, name));
Microsoft.Deployment.DotNet.Releases (3)
ReleaseFile.cs (2)
38public string FileName => Path.GetFileName(Address.LocalPath); 117string tempPath = !File.Exists(destinationPath) ? destinationPath : Path.GetTempFileName();
Utils.cs (1)
50string directory = Path.GetDirectoryName(fileName);
Microsoft.Diagnostics.DataContractReader.Legacy (1)
DebugExtensions.cs (1)
110string message = $"HResult mismatch - cDAC: 0x{unchecked((uint)cdacHr):X8}, DAC: 0x{unchecked((uint)dacHr):X8} ({Path.GetFileName(filePath)}:{lineNumber})";
Microsoft.Diagnostics.NETCore.Client (9)
DiagnosticsClient\DiagnosticsClient.cs (3)
502if (!int.TryParse(Path.GetFileName(procEntry), NumberStyles.Integer, CultureInfo.InvariantCulture, out int hostPid)) 517string crossNsDir = Path.Combine(PidIpcEndpoint.GetProcessRootPath(hostPid), targetTmpDir.TrimStart(Path.DirectorySeparatorChar));
DiagnosticsClient\DiagnosticsClientConnector.cs (1)
65string fullPort = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? portConfig.Address : Path.GetFullPath(portConfig.Address);
DiagnosticsIpc\IpcTransport.cs (5)
244public static string IpcRootPath { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @"\\.\pipe\" : Path.GetTempPath(); 502string fileName = Path.GetFileName(path); 606string tmpDirPath = Path.GetTempPath(); 692searchDirectory = Path.Combine(GetProcessRootPath(pid), targetTmpDir.TrimStart(Path.DirectorySeparatorChar));
Microsoft.DiaSymReader (1)
SymUnmanagedFactory.cs (1)
135var moduleHandle = LoadLibraryW(Path.Combine(dir, DiaSymReaderModuleName));
Microsoft.DotNet.ApiCompat.Task (6)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RoslynResolver.cs (3)
50Assembly asm = loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{name.Name}.dll")); 60loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisCSharpName}.dll")); 62loadFromPath(Path.Combine(_roslynAssembliesPath!, $"{codeAnalysisName}.dll"));
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\ValidateAssemblies.cs (3)
113assemblyName: Path.GetFileNameWithoutExtension(assembly), 131string filename = Path.GetFileName(path); 134string? directoryName = Path.GetDirectoryName(path);
Microsoft.DotNet.ApiSymbolExtensions (11)
AssemblySymbolLoader.cs (11)
88ImmutableHashSet<string> fileNames = assembliesPaths.Select(path => Path.GetFileName(path)).ToImmutableHashSet(); 138string assemblyName = Path.GetFileName(path); 141string? directoryName = Path.GetDirectoryName(path); 160ImmutableHashSet<string> fileNames = paths.Select(path => Path.GetFileName(path)).ToImmutableHashSet(); 189ImmutableHashSet<string> fileNames = relativePaths.Select(relativePath => Path.GetFileName(relativePath)).ToImmutableHashSet(); 205string name = Path.GetFileName(relativePaths[i]); 310string possiblePath = Path.Combine(directory, name); 364string? directory = Path.GetDirectoryName(path); 384string name = Path.GetFileName(path); 456using FileStream resolvedStream = File.OpenRead(Path.Combine(fullReferencePath, assemblyReferenceName)); 467string potentialPath = Path.Combine(referencePathDirectory, assemblyReferenceName);
Microsoft.DotNet.Arcade.Sdk (21)
parent\Common\Internal\AbsolutePathExtensions.cs (1)
46new(Path.GetFullPath(path.Value));
src\DownloadFile.cs (1)
79Directory.CreateDirectory(Path.GetDirectoryName(destinationPath));
src\ExtractNgenMethodList.cs (2)
87var outputFileName = $"{Path.GetFileNameWithoutExtension(AssemblyFilePath)}-{outputFileNameSuffix}.ngen.txt"; 88var outputFilePath = Path.Combine(outputDirectory, outputFileName);
src\GenerateSourcePackageSourceLinkTargetsFile.cs (4)
36Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 100return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 104=> EndsWithSeparator(path) ? path : path + Path.DirectorySeparatorChar;
src\InstallDotNetCore.cs (6)
206string dotNetPath = Path.TrimEndingDirectorySeparator(DotNetPath); 297dotnetRoot = Path.Combine(dotnetRoot, architecture.ToLowerInvariant()); 302"dotnet" => Path.Combine(dotnetRoot, "shared", "Microsoft.NETCore.App", version), 303"aspnetcore" => Path.Combine(dotnetRoot, "shared", "Microsoft.AspNetCore.App", version), 304"windowsdesktop" => Path.Combine(dotnetRoot, "shared", "Microsoft.WindowsDesktop.App", version), 305_ => Path.Combine(dotnetRoot, "shared", version)
src\LocateDotNet.cs (6)
41var globalJsonPath = TaskEnvironment.GetAbsolutePath(Path.Combine(RepositoryRoot, "global.json")); 76var fileName = (Path.DirectorySeparatorChar == '\\') ? "dotnet.exe" : "dotnet"; 78var dotNetDir = paths.Split(new[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(p => File.Exists(TaskEnvironment.GetAbsolutePath(Path.Combine(p, fileName)))); 80if (dotNetDir == null || !Directory.Exists(TaskEnvironment.GetAbsolutePath(Path.Combine(dotNetDir, "sdk", sdkVersion)))) 89DotNetPath = TaskEnvironment.GetAbsolutePath(Path.Combine(dotNetDir, fileName)).GetCanonicalForm();
src\SaveItems.cs (1)
50string path = Path.GetDirectoryName(outputPath);
Microsoft.DotNet.Build.Tasks.FileCatalog (1)
GenerateFileCatalog.cs (1)
75string? directory = Path.GetDirectoryName(outputPath);
Microsoft.DotNet.Build.Tasks.Installers (78)
src\CreateLightCommandPackageDrop.cs (8)
34string packageDropOutputFolder = Path.Combine(LightCommandWorkingDir, Path.GetFileName(InstallerFile)); 56AbsolutePath destinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, Path.GetFileName(WixProjectFile))); 58commandString.Append($" -wixprojectfile {Path.GetFileName(WixProjectFile)}"); 62commandString.Append($" -contentsfile {Path.GetFileName(ContentsFile)}"); 66commandString.Append($" -outputsfile {Path.GetFileName(OutputsFile)}"); 70commandString.Append($" -builtoutputsfile {Path.GetFileName(BuiltOutputsFile)}");
src\CreateMD5SumsFile.cs (1)
46string relativePath = file.ItemSpec.Substring(RootDirectory.Length).TrimStart(Path.DirectorySeparatorChar).Replace('\\', '/');
src\CreateWixBuildWixpack.cs (49)
105WixpackWorkingDir = Path.Combine(Path.GetTempPath(), "WixpackTemp", Guid.NewGuid().ToString().Split('-')[0]); 109_installerFilename = Path.GetFileName(InstallerFile); 124AbsolutePath destPathAbsolute = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, Path.GetFileName(projectPath))); 157OutputFile = Path.Combine(OutputFolder, $"{_installerFilename}{_packageExtension}"); 192var randomDirName = Path.GetRandomFileName(); 195AbsolutePath destinationDir = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, randomDirName)); 219var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 282_defineConstantsDictionary["ProjectPath"] = Path.GetFileName(projectPath); 300_defineConstantsDictionary["TargetPath"] = Path.Combine("%outputfolder%", Path.GetFileName(targetPath)); 304InstallerFile = Path.Combine("%outputfolder%", Path.GetFileName(InstallerFile)); 312PdbFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(PdbFile.ItemSpec)); 318BindTrackingFile.ItemSpec = Path.Combine("%outputfolder%", Path.GetFileName(BindTrackingFile.ItemSpec)); 446commandLineArgs.Add($"{Path.GetFileName(sourceFile.ItemSpec)}"); 452AbsolutePath responseFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, "create.rsp")); 467AbsolutePath commandFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(wixpackWorkingDir, "create.cmd")); 541var copiedXmlPath = Path.Combine(WixpackWorkingDir, Path.GetFileName(xmlPath)); 544string sourceFileFolder = Path.GetDirectoryName(xmlPath); 622var filePath = Path.Combine(dir, Path.GetFileName(source)); 623CopySourceFile(Path.GetFileName(dir), filePath); 634id = Path.GetFileName(source); 640var newSourceValue = $"{id}\\{Path.GetFileName(source)}"; 678string id = Path.GetFileName(includeFilePath); 691var potentialPath = Path.Combine(wixpackWorkingDir, searchPath, Path.GetFileName(includeFilePath)); 1042AbsolutePath destDir = TaskEnvironment.GetAbsolutePath(Path.Combine(WixpackWorkingDir, fileId)); 1050AbsolutePath destPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destDir, Path.GetFileName(source))); 1065string filename = Path.GetFileName(extensionPath); 1069Extensions[i] = new TaskItem(Path.Combine(filename, filename)); 1081string wixpackSubfolder = Path.GetRandomFileName(); 1109string filename = Path.GetFileName(localizationPath); 1113LocalizationFiles[i] = new TaskItem(Path.Combine(filename, filename)); 1120if (!Path.IsPathRooted(source)) 1123Path.Combine(_wixprojDir, source) : 1124Path.Combine(relativeRoot, source); 1137AbsolutePath destinationFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(destDir, Path.GetFileName(file))); 1144AbsolutePath destinationSubdirectoryPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destDir, Path.GetFileName(dir)));
src\CreateWixCommandPackageDropBase.cs (17)
74OutputFile = Path.Combine(OutputFolder, $"{Path.GetFileName(InstallerFile)}{_packageExtension}"); 90AbsolutePath commandFilename = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, $"create.cmd")); 106commandString.Append($" -out %outputfolder%{Path.GetFileName(InstallerFile)}"); 115commandString.Append($" -loc {Path.GetFileName(locItem.ItemSpec)}"); 129commandString.Append($" {Path.GetFileName(wixSrcFile.ItemSpec)}"); 153AbsolutePath newWixSrcFilePath = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, Path.GetFileName(wixSrcFile.ItemSpec))); 156string wixSrcFileExtension = Path.GetExtension(wixSrcFile.ItemSpec); 185AbsolutePath destinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(packageDropDir, Path.GetFileName(locItem.ItemSpec))); 292else if (!Path.IsPathRooted(oldPath)) 301AbsolutePath possiblePath = TaskEnvironment.GetAbsolutePath(Path.Combine(additionalBasePath.ItemSpec, oldPath)); 319newRelativePath = Path.Combine(id, Path.GetFileName(oldPath)); 334AbsolutePath newFolder = TaskEnvironment.GetAbsolutePath(Path.Combine(outputPath, id)); 340File.Copy(TaskEnvironment.GetAbsolutePath(oldPath), TaskEnvironment.GetAbsolutePath(Path.Combine(outputPath, newRelativePath)), true);
src\RpmBuilder.cs (3)
413baseNames.Add(Path.GetFileName(file.Name)); 414string dirName = Path.GetDirectoryName(file.Name)!; 473if (file.Name.StartsWith("usr/share/doc") && Path.GetFileName(file.Name) == "copyright")
Microsoft.DotNet.Build.Tasks.Packaging (63)
CreateTrimDependencyGroups.cs (2)
163string fileName = Path.GetFileName(compileAsset); 165if (!runtimeAssets.Any(r => Path.GetFileName(r).Equals(fileName, StringComparison.OrdinalIgnoreCase)))
GenerateNuSpec.cs (3)
119var directory = Path.GetDirectoryName(OutputFileName); 262Target = f.GetMetadata(Metadata.FileTarget).Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar),
GenerateRuntimeDependencies.cs (1)
139string 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)
107int dirLength = contentItem.Path.LastIndexOf(Path.AltDirectorySeparatorChar); 153return Path.GetFileName(path) == PlaceHolderFile;
NuGetPack.cs (13)
25@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar), 26@"src\**\*".Replace('\\', Path.DirectorySeparatorChar) 33@"content\**\*".Replace('\\', Path.DirectorySeparatorChar), 34@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar) 212string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 263return Path.Combine(nupkgOutputDirectory, $"{id}.{version}{nupkgExtension}"); 268bool creatingSymbolsPackage = packSymbols && (Path.GetExtension(nupkgPath) == _symbolsPackageExtension); 274string baseDirectoryPath = (string.IsNullOrEmpty(BaseDirectory)) ? Path.GetDirectoryName(nuspecPath) : BaseDirectory; 311var directory = Path.GetDirectoryName(nupkgPath); 392if(Path.GetFileName(fileName) == "runtime.json" && file.Target == "") 394string 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)
40var testAssetsByName = testAssets.Where(a => Path.GetExtension(a.PackagePath) == ".dll") 41.ToDictionary(a => Path.GetFileNameWithoutExtension(a.PackagePath), a => a);
ValidatePackage.cs (4)
288string fileName = Path.GetFileName(implementationAssembly.PackagePath); 304Path.GetFileName(i.PackagePath).Equals(fileName, StringComparison.OrdinalIgnoreCase) && 397var moduleNames = allDlls.Select(d => Path.GetFileNameWithoutExtension(d.LocalPath)); 410return !String.IsNullOrWhiteSpace(path) && Path.GetExtension(path).Equals(".dll", StringComparison.OrdinalIgnoreCase);
Microsoft.DotNet.Build.Tasks.Templating (2)
GenerateFileFromTemplate.cs (1)
101string directory = Path.GetDirectoryName(resolvedOutputPath);
parent\parent\Common\Internal\AbsolutePathExtensions.cs (1)
46new(Path.GetFullPath(path.Value));
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
OptProf\GenerateTrainingInputFiles.cs (6)
86var jsonManifest = ReadVsixJsonManifest(TaskEnvironment.GetAbsolutePath(Path.Combine(insertionDirectory, product.Name))); 121var configurationsDir = Path.Combine(OutputDirectory, test.Container, "Configurations"); 126WriteEntries(ibcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 136WriteEntries(filteredIbcEntries, Path.Combine(configurationsDir, fullyQualifiedName)); 151string basePath = Path.Combine(outDirPath, entry.RelativeDirectoryPath.Replace("\\", "") + Path.GetFileNameWithoutExtension(entry.RelativeInstallationPath));
OptProf\GenerateTrainingPropsFile.cs (1)
59File.WriteAllText(Path.Combine(outputDirectory, outputFileNameNoExt + ".props"),
OptProf\IbcEntry.cs (4)
48ngenApplicationPath: Path.Combine(VSInstallationRootVar, args.InstrumentationExecutable.Replace("/", "\\"))); 59string ext = Path.GetExtension(filePath); 65=> Path.GetFileNameWithoutExtension(filePath).EndsWith(".resources"); 80select new IbcEntry(fileName, filePath, relativeDirectoryPath: Path.GetDirectoryName(fileName), DefaultNgenApplication);
Microsoft.DotNet.Build.Tasks.Workloads (23)
EmbeddedTemplates.cs (1)
41string destinationPath = Path.Combine(destinationFolder, destinationFilename);
Swix\ComponentSwixProject.cs (3)
19SourcePath = Path.Combine(SourcePath, $"{component.SdkFeatureBand}", $"{Path.GetRandomFileName()}"); 63Path.Combine(base.GetRelativePackagePath(), "_package.json");
Swix\SwixProjectBase.cs (1)
59SourcePath = Path.Combine(SourcePath, "swix");
Utils.cs (2)
47return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
Wix\WixToolTask.cs (1)
101public string GetWixCommandLine() => Path.Combine(ToolPath, ToolExe) + " " +
Wix\WixToolTaskBase.cs (3)
56ToolPath = Path.GetDirectoryName(toolFullPath); 57ToolName = Path.GetFileName(toolFullPath); 60protected override string GenerateFullPathToTool() => Path.Combine(ToolPath, ToolName);
WorkloadPackageBase.cs (10)
216DestinationDirectory = Path.Combine(destinationBaseDirectory, Path.GetRandomFileName()); 219PackageFileName = Path.GetFileNameWithoutExtension(packagePath); 252File.Copy(PackagePath, Path.Combine(DestinationDirectory, Path.GetFileName(PackagePath)), overwrite: true); 260Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "_rels")); 261Utils.DeleteDirectory(Path.Combine(DestinationDirectory, "package")); 263Utils.DeleteFile(Path.Combine(DestinationDirectory, ".signature.p7s")); 264Utils.DeleteFile(Path.Combine(DestinationDirectory, "[Content_Types].xml")); 265Utils.DeleteFile(Path.Combine(DestinationDirectory, $"{Id}.nuspec"));
WorkloadTemplateBase.cs (2)
78SourcePath = Path.Combine(OutputPath, "src"); 79IntermediateOutputPath = Path.Combine(OutputPath, "obj");
Microsoft.DotNet.Cli.CoreUtils (14)
DotnetFiles.cs (2)
18public static string VersionFile => Path.GetFullPath(Path.Combine(SdkPaths.SdkDirectory, ".version"));
PathUtilities.cs (1)
9=> EnsureTrailingCharacter(path, Path.DirectorySeparatorChar);
Resources\ManagedAssemblyStringResourceSource.cs (1)
28AssemblyFile = Path.GetFullPath(assemblyFile);
Resources\SatelliteStringResourceManager.cs (4)
103: this(baseName, assembly, Path.Join(AppContext.BaseDirectory, "resources")) 699localizedRoot = Path.GetFullPath(localizedRoot); 987string resourcesPath = Path.Join(resourcesRoot, culture.Name, _resourceName); 1015string satellitePath = Path.Join(satelliteRoot, culture.Name, satelliteFileName);
Resources\StringResourceManager.cs (2)
200string fullPath = Path.GetFullPath(assemblyFile); 375public virtual string BaseName => _baseName ??= Path.GetFileNameWithoutExtension((string)_source);
SdkPaths.cs (4)
74string? assemblyDirectory = Path.GetDirectoryName(typeof(SdkPaths).Assembly.Location); 86string? root = Path.GetPathRoot(path); 89&& (last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar)
Microsoft.DotNet.Cli.Definitions (17)
Commands\Test\TestCommandDefinition.cs (2)
112string globalJsonPath = Path.Combine(directory, "global.json"); 118directory = Path.GetDirectoryName(directory);
Commands\Workload\WorkloadElevateCommandDefinition.cs (1)
12/// the client's <see cref="System.IO.Path.GetTempPath"/>. Used by the elevated server to accept
Common\TargetPlatformOptions.cs (5)
115var sdkPath = dotnetRootPath is not null ? Path.Combine(dotnetRootPath, "sdk") : "sdk"; 128string productVersionPath = Path.Combine(sdkPath, productVersion ?? string.Empty, ridFileName); 140Version = NuGetVersion.TryParse(Path.GetFileName(path), out NuGetVersion? version) ? version : null 142.Where(sdk => sdk.Version is not null && File.Exists(Path.Combine(sdk.Path, ridFileName))) 147return latestSdkPath is null ? productVersionPath : Path.Combine(latestSdkPath, ridFileName);
src\sdk\src\Resolvers\Microsoft.DotNet.NativeWrapper\EnvironmentProvider.cs (5)
10private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 33.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 46.Select(p => Path.Combine(p, commandNameWithExtension)) 67if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileName(dotnetExe) 106var dotnetDirectory = Path.GetDirectoryName(dotnetExe);
Utilities\CommandDirectoryContext.cs (2)
19? Path.GetFullPath(path, _basePath) 20: Path.GetFullPath(path);
Utilities\OptionExtensions.cs (2)
50if (!Path.EndsInDirectorySeparator(argVal)) 52argVal += Path.DirectorySeparatorChar;
Microsoft.DotNet.Cli.InternalMicrosoft (10)
Internal\InternalMicrosoftDetectionContext.cs (4)
267if (Path.IsPathFullyQualified(command)) 281foreach (var directory in path.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries)) 285var candidate = Path.Combine(directory.Trim(), command); 286if (Path.HasExtension(candidate) || string.IsNullOrEmpty(extension))
InternalMicrosoftDetector.cs (3)
428var directory = Path.GetDirectoryName(_cacheFilePath); 438temporaryPath = Path.Combine(directory, $".{Path.GetFileName(_cacheFilePath)}.{Guid.NewGuid():N}.tmp");
Providers\CopilotCliDetectionProvider.cs (1)
49var path = Path.Combine(context.HomeDirectory, ".copilot", fileName);
Providers\VisualStudioAccountDetectionProvider.cs (2)
27Path.Combine(localAppData, ".IdentityService", "V3AccountStore.json"), 80Path.Combine(localAppDataPath, ".IdentityService", "V3AccountStore.json"),
Microsoft.DotNet.Cli.Utils (55)
DependencyProvider.cs (1)
127using RegistryKey dependentsKey = BaseKey.CreateSubKey(Path.Combine(DependentsKeyPath, dependent), writable: true);
EnvironmentProvider.cs (4)
13private static char[] s_pathSeparator = [Path.PathSeparator]; 63return Path.Combine(_userHomeDirectory.Value, path.Substring(tildeSlash.Length)); 81(p, s) => Path.Combine(p, commandName + s)) 94var commandPath = extensions.Select(e => Path.Combine(rootPath, commandName + e))
FileLockOwnerFinder.Linux.cs (3)
137FileDescriptorHasExclusiveFlock(processId, Path.GetFileName(fileDescriptor))) 189string? executableName = Path.GetFileName(executable?.FullName); 222var fileInfo = new FileInfo(Path.GetFullPath(filePath));
MSBuildForwardingAppWithoutLogging.cs (2)
324return Path.Combine( 343return Path.Combine(
Muxer.cs (6)
43string? rootPath = Path.GetDirectoryName(Path.GetDirectoryName(AppContext.BaseDirectory.TrimEnd(Path.DirectorySeparatorChar))); 46string muxerPathMaybe = Path.Combine(rootPath, muxerFileName); 65if (processPath is not null && !Path.GetFileName(processPath).Equals(muxerFileName, StringComparison.OrdinalIgnoreCase)) 75processPath = Path.Combine(root, muxerFileName);
NuGetSourceConfiguration.cs (6)
36Path.GetDirectoryName(configPath)!, 37Path.GetFileName(configPath)); 144if (!Uri.IsWellFormedUriString(source, UriKind.Absolute) && !Path.IsPathRooted(source)) 153=> Path.GetFullPath(Path.IsPathRooted(path) ? path : Path.Combine(basePath, path));
PathUtility.cs (33)
19return string.Equals(Path.GetFileName(path), "_._", StringComparison.Ordinal); 32dir = Path.GetFullPath(dir); 34candidate = Path.GetFullPath(candidate); 43if (lastChar == Path.DirectorySeparatorChar) 54string? directory = Path.GetDirectoryName(filePath); 92var dir = Path.GetDirectoryName(path); 101dir = Path.GetDirectoryName(dir); 116return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); 124if (!Path.IsPathRooted(path1) || !Path.IsPathRooted(path2)) 129return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, true); 138return GetRelativePath(path1, path2, Path.DirectorySeparatorChar, false); 161if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare)) 173var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 174var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 246path = path.TrimEnd(Path.DirectorySeparatorChar); 247return path.Substring(Path.GetDirectoryName(path)?.Length ?? 0).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 262if (Path.DirectorySeparatorChar == '/') 279var components = path.Split(Path.DirectorySeparatorChar); 296result += Path.DirectorySeparatorChar; 301result = Path.Combine(result, component); 305if (path[path.Length - 1] == Path.DirectorySeparatorChar) 307result += Path.DirectorySeparatorChar; 322return Path.GetExtension(filePath).Equals(extension, comparison); 336return Path.GetFullPath(path); 368return string.IsNullOrEmpty(path) || Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 373return Regex.Escape(Path.DirectorySeparatorChar.ToString()); 382var filePath = Path.Combine(directory.FullName, relativeFilePath);
Microsoft.DotNet.CMake.Sdk (13)
parent\Common\Internal\AbsolutePathExtensions.cs (1)
46new(Path.GetFullPath(path.Value));
src\CMakeBuildMutex.cs (4)
59string directory = Path.Combine(taskEnvironment.GetAbsolutePath(path).GetCanonicalForm().Value, ".cmake"); 61string identityDirectory = Path.Combine(directory, "Microsoft.DotNet.CMake.Sdk.mutex"); 63AbsolutePath identityFile = taskEnvironment.GetAbsolutePath(Path.Combine(identityDirectory, "identity")); 70AbsolutePath temporaryFile = taskEnvironment.GetAbsolutePath(Path.Combine(temporaryDirectory, "identity"));
src\CreateCMakeFileApiQuery.cs (2)
31string queryDir = Path.Combine(CMakeOutputDir, ".cmake", "api", "v1", "query", "client-Microsoft.DotNet.CMake.Sdk"); 34string queryFile = Path.Combine(queryDir, "codemodel-v2");
src\GetCMakeArtifactsFromFileApi.cs (6)
60string replyDir = Path.Combine(CMakeOutputDir, ".cmake", "api", "v1", "reply"); 103string codeModelFile = Path.Combine(replyDir, index.Reply.ClientReply.CodemodelV2.JsonFile); 168if (!Path.IsPathRooted(dirSource)) 170dirSource = Path.Combine(sourceRoot, dirSource); 197string targetFile = Path.Combine(replyDir, target.JsonFile); 217string fullPath = Path.Combine(CMakeOutputDir, artifact.Path);
Microsoft.DotNet.CodeAnalysis (2)
Analyzers\PinvokeAnalyzer.cs (2)
30_allowedPinvokeFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzer_", StringComparison.OrdinalIgnoreCase) >= 0); 31_exceptionFile = obj.Options.AdditionalFiles.FirstOrDefault(f => Path.GetFileName(f.Path).IndexOf("PinvokeAnalyzerExceptionList.analyzerdata", StringComparison.OrdinalIgnoreCase) >= 0);
Microsoft.DotNet.Configurer (11)
AspNetCertificateSentinel.cs (1)
16private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL);
CliFolderPathCalculator.cs (5)
18Path.Combine(new DirectoryInfo(AppContext.BaseDirectory).Parent?.FullName ?? string.Empty, "NuGetFallbackFolder"); 20public static string ToolsShimPath => Path.Combine(DotnetUserProfileFolderPath, ToolsShimFolderName); 28Path.Combine(DotnetProfileDirectoryName, ToolsShimFolderName)); 41Path.Combine(DotnetHomePath, DotnetProfileDirectoryName); 43public static string ToolsResolverCachePath => Path.Combine(DotnetUserProfileFolderPath, ToolsResolverCacheFolderName);
FirstTimeUseNoticeSentinel.cs (1)
16private string SentinelPath => Path.Combine(_dotnetUserProfileFolderPath, SENTINEL);
IFileExtensions.cs (1)
17var parentDirectory = Path.GetDirectoryName(filePath) ?? string.Empty;
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
ToolPackageFolderPathCalculator.cs (1)
11return Path.Combine(toolsShimPath, NestedToolPackageFolderName);
UserLevelCacheWriter.cs (1)
72return Path.Combine(_dotnetUserProfileFolderPath, $"{Product.Version}_{cacheKey}.dotnetUserLevelCache");
Microsoft.DotNet.GenFacades (6)
GenPartialFacadeSourceGenerator.cs (3)
36string[] distinctSeeds = seeds.Select(seed => Path.GetFullPath(seed)).Distinct().ToArray(); 37string[] seedNames = distinctSeeds.Select(seed => Path.GetFileName(seed)).ToArray(); 150AddTypeToTable(typeTable, type, Path.GetFileName(assembly));
RoslynBuildTask.cs (3)
45Assembly asm = loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{name.Name}.dll")); 55loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisCsharpName}.dll")) : 56loadFromPath(Path.Combine(RoslynAssembliesPath!, $"{codeAnalysisName}.dll"));
Microsoft.DotNet.HotReload.Utils.Generator (5)
Config.cs (1)
57public string LiveCodingWatchDir { get => Path.GetDirectoryName(ProjectPath) ?? "."; }
DocResolver.cs (1)
39var absolutePath = Path.GetFullPath(relativePath);
Script\Json\Parsing.cs (3)
22_absDir = System.IO.Path.GetDirectoryName(System.IO.Path.GetFullPath(path))!; 40return System.IO.Path.GetFullPath(relativePath, _absDir);
Microsoft.DotNet.HotReload.Watch (83)
AppModels\HotReloadAppModel.cs (2)
15=> Path.Combine(Path.GetDirectoryName(typeof(HotReloadAppModel).Assembly.Location)!, "hotreload", targetFramework, assemblyName + ".dll");
AppModels\MobileAppModel.cs (1)
22var keyDirectory = Path.Combine(
Aspire\AspireServiceFactory.cs (1)
244WorkingDirectory = Path.GetDirectoryName(projectLaunchInfo.ProjectPath) ?? throw new InvalidOperationException(),
Build\BuildReporter.cs (2)
32? $"{file.FilePath}{Path.PathSeparator}{string.Join(Path.PathSeparator, file.StaticWebAssetRelativeUrl)}"
Build\EvaluationResult.cs (5)
170!Path.GetExtension(projectInstance.FullPath).Equals(".csproj", PathUtilities.OSSpecificPathComparison) || 174var projectDirectory = Path.GetDirectoryName(projectPath)!; 178StaticWebAssetsManifest.TryParseFile(Path.Combine(outputDir, StaticWebAsset.ManifestFileName), logger) is { } manifest) 211var filePath = Path.GetFullPath(Path.Combine(projectDirectory, relativePath));
Build\FilePathExclusions.cs (3)
53if (Path.DirectorySeparatorChar == '/') 58outputDirectories.Add(Path.TrimEndingDirectorySeparator(Path.GetFullPath(dir)));
Build\ProjectGraphUtilities.cs (5)
20=> $"{Path.GetFileNameWithoutExtension(project.FullPath)} ({project.GetTargetFramework()})"; 59=> project.GetPropertyValue(PropertyNames.TargetPath) is { Length: >0 } path ? Path.GetDirectoryName(Path.Combine(project.Directory, NormalizeSeparators(path))) : null; 65=> Path.DirectorySeparatorChar == '\\' ? path : path.Replace('\\', '/'); 68=> project.GetPropertyValue(PropertyNames.IntermediateOutputPath) is { Length: >0 } path ? Path.Combine(project.Directory, NormalizeSeparators(path)) : null;
Build\ProjectRepresentation.cs (2)
32=> Path.GetDirectoryName(ProjectOrEntryPointFilePath)!; 35=> string.Equals(Path.GetExtension(projectOrEntryPointFilePath), ".csproj", StringComparison.OrdinalIgnoreCase)
Context\EnvironmentOptions.cs (5)
82? Path.GetFullPath(Path.Combine(SdkDirectory, "..", "..", "dotnet" + PathUtilities.ExecutableExtension)) 94Debug.Assert(Path.GetFileName(path) == $"dotnet{PathUtilities.ExecutableExtension}"); 100? $"{Path.Combine(WorkingDirectory, options.BinaryLogPath)[..^".binlog".Length]}-dotnet-watch.{operationName}.{Path.GetFileName(projectPath)}.{Interlocked.Increment(ref _uniqueLogId)}.binlog"
FileWatcher\DirectoryWatcher.cs (1)
32if (watchedFileNames.Count > 0 && !watchedFileNames.Contains(Path.GetFileName(fullPath)))
FileWatcher\EventBasedDirectoryWatcher.cs (1)
68var oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1));
FileWatcher\FileWatcher.cs (2)
76group path by PathUtilities.EnsureTrailingSlash(PathUtilities.NormalizeDirectorySeparators(Path.GetDirectoryName(path)!)) 78select (g.Key, containingDirectories ? [] : g.Select(Path.GetFileName).ToImmutableHashSet(PathUtilities.OSSpecificPathComparer));
HotReload\HotReloadDotNetWatcher.cs (12)
615var extension = Path.GetExtension(filePath); 620|| string.Equals(Path.GetFileName(filePath), "global.json", PathUtilities.OSSpecificPathComparison); 643var dirUrl = match.WildcardDirectoryPartMatchGroup.Replace(Path.DirectorySeparatorChar, '/'); 724var outputDir = Path.Combine(Path.GetDirectoryName(projectPath)!, relativeOutputDir); 731var targetPath = Path.Combine(outputDir, item.GetMetadata(MetadataNames.TargetPath)); 741var directory = Path.GetDirectoryName(targetPath); 826if (Path.GetExtension(path) == ".binlog") 845=> Path.GetFileName(dir).StartsWith('.'); 1330WorkingDirectory = Path.GetDirectoryName(path), 1380return $".{(relativePath.StartsWith(Path.DirectorySeparatorChar) ? string.Empty : Path.DirectorySeparatorChar)}{relativePath}";
Process\ProcessSpec.cs (1)
23=> Path.GetFileNameWithoutExtension(Executable);
src\sdk\src\Dotnet.Watch\HotReloadClient\DefaultHotReloadClient.cs (1)
191environmentBuilder.InsertListItem(AgentEnvironmentVariables.DotNetStartupHooks, startupHookPath, Path.PathSeparator);
src\sdk\src\Dotnet.Watch\HotReloadClient\Utilities\PathExtensions.cs (2)
14=> Path.IsPathFullyQualified(path); 17=> Path.Join(path1, path2);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\BrowserRefreshServer.cs (2)
136builder.InsertListItem(MiddlewareEnvironmentVariables.DotNetStartupHooks, middlewareAssemblyPath, Path.PathSeparator); 137builder.InsertListItem(MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssemblies, Path.GetFileNameWithoutExtension(middlewareAssemblyPath), MiddlewareEnvironmentVariables.AspNetCoreHostingStartupAssembliesSeparator);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\SharedSecretBuildOutputs.cs (12)
50_publicKeyPath = Path.Combine(directory, publicKeyFileName); 51_privateKeyPath = Path.Combine(directory, privateKeyFileName); 58=> new(Path.Combine(intermediateOutputDirectory, DirectoryName), PublicKeyFileName, PrivateKeyFileName); 89return new SharedSecretBuildOutputs(Path.Combine(intermediateOutputDirectory, DirectoryName), PublicKeyFileName, PrivateKeyFileName); 152throw Fail($"'{Path.GetFileName(_privateKeyPath)}' does not contain the private key components"); 177throw Fail($"'{Path.GetFileName(path)}' was not produced by the build"); 181throw Fail($"'{Path.GetFileName(path)}' was not produced by the build"); 185throw Fail($"'{Path.GetFileName(path)}' could not be read ({e.GetType().Name})"); 194throw Fail($"'{Path.GetFileName(path)}' is not a valid JSON document"); 200var name = Path.GetFileName(path); 236throw Fail($"'{Path.GetFileName(path)}' does not contain '{propertyName}'"); 245throw Fail($"'{propertyName}' in '{Path.GetFileName(path)}' is not base64");
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAsset.cs (9)
13private static readonly StringComparison OSSpecificPathComparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 34var sourceProjectName = Path.GetFileNameWithoutExtension(containingProjectFilePath); 60=> Path.GetFileName(filePath).IndexOf(".HotReload.", StringComparison.Ordinal) >= 0 && 61string.Equals(Path.GetFileName(Path.GetDirectoryName(filePath)), "HotReload", OSSpecificPathComparison); 69var fileName = Path.GetFileName(filePath); 86var webRoot = "wwwroot" + Path.DirectorySeparatorChar; 87var webRootDir = Path.Combine(Path.GetDirectoryName(containingProjectFilePath)!, webRoot);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetsManifest.cs (4)
97if (Path.GetFileName(path).Equals(bundleFileName, StringComparison.Ordinal)) 165if (Path.IsPathFullyQualified(root)) 208urlToPathMap[url] = Path.Join(root, node.Asset.SubPath.Replace('/', Path.DirectorySeparatorChar));
Utilities\PathUtilities.cs (9)
8public static readonly IEqualityComparer<string?> OSSpecificPathComparer = Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 9public static readonly StringComparison OSSpecificPathComparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 15=> (path is [.., var last] && last != Path.DirectorySeparatorChar) ? path + Path.DirectorySeparatorChar : path; 18=> path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); 27fullPath = Path.TrimEndingDirectorySeparator(fullPath); 36var containingDir = Path.GetDirectoryName(fullPath); 50var containingDir = Path.GetDirectoryName(path);
Utilities\TemporaryFileManager.cs (1)
68var path = Path.Combine(_directory, Interlocked.Increment(ref _uniqueFileId) + extension);
Microsoft.DotNet.HotReload.WebAssembly.Browser (3)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (3)
318var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 321var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 324return string.Join(Path.PathSeparator, updatedValues);
Microsoft.DotNet.ILAssembler (2)
Actions\GrammarActions.BuildImage.cs (1)
763? Path.ChangeExtension(_options.OutputFileName, ".pdb")
PathMap.cs (1)
195: Path.DirectorySeparatorChar;
Microsoft.DotNet.InternalAbstractions (12)
DirectoryPath.cs (8)
16if (!Path.IsPathRooted(value)) 18value = Path.GetFullPath(value); 30return new DirectoryPath(Path.Combine(insertValueInFront)); 35return new FilePath(Path.Combine(Value, fileName)); 93CopyDirectoryAcrossMounts(dir, Path.Combine(destPath, Path.GetFileName(dir))); 98new FileInfo(file).CopyTo(Path.Combine(destPath, Path.GetFileName(file)), true);
FilePath.cs (3)
16if (!Path.IsPathRooted(value)) 18value = Path.GetFullPath(value); 31return new DirectoryPath(Path.GetDirectoryName(Value)!);
TemporaryDirectory.cs (1)
14DirectoryPath = Path.Combine(CreateSubdirectory());
Microsoft.DotNet.MacOsPkg.Core (13)
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 (6)
60var xml = XElement.Load(Path.Combine(dstPath, "Distribution")); 67string packageName = Path.Combine(dstPath, package.Value.Substring(1)); 68string tempDest = Path.Combine(dstPath, Path.GetRandomFileName()); 191Path.GetFullPath(Utilities.FindInPath("Payload", searchPath, isDirectory, searchOption: SearchOption.TopDirectoryOnly) 203string full_path = Path.GetFullPath(inputPath);
Utilities.cs (3)
12Path.GetExtension(path).Equals(".pkg"); 15Path.GetExtension(path).Equals(".app"); 37string? parent = Path.GetDirectoryName(path);
Microsoft.DotNet.NativeWrapper (8)
EnvironmentProvider.cs (5)
10private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 33.Split(new char[] { Path.PathSeparator }, options: StringSplitOptions.RemoveEmptyEntries) 46.Select(p => Path.Combine(p, commandNameWithExtension)) 67if (string.IsNullOrEmpty(dotnetExe) || !Path.GetFileName(dotnetExe) 106var dotnetDirectory = Path.GetDirectoryName(dotnetExe);
src\sdk\src\Common\HostFxrPathResolver.cs (3)
41string fxrDir = Path.Combine(dotnetRoot, "host", "fxr"); 54SemanticVersion.TryParse(Path.GetFileName(path), out SemanticVersion? version); 77string hostfxrPath = Path.Combine(latestFxr, hostfxrName);
Microsoft.DotNet.NuGetRepack.Tasks (5)
src\NuGetVersionUpdater.cs (2)
107tempPathOpt = new FileInfo(Path.Combine(tempDirectoryOpt.FullName, Guid.NewGuid().ToString())); 361string finalPath = Path.Combine(outDirectory.FullName, package.Id + "." + package.NewVersion + ".nupkg");
src\ReplacePackageParts.cs (2)
117string tempPackagePath = Path.Combine(tempDirectory.FullName, "package.nupkg"); 232NewPackage = Path.Combine(DestinationFolder, packageId + "." + packageVersion + ".nupkg");
src\UpdatePackageVersionTask.cs (1)
87File.WriteAllLines(Path.Combine(outputDirectory.FullName, "PreReleaseDependencies.txt"), preReleaseDependencies.Distinct());
Microsoft.DotNet.PackageTesting (5)
VerifyClosure.cs (3)
104otherFiles.Add(Path.GetFileName(file)); 111var fileName = Path.GetFileName(assemblyInfo.Path); 112var existingFileName = Path.GetFileName(existingInfo.Path);
VerifyTypes.cs (2)
109var fileName = Path.GetFileName(assemblyInfo.Path); 110var existingFileName = Path.GetFileName(existingInfo.Path);
Microsoft.DotNet.PackageValidation (2)
ApiCompatRunnerExtensions.cs (1)
100return new MetadataInformation(Path.GetFileName(item.Path), item.Path, package.PackagePath, assemblyReferences, displayString);
Package.cs (1)
130if (!File.Exists(Path.GetFullPath(packagePath)))
Microsoft.DotNet.ProjectTools (27)
LaunchSettings\ExecutableLaunchProfileParser.cs (3)
72workingDirectory = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(launchSettingsPath)!, expandedValue));
LaunchSettings\LaunchSettings.cs (5)
24=> Path.Combine(directoryPath, propertiesDirectoryName, "launchSettings.json"); 27=> Path.Join(directoryPath, $"{projectNameWithoutExtension}.run.json"); 31var buildPathContainer = Path.GetDirectoryName(projectOrEntryPointFilePath); 37var propsDirectory = string.Equals(Path.GetExtension(projectOrEntryPointFilePath), ".vbproj", StringComparison.OrdinalIgnoreCase) 44string appName = Path.GetFileNameWithoutExtension(projectOrEntryPointFilePath);
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\ExternalHelpers.cs (2)
25=> Path.GetRelativePath(relativeTo, path); 28=> Path.IsPathFullyQualified(path);
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (5)
1076var sourceDirectory = Path.GetDirectoryName(sourcePath) 1079var resolvedProjectPath = Path.Combine(sourceDirectory, resolvedName.Replace('\\', '/')); 1204var sourceDirectory = Path.GetDirectoryName(sourcePath) 1207var resolvedFilePath = Path.GetFullPath(Path.Combine(sourceDirectory, Name.Replace('\\', '/')));
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\VirtualProjectBuilder.cs (12)
114string fileName = Path.GetFileNameWithoutExtension(entryPointFileFullPath); 162? Path.GetTempPath() 170return Path.Combine(directory, "dotnet", dotNetSubdirectory ?? "runfile"); 178return Path.Combine(GetTempSubdirectory(dotNetSubdirectory), name); 260var fullPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(includeOrExcludeDirective.Info.SourceFile.Path)!, expandedPath)); 351var entryPointDirectory = Path.GetDirectoryName(EntryPointFileFullPath)!; 411var compilePath = Path.GetFullPath(Path.Combine( 649<AssemblyName>{EscapeValue(Path.GetFileNameWithoutExtension(entryPointFilePath))}</AssemblyName> 943var entryPointDirectory = Path.GetDirectoryName(entryPointFilePath) ?? "";
Microsoft.DotNet.SdkResolver (1)
NETCoreSdkResolver.cs (1)
137string minimumVersionFilePath = Path.Combine(netcoreSdkDir, "minimumMSBuildVersion");
Microsoft.DotNet.SharedFramework.Sdk (16)
parent\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (3)
104otherFiles.Add(Path.GetFileName(file)); 111var fileName = Path.GetFileName(assemblyInfo.Path); 112var existingFileName = Path.GetFileName(existingInfo.Path);
parent\Microsoft.DotNet.PackageTesting\VerifyTypes.cs (2)
109var fileName = Path.GetFileName(assemblyInfo.Path); 110var existingFileName = Path.GetFileName(existingInfo.Path);
src\CreateFrameworkListFile.cs (5)
92Filename = Path.GetFileName(item.ItemSpec), 128string path = Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/'); 180new XAttribute("Culture", Path.GetFileName(Path.GetDirectoryName(path)))); 269Directory.CreateDirectory(Path.GetDirectoryName(TaskEnvironment.GetAbsolutePath(TargetFile)));
src\GeneratePlatformManifestEntriesFromTemplate.cs (2)
35var files = Files.ToLookup(file => Path.GetFileName(file.ItemSpec)).ToDictionary(l => l.Key, l=> l.First()); 54var entryTemplateExtension = Path.GetExtension(entryTemplate.ItemSpec);
src\GenerateSharedFrameworkDepsFile.cs (3)
65string fileName = Path.GetFileName(filePath); 72resourceAssemblies.Add(new ResourceAssembly(Path.Combine(cultureMaybe, fileName), cultureMaybe)); 124var depsFilePath = Path.Combine(IntermediateOutputPath, depsFileName);
src\ValidateFileVersions.cs (1)
34var fileName = Path.GetFileName(file.ItemSpec);
Microsoft.DotNet.SourceBuild.Tasks (12)
src\UsageReport\WritePackageUsageData.cs (8)
158Directory.CreateDirectory(Path.GetDirectoryName(TaskEnvironment.GetAbsolutePath(ProjectAssetsJsonArchiveFile))); 171using (var stream = File.OpenRead(Path.Combine(AbsoluteRootDir, relativePath))) 192using (var file = File.OpenRead(Path.Combine(AbsoluteRootDir, assetFile))) 262Directory.CreateDirectory(Path.GetDirectoryName(TaskEnvironment.GetAbsolutePath(DataFile))); 286(path[path.Length - 1] == Path.DirectorySeparatorChar || 287path[path.Length - 1] == Path.AltDirectorySeparatorChar) 289: path + Path.DirectorySeparatorChar; 300return absolutePath.Substring(root.Length).Replace(Path.DirectorySeparatorChar, '/');
src\UsageReport\WriteUsageReports.cs (3)
113poisonNupkgFilenames.Add(Path.GetFileNameWithoutExtension(segments[1])); 176Path.Combine(outputDirectory, "annotated-usage.xml"), 218string filename = Path.GetFileName(snapshot.Path);
src\WriteBuildOutputProps.cs (1)
84Directory.CreateDirectory(Path.GetDirectoryName(TaskEnvironment.GetAbsolutePath(OutputPath)));
Microsoft.DotNet.TemplateLocator (55)
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString); 387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString); 392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 480string manifestId = Path.GetFileName(manifestDirectory); 488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 491return (directory: dir, version: Path.GetFileName(dir)); 500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 526.Select(dir => Path.GetFileName(dir)) 532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 639var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 668string globalJsonPath = Path.Combine(directory, "global.json"); 673directory = Path.GetDirectoryName(directory);
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine( 40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState"); 44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.Localization.cs (4)
26var catalog = Path.Combine(localizationDir, $"WorkloadManifest.{culture.Name}.json"); 55var cultureName = Path.GetFileNameWithoutExtension(filePath).Substring("WorkloadManifest.".Length); 64string manifestDir = Path.GetDirectoryName(manifestFilePath) ?? throw new ArgumentException(nameof(manifestFilePath)); 65string localizationDir = Path.Combine(manifestDir, "localize");
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt"); 48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray(); 329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion); 333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (1)
100if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
src\sdk\src\Cli\dotnet\Installer\Windows\TrustedMachinePath.cs (6)
58public static string ProgramDataDotnetRoot { get; } = Path.Combine( 67string fullPath = Path.GetFullPath(path); 68string fullRoot = Path.GetFullPath(root).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 71fullPath.StartsWith(fullRoot + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase);
src\sdk\src\Common\PathComponentUtilities.cs (3)
16!Path.IsPathRooted(value) && 17value.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 && 18(Path.DirectorySeparatorChar != '\\' ||
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
Microsoft.DotNet.VersionTools.Cli (1)
VersionTrimmingOperation.cs (1)
45if (assets.Any(a => Path.GetExtension(a) != ".nupkg"))
Microsoft.DotNet.XliffTasks (46)
Model\Document.cs (2)
70string tempPath = Path.Combine(path.Directory.FullName, 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);
parent\Common\Internal\AbsolutePathExtensions.cs (1)
46new(Path.GetFullPath(path.Value));
Tasks\GatherTranslatedSource.cs (10)
53Path.DirectorySeparatorChar, 54Path.AltDirectorySeparatorChar 67string relativePath = Path.GetFileName(translatedFullPath); 70relativePath = Path.Combine(language, relativePath); 79string linkDirectory = Path.GetDirectoryName(link); 80link = Path.Combine(linkDirectory, relativePath); 101string logicalExtension = Path.GetExtension(logicalName); 102logicalName = Path.ChangeExtension(logicalName, $".{language}{logicalExtension}"); 112string sourceDirectory = Path.GetDirectoryName(xlf.GetMetadataOrThrow(MetadataKey.XlfSource)); 115dependentUpon = TaskEnvironment.GetAbsolutePath(Path.Combine(sourceDirectory, dependentUpon)).GetCanonicalForm();
Tasks\GatherXlf.cs (5)
63translatedFileName = Path.GetFileNameWithoutExtension(source.ItemSpec); 68string extension = Path.GetExtension(source.ItemSpec); 71Path.Combine(TranslatedOutputDirectory, language, $"{translatedFileName}{extension}") : 72Path.Combine(TranslatedOutputDirectory, $"{translatedFileName}.{language}{extension}"); 77$"Two or more source files to be translated in the same project are named {Path.GetFileName(sourceDocumentPath)}. " +
Tasks\SortXlf.cs (1)
48Directory.CreateDirectory(Path.GetDirectoryName(xlfAbsolutePath));
Tasks\TransformTemplates.cs (14)
70string templateName = Path.GetFileNameWithoutExtension(template.ItemSpec); 72string templateDirectory = Path.GetDirectoryName(templatePath); 77? Path.Combine(TranslatedOutputDirectory, $"{templateName}.default.1033") 78: Path.Combine(TranslatedOutputDirectory, $"{templateName}.{language}"); 80string cultureSpecificTemplateFile = Path.Combine(localizedTemplateDirectory, Path.GetFileName(template.ItemSpec)); 86string projectFileFullPath = Path.Combine(templateDirectory, projectNode.Attribute("File").Value); 87File.Copy(TaskEnvironment.GetAbsolutePath(projectFileFullPath), TaskEnvironment.GetAbsolutePath(Path.Combine(localizedTemplateDirectory, Path.GetFileName(projectNode.Attribute("File").Value))), overwrite: true); 93string templateItemFullPath = Path.Combine(templateDirectory, templateItem.Value); 94string templateItemDestinationPath = Path.Combine(localizedTemplateDirectory, templateItem.Value); 112Path.GetFileNameWithoutExtension(unstructuredResource.ItemSpec), 115Path.GetExtension(unstructuredResource.ItemSpec)); 116File.Copy(TaskEnvironment.GetAbsolutePath(Path.Combine(TranslatedOutputDirectory, localizedFileName)), templateItemDestinationAbsolutePath, overwrite: true);
Tasks\TranslateSource.cs (1)
42Directory.CreateDirectory(Path.GetDirectoryName(translatedAbsolutePath));
Tasks\UpdateXlf.cs (1)
75Directory.CreateDirectory(Path.GetDirectoryName(absoluteXlfPath));
Tasks\XlfTask.cs (5)
111string directory = Path.GetDirectoryName(sourcePath); 112string filename = Path.GetFileNameWithoutExtension(sourcePath); 113string extension = Path.GetExtension(sourcePath); 127return Path.Combine(directory, "xlf", filename + xlfExtension); 132return $"../{Path.GetFileName(sourcePath)}";
Microsoft.Extensions.AI (2)
Files\LoggingHostedFileClient.cs (1)
62fileName ??= content is FileStream fs ? Path.GetFileName(fs.Name) : null;
Files\OpenTelemetryHostedFileClient.cs (1)
138fileName ??= content is FileStream fs ? Path.GetFileName(fs.Name) : null;
Microsoft.Extensions.AI.Abstractions (6)
Contents\DataContent.cs (3)
175string? fileName = Path.GetFileName(filePath); 225name = Path.GetFileName(Name); 233path = path.Length == 0 ? name! : Path.Combine(path, name);
Files\HostedFileClientExtensions.cs (3)
69string fileName = Path.GetFileName(filePath); 114fileName = Path.GetFileName(downloadStream.FileName); 123finalPath = destinationPath.Length == 0 ? fileName! : Path.Combine(destinationPath, fileName);
Microsoft.Extensions.AI.Abstractions.Tests (64)
Contents\DataContentTests.cs (49)
327string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.json"); 338Assert.Equal(Path.GetFileName(tempPath), content.Name); 354string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.bin"); 365Assert.Equal(Path.GetFileName(tempPath), content.Name); 381string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.unknownextension"); 407string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.png"); 419Assert.Equal(Path.GetFileName(tempPath), content.Name); 470string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.bin"); 497string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}"); 527string tempDir = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}"); 529string expectedPath = Path.Combine(tempDir, "myfile.json"); 556string tempDir = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}"); 585string tempPath = Path.Combine(Path.GetTempPath(), $"test_{Guid.NewGuid()}.txt"); 613string expectedAbsolute = Path.Combine(cwdBefore, filename); 621Assert.Equal(filename, Path.GetFileName(savedPath)); 649Assert.Equal(content.Name, Path.GetFileName(savedPath)); 671string expectedAbsolute = Path.Combine(cwdBefore, content.Name!); 679Assert.Equal(content.Name, Path.GetFileName(savedPath)); 721string tempDir = Path.Combine(Path.GetTempPath(), $"test_subdir_{Guid.NewGuid()}"); 722string subDir = Path.Combine(tempDir, "subdir"); 727string filePath = Path.Combine(subDir, "nested.html"); 754string tempDir = Path.Combine(Path.GetTempPath(), $"test_dir_noname_{Guid.NewGuid()}"); 781string tempPath = Path.Combine(Path.GetTempPath(), $"test_cancel_{Guid.NewGuid()}.txt"); 812string tempPath = Path.Combine(Path.GetTempPath(), $"test_save_cancel_{Guid.NewGuid()}.bin"); 852string tempDir = Path.Combine(Path.GetTempPath(), $"test_dir_name_{Guid.NewGuid()}"); 854string expectedPath = Path.Combine(tempDir, content.Name); 880string tempDir = Path.Combine(Path.GetTempPath(), $"test_nonexist_{Guid.NewGuid()}"); 882string filePath = Path.Combine(tempDir, "newfile"); 909string tempPath = Path.Combine(Path.GetTempPath(), $"test_large_{Guid.NewGuid()}.bin"); 938string tempPath = Path.Combine(Path.GetTempPath(), $"test_save_large_{Guid.NewGuid()}.bin"); 961string tempPath = Path.Combine(Path.GetTempPath(), $"test_existing_{Guid.NewGuid()}.bin");
Files\HostedFileClientExtensionsTests.cs (15)
63var tempFile = Path.Combine(Path.GetTempPath(), $"test-{Guid.NewGuid()}.txt"); 89Assert.Equal(Path.GetFileName(tempFile), capturedFileName); 123var tempFile = Path.Combine(Path.GetTempPath(), $"download-{Guid.NewGuid()}.bin"); 150var tempDir = Path.Combine(Path.GetTempPath(), $"dldir-{Guid.NewGuid()}"); 162Assert.Equal(Path.Combine(tempDir, "result.bin"), savedPath); 181var tempDir = Path.Combine(Path.GetTempPath(), $"dldir2-{Guid.NewGuid()}"); 193Assert.Equal(Path.Combine(tempDir, $"file-id-fallback{extension}"), savedPath); 216string expectedAbsolute = Path.Combine(cwdBefore, fileName); 224Assert.False(Path.IsPathRooted(savedPath)); 238var tempFile = Path.Combine(Path.GetTempPath(), $"existing-{Guid.NewGuid()}.bin");
Microsoft.Extensions.AI.Evaluation.Console (7)
Commands\ReportCommand.cs (1)
120string? outputPath = Path.GetDirectoryName(outputFilePath);
Telemetry\DeviceIdHelper.cs (5)
91string cacheFilePath = Path.Combine(cacheFileDirectoryPath, CacheFileName); 123string cacheFilePath = Path.Combine(cacheFileDirectoryPath, CacheFileName); 141cacheFileDirectoryPath = Path.Combine(userProfilePath, ".cache"); 145cacheFileDirectoryPath = Path.Combine(xdgCacheHome, "Microsoft", "DeveloperTools"); 161Path.Combine(userProfilePath, "Library", "Application Support", "Microsoft", "DeveloperTools");
Telemetry\TelemetryConstants.cs (1)
135: Path.Combine(homeDirectoryPath, ".dotnet", $"{Constants.Version}.aieval.dotnetFirstUseSentinel");
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
ResultsTests.cs (3)
31Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()),
Microsoft.Extensions.AI.Evaluation.Reporting (26)
Storage\DiskBasedReportingConfiguration.cs (1)
80storageRootPath = Path.GetFullPath(storageRootPath);
Storage\DiskBasedResponseCache.cs (6)
47storageRootPath = Path.GetFullPath(storageRootPath); 52Path.Combine(cacheRootPath, scenarioName, iterationName)); 288=> Path.Combine(storageRootPath, "cache"); 291=> Path.Combine(keyPath, "entry.json"); 294=> Path.Combine(keyPath, "contents.data"); 300string keyPath = PathValidation.EnsureWithinRoot(_iterationPath, Path.Combine(_iterationPath, key));
Storage\DiskBasedResultStore.cs (12)
48storageRootPath = Path.GetFullPath(storageRootPath); 49_resultsRootPath = Path.Combine(storageRootPath, "results"); 102Path.Combine(_resultsRootPath, result.ExecutionName, result.ScenarioName))); 106var resultFile = new FileInfo(Path.Combine(resultDir.FullName, $"{result.IterationName}.json")); 139Path.Combine(_resultsRootPath, executionName))); 152Path.Combine(_resultsRootPath, executionName, scenarioName))); 165Path.Combine(_resultsRootPath, executionName, scenarioName, $"{iterationName}.json"))); 262yield return Path.GetFileNameWithoutExtension(resultFile.Name); 293Path.Combine(_resultsRootPath, executionName))); 326var scenarioDir = new DirectoryInfo(Path.Combine(executionDir.FullName, scenarioName)); 351.OrderBy(f => Path.GetFileNameWithoutExtension(f.Name), IterationNameComparer.Default); 362var resultFile = new FileInfo(Path.Combine(scenarioDir.FullName, $"{iterationName}.json"));
Utilities\PathValidation.cs (7)
16private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars(); 56/// Both paths are canonicalized via <see cref="Path.GetFullPath(string)"/> before comparison. 61string fullRoot = Path.GetFullPath(rootPath); 63string fullResolved = Path.GetFullPath(resolvedPath); 68if (!normalizedRoot.EndsWith(Path.DirectorySeparatorChar, StringComparison.Ordinal) && 69!normalizedRoot.EndsWith(Path.AltDirectorySeparatorChar, StringComparison.Ordinal)) 78normalizedRoot += Path.DirectorySeparatorChar;
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (7)
src\Libraries\Microsoft.Extensions.AI.Evaluation.Reporting\CSharp\Utilities\PathValidation.cs (7)
16private static readonly char[] _invalidFileNameChars = Path.GetInvalidFileNameChars(); 56/// Both paths are canonicalized via <see cref="Path.GetFullPath(string)"/> before comparison. 61string fullRoot = Path.GetFullPath(rootPath); 63string fullResolved = Path.GetFullPath(resolvedPath); 68if (!normalizedRoot.EndsWith(Path.DirectorySeparatorChar, StringComparison.Ordinal) && 69!normalizedRoot.EndsWith(Path.AltDirectorySeparatorChar, StringComparison.Ordinal)) 78normalizedRoot += Path.DirectorySeparatorChar;
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (80)
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)
20string path = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.ResultStoreTests", Path.GetRandomFileName());
DiskBased\PathValidationTests.cs (59)
113string root = Path.Combine(Path.GetTempPath(), "testroot"); 114string child = Path.Combine(root, "sub", "file.txt"); 118Assert.Equal(Path.GetFullPath(child), result); 124string root = Path.Combine(Path.GetTempPath(), "testroot"); 125string child = Path.Combine(root, "a", "b", "c", "d.json"); 129Assert.Equal(Path.GetFullPath(child), result); 135string root = Path.Combine(Path.GetTempPath(), "testroot") + Path.DirectorySeparatorChar; 136string child = Path.Combine(root, "file.txt"); 140Assert.Equal(Path.GetFullPath(child), result); 150string root = Path.Combine(Path.GetTempPath(), "testroot"); 151string escaped = Path.Combine(root, "..", "outside"); 160string root = Path.Combine(Path.GetTempPath(), "testroot", "nested"); 161string escaped = Path.Combine(root, "..", "..", "outside"); 170string root = Path.Combine(Path.GetTempPath(), "testroot"); 171string other = Path.Combine(Path.GetTempPath(), "other", "file.txt"); 181string root = Path.Combine(Path.GetTempPath(), "testroot"); 182string sibling = Path.Combine(Path.GetTempPath(), "testroot-sibling", "file.txt"); 191string root = Path.Combine(Path.GetTempPath(), "testroot"); 195Assert.Equal(Path.GetFullPath(root), result); 205string storagePath = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.PathTests", Path.GetRandomFileName()); 233string storagePath = Path.Combine(Path.GetTempPath(), "M.E.AI.Eval.PathTests", Path.GetRandomFileName()); 272Assert.Equal(Path.GetFullPath(child), result); 320Assert.Equal(Path.GetFullPath(root), result); 338string longRoot = Path.Combine(Path.GetTempPath(), "LongDirectoryName_ForTesting"); 349string longChild = Path.Combine(longRoot, "file.txt"); 353Path.GetFullPath(shortRoot), 354Path.GetFullPath(longRoot), 361Assert.Equal(Path.GetFullPath(longChild), result); 386string longRoot = Path.Combine(Path.GetTempPath(), "LongDirectoryName_ForTesting"); 398string child = Path.Combine(shortRoot, "file.txt"); 399File.WriteAllText(Path.Combine(longRoot, "file.txt"), string.Empty); 403Assert.Equal(Path.GetFullPath(child), result); 421string root = Path.GetTempPath().Replace('\\', '/') + "testroot"; 422string child = Path.Combine(root, "sub", "file.txt"); 426Assert.Equal(Path.GetFullPath(child), result); 432string root = Path.Combine(Path.GetTempPath(), "TestRoot"); 433string child = Path.Combine(Path.GetTempPath(), "testroot", "file.txt"); 439Assert.Equal(Path.GetFullPath(child), result); 459Assert.Equal(Path.GetFullPath(child), result); 484Assert.Equal(Path.GetFullPath(child), result);
ResultStoreTester.cs (10)
72string newExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 111string newExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 131string firstExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 141string secondExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 151string thirdExecutionName = $"Test Execution {Path.GetRandomFileName()}"; 175string executionName = $"Test Execution {Path.GetRandomFileName()}"; 199string executionName0 = $"Test Execution {Path.GetRandomFileName()}"; 200string executionName1 = $"Test Execution {Path.GetRandomFileName()}"; 234string executionName = $"Test Execution {Path.GetRandomFileName()}"; 269string executionName = $"Test Execution {Path.GetRandomFileName()}";
ScenarioRunResultTests.cs (1)
279string? witnessDirectory = Path.GetDirectoryName(witnessPath);
Microsoft.Extensions.AI.OpenAI (4)
OpenAIHostedFileClient.cs (3)
105fileName ??= content is FileStream fs ? Path.GetFileName(fs.Name) : null; 167string containerFileName = path is not null ? Path.GetFileName(path) : fileId; 345string name = file.Path is { } path ? Path.GetFileName(path) : file.Id;
OpenAISpeechToTextClient.cs (1)
193return Path.GetFileName(fileStream.Name);
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIHostedFileClientIntegrationTests.cs (2)
241tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
OpenAIResponseClientIntegrationTests.cs (2)
182string tempPath = Path.Combine(Path.GetTempPath(), $"image_gen_test_{imageModel}{extension}");
Microsoft.Extensions.AI.Templates.Tests (21)
test\ProjectTemplates\Infrastructure\Project.cs (1)
28StartupProjectFullPath = Path.Combine(rootPath, field);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestClassFixtureBase.cs (5)
42_sandboxInstallPath = Path.Combine(_sandboxOutput, "install"); 43_sandboxProjectsPath = Path.Combine(_sandboxOutput, "projects"); 84file.CopyTo(Path.Combine(testSandbox, file.Name)); 89CopySandboxDirectory(subDir.FullName, Path.Combine(testSandbox, subDir.Name)); 95var outputFolderPath = Path.Combine(_sandboxProjectsPath, projectName);
test\ProjectTemplates\Infrastructure\TemplateExecutionTestConfiguration.cs (3)
13private string TemplateSandboxRoot => Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, TemplatePackageName, "Sandbox"); 14public string TemplateSandboxPackages => Path.Combine(TemplateSandboxRoot, "packages"); 15public string TemplateSandboxOutput => Path.Combine(TemplateSandboxRoot, TemplateName);
test\ProjectTemplates\Infrastructure\TemplateSnapshotTestBase.cs (5)
26string workingDir = Path.Combine(WellKnownPaths.ProjectTemplatesArtifactsRoot, templatePackageName, "Snapshots", templateName, $"{templateName}.{scenarioName}"); 35string templateLocation = Path.Combine(WellKnownPaths.LocalShippingPackagesPath, $"{templatePackageName}.*.nupkg"); 37string[]? excludePatterns = Path.DirectorySeparatorChar is '/' 39: verificationExcludePatterns?.Select(p => p.Replace('/', Path.DirectorySeparatorChar)).ToArray(); 45SnapshotsDirectory = Path.Combine("Snapshots", templateName),
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
50if (Path.GetFileName(path).Equals("launchSettings.json", StringComparison.OrdinalIgnoreCase))
test\ProjectTemplates\Infrastructure\WellKnownPaths.cs (6)
33ProjectTemplatesArtifactsRoot = Path.Combine(RepoRoot, "artifacts", "ProjectTemplates"); 34TemplateSandboxSource = Path.Combine(RepoRoot, "test", "ProjectTemplates", "Infrastructure", "TemplateSandbox"); 35TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxSource, "nuget.config"); 37LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping"); 46var gitPath = Path.Combine(directory, ".git"); 66var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
Microsoft.Extensions.Configuration.FileExtensions (4)
FileConfigurationProvider.cs (1)
183/// Loads the contents of the file at <see cref="Path"/>.
FileConfigurationSource.cs (3)
82System.IO.Path.IsPathRooted(Path) && 83System.IO.Path.GetDirectoryName(Path) is string directory) 86Path = System.IO.Path.GetFileName(Path);
Microsoft.Extensions.Configuration.UserSecrets (4)
PathHelper.cs (3)
48int badCharIndex = userSecretsId.IndexOfAny(Path.GetInvalidFileNameChars()); 87? Path.Combine(root, "Microsoft", "UserSecrets", userSecretsId, SecretsFileName) 88: Path.Combine(root, ".microsoft", "usersecrets", userSecretsId, SecretsFileName);
UserSecretsConfigurationExtensions.cs (1)
182string? directoryPath = Path.GetDirectoryName(secretPath);
Microsoft.Extensions.DataIngestion.MarkItDown (3)
MarkItDownReader.cs (3)
106string inputFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
Microsoft.Extensions.DataIngestion.Tests (13)
IngestionPipelineTests.cs (3)
32_sampleDirectory = Directory.CreateDirectory(Path.Combine("TestFiles")); 34_withTable = new(Path.Combine("TestFiles", "withTable.md")); 55_withImage = new(Path.Combine("TestFiles", "withImage.md"));
Readers\DocumentReaderConformanceTests.cs (6)
48string filePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName() + ".txt"); 192FileInfo file = new(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + extension));
Readers\MarkItDownMcpReaderTests.cs (3)
45var nonExistentFile = new FileInfo(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
Writers\SqliteVectorStoreWriterTests.cs (1)
13private readonly string _tempFile = Path.GetTempFileName();
Microsoft.Extensions.DependencyModel (21)
ApplicationEnvironment.cs (1)
16return Path.GetFullPath(basePath);
DependencyContextExtensions.cs (1)
112string name = Path.GetFileNameWithoutExtension(assetPath);
DependencyContextJsonReader.cs (2)
808groupRuntimeAssemblies.Where(a => Path.GetFileName(a.Path) != "_._"))); 820groupNativeLibraries.Where(a => Path.GetFileName(a.Path) != "_._")));
DependencyContextLoader.cs (2)
136string depsJsonFile = Path.ChangeExtension(assemblyLocation, DepsJsonExtension); 147depsJsonFile = Path.ChangeExtension(assemblyCodeBase, DepsJsonExtension);
Resolution\AppBaseCompilationAssemblyResolver.cs (4)
61string refsPath = Path.Combine(_basePath, RefsDirectoryName); 84string? sharedDirectory = Path.GetDirectoryName(sharedPath); 87string sharedRefs = Path.Combine(sharedDirectory, RefsDirectoryName); 100string assemblyFile = Path.GetFileName(assembly);
Resolution\PackageCompilationAssemblyResolver.cs (2)
49return listOfDirectories.Split([Path.PathSeparator], StringSplitOptions.RemoveEmptyEntries); 66return [Path.Combine(basePath, ".nuget", "packages")];
Resolution\ReferenceAssemblyPathResolver.cs (5)
69string relativeToReferenceAssemblies = Path.Combine(_defaultReferenceAssembliesPath, path); 77string name = Path.GetFileName(path); 81string fallbackFile = Path.Combine(fallbackPath, name); 105string net20Dir = Path.Combine(windir, "Microsoft.NET", "Framework", "v2.0.50727"); 146return Path.Combine(
Resolution\ResolverUtils.cs (3)
15path = Path.Combine(library.Name, library.Version); 18packagePath = Path.Combine(basePath, path); 29fullName = Path.Combine(basePath, assemblyPath);
RuntimeAssembly.cs (1)
34string assemblyName = System.IO.Path.GetFileNameWithoutExtension(path);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Linux\LinuxUtilizationParserCgroupV2.cs (1)
319FileInfo memoryUsageInBytesFile = new(Path.Combine(path, "memory.current"));
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Linux\OSFileSystemTests.cs (1)
26Path.Combine(Directory.GetCurrentDirectory(), "fixtures"), "*.slice");
Linux\Resources\HardcodedValueFileSystem.cs (1)
41.Select(x => Path.Combine(directory, x.Value))
Microsoft.Extensions.DotNetDeltaApplier (5)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (2)
38var processDir = Path.GetDirectoryName(processPath)!; 61var path = Path.Combine(processDir, args.Name + ".dll");
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (3)
318var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 321var updatedValues = environment.Split(Path.PathSeparator, StringSplitOptions.RemoveEmptyEntries) 324return string.Join(Path.PathSeparator, updatedValues);
Microsoft.Extensions.FileProviders.Embedded (9)
EmbeddedFileProvider.cs (4)
25private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 107var everettId = MakeValidEverettIdentifier(Path.GetDirectoryName(subpath)); 117builder.Append(Path.GetFileName(subpath)); 125var name = Path.GetFileName(subpath);
Manifest\EmbeddedFilesManifest.cs (5)
16private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 17.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 25private static readonly char[] _separators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
Microsoft.Extensions.FileProviders.Embedded.Manifest.Task (2)
GenerateEmbeddedResourcesManifest.cs (1)
101private static string NormalizePath(string path) => Path.DirectorySeparatorChar == '\\' ?
Manifest.cs (1)
26var paths = originalPath.Split(Path.DirectorySeparatorChar);
Microsoft.Extensions.FileProviders.Physical (26)
Internal\PathUtils.cs (8)
14private static char[] GetInvalidFileNameChars() => Path.GetInvalidFileNameChars() 15.Where(c => c != Path.DirectorySeparatorChar && c != Path.AltDirectorySeparatorChar).ToArray(); 30[Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 35path[path.Length - 1] != Path.DirectorySeparatorChar && 36path[path.Length - 1] != Path.AltDirectorySeparatorChar) 38return path + Path.DirectorySeparatorChar;
PhysicalFileProvider.cs (7)
54if (!Path.IsPathRooted(root)) 59string fullRoot = Path.GetFullPath(root); 156string root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(Root)); 232fullPath = Path.GetFullPath(Path.Combine(Root, path)); 268if (Path.IsPathRooted(subpath)) 313if (Path.IsPathRooted(subpath))
PhysicalFilesWatcher.cs (10)
109_root = PathUtils.EnsureTrailingSlash(Path.GetFullPath(root)); 123string watcherFullPath = PathUtils.EnsureTrailingSlash(Path.GetFullPath(fswPath)); 180if (Path.IsPathRooted(filter) || PathUtils.PathNavigatesAboveRoot(filter)) 233var pollingChangeToken = new PollingFileChangeToken(new FileInfo(Path.Combine(_root, filePath))); 357string oldLocation = Path.Combine(e.OldFullPath, newLocation.Substring(e.FullPath.Length + 1)); 817(path[path.Length - 1] == Path.DirectorySeparatorChar || 818path[path.Length - 1] == Path.AltDirectorySeparatorChar); 940current = Path.GetDirectoryName(current) ?? throw new DirectoryNotFoundException(SR.Format(SR.RootDirectoryMissing, current)); 987while (Path.Combine(watchDir, _expectedName) is var childPath && Directory.Exists(childPath)) 1023string nextDir = Path.Combine(watchDir, _expectedName);
PollingWildCardChangeToken.cs (1)
182string filePath = Path.Combine(_directoryInfo.FullName, path);
Microsoft.Extensions.FileSystemGlobbing (30)
Abstractions\DirectoryInfoWrapper.cs (2)
79new DirectoryInfo(Path.Combine(_directoryInfo.FullName, name)), 89=> new FileInfoWrapper(new FileInfo(Path.Combine(_directoryInfo.FullName, name)));
InMemoryDirectoryInfo.cs (25)
18private static readonly char[] DirectorySeparators = new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 54Name = isParentPath ? ".." : Path.GetFileName(rootDir); 63string normalizedRoot = Path.GetFullPath(rootDir.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 68string fileWithNormalSeparators = file.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 69if (Path.IsPathRooted(file)) 71fileList.Add(Path.GetFullPath(fileWithNormalSeparators)); 75fileList.Add(Path.GetFullPath(Path.Combine(normalizedRoot, fileWithNormalSeparators))); 93new InMemoryDirectoryInfo(Path.GetDirectoryName(FullName)!, _files, true, _comparisonType); 100if (FullName[beginSegment - 1] != Path.DirectorySeparatorChar) 108file[beginSegment - 1] != Path.DirectorySeparatorChar || 116while (segmentStart < file.Length && file[segmentStart] == Path.DirectorySeparatorChar) 161normPath = Path.GetDirectoryName(FullName) ?? FullName; 165string combinedPath = Path.Combine(FullName, path); 166normPath = Path.GetFullPath(combinedPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 179string combinedPath = Path.Combine(FullName, path); 180string normPath = Path.GetFullPath(combinedPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar));
Internal\InMemoryFileInfo.cs (1)
16Name = Path.GetFileName(file);
MatcherExtensions.cs (2)
67result.Add(Path.GetFullPath(Path.Combine(directoryPath, match.Path)));
Microsoft.Extensions.Hosting (5)
HostBuilder.cs (3)
259if (Path.IsPathRooted(contentRootPath)) 263return Path.Combine(Path.GetFullPath(basePath), contentRootPath);
HostingHostBuilderExtensions.cs (2)
241string sanitizedApplicationName = env.ApplicationName.Replace(Path.DirectorySeparatorChar, '_') 242.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.Http.Resilience.Tests (6)
BuildTransitive\GrpcNetClientFactoryVersionTargetTests.cs (6)
230var tempDirectory = Path.Combine(Path.GetTempPath(), $"GrpcNetClientFactoryTargetTests_{Guid.NewGuid():N}"); 235var projectPath = Path.Combine(tempDirectory, "test.proj"); 396return Path.Combine( 408var repoDotnetPath = Path.Combine(GetRepoRoot(), ".dotnet", dotnetFileName); 419var targetPath = Path.Combine(
Microsoft.Extensions.Localization (4)
ResourceManagerStringLocalizerFactory.cs (4)
48_resourcesRelativePath = _resourcesRelativePath.Replace(Path.AltDirectorySeparatorChar, '.') 49.Replace(Path.DirectorySeparatorChar, '.') + "."; 231.Replace(Path.DirectorySeparatorChar, '.') 232.Replace(Path.AltDirectorySeparatorChar, '.');
Microsoft.Extensions.Logging.AzureAppServices (4)
FileLoggerConfigureOptions.cs (1)
23options.LogDirectory = Path.Combine(_context.HomeFolder, "LogFiles", "Application");
FileLoggerProvider.cs (1)
66return Path.Combine(_path, $"{_fileName}{group.Year:0000}{group.Month:00}{group.Day:00}.txt");
SiteConfigurationProvider.cs (2)
13var settingsFolder = Path.Combine(context.HomeFolder, "site", "diagnostics"); 14var settingsFile = Path.Combine(settingsFolder, "settings.json");
Microsoft.Extensions.ML (2)
ModelLoaders\FileModelLoader.cs (2)
45var directory = Path.GetDirectoryName(filePath); 52var file = Path.GetFileName(filePath);
Microsoft.Extensions.ML.Tests (4)
FileLoaderTests.cs (1)
48loaderUnderTest.Start(Path.Combine("TestModels", "SentimentModel.zip"), false);
PredictionEnginePoolTests.cs (3)
35.FromFile(modelName: "model1", filePath: Path.Combine("TestModels", "SentimentModel.zip"), watchForChanges: false); 85using var stream = File.OpenRead(Path.Combine("TestModels", "SentimentModel.zip")); 113using var stream = File.OpenRead(Path.Combine("TestModels", "SentimentModel.zip"));
Microsoft.Extensions.ServiceDiscovery.Dns (8)
DnsSrvServiceEndpointProviderFactory.cs (8)
17private static readonly string s_serviceAccountPath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount"); 18private static readonly string s_serviceAccountNamespacePath = Path.Combine($"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount", "namespace"); 19private static readonly string s_resolveConfPath = Path.Combine($"{Path.DirectorySeparatorChar}etc", "resolv.conf"); 133var tokenPath = Path.Combine(s_serviceAccountPath, "token"); 139var certPath = Path.Combine(s_serviceAccountPath, "ca.crt");
Microsoft.Extensions.Telemetry.PerformanceTests (2)
RetainedMemoryMeasurement.cs (1)
181if (string.Equals(Path.GetFileNameWithoutExtension(executable), "dotnet", StringComparison.OrdinalIgnoreCase))
SustainedGcPressureMeasurement.cs (1)
304if (string.Equals(Path.GetFileNameWithoutExtension(executable), "dotnet", StringComparison.OrdinalIgnoreCase))
Microsoft.Gen.BuildMetadata (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.ComplianceReports (5)
ComplianceReportsGenerator.cs (3)
36_directory = Path.GetDirectoryName(filePath); 37_fileName = Path.GetFileName(filePath); 112File.WriteAllText(Path.Combine(_directory, _fileName), report, Encoding.UTF8);
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.ComplianceReports.Unit.Tests (8)
GeneratorTests.cs (5)
61var stem = Path.GetFileNameWithoutExtension(inputFile); 66var tmp = Path.GetTempFileName(); 139var projectDir = Path.GetTempPath(); 141var fullReportPath = Path.Combine(projectDir, outputPath); 155Assert.True(File.Exists(Path.Combine(fullReportPath, "ComplianceReport.json")));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.ContextualOptions (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.Logging (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.Logging.Unit.Tests (9)
AttributeParserTests.cs (1)
117.UseDirectory(Path.Combine("..", "Verified"));
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)
619.UseDirectory(Path.Combine("..", "Verified"));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.MetadataExtractor (7)
MetadataReportsGenerator.cs (1)
110File.WriteAllText(Path.Combine(path, _fileName), reportStringBuilder.ToString(), Encoding.UTF8);
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (3)
36_directory = Path.GetDirectoryName(filePath); 37_fileName = Path.GetFileName(filePath); 112File.WriteAllText(Path.Combine(_directory, _fileName), report, Encoding.UTF8);
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
86File.WriteAllText(Path.Combine(path, _fileName), report, Encoding.UTF8);
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.MetadataExtractor.Unit.Tests (13)
GeneratorTests.cs (10)
78var stem = Path.GetFileNameWithoutExtension(inputFile); 79var goldenFileName = Path.ChangeExtension(stem, ".json"); 80var goldenReportPath = Path.Combine("GoldenReports", goldenFileName); 82var generatedReportPath = Path.Combine(Directory.GetCurrentDirectory(), ReportFilename); 127["build_property.MetadataReportOutputPath"] = Path.GetTempPath(), 133Assert.False(File.Exists(Path.Combine(Path.GetTempPath(), ReportFilename))); 167var projectDir = Path.GetTempPath(); 169var fullReportPath = Path.Combine(projectDir, outputPath); 183Assert.True(File.Exists(Path.Combine(fullReportPath, ReportFilename)));
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.Metrics (2)
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.Metrics.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
59var runtimeDir = Path.GetDirectoryName(corelib)!; 65refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "netstandard.dll"))); 66refs.Add(MetadataReference.CreateFromFile(Path.Combine(runtimeDir, "System.Runtime.dll")));
Microsoft.Gen.MetricsReports (3)
MetricsReportsGenerator.cs (1)
86File.WriteAllText(Path.Combine(path, _fileName), report, Encoding.UTF8);
src\Generators\Shared\GeneratorUtilities.cs (2)
158if (Path.IsPathRooted(compilationOutputPath)) 165? Path.Combine(currentProjectPath!, compilationOutputPath!)
Microsoft.Gen.MetricsReports.Unit.Tests (13)
GeneratorTests.cs (10)
43var stem = Path.GetFileNameWithoutExtension(inputFile); 44var goldenFileName = Path.ChangeExtension(stem, ".json"); 45var goldenReportPath = Path.Combine("GoldenReports", goldenFileName); 47var generatedReportPath = Path.Combine(Directory.GetCurrentDirectory(), ReportFilename); 88["build_property.MetricsReportOutputPath"] = Path.GetTempPath() 93Assert.False(File.Exists(Path.Combine(Path.GetTempPath(), ReportFilename))); 120var projectDir = Path.GetTempPath(); 122var fullReportPath = Path.Combine(projectDir, outputPath); 136Assert.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)
80var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "DatasetWithEmptyColumn.txt"), DefaultColumnNames.Label, groupColumns: false); 88var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "BinaryDatasetWithBoolColumn.txt"), DefaultColumnNames.Label); 107var filePath = Path.Combine("TestData", "DatasetWithoutHeader.txt"); 135var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "NameColumnIsOnlyFeatureDataset.txt"), DefaultColumnNames.Label); 152.InferColumns(Path.Combine("TestData", "DatasetWithDefaultColumnNames.txt"), 172var result = new MLContext(1).Auto().InferColumns(Path.Combine("TestData", "DatasetWithDefaultColumnNames.txt"), 203var dataset = Path.Combine("TestData", "DatasetWithNewlineBetweenQuotes.txt"); 244var 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)
52var 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)
238var entryPointsSubDir = Path.Combine("..", "Common", "EntryPoints"); 266var entryPointsSubDir = Path.Combine("..", "Common", "EntryPoints"); 4600TestEntryPointPipelineRoutine(GetDataPath(Path.Combine("Timeseries", "A4Benchmark-TS1.csv")), "sep=, col=Features:R4:1 header=+", 4629TestEntryPointPipelineRoutine(GetDataPath(Path.Combine("Timeseries", "real_1.csv")), "sep=, col=Features:R4:1 header=+", 4653TestEntryPointPipelineRoutine(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)
995options.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.ImageAnalytics (4)
ImageLoader.cs (3)
112ImageFolder = Path.GetFullPath(imageFolder); 248path = Path.Combine(_parent.ImageFolder, path); 279path = Path.Combine(_parent.ImageFolder, path);
MLImage.cs (1)
236string ext = Path.GetExtension(imagePath);
Microsoft.ML.IntegrationTests (5)
DataIO.cs (2)
121var filePath = TestCommon.GetOutputPath(OutDir, Path.GetRandomFileName()); 130var filePath = TestCommon.GetOutputPath(OutDir, Path.GetRandomFileName());
IntegrationTestBaseClass.cs (2)
22DataDir = Path.Combine(RootDir, "test", "data"); 49OutDir = Path.Combine(currentAssemblyLocation.Directory.FullName, "TestOutput");
ModelFiles.cs (1)
60var versionFileName = @"TrainingInfo" + Path.DirectorySeparatorChar + "Version.txt";
Microsoft.ML.Maml (4)
MAML.cs (4)
57string currentDirectory = Path.GetDirectoryName(typeof(Maml).Module.FullyQualifiedName); 136var dumpFileDir = Path.Combine( 137Path.GetTempPath(), 139var dumpFilePath = Path.Combine(dumpFileDir,
Microsoft.ML.OneDal (1)
OneDalUtils.cs (1)
33var nativeLibs = Path.Combine(currentDir, "runtimes", "win-x64", "native");
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
103_name = Path.GetFileNameWithoutExtension(_outputModelPath);
Microsoft.ML.OnnxTransformer (4)
OnnxUtils.cs (4)
412var tempModelFile = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName()); 437var tempModelFile = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName());
Microsoft.ML.OnnxTransformerTest (21)
DnnImageFeaturizerTest.cs (2)
102var imageFolder = Path.GetDirectoryName(dataFile); 212var imageFolder = Path.GetDirectoryName(dataFile);
OnnxTransformTests.cs (19)
239var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 247var imageFolder = Path.GetDirectoryName(dataFile); 265var tempPath = Path.GetTempFileName(); 292var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 298var imageFolder = Path.GetDirectoryName(dataFile); 316var tempPath = Path.GetTempFileName(); 425var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 465var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 553var modelFile = Path.Combine(@"unknowndimensions/linear_regression.onnx"); 686var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 739var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapString.onnx"); 790var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 809var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "zipmap", "TestZipMapInt64.onnx"); 882var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "unknowndimensions", "test_unknowndimensions_float.onnx"); 960var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "twoinput", "twoinput.onnx"); 1052var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "unknowndimensions", "test_unknowndimensions_float.onnx"); 1079var tempPath = Path.GetTempFileName(); 1122var modelFile = Path.Combine(Directory.GetCurrentDirectory(), "squeezenet", "00000001", "model.onnx"); 1127var imageFolder = Path.GetDirectoryName(dataFile);
Microsoft.ML.Parquet (6)
PartitionedFileLoader.cs (1)
712truncPath = String.Join(Path.DirectorySeparatorChar.ToString(), segments);
PartitionedPathUtils.cs (5)
55relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 68char[] separators = { Path.DirectorySeparatorChar }; 70var cleanPath = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
Microsoft.ML.PerformanceTests (33)
BenchmarkBase.cs (6)
17DataDir = Path.Combine(RootDir, "test", "data"); 35return Path.GetFullPath(Path.Combine(DataDir, name)); 43var filePath = Path.GetFullPath(Path.Combine(DataDir, path, name)); 47var blobName = Path.GetFileName(name);
FeaturizeTextBench.cs (1)
29var path = Path.GetTempFileName();
Harness\ProjectGenerator.cs (2)
54<Compile Include=""{Path.GetFileName(artifactsPaths.ProgramCodePath)}"" Exclude=""bin\**;obj\**;**\*.xproj;packages\**"" /> 64=> Path.Combine(buildArtifactsDirectoryPath, "bin", configuration, TargetFrameworkMoniker, _runtimeIdentifier);
ImageClassificationBench.cs (16)
40var outputMlNetModelFilePath = Path.Combine(assetsPath, "outputs", 44string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 50string fullImagesetFolderPath = Path.Combine( 107if (Path.GetExtension(file) != ".jpg" && 108Path.GetExtension(file) != ".JPEG" && 109Path.GetExtension(file) != ".png") 112var label = Path.GetFileName(file); 145UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 147return Path.GetFileNameWithoutExtension(fileName); 154destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 156string relativeFilePath = Path.Combine(destDir, destFileName); 192var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 197if (File.Exists(Path.Combine(destFolder, flag))) return; 201File.Create(Path.Combine(destFolder, flag)); 213string fullPath = Path.Combine(assemblyFolderPath, relativePath); 232string pathname = Path.GetFullPath(filename);
Numeric\Ranking.cs (2)
88_modelPathMslr = Path.Combine(Path.GetDirectoryName(typeof(RankingTest).Assembly.Location), "FastTreeRankingModel.zip");
Text\MultiClassClassification.cs (4)
105_modelPathWiki = Path.Combine(Path.GetDirectoryName(typeof(MulticlassClassificationTest).Assembly.Location), @"WikiModel.zip"); 123string modelpath = Path.Combine(Path.GetDirectoryName(typeof(MulticlassClassificationTest).Assembly.Location), @"WikiModel.fold000.zip");
TextLoaderBench.cs (1)
32var path = Path.GetTempFileName();
TextPredictionEngineCreation.cs (1)
43_trainedModelOldFormat = _context.Model.Load(Path.Combine("TestModels", "SentimentModel.zip"), out inputSchema);
Microsoft.ML.Predictor.Tests (15)
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)))
ResultProcessor\TestResultProcessor.cs (1)
33string outputDirectory = Path.Combine(SubDirectory, directory);
Microsoft.ML.ResultProcessor (1)
ResultProcessor.cs (1)
1005string currentDirectory = Path.GetDirectoryName(typeof(ResultProcessor).Module.FullyQualifiedName);
Microsoft.ML.Samples (72)
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\ApplyOnnxModelWithCustomShape.cs (1)
20var modelPath = Path.Combine(AppContext.BaseDirectory,
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)
parent\6a273e5f1a281752\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);
parent\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
31Unzip(Path.Join(Directory.GetCurrentDirectory(), modelLocation),
parent\Microsoft.ML.Samples\Dynamic\TensorFlow\TextClassification.cs (1)
45var lookupMap = mlContext.Data.LoadFromTextFile(Path.Combine(
parent\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);
parent\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);
parent\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (14)
26string imagesDownloadFolderPath = Path.Combine(assetsPath, "inputs", 32string fullImagesetFolderPath = Path.Combine( 185if (Path.GetExtension(file) != ".jpg") 188var label = Path.GetFileName(file); 221if (Path.GetExtension(file) != ".jpg") 224var label = Path.GetFileName(file); 258UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 260return Path.GetFileNameWithoutExtension(fileName); 267destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 271string relativeFilePath = Path.Combine(destDir, destFileName); 300var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 305if (File.Exists(Path.Combine(destFolder, flag))) return; 319File.Create(Path.Combine(destFolder, flag)); 332string fullPath = Path.Combine(assemblyFolderPath, relativePath);
Microsoft.ML.SamplesUtils (11)
SamplesDatasetUtils.cs (11)
27while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null) 36return Path.Combine(directory, "test", "data", fileName); 179string varPath = Path.Combine(path, "variables"); 183Download(Path.Combine(remotePath, "saved_model.pb"), Path.Combine(path, "saved_model.pb")).Wait(); 184Download(Path.Combine(remotePath, "imdb_word_index.csv"), Path.Combine(path, "imdb_word_index.csv")).Wait(); 185Download(Path.Combine(remotePath, "variables", "variables.data-00000-of-00001"), Path.Combine(varPath, "variables.data-00000-of-00001")).Wait(); 186Download(Path.Combine(remotePath, "variables", "variables.index"), Path.Combine(varPath, "variables.index")).Wait();
Microsoft.ML.SearchSpace.Tests (2)
TestBase.cs (2)
41return Path.Combine(testDataDir.FullName, fileName).Replace(cwd, "."); 53return Path.Combine(testDataDir.FullName, folderName).Replace(cwd, ".");
Microsoft.ML.Sweeper (5)
ConfigRunner.cs (4)
94return Path.Combine(SweepCommand.LocalExePath, "../Win/maml.exe"); 96return Path.Combine(SweepCommand.LocalExePath, "../Linux/maml"); 107string currentDirectory = Path.GetDirectoryName(typeof(ExeConfigRunnerBase).Module.FullyQualifiedName); 134var folderPath = Path.GetFullPath(folderName);
SweepCommand.cs (1)
49public static readonly string LocalExePath = Path.GetDirectoryName(typeof(SweepCommand).Module.FullyQualifiedName);
Microsoft.ML.TensorFlow (11)
TensorflowTransform.cs (7)
154var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(TensorFlowTransformer) + "_" + Guid.NewGuid())); 166string fullFilePath = Path.Combine(tempDirPath, relativeFile); 167string fullFileDir = Path.GetDirectoryName(fullFilePath); 472Path.Combine(_savedModelPath, DefaultModelFileNames.Graph), 473Path.Combine(_savedModelPath, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index) 475modelFilePaths.AddRange(Directory.GetFiles(Path.Combine(_savedModelPath, DefaultModelFileNames.VariablesFolder), DefaultModelFileNames.Data, SearchOption.TopDirectoryOnly));
TensorflowUtils.cs (4)
220var directory = Path.GetDirectoryName(errorResult.FileName); 221var name = Path.GetFileName(errorResult.FileName); 642string tempDirectory = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, Path.GetRandomFileName());
Microsoft.ML.TensorFlow.Tests (51)
TensorFlowEstimatorTests.cs (3)
162var imageFolder = Path.GetDirectoryName(dataFile); 205var imageFolder = Path.GetDirectoryName(dataFile); 260var imageFolder = Path.GetDirectoryName(dataFile);
TensorflowTests.cs (48)
35tempFolder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 36assetsPath = Path.Combine(tempFolder, "assets"); 37parentWorkspacePath = Path.Combine(assetsPath, "cached"); 73string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs", 80_fullImagesetFolderPath = Path.Combine( 129var imageFolder = Path.GetDirectoryName(dataFile); 497var imageFolder = Path.GetDirectoryName(dataFile); 533var imageFolder = Path.GetDirectoryName(dataFile); 759var varDir = Path.Combine(modelLocation, "variables"); 1005var imageFolder = Path.GetDirectoryName(dataFile); 1064var imageFolder = Path.GetDirectoryName(dataFile); 1107var imageFolder = Path.GetDirectoryName(dataFile); 1142var imageFolder = Path.GetDirectoryName(dataFile); 1180var mlModelLocation = DeleteOutputPath(Path.ChangeExtension(modelLocation, ".zip")); 1220var imageFolder = Path.GetDirectoryName(dataFile); 1445if (Directory.Exists(workspacePath) && File.Exists(Path.Combine(workspacePath, trainSetBottleneckCachedValuesFileName)) 1446&& File.Exists(Path.Combine(workspacePath, validationSetBottleneckCachedValuesFileName))) 1461string workspacePath = Path.Combine(TensorFlowScenariosTestsFixture.parentWorkspacePath, finalImagesFolderName + "_" + (int)arch); 1561ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg") 1567ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg") 1720ImagePath = Path.Combine(_fullImagesetFolderPath, "daisy", "5794835_d15905c7c8_n.jpg") 1726ImagePath = Path.Combine(_fullImagesetFolderPath, "roses", "12240303_80d87f77a3_n.jpg") 1746Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.TrainSetBottleneckCachedValuesFileName))); 1747Assert.True(File.Exists(Path.Combine(options.WorkspacePath, options.ValidationSetBottleneckCachedValuesFileName))); 1748Assert.True(File.Exists(Path.Combine(Path.GetTempPath(), "MLNET", ImageClassificationTrainer.ModelFileName[options.Arch]))); 1840string imagesDownloadFolderPath = Path.Combine(TensorFlowScenariosTestsFixture.assetsPath, "inputs", 1846string fullImagesetFolderPath = Path.Combine( 1920if (Path.GetExtension(file) != ".jpg") 1923var label = Path.GetFileName(file); 1954UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 1956if (!Directory.Exists(Path.Combine(imagesDownloadFolder, filenameAlias))) 1957Directory.Move(Path.Combine(imagesDownloadFolder, Path.GetFileNameWithoutExtension(fileName)), Path.Combine(imagesDownloadFolder, "FPTSUT")); 1967UnZip(Path.Combine(imagesDownloadFolder, fileName), imagesDownloadFolder); 1969return Path.GetFileNameWithoutExtension(fileName); 1975destFileName = url.Split(Path.DirectorySeparatorChar).Last(); 1979string relativeFilePath = Path.Combine(destDir, destFileName); 1990var flag = gzArchiveName.Split(Path.DirectorySeparatorChar) 1995if (File.Exists(Path.Combine(destFolder, flag))) 1999File.Create(Path.Combine(destFolder, flag)); 2022string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 2037string 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 (22)
TestCommon.cs (9)
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)); 77!Directory.Exists(Path.Combine(directory, ".git")) && 78!File.Exists(Path.Combine(directory, ".git"))) 295Directory.CreateDirectory(Path.Combine(outDir, subDir));
TestDownloadUtils.cs (1)
16var directory = Path.GetDirectoryName(filePath);
Utility\LibraryLoader.cs (4)
91if (Path.IsPathRooted(name)) 99if (!Path.IsPathRooted(loadTarget) || File.Exists(loadTarget)) 198if (Path.IsPathRooted(name)) 199return Kernel32.LoadLibraryEx(Path.GetFullPath(name), IntPtr.Zero, Kernel32.LoadWithAlteredSearchPath);
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); 154return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
Microsoft.ML.Tests (59)
CalibratedModelParametersTests.cs (3)
232ModelSaveContext.SaveModel(writer, embeddedCalibrator, Path.Combine("Predictor", "Calibrator")); 242Env, out var subModel, reader, Path.Combine("Predictor", "Predictor")); 245Env, out var calibrator, reader, Path.Combine("Predictor", "Calibrator"));
DatabaseLoaderTests.cs (9)
355var sourceDirectory = Path.GetFullPath("TestDatabases"); 358_temporaryDatabaseDirectory = Path.Combine(Path.GetTempPath(), "Microsoft.ML.Tests", databaseId); 362var databaseFile = Path.Combine(_temporaryDatabaseDirectory, $"{databaseName}.mdf"); 363File.Copy(Path.Combine(sourceDirectory, $"{databaseName}.mdf"), databaseFile); 366var logFile = Path.Combine(_temporaryDatabaseDirectory, $"{databaseName}_log.ldf"); 367File.Copy(Path.Combine(sourceDirectory, $"{databaseName}_log.ldf"), logFile); 375var 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\OneDalEstimators.cs (2)
33Path.GetDirectoryName(typeof(TrainerEstimators).Assembly.Location) + Path.PathSeparator + Environment.GetEnvironmentVariable("PATH");
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)
779var 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)
parent\Microsoft.ML.Tokenizers.Tests\Utils.cs (3)
53Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Guid.NewGuid().ToString(), extension));
Microsoft.ML.Tokenizers.Tests (38)
BpeTests.cs (9)
366using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json")); 367using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt")); 380string vocabFile = Path.Combine(@"Gpt-2", "vocab.json"); 381string mergesFile = Path.Combine(@"Gpt-2", "merges.txt"); 590using Stream vocabStream = File.OpenRead(Path.Combine(@"Gpt-2", "vocab.json")); 591using Stream mergesStream = File.OpenRead(Path.Combine(@"Gpt-2", "merges.txt")); 938BpeOptions options = new BpeOptions(Path.Combine(@"Gpt-2", "vocab.json"), Path.Combine(@"Gpt-2", "merges.txt")) 995using Stream jsonModelStream = File.OpenRead(Path.Combine(@"DeepSeek", "tokenizer-DeepSeek-R1.json"));
CodeGenTests.cs (4)
28using Stream vocabStream = File.OpenRead(Path.Combine(@"Codegen-350M-mono", "vocab.json")); 29using Stream mergesStream = File.OpenRead(Path.Combine(@"Codegen-350M-mono", "merges.txt")); 39using Stream vocabStream = File.OpenRead(Path.Combine(@"Phi-2", "vocab.json")); 40using Stream mergesStream = File.OpenRead(Path.Combine(@"Phi-2", "merges.txt"));
EnglishRobertaTests.cs (6)
91Path.Combine(@"Gpt-2", "vocab.json"), 92Path.Combine(@"Gpt-2", "merges.txt"), 93Path.Combine(@"Gpt-2", "dict.txt"), 109string vocabFile = Path.Combine(@"Gpt-2", "vocab.json"); 110string mergeFile = Path.Combine(@"Gpt-2", "merges.txt"); 111string translationFile = Path.Combine(@"Gpt-2", "dict.txt");
LlamaTests.cs (3)
32using Stream remoteStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 39using Stream remoteStream = File.OpenRead(Path.Combine(@"Mistral", "tokenizer.model")); 46using Stream remoteStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model"));
SentencePieceTests.cs (7)
44using Stream stream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 57byte[] modelBytes = File.ReadAllBytes(Path.Combine(@"Llama", "tokenizer.model")); 71using Stream stream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 92using Stream stream = File.OpenRead(Path.Combine( 108using Stream stream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 142using Stream bpeStream = File.OpenRead(Path.Combine(@"Llama", "tokenizer.model")); 146using Stream unigramStream = File.OpenRead(Path.Combine(
UnigramTests.cs (5)
26using Stream remoteStream = File.OpenRead(Path.Combine(@"Paraphrase-multilingual-MiniLM-L12-v2", "sentencepiece.bpe.model")); 58using Stream remoteStream = File.OpenRead(Path.Combine(@"Paraphrase-multilingual-MiniLM-L12-v2", "sentencepiece.bpe.model")); 616using Stream jsonStream = File.OpenRead(Path.Combine("Paraphrase-multilingual-MiniLM-L12-v2", "tokenizer.json")); 654using Stream jsonStream = File.OpenRead(Path.Combine("Paraphrase-multilingual-MiniLM-L12-v2", "tokenizer.json")); 1191using JsonDocument bundled = JsonDocument.Parse(File.ReadAllText(Path.Combine("Paraphrase-multilingual-MiniLM-L12-v2", "tokenizer.json")));
Utils.cs (3)
53Path.Combine(Path.GetTempPath(), Path.ChangeExtension(Guid.NewGuid().ToString(), extension));
WordPieceTests.cs (1)
20string vocabFile = Path.GetTempFileName();
Microsoft.ML.TorchSharp (12)
AutoFormerV2\ObjectDetectionTrainer.cs (4)
275var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 280string relativeFilePath = Path.Combine(destDir, destFileName); 290var directory = Path.GetDirectoryName(errorResult.FileName); 291var name = Path.GetFileName(errorResult.FileName);
Roberta\QATrainer.cs (4)
252var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 257string relativeFilePath = Path.Combine(destDir, destFileName); 267var directory = Path.GetDirectoryName(errorResult.FileName); 268var name = Path.GetFileName(errorResult.FileName);
TorchSharpBaseTrainer.cs (4)
182var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 187string relativeFilePath = Path.Combine(destDir, destFileName); 197var directory = Path.GetDirectoryName(errorResult.FileName); 198var 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)
757var 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)
560_resourcePath = Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, "MLNET"); 593_checkpointPath = Path.Combine(_options.WorkspacePath, _options.FinalModelPrefix + 595_sizeFile = Path.Combine(_options.WorkspacePath, "TrainingSetSize.txt"); 691string trainSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath, 694string validationSetBottleneckCachedValuesFilePath = Path.Combine(_options.WorkspacePath, 879Path.Combine(_options.WorkspacePath, _options.ValidationSetBottleneckCachedValuesFileName), 977trainWriter = tf.summary.FileWriter(Path.Combine(_options.WorkspacePath, "train"), 1172var evalGraph = LoadMetaGraph(Path.Combine(_resourcePath, ModelFileName[_options.Arch])); 1336var modelFilePath = Path.Combine(_resourcePath, modelFileName);
Microsoft.NET.Build.Containers (27)
ContentStore.cs (9)
15string contentPath = Path.Join(ArtifactRoot, "Content"); 40string descriptorPath = Path.Combine(ContentRoot, digestValue) + extension; 44public static string GetTempFile() => Path.Join(TempPath, Path.GetRandomFileName()); 55string dotnetCacheDir = Path.Join(userCacheDir, "dotnet"); 58string containersCacheDir = Path.Join(dotnetCacheDir, "Containers"); 96if (!string.IsNullOrEmpty(xdgCacheHome) && Path.IsPathFullyQualified(xdgCacheHome)) 103return Path.Join(userHomeDirectory, ".cache"); 111return Path.Join(userHomeDirectory, "Library", "Caches");
Layer.cs (3)
127string relativePath = Path.GetRelativePath(directory, fsi.FullName); 255private static readonly char[] PathSeparators = new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };
LocalDaemons\ArchiveFileRegistry.cs (6)
27var parentDirectory = Path.GetDirectoryName(fullPath); 53var fullPath = Path.GetFullPath(archiveOutputPath); 55var directorySeparatorChar = Path.DirectorySeparatorChar; 58if (!Path.HasExtension(fullPath)) 60fullPath += Path.DirectorySeparatorChar; 66fullPath = Path.Combine(fullPath, repository + ".tar.gz");
LocalDaemons\ContainerRuntimeOperations.cs (3)
97string archivePath = Path.Combine(temporaryDirectory.FullName, "image.tar"); 159foreach (string directory in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(Path.PathSeparator)) 161string fullPath = Path.Combine(
LocalDaemons\DockerCli.cs (2)
56foreach (string directory in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(Path.PathSeparator)) 58string fullPath = Path.Combine(directory, RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? $"{command}.exe" : command);
Tasks\ContainerArchiveCache.cs (4)
63string publishDirectory = Path.GetFullPath(task.PublishDirectory); 66.OrderBy(path => Path.GetRelativePath(publishDirectory, path), StringComparer.Ordinal)) 69string relativePath = Path.GetRelativePath(publishDirectory, path).Replace('\\', '/'); 142string? cacheDirectory = Path.GetDirectoryName(task.ArchiveIncrementalCachePath);
Microsoft.NET.Build.Extensions.Tasks (10)
parent\Common\ConflictResolution\ConflictItem.cs (1)
125_fileName = OriginalItem == null ? string.Empty : Path.GetFileName(OriginalItem.ItemSpec);
parent\Common\ConflictResolution\FrameworkListReader.cs (1)
23if (!Path.IsPathRooted(frameworkListPath.OriginalValue))
parent\Common\ConflictResolution\ResolvePackageFileConflicts.cs (2)
76AbsolutePath frameworkListPath = TaskEnvironment.GetAbsolutePath(Path.Combine(tfd.ItemSpec, "RedistList", "FrameworkList.xml")); 193compilePlatformWinners.Select(c => Path.GetFileNameWithoutExtension(c.FileName) ?? string.Empty)
parent\Common\FileUtilities.cs (1)
46var extension = Path.GetExtension(sourcePath);
parent\Common\ItemUtilities.cs (4)
74return Path.GetFileName(sourcePath); 104return targetPath != null ? Path.GetFileName(targetPath) : null; 141var fileName = Path.GetFileName(sourcePath); 148return Path.Combine(destinationSubDirectory, fileName);
parent\Common\TaskEnvironmentExtensions.cs (1)
24_ = Path.GetFullPath(path);
Microsoft.NET.Build.Tasks (247)
AssetsFileResolver.cs (8)
57string sourcePath = Path.Combine(libraryPath, runtimeTarget.Path); 76string sourcePath = Path.Combine(libraryPath, resourceAssembly.Path); 98string srcpath = Path.Combine(libraryPath, item.Path); 112return Path.GetDirectoryName(runtimeTarget.Path) + Path.DirectorySeparatorChar; 127destPath = Path.GetDirectoryName(libraryPath.Substring(pkgRoot.Length)); 130if (destPath != null && destPath[destPath.Length - 1] != Path.DirectorySeparatorChar) 132destPath += Path.DirectorySeparatorChar;
CheckForUnsupportedWinMDReferences.cs (5)
29if (Path.GetExtension(referencePath.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase)) 54if (!Path.GetExtension(referencePath.ItemSpec).Equals(".winmd", StringComparison.OrdinalIgnoreCase) && 59if (Path.GetFileName(referencePath.ItemSpec).Equals("System.Runtime.WindowsRuntime.dll", StringComparison.OrdinalIgnoreCase)) 66Log.LogError(Strings.WinMDTransitiveReferenceNotSupported, Path.GetFileName(referencePath.ItemSpec)); 76Log.LogError(Strings.WinMDReferenceNotSupportedOnTargetFramework, TargetFrameworkMoniker, Path.GetFileName(winMDReference.ItemSpec));
CheckSdkVulnerabilities.cs (2)
40if (SdkVersion.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) 45string summaryPath = Path.Combine(userProfileDir, CacheDirectoryName, $"{SummaryFilePrefix}{SdkVersion}.json");
DependencyContextBuilder.cs (10)
248referenceAssembliesPath[referenceAssembliesPath.Length - 1] == Path.DirectorySeparatorChar) 254_referenceAssembliesPath = referenceAssembliesPath + Path.DirectorySeparatorChar; 440resolvedPath = Path.GetFileName(referenceAssembly.FullPath); 651var fileName = Path.GetFileNameWithoutExtension(library.Path); 653? userRuntimeAssemblies.FirstOrDefault(p => Path.GetFileNameWithoutExtension(p.Path).Equals(fileName)) 655string mainProjectDirectory = Path.GetDirectoryName(_mainProjectInfo.ProjectPath); 656string libraryPath = !string.IsNullOrWhiteSpace(library.Path) ? Path.Combine(mainProjectDirectory, library.Path) : null; 858string mainProjectDirectory = Path.GetDirectoryName(_mainProjectInfo.ProjectPath); 859string fullProjectPath = Path.GetFullPath(Path.Combine(mainProjectDirectory, projectPath));
FrameworkPackages\FrameworkPackages.cs (8)
128var packsFolder = Path.Combine(targetingPackRoot, frameworkName + ".Ref"); 129var originalPacksFolder = Path.Combine(targetingPackRoot.OriginalValue, frameworkName + ".Ref"); 135log.LogMessage("Pack directories found: {0}", string.Join(Environment.NewLine, packDirectories.Select(d => Path.Combine(originalPacksFolder, Path.GetFileName(d))))); 137.Select(d => (Overrides: Path.Combine(d, "data", "PackageOverrides.txt"), OriginalOverrides: Path.Combine(originalPacksFolder, Path.GetFileName(d), "data", "PackageOverrides.txt"), Version: ParseVersion(Path.GetFileName(d))))
FrameworkReferenceResolver.cs (1)
59return Path.Combine(
GenerateDepsFile.cs (2)
270string destinationSubPath = string.IsNullOrEmpty(destinationSubDir) ? null : Path.Combine(destinationSubDir, Path.GetFileName(i.ItemSpec));
GenerateRegFreeComManifest.cs (1)
44Path.GetFileNameWithoutExtension(IntermediateAssembly),
GenerateRuntimeConfigurationFiles.cs (1)
400if (lastChar == Path.DirectorySeparatorChar)
GenerateShims.cs (2)
83var packagedShimOutputDirectoryAndRid = Path.Combine( 87var appHostDestinationFilePath = Path.Combine(
GetEmbeddedApphostPaths.cs (2)
40var packagedShimOutputDirectoryAndRid = Path.Combine( 44var appHostDestinationFilePath = Path.Combine(
GetPackagesToPrune.cs (1)
267string packageOverridesPath = Path.Combine(prunePackageDataRoot, targetFrameworkVersion, frameworkReference, "PackageOverrides.txt");
LockFileCache.cs (1)
29if (!Path.IsPathRooted(path))
NugetContentAssetPreprocessor.cs (3)
19_preprocessedOutputDirectory = Path.Combine(outputDirectoryBase, BuildPreprocessedContentHash(_preprocessorValues)); 31pathToFinalAsset = Path.Combine(_preprocessedOutputDirectory, relativeOutputPath); 35Directory.CreateDirectory(Path.GetDirectoryName(pathToFinalAsset));
NuGetPackageResolver.cs (2)
54return Path.Combine(packagePath, NormalizeRelativePath(relativePath)); 58=> relativePath.Replace('/', Path.DirectorySeparatorChar);
parent\Common\ConflictResolution\ConflictItem.cs (1)
125_fileName = OriginalItem == null ? string.Empty : Path.GetFileName(OriginalItem.ItemSpec);
parent\Common\ConflictResolution\FrameworkListReader.cs (1)
23if (!Path.IsPathRooted(frameworkListPath.OriginalValue))
parent\Common\ConflictResolution\ResolvePackageFileConflicts.cs (2)
76AbsolutePath frameworkListPath = TaskEnvironment.GetAbsolutePath(Path.Combine(tfd.ItemSpec, "RedistList", "FrameworkList.xml")); 193compilePlatformWinners.Select(c => Path.GetFileNameWithoutExtension(c.FileName) ?? string.Empty)
parent\Common\FileUtilities.cs (1)
46var extension = Path.GetExtension(sourcePath);
parent\Common\ItemUtilities.cs (4)
74return Path.GetFileName(sourcePath); 104return targetPath != null ? Path.GetFileName(targetPath) : null; 141var fileName = Path.GetFileName(sourcePath); 148return Path.Combine(destinationSubDirectory, fileName);
parent\Common\TaskEnvironmentExtensions.cs (1)
24_ = Path.GetFullPath(path);
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString); 387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString); 392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 480string manifestId = Path.GetFileName(manifestDirectory); 488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 491return (directory: dir, version: Path.GetFileName(dir)); 500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 526.Select(dir => Path.GetFileName(dir)) 532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 639var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 668string globalJsonPath = Path.Combine(directory, "global.json"); 673directory = Path.GetDirectoryName(directory);
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine( 40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState"); 44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadManifestReader.Localization.cs (4)
26var catalog = Path.Combine(localizationDir, $"WorkloadManifest.{culture.Name}.json"); 55var cultureName = Path.GetFileNameWithoutExtension(filePath).Substring("WorkloadManifest.".Length); 64string manifestDir = Path.GetDirectoryName(manifestFilePath) ?? throw new ArgumentException(nameof(manifestFilePath)); 65string localizationDir = Path.Combine(manifestDir, "localize");
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt"); 48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray(); 329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion); 333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
parent\parent\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadSet.cs (1)
100if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
ParseTargetManifests.cs (1)
32var targetManifestFileName = Path.GetFileName(manifestFile);
PrepareForReadyToRunCompilation.cs (26)
174var outputR2RImage = Path.Combine(OutputPath, outputR2RImageRelativePath); 202outputPDBImage = Path.ChangeExtension(outputR2RImage, "ni.pdb"); 203outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, "ni.pdb"); 204crossgen1CreatePDBCommand = $"/CreatePDB \"{Path.GetDirectoryName(outputPDBImage)}\""; 225outputPDBImage = Path.ChangeExtension(outputR2RImage, perfmapExtension); 226outputPDBImageRelativePath = Path.ChangeExtension(outputR2RImageRelativePath, perfmapExtension); 227crossgen1CreatePDBCommand = $"/CreatePerfMap \"{Path.GetDirectoryName(outputPDBImage)}\""; 259r2rFileToPublish.ItemSpec = Path.Combine(OutputPath, Path.GetFileName(outputR2RImageRelativePath)); 269r2rFileToPublish.ItemSpec = Path.Combine(OutputPath, Path.GetFileName(outputR2RImageRelativePath)); 314MainAssembly.SetMetadata(MetadataKeys.RelativePath, Path.GetFileName(MainAssembly.ItemSpec)); 317string compositeR2RImageBaseRelativePath = Path.ChangeExtension( 319"r2r" + Path.GetExtension(mainAssemblyRelativePath)); 345compositePDBImage = Path.ChangeExtension(compositeR2RImageOutputPath, ".ni.pdb"); 346compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, ".ni.pdb"); 352compositePDBImage = Path.ChangeExtension(compositeR2RImageOutputPath, perfmapExtension); 353compositePDBRelativePath = Path.ChangeExtension(compositeR2RImageRelativePath, perfmapExtension); 400: Path.ChangeExtension(relativePath, compilerExtension); 403: Path.ChangeExtension(relativePath, publishExtension); 405compilerOutputPath = Path.Combine(OutputPath, compilerOutputRelativePath); 406string publishOutputPath = Path.Combine(OutputPath, publishOutputRelativePath); 531bool excludeFromR2R = (exclusionSet != null && exclusionSet.Contains(Path.GetFileName(file.ItemSpec))); 532bool excludeFromComposite = (r2rCompositeExclusionSet != null && r2rCompositeExclusionSet.Contains(Path.GetFileName(file.ItemSpec))) || excludeFromR2R; 533bool partialImage = (partialSet != null && partialSet.Contains(Path.GetFileName(file.ItemSpec))); 537bool rootedInComposite = (r2rCompositeRootSet == null || r2rCompositeRootSet.Contains(Path.GetFileName(file.ItemSpec)));
ProcessFrameworkReferences.cs (4)
1144foreach (var packRoot in packRootEnvironmentVariable.Split(Path.PathSeparator)) 1146yield return Path.Combine(packRoot, "packs"); 1156yield return Path.Combine(userProfileDir, "packs"); 1168string packPath = Path.Combine(packFolder, packName, packVersion);
ProduceContentAssets.cs (3)
210string relativeOutputPath = Path.Combine(packageName, packageVersion, ppOutputPath); 252item.SetMetadata("Link", Path.Combine("NuGet", packageName, packageVersion, Path.GetFileName(resolvedPath)));
ReferenceInfo.cs (6)
16public string FileName => Path.GetFileName(FullPath); 82projectName = Path.GetFileNameWithoutExtension(projectFilePath); 87projectName = Path.GetFileNameWithoutExtension(referencePath.ItemSpec); 159string name = Path.GetFileNameWithoutExtension(fullPath); 169string destinationSubPath = string.IsNullOrEmpty(destinationSubDirectory) ? null : Path.Combine(destinationSubDirectory, Path.GetFileName(fullPath));
ResolveAppHosts.cs (3)
289string hostRelativePathInPackage = Path.Combine("runtimes", bestAppHostRuntimeIdentifier, "native", 298appHostPackPath = Path.Combine(TargetingPackRoot, hostPackName, appHostPackVersion); 306appHostItem.SetMetadata(MetadataKeys.Path, Path.Combine(appHostPackPath, hostRelativePathInPackage));
ResolveCopyLocalAssets.cs (1)
88item.SetMetadata(MetadataKeys.Culture, resolvedFile.DestinationSubDirectory.TrimEnd(Path.DirectorySeparatorChar));
ResolvedFile.cs (3)
33get { return Path.GetFileName(SourcePath); } 42Path.Combine(DestinationSubDirectory, FileName); 50SourcePath = Path.GetFullPath(sourcePath);
ResolvePackageAssets.cs (14)
777Directory.CreateDirectory(Path.GetDirectoryName(_task.TaskEnvironment.GetAbsolutePath(_task.ProjectAssetsCacheFile))); 1289string xmlFilePath = Path.ChangeExtension(itemSpec, fileExtension); 1447WriteCopyLocalMetadataIfNeeded(package, Path.GetFileName(asset.Path)); 1787Path.GetFileName(asset.Path), 1788destinationSubDirectory: locale + Path.DirectorySeparatorChar); 1791WriteMetadata(MetadataKeys.DestinationSubDirectory, locale + Path.DirectorySeparatorChar); 1805WriteCopyLocalMetadataIfNeeded(package, Path.GetFileName(asset.Path)); 1822Path.GetFileName(asset.Path), 1823destinationSubDirectory: Path.GetDirectoryName(asset.Path) + Path.DirectorySeparatorChar); 1827WriteMetadata(MetadataKeys.DestinationSubDirectory, Path.GetDirectoryName(asset.Path) + Path.DirectorySeparatorChar); 1971Path.Combine(destinationSubDirectory, assetsFileName)); 2127if (Path.GetFileName(resolvedPackageAssetPath) == apphostName)
ResolvePackageDependencies.cs (7)
455if (Path.DirectorySeparatorChar != '/') 457relativePath = relativePath.Replace('/', Path.DirectorySeparatorChar); 460if (Path.DirectorySeparatorChar != '\\') 462relativePath = relativePath.Replace('\\', Path.DirectorySeparatorChar); 465return Path.Combine(resolvedPackagePath, relativePath); 470string projectDirectory = Path.GetDirectoryName(ProjectPath); 476return Path.GetFullPath(new AbsolutePath(path, absProjectDir));
ResolveReadyToRunCompilers.cs (26)
306_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 307_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 308_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm.dll"); 313_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x86_arm", "crossgen.exe"); 314_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "clrjit.dll"); 315_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x86_arm", "native", "Microsoft.DiaSymReader.Native.x86.dll"); 322_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 323_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 324_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.arm64.dll"); 334_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "x64_arm64", "crossgen.exe"); 335_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "clrjit.dll"); 336_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", "x64_arm64", "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 341_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen.exe"); 342_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "clrjit.dll"); 345_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.amd64.dll"); 349_crossgenTool.DiaSymReaderPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "Microsoft.DiaSymReader.Native.x86.dll"); 359_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 360_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 365_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", xarchPath, "crossgen"); 366_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", xarchPath, "native", "libclrjit.so"); 375_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 376_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.so"); 387_crossgenTool.ToolPath = Path.Combine(_crossgenTool.PackagePath, "tools", "crossgen"); 388_crossgenTool.ClrJitPath = Path.Combine(_crossgenTool.PackagePath, "runtimes", _targetRuntimeIdentifier, "native", "libclrjit.dylib"); 423_crossgen2Tool.ClrJitPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", clrJitFileName); 430_crossgen2Tool.ToolPath = Path.Combine(_crossgen2Tool.PackagePath, "tools", toolFileName);
ResolveRuntimePackAssets.cs (11)
151string runtimeListPath = Path.Combine(runtimePackRoot, "data", "RuntimeList.xml"); 152AbsolutePath absoluteRuntimeListPath = new(Path.Combine("data", "RuntimeList.xml"), absoluteRuntimePackRoot); 209? Path.GetFullPath(absoluteRuntimePackRoot) 210: Path.GetFullPath(new AbsolutePath(pathAttributeValue, absoluteRuntimePackRoot)); 233throw new BuildErrorException($"Culture not set in runtime manifest for {Path.GetFullPath(Path.Combine(runtimePack.GetMetadata(MetadataKeys.PackageDirectory), fileElement.Attribute("Path").Value))}"); 243throw new BuildErrorException($"Unrecognized file type '{typeAttributeValue}' in {Path.Combine(absoluteRuntimePackRoot.OriginalValue, absoluteRuntimeListPath.OriginalValue)}"); 280assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.GetFileName(assetPath)); 284assetItem.SetMetadata(MetadataKeys.DestinationSubDirectory, culture + Path.DirectorySeparatorChar); 285assetItem.SetMetadata(MetadataKeys.DestinationSubPath, Path.Combine(culture, Path.GetFileName(assetPath)));
ResolveTargetingPackAssets.cs (13)
200Path.Combine(targetingPackRoot.OriginalValue, "ref", targetingPackTargetFramework)); 208Path.Combine(targetingPackRoot.OriginalValue, "ref", targetingPackTargetFramework)); 211string targetingPackOriginalDataPath = Path.Combine(targetingPackRoot.OriginalValue, "data"); 214Path.Combine(targetingPackOriginalDataPath, "PlatformManifest.txt")); 217Path.Combine(targetingPackOriginalDataPath, "PackageOverrides.txt")); 220Path.Combine(targetingPackOriginalDataPath, "FrameworkList.xml")); 297Path.Combine(targetingPackRoot.OriginalValue, "build", targetingPackTargetFramework, "ref")); 301string itemSpec = Path.Combine(targetingPackAssetPath.OriginalValue, Path.GetFileName(dll)); 309if (!Path.GetFileName(dll).Equals("netstandard.dll", StringComparison.OrdinalIgnoreCase)) 380Path.Combine(definition.TargetingPackRoot.OriginalValue, fileElement.Attribute("Path").Value) : 437string dllPath = Path.Combine(targetingPackDllFolder, assemblyName + ".dll"); 447var 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)
241if (IsPdbCompilation && string.Equals(Path.GetFileName(reference.ItemSpec), Path.GetFileName(_outputR2RImage), StringComparison.OrdinalIgnoreCase)) 333result.AppendLine($"--pdb-path:{Path.GetDirectoryName(_outputPDBImage)}"); 338result.AppendLine($"--perfmap-path:{Path.GetDirectoryName(_outputPDBImage)}"); 440Directory.CreateDirectory(Path.GetDirectoryName(_outputR2RImage));
RuntimeGraphCache.cs (1)
31if (!Path.IsPathRooted(runtimeJsonPath))
SingleProjectInfo.cs (2)
90string outputName = Path.GetFileName(projectReferencePath.ItemSpec); 91string name = Path.GetFileNameWithoutExtension(outputName);
src\sdk\src\Cli\dotnet\Installer\Windows\TrustedMachinePath.cs (6)
58public static string ProgramDataDotnetRoot { get; } = Path.Combine( 67string fullPath = Path.GetFullPath(path); 68string fullRoot = Path.GetFullPath(root).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 71fullPath.StartsWith(fullRoot + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase);
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
src\sdk\src\Common\HotReloadKeyPair.cs (2)
46var directory = Path.GetDirectoryName(privateKeyPath); 52directory = Path.GetDirectoryName(publicKeyPath);
src\sdk\src\Common\PathComponentUtilities.cs (3)
16!Path.IsPathRooted(value) && 17value.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 && 18(Path.DirectorySeparatorChar != '\\' ||
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
Microsoft.NET.HostModel (7)
AppHost\HostWriter.cs (2)
126string destinationFileName = Path.GetFileName(appHostDestinationFilePath); 201if (Path.IsPathRooted(searchOptions.AppRelativeDotNet))
Bundle\Bundler.cs (4)
53if (!string.IsNullOrEmpty(Path.GetDirectoryName(hostName))) 59_outputDir = Path.GetFullPath(string.IsNullOrEmpty(outputDir) ? Environment.CurrentDirectory : outputDir); 216if (Path.GetExtension(fileSpec.BundleRelativePath).ToLowerInvariant().Equals(".pdb")) 315string bundlePath = Path.Combine(_outputDir, _hostName);
Bundle\TargetInfo.cs (1)
93return (IsWindows ? Path.GetFileNameWithoutExtension(hostName) : hostName);
Microsoft.NET.ProjectData (141)
CacheFileReader.cs (9)
304 string projectDirectory = Path.GetDirectoryName(projectFilePath)!; 612 string nativeValue = value.Replace('/', Path.DirectorySeparatorChar); 613 if (Path.IsPathRooted(nativeValue)) 615 return Path.GetFullPath(nativeValue); 873 string analyzerDir = Path.Join(packageDir, "analyzers", "dotnet", "cs"); 1006 string filename = Path.GetFileName(packRef); 1178 explicitBasenames.Add(Path.GetFileName(r.FilePath)); 1185 string filename = Path.GetFileName(packRef); 1202 set.Add(Path.GetFileName(p));
CachePathResolver.cs (51)
148 string? sdkParent = Path.GetDirectoryName(sdkDirectory.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 149 if (sdkParent is null || !string.Equals(Path.GetFileName(sdkParent), "sdk", StringComparison.OrdinalIgnoreCase)) 154 string? dotnetRoot = Path.GetDirectoryName(sdkParent); 179 return Path.GetFullPath(Path.Join(projectDirectory, portablePath.Replace('/', Path.DirectorySeparatorChar))); 208 if (Path.IsPathRooted(body)) return false; 226 string objDir = Path.Combine(projectDirectory, "obj"); 236 return Path.Combine(objDir, "NuGet"); 239 string nativeSuffix = packageRelativePath.Replace('/', Path.DirectorySeparatorChar); 269 return Path.Combine(objDir, "NuGet", nativeSuffix); 286 : $"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}{configurationName}{Path.DirectorySeparatorChar}"; 290 string excludeDebug = $"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}Debug{Path.DirectorySeparatorChar}"; 315 string candidate = Path.Combine(hashDir, nativeSuffix); 374 PathSentinels.NetFxRef => this.ResolveNetFrameworkReferenceAssembly(body) ?? body.Replace('/', Path.DirectorySeparatorChar), 376 PathSentinels.Path => Path.GetFullPath(Path.Join(projectDirectory, body.Replace('/', Path.DirectorySeparatorChar))), 411 return relative.Replace('/', Path.DirectorySeparatorChar); 432 return this.ResolveNetFrameworkReferenceAssembly(body) ?? body.Replace('/', Path.DirectorySeparatorChar); 470 return relativePart.Replace('/', Path.DirectorySeparatorChar); 488 string candidate = Path.Join(root, "sdk", sdkVersion); 505 return NormalizeFolderPath(Path.Join(root, "sdk", sdkVersion)); 531 string packDir = Path.Join(root, "packs", packName); 536 string versionName = Path.GetFileName(versionDir); 660 string candidate = Path.Join(packageDirectory, "build", ".NETFramework", entry.Replace('/', Path.DirectorySeparatorChar)); 762 string file = Path.Join(this.netSdkPath, "Sdks", "Microsoft.NET.Sdk", "analyzers", "build", "config", fileName); 811 string file = Path.Join(this.netSdkPath, "Sdks", "Microsoft.NET.Sdk", "codestyle", language, "build", "config", $"analysislevelstyle_{mode.ToLowerInvariant()}.globalconfig"); 874 string targetsPath = Path.Join(sdkPath, "Sdks", "Microsoft.NET.Sdk", "targets", "Microsoft.NET.Sdk.Analyzers.targets"); 1050 string sdkVersion = Path.GetFileName(sdkPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); 1111 string versionName = Path.GetFileName(versionDir); 1127 string direct = Path.Join(parent, childName); 1133 string lower = Path.Join(parent, childName.ToLowerInvariant()); 1145 && value.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 1269 string defaultFolder = Path.Join(userProfile, ".nuget", "packages"); 1296 yield return Path.Join(programFiles, "dotnet"); 1313 yield return Path.Join(userHome, ".dotnet"); 1325 string candidate = Path.Join(programFilesX86, "Reference Assemblies", "Microsoft", "Framework", ".NETFramework"); 1338 string full = Path.GetFullPath(path); 1340 if (!full.EndsWith(Path.DirectorySeparatorChar)) 1342 full += Path.DirectorySeparatorChar; 1355 suffix.Replace('/', Path.DirectorySeparatorChar);
Donor\ProjectDataDonorIndex.cs (27)
81 Directory.CreateDirectory(Path.GetDirectoryName(lockPath)!); 103 ? Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName) 121 ? Path.GetFullPath(indexPathOverride) 132 candidateIndexPath ??= Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName); 143 string normalizedRoot = EnsureTrailingDirectorySeparator(Path.GetFullPath(root)); 144 string normalizedFullPath = Path.GetFullPath(fullPath); 151 return relativePath.Length > 0 && !relativePath.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal); 156 if (path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) || 157 path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 162 return path + Path.DirectorySeparatorChar; 170 string fullPath = Path.GetFullPath(path); 171 string root = Path.GetPathRoot(fullPath) ?? string.Empty; 173 ? fullPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) 194 string? current = Path.GetDirectoryName(Path.GetFullPath(projectFilePath)); 198 string gitPath = Path.Combine(currentDirectory, ".git"); 232 gitDirectory = Path.IsPathRooted(value) 233 ? Path.GetFullPath(value) 234 : Path.GetFullPath(Path.Combine(Path.GetDirectoryName(gitFilePath)!, value)); 245 string commonDirFilePath = Path.Combine(gitDirectory, "commondir"); 251 return Path.IsPathRooted(commonDir) 252 ? Path.GetFullPath(commonDir) 253 : Path.GetFullPath(Path.Combine(gitDirectory, commonDir));
Donor\ProjectDataDonorIndex.Git.cs (8)
42 string gitPath = Path.Combine(workspaceRoot, ".git"); 63 string headPath = Path.Combine(gitDirectory, "HEAD"); 80 AppendFileFingerprint(fingerprint, Path.Combine(commonGitDirectory, "packed-refs"), gitQueryContext); 81 AppendFileFingerprint(fingerprint, Path.Combine(commonGitDirectory, "reftable", "tables.list"), gitQueryContext); 84 AppendFileFingerprint(fingerprint, Path.Combine(gitDirectory, "reftable", "tables.list"), gitQueryContext); 268 string relativePath = refName.Replace('/', Path.DirectorySeparatorChar); 269 string worktreeRefPath = Path.Combine(gitDirectory, relativePath); 274 : Path.Combine(commonGitDirectory, relativePath),
Donor\ProjectDataDonorIndex.Reader.cs (2)
76 string donorProjectFilePath = Path.GetFullPath(Path.Combine(entry.Path, relativeProjectPath));
Donor\ProjectDataDonorIndex.Selection.cs (3)
26 Path.GetFullPath(indexPath), 27 Path.GetFullPath(workspaceRoot), 135 string cacheKey = Path.GetFullPath(workspaceRoot);
Donor\ProjectDataDonorIndex.Serialization.cs (2)
88 normalizedPath = Path.GetFullPath(entryPath); 105 Directory.CreateDirectory(Path.GetDirectoryName(indexPath)!);
FrameworkListExpander.cs (3)
57 string manifestPath = Path.Join(packDir, "data", "FrameworkList.xml"); 88 string absolutePath = Path.Join(packDir, path.Replace('/', Path.DirectorySeparatorChar));
ProjectDataBuildAttemptManifest.cs (1)
34 return Path.Combine(receiptDirectory, FileName);
ProjectDataBuildReceipt.cs (11)
29 return Path.Combine(receiptDirectory, fileName); 35 return Path.Combine(receiptDirectory, AggregateCompletionFileName); 44 string fullProjectPath = Path.GetFullPath(projectFilePath); 177 string fullPath = Path.GetFullPath(projectFilePath); 185 Path.GetFullPath(left).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 186 Path.GetFullPath(right).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 191 string? directory = Path.GetDirectoryName(path);
SdkKnownFrameworkReferenceResolver.cs (8)
63 string propsPath = Path.Combine(sdkPath, "Microsoft.NETCoreSdk.BundledVersions.props"); 124 string full = Path.GetFullPath(sdkPath); 125 if (string.Equals(Path.GetFileName(full.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)), "Sdks", StringComparison.OrdinalIgnoreCase)) 127 full = Path.GetDirectoryName(full.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) ?? full;
UnsupportedProjectDataMarker.cs (11)
58 !PathsEqual(markerProjectPath, Path.GetFullPath(projectFilePath))) 107 string? directory = Path.GetDirectoryName(markerPath); 116 $"project={Path.GetFullPath(projectFilePath)}\n" + 158 => ComputeFileFingerprint(Path.GetFullPath(projectFilePath), cancellationToken); 165 string? directory = Path.GetDirectoryName(Path.GetFullPath(projectFilePath)); 172 string candidate = Path.Combine(directory, fileName); 175 inputs.Add(Path.GetFullPath(candidate)); 270 => string.Equals(Path.GetFullPath(left), Path.GetFullPath(right), IsCaseSensitiveFileSystem() ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); 277 string normalized = Path.GetFullPath(path);
UserFolderCachePath.cs (5)
56 return Path.Combine(baseDir, hex.Substring(0, 2), hex.Substring(2)); 93 return Path.Combine(localAppData, "Microsoft", CacheDirectoryName); 101 return Path.Combine(home, "Library", "Caches", CacheDirectoryName); 109 return Path.Combine(xdgCacheHome!, CacheDirectoryName); 115 return Path.Combine(home, ".cache", CacheDirectoryName);
Microsoft.NET.ProjectData.Generators (1)
DataModelSchemaGenerator.cs (1)
44 if (Path.GetFileName(file.Path).Equals(SchemaFileName, StringComparison.OrdinalIgnoreCase))
Microsoft.NET.ProjectData.Tasks (127)
AnalyzerConfigFileFilter.cs (15)
94 string? directory = Path.GetDirectoryName(resolver.ToAbsolutePath(itemSpec)); 118 IsSameOrAncestorDirectory(Path.GetDirectoryName(path) ?? string.Empty, sourceDirectory))) 129 string editorConfigDirectory = Path.GetDirectoryName(editorConfigPath) ?? string.Empty; 144 string rootDirectory = Path.GetDirectoryName(rootEditorConfigPath) ?? string.Empty; 180 => string.Equals(Path.GetFileName(path), ".editorconfig", StringComparison.OrdinalIgnoreCase); 197 string normalizedLeft = Path.GetFullPath(left).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 198 string normalizedRight = Path.GetFullPath(right).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 205 return normalized + Path.DirectorySeparatorChar; 209 => Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
CachePathResolver.cs (22)
26 this.projectDir = Path.GetDirectoryName(projectFilePath) ?? string.Empty; 27 bool caseInsensitive = Path.DirectorySeparatorChar == '\\'; 38 bool caseInsensitive = Path.DirectorySeparatorChar == '\\'; 79 return Path.IsPathRooted(inputPath) 80 ? Path.GetFullPath(inputPath) 81 : Path.GetFullPath(Path.Combine(this.projectDir, inputPath)); 219 if (Path.DirectorySeparatorChar != '\\') 265 bool ci = Path.DirectorySeparatorChar == '\\'; 297 return [NormalizeFolderPath(Path.Combine(userProfile, ".nuget", "packages"))]; 317 if (Path.DirectorySeparatorChar == '\\') 320 if (!string.IsNullOrEmpty(programFiles)) Add(Path.Combine(programFiles, "dotnet")); 329 if (!string.IsNullOrEmpty(userHome)) Add(Path.Combine(userHome, ".dotnet")); 335 if (string.IsNullOrWhiteSpace(hostPath) || !Path.IsPathRooted(hostPath)) return null; 336 return Path.GetDirectoryName(Path.GetFullPath(hostPath)); 343 DirectoryInfo sdkVersionDirectory = new DirectoryInfo(Path.GetFullPath(sdkPath)); 351 if (Path.DirectorySeparatorChar != '\\') return null; 354 string candidate = Path.Combine(pfx86, "Reference Assemblies", "Microsoft", "Framework", ".NETFramework"); 360 string full = Path.GetFullPath(path); 361 if (full.Length == 0 || full[full.Length - 1] != Path.DirectorySeparatorChar) 362 full += Path.DirectorySeparatorChar;
MergeProjectDataSlicesTask.cs (3)
224 PathsEqual(this.ResolvedOutputPath, Path.GetFullPath(this.ProjectFilePath) + ".lscache")) 241 Path.GetFullPath(left), 242 Path.GetFullPath(right),
ProjectDataBuildCompletionLogger.cs (1)
542 string extension = Path.GetExtension(path);
ProjectDataMerger.cs (7)
115 string fullPath = Path.GetFullPath(file); 226 baseDir = sliceGlob.Substring(0, starStar).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 228 string rest = sliceGlob.Substring(starStar + 2).TrimStart(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 233 baseDir = Path.GetDirectoryName(sliceGlob) ?? "."; 235 pattern = Path.GetFileName(sliceGlob);
ProjectDataWriter.cs (17)
532 string? outputDir = Path.GetDirectoryName(outputPath); 539 string tempPath = Path.Combine(tempDir, Path.GetFileName(outputPath) + "." + Guid.NewGuid().ToString("N") + ".tmp"); 567 string full = Path.GetFullPath(tempDirectory!); 569 !string.Equals(Path.GetPathRoot(full), Path.GetPathRoot(Path.GetFullPath(fallback)), StringComparison.OrdinalIgnoreCase)) 689 string projectDirectory = Path.GetDirectoryName(projectFilePath) ?? string.Empty; 700 string absolutePath = Path.IsPathRooted(item.ItemSpec) 701 ? Path.GetFullPath(item.ItemSpec) 702 : Path.GetFullPath(Path.Combine(projectDirectory, item.ItemSpec)); 717 if (IsNetFrameworkCoreAssemblyName(Path.GetFileName(item.ItemSpec)) && !File.Exists(absolutePath)) 739 if (arg.IndexOfAny(Path.GetInvalidPathChars()) >= 0) 742 return Path.IsPathRooted(arg); 755 string extension = Path.GetExtension(arg); 1392 && !Path.GetFileName(relativePath).Contains("..", StringComparison.Ordinal);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\Donor\ProjectDataDonorIndex.cs (27)
81 Directory.CreateDirectory(Path.GetDirectoryName(lockPath)!); 103 ? Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName) 121 ? Path.GetFullPath(indexPathOverride) 132 candidateIndexPath ??= Path.Combine(gitCommonDirectory, IndexDirectoryName, IndexFileName); 143 string normalizedRoot = EnsureTrailingDirectorySeparator(Path.GetFullPath(root)); 144 string normalizedFullPath = Path.GetFullPath(fullPath); 151 return relativePath.Length > 0 && !relativePath.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal); 156 if (path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) || 157 path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 162 return path + Path.DirectorySeparatorChar; 170 string fullPath = Path.GetFullPath(path); 171 string root = Path.GetPathRoot(fullPath) ?? string.Empty; 173 ? fullPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) 194 string? current = Path.GetDirectoryName(Path.GetFullPath(projectFilePath)); 198 string gitPath = Path.Combine(currentDirectory, ".git"); 232 gitDirectory = Path.IsPathRooted(value) 233 ? Path.GetFullPath(value) 234 : Path.GetFullPath(Path.Combine(Path.GetDirectoryName(gitFilePath)!, value)); 245 string commonDirFilePath = Path.Combine(gitDirectory, "commondir"); 251 return Path.IsPathRooted(commonDir) 252 ? Path.GetFullPath(commonDir) 253 : Path.GetFullPath(Path.Combine(gitDirectory, commonDir));
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\Donor\ProjectDataDonorIndex.Serialization.cs (2)
88 normalizedPath = Path.GetFullPath(entryPath); 105 Directory.CreateDirectory(Path.GetDirectoryName(indexPath)!);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\ProjectDataBuildAttemptManifest.cs (1)
34 return Path.Combine(receiptDirectory, FileName);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\ProjectDataBuildReceipt.cs (11)
29 return Path.Combine(receiptDirectory, fileName); 35 return Path.Combine(receiptDirectory, AggregateCompletionFileName); 44 string fullProjectPath = Path.GetFullPath(projectFilePath); 177 string fullPath = Path.GetFullPath(projectFilePath); 185 Path.GetFullPath(left).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 186 Path.GetFullPath(right).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar), 191 string? directory = Path.GetDirectoryName(path);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\UnsupportedProjectDataMarker.cs (11)
58 !PathsEqual(markerProjectPath, Path.GetFullPath(projectFilePath))) 107 string? directory = Path.GetDirectoryName(markerPath); 116 $"project={Path.GetFullPath(projectFilePath)}\n" + 158 => ComputeFileFingerprint(Path.GetFullPath(projectFilePath), cancellationToken); 165 string? directory = Path.GetDirectoryName(Path.GetFullPath(projectFilePath)); 172 string candidate = Path.Combine(directory, fileName); 175 inputs.Add(Path.GetFullPath(candidate)); 270 => string.Equals(Path.GetFullPath(left), Path.GetFullPath(right), IsCaseSensitiveFileSystem() ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase); 277 string normalized = Path.GetFullPath(path);
src\roslyn\src\ProjectData\Microsoft.NET.ProjectData\UserFolderCachePath.cs (5)
56 return Path.Combine(baseDir, hex.Substring(0, 2), hex.Substring(2)); 93 return Path.Combine(localAppData, "Microsoft", CacheDirectoryName); 101 return Path.Combine(home, "Library", "Caches", CacheDirectoryName); 109 return Path.Combine(xdgCacheHome!, CacheDirectoryName); 115 return Path.Combine(home, ".cache", CacheDirectoryName);
WriteProjectDataBuildReceiptTask.cs (2)
59 string receiptPath = ProjectDataBuildReceipt.GetReceiptFilePath(Path.GetTempPath(), this.ProjectFilePath); 60 this.ProjectId = Path.GetFileNameWithoutExtension(receiptPath);
WriteProjectDataSliceTask.cs (3)
254 string projectFolderOutputPath = Path.GetFullPath(this.ProjectFilePath) + ".lscache"; 260 Path.GetFullPath(left), 261 Path.GetFullPath(right),
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (20)
BrotliCompress.cs (4)
14private static readonly char[] InvalidPathChars = Path.GetInvalidFileNameChars(); 33protected override string ToolName => Path.GetDirectoryName(DotNetPath); 87var outputRelativePath = Path.Combine(OutputDirectory, CalculateTargetPath(inputFullPath, ".br")); 88var outputFullPath = Path.GetFullPath(outputRelativePath);
GenerateBlazorWebAssemblyBootJson50.cs (1)
156result.config.Add(Path.GetFileName(configFile.ItemSpec));
GZipCompress.cs (3)
40inputFullPaths[i] = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(FilesToCompress[i].ItemSpec)); 50var outputRelativePath = Path.Combine(OutputDirectory, targetFileName); 51var outputFullPath = Path.Combine(outputDirectory.Value, targetFileName);
parent\parent\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (11)
908return Path.Combine(normalizedPrefix, computedBasePath, route) 1137RelatedAsset = !string.IsNullOrEmpty(RelatedAsset) ? Path.GetFullPath(env.GetAbsolutePath(RelatedAsset)) : RelatedAsset; 1147=> Path.GetFullPath(string.IsNullOrEmpty(path) ? path : env.GetAbsolutePath(path)) + 1149(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch 1153(false, false) => Path.DirectorySeparatorChar 1239var fxDir = Path.Combine(intermediateOutputPath, "fx", originalSourceId); 1241var destPath = Path.Combine(fxDir, Normalize(fileSystemRelativePath)); 1243destPath = Path.GetFullPath(env.GetAbsolutePath(destPath)); 1257var destDir = Path.GetDirectoryName(destPath); 1545var pathWithTokens = Path.Combine(prefix, computedBasePath, RelativePath)
UpgradeLegacyWasmStaticWebAssets.cs (1)
34if (string.Equals(Path.GetExtension(legacyAsset.RelativePath), ".gz", StringComparison.Ordinal))
Microsoft.NET.Sdk.Publish.Tasks (56)
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 (1)
152string zipFileFullPath = Path.Combine(tempSubdirectory, "Publish.zip");
Tasks\MsDeploy\MSDeploy.cs (7)
266string msdeployExePath = Path.Combine("IIS", "Microsoft Web Deploy V3"); 267m_exePath = Path.Combine(programFiles, msdeployExePath); 268if (!File.Exists(Path.Combine(m_exePath, ToolName))) 275m_exePath = Path.Combine(programFiles, msdeployExePath); 281m_exePath = Path.Combine(programFiles, msdeployExePath); 1016commandLine.AppendSwitchIfNotNull("-webServerManifest:", Path.GetFileName(WebServerManifest)); 1039string result = ExePath is null ? string.Empty : Path.Combine(ExePath, ToolName);
Tasks\OneDeploy\CreatePackageFile.cs (1)
49var packageFilePath = Path.Combine(IntermediateTempPath, packageFileName);
Tasks\OneDeploy\OneDeploy.WebJob.cs (1)
39publishUri, username, password, DefaultRequestContentType, userAgent, Path.GetFileName(fileToPublish), Encoding.UTF8, fileToPublishStream, cancellationToken);
Tasks\TransformAppSettings.cs (4)
65sourceAppSettingsFilePath = Path.Combine(ProjectDirectory, SourceAppSettingsName); 69DestinationAppSettingsName = $"{Path.GetFileNameWithoutExtension(SourceAppSettingsName)}.{EnvironmentName}{Path.GetExtension(SourceAppSettingsName)}"; 74destinationAppSettingsFilePath = Path.Combine(PublishDirectory, DestinationAppSettingsName);
Tasks\TransformWebConfig.cs (9)
83publishWebConfigPath = Path.Combine(PublishDir, defaultWebConfigPath); 90publishWebConfigPath = Path.Combine(PublishDir, Path.GetFileName(projectWebConfigPath)); 93publishWebConfigPath = Path.GetFullPath(publishWebConfigPath); 127string? outputFile = Path.GetFileName(TargetPath) ?? string.Empty; 158var projectDirectory = Path.GetDirectoryName(projectPath); 164.FirstOrDefault(file => string.Equals(Path.GetFileName(file), defaultWebConfigName, StringComparison.OrdinalIgnoreCase)); 165var webConfigFileName = currentWebConfigFileName == null ? defaultWebConfigName : Path.GetFileName(currentWebConfigFileName); 166var projectWebConfigPath = Path.Combine(projectDirectory, webConfigFileName);
Tasks\WebJobs\GenerateRunCommandFile.cs (2)
27bool isRunCommandFilePresent = ProjectDirectory is not null && File.Exists(Path.Combine(ProjectDirectory, runCmdFileName)); 33File.WriteAllText(Path.Combine(WebJobsDirectory, runCmdFileName), command);
Tasks\ZipDeploy\CreateZipFile.cs (1)
30CreatedZipPath = Path.Combine(PublishIntermediateTempPath, zipFileName);
WebConfigTelemetry.cs (4)
60string? solutionDirectory = Path.GetDirectoryName(projectFileFullPath); 104string? solutionFileDirectory = Path.GetDirectoryName(solutionFileFullPath); 107string projectFullPathConstructed = Path.Combine(solutionFileDirectory, projectRelativePath); 108projectFullPathConstructed = Path.GetFullPath((new Uri(projectFullPathConstructed)).LocalPath);
WebConfigTransform.cs (7)
93var appPath = Path.Combine(".", appName).Replace("/", "\\"); 98appPath = Path.ChangeExtension(appPath, !string.IsNullOrWhiteSpace(extension) ? extension : null); 102else if (string.Equals(Path.GetExtension(appPath), ".exe", StringComparison.OrdinalIgnoreCase)) 104appPath = Path.ChangeExtension(appPath, ".exe"); 131var logPath = Path.Combine(configureForAzure ? @"\\?\%home%\LogFiles" : @".\logs", "stdout").Replace("/", "\\"); 149string? projectFolder = Path.GetDirectoryName(projectFullPath); 152projectWebConfigPath = Path.Combine(projectFolder, "web.config");
WebJobsCommandGenerator.cs (4)
10string? appName = Path.GetFileName(targetPath); 15command = Path.ChangeExtension(appName, !string.IsNullOrWhiteSpace(executableExtension) ? executableExtension : null); 25if (string.Equals(Path.GetExtension(targetPath), ".exe", StringComparison.OrdinalIgnoreCase)) 27command = Path.ChangeExtension(appName, ".exe");
Microsoft.NET.Sdk.Razor.Tasks (21)
DotnetToolTask.cs (3)
154var clientDir = Path.GetFullPath(Path.GetDirectoryName(ToolAssembly)); 285var toolCommand = Path.GetFileNameWithoutExtension(ToolAssembly) + " " + Command;
parent\Tool\PipeName.cs (1)
47baseDirectory = baseDirectory.TrimEnd(Path.DirectorySeparatorChar);
parent\Tool\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)) 295if (exeName.Equals(Path.GetFileName(expectedPath), StringComparison.Ordinal)) 301var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); 304var dotnetPath = Path.Combine(path, exeName); 320var expectedCompilerPath = Path.Combine(clientDir, ServerName); 425public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 426public static bool IsUnix => Path.DirectorySeparatorChar == '/';
parent\Tool\ServerProtocol\ServerLogger.cs (1)
48loggingFileName = Path.Combine(loggingFileName, $"razorserver.{GetCurrentProcessId()}.log");
SdkRazorGenerate.cs (2)
122var outputPath = Path.Combine(ProjectRoot, input.GetMetadata(GeneratedOutput)); 201builder.AppendLine(Path.GetFullPath(Extensions[i].GetMetadata(AssemblyFilePath)));
SdkRazorTagHelper.cs (2)
67if (!Path.IsPathRooted(Assemblies[i])) 116builder.AppendLine(Path.GetFullPath(Extensions[i].GetMetadata(AssemblyFilePath)));
Microsoft.NET.Sdk.StaticWebAssets.Tasks (77)
CollectStaticWebAssetsToCopy.cs (2)
48fileOutputPath = Path.Combine(normalizedOutputPath, asset.ComputeTargetPath("", Path.DirectorySeparatorChar, StaticWebAssetTokenResolver.Instance));
Compression\BrotliCompress.cs (3)
24protected override string ToolName => Path.GetDirectoryName(DotNetPath); 75.Select(f => Path.GetDirectoryName(f.ItemSpec)) 89var outputFullPath = Path.GetFullPath(outputRelativePath);
Compression\DiscoverPrecompressedAssets.cs (1)
60Path.GetFileNameWithoutExtension(candidate.RelativePath));
Compression\GZipCompress.cs (1)
20.Select(f => Path.GetDirectoryName(f.ItemSpec))
Compression\ResolveCompressedAssets.cs (2)
123var outputPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(OutputPath)); 196return Path.Combine(outputPath, $"{pathHash}-{{0}}-{asset.Fingerprint}");
ComputeReferenceStaticWebAssetItems.cs (4)
81groupedAsset.OriginalItemSpec = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(groupedAsset.OriginalItemSpec)); 105selected.OriginalItemSpec = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(selected.OriginalItemSpec)); 165var directory = Path.GetDirectoryName(asset.Identity); 169directory = Path.GetDirectoryName(directory);
ComputeStaticWebAssetsTargetPaths.cs (4)
33var separator = UseAlternatePathDirectorySeparator ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar; 46if (AdjustPathsForPack && string.IsNullOrEmpty(Path.GetExtension(targetPath))) 48targetPath = Path.GetDirectoryName(targetPath);
Data\ContentTypeProvider.cs (4)
428var fileNameSpan = Path.GetFileName(context.Path); 483var extension = Path.GetExtension(fileName); 487var fileNameNoExtension = Path.GetFileNameWithoutExtension(fileName); 488if (!Path.GetExtension(fileNameNoExtension).Equals("", StringComparison.Ordinal))
Data\StaticWebAsset.cs (11)
908return Path.Combine(normalizedPrefix, computedBasePath, route) 1137RelatedAsset = !string.IsNullOrEmpty(RelatedAsset) ? Path.GetFullPath(env.GetAbsolutePath(RelatedAsset)) : RelatedAsset; 1147=> Path.GetFullPath(string.IsNullOrEmpty(path) ? path : env.GetAbsolutePath(path)) + 1149(path.EndsWith(Path.DirectorySeparatorChar.ToString()), path.EndsWith(Path.AltDirectorySeparatorChar.ToString())) switch 1153(false, false) => Path.DirectorySeparatorChar 1239var fxDir = Path.Combine(intermediateOutputPath, "fx", originalSourceId); 1241var destPath = Path.Combine(fxDir, Normalize(fileSystemRelativePath)); 1243destPath = Path.GetFullPath(env.GetAbsolutePath(destPath)); 1257var destDir = Path.GetDirectoryName(destPath); 1545var pathWithTokens = Path.Combine(prefix, computedBasePath, RelativePath)
DefineStaticWebAssetEndpoints.cs (2)
233var finalRoute = asset.IsProject() || asset.IsPackage() ? StaticWebAsset.Normalize(Path.Combine(asset.BasePath, route)) : route; 352var finalRoute = asset.IsProject() || asset.IsPackage() ? StaticWebAsset.Normalize(Path.Combine(asset.BasePath, route)) : route;
DefineStaticWebAssets.Cache.cs (1)
90var candidateFullPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec));
DefineStaticWebAssets.cs (17)
133if (Path.IsPathRooted(candidateMatchPath) && candidateMatchPath == candidate.ItemSpec) 135var normalizedAssetPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec)); 136var normalizedDirectoryPath = Path.GetDirectoryName(BuildEngine.ProjectFileOfTaskNode); 144var withSeparator when withSeparator[withSeparator.Length - 1] == Path.DirectorySeparatorChar || withSeparator[withSeparator.Length - 1] == Path.AltDirectorySeparatorChar => normalizedDirectoryPath.Length, 236var identity = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec)); 281var fileNamePattern = Path.GetFileName(identity); 285identity = Path.Combine(Path.GetDirectoryName(identity) ?? string.Empty, expanded); 386var candidateFullPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec)); 416var identitySubPath = Path.GetDirectoryName(relativePath); 417var itemSpecFileName = Path.GetFileName(candidateFullPath); 418var relativeFileName = Path.GetFileName(relativePath); 424var finalIdentity = Path.Combine(normalizedContentRoot, identitySubPath ?? string.Empty, itemSpecFileName); 436var assetIdentity = Path.GetFullPath(Path.Combine(normalizedContentRoot, stem)); 504var normalizedAssetPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(candidate.ItemSpec));
FingerprintPatternMatcher.cs (6)
60var result = Path.Combine(directoryName.ToString(), $"{fileNamePrefix}{DefaultFingerprintExpression}{extension}"); 79var simpleExtensionResult = Path.Combine(directoryName.ToString(), $"{stem}{expression}{matchExtension}"); 124var fileName = Path.GetFileName(relativePathCandidate.Span); 125var directoryName = Path.GetDirectoryName(relativePathCandidate.Span); 126var stem = Path.GetFileNameWithoutExtension(relativePathCandidate.Span); 127var extension = Path.GetExtension(relativePathCandidate.Span);
GenerateStaticWebAssetEndpointsManifest.cs (1)
215var directoryName = Path.GetDirectoryName(exclusionCacheAbsolutePath);
JSModules\GenerateJSModuleManifest.cs (1)
49Directory.CreateDirectory(TaskEnvironment.GetAbsolutePathPreservingInvalidArguments(Path.GetDirectoryName(OutputFile)));
Legacy\GenerateV1StaticWebAssetsManifest.cs (3)
117var normalizedContentRoot = $"{contentRoot.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)}{Path.DirectorySeparatorChar}";
Legacy\ValidateStaticWebAssetsUniquePaths.cs (1)
70private static string GetWebRootPath(string webRoot, string basePath, string relativePath) => $"{webRoot}/{Path.Combine(basePath, relativePath.TrimStart('.').TrimStart('/')).Replace("\\", "/").Trim('/')}";
MergeConfigurationProperties.cs (1)
116var projectReferenceFullPath = Path.GetFullPath((string)TaskEnvironment.GetAbsolutePath(referenceMetadata));
OverrideHtmlAssetPlaceholders.cs (1)
95string outputPath = Path.Combine(OutputPath, FileHasher.HashString(item.ItemSpec) + item.GetMetadata("Extension"));
ReadPackageAssetsManifest.cs (3)
194return Path.GetFullPath(Path.Combine(packageRoot, relativePath.Replace('/', Path.DirectorySeparatorChar)));
ScopedCss\ConcatenateCssFiles.cs (2)
70var importPath = NormalizePath(Path.Combine(prefix, ProjectBundles[i].ItemSpec)); 101Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
ScopedCss\ConcatenateCssFiles50.cs (2)
70var importPath = NormalizePath(Path.Combine(prefix, bundleBasePath, relativePath)); 100Directory.CreateDirectory(Path.GetDirectoryName(OutputFile));
ScopedCss\RewriteCss.cs (1)
53Directory.CreateDirectory(Path.GetDirectoryName(outputFile));
src\sdk\src\Common\HotReloadKeyPair.cs (2)
46var directory = Path.GetDirectoryName(privateKeyPath); 52directory = Path.GetDirectoryName(publicKeyPath);
src\sdk\src\Tasks\Common\TaskEnvironmentExtensions.cs (1)
24_ = Path.GetFullPath(path);
Microsoft.NET.Sdk.WorkloadManifestReader (55)
SdkDirectoryWorkloadManifestProvider.cs (28)
92string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); 93string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); 109var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); 112knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); 130_manifestRoots = manifestDirectoryEnvironmentVariable.Split(Path.PathSeparator) 205_installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 302var installStateFilePath = Path.Combine(WorkloadInstallType.GetInstallStateFolder(_sdkVersionBand, _sdkOrUserLocalPath), "default.json"); 344var workloadManifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 363AddManifest(id, finalManifestDirectory, featureBand, version ?? Path.GetFileName(manifestDirectory)); 372var manifestVersionBandDirectory = Path.Combine(_manifestRoots[0], versionBandString); 387var manifestVersionBandDirectory = Path.Combine(manifestRoot, versionBandString); 392directoriesWithManifests[Path.GetFileName(workloadManifestDirectory)] = workloadManifestDirectory; 452AddManifest(missingManifestId, manifestDir, featureBand, Path.GetFileName(manifestDir)); 480string manifestId = Path.GetFileName(manifestDirectory); 488.Where(dir => File.Exists(Path.Combine(dir, "WorkloadManifest.json"))) 491return (directory: dir, version: Path.GetFileName(dir)); 500else if (File.Exists(Path.Combine(manifestDirectory, "WorkloadManifest.json"))) 502var manifestPath = Path.Combine(manifestDirectory, "WorkloadManifest.json"); 526.Select(dir => Path.GetFileName(dir)) 532.Select(featureBand => (featureBand, manifestDirectory: Path.Combine(sdkManifestPath, featureBand.ToString(), manifestId))) 557var specifiedManifestDirectory = Path.Combine(manifestDirectory, manifestSpecifier.FeatureBand.ToString(), manifestSpecifier.Id.ToString(), 559if (File.Exists(Path.Combine(specifiedManifestDirectory, "WorkloadManifest.json"))) 607var featureBandDirectory = Path.Combine(manifestRoot, workloadSetFeatureBand.Value.ToString()); 624var featureBandDirectoryName = Path.GetFileName(featureBandDirectory); 634var workloadSetsRoot = Path.Combine(featureBandDirectory, WorkloadSetsFolderName); 639var workloadSetVersion = Path.GetFileName(workloadSetDirectory); 668string globalJsonPath = Path.Combine(directory, "global.json"); 673directory = Path.GetDirectoryName(directory);
src\sdk\src\Cli\dotnet\Installer\Windows\TrustedMachinePath.cs (6)
58public static string ProgramDataDotnetRoot { get; } = Path.Combine( 67string fullPath = Path.GetFullPath(path); 68string fullRoot = Path.GetFullPath(root).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 71fullPath.StartsWith(fullRoot + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase);
src\sdk\src\Common\PathComponentUtilities.cs (3)
16!Path.IsPathRooted(value) && 17value.IndexOfAny(Path.GetInvalidFileNameChars()) < 0 && 18(Path.DirectorySeparatorChar != '\\' ||
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
TempDirectoryWorkloadManifestProvider.cs (2)
23string? workloadManifestPath = Path.Combine(workloadManifestDirectory, "WorkloadManifest.json"); 24var manifestId = Path.GetFileName(workloadManifestDirectory);
WorkloadInstallType.cs (3)
29dotnetDir is not null && File.Exists(Path.Combine( 40return Path.Combine(dotnetDir, "metadata", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState"); 44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
WorkloadManifestReader.Localization.cs (4)
26var catalog = Path.Combine(localizationDir, $"WorkloadManifest.{culture.Name}.json"); 55var cultureName = Path.GetFileNameWithoutExtension(filePath).Substring("WorkloadManifest.".Length); 64string manifestDir = Path.GetDirectoryName(manifestFilePath) ?? throw new ArgumentException(nameof(manifestFilePath)); 65string localizationDir = Path.Combine(manifestDir, "localize");
WorkloadResolver.cs (6)
30string runtimeIdentifierChainPath = Path.Combine(dotnetRootPath, "sdk", sdkVersion, "NETCoreSdkRuntimeIdentifierChain.txt"); 48workloadRootPaths = packRootEnvironmentVariable!.Split(Path.PathSeparator).Select(path => new WorkloadRootPath(path, false)).Concat(workloadRootPaths).ToArray(); 329packPath = Path.Combine(rootPath.Path, "packs", resolvedPackageId.ToString(), packageVersion); 333packPath = Path.Combine(rootPath.Path, "template-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 337packPath = Path.Combine(rootPath.Path, "library-packs", resolvedPackageId.GetNuGetCanonicalId() + "." + packageVersion.ToLowerInvariant() + ".nupkg"); 341packPath = Path.Combine(rootPath.Path, "tool-packs", resolvedPackageId.ToString(), packageVersion);
WorkloadSet.cs (1)
100if (File.Exists(Path.Combine(path, "baseline.workloadset.json")))
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (20)
CachingWorkloadResolver.cs (5)
75string sentinelPath = Path.Combine(SdkPaths.SdkDirectory, "DisableWorkloadResolver.sentinel"); 182string sdkPackSdkFolder = Path.Combine(sdkPackInfo.Path, "Sdk"); 183string autoImportPath = Path.Combine(sdkPackSdkFolder, "AutoImport.props"); 200var workloadManifestTargetPath = Path.Combine(manifestDirectory, "WorkloadManifest.targets"); 216return new SinglePathResolutionResult(Path.Combine(packInfo.Path, "Sdk"));
parent\parent\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\FileBasedInstallationRecordInstaller.cs (8)
21.Where(band => Directory.Exists(Path.Combine(band, InstalledWorkloadDir)) && Directory.GetFiles(Path.Combine(band, InstalledWorkloadDir)).Any()) 22.Select(path => new SdkFeatureBand(Path.GetFileName(path))); 32var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir); 36.Select(file => new WorkloadId(Path.GetFileName(file))); 46var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString()); 49var pathDir = Path.GetDirectoryName(path); 60var path = Path.Combine(_workloadMetadataDir, featureBand.ToString(), InstalledWorkloadDir, workloadId.ToString());
parent\parent\Cli\dotnet\Commands\Workload\Install\WorkloadInstallRecords\WindowsWorkloadInstallationRecordReader.cs (1)
41using RegistryKey? workloadKey = baseKey.OpenSubKey(Path.Combine(basePath, $"{sdkFeatureBand}"));
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
src\sdk\src\Common\WorkloadFileBasedInstall.cs (2)
22Directory.CreateDirectory(Path.GetDirectoryName(filePath)!); 44return Path.Combine(dotnetDir, "metadata", "workloads", new SdkFeatureBand(sdkFeatureBand).ToString(), "userlocal");
WorkloadSdkResolver.cs (3)
52var sdkVersion = Path.GetFileName(sdkDirectory); 113startDir = Path.GetDirectoryName(context.SolutionFilePath); 117startDir = Path.GetDirectoryName(context.ProjectFilePath);
Microsoft.Private.Windows.Core (1)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\PathExtensions.cs (1)
8extension(Path)
Microsoft.SourceLink.AzureDevOpsServer.Git (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.AzureRepos.Git (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Bitbucket.Git (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Common (11)
GenerateSourceLinkFile.cs (4)
88var outputPath = Path.GetFullPath(path); 98var comparison = Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal; 99if (string.Equals(outputPath, Path.GetFullPath(path), comparison)) 320Directory.CreateDirectory(Path.GetDirectoryName(path)!);
parent\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Gitea (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.Gitee (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.GitHub (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.GitLab (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.SourceLink.GitWeb (7)
src\sourcelink\src\Common\Utilities\PathUtilities.cs (7)
15private static readonly char[] s_directorySeparators = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; 23if (Path.DirectorySeparatorChar == '\\') 45return last == Path.DirectorySeparatorChar || last == Path.AltDirectorySeparatorChar; 49=> path.EndsWithSeparator() ? path : path + Path.DirectorySeparatorChar; 87return Path.IsPathFullyQualified(path);
Microsoft.TemplateEngine.Cli (20)
Alias\AliasRegistry.cs (1)
20_aliasesFilePath = Path.Combine(_environmentSettings.Paths.HostVersionSettingsDir, "aliases.json");
CliTemplateEngineHost.cs (3)
32OutputPath = outputPath != null ? Path.Combine(workingPath, outputPath) : workingPath; 79string checkPath = Path.Join(workingPath, fileName); 83workingPath = 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)
50if (fileSystem.FileExists(Path.Combine(currentDirectory, "global.json")) || 51fileSystem.FileExists(Path.Combine(currentDirectory, ".git")) || 52fileSystem.DirectoryExists(Path.Combine(currentDirectory, ".git"))) 137string newJsonFilePath = Path.Combine(repoRoot ?? outputBasePath, jsonFileName); 288string? directory = fileSystem.DirectoryExists(startPath) ? startPath : Path.GetDirectoryName(startPath); 314directory = Path.GetPathRoot(directory) != directory ? Directory.GetParent(directory)?.FullName : null;
PostActionProcessors\PostActionProcessorBase.cs (3)
27outputBasePath = Path.GetFullPath(outputBasePath); 45results.Add(Path.GetFullPath(change.TargetRelativePath, outputBasePath)); 110.Select(p => Path.GetFullPath(p, outputBasePath))
PostActionProcessors\ProcessStartPostActionProcessor.cs (2)
114string executableCombinedFileName = Path.Combine(Path.GetFullPath(outputBasePath), executableFileName);
TemplateInvoker.cs (2)
126Path.Combine(_cliTemplateEngineHost.OutputPath, targetPath), 133char[] invalidChars = Path.GetInvalidFileNameChars();
Microsoft.TemplateEngine.Core (9)
Util\Orchestrator.cs (9)
130string targetPath = Path.Combine(targetDir, targetRel); 131string fullTargetDir = Path.GetDirectoryName(targetPath); 143string fileName = Path.GetFileName(sourceRel); 170string targetPath = Path.Combine(targetDir, targetRel); 174targetPath = Path.GetDirectoryName(targetPath); 175targetRel = Path.GetDirectoryName(targetRel); 214string fileName = Path.GetFileName(sourceRel); 279string targetPath = Path.Combine(targetDir, targetRel); 284string fullTargetDir = Path.GetDirectoryName(targetPath);
Microsoft.TemplateEngine.Edge (30)
BuiltInManagedProvider\GlobalSettings.cs (1)
30environmentSettings.Host.FileSystem.CreateDirectory(Path.GetDirectoryName(_globalSettingsFile));
BuiltInManagedProvider\GlobalSettingsTemplatePackageProvider.cs (2)
27string packagesFolder = Path.Combine(settings.Paths.GlobalSettingsDir, "packages"); 44string globalSettingsFilePath = Path.Combine(environmentSettings.Paths.GlobalSettingsDir, "packages.json");
DefaultPathInfo.cs (3)
103return Path.Combine(userDir, ".templateengine"); 116return Path.Combine(globalDir ?? GetDefaultGlobalSettingsDir(userDir!), host.HostIdentifier); 133return Path.Combine(globalDir ?? GetDefaultGlobalSettingsDir(userDir!), host.HostIdentifier, host.Version);
Installers\NuGet\NugetApiPackageManager.cs (2)
116string filePath = Path.Combine(downloadPath, packageMetadata.Identity.Id + "." + packageMetadata.Identity.Version + ".nupkg"); 130string stagedPackagePath = Path.Combine(stagingDirectory, "package.nupkg");
Installers\NuGet\NuGetInstaller.cs (1)
410string targetPackageLocation = Path.Combine(_installPath, packageInfo.PackageIdentifier + "." + packageInfo.PackageVersion + ".nupkg");
Mount\FileSystem\FileSystemDirectory.cs (3)
35string baseName = x.Substring(fileSystemMountPoint.MountPointRootPath.Length).Replace(Path.DirectorySeparatorChar, '/'); 60string baseName = x.Substring(((FileSystemMountPoint)MountPoint).MountPointRootPath.Length).Replace(Path.DirectorySeparatorChar, '/'); 85string baseName = x.Substring(((FileSystemMountPoint)MountPoint).MountPointRootPath.Length).Replace(Path.DirectorySeparatorChar, '/');
Mount\FileSystem\FileSystemMountPoint.cs (3)
43string fullPath = Path.Combine(MountPointRootPath, path.TrimStart('/')); 55string fullPath = Path.Combine(MountPointRootPath, path.TrimStart('/')); 61string fullPath = Path.Combine(MountPointRootPath, path.TrimStart('/'));
ReflectionLoadProbingPath.cs (7)
215DirectoryInfo info = new DirectoryInfo(Path.Combine(selector._path, stringName)); 221.Where(x => x.FullName.IndexOf($"{Path.DirectorySeparatorChar}lib{Path.DirectorySeparatorChar}", StringComparison.OrdinalIgnoreCase) > -1 222&& (x.FullName.IndexOf($"{Path.DirectorySeparatorChar}netstandard", StringComparison.OrdinalIgnoreCase) > -1 223|| x.FullName.IndexOf($"{Path.DirectorySeparatorChar}netcoreapp", StringComparison.OrdinalIgnoreCase) > -1)) 231else if (File.Exists(Path.Combine(selector._path, stringName + ".dll"))) 233FileInfo f = new FileInfo(Path.Combine(selector._path, stringName + ".dll"));
Settings\ComponentManager.cs (1)
215AddProbingPath(Path.GetDirectoryName(type.Assembly.Location));
Settings\Scanner.cs (2)
203string targetPath = Path.Combine(targetBasePath, Path.GetFileName(sourceLocation));
Settings\SettingsFilePaths.cs (5)
56string wholeTargetPath = Path.Combine(targetPath, localPath); 129return Path.GetFileName(path); 139current = Path.Combine(current, parts[i]); 156return Path.Combine(_environmentSettings.Paths.UserProfileDir, path.Substring(1)); 161return cache ??= Path.Combine(paths);
Microsoft.TemplateEngine.IDE (2)
Bootstrapper.cs (2)
53string hostSettingsDir = Path.Combine(hostSettingsLocation, host.HostIdentifier); 54string hostVersionSettingsDir = Path.Combine(hostSettingsLocation, host.HostIdentifier, host.Version);
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (5)
RunnableProjectConfig.cs (1)
266if ((singleConfig.IndexOfAny(Path.GetInvalidPathChars()) != -1)
RunnableProjectGenerator.cs (4)
146string target = Path.Combine(targetDirectory, source.Target); 158Path.Combine(source.Source, fileChange.SourceRelativePath), 159Path.Combine(source.Target, fileChange.TargetRelativePath), 321string target = Path.Combine(targetDirectory, source.Target);
Microsoft.TemplateEngine.Utils (31)
FileFindHelpers.cs (2)
14string? directory = fileSystem.DirectoryExists(startPath) ? startPath : Path.GetDirectoryName(startPath); 26directory = Path.GetPathRoot(directory) != directory ? Directory.GetParent(directory).FullName : null;
FileSystemInfoExtensions.cs (2)
16using Stream f = source.MountPoint.EnvironmentSettings.Host.FileSystem.CreateFile(Path.Combine(target, file.Name)); 24dir.CopyTo(Path.Combine(target, dir.Name));
IFileSystemInfoExtensions.cs (1)
26result = Path.Combine(fileSystemInfo.MountPoint.MountPointUri, fileSystemInfo.FullPath.Trim('/', '\\'));
InMemoryFileSystem.cs (15)
22_root = new FileSystemDirectory(Path.GetFileName(root.TrimEnd('/', '\\')), root); 26_root = new FileSystemDirectory(Path.GetFileName(newRoot.TrimEnd('/', '\\')), newRoot); 53dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 77dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 86targetFile = new FileSystemFile(parts[parts.Length - 1], Path.Combine(currentDir.FullPath, parts[parts.Length - 1])); 451dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 507dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 565dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 597dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 628dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 659dir = new FileSystemDirectory(parts[i], Path.Combine(currentDir.FullPath, parts[i])); 699if (!Path.IsPathRooted(path)) 701path = Path.Combine(GetCurrentDirectory(), path); 742processedPath = string.Join(Path.DirectorySeparatorChar + string.Empty, realParts); 743if (processedPath.Equals(_root.FullPath) || processedPath.StartsWith(_root.FullPath.TrimEnd('/', '\\') + Path.DirectorySeparatorChar))
InstallRequestPathResolution.cs (6)
38var arr = Path.GetInvalidPathChars(); 63string searchTarget = Path.Combine(environmentSettings.Host.FileSystem.GetCurrentDirectory(), baseDir.Trim()); 64string parentFolder = Path.GetFullPath(Path.GetDirectoryName(searchTarget)); 65string searchPattern = Path.GetFileName(searchTarget); 70return new[] { Path.GetFullPath(searchTarget) };
PhysicalFileSystem.cs (5)
114string basePath = Path.GetFullPath(relativeTo); 115string sourceFullPath = Path.GetFullPath(target); 128FileSystemWatcher watcher = new FileSystemWatcher(Path.GetDirectoryName(filePath), Path.GetFileName(filePath)); 149char desiredDirectorySeparator = Path.DirectorySeparatorChar;
Microsoft.TemplateSearch.Common (2)
Providers\NuGetMetadataSearchProvider.cs (1)
105string preferredMetadataLocation = Path.Combine(_environmentSettings.Paths.HostVersionSettingsDir, TemplateDiscoveryMetadataFile);
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (1)
57string pathToConfig = Path.Combine(environmentSettings.Paths.HostVersionSettingsDir, filePath);
Microsoft.TestPlatform.AdapterUtilities (1)
src\vstest\src\Microsoft.TestPlatform.Hashing.Source\TestIdSeed.cs (1)
54fileNameOrSource = Path.GetFileName(source);
Microsoft.TestPlatform.Build (1)
Tasks\TestTaskUtils.cs (1)
403return StringUtils.IsNullOrEmpty(dotnetHostPath) ? null : Path.GetFullPath(dotnetHostPath);
Microsoft.TestPlatform.CommunicationUtilities (2)
DataCollectionRequestHandler.cs (2)
263datacollectorSearchPaths.Add(Path.GetDirectoryName(source)!); 276Path.GetFullPath(Environment.ExpandEnvironmentVariables(datacollectorSearchPath));
Microsoft.TestPlatform.CoreUtilities (14)
Helpers\DotnetHostHelper.cs (12)
114foreach (string path in pathString.Split(Path.PathSeparator)) 116string exeFullPath = Path.Combine(path.Trim(), executableBaseName); 140if (Path.GetFileName(currentProcessFileName) == _muxerName) 198muxerPath = Path.Combine(envVar, _muxerName); 265muxerPath = Path.Combine(_environmentVariableHelper.GetEnvironmentVariable("ProgramFiles(x86)")!, "dotnet", _muxerName); 271? Path.Combine(_environmentVariableHelper.GetEnvironmentVariable("ProgramFiles")!, "dotnet", "x64", _muxerName) 272: Path.Combine(_environmentVariableHelper.GetEnvironmentVariable("ProgramFiles")!, "dotnet", _muxerName); 281? Path.Combine("/usr/local/share/dotnet/x64", _muxerName) 282: Path.Combine("/usr/local/share/dotnet", _muxerName); 286muxerPath = Path.Combine("/usr/share/dotnet", _muxerName); 339string path = Path.Combine(installLocation.Trim(), _muxerName); 368string path = Path.Combine(content, _muxerName);
Helpers\FileHelper.cs (2)
87=> Path.GetFullPath(path); 118=> Path.GetTempPath();
Microsoft.TestPlatform.CrossPlatEngine (48)
Client\ProxyOperationManager.cs (2)
469: Path.ChangeExtension( 476Path.GetExtension(logFile))).AddDoubleQuote();
Constants.cs (1)
26internal static string DefaultAdapterLocation = Path.Combine(new ProcessHelper().GetCurrentProcessLocation(), "Extensions");
DataCollection\DefaultDataCollectionLauncher.cs (3)
55var dataCollectorDirectory = Path.GetDirectoryName(typeof(DefaultDataCollectionLauncher).Assembly.GetAssemblyLocation()); 67? Path.Combine(dataCollectorDirectory, "TestHostNetFramework", dataCollectorProcessName) 68: Path.Combine(dataCollectorDirectory, dataCollectorProcessName);
DataCollection\DotnetDataCollectionLauncher.cs (5)
64var dataCollectorDirectory = Path.GetDirectoryName(typeof(DefaultDataCollectionLauncher).Assembly.GetAssemblyLocation()); 67var dataCollectorAssemblyPath = Path.Combine(dataCollectorDirectory, DataCollectorProcessName); 68string dataCollectorFileName = Path.GetFileNameWithoutExtension(dataCollectorAssemblyPath); 73var runtimeConfigPath = Path.Combine(dataCollectorDirectory, string.Concat(dataCollectorFileName, ".runtimeconfig.json")); 87var depsFilePath = Path.Combine(dataCollectorDirectory, string.Concat(dataCollectorFileName, ".deps.json"));
DataCollection\InProcDataCollectionExtensionManager.cs (3)
73CodeBasePaths.Add(Path.GetDirectoryName(extensionPath)!); 243if (Path.IsPathRooted(codeBase)) 255var assemblyPath = Path.Combine(extensionPath, codeBase);
DataCollection\InProcDataCollector.cs (3)
75if (Path.GetFileName(codeBase) == Constants.CoverletDataCollectorCodebase) 82TPDebug.Assert(Path.IsPathRooted(codeBase), "Absolute path expected"); 83testPluginCache.AddResolverSearchDirectories([Path.GetDirectoryName(codeBase)!]);
DataCollection\ProxyDataCollectionManager.cs (4)
329return Path.ChangeExtension( 336Path.GetExtension(logFile))).AddDoubleQuote(); 350var extensionsFolder = Path.Combine(Path.GetDirectoryName(typeof(ITestPlatform).Assembly.GetAssemblyLocation())!, "Extensions");
Discovery\DiscovererEnumerator.cs (3)
301return Path.GetDirectoryName(discovererLocation)! 408Path.GetExtension(source), 486var fileExtension = Path.GetExtension(filePath);
Discovery\DiscoveryManager.cs (5)
257string src = !Path.IsPathRooted(source) ? Path.Combine(Directory.GetCurrentDirectory(), source) : source; 275src = !Path.IsPathRooted(source) ? Path.Combine(Path.GetDirectoryName(package)!, source) : source;
EventHandlers\PathConverter.cs (2)
39string normalizedLocalPath = fileHelper.GetFullPath(unquotedOriginalPath).TrimEnd('\\').TrimEnd('/') + Path.DirectorySeparatorChar; 43string normalizedDeploymentPath = fileHelper.GetFullPath(unquotedDeploymentPath).TrimEnd('\\').TrimEnd('/') + Path.DirectorySeparatorChar;
EventHandlers\TestRequestHandler.cs (1)
114? System.IO.Path.GetDirectoryName(currentProcessPath)
Execution\BaseRunTests.cs (1)
520executorsFromDeprecatedLocations |= Path.GetDirectoryName(executorLocation)!.Equals(CrossPlatEngine.Constants.DefaultAdapterLocation);
PostProcessing\ArtifactProcessingManager.cs (13)
86_processArtifactFolder = Path.Combine(_artifactsDirectory, _testSessionCorrelationId); 94_testSessionProcessArtifactFolder = Path.Combine(_processArtifactFolder, $"{pid}_{Guid.NewGuid()}"); 129var fullPath = Path.GetFullPath(providedDirectory); 153/// (TMP/TEMP on Windows, TMPDIR on Unix, and the value <see cref="Path.GetTempPath()"/> would return): 184=> !Path.IsPathRooted(name) 185&& name.IndexOfAny(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }) < 0 196return Path.IsPathFullyQualified(path); 272_fileHelper.WriteAllTextToFile(Path.Combine(_testSessionProcessArtifactFolder, RunsettingsFileName), runSettingsXml); 275_fileHelper.WriteAllTextToFile(Path.Combine(_testSessionProcessArtifactFolder, ExecutionCompleteFileName), serializedExecutionComplete); 415.Select(file => new { TestSessionId = Path.GetFileName(Path.GetDirectoryName(file)), Artifact = file }) 425return Path.GetFileName(fileName) switch
Utilities\TestSourcesUtility.cs (2)
48return Path.GetDirectoryName(source); 59return Path.GetDirectoryName(source);
Microsoft.TestPlatform.Extensions.BlameDataCollector (23)
BlameCollector.cs (7)
166var dumpPath = Path.Combine(dumpDirectory, $"%e_%p_%t_crashdump.dmp"); 516var filepath = Path.Combine(GetTempDirectory(), Constants.AttachmentFileName + "_" + _attachmentGuid); 595string dumpFileName = Path.GetFileNameWithoutExtension(dumpFileNameFullPath); 713var temp = Environment.GetEnvironmentVariable("VSTEST_DUMP_TEMP_PATH") ?? Environment.GetEnvironmentVariable("AGENT_TEMPDIRECTORY") ?? Path.GetTempPath(); 714_tempDirectory = Path.Combine(temp, Guid.NewGuid().ToString()); 736var dumpPath = Path.Combine(Path.GetFullPath(dumpDirectory));
NetClientHangDumper.cs (1)
67var outputFile = Path.Combine(outputDirectory, $"{p.ProcessName}_{p.Id}_{DateTime.Now:yyyyMMddTHHmmss}_hangdump.dmp");
ProcDumpDumper.cs (7)
120var outputFile = Path.Combine(outputDirectory, $"{_outputFilePrefix}.dmp"); 137_tempDirectory = Path.GetDirectoryName(outputFile); 138_dumpFileName = Path.GetFileNameWithoutExtension(outputFile); 264.Where(dump => Path.GetFileNameWithoutExtension(dump).StartsWith(_outputFilePrefix ?? string.Empty, StringComparison.Ordinal)) 292var outputFile = Path.Combine(outputDirectory, $"{process.ProcessName}_{processId}_{DateTime.Now:yyyyMMddTHHmmss}_hangdump.dmp"); 309var tempDirectory = Path.GetDirectoryName(outputFile); 310var dumpFileName = Path.GetFileNameWithoutExtension(outputFile);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
WindowsHangDumper.cs (4)
89var outputFile = Path.Combine(outputDirectory, $"{p.ProcessName}_{p.Id}_{DateTime.Now:yyyyMMddTHHmmss}_hangdump.dmp"); 144var dumpMinitoolPath = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location)!, "dump", dumpMinitoolName); 156Path.GetDirectoryName(outputFile),
Microsoft.TestPlatform.PlatformAbstractions (15)
common\System\ProcessHelper.cs (3)
276return Path.GetDirectoryName(typeof(ProcessHelper).Assembly.Location); 361? Path.Combine(GetCurrentProcessLocation(), GetFormattedCurrentProcessArchitecture(), Arm) 362: Path.Combine(GetCurrentProcessLocation(), GetFormattedCurrentProcessArchitecture());
common\Tracing\PlatformEqtTrace.cs (7)
338string runnerLogFileName = $"{Path.GetFileNameWithoutExtension(process.MainModule!.FileName)}_{process.Id}.{DateTime.Now:yy-MM-dd_HH-mm-ss_fffff}.diag"; 339string logsDirectory = Path.GetTempPath(); 342LogFile ??= Path.Combine(logsDirectory, runnerLogFileName); 356runnerLogFileName = Path.Combine(LogFile, runnerLogFileName); 357LogFile = Path.Combine(LogFile, $"{Path.GetFileNameWithoutExtension(process.MainModule.FileName)}_{process.Id}.diag"); 400processName = Path.GetFileName(args[0]);
common\Tracing\RollingFileTraceListener.cs (4)
188string directory = Path.GetDirectoryName(actualFileName)!; 189string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(actualFileName); 190string extension = Path.GetExtension(actualFileName); 197string archiveFileName = Path.Combine(directory, fileNameBuilder.ToString());
netcore\System\ProcessHelper.cs (1)
21return Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!;
Microsoft.TestPlatform.TestHostRuntimeProvider (32)
Hosting\DefaultTestHostManager.cs (12)
180var currentWorkingDirectory = Path.GetDirectoryName(typeof(DefaultTestHostManager).Assembly.Location); 186var testhostProcessPath = Path.Combine(currentWorkingDirectory, testHostProcessName); 195testHostProcessName = Path.Combine("TestHostNetFramework", originalTestHostProcessName); 196testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", testHostProcessName); 225testhostProcessPath = Path.Combine(currentWorkingDirectory, "..", originalTestHostProcessName); 323extensions = extensions.Concat(sources.SelectMany(s => _fileHelper.EnumerateFiles(Path.GetDirectoryName(s)!, SearchOption.TopDirectoryOnly, TestAdapterEndsWithPattern))); 343actualSources.Add(Path.Combine(Path.GetDirectoryName(uwpSource)!, GetUwpSources(uwpSource)!)); 437var extensionAssemblyName = Path.GetFileNameWithoutExtension(extensionFullPath); 596if (!Path.IsPathRooted(appxManifestPath)) 598appxManifestPath = Path.Combine(Path.GetDirectoryName(uwpSource)!, appxManifestPath);
Hosting\DotnetTestHostManager.cs (20)
269var dotnetExeArchitecture = GetExecutableArchitecture(Path.Combine(dotnetRoot, "dotnet.exe")); 306var sourceFile = Path.GetFileNameWithoutExtension(sourcePath); 307var sourceDirectory = Path.GetDirectoryName(sourcePath)!; 310var runtimeConfigPath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".runtimeconfig.json")); 325var depsFilePath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".deps.json")); 337var runtimeConfigDevPath = Path.Combine(sourceDirectory, string.Concat(sourceFile, ".runtimeconfig.dev.json")); 361var fullExePath = Path.Combine(sourceDirectory, exeName); 384var testHostExeNugetPath = Path.Combine(testHostNugetRoot.FullName, "build", "net10.0", folderName, exeName); 411var testHostNextToRunner = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, "testhost.dll"); 434var testhostDeps = Path.Combine(Path.GetDirectoryName(testHostNextToRunner)!, "testhost.deps.json"); 448var testHostProbingPath = Path.GetDirectoryName(testHostNextToRunner)!; 463var testhostRuntimeConfig = Path.Combine(Path.GetDirectoryName(testHostNextToRunner)!, "testhost-latest.runtimeconfig.json"); 582var testhostDllPath = Path.ChangeExtension(startInfo.FileName, ".dll"); 834var sourceDirectory = Path.GetDirectoryName(sources.Single()); 1015testHostPath = Path.Combine(testhostPackage.Path, testHostPath); 1056testHostFullPath = Path.Combine(x.GetString()!, testHostPath); 1123var testHostNextToTestProject = Path.Combine(sourceDirectory, "testhost.dll");
Microsoft.TestPlatform.Utilities (10)
ClientUtilities.cs (4)
32var root = Path.GetDirectoryName(path)!; 68&& !Path.IsPathRooted(fileName)) 71fileName = Path.Combine(root, fileName); 72fileName = Path.GetFullPath(fileName);
CodeCoverageDataAttachmentsHandler.cs (2)
179var assemblyPath = Path.Combine(Path.GetDirectoryName(dataAttachmentAssemblyLocation)!, CodeCoverageIoAssemblyName + ".dll");
InferRunSettingsHelper.cs (1)
687var onlyFileName = Path.GetFileName(source);
MSTestSettingsUtilities.cs (3)
63return string.Equals(Path.GetExtension(settingsFile), ".testSettings", StringComparison.OrdinalIgnoreCase) 64|| string.Equals(Path.GetExtension(settingsFile), ".testrunConfig", StringComparison.OrdinalIgnoreCase) 65|| string.Equals(Path.GetExtension(settingsFile), ".vsmdi", StringComparison.OrdinalIgnoreCase);
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (1)
ConsoleParameters.cs (1)
75var directoryPath = Path.GetDirectoryName(value);
Microsoft.VisualBasic.Forms (38)
Microsoft\VisualBasic\ApplicationServices\AssemblyInfo.vb (1)
91Return IO.Path.GetDirectoryName(_assembly.Location)
Microsoft\VisualBasic\Devices\Network.DownloadFile.vb (1)
352Dim targetDirectory As String = IO.Path.GetDirectoryName(fullFilename)
Microsoft\VisualBasic\Devices\Network.UploadFile.vb (1)
146If String.IsNullOrEmpty(IO.Path.GetFileName(addressUri.AbsolutePath)) Then
Microsoft\VisualBasic\Helpers\FileSystemUtils.vb (18)
26Debug.Assert(Not String.IsNullOrEmpty(fullPath) AndAlso IO.Path.IsPathRooted(fullPath), "Must be full path") 38Debug.Assert(dInfo.GetFiles(IO.Path.GetFileName(fullPath)).Length = 1, "Must found exactly 1") 39Return dInfo.GetFiles(IO.Path.GetFileName(fullPath))(0).FullName 41Debug.Assert(dInfo.GetDirectories(IO.Path.GetFileName(fullPath)).Length = 1, 43Return dInfo.GetDirectories(IO.Path.GetFileName(fullPath))(0).FullName 84If Not IO.Path.IsPathRooted(path) Then 88path = path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 89Return String.Equals(path, IO.Path.GetPathRoot(path), 100If IO.Path.IsPathRooted(path) Then 105If path.Equals(IO.Path.GetPathRoot(path), StringComparison.OrdinalIgnoreCase) Then 111Return path.TrimEnd(IO.Path.DirectorySeparatorChar, IO.Path.AltDirectorySeparatorChar) 125If path.EndsWith(IO.Path.DirectorySeparatorChar, StringComparison.Ordinal) Or 126path.EndsWith(IO.Path.AltDirectorySeparatorChar, StringComparison.Ordinal) Then 152''' <exception cref="Path.GetFullPath"> 153''' <see cref="Path.GetFullPath"/> for possible exceptions. 159Return GetLongPath(RemoveEndingSeparator(IO.Path.GetFullPath(path)))
Microsoft\VisualBasic\Logging\FileLogTraceListener.vb (14)
38Private _baseFileName As String = Path.GetFileNameWithoutExtension(Application.ExecutablePath) 137basePath = Path.GetDirectoryName(Application.ExecutablePath) 141basePath = Path.GetTempPath() 169Return Path.Join(basePath, fileName) 258Path.GetFullPath(value) 282Dim fileName As String = Path.GetFullPath(_customLocation) 288Dim tempPath As String = Path.GetFullPath(value) 594Debug.Assert(Not String.IsNullOrWhiteSpace(Path.GetDirectoryName(LogFileName)), "The log directory shouldn't be empty.") 595Dim fileName As String = Path.GetDirectoryName(LogFileName) 641Dim pathName As String = Path.GetPathRoot(Path.GetFullPath(FullLogFileName)) 667Dim baseStreamName As String = Path.GetFullPath($"{LogFileName}{FILE_EXTENSION}") 675fileName = Path.GetFullPath($"{LogFileName}{FILE_EXTENSION}") 677fileName = Path.GetFullPath(FormattableString.Invariant($"{LogFileName}-{i}{FILE_EXTENSION}"))
Microsoft\VisualBasic\MyServices\FileSystemProxy.vb (1)
874''' <exception cref="IO.Path.GetFullPath">See IO.Path.GetFullPath: If path is an invalid path.</exception>
Microsoft\VisualBasic\MyServices\Internal\WebClientCopy.vb (2)
157Dim path As String = IO.Path.GetDirectoryName(IO.Path.GetFullPath(destinationFileName))
Microsoft.VisualStudio.TestPlatform.Client (6)
TestPlatform.cs (6)
215var sourceDirectory = Path.GetDirectoryName(source); 270string extensionsFolder = Path.Combine( 271Path.GetDirectoryName(typeof(TestPlatform).Assembly.GetAssemblyLocation())!, 280extensionsFolder = Path.Combine(Path.GetDirectoryName(extensionsFolder)!, "vstest.console", "Extensions"); 314string adapterPath = Path.GetFullPath(Environment.ExpandEnvironmentVariables(path));
Microsoft.VisualStudio.TestPlatform.Common (26)
DataCollection\DataCollectionAttachmentManager.cs (8)
108SessionOutputDirectory = Path.Combine(Path.GetTempPath(), DefaultOutputDirectoryName, id.Id.ToString()); 114var absolutePath = Path.GetFullPath(expandedOutputDirectory); 115SessionOutputDirectory = Path.Combine(absolutePath, id.Id.ToString()); 210var directoryName = Path.GetDirectoryName(localFilePath); 249var directoryPath = Path.Combine( 252var localFilePath = Path.Combine(directoryPath, Path.GetFileName(fileTransferInfo.FileName));
ExtensionFramework\TestPluginCache.cs (9)
247var directories = _filterableExtensionPaths.Concat(_unfilterableExtensionPaths).Select(e => Path.GetDirectoryName(Path.GetFullPath(e))).Distinct(); 351var extensionDirectory = Path.GetDirectoryName(Path.GetFullPath(extensionAssembly))!; 354var currentDirectory = Path.GetDirectoryName(typeof(TestPluginCache).Assembly.GetAssemblyLocation())!; 372var extensionDirectories = GetExtensionPaths(string.Empty).Select(e => Path.GetDirectoryName(Path.GetFullPath(e))!).Distinct().ToList(); 379var currentDirectory = Path.GetDirectoryName(typeof(TestPluginCache).Assembly.GetAssemblyLocation())!; 432mergedExtensionsList = additionalExtensions.Select(Path.GetFullPath)
ExtensionFramework\TestPluginDiscoverer.cs (1)
94var assemblyName = Path.GetFileNameWithoutExtension(file);
Utilities\AssemblyResolver.cs (1)
136var assemblyPath = Path.Combine(dir, requestedName.Name + extension);
Utilities\InstallationContext.cs (6)
30var pathToDevenv = Path.Combine(vsInstallPath, DevenvExe); 45return Path.Combine(visualStudioDirectory, DevenvExe); 53Path.Combine(visualStudioDirectory, PrivateAssembliesDirName), 54Path.Combine(visualStudioDirectory, PublicAssembliesDirName), 55Path.Combine(visualStudioDirectory, "CommonExtensions", "Microsoft", "TestWindow"), 56Path.Combine(visualStudioDirectory, "CommonExtensions", "Microsoft", "TeamFoundation", "Team Explorer"),
Utilities\RunSettingsProviderExtensions.cs (1)
188var defaultResultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), Constants.ResultsDirectoryName);
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (4)
HtmlLogger.cs (4)
294HtmlFilePath = Path.Combine(TestResultsDirPath!, logFilePrefixValue); 300HtmlFilePath = Path.Combine(TestResultsDirPath!, logFileNameValue); 353var fileNameWithIter = i == 0 ? fileName : Path.GetFileNameWithoutExtension(fileName) + $"[{i}]"; 354var fullFilePath = Path.Combine(TestResultsDirPath!, $"TestResult_{fileNameWithIter}.{fileExtension}");
Microsoft.VisualStudio.TestPlatform.Extensions.TestIds.TestLogger (9)
TestIdsLogger.cs (9)
310string? directory = Path.GetDirectoryName(filePath); 433return Path.IsPathRooted(logFileNameValue) ? logFileNameValue! : Path.Combine(_testResultsDirPath!, logFileNameValue!); 470string stem = Path.GetFileNameWithoutExtension(fileName); 471string extension = Path.GetExtension(fileName); 476? Path.Combine(directory, fileName) 477: Path.Combine(directory, stem + "(" + iteration.ToString(CultureInfo.InvariantCulture) + ")" + extension); 504return Path.Combine(directory, fileName); 527foreach (char invalid in Path.GetInvalidFileNameChars())
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (43)
ObjectModel\TestRun.cs (1)
166return Path.Combine(GetResultsDirectory(), result.RelativeTestResultsDirectory);
ObjectModel\TestRunConfiguration.cs (2)
82return Path.Combine(_runDeploymentRoot, DeploymentInDirectorySuffix); 145TrxFileHelper.MakePathRelative(_runDeploymentRoot, Path.GetDirectoryName(_runDeploymentRoot)!),
TrxLogger.cs (5)
184var logFileDir = Path.GetDirectoryName(logFileNameInit); 187testRunDirectory = Path.Combine(testRunDirectory, logFileDir); 589filePath = Path.Combine(_testResultsDirPath, Path.GetFileName(logFileNameValue!)); 596var trxFileDirPath = Path.GetDirectoryName(filePath);
Utility\Converter.cs (18)
440string runDirectoryName = Path.Combine(trxFileDirectory, testRun.RunConfiguration!.RunDeploymentRootDirectory); 441string inDirectory = Path.Combine(runDirectoryName, "In"); 446targetDirectory = Path.Combine(inDirectory, testResultExecutionId.ToString()); 449targetDirectory = Path.Combine(targetDirectory, Environment.MachineName); 462_ = (Path.GetFullPath(sourceFile) == sourceFile); 463TPDebug.Assert(Path.IsPathRooted(sourceFile), "Source file is not rooted"); 466string targetFileName = TrxFileHelper.GetNextIterationFileName(targetDirectory, Path.GetFileName(sourceFile), false); 474string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName)); 497string runDirectoryName = Path.Combine(trxFileDirectory, testRun.RunConfiguration!.RunDeploymentRootDirectory); 498string testResultDirectory = Path.Combine(runDirectoryName, "In"); 502testResultDirectory = Path.Combine(testResultDirectory, testResultExecutionId.ToString()); 505testResultDirectory = Path.Combine(testResultDirectory, Environment.MachineName); 519TPDebug.Assert(Path.IsPathRooted(sourceFile), "Source file is not rooted"); 521string targetFileName = TrxFileHelper.GetNextIterationFileName(testResultDirectory, Path.GetFileName(sourceFile), false); 529string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName)); 621string testCaseSource = Path.GetFileNameWithoutExtension(source);
Utility\TrxFileHelper.cs (17)
144var fileNamePrefix = Path.GetFileNameWithoutExtension(fileName); 145var extension = Path.GetExtension(fileName); 150string tryMePath = Path.Combine(directoryName, tryMe); 177if (!Path.IsPathRooted(path)) 181path = Path.Combine(basePath, path); 183path = Path.GetFullPath(path); 184basePath = Path.GetFullPath(basePath); 186char[] delimiters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar]; 236newPath.Append(Path.DirectorySeparatorChar); 249newPath.Append(Path.DirectorySeparatorChar); 316string tryMePath = Path.Combine(baseDirectoryName, tryMe); 377string withoutExtensionName = Path.GetFileNameWithoutExtension(baseName); 379if (Path.HasExtension(baseName)) 381tryMe += Path.GetExtension(baseName); // Path.GetExtension already returns the leading ".". 397return !_checkMatchingDirectory || !Path.HasExtension(path) || !Directory.Exists(Path.ChangeExtension(path, string.Empty));
Microsoft.VisualStudio.TestPlatform.ObjectModel (10)
Constants.cs (1)
206public static readonly string DefaultResultsDirectory = Path.Combine(Directory.GetCurrentDirectory(), ResultsDirectoryName);
DataCollector\Common\FileHelper.cs (1)
20char[] invalidCharsArray = Path.GetInvalidFileNameChars();
Navigation\DiaSession.cs (3)
114var pdbFilePath = Path.ChangeExtension(binaryPath, ".pdb"); 119? Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(pdbFilePath)!)
Navigation\FullSymbolReader.cs (2)
129if (!Path.IsPathRooted(filename)) 131filename = Path.Combine(Directory.GetCurrentDirectory(), filename);
Navigation\NativeMethods.cs (1)
562IntPtr modHandle = LoadLibraryEx(Path.Combine(nativeDllDirectory, "msdia140.dll"), IntPtr.Zero, 0);
Navigation\PortableSymbolReader.cs (1)
87var pdbFilePath = Path.ChangeExtension(binaryPath, ".pdb");
src\vstest\src\Microsoft.TestPlatform.Hashing.Source\TestIdSeed.cs (1)
54fileNameOrSource = Path.GetFileName(source);
Microsoft.Web.XmlTransform (3)
NamedTypeFactory.cs (3)
37if (!Path.IsPathRooted(path)) { 39path = Path.Combine(Path.GetDirectoryName(relativePathRoot), path);
Mono.Cecil (8)
Mono.Cecil.Cil\Symbols.cs (1)
1169 return Path.ChangeExtension (assemblyFileName, ".pdb");
Mono.Cecil\AssemblyReader.cs (2)
685 var path = Path.GetDirectoryName (module.FileName); 686 return Path.Combine (path, name);
Mono.Cecil\BaseAssemblyResolver.cs (4)
202 foreach (var path in paths.Split (Path.PathSeparator)) 203 if (string.Equals (Path.GetExtension (path), ".dll", StringComparison.OrdinalIgnoreCase)) 204 result [Path.GetFileNameWithoutExtension (path)] = path; 215 string file = Path.Combine (directory, name.Name + extension);
Mono.Cecil\ModuleDefinition.cs (1)
1363 return Path.GetFullPath (file_stream.Name);
MSBuild (31)
CommandLine\CommandLineParser.cs (7)
120string exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath()); // Copied from XMake 350responseFile = Path.GetFullPath(responseFile); 367var responseFileDirectory = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(responseFile)); 541string exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath()); // Copied from XMake 572projectDirectory = Path.GetDirectoryName(Path.GetFullPath(projectFile)); 663string autoResponseFile = Path.Combine(path, autoResponseFileName);
FilteredBinlogReplay.cs (4)
88outputPath = Path.GetFullPath(parameters.LogFilePath ?? BinaryLogger.ExtractFilePathFromParameters(parameter)); 152string assemblyPath = Path.Combine(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, "dotnet.dll"); 189string directory = Path.GetDirectoryName(output.Path)!; 191output.StagingPath = Path.Combine(directory, $".msbuild-filter-{Guid.NewGuid():N}.binlog");
OutOfProcTaskHostNode.cs (1)
1503? 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");
XMake.cs (18)
164s_exePath = Path.GetDirectoryName(typeof(MSBuildApp).GetAssemblyPath()); 1799parseConfigDirectory: Path.GetDirectoryName(Path.GetFullPath(projectFile))); 2847Console.WriteLine($"{Path.Combine(s_exePath, s_exeName)} {equivalentCommandLine} {projectFile}"); 3668if (!extensionsToIgnore.Contains(Path.GetExtension(s)) && !s.EndsWith("~", StringComparison.CurrentCultureIgnoreCase)) 3683if (!extensionsToIgnore.Contains(Path.GetExtension(s))) 3701string solutionName = Path.GetFileNameWithoutExtension(actualSolutionFiles[0]); 3702string projectName = Path.GetFileNameWithoutExtension(actualProjectFiles[0]); 3721string firstPotentialProjectExtension = Path.GetExtension(actualProjectFiles[0]); 3722string secondPotentialProjectExtension = Path.GetExtension(actualProjectFiles[1]); 3776|| Path.IsPathRooted(projectFile) 3785if (string.IsNullOrEmpty(logicalCurrentDirectory) || !Path.IsPathRooted(logicalCurrentDirectory)) 3799string rebasedProjectFile = Path.GetFullPath(Path.Combine(logicalCurrentDirectory, projectFile)); 3823InitializationException.VerifyThrow(string.Equals(extension, Path.GetExtension(extension), StringComparison.OrdinalIgnoreCase), "InvalidExtensionToIgnore", extension, null, false); 4285if (!string.IsNullOrEmpty(logFileName) && !Path.IsPathRooted(logFileName)) 4288$"logFile={Path.Combine(Directory.GetCurrentDirectory(), logFileName)}"); 4305fileParameters += $"logFile={Path.Combine(Directory.GetCurrentDirectory(), msbuildLogFileName)}";
MSBuild.Coordinator (1)
CoordinatorServer.DefaultDebugOutput.cs (1)
38_debugDumpTraceFilePath = Path.Combine(_debugDumpDirectory, $"MSBuild_CoordinatorTrace_PID_{EnvironmentUtilities.CurrentProcessId}.txt");
mscorlib (1)
parent\ref\mscorlib.cs (1)
338[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
NativeIntegrations.DockerCompose (17)
ComposeModels.cs (5)
306var context = Path.GetFullPath(Text(build.Context), applicationDirectory); 307var dockerfile = Path.GetFullPath(Text(build.Dockerfile), applicationDirectory); 308var within = Path.GetRelativePath(context, dockerfile); 309if (within is "." or ".." || within.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal) || Path.IsPathRooted(within))
DockerComposeEnvironment.cs (8)
191await File.WriteAllTextAsync(Path.Combine(context.OutputPath, "compose.yaml"), ComposeJson.Json(plan.Compose), context.CancellationToken).ConfigureAwait(false); 192await File.WriteAllTextAsync(Path.Combine(context.OutputPath, "deployment-inputs.json"), ComposeJson.Json(plan.Inputs), context.CancellationToken).ConfigureAwait(false); 193await File.WriteAllTextAsync(Path.Combine(context.OutputPath, "prerequisites.txt"), string.Join('\n', 205Path.Combine(context.OutputPath, "compose.yaml"), "down").ToJsonString(), 214var composePath = Path.Combine(context.OutputPath, "compose.yaml"); 215foreach (var (path, expected) in new[] { (composePath, plan.Compose), (Path.Combine(context.OutputPath, "deployment-inputs.json"), plan.Inputs) }) 248await File.WriteAllTextAsync(Path.Combine(context.OutputPath, "deployment-state.json"), ComposeJson.Json(state), context.CancellationToken).ConfigureAwait(false); 280context with { OutputPath = Path.Combine(context.OutputPath, ServiceName(Name)) } : context;
DockerComposeGenerator.cs (4)
18var directory = Path.TrimEndingDirectorySeparator(Path.GetFullPath(applicationDirectory)); 23return $"aspire-{Slug(Path.GetFileName(directory))[..Math.Min(Slug(Path.GetFileName(directory)).Length, 16)]}-{ShortSlug(name, 12)}-{ShortSlug(environmentName, 12)}-{identity}";
NativeIntegrations.DockerCompose.AppHost.Sample (2)
Program.cs (2)
28var web = builder.AddExecutable("web", Environment.ProcessPath!, Path.Combine(builder.AppHostDirectory, "web")) 49var artifact = Path.Combine(context.PublishingContext.OutputPath, "compose.yaml");
netstandard (1)
netstandard.cs (1)
948[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
NuGet.Build.Tasks (34)
BuildTasksUtility.cs (7)
252FileUtility.Delete(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName)); 264FileUtility.Delete(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))); 711return GetPackagesConfigFilePath(Path.GetDirectoryName(projectFullPath), Path.GetFileNameWithoutExtension(projectFullPath)); 733string packagesConfigPath = Path.Combine(projectDirectory, NuGetConstants.PackageReferenceFile); 740packagesConfigPath = Path.Combine(projectDirectory, "packages." + projectName + ".config");
GetRestoreProjectReferencesTask.cs (3)
62var parentDirectory = Path.GetDirectoryName(ParentProjectPath); 74var combinedPath = Path.Combine(parentDirectory, project.ItemSpec); 76var referencePath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(combinedPath));
GetRestoreSettingsTask.cs (7)
141Debug.Assert(Path.IsPathFullyQualified(ProjectUniqueName)); 142Debug.Assert(Path.IsPathFullyQualified(MSBuildStartupDirectory)); 143Debug.Assert(string.IsNullOrEmpty(RestoreRootConfigDirectory) || Path.IsPathFullyQualified(RestoreRootConfigDirectory)); 144Debug.Assert(string.IsNullOrEmpty(RestoreSolutionDirectory) || Path.IsPathFullyQualified(RestoreSolutionDirectory)); 155restoreDir = Path.GetDirectoryName(ProjectUniqueName); 178Path.GetDirectoryName(ProjectUniqueName), 187Path.GetDirectoryName(ProjectUniqueName),
GetRestoreSolutionProjectsTask.cs (3)
53var parentDirectory = Path.GetDirectoryName(SolutionFilePath); 62var combinedPath = Path.Combine(parentDirectory, project.ItemSpec); 64var projectPath = Path.GetFullPath(TaskEnvironment.GetAbsolutePath(combinedPath));
RestoreSettingsUtils.cs (5)
31var solutionSettingsFile = Path.Combine( 37restoreConfigFile = Path.GetFullPath(restoreConfigFile); 57var configFileFullPath = Path.GetFullPath(restoreConfigFile); 58var directory = Path.GetDirectoryName(configFileFullPath); 59var configFileName = Path.GetFileName(configFileFullPath);
RestoreTask.cs (3)
319restoredProjectOutputPaths.Add(new TaskItem(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName))); 326restoredProjectOutputPaths.Add(new TaskItem(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))));
StaticGraphRestoreTaskBase.cs (6)
247yield return Path.Combine(ThisAssemblyLazy.Value.DirectoryName, Path.ChangeExtension(ThisAssemblyLazy.Value.Name, ".Console.dll")); 256yield return Path.Combine(MSBuildBinPath, "MSBuild.dll"); 353return Path.GetFullPath(processFileName); 357return Path.GetFullPath(Path.Combine(MSBuildBinPath, "..", "..", "dotnet"));
NuGet.Build.Tasks.Console (15)
MSBuildStaticGraphRestore.cs (14)
145if ((string.Equals(Path.GetExtension(entryProjectFilePath), ".sln", StringComparison.OrdinalIgnoreCase) 146|| string.Equals(Path.GetExtension(entryProjectFilePath), ".slnx", StringComparison.OrdinalIgnoreCase)) 622: Path.GetDirectoryName(solutionDir); 637return outputPath == null ? null : Path.GetFullPath(Path.Combine(project.Directory, outputPath)); 644return outputPath == null ? null : Path.GetFullPath(Path.Combine(projectDirectory, outputPath)); 716var extension = Path.GetExtension(entryProjectPath); 912var message = string.Format(CultureInfo.CurrentCulture, Strings.Error_ReadingProjectInformation, projectName ?? Path.GetFileNameWithoutExtension(projectPath), innerException.Message); 932outputPath ??= Path.Combine(projectDirectory, "obj"); 937Name = projectName ?? Path.GetFileNameWithoutExtension(projectPath), 1499LoggingQueue.Enqueue(new ConsoleOutLogEmbedInBinlog(Path.Combine(project.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName))); 1506LoggingQueue.Enqueue(new ConsoleOutLogEmbedInBinlog(Path.Combine(project.RestoreMetadata.OutputPath, DependencyGraphSpec.GetDGSpecFileName(Path.GetFileName(project.RestoreMetadata.ProjectPath)))));
RestoreProjectAdapter.cs (1)
19Directory = Path.GetDirectoryName(fullPath) ?? throw new ArgumentNullException(nameof(fullPath));
NuGet.Build.Tasks.Pack (40)
GetPackOutputItemsTask.cs (4)
61outputs.Add(new TaskItem(Path.Combine(PackageOutputPath, nupkgFileName))); 62outputs.Add(new TaskItem(Path.Combine(NuspecOutputPath, nuspecFileName))); 68outputs.Add(new TaskItem(Path.Combine(PackageOutputPath, nupkgSymbolsFileName))); 69outputs.Add(new TaskItem(Path.Combine(NuspecOutputPath, nuspecSymbolsFileName)));
GetProjectReferencesFromAssetsFileTask.cs (4)
43assetsFilePath = Path.Combine(RestoreOutputAbsolutePath, LockFileFormat.AssetsFileName); 66var projectDirectory = Path.GetDirectoryName(assetsFile.PackageSpec.RestoreMetadata.ProjectPath); 71.Select(library => new TaskItem(Path.GetFullPath(Path.Combine(
PackTaskLogic.cs (32)
108var assetsFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName); 344string assetsFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName); 542targetPath = Path.GetFileName(finalOutputPath); 620packArgs.CurrentDirectory = Path.Combine( 622request.PackItem.GetProperty("Directory")).TrimEnd(Path.DirectorySeparatorChar); 639if (Path.IsPathRooted(request.NuspecOutputPath)) 645packArgs.PackTargetArgs.NuspecOutputPath = Path.Combine( 716var fileName = Path.GetFileName(sourcePath); 720Compare(Path.GetExtension(fileName), 721Path.GetExtension(targetPath)) == 0 722&& !string.IsNullOrEmpty(Path.GetExtension(fileName)) 724: Path.Combine(targetPath, recursiveDir)); 744if (setOfTargetPaths.Remove("contentFiles" + Path.DirectorySeparatorChar) 750Path.Combine("contentFiles", language, framework.GetShortFolderName() 764!Path.GetFileName(sourcePath) 771if (Path.IsPathRooted(identity)) 774identity = Path.GetDirectoryName(identity); 778else if (identity.EndsWith(Path.GetFileName(sourcePath), StringComparison.CurrentCultureIgnoreCase)) 780identity = Path.GetDirectoryName(identity); 785var newTargetPath = Path.Combine(targetPath, identity); 802var fileName = Path.GetFileName(sourcePath); 803if (string.IsNullOrEmpty(Path.GetExtension(fileName)) || 804!Path.GetExtension(fileName) 805.Equals(Path.GetExtension(targetPath), StringComparison.OrdinalIgnoreCase)) 807currentPath = Path.Combine(targetPath, fileName); 829sourcePath = Path.Combine(sourceProjectFile.Replace(Path.GetFileName(sourceProjectFile), string.Empty), identity); 831return Path.GetFullPath(sourcePath); 860sourceProjectFile = Path.GetDirectoryName(sourceProjectFile); 923library => Path.GetFullPath(Path.Combine( 924Path.GetDirectoryName(assetsFile.PackageSpec.RestoreMetadata.ProjectPath),
NuGet.CommandLine.XPlat (25)
Commands\Package\Stage\StagePushCommandRunner.cs (1)
167string fullPath = Path.GetFullPath(packagePath);
Commands\Package\Update\PackageUpdateCommandRunner.cs (1)
112var projectName = Path.GetFileNameWithoutExtension(projectPath);
Commands\Package\Update\PackageUpdateIO.cs (3)
55string settingsRoot = Directory.Exists(solutionDirectory) ? solutionDirectory : Path.GetDirectoryName(solutionDirectory)!; 74string tempFile = Path.GetTempFileName(); 603var assetsFilePath = Path.Combine(packageSpec.RestoreMetadata.OutputPath, LockFileFormat.AssetsFileName);
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (4)
80var projectFullPath = Path.GetFullPath(packageReferenceArgs.ProjectPath); 90PathUtility.GetStringComparerBasedOnOS().Equals(Path.GetFullPath(p.RestoreMetadata.ProjectPath), projectFullPath)) 378var nuspecFilePath = Path.GetFullPath(Path.Combine(packageDirectory, nuspecFile));
Commands\PackageReferenceCommands\ListPackage\ListPackageCommand.cs (3)
263var configFileFullPath = Path.GetFullPath(configFile); 264var directory = Path.GetDirectoryName(configFileFullPath); 265var configFileName = Path.GetFileName(configFileFullPath);
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (1)
71string fileExtension = Path.GetExtension(listPackageArgs.Path);
Commands\Why\DependencyGraphFinder.cs (3)
106string projectDirectory = Path.GetDirectoryName(assetsFile.PackageSpec.FilePath)!; 110.ToDictionary(l => Path.GetFullPath(Path.Combine(projectDirectory, l.Path)), l => l, StringComparer.OrdinalIgnoreCase);
Commands\Why\WhyCommandRunner.cs (1)
175fullPath = Path.GetFullPath(path);
Utility\MSBuildAPIUtility.cs (2)
125string fullPath = Path.GetFullPath(path); 1070var fullPath = Path.GetFullPath(filename);
Utility\XPlatUtility.cs (6)
71var configFileFullPath = Path.GetFullPath(configFile); 72var directory = Path.GetDirectoryName(configFileFullPath); 73var configFileName = Path.GetFileName(configFileFullPath); 131var extension = System.IO.Path.GetExtension(fileName); 148var extension = System.IO.Path.GetExtension(fileName); 162var extension = Path.GetExtension(filename);
NuGet.Commands (120)
CommandRunners\PackCommandRunner.cs (28)
46@"**\*.pdb".Replace('\\', Path.DirectorySeparatorChar), 47@"src\**\*".Replace('\\', Path.DirectorySeparatorChar) 53@"content\**\*".Replace('\\', Path.DirectorySeparatorChar), 54@"tools\**\*.ps1".Replace('\\', Path.DirectorySeparatorChar) 87var result = BuildPackage(Path.GetFullPath(Path.Combine(_packArgs.CurrentDirectory, _packArgs.Path))); 93string extension = Path.GetExtension(path); 117Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 202Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 204string resolvedNuSpecOutputPath = Path.Combine( 205Path.GetDirectoryName(outputPath), 229string tempOutputPath = Path.GetTempFileName(); 253Directory.CreateDirectory(Path.GetDirectoryName(outputPath)); 255string sha512OutputPath = Path.Combine(outputPath + ".sha512"); 275string tempOutputPath = Path.GetTempFileName(); 577WriteLine(Strings.Log_PackageCommandAttemptingToBuildSymbolsPackage, Path.GetFileName(path)); 712var fileName = Path.GetFileName(filePath); 754path = path.Substring(index + basePath.Length).TrimStart(Path.DirectorySeparatorChar); 830List<IPackageFile> toRemove = files.Where(t => !string.Equals(Path.GetExtension(t.Path), ".pdb", StringComparison.OrdinalIgnoreCase)).ToList(); 883return Path.Combine(finalOutputDirectory, outputFile); 918string directory = Path.GetDirectoryName(packArgs.Path); 926packArgs.OutputDirectory = Path.GetFullPath(packArgs.OutputDirectory); 931packArgs.BasePath = Path.GetFullPath(packArgs.BasePath); 955List<string> candidates = files.Where(file => AllowedExtensions.Contains(Path.GetExtension(file))).ToList(); 960!Path.GetFileName(ext).Equals(ProjectJsonPathUtilities.ProjectConfigFileName, StringComparison.OrdinalIgnoreCase) && 974candidates.RemoveAll(file => Path.GetExtension(file).Equals(NuGetConstants.ManifestExtension, StringComparison.OrdinalIgnoreCase)); 982candidates.RemoveAll(file => Path.GetExtension(file).Equals(".json", StringComparison.OrdinalIgnoreCase)); 994return Path.Combine(packArgs.CurrentDirectory, result);
MSBuildProjectFactory.cs (19)
103var manifestDirectory = Path.GetDirectoryName(manifestPath); 134var extension = Path.GetExtension(file.FinalOutputPath); 148Target = IsTool ? Path.Combine(targetFolders[i], targetPath) : Path.Combine(targetFolders[i], tfm, targetPath) 160var fileExtension = Path.GetExtension(packageFile.Source); 195Target = target.EndsWith(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal) || string.IsNullOrEmpty(target) 196? Path.Combine(target, Path.GetFileName(sourcePath)) 204var includePath = PathUtility.GetRelativePath("contentFiles" + Path.DirectorySeparatorChar, packageFile.Target, '/'); 207if (!Path.GetExtension(includePath) 208.Equals(Path.GetExtension(sourcePath), StringComparison.OrdinalIgnoreCase)) 210includePath = Path.Combine(includePath, Path.GetFileName(sourcePath)); 258var projectName = Path.GetFileName(projectDirectory); 259var targetPath = Path.Combine(SourcesFolder, projectName); 270var relativePath = Path.GetDirectoryName(sourcePath).Replace(projectDirectoryWithSeparatorChar, string.Empty, StringComparison.Ordinal); 282targetPath = Path.Combine(targetPath, relativePath); 285var finalTargetPath = Path.Combine(targetPath, Path.GetFileName(sourcePath));
PackagesLockFileBuilder.cs (1)
99var id = PathUtility.GetStringComparerBasedOnOS().Equals(Path.GetFileNameWithoutExtension(projectFullPath), projectIdentity.Id)
RestoreCommand\CompatibilityChecker.cs (4)
163.Where(p => Path.GetExtension(p.Path) 166var name = Path.GetFileNameWithoutExtension(compile.Path); 178.Where(p => Path.GetExtension(p.Path) 181var name = Path.GetFileNameWithoutExtension(runtime.Path);
RestoreCommand\ContentFiles\ContentFileUtils.cs (3)
131absolutePaths.Add(Path.Combine(MatcherRoot, key)); 221&& !string.IsNullOrEmpty(Path.GetFileNameWithoutExtension(lockFileItem.Path)); 229destination = Path.GetFileName(lockFileItem.Path);
RestoreCommand\Diagnostics\UnresolvedMessages.cs (1)
95if (unresolved.Name.IndexOf(Path.DirectorySeparatorChar, StringComparison.Ordinal) > -1 && File.Exists(unresolved.Name))
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (1)
189var rootPath = Path.GetDirectoryName(project.PackageSpec.FilePath);
RestoreCommand\RequestFactory\RestoreArgs.cs (7)
94var configFileFullPath = Path.GetFullPath(ConfigFile); 95var directory = Path.GetDirectoryName(configFileFullPath); 96var configFileName = Path.GetFileName(configFileFullPath); 111return Path.GetFullPath(GlobalPackagesFolder); 117return Path.GetFullPath(Path.Combine(rootDirectory, globalPath)); 191request.LockFilePath = Path.Combine(request.RestoreOutputPath, LockFileFormat.AssetsFileName);
RestoreCommand\RestoreCommand.cs (2)
1812projectLockFilePath = Path.Combine(_request.RestoreOutputPath, LockFileFormat.AssetsFileName); 1816return Path.GetFullPath(projectLockFilePath);
RestoreCommand\RestoreRequest.cs (1)
51RestoreOutputPath = Path.GetDirectoryName(Project.FilePath);
RestoreCommand\RestoreRunner.cs (3)
179inputs.Add(Path.GetFullPath(".")); 207Path.GetFullPath(input)); 396var fileExtension = Path.GetExtension(input);
RestoreCommand\Utility\BuildAssetsUtils.cs (13)
76Directory.CreateDirectory(Path.GetDirectoryName(file.Path)); 180var resolvableAssetsFilePath = @"$(MSBuildThisFileDirectory)" + Path.GetFileName(assetsFilePath); 287var destinationSubDirectory = Path.GetDirectoryName(outputPath); 291entry.Add(new XElement(Namespace + "DestinationSubDirectory", destinationSubDirectory + Path.DirectorySeparatorChar)); 299var linkPath = string.Join(string.Empty + Path.DirectorySeparatorChar, 433var projFileName = Path.GetFileName(project.RestoreMetadata.ProjectPath); 434path = Path.Combine(project.RestoreMetadata.OutputPath, $"{projFileName}.nuget.g{extension}"); 439var dir = Path.GetDirectoryName(project.FilePath); 440path = Path.Combine(dir, $"{project.Name}.nuget{extension}"); 448var projFileName = Path.GetFileName(project.RestoreMetadata.ProjectPath); 450return Path.Combine(project.RestoreMetadata.OutputPath, $"{projFileName}.nuget.g{extension}"); 846return Path.Combine(package.Value.Package.ExpandedPath, LockFileUtils.ToDirectorySeparator(item.Path)); 868if (extension.Equals(Path.GetExtension(item.Path), StringComparison.OrdinalIgnoreCase))
RestoreCommand\Utility\LockFileUtils.cs (14)
312if (Path.GetFileName(btItem.Path).Equals(Path.GetFileName(buildItem.Path), StringComparison.OrdinalIgnoreCase)) 450lockFileLib.RuntimeAssemblies = lockFileLib.RuntimeAssemblies.Where(p => !p.Path.StartsWith("lib/", StringComparison.Ordinal) || referenceFilter.Contains(Path.GetFileName(p.Path))).ToList(); 451lockFileLib.CompileTimeAssemblies = lockFileLib.CompileTimeAssemblies.Where(p => !p.Path.StartsWith("lib/", StringComparison.Ordinal) || referenceFilter.Contains(Path.GetFileName(p.Path))).ToList(); 637string relativePath = PathUtility.GetPathWithForwardSlashes(Path.Combine("bin", "placeholder", $"{localMatch.Library.Name}.dll")); 805int lastSeparator = path.LastIndexOf(Path.AltDirectorySeparatorChar); 809int separator = path.IndexOf(Path.AltDirectorySeparatorChar, segmentStart); 878Path.GetFileName(c.Path), 889Path.GetFileName(c.Path), 979var fileName = Path.GetFileName(firstItem.Path); 1145if (Path.DirectorySeparatorChar == '/') 1150return path.Replace('/', Path.DirectorySeparatorChar); 1235item => Path.GetFileName(item.Path).Equals(Path.GetFileName(currentBuildItem.Path), StringComparison.OrdinalIgnoreCase));
RestoreCommand\Utility\MSBuildRestoreUtility.cs (5)
227?? Path.GetFileNameWithoutExtension(result.FilePath); 314pcRestoreMetadata.RepositoryPath = Path.Combine( 351var projectName = specItem.GetProperty("ProjectName") ?? Path.GetFileNameWithoutExtension(projectPath); 355outputPath = Path.Combine(Path.GetDirectoryName(projectPath), "obj");
RestoreCommand\Utility\NoOpRestoreUtilities.cs (7)
43return cacheRoot == null ? null : Path.Combine(cacheRoot, NoOpCacheFileName); 69return Path.Combine( 94return projectCacheFilePath != null ? Path.GetFullPath(projectCacheFilePath) : null; 151var packageDirectory = Path.GetDirectoryName(package); 152var metadataFile = Path.Combine(packageDirectory, PackagingCoreConstants.NupkgMetadataFileExtension); 209var projFileName = Path.GetFileName(request.Project.RestoreMetadata.ProjectPath); 211return Path.Combine(outputRoot, dgFileName);
RestoreCommand\Utility\PackageSpecFactory.cs (5)
440string packagesConfigPath = Path.Combine(projectDirectory, NuGetConstants.PackageReferenceFile); 447packagesConfigPath = Path.Combine(projectDirectory, "packages." + projectName + ".config"); 810: Path.GetDirectoryName(solutionDir)!; 940return outputPath == null ? null : Path.GetFullPath(Path.Combine(project.Directory, outputPath));
SignCommand\SignCommandRunner.cs (3)
115var tempPackageFile = new FileInfo(Path.GetTempFileName()); 127outputPath = Path.Combine(outputDirectory, Path.GetFileName(packagePath));
SourcesCommands\SourceRunners.cs (3)
354var configFileFullPath = Path.GetFullPath(configfile); 355var configDirectory = Path.GetDirectoryName(configFileFullPath); 356var configFileName = Path.GetFileName(configFileFullPath);
NuGet.Common (108)
ConcurrencyUtilities.cs (4)
264return Path.Combine(NuGetEnvironment.GetFolderPath(folder), "lock"); 273return Path.Combine(BasePath, FilePathToLockName(filePath)); 285var fullPath = Path.IsPathRooted(filePath) ? Path.GetFullPath(filePath) : filePath;
LocalResourceUtils.cs (2)
104var filePath = Path.Combine(folderPath, Path.GetFileName(file));
Migrations\Migration1.cs (10)
21string nugetPath = Path.Combine(localAppDataPath, "NuGet"); 37var v3cachePath = Path.Combine(nugetBaseDirectory, "v3-cache"); 43var pluginsCachePath = Path.Combine(nugetBaseDirectory, "plugins-cache"); 65var nugetLocalAppDataPath = Path.GetDirectoryName(httpCachePath); 87if (!path.StartsWith(homePath + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 92string? parent = Path.GetDirectoryName(path); 96parent = Path.GetDirectoryName(parent); 107return Path.Combine(home, ".config", "NuGet"); 111return Path.Combine(xdgConfigHome, "NuGet"); 118return Path.Combine(home, ".nuget", "NuGet");
Migrations\MigrationRunner.cs (4)
31var expectedMigrationFilename = Path.Combine(migrationsDirectory, MaxMigrationFilename); 92return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NuGet", "Migrations"); 98? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "NuGet", "Migrations") 99: Path.Combine(XdgDataHome, "NuGet", "Migrations");
PathUtil\FileUtility.cs (4)
26return Path.GetFullPath(Path.Combine(directory, fileName)); 95string? destFileDirectory = Path.GetDirectoryName(destFilePath); 133string? destFileDirectory = Path.GetDirectoryName(destFilePath);
PathUtil\NuGetEnvironment.cs (18)
64var tempPath = Path.GetTempPath(); 68nuGetScratch = Path.Combine(tempPath, 113return Path.Combine(machineWideBaseDir, 117return Path.Combine( 122return Path.Combine( 127return Path.Combine( 134return Path.Combine( 141return Path.Combine( 150return Path.Combine( 157return Path.Combine( 171return Path.Combine(programFilesPath, "MSBuild", "14.0", "Bin", "MSBuild.exe"); 238return Path.Combine(_getHome.Value, ".nuget"); 254return Path.Combine(_getHome.Value, ".local", "share"); 361foreach (var dir in path.Split(Path.PathSeparator)) 363var fullPath = Path.Combine(dir, executable); 375var fullPath = Path.Combine(programFiles, DotNet, DotNetExe); 385var fullPath = Path.Combine(programFiles, DotNet, DotNetExe); 397var fullPath = Path.Combine(localBin, DotNet);
PathUtil\PathResolver.cs (15)
70return Path.Combine(basePath, wildcard); 77if (Path.DirectorySeparatorChar == '/') 125searchPath = searchPath + "**" + Path.DirectorySeparatorChar + "*"; 133Regex searchRegex = WildcardToRegex(Path.Combine(basePath, searchPath)); 141bool isWildcardPath = Path.GetDirectoryName(searchPath)?.Contains('*') ?? false; 181string? searchRoot = Path.GetDirectoryName(searchPath); 186basePathToEnumerate = Path.Combine(basePath, searchRoot); 191int directorySeparatoryIndex = searchPath.LastIndexOf(Path.DirectorySeparatorChar, wildcardIndex); 201basePathToEnumerate = Path.Combine(basePath, nonWildcardPortion); 210string parentDirectoryPath = $"..{Path.DirectorySeparatorChar}"; 211string currentDirectoryPath = $".{Path.DirectorySeparatorChar}"; 220basePath = Path.Combine(basePath, parentDirectoryPath); 224return Path.GetFullPath(basePath); 238(path[path.Length - 1] == Path.DirectorySeparatorChar || 239path[path.Length - 1] == Path.AltDirectorySeparatorChar);
PathUtil\PathUtility.cs (31)
99return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar); 140dir = Path.GetFullPath(dir); 142candidate = Path.GetFullPath(candidate); 163return (ch == Path.DirectorySeparatorChar || 164ch == Path.AltDirectorySeparatorChar); 168return ch == Path.DirectorySeparatorChar; 174string? directory = Path.GetDirectoryName(filePath); 190return GetRelativePath(path1, path2, Path.DirectorySeparatorChar); 213if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2), compare)) 225var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 226var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 298path = path.TrimEnd(Path.DirectorySeparatorChar); 299string? fullDirectoryPath = Path.GetDirectoryName(path); 304return path.Substring(fullDirectoryPath.Length).Trim(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 314if (Path.DirectorySeparatorChar == '/') 334return Uri.UnescapeDataString(path.Replace('/', Path.DirectorySeparatorChar)); 378var folder = path.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault() ?? string.Empty; 380folder = Path.DirectorySeparatorChar + folder + Path.DirectorySeparatorChar; 382var root = Path.GetPathRoot(path); 417basePath = basePath.TrimEnd(Path.DirectorySeparatorChar); 423return path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 428return path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 484string? parentDirectory = Path.GetFullPath(path); 493parentDirectory = Path.GetDirectoryName(parentDirectory);
PathUtil\PathValidator.cs (5)
49Path.GetFullPath(path); 51return Path.IsPathRooted(path) && !path.StartsWith(@"\\", StringComparison.Ordinal); 74_ = Path.GetFullPath(path); 99_ = Path.GetFullPath(path); 101return !Regex.IsMatch(path, @"^\w+://", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && !Path.IsPathRooted(path);
PathUtil\ProjectJsonPathUtilities.cs (7)
39var configPath = Path.Combine(directoryPath, GetProjectConfigWithProjectName(projectName)); 44configPath = Path.Combine(directoryPath, ProjectConfigFileName); 86var dir = Path.GetDirectoryName(configFilePath); 96lockFilePath = Path.Combine(dir, ProjectLockFileName); 101lockFilePath = Path.Combine(dir, lockFileWithProject); 118var file = Path.GetFileName(configPath); 147file = Path.GetFileName(configPath);
RuntimeEnvironmentHelper.cs (1)
24var currentProcessName = Path.GetFileNameWithoutExtension(GetCurrentProcessFilePath());
UriUtility.cs (7)
41if (Path.DirectorySeparatorChar == '/' && !string.IsNullOrEmpty(source) && source[0] == '/') 99return GetAbsolutePath(Path.GetDirectoryName(sourceFile!), path)!; 129return Path.IsPathFullyQualified(rootDirectory) 130? Path.GetFullPath(local, rootDirectory) 131: Path.GetFullPath(Path.Combine(rootDirectory, local)); 141return Path.GetFullPath(local);
NuGet.Configuration (52)
Settings\ConfigurationDefaults.cs (1)
38if (File.Exists(Path.Combine(directory, configFile)))
Settings\Items\FileClientCertItem.cs (2)
38return new SettingsFile(Path.GetDirectoryName(settingsFilePath)!, Path.GetFileName(settingsFilePath), isMachineWide: false, isReadOnly: false);
Settings\Settings.cs (25)
507.OrderByDescending(file => file.FullName.Count(c => c == Path.DirectorySeparatorChar)) 592var defaultSettingsFilePath = Path.Combine(userSettingsDir, DefaultSettingsFileName); 624Path.Combine(rootDirectory, configFileName)); 638? Path.Combine(rootDirectory, "TestingGlobalPath") 644return Path.Combine(userSettingsDirectory, ConfigurationConstants.Config); 671var combinedPath = Path.Combine(paths); 690var index = combinedPath.LastIndexOf(Path.DirectorySeparatorChar); 721if (Path.IsPathRooted(settingsPath)) 723fileName = Path.GetFileName(settingsPath); 724directory = Path.GetDirectoryName(settingsPath)!; 728var fullPath = Path.Combine(root ?? string.Empty, settingsPath); 729fileName = Path.GetFileName(fullPath); 730directory = Path.GetDirectoryName(fullPath)!; 784var rawPath = Path.Combine(originDirectoryPath, ResolvePath(Path.GetDirectoryName(originFilePath)!, path)); 802root = Path.GetPathRoot(value)!; 816&& (root[0] == Path.DirectorySeparatorChar || value[0] == Path.AltDirectorySeparatorChar)) 818return Path.Combine(Path.GetPathRoot(configDirectory)!, value.Substring(1)); 820return Path.Combine(configDirectory, value); 829if (!Path.IsPathRooted(settingsPath) && !string.IsNullOrWhiteSpace(settingsRoot)) 831settingsPath = Path.Combine(settingsRoot, settingsPath); 880var file = Path.Combine(directory, nugetConfigCasing); 896current = Path.GetDirectoryName(current);
Settings\SettingsFile.cs (2)
108ConfigFilePath = Path.GetFullPath(Path.Combine(DirectoryPath, FileName));
Settings\SettingsLoadingContext.cs (1)
60if (!Path.IsPathRooted(filePath))
Utility\FileSystemUtility.cs (6)
33Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!); 57return String.Equals(path, Path.GetFileName(path), StringComparison.OrdinalIgnoreCase); 62return File.Exists(Path.Combine(root, file)); 67path = EnsureTrailingSlash(Path.Combine(root, path)); 99return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar); 104return EnsureTrailingCharacter(path, Path.DirectorySeparatorChar);
Utility\SettingsUtility.cs (15)
19public static readonly string DefaultGlobalPackagesFolderPath = "packages" + Path.DirectorySeparatorChar; 73path = path!.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 298path = path!.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 299path = Path.GetFullPath(path); 303path = Path.Combine(NuGetEnvironment.GetFolderPath(NuGetFolderPath.NuGetHome), DefaultGlobalPackagesFolderPath); 345paths[i] = paths[i].Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 346paths[i] = Path.GetFullPath(paths[i]); 388path = path!.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); 389path = Path.GetFullPath(path); 411path = Path.GetFullPath(path); 481if (!Path.IsPathRooted(path))
NuGet.Credentials (3)
PluginCredentialProvider.cs (1)
59var filename = System.IO.Path.GetFileName(path);
PluginCredentialProviderBuilder.cs (2)
77.GroupBy(Path.GetDirectoryName) 78.SelectMany(g => g.OrderBy(Path.GetFileName, StringComparer.OrdinalIgnoreCase))
NuGet.PackageManagement (88)
BuildIntegration\DependencyGraphRestoreUtility.cs (2)
277var projFileName = Path.GetFileName(packageSpec.RestoreMetadata.ProjectPath); 289var persistedDGSpecPath = Path.Combine(outputPath, dgFileName);
NuGetPackageManager.cs (3)
3582readmeFilePath = Path.Combine(packageFolderPath, Constants.ReadmeFileName); 3591readmeFilePath = Path.Combine(Path.GetDirectoryName(packagePath), Constants.ReadmeFileName);
Projects\FolderNuGetProject.cs (11)
155nuGetProjectContext.Log(MessageLevel.Info, Strings.AddingPackageToFolder, packageIdentity, Path.GetFullPath(Root)); 215nuGetProjectContext.Log(MessageLevel.Info, Strings.AddedPackageToFolder, packageIdentity, Path.GetFullPath(Root)); 221nuGetProjectContext.Log(MessageLevel.Debug, Strings.AddedPackageToFolderFromSource, packageIdentity, Path.GetFullPath(Root), downloadResourceResult.PackageSource); 432var installPath = Path.GetFullPath(Path.Combine(packageDirectory, packageName)); 488var installPath = Path.GetFullPath(Path.Combine(packageDirectory, manifestName)); 517var filePath = Path.GetFullPath(Path.Combine(packageDirectory, fileName)); 546return Path.GetDirectoryName(installFilePath); 583var packageDirectoryPath = Path.GetDirectoryName(packageFilePath);
Projects\MSBuildNuGetProject.cs (14)
320var referenceItemFullPath = Path.Combine(packageInstallPath, referenceItem); 321var referenceName = Path.GetFileName(referenceItem); 362var fullImportFilePath = Path.Combine(packageInstallPath, buildImportFile); 372ProjectSystem.AddExistingFile(Path.GetFileName(PackagesConfigNuGetProject.FullPath)); 402p => p.EndsWith(Path.DirectorySeparatorChar + PowerShellScripts.Install, StringComparison.OrdinalIgnoreCase)); 475p => p.EndsWith(Path.DirectorySeparatorChar + PowerShellScripts.Uninstall, 522ProjectSystem.RemoveFile(Path.GetFileName(PackagesConfigNuGetProject.FullPath)); 526ProjectSystem.AddExistingFile(Path.GetFileName(PackagesConfigNuGetProject.FullPath)); 537await ProjectSystem.RemoveReferenceAsync(Path.GetFileName(item)); 565var fullImportFilePath = Path.Combine(FolderNuGetProject.GetInstalledPath(packageIdentity), buildImportFile); 610if (!filePath.StartsWith(PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) 611&& !filePath.StartsWith(PackagingConstants.Folders.Lib + Path.AltDirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) 616var fileName = Path.GetFileName(filePath); 626Constants.AssemblyReferencesExtensions.Contains(Path.GetExtension(filePath), StringComparer.OrdinalIgnoreCase);
Projects\PackagesConfigNuGetProject.cs (6)
76PackagesConfigPath = Path.Combine(folderPath, "packages.config"); 79PackagesProjectNameConfigPath = Path.Combine(folderPath, "packages." + projectName + ".config"); 125nuGetProjectContext.Log(MessageLevel.Warning, Strings.PackageAlreadyExistsInPackagesConfig, packageIdentity, Path.GetFileName(FullPath)); 181nuGetProjectContext.Log(MessageLevel.Info, Strings.AddedPackageToPackagesConfig, packageIdentity, Path.GetFileName(FullPath)); 202nuGetProjectContext.Log(MessageLevel.Warning, Strings.PackageDoesNotExisttInPackagesConfig, packageIdentity, Path.GetFileName(FullPath)); 235nuGetProjectContext.Log(MessageLevel.Info, Strings.RemovedPackageFromPackagesConfig, packageIdentity, Path.GetFileName(FullPath));
Projects\PowerShellScripts.cs (1)
16public static readonly string InitPS1RelativePath = PackagingConstants.Folders.Tools + Path.AltDirectorySeparatorChar + Init;
Projects\ProjectJsonNuGetProject.cs (1)
61_projectName = Path.GetFileNameWithoutExtension(msBuildProjectPath);
Utility\FileSystemUtility.cs (28)
46return Path.Combine(root, path); 72|| string.IsNullOrEmpty(Path.GetFileName(path))) 77Directory.CreateDirectory(GetFullPath(root, Path.GetDirectoryName(path))); 96var folderPath = Path.GetDirectoryName(path); 100nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_AddedFileToFolder, Path.GetFileName(path), folderPath); 104nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_AddedFile, Path.GetFileName(path)); 127if (string.IsNullOrEmpty(Path.GetFileName(fullPath))) 142if (string.IsNullOrEmpty(Path.GetFileName(fullPath))) 148Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); 155|| string.IsNullOrEmpty(Path.GetFileName(fullPath))) 170path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path)); 188trimmedPaths.Add(filePath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar)); 192trimmedPaths.Add(filePath.TrimStart(Path.DirectorySeparatorChar)); 224var folderPath = Path.GetDirectoryName(fullPath); 230Path.GetFileName(fullPath), 231Path.GetFullPath(folderPath)); 235nuGetProjectContext.Log(MessageLevel.Debug, Strings.Debug_RemovedFile, Path.GetFileName(fullPath)); 273var directoryLookup = filesToDelete.ToLookup(p => Path.GetDirectoryName(p)); 285var dirPath = Path.Combine(packagesDir, directory); 294var path = Path.Combine(packagesDir, file); 303DeleteDirectorySafe(Path.Combine(packagesDir, dirPath), recursive: false, nuGetProjectContext: nuGetProjectContext); 398for (var path = Path.GetDirectoryName(filePath); !string.IsNullOrEmpty(path); path = Path.GetDirectoryName(path)) 466foreach (var index in IndexOfAll(path, altDirectorySeparator ? Path.AltDirectorySeparatorChar : Path.DirectorySeparatorChar)) 491return fullPath.TrimStart(Path.DirectorySeparatorChar); 493return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar); 498return fullPath.Substring(root.Length).TrimStart(Path.DirectorySeparatorChar);
Utility\MSBuildNuGetProjectSystemUtility.cs (11)
27if (File.Exists(Path.Combine(msBuildNuGetProjectSystem.ProjectFullPath, path))) 31return Shared.XmlUtility.Load(Path.Combine(msBuildNuGetProjectSystem.ProjectFullPath, path), LoadOptions.PreserveWhitespace); 225p => Path.GetDirectoryName(ResolveTargetPath(projectSystem, 246if (!Directory.Exists(Path.Combine(projectFullPath, directory))) 394var fullPath = Path.Combine(projectSystem.ProjectFullPath, path); 434var fullPath = Path.Combine(projectSystem.ProjectFullPath, path); 514PackagingCoreConstants.EmptyFolder.Equals(Path.GetFileName(packageFilePath), StringComparison.OrdinalIgnoreCase); 570var fileName = Path.GetFileName(truncatedPath); 587if (effectivePathForContentFile.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)) 589effectivePathForContentFile = effectivePathForContentFile.Substring((PackagingConstants.Folders.Content + Path.DirectorySeparatorChar).Length); 593var frameworkFolderEndIndex = effectivePathForContentFile.IndexOf(Path.DirectorySeparatorChar);
Utility\PackagesConfigContentHashProvider.cs (4)
49var metadataPath = Path.Combine(Path.GetDirectoryName(nupkgPath), PackagingCoreConstants.NupkgMetadataFileExtension); 61return Path.Combine(Path.GetDirectoryName(nupkgPath), PackagingCoreConstants.NupkgMetadataFileExtension);
Utility\PackagesConfigLockFileUtility.cs (2)
80return Path.Combine(projectPath, nuGetLockFilePath); 97var lockFilePath = GetPackagesLockFilePath(Path.GetDirectoryName(packagesConfigFile), nuGetLockFilePath, projectName);
Utility\PackagesFolderPathUtility.cs (3)
51return Uri.UnescapeDataString(path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); 53return Path.Combine(solutionDirectory, string.IsNullOrEmpty(path) ? DefaultRepositoryPath : path);
Utility\XmlUtility.cs (2)
15if (File.Exists(Path.Combine(root, path))) 19return Shared.XmlUtility.Load(Path.Combine(root, path), LoadOptions.PreserveWhitespace);
NuGet.Packaging (139)
Core\FrameworkNameValidatorUtility.cs (2)
11return IsValidFrameworkName(PackagingConstants.Folders.Build + Path.DirectorySeparatorChar 12+ framework.GetShortFolderName() + Path.DirectorySeparatorChar);
PackageArchiveReader.cs (5)
160path = path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 308var normalizedPath = Uri.UnescapeDataString(packageFileName.Replace('/', Path.DirectorySeparatorChar)); 371PathUtility.EnsureTrailingSlash(Path.GetFullPath(destination)), 387var packageFileFullPath = Path.Combine(packageDirectory, packageFile);
PackageCreation\Authoring\EmptyFrameworkFolderFile.cs (1)
25TargetPath = System.IO.Path.Combine(directoryPathInPackage, PackagingConstants.PackageEmptyFileName);
PackageCreation\Authoring\PackageBuilder.cs (22)
50: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic) 55: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic, logger, versionOverride: "") 60: this(path, Path.GetDirectoryName(path)!, propertyProvider, includeEmptyDirectories, deterministic, logger, versionOverride) 429(f.Path.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) || 430f.Path.StartsWith(PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))); 440f.Path.StartsWith(PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) && 450file.Path.StartsWith(PackagingConstants.Folders.ContentFiles + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)); 464file.Path.StartsWith(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase) && 516select Path.GetFileName(file.Path), StringComparer.OrdinalIgnoreCase); 609var ext = Path.GetExtension(licenseMetadata.License); 645var ext = Path.GetExtension(iconPath); 771var extension = Path.GetExtension(readmePath); 965var fileExtension = Path.GetExtension(file.Path); 1000exclude = exclude?.Replace('\\', Path.DirectorySeparatorChar); 1002List<PhysicalPackageFile> searchFiles = ResolveSearchPattern(basePath, source.Replace('\\', Path.DirectorySeparatorChar), destination, _includeEmptyDirectories).ToList(); 1007searchFiles.RemoveAll(file => Path.GetFileName(file.TargetPath) == PackagingConstants.PackageEmptyFileName 1060packagePath = fullPath.Substring(searchDirectory.Length).TrimStart(Path.DirectorySeparatorChar); 1062else if (!isWildcardSearch && Path.GetExtension(searchPattern).Equals(Path.GetExtension(targetPath), StringComparison.OrdinalIgnoreCase)) 1070packagePath = Path.GetFileName(fullPath); 1072return Path.Combine(targetPath ?? string.Empty, packagePath); 1136var segments = path.Split(new[] { '/', '\\', Path.DirectorySeparatorChar }, StringSplitOptions.None)
PackageCreation\Utility\FrameworkNameUtility.cs (6)
19string folderPrefix = knownFolder + System.IO.Path.DirectorySeparatorChar; 64string targetFrameworkString = Path.GetDirectoryName(path)!.Split(Path.DirectorySeparatorChar).First(); 89string folderPrefix = knownFolder + System.IO.Path.DirectorySeparatorChar; 134string targetFrameworkString = Path.GetDirectoryName(path)!.Split(Path.DirectorySeparatorChar).First();
PackageExtraction\PackageHelper.cs (2)
55|| string.IsNullOrEmpty(Path.GetFileName(packageFileName))) 151runtimePackageDirectory = Path.GetDirectoryName(runtimePackageFilePath);
PackageExtraction\PackagePathHelper.cs (4)
22path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path)); 49path = PathUtility.EnsureTrailingSlash(Path.Combine(root, path)); 94var name = Path.GetFileNameWithoutExtension(path); 130var manifestFileName = Path.ChangeExtension(packageFileName, PackagingCoreConstants.NuspecExtension);
PackageExtraction\StreamExtensions.cs (2)
75if (Path.GetFileName(fileFullPath).Length == 0) 81var directory = Path.GetDirectoryName(fileFullPath);
PackageExtractor.cs (28)
97var targetNuspecPath = Path.Combine( 127var nupkgFilePath = Path.Combine( 224var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentityFromNuspec)); 333var nupkgFilePath = Path.Combine(packageDirectory, packagePathResolver.GetPackageFileName(packageIdentityFromNuspec)); 450var targetTempNupkg = Path.Combine(targetPath, Path.GetRandomFileName()); 451var tempHashPath = Path.Combine(targetPath, Path.GetRandomFileName()); 452var tempNupkgMetadataPath = Path.Combine(targetPath, Path.GetRandomFileName()); 491packageReader.ExtractFile(nuspecFile, targetPath, Path.GetFullPath(targetNuspec), logger); 496var hashFileName = Path.GetFileName(hashPath); 497var nupkgMetadataFileName = Path.GetFileName(nupkgMetadataFilePath); 726var targetTempNupkg = Path.Combine(targetPath, Path.GetRandomFileName()); 727var tempHashPath = Path.Combine(targetPath, Path.GetRandomFileName()); 728var tempNupkgMetadataFilePath = Path.Combine(targetPath, Path.GetRandomFileName()); 780var packageDirectoryPath = Path.GetDirectoryName(targetNuspec)!; 796var nuspecFileName = Path.GetFileName(targetNuspec); 797var actualNuspecFileName = Path.GetFileName(extractedNuspecFilePath); 801var tempNuspecFilePath = Path.Combine(packageDirectoryPath, Path.GetRandomFileName()); 816var hashFileName = Path.GetFileName(hashPath); 817var nupkgMetadataFileName = Path.GetFileName(nupkgMetadataFilePath); 906var fileName = Path.GetFileName(fullName); 919var extension = Path.GetExtension(fullName);
PackageFileExtractor.cs (7)
46var dllFile = Path.ChangeExtension(file, ".dll"); 54var resourceDll = Path.ChangeExtension(file, ".resources.dll"); 87return Path.ChangeExtension(fileAtParentDirectory, ".dll"); 101var extractDirectory = Path.GetDirectoryName(target)!; 108var targetZip = Path.ChangeExtension(target, ".xml.zip"); 112var entry = zipArchive.CreateEntry(Path.GetFileName(source)); 122if (Path.IsPathRooted(source))
PackageFolderReader.cs (5)
98var fullPath = Path.GetFullPath(Path.Combine(_rootPath, path)); 125searchFolder = new DirectoryInfo(Path.Combine(_root.FullName, folder)); 212var targetPath = Path.Combine(destination, packageFile); 213Directory.CreateDirectory(Path.GetDirectoryName(targetPath)!);
PackagePathResolver.cs (3)
36if (!Path.IsPathRooted(rootDirectory)) 85return Path.Combine(_rootDirectory, GetPackageDirectoryName(packageIdentity)); 92return string.IsNullOrEmpty(installedPackageFilePath) ? null : Path.GetDirectoryName(installedPackageFilePath);
PackageReaderBase.cs (9)
295var file = Path.GetFileName(path); 496var file = Path.GetFileName(path); 509var extension = Path.GetExtension(path); 566var fullPath = Path.GetFullPath(Path.Combine(normalizedDestination, normalizedFilePath)); 593if (!path.EndsWith(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal)) 595path += Path.DirectorySeparatorChar; 598return Path.GetFullPath(path); 606var normalizedPath = Uri.UnescapeDataString(p.Replace('/', Path.DirectorySeparatorChar));
PackageReaderExtensions.cs (2)
39Path.GetDirectoryName(item)! 40.Split(Path.DirectorySeparatorChar)
PackagesConfigWriter.cs (3)
524var directorypath = Path.GetDirectoryName(fullPath)!; 526var configFileCopyPath = Path.Combine(directorypath, 554var configFileNewPath = Path.Combine(directorypath,
Rules\ContentFolderInPackageReferenceProjectRule.cs (2)
27(PackagingConstants.Folders.Content + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))) 33(PackagingConstants.Folders.ContentFiles + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase)))
Rules\DependenciesGroupsForEachTFMRule.cs (1)
30Where(t => PathUtility.GetPathWithDirectorySeparator(t).Count(m => m == Path.DirectorySeparatorChar) > 1);
Rules\InitScriptNotUnderToolsRule.cs (3)
24var name = Path.GetFileName(file); 25var dirName = Path.GetFileName(Path.GetDirectoryName(file))!;
Rules\InstallScriptInPackageReferenceProjectRule.cs (1)
24t.StartsWith(PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar,
Rules\InvalidFrameworkFolderRule.cs (1)
29var parts = file.Split(Path.DirectorySeparatorChar);
Rules\InvalidPlaceholderFileRule.cs (3)
26if (Path.GetFileName(file).Equals(PackagingCoreConstants.EmptyFolder, StringComparison.Ordinal)) 28var directory = PathUtility.EnsureTrailingSlash(Path.GetDirectoryName(file)!); 29if (builder.GetFiles().Count(f => PathUtility.EnsureTrailingSlash(Path.GetDirectoryName(f)!).StartsWith(directory, StringComparison.OrdinalIgnoreCase)) > 1)
Rules\MisplaceAssemblyOutsideLibRule.cs (9)
64PackagingConstants.Folders.Lib + Path.DirectorySeparatorChar, 65PackagingConstants.Folders.Analyzers + Path.DirectorySeparatorChar, 66PackagingConstants.Folders.Ref + Path.DirectorySeparatorChar, 67PackagingConstants.Folders.Runtimes + Path.DirectorySeparatorChar, 68PackagingConstants.Folders.Native + Path.DirectorySeparatorChar, 69PackagingConstants.Folders.Build + Path.DirectorySeparatorChar, 70PackagingConstants.Folders.BuildCrossTargeting + Path.DirectorySeparatorChar, 71PackagingConstants.Folders.BuildTransitive + Path.DirectorySeparatorChar, 72PackagingConstants.Folders.Tools + Path.DirectorySeparatorChar,
Rules\MisplacedAssemblyUnderLibRule.cs (1)
25var directory = Path.GetDirectoryName(file)!;
Rules\MisplacedScriptFileRule.cs (1)
34if (!file.StartsWith(ToolsDirectory + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
Rules\MisplacedTransformFileRule.cs (2)
39if (!file.StartsWith(ContentDirectory + Path.DirectorySeparatorChar, 41&& !file.StartsWith(ContentFilesDirectory + Path.DirectorySeparatorChar,
Rules\PathTooLongRule.cs (1)
26if (Path.Combine(installedPath, file).Length > _pathLenghtWarningThreshold)
Rules\ReferencesInNuspecMatchRefAssetsRule.cs (1)
57.GroupBy(t => NuGetFramework.ParseFolder(t.Split('/')[1]).GetShortFolderName(), t => Path.GetFileName(t));
Rules\UnrecognizedScriptFileRule.cs (1)
34var name = Path.GetFileNameWithoutExtension(file);
Rules\UpholdBuildConventionRule.cs (1)
72foreach (var extension in tfm.GroupBy(Path.GetExtension))
Signing\Authoring\SigningOptions.cs (1)
177return Path.GetFullPath(filePath).TrimEnd('\\');
Signing\TrustStore\FallbackCertificateBundleX509ChainFactory.cs (1)
45string fullFilePath = Path.Combine(
Signing\Utility\SigningUtility.cs (1)
181var tempPackageFile = new FileInfo(Path.GetTempFileName());
VersionFolderPathResolver.cs (7)
53return Path.Combine( 65return Path.Combine( 78return Path.Combine( 92return Path.Combine( 105return Path.Combine( 129return Path.Combine( 152return Path.Combine(
NuGet.ProjectModel (13)
ExternalProjectReference.cs (1)
123?? Path.GetFileNameWithoutExtension(MSBuildProjectPath)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (2)
118string filePath = name == null ? null : Path.GetFullPath(packageSpecPath); 165packageSpec.FilePath = name == null ? null : Path.GetFullPath(packageSpecPath);
PackageSpec.cs (1)
46public string BaseDirectory => Path.GetDirectoryName(FilePath);
ProjectLockFile\PackagesLockFileUtilities.cs (4)
43return Path.Combine(project.BaseDirectory, path); 46var projectName = Path.GetFileNameWithoutExtension(project.RestoreMetadata.ProjectPath); 54var path = Path.Combine(baseDirectory, "packages." + projectName.Replace(' ', '_') + ".lock.json"); 62return Path.Combine(baseDirectory, PackagesLockFileFormat.LockFileName);
ToolPathResolver.cs (5)
34return Path.Combine(toolDirectory, LockFileFormat.AssetsFileName); 62return Path.Combine( 74return Path.Combine( 103var toolBasePath = Path.Combine(GetPackagesToolsBasePath(), _isLowercase ? packageId.ToLowerInvariant() : packageId); 113var version = Path.GetFileName(versionDirectory);
NuGet.Protocol (56)
HttpSource\HttpCacheUtility.cs (8)
30var cacheFolder = Path.Combine(httpCacheDirectory, baseFolderName); 31var cacheFile = Path.Combine(cacheFolder, baseFileName); 41var temporaryFile = Path.Combine(context.RootTempFolder!, Path.GetRandomFileName()); 42var newTemporaryFile = Path.Combine(context.RootTempFolder!, Path.GetRandomFileName()); 59var newCacheFileDirectory = Path.GetDirectoryName(result.NewFile)!; 60var cacheFileDirectory = Path.GetDirectoryName(result.CacheFile)!;
LocalRepositories\FindLocalPackagesResourceUnzipped.cs (4)
112validSet.IntersectWith(files.Select(file => Path.GetFileNameWithoutExtension(file.Name))); 119var nupkgPath = Path.Combine(rootDirInfo.FullName, $"{name}{PackagingCoreConstants.NupkgExtension}"); 138var nuspecPath = Path.Combine(root.FullName, name, $"{name}{PackagingCoreConstants.NuspecExtension}"); 147var nupkgPath = Path.Combine(root.FullName, $"{name}{PackagingCoreConstants.NupkgExtension}");
LocalRepositories\LocalPackageInfo.cs (3)
53var directoryName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Path)!, System.IO.Path.GetFileNameWithoutExtension(Path));
PackagesFolder\LocalPackageFileCache.cs (1)
231var runtimeGraphFile = Path.Combine(expandedPath, RuntimeGraph.RuntimeGraphFileName);
PackagesFolder\NuGetv3LocalRepository.cs (1)
184var versionPart = fullVersionDir.Substring(packageIdRoot.Length).TrimStart(Path.DirectorySeparatorChar);
Plugins\Logging\PluginLogger.cs (2)
163var fileName = $"NuGet_PluginLogFor_{Path.GetFileNameWithoutExtension(file.Name)}_{DateTime.UtcNow.Ticks:x}_{processId}.log"; 164var filePath = Path.Combine(logDirectoryPath, fileName);
Plugins\Plugin.cs (1)
113Name = Path.GetFileNameWithoutExtension(filePath);
Plugins\PluginCacheEntry.cs (2)
25RootFolder = Path.Combine(rootCacheFolder, CachingUtility.RemoveInvalidFileNameChars(CachingUtility.ComputeHash(pluginFilePath, addIdentifiableCharacters: false))); 26CacheFileName = Path.Combine(RootFolder, CachingUtility.RemoveInvalidFileNameChars(CachingUtility.ComputeHash(requestKey, addIdentifiableCharacters: false)) + ".dat");
Plugins\PluginDiscoverer.cs (3)
97var filePaths = _netCoreOrNetFXPluginPaths!.Split(new[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries); 191string[] paths = _nuGetPluginPaths?.Split([Path.PathSeparator], StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>(); 240string[] paths = nugetPluginPaths?.Split(Path.PathSeparator) ?? Array.Empty<string>();
Plugins\PluginDiscoveryUtility.cs (5)
57Path.Combine( 58Path.GetDirectoryName(nugetAssemblyPath)!, 68return Path.Combine(nuGetHome, 91var expectedPluginName = Path.Combine(pluginDirectory, Path.GetFileName(pluginDirectory) + ".dll");
Plugins\PluginPackageReader.cs (3)
853var file = Path.GetFileName(path); 1106var directory = Path.GetDirectoryName(nupkgFilePath)!; 1109var filePath = Path.Combine(directory, fileName);
Resources\PackageStagingResourceV3.cs (1)
142content.Add(fileContent, formFieldName, Path.GetFileName(packagePath));
Resources\PackageUpdateResource.cs (9)
236Path.GetFileName(symbolPackagePath), 327Path.GetFileName(symbolPackagePath), 367Path.GetFileName(packageToPush), 414var symbolPath = Path.GetFileNameWithoutExtension(packagePath) + (isSnupkg ? NuGetConstants.SnupkgExtension : NuGetConstants.SymbolsExtension); 415var packageDir = Path.GetDirectoryName(packagePath)!; 416return Path.Combine(packageDir, symbolPath); 696var fullPath = Path.Combine(root, packageFileName); 806var nupkgFilePath = Path.Combine(root, packageFileName); 894var idDirectoryName = Path.GetFileName(idDirectory);
Utility\CachingUtility.cs (1)
89var invalid = Path.GetInvalidFileNameChars();
Utility\FindPackagesByIdNupkgDownloader.cs (1)
120string tempFilePath = Path.GetTempFileName();
Utility\GetDownloadResultUtility.cs (2)
186var randomComponent = Path.GetRandomFileName(); 188var directDownloadPath = Path.Combine(downloadContext.DirectDownloadDirectory!, fileName);
Utility\LocalFolderUtility.cs (6)
371var expectedPath = Path.Combine(rootDirInfo.FullName, idVersion, $"{idVersion}{PackagingCoreConstants.NupkgExtension}"); 473var nupkgPath = Path.Combine( 576fileName = Path.GetFileNameWithoutExtension(fileName); 1083packagePath = packagePath + Path.DirectorySeparatorChar + '*'; 1291var tempNupkgMetadataFilePath = Path.Combine(installPath, Path.GetRandomFileName());
Utility\OfflineFeedUtility.cs (3)
73return Path.GetDirectoryName( 87var invalidPathChars = Path.GetInvalidPathChars(); 101path = Path.GetFullPath(path);
Pipelines.AppHost (6)
AppHost.cs (6)
263.CreateTaskAsync($"Uploading {Path.GetFileName(sourcePath)} to {fileShareName}", deployingContext.CancellationToken) 292var relativePath = Path.GetRelativePath(sourcePath, filePath); 293var directoryPath = Path.GetDirectoryName(relativePath) ?? string.Empty; 299var parts = directoryPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 307var fileName = Path.GetFileName(filePath);
Pipelines.Library (4)
DistributedApplicationPipelineExtensions.cs (4)
75var publishDir = Path.Combine(Path.GetTempPath(), $"aspire-publish-{Guid.NewGuid()}"); 119var zipPath = Path.Combine(Path.GetTempPath(), $"aspire-deploy-{Guid.NewGuid()}.zip");
PresentationBuildTasks (71)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (6)
139string currentProjectName = Path.GetFileNameWithoutExtension(CurrentProject); 140string currentProjectExtension = Path.GetExtension(CurrentProject); 149string randomFileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); 277( "_TargetAssemblyProjectName", Path.GetFileNameWithoutExtension(CurrentProject) ), 313foreach (FileInfo temporaryProjectFile in intermediateOutputPath.EnumerateFiles($"{Path.GetFileNameWithoutExtension(TemporaryTargetAssemblyProjectName)}*"))
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (10)
63_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 264if (!_outputDir.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 266_outputDir += Path.DirectorySeparatorChar; 712string buildCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, buildExtension); 713string intelCodeFile = OutputPath + Path.ChangeExtension(relativeFilePath, intellisenseExtension); 721bamlFile = OutputPath + Path.ChangeExtension(relativeFilePath, SharedStrings.BamlExtension); 861return Path.Combine(OutputPath, fileName); 1077int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1125asmname = Path.GetFileNameWithoutExtension(refpath); 1672locFile = Path.ChangeExtension(xamlRelativeFilePath, SharedStrings.LocExtension);
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (6)
49_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 243if (!_outputPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 245_outputPath += Path.DirectorySeparatorChar; 540int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar); 605asmname = Path.GetFileNameWithoutExtension(refpath); 774string bamlFileName = Path.ChangeExtension(resolvedXamlfile, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\MergeLocalizationDirectives.cs (1)
55string absoluteFilePath = Path.Combine(
Microsoft\Build\Tasks\Windows\ResourcesGenerator.cs (10)
38_sourcePath = Path.GetFullPath(path); 124SourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 249_outputPath = Path.GetFullPath(value); 251if (!_outputPath.EndsWith((Path.DirectorySeparatorChar).ToString(), StringComparison.Ordinal)) 252_outputPath += Path.DirectorySeparatorChar; 354string fullFilePath = Path.GetFullPath(filePath); 373relPath = Path.GetFileName(fullFilePath); 390Path.GetExtension(sourceFilePath).Equals(SharedStrings.BamlExtension) && 391Path.GetExtension(path).Equals(SharedStrings.XamlExtension)) 394path = Path.ChangeExtension(path, SharedStrings.BamlExtension);
Microsoft\Build\Tasks\Windows\UidManager.cs (7)
155string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 358return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidtemp")); 363return Path.Combine(_backupPath, Path.ChangeExtension(Path.GetFileName(fileName), "uidbackup"));
MS\Internal\MarkupCompiler\MarkupCompiler.cs (12)
472if (!TargetPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal)) 474TargetPath += Path.DirectorySeparatorChar; 478int pathEndIndex = SourceFileInfo.RelativeSourceFilePath.LastIndexOf(Path.DirectorySeparatorChar); 1586string pathOfRelativeSourceFilePath = System.IO.Path.GetDirectoryName(SourceFileInfo.RelativeSourceFilePath); 1593string path = Path.GetRelativePath(TargetPath + pathOfRelativeSourceFilePath, SourceFileInfo.SourcePath); 1596return path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar; 1605string[] dirs = relPath.Split(Path.DirectorySeparatorChar); 2635Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, 3327string fullFilePath = Path.GetFullPath(_splashImage); 3340relPath = TaskHelper.GetRootRelativePath(Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar, fullFilePath); 3349resourceId = Path.GetFileName(fullFilePath);
MS\Internal\MarkupCompiler\PathInternal.cs (6)
42relativeTo = Path.GetFullPath(relativeTo); 43path = Path.GetFullPath(path); 89sb.Append(Path.DirectorySeparatorChar); 110sb.Append(Path.DirectorySeparatorChar); 125return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar;
MS\Internal\Tasks\CompilerWrapper.cs (4)
38_sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 390if (!Path.IsPathRooted(filePath)) 396string fullFilePath = Path.GetFullPath(filePath); 419int pathEndIndex = fullFilePath.LastIndexOf(Path.DirectorySeparatorChar);
MS\Internal\Tasks\IncrementalCompileAnalyzer.cs (5)
208string filepath = Path.GetFullPath(fileName); 463Path.GetFullPath(taskItem.ItemSpec), 486string curDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar; 494string fullPath = Path.GetFullPath(_mcPass1.ContentFiles[i].ItemSpec); 500relContentFilePath = Path.GetFileName(fullPath);
MS\Internal\Tasks\TaskHelper.cs (3)
68if (!Path.IsPathRooted(thePath) ) 74thePath = Path.GetFullPath(thePath); 94string sourceDir = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar;
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
564_cachedMetadataLoadContextAssembliesByNameNoExtension.Add(Path.GetFileNameWithoutExtension(fullPathToAssembly), assembly);
PresentationCore (21)
MS\Internal\FontCache\DWriteFactory.cs (3)
63localPath = Directory.GetParent(fontCollectionUri.LocalPath).FullName + Path.DirectorySeparatorChar; 71if (string.Equals((localPath.Length > 0 && localPath[localPath.Length - 1] != Path.DirectorySeparatorChar) ? localPath + Path.DirectorySeparatorChar : localPath, Util.WindowsFontsUriObject.LocalPath, StringComparison.OrdinalIgnoreCase))
MS\Internal\FontCache\FamilyCollection.cs (2)
45internal static string SxSFontsResourcePrefix { get; } = $"/{Path.GetFileNameWithoutExtension(ExternDll.PresentationCore)};component/fonts/"; 238FontSource fontSource = new FontSource(new Uri(Path.Combine(FamilyCollection.SxSFontsResourcePrefix, _systemCompositeFontsFileNames[index] + Util.CompositeFontExtension), UriKind.RelativeOrAbsolute),
MS\Internal\FontCache\FontCacheUtil.cs (2)
288private static readonly char[] InvalidFileNameChars = Path.GetInvalidFileNameChars(); 585return Path.GetExtension(unescapedPath);
MS\Internal\FontCache\FontResourceCache.cs (1)
126string extension = Path.GetExtension(fileName);
MS\Internal\FontCache\FontSourceCollection.cs (4)
74_isFileSystemFolder = localPath[localPath.Length - 1] == Path.DirectorySeparatorChar; 120if (Util.IsSupportedFontExtension(Path.GetExtension(file), out isComposite)) 144isComposite = Util.IsCompositeFont(Path.GetExtension(_uri.AbsoluteUri)); 149isComposite = Util.IsCompositeFont(Path.GetExtension(resourceName));
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (1)
210String guid = Path.GetFileNameWithoutExtension(
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
135string extensionWithDot = Path.GetExtension(docString);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\IO\FileHelper.cs (5)
97string folderPath = Path.GetTempPath(); 101string subFolderPath = Path.Combine(folderPath, subFolder); 115string path = Path.Combine(folderPath, Path.GetRandomFileName()); 118path = Path.ChangeExtension(path, extension);
System\Windows\Input\Cursor.cs (1)
214string filePath = Path.GetTempFileName();
System\Windows\Media\ColorContext.cs (1)
579profilePath = new Uri(Path.Combine(buffer.ToString(), profilePathString));
PresentationFramework (20)
Microsoft\Win32\FileDialog.cs (5)
112string safeFN = Path.GetFileName(CriticalItemName); 143safeFileNames[i] = Path.GetFileName(unsafeFileNames[i]); 458string tempPath = Path.GetFullPath(fileName); 564if (AddExtension && !Path.HasExtension(fileName)) 572string currentExtension = Path.GetExtension(fileName);
Microsoft\Win32\OpenFolderDialog.cs (2)
99string safeFN = Path.GetFileName(CriticalItemName); 130safeFolderNames[i] = Path.GetFileName(unsafeFolderNames[i]);
MS\Internal\AppModel\ContentFilePart.cs (2)
68_fullPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), filePath);
MS\Internal\AppModel\ResourcePart.cs (3)
116if (string.Equals(Path.GetExtension(_name), ResourceContainer.BamlExt, StringComparison.OrdinalIgnoreCase)) 121if (string.Equals(Path.GetExtension(_name), ResourceContainer.XamlExt, StringComparison.OrdinalIgnoreCase)) 124string newName = Path.ChangeExtension(_name, ResourceContainer.BamlExt);
MS\Internal\IO\Packaging\PackageFilter.cs (1)
594string extension = Path.GetExtension(path);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (2)
100private static readonly string _currentModuleDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 123_moduleHandle = Platform.LoadLibraryExW(System.IO.Path.Combine(_currentModuleDirectory, fileName), IntPtr.Zero, /* LOAD_WITH_ALTERED_SEARCH_PATH */ 8);
MS\Win32\UxThemeWrapper.cs (1)
263themeName = Path.GetFileNameWithoutExtension(themeName);
System\Windows\Documents\Speller.cs (1)
1557tempFolder = System.IO.Path.GetTempPath();
System\Windows\Shell\JumpList.cs (2)
129itemPath = Path.GetFullPath(itemPath); 990return ShellUtil.GetShellItemForPath(Path.GetFullPath(jumpPath.Path));
System\Windows\SystemParameters.cs (1)
5533_uxThemeName = System.IO.Path.GetFileNameWithoutExtension(name);
PresentationUI (11)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
98_filename = Path.GetFileName(_uri.LocalPath);
MS\Internal\Documents\Application\DocumentStream.cs (4)
808file = Path.GetFileNameWithoutExtension(path); 819Path.GetDirectoryName(path), 820Path.DirectorySeparatorChar, 955if (!Path.GetExtension(location.LocalPath).Equals(
MS\Internal\Documents\Application\FilePresentation.cs (1)
86Path.GetExtension(filePath),
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
365Path.GetFileNameWithoutExtension(DocumentProperties.Current.Filename),
MS\Internal\Documents\RightsManagementManager.cs (1)
860string msdrmdllPath = Path.Combine(systemPath, msdrmDLLName);
MS\Internal\Documents\RightsManagementProvider.cs (2)
1353string applicationManifestFileLocation = Path.Combine( Path.GetDirectoryName(fileName),
MS\Internal\Documents\RMPublishingDialog.cs (1)
1001return Path.GetFileNameWithoutExtension(_template.LocalPath);
ProjectResourceExtensions.AppHost (2)
AppHost.cs (2)
58var projectPath = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, relativeProjectPath));
ReachFramework (4)
Packaging\XpsFixedPageReaderWriter.cs (3)
1852ReadOnlySpan<char> extension = Path.GetExtension(path).Slice(1); 1897String extension = Path.GetExtension(path); 1898String fileName = Path.GetFileNameWithoutExtension(path);
Serialization\XpsFontSubsetter.cs (1)
657string fileName = System.IO.Path.GetFileNameWithoutExtension(
RepoTasks (42)
BatchHelixWorkItems.cs (8)
51var batchRoot = Path.Combine(OutputDirectory, "batched"); 78File.WriteAllText(Path.Combine(payloadDirectory, "targets.txt"), testAssembly); 102var batchDirectory = Path.Combine(batchRoot, $"batch_{batchNumber}"); 117var destPath = Path.Combine(batchDirectory, Path.GetFileName(file)); 130var assemblyName = Path.GetFileNameWithoutExtension(testAssembly); 131var targetDirectory = Path.Combine(batchDirectory, assemblyName); 147File.WriteAllLines(Path.Combine(batchDirectory, "targets.txt"), targets);
GenerateTestDevCert.cs (1)
46var devCertJsonFile = Path.ChangeExtension(CertificatePath, ".json");
ResolveDotnetToolPackagePaths.cs (1)
102var packagePath = Path.Combine(
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (5)
443var exportDir = Path.GetDirectoryName(path); 661var targetDirectoryPath = Path.GetDirectoryName(path); 747var tempFilename = Path.GetTempFileName(); 769var keyPath = Path.ChangeExtension(path, ".key"); 775var tempFilename = Path.GetTempFileName();
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (6)
34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https"); 96var tmpFile = Path.GetTempFileName(); 156var tmpFile = Path.GetTempFileName(); 207var certificatePath = Path.GetTempFileName(); 347var certificatePath = Path.GetTempFileName(); 377Path.Combine(MacOSUserHttpsCertificateLocation, $"aspnetcore-localhost-{certificate.Thumbprint}.pfx");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (21)
111var sslCertDirs = sslCertDirString.Split(Path.PathSeparator); 114var certPath = Path.Combine(sslCertDir, certificateNickname + ".pem"); 242var certPath = Path.Combine(certDir, nickname) + ".pem"; 356var homeDirectoryWithSlash = homeDirectory[^1] == Path.DirectorySeparatorChar 358: homeDirectory + Path.DirectorySeparatorChar; 361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..]) 370var existingDirs = existingSslCertDir.Split(Path.PathSeparator); 371var certDirFullPath = Path.GetFullPath(certDir); 381return string.Equals(Path.GetFullPath(dir), certDirFullPath, StringComparison.Ordinal); 405Log.UnixSuggestSettingEnvironmentVariable(prettyCertDir, Path.Combine(openSslDir, "certs"), OpenSslCertificateDirectoryVariableName); 471var certPath = Path.Combine(certDir, nickname) + ".pem"; 561return Path.Combine(homeDirectory, ".pki", "nssdb"); 566return Path.Combine(homeDirectory, "snap", "chromium", "current", ".pki", "nssdb"); 571return Path.Combine(homeDirectory, ".mozilla", "firefox"); 576return Path.Combine(homeDirectory, "snap", "firefox", "common", ".mozilla", "firefox"); 600var searchFolders = searchPath.Split(Path.PathSeparator); 610if (File.Exists(Path.Combine(searchFolder, command))) 817return Path.Combine(homeDirectory, ".aspnet", "dev-certs", "trust"); 849var paths = nssDbOverride.Split(Path.PathSeparator); // May be empty - the user may not want to add browser trust 852var nssDb = Path.GetFullPath(path); 1056var linkPath = Path.Combine(certificateDirectory, $"{hash}.{i}");
ResultsOfTGenerator (2)
Program.cs (2)
17var classTargetFilePath = Path.Combine(pwd, "..", "..", "src", "ResultsOfT.Generated.cs"); 18var testsTargetFilePath = Path.Combine(pwd, "..", "..", "test", "ResultsOfTTests.Generated.cs");
Roslyn.Diagnostics.Analyzers (26)
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (6)
206return Path.GetDirectoryName(resolvedBasePath); 214private static readonly char[] s_invalidPathChars = Path.GetInvalidPathChars(); 257return Path.GetFullPath(path); 275return NormalizeAbsolutePath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); 287return Path.GetFullPath(path);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (5)
28internal static char DirectorySeparatorChar => Path.DirectorySeparatorChar; 105var path = Path.Combine(parentPath, directoryName); 149/// Unlike <see cref="System.IO.Path.GetDirectoryName(string)"/> it doesn't check for invalid path characters 475/// Combines paths with the same semantics as <see cref="Path.Combine(string, string)"/> 484/// Relative and absolute paths treated the same as <see cref="Path.Combine(string, string)"/>.
src\roslyn\src\Compilers\Core\Portable\FileSystem\TempPathUtilities.cs (2)
46return Path.GetTempPath(); 124return Path.Combine(home, ".cache");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (3)
79/// The same functionality as <see cref="System.IO.Path.GetExtension(string)"/> but doesn't throw an exception 134/// Equivalent of <see cref="System.IO.Path.ChangeExtension(string, string)"/> 188/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> doesn't check for invalid path characters.</remarks>
src\roslyn\src\Dependencies\Contracts\Contract.cs (1)
160var fileName = filePath is null ? null : Path.GetFileName(filePath);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (2)
43=> _additionalFiles.FirstOrDefault(x => Path.GetFileName(x.Path).Equals(fileName, StringComparison.OrdinalIgnoreCase)); 51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PathHelper.cs (2)
13private static readonly char[] DirectorySeparatorCharacters = [Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (3)
35editorconfigFilePath = Path.Combine(editorconfigFilePath, ".editorconfig"); 52var name = rulesetNode.Attribute(RuleSetNameAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath); 53var description = rulesetNode.Attribute(RuleSetDescriptionAttributeName)?.Value ?? Path.GetFileName(rulesetFilePath);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Helpers\MefHostServicesHelpers.cs (2)
61var thisAssemblyFolder = Path.GetDirectoryName(thisAssemblyName); 63? Path.Combine(thisAssemblyFolder, assemblySimpleName + ".dll")
rzc (50)
DefaultExtensionAssemblyLoader.cs (3)
47if (!Path.IsPathRooted(filePath)) 52var assemblyName = Path.GetFileNameWithoutExtension(filePath); 112if (!Path.IsPathRooted(filePath))
DefaultExtensionDependencyChecker.cs (1)
67if (!Path.IsPathRooted(item.FilePath))
DiscoverCommand.cs (7)
93if (!Path.IsPathRooted(filePath)) 131if (!string.Equals(expectedOriginalPath, Path.GetFileNameWithoutExtension(extensionFilePath), StringComparison.OrdinalIgnoreCase)) 137currentDirectory ??= Path.GetDirectoryName(typeof(Application).Assembly.Location); 138extensionFilePaths.Values[i] = Path.Combine(currentDirectory, RazorCompilerFileName); 174outputFilePath = Path.Combine(projectDirectory, outputFilePath); 204outputFilePath = Path.Combine(projectDirectory, outputFilePath); 212var syntheticPath = Path.Combine(projectDirectory, "__rzc_discover__.cshtml");
GenerateCommand.cs (3)
173if (!Path.IsPathRooted(filePath)) 191tagHelperManifest = Path.Combine(projectDirectory, tagHelperManifest); 503.Replace(Path.DirectorySeparatorChar, '/')
MetadataCache.cs (1)
56Debug.Assert(Path.IsPathRooted(fullPath));
PipeName.cs (1)
47baseDirectory = baseDirectory.TrimEnd(Path.DirectorySeparatorChar);
Program.cs (2)
65var roslynPath = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "Roslyn", "bincore"); 71var loadedAssembly = context.LoadFromAssemblyPath(Path.Combine(roslynPath, assembly.Name + ".dll"));
ServerCommand.cs (2)
153var path = Path.Combine(directoryPath, fileName); 179path = Path.Combine(homePath, ".dotnet", "pids", "build");
ServerProtocol\ServerConnection.cs (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)) 295if (exeName.Equals(Path.GetFileName(expectedPath), StringComparison.Ordinal)) 301var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator); 304var dotnetPath = Path.Combine(path, exeName); 320var expectedCompilerPath = Path.Combine(clientDir, ServerName); 425public static bool IsWindows => Path.DirectorySeparatorChar == '\\'; 426public static bool IsUnix => Path.DirectorySeparatorChar == '/';
ServerProtocol\ServerLogger.cs (1)
48loggingFileName = Path.Combine(loggingFileName, $"razorserver.{GetCurrentProcessId()}.log");
ShadowCopyManager.cs (16)
24BaseDirectory = baseDirectory ?? GetBaseDirectory(Path.Combine("Razor", "ShadowCopy")); 27UniqueDirectory = Path.Combine(BaseDirectory, guid); 42? Path.GetTempPath() 55return Path.Combine(root, relativePath); 62var destination = Path.Combine(assemblyDirectory, Path.GetFileName(filePath)); 65var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); 69foreach (var directory in Directory.EnumerateDirectories(Path.GetDirectoryName(filePath))) 71var directoryName = Path.GetFileName(directory); 73var resourcesPath = Path.Combine(directory, resourcesNameWithExtension); 76var resourcesShadowCopyPath = Path.Combine(assemblyDirectory, directoryName, resourcesNameWithExtension); 80resourcesPath = Path.Combine(directory, resourcesNameWithoutExtension, resourcesNameWithExtension); 83var resourcesShadowCopyPath = Path.Combine(assemblyDirectory, directoryName, resourcesNameWithoutExtension, resourcesNameWithExtension); 105var directory = Path.Combine(UniqueDirectory, id.ToString(CultureInfo.InvariantCulture)); 112var directory = Path.GetDirectoryName(shadowCopyPath); 179if (!Mutex.TryOpenExisting(Path.GetFileName(directory).ToLowerInvariant(), out mutex))
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (1)
38return Path.Combine(homePath, DotnetProfileDirectoryName);
sdk-tasks (99)
CopyPreservingRelativeSymlinks.cs (6)
54sourcePathSet.Add(Path.GetFullPath(item.ItemSpec)); 93var destDir = Path.GetDirectoryName(destPath); 109var sourceDir = Path.GetDirectoryName(Path.GetFullPath(sourcePath))!; 110var resolvedTarget = Path.GetFullPath(Path.Combine(sourceDir, sourceInfo.LinkTarget));
Crossgen.cs (10)
46string tempDirPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); 48TempOutputPath = Path.Combine(tempDirPath, Path.GetFileName(DestinationPath)); 54var files = Directory.GetFiles(Path.GetDirectoryName(TempOutputPath)); 55var destination = Path.GetDirectoryName(DestinationPath); 59File.Copy(file, Path.Combine(destination, Path.GetFileName(file)), overwrite: true); 127platformAssemblyPaths += $"-r {excludeTaskItem.ItemSpec}{Path.DirectorySeparatorChar}*.dll ";
DeduplicateAssembliesWithLinks.cs (6)
146var duplicateDirectory = Path.GetDirectoryName(duplicateFilePath)!; 147var relativePath = Path.GetRelativePath(duplicateDirectory, primaryFilePath); 154var relativePath = Path.GetRelativePath(rootDirectory, filePath); 155return relativePath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Length - 1; 160var extension = Path.GetExtension(filePath);
ExtractArchiveToDirectory.cs (11)
71bool isZipArchive = Path.GetExtension(SourceArchive).Equals(".zip", StringComparison.OrdinalIgnoreCase); 93string destinationPath = Path.GetFullPath(Path.Combine(DestinationDirectory, entry.FullName)); 97Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)); 99Log.LogMessage(Path.GetDirectoryName(entry.FullName)); 128string destinationPath = Path.GetFullPath(Path.Combine(DestinationDirectory, entryName)); 131Directory.CreateDirectory(Path.GetDirectoryName(destinationPath)); 182string fullDirectoryPath = Path.GetFullPath(directory); 184if (!fullDirectoryPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) 186fullDirectoryPath = string.Concat(fullDirectoryPath, Path.DirectorySeparatorChar);
GenerateMSBuildExtensionsSWR.cs (9)
42string sourceFolder = Path.Combine(MSBuildExtensionsLayoutDirectory, relativeSourcePath); 44.Where(f => !Path.GetExtension(f).Equals(".pdb", StringComparison.OrdinalIgnoreCase) && !Path.GetExtension(f).Equals(".swr", StringComparison.OrdinalIgnoreCase)) 46if (files.Any(f => !Path.GetFileName(f).Equals("_._"))) 55sb.Append(Path.Combine(relativeSourcePath, Path.GetFileName(file))); 71string subfolderName = Path.GetFileName(subfolder); 72string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); 73string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
GenerateRuntimeAnalyzersSWR.cs (9)
59string sourceFolder = Path.Combine(RuntimeAnalyzersLayoutDirectory, relativeSourcePath); 66var path = Path.Combine(sourceFolder, file); 78var extension = Path.GetExtension(f); 81!Path.GetFileName(f).Equals("_._"); 92var fileName = Path.GetFileName(file); 95sb.Append(Path.Combine(relativeSourcePath, fileName)); 117string subfolderName = Path.GetFileName(subfolder); 118string newRelativeSourcePath = Path.Combine(relativeSourcePath, subfolderName); 119string newSwrInstallDir = Path.Combine(swrInstallDir, subfolderName);
GetDnxShimLayout.cs (5)
40string name = Path.GetFileName(source.ItemSpec); 47string destination = Path.Combine(root, name); 57.Select(name => Path.Combine(root, name)) 63LayoutPathValidation.RejectDirectory(Path.Combine(root, name)); 88if (Path.GetFileName(item.ItemSpec) == "dnx" && File.Exists(item.ItemSpec))
GetRuntimePackRids.cs (1)
20string runtimeJsonPath = Path.Combine(MetapackagePath, "runtime.json");
IncrementalLayout.cs (4)
228if (!Path.IsPathFullyQualified(path)) 235fullPath = Path.GetFullPath(path); 241string fullPath = Path.GetFullPath(path); 242Directory.CreateDirectory(Path.GetDirectoryName(fullPath)!);
OverrideAndCreateBundledNETCoreAppPackageVersion.cs (2)
158.OrderByDescending(p => NuGetVersion.TryParse(Path.GetFileName(Path.GetDirectoryName(p)), out var v) ? v : new NuGetVersion(0, 0, 0))
ProcessRuntimeAnalyzerVersions.cs (1)
61Directory.CreateDirectory(Path.GetDirectoryName(MetadataFilePath)!);
ReplaceFileContents.cs (1)
123var destinationDirectory = Path.GetDirectoryName(destinationFile);
ReplaceFilesWithSymbolicLinks.cs (4)
79string fileName = Path.GetFileName(file); 83string targetFile = Path.Combine(LinkToFilesFrom, fileName); 136string relativePath = Path.GetRelativePath(Path.GetDirectoryName(path)!, pathToTarget);
TarGzFileCreateFromDirectory.cs (5)
76SourceDirectory = Path.GetFullPath(SourceDirectory); 78SourceDirectory = SourceDirectory.EndsWith(Path.DirectorySeparatorChar.ToString()) 80: SourceDirectory + Path.DirectorySeparatorChar; 107var sourceDirectoryName = Path.GetFileName(Path.GetDirectoryName(SourceDirectory));
WorkloadManifestLayout.cs (18)
129string name = Path.GetFileName(directory); 134string parent = Path.GetDirectoryName(directory)!; 135string flippedPath = Path.Combine(parent, flipped); 140.Any(path => string.Equals(Path.GetFileName(path), flipped, StringComparison.Ordinal)); 158string[] existingParts = Path.GetRelativePath(root, existing).Split(Path.DirectorySeparatorChar); 159string[] destinationParts = Path.GetRelativePath(root, destination).Split(Path.DirectorySeparatorChar); 169if (!IsFeatureBand(Path.GetFileName(band))) 179bool isWorkloadSets = IsWorkloadSets(Path.GetFileName(manifest)); 183if (!IsVersion(Path.GetFileName(version))) 192string baseline = Path.Combine(version, BaselineFileName); 216string[] parts = Path.GetRelativePath(root, path).Split(Path.DirectorySeparatorChar); 229Path.TrimEndingDirectorySeparator(root) + Path.DirectorySeparatorChar, 292Path.Combine(root, item.GetMetadata("NupkgId").ToLowerInvariant(), normalizedVersion)); 294Path.Combine(root, item.GetMetadata("MsiNupkgId").ToLowerInvariant(), normalizedVersion));
WorkloadMetadataLayout.cs (4)
49string workloads = Path.Combine(root, "metadata", "workloads"); 51string? expected = Enabled ? Path.Combine(workloads, FeatureBand, "userlocal") : null; 58if (!GetWorkloadManifestLayout.IsFeatureBand(Path.GetFileName(directory))) 63string marker = Path.Combine(directory, "userlocal");
ZipFileCreateFromDirectory.cs (3)
58if (!Directory.Exists(Path.GetDirectoryName(DestinationArchive))) 59Directory.CreateDirectory(Path.GetDirectoryName(DestinationArchive)); 122if (subdirectory[chop] == Path.DirectorySeparatorChar)
SelectTests (27)
ChangedFileFilter.cs (1)
47var patternsPath = Path.Combine(repoRoot, prefilter.PatternsFile);
GraphAffectedProjects.cs (16)
145trace?.Processing($"build MSBuild ProjectGraph from {Path.GetFileName(solutionPath)}"); 155.Select(p => NormalizeFullPath(Path.GetDirectoryName(p)!)) 170.Select(Path.GetFileNameWithoutExtension) 179var normalizedTestsDir = NormalizeFullPath(Path.Combine(repoRoot, "tests")); 182.Select(Path.GetFileNameWithoutExtension) 229static string NameOf(string projectPath) => Path.GetFileNameWithoutExtension(projectPath); 242["SolutionFileName"] = Path.GetFileName(solutionPath), 243["SolutionName"] = Path.GetFileNameWithoutExtension(solutionPath), 372if (s_pathComparer.Equals(NormalizeFullPath(Path.GetDirectoryName(project)!), directory)) 508NormalizeFullPath(Path.Combine(repoRoot, rel.Replace('/', Path.DirectorySeparatorChar))))) 601path.EndsWith(Path.DirectorySeparatorChar) ? path : path + Path.DirectorySeparatorChar; 605var fullPath = Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
Program.cs (10)
100var repoRoot = Path.GetFullPath(parseResult.GetValue(repoRootOption)!); 102?? Path.Combine(repoRoot, "eng", "github-ci", "test-trigger-map.yml"); 104?? Path.Combine(repoRoot, "Aspire.slnx"); 314var name = Path.GetFileNameWithoutExtension(relPath); 333var directory = Path.GetDirectoryName(Path.GetFullPath(path)); 653var dir = Path.GetDirectoryName(Path.GetFullPath(jsonPath)); 1004var dir = Path.GetDirectoryName(Path.GetFullPath(commentPath));
Stress.ApiService (2)
Program.cs (2)
394var xmlLarge = File.ReadAllText(Path.Combine("content", "books.xml")); 401var jsonLarge = File.ReadAllText(Path.Combine("content", "example.json"));
Stress.AppHost (16)
CommandResources.cs (14)
523var processCommandScriptsDirectory = Path.Combine(builder.AppHostDirectory, "process-command-scripts"); 524var processCommandStdinScriptPath = Path.Combine(processCommandScriptsDirectory, "stdin.js"); 525var processCommandEnvironmentScriptPath = Path.Combine(processCommandScriptsDirectory, "environment.js"); 526var processCommandWorkingDirectoryScriptPath = Path.Combine(processCommandScriptsDirectory, "working-directory.js"); 527var processCommandStderrFailureScriptPath = Path.Combine(processCommandScriptsDirectory, "stderr-failure.js"); 528var processCommandOutputLimitScriptPath = Path.Combine(processCommandScriptsDirectory, "output-limit.js"); 529var processCommandBackupRestoreScriptPath = Path.Combine(processCommandScriptsDirectory, "backup-restore.js"); 530var processCommandContainerExecScriptPath = Path.Combine(processCommandScriptsDirectory, "container-exec.js"); 531var processCommandSampleBackupPath = Path.Combine(processCommandScriptsDirectory, "sample-backup.dump"); 532var processCommandFileAppsDirectory = Path.GetFullPath(Path.Combine(builder.AppHostDirectory, "..", "process-command-file-apps")); 533var processCommandCSharpArgumentsAndStdinAppPath = Path.Combine(processCommandFileAppsDirectory, "arguments-and-stdin.cs"); 534var processCommandCSharpWorkingDirectoryFailureAppPath = Path.Combine(processCommandFileAppsDirectory, "working-directory-failure.cs"); 535var processCommandIssueToolAppPath = Path.Combine(processCommandFileAppsDirectory, "issue-tool.cs");
src\Shared\StringComparers.cs (2)
41public static StringComparer FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparer.OrdinalIgnoreCase : StringComparer.Ordinal; 92public static StringComparison FileSystemPath => Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
SuperFileCheck (6)
Program.cs (6)
47var superFileCheckDir = Path.GetDirectoryName(superFileCheckPath); 51Directory.EnumerateFiles(Path.Combine(superFileCheckDir, "runtimes/"), "FileCheck*", SearchOption.AllDirectories) 59FileCheckPath = Path.Combine(superFileCheckDir, "FileCheck"); 681var checkFileNameNoExt = Path.GetFileNameWithoutExtension(checkFilePath); 719var tmpDirName = Path.GetDirectoryName(checkFilePath); 727tmpFilePath = Path.Combine(tmpDirName, tmpFileName);
System.CodeDom (5)
src\runtime\src\libraries\Common\src\System\IO\TempFileCollection.cs (4)
132_basePath = Path.Combine( 134Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); 221Directory.Delete(Path.GetDirectoryName(BasePath));
System\CodeDom\Compiler\CodeValidator.cs (1)
17private static readonly SearchValues<char> s_invalidPathChars = SearchValues.Create(Path.GetInvalidPathChars());
System.CommandLine (7)
ArgumentValidation.cs (3)
81var invalidFileNameChars = Path.GetInvalidFileNameChars(); 106var invalidPathChars = Path.GetInvalidPathChars(); 190if (!Path.Exists(token.Value))
Binding\ArgumentConverter.StringConverters.cs (2)
125else if (path.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal) || 126path.EndsWith(Path.AltDirectorySeparatorChar.ToString(), StringComparison.Ordinal))
ExecutableNameHelper.cs (1)
18ReadOnlySpan<char> fileName = Path.GetFileName(path.AsSpan());
Parsing\StringExtensions.cs (1)
287var potentialRootCommand = Path.GetFileName(args[0]);
System.CommandLine.StaticCompletions (1)
ShellName.cs (1)
34var shellName = Path.GetFileName(shellPath);
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\FileExtensionsAttribute.cs (1)
61return ExtensionsParsed.Contains(Path.GetExtension(fileName).ToLowerInvariant());
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\Hosting\ApplicationCatalog.cs (1)
90var path = Path.Combine(location, probingPath);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (2)
17using IOPath = System.IO.Path; 741var fullPath = IOPath.GetFullPath(path);
System.ComponentModel.TypeConverter (3)
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
98string fileName = Path.GetFileName(location);
System\ComponentModel\LicFileLicenseProvider.cs (1)
81string? moduleDir = Path.GetDirectoryName(modulePath);
System\ComponentModel\SyntaxCheck.cs (1)
61return Path.IsPathRooted(value);
System.Configuration.ConfigurationManager (41)
src\runtime\src\libraries\Common\src\System\IO\TempFileCollection.cs (4)
132_basePath = Path.Combine( 134Path.GetFileNameWithoutExtension(Path.GetRandomFileName())); 221Directory.Delete(Path.GetDirectoryName(BasePath));
System\Configuration\AppSettingsSection.cs (2)
102: Path.Combine(Path.GetDirectoryName(configFile), File);
System\Configuration\BaseConfigurationRecord.cs (1)
3201if (string.IsNullOrEmpty(configSource) || Path.IsPathRooted(configSource))
System\Configuration\ClientConfigPaths.cs (11)
46ApplicationUri = Path.GetFullPath(exePath); 67ApplicationUri = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, exeAssembly.ManifestModule.Name); 100if (!Path.IsPathRooted(externalConfigPath)) 102externalConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, externalConfigPath); 105ApplicationConfigUri = Path.GetFullPath(externalConfigPath); 116Path.ChangeExtension(ApplicationUri, ".dll") : ApplicationUri + ".dll"; 156if (Path.IsPathRooted(roamingFolderPath)) 163if (Path.IsPathRooted(localFolderPath)) 226return Path.Combine(path1, path2); 263else if (Uri.TryCreate(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, assembly.ManifestModule.Name), UriKind.Absolute, out Uri codeBase)) 379foreach (char c in Path.GetInvalidFileNameChars()) validated = validated.Replace(c, '_');
System\Configuration\ClientConfigurationHost.cs (6)
49s_machineConfigFilePath = Path.Combine(Path.Combine(directory, MachineConfigSubdirectory), 154_fileMap.MachineConfigFilename = Path.GetFullPath(fileMap.MachineConfigFilename); 160_fileMap.ExeConfigFilename = Path.GetFullPath(exeFileMap.ExeConfigFilename); 163_fileMap.RoamingUserConfigFilename = Path.GetFullPath(exeFileMap.RoamingUserConfigFilename); 166_fileMap.LocalUserConfigFilename = Path.GetFullPath(exeFileMap.LocalUserConfigFilename);
System\Configuration\Configuration.cs (1)
213filename = string.IsNullOrEmpty(filename) ? null : Path.GetFullPath(filename);
System\Configuration\Internal\InternalConfigHost.cs (6)
194if (!Path.IsPathRooted(streamName)) throw ExceptionUtil.ParameterInvalid(nameof(streamName)); 197streamName = Path.GetFullPath(streamName); 201string result = Path.Combine(dirStream, configSource); 202result = Path.GetFullPath(result); 241string dir = Path.GetDirectoryName(streamName); 298return Path.IsPathRooted(streamName);
System\Configuration\LocalFileSettingsProvider.cs (1)
327file = Path.Combine(previousDirectory.FullName, ConfigurationManagerInternalFactory.Instance.UserConfigFilename);
System\Configuration\NameValueFileSectionHandler.cs (2)
40string directory = Path.GetDirectoryName(configFile); 41string sourceFileFullPath = Path.Combine(directory, filename);
System\Configuration\UrlPath.cs (2)
15return Path.GetDirectoryName(path) ?? Path.GetPathRoot(path);
System\Diagnostics\TraceUtils.cs (5)
74if ((initializeData[0] != Path.DirectorySeparatorChar) && (initializeData[0] != Path.AltDirectorySeparatorChar) && !Path.IsPathRooted(initializeData)) 80string dirPath = Path.GetDirectoryName(filePath); 83initializeData = Path.Combine(dirPath, initializeData);
System.Console (4)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
System.Data.Common (3)
System\Data\xmlsaver.cs (3)
1094_filePath = Path.GetDirectoryName(fs.Name); 1095_fileName = Path.GetFileNameWithoutExtension(fs.Name); 1096_fileExt = Path.GetExtension(fs.Name);
System.Data.Odbc (1)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
651return Path.GetFullPath(filename);
System.Data.OleDb (1)
System\Data\Common\AdapterUtil.cs (1)
1020return Path.GetFullPath(filename);
System.Diagnostics.EventLog (6)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (1)
230dllDir = Path.Combine(installRoot, version);
System\Diagnostics\EventLog.cs (5)
699string dllPath = Path.Combine(NetFrameworkUtils.GetLatestBuildDllDirectory(machineName), DllName); 707dllPath = Path.Combine(Path.GetDirectoryName(assmLocation)!, AltDllName); 711dllPath = Path.Combine(AppContext.BaseDirectory, AltDllName); 806return Path.GetFullPath(path);
System.Diagnostics.FileVersionInfo (2)
System\Diagnostics\FileVersionInfo.cs (2)
301if (!Path.IsPathFullyQualified(fileName)) 303fileName = Path.GetFullPath(fileName);
System.Diagnostics.PerformanceCounter (4)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (1)
230dllDir = Path.Combine(installRoot, version);
System\Diagnostics\PerformanceCounterLib.cs (3)
233s_iniFilePath = Path.GetTempFileName(); 274s_symbolFilePath = Path.GetTempFileName(); 428iniWriter.WriteLine(Path.GetFileName(SymbolFilePath));
System.Diagnostics.Process (16)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (1)
151currentCGroupMemoryPath = Path.GetDirectoryName(currentCGroupMemoryPath);
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
66module = new ProcessModule(parsedLine.Path, Path.GetFileName(parsedLine.Path))
System\Diagnostics\Process.SunOS.cs (1)
43return Path.GetFileName(argv[0]);
System\Diagnostics\ProcessManager.BSD.cs (1)
49new ProcessModule(exePath, Path.GetFileName(exePath))
System\Diagnostics\ProcessManager.Linux.cs (1)
47string dirName = Path.GetFileName(taskDir);
System\Diagnostics\ProcessManager.NonApple.cs (1)
58string dirName = Path.GetFileName(procDir);
System\Diagnostics\ProcessManager.SunOS.cs (2)
37new ProcessModule(fullName, Path.GetFileName(fullName)) 76string dirName = Path.GetFileName(lwpDir);
System\Diagnostics\ProcessUtils.Unix.cs (8)
39if (!directory.EndsWith(Path.DirectorySeparatorChar)) 41pathBuilder.Append(Path.DirectorySeparatorChar); 73int segmentLength = pathEnvVarSpan[segmentStart..].IndexOf(Path.PathSeparator); 217if (Path.IsPathRooted(filename)) 237workingDirectory = workingDirectory != null ? Path.GetFullPath(workingDirectory) : 239string filenameInWorkingDirectory = Path.Combine(workingDirectory, filename); 363if (Path.IsPathRooted(filename)) 377ReadOnlySpan<char> executableDirectory = Path.GetDirectoryName(path.AsSpan());
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.Formats.Tar (86)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\Formats\Tar\TarEntry.cs (37)
331TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, extractState.PendingModes); 344TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, extractState.PendingModes); 363TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, extractState.PendingModes); 377TarHelpers.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, extractState.PendingModes); 387Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 392Path.IsPathFullyQualified(name) ? name : Path.Join(destinationDirectoryPath, name)); 407if (OperatingSystem.IsWindows() && Path.IsPathRooted(linkName) && !Path.IsPathFullyQualified(linkName)) 432Path.Join(destinationDirectoryPath, linkName)); 454if (deferred || Path.IsPathFullyQualified(linkTarget)) 456string resolvedPath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(linkFullPath)!, linkTarget)); 468foreach (Range range in path.SplitAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 506Debug.Assert(destinationDirectoryPath[^1] == Path.DirectorySeparatorChar); 514ReadOnlySpan<char> resolvedRoot = resolvedDest.AsSpan().TrimEnd(Path.DirectorySeparatorChar); 518foreach (Range range in relative.SplitAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 526current = Path.Join(current, component); 531(current.Length > resolvedRoot.Length && current[resolvedRoot.Length] != Path.DirectorySeparatorChar)) 564string fullPath = Path.GetFullPath(path); 565string? root = Path.GetPathRoot(fullPath); 574foreach (Range range in relative.SplitAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 582current = Path.Join(current, component); 583if (!IsExistingNonLink(current) && Path.Exists(current)) 595Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 596Debug.Assert(destinationDirectoryFullPath[^1] == Path.DirectorySeparatorChar, "caller must ensure the path ends with a separator."); 598string fullPath = Path.GetFullPath(qualifiedPath); // Removes relative segments 649Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 712string? directoryPath = Path.GetDirectoryName(filePath); 714if (!string.IsNullOrEmpty(directoryPath) && !Path.Exists(directoryPath)) 719if (!Path.Exists(filePath)) 761Debug.Assert(!Path.Exists(destinationFileName)); 787Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarFile.cs (14)
80sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 148sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 194sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 195destinationFileName = Path.GetFullPath(destinationFileName); 257sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 258destinationFileName = Path.GetFullPath(destinationFileName); 317destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 380destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 428sourceFileName = Path.GetFullPath(sourceFileName); 429destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 492sourceFileName = Path.GetFullPath(sourceFileName); 493destinationDirectoryName = Path.GetFullPath(destinationDirectoryName); 717Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 726Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath));
System\Formats\Tar\TarHeader.Write.cs (5)
1143ReadOnlySpan<char> dirName = Path.GetDirectoryName(_name.AsSpan()); 1146ReadOnlySpan<char> fileName = Path.GetFileName(_name.AsSpan()); 1150$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}{Path.DirectorySeparatorChar}" : 1165ReadOnlySpan<char> tmp = Path.TrimEndingDirectorySeparator(Path.GetTempPath());
System\Formats\Tar\TarHelpers.cs (20)
542=> c == Path.DirectorySeparatorChar; 562Debug.Assert(destinationDirectoryFullPath[^1] == Path.DirectorySeparatorChar); 574string root = Path.GetPathRoot(destinationDirectoryFullPath)!; 580if (!resolvedDestinationDirectoryFullPath.EndsWith(Path.DirectorySeparatorChar)) 582resolvedDestinationDirectoryFullPath += Path.DirectorySeparatorChar; 614Debug.Assert(fullPath[^1] == Path.DirectorySeparatorChar); 617|| string.Equals(nestedFullPath, fullPath.TrimEnd(Path.DirectorySeparatorChar), PathInternal.StringComparison); 636Debug.Assert(destination[^1] == Path.DirectorySeparatorChar); 670ReadOnlySpan<char> directoryPath = Path.GetDirectoryName(relativeLinkPath); 681if (Path.IsPathFullyQualified(linkTarget)) 684resolvedPath = Path.GetPathRoot(linkTarget)!; 710foreach (Range range in relativePath.SplitAny(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)) 728resolvedFullPathSpan = Path.GetDirectoryName(resolvedFullPathSpan); 738string componentPath = Path.Join(resolvedFullPath, component); 794if (Path.IsPathFullyQualified(linkTarget)) 818if (Path.IsPathFullyQualified(linkTarget)) 820resolveFrom = Path.GetPathRoot(linkTarget)!; 837if (!rootPath.EndsWith(Path.DirectorySeparatorChar)) 839rootPath += Path.DirectorySeparatorChar;
System\Formats\Tar\TarHelpers.Unix.cs (3)
41string filename = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
System\Formats\Tar\TarWriter.cs (2)
393string fullPath = Path.GetFullPath(fileName); 394string? actualEntryName = string.IsNullOrEmpty(entryName) ? Path.GetFileName(fileName) : entryName;
System.IO.Compression (2)
System\IO\Compression\ZipArchiveEntry.cs (2)
185_externalFileAttr = entryName.EndsWith(Path.DirectorySeparatorChar) || entryName.EndsWith(Path.AltDirectorySeparatorChar)
System.IO.Compression.ZipFile (14)
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.Windows.cs (1)
20if (preserveDriveRoot && entryPath.Length >= 3 && entryPath[1] == ':' && Path.IsPathFullyQualified(entryPath))
System\IO\Compression\ZipFile.Create.cs (3)
530sourceDirectoryName = Path.GetFullPath(sourceDirectoryName); 531destinationArchiveFileName = Path.GetFullPath(destinationArchiveFileName); 550return Path.GetFullPath(sourceDirectoryName);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs (2)
108tempPath = Path.GetTempFileName(); 154Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System\IO\Compression\ZipFileExtensions.ZipArchiveEntry.Extract.cs (8)
101tempPath = Path.GetTempFileName(); 191string fullDestination = Path.GetFullPath(di.FullName); 194fileDestinationPath = Path.GetFullPath(Path.Combine(fullDestination, sanitizedEntryPath)); 200string destinationPrefix = fullDestination.EndsWith(Path.DirectorySeparatorChar) 202: fullDestination + Path.DirectorySeparatorChar; 210if (Path.GetFileName(fileDestinationPath).Length == 0) 231Directory.CreateDirectory(Path.GetDirectoryName(fileDestinationPath)!);
System.IO.FileSystem.AccessControl (7)
src\runtime\src\libraries\Common\src\System\IO\FileSystem.DirectoryCreation.Windows.cs (1)
120string? root = Path.GetPathRoot(fullPath);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
System\IO\FileSystemAclExtensions.cs (3)
31string fullPath = Path.GetFullPath(directoryInfo.FullName); 54string fullPath = Path.GetFullPath(fileInfo.FullName); 314if (errorCode == Interop.Errors.ERROR_PATH_NOT_FOUND && fullPath.Length == Path.GetPathRoot(fullPath)!.Length)
System\Security\AccessControl\FileSystemSecurity.cs (1)
21: base(isContainer, s_ResourceType, PathInternal.EnsureExtendedPrefixIfNeeded(Path.GetFullPath(name)), includeSections, _HandleErrorCode, isDirectory)
System.IO.FileSystem.DriveInfo (2)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
System.IO.FileSystem.Watcher (9)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
System\IO\FileSystemWatcher.cs (1)
376ReadOnlySpan<char> name = IO.Path.GetFileName(relativePath);
System\IO\FileSystemWatcher.Linux.cs (3)
304string name = System.IO.Path.GetFileName(directoryPath); 1032BasePath = System.IO.Path.TrimEndingDirectorySeparator(System.IO.Path.GetFullPath(fsw.Path));
System.IO.IsolatedStorage (18)
System\IO\IsolatedStorage\Helper.cs (2)
71if (Path.GetFileName(directory)?.Length == 12) 75if (Path.GetFileName(subdirectory)?.Length == 12)
System\IO\IsolatedStorage\Helper.NonMobile.cs (4)
26dataDirectory = Path.Combine(dataDirectory, IsolatedStorageDirectoryName); 49randomDirectory = Path.Combine(rootDirectory, Path.GetRandomFileName(), Path.GetRandomFileName());
System\IO\IsolatedStorage\IsolatedStorage.cs (1)
115get { return Path.DirectorySeparatorChar; }
System\IO\IsolatedStorage\IsolatedStorageFile.cs (8)
177return Directory.EnumerateFiles(RootDirectory, searchPattern).Select(f => Path.GetFileName(f)).ToArray(); 201return Directory.EnumerateDirectories(RootDirectory, searchPattern).Select(m => m.Substring(Path.GetDirectoryName(m)!.Length + 1)).ToArray(); 548if (partialPath[i] != Path.DirectorySeparatorChar && partialPath[i] != Path.AltDirectorySeparatorChar) 556return Path.Combine(RootDirectory, partialPath); 627parentDirectory = Path.GetDirectoryName(parentDirectory); 716private static bool IsIdFile(string file) => string.Equals(Path.GetFileName(file), "identity.dat"); 718private static bool IsInfoFile(string file) => string.Equals(Path.GetFileName(file), "info.dat");
System\IO\IsolatedStorage\IsolatedStorageFile.NonMobile.cs (3)
64string directoryName = Path.GetFileName(directory); 74return Path.GetDirectoryName(RootDirectory.TrimEnd(Path.DirectorySeparatorChar));
System.IO.MemoryMappedFiles (4)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (2)
310string path = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
System.IO.Packaging (6)
System\IO\Packaging\PackUriHelper.cs (6)
207string file = Path.GetFileName(partName); 215partName = Path.Combine(partName, RelationshipPartSegmentName, file); // Adding the "_rels" segment and the last segment back 263string partNameWithoutExtension = Path.GetFileNameWithoutExtension(path); 275path = Path.Combine(path, partNameWithoutExtension); // Adding the last segment without ".rels" extension 680string partUriExtension = Path.GetExtension(_partUriString); 787Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension);
System.IO.Pipes (8)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
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 (4)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
System\IO\Ports\SerialPort.Unix.cs (2)
149if (GetOpenBSDSerialDevice(Path.GetFileName(path.AsSpan()), comDriver) is string device && IsAttached(device, bootDevices)) 186if (GetNetBSDSerialDevice(Path.GetFileName(path.AsSpan())) is string device && IsAttached(device, bootDevices))
System.Management (1)
System\Management\ManagementScope.cs (1)
307string wminet_utilsPath = Path.Combine(
System.Net.Mail (8)
System\Net\Mail\Attachment.cs (3)
309Name = Path.GetFileName(fileName); 316Name = Path.GetFileName(fileName); 325Name = Path.GetFileName(fileName);
System\Net\Mail\SmtpClient.cs (2)
432if (!Path.IsPathRooted(pickupDirectory)) 439pathAndFilename = Path.Combine(pickupDirectory, filename);
System\Net\Mime\MediaTypeMap.cs (3)
771/// The method extracts the extension from <paramref name="pathOrExtension"/> using the same logic as <see cref="Path.GetExtension(string)"/>. 793/// The method extracts the extension from <paramref name="pathOrExtension"/> using the same logic as <see cref="Path.GetExtension(ReadOnlySpan{char})"/>. 800scoped ReadOnlySpan<char> extension = Path.GetExtension(pathOrExtension);
System.Net.NetworkInformation (3)
System\Net\NetworkInformation\LinuxIPGlobalStatistics.cs (1)
36string forwardingConfigFile = Path.Combine(NetworkFiles.Ipv6ConfigFolder,
System\Net\NetworkInformation\LinuxIPInterfaceStatistics.cs (1)
26string transmitQueueLengthFilePath = Path.Combine(NetworkFiles.SysClassNetFolder, name, NetworkFiles.TransmitQueueLengthFileName);
System\Net\NetworkInformation\LinuxIPv4InterfaceProperties.cs (1)
41Path.Join(NetworkFiles.Ipv4ConfigFolder, _linuxNetworkInterface.Name, NetworkFiles.ForwardingFileName),
System.Net.Ping (2)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (2)
30string pathv4v6 = Path.Combine(folder, s_ipv4v6PingFile); 31string path = Path.Combine(folder, fileName);
System.Net.Quic (2)
System\Net\Quic\Internal\MsQuicApi.cs (2)
100? System.IO.Path.GetDirectoryName(assemblyLocation)! 103path = System.IO.Path.Combine(path, Interop.Libraries.MsQuic);
System.Net.Sockets (2)
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (1)
277string? dirname = Path.GetDirectoryName(fnfe.FileName);
System\Net\Sockets\UnixDomainSocketEndPoint.cs (1)
153return new UnixDomainSocketEndPoint(_path, Path.GetFullPath(_path));
System.Private.CoreLib (155)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
125string? parentPath = Path.GetDirectoryName(Path.TrimEndingDirectorySeparator(path));
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
242Path.Join(Path.GetDirectoryName(path.AsSpan()), pathToTarget.AsSpan()) : pathToTarget;
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
81return !Path.IsPathRooted(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (2)
27string? directory = Path.GetDirectoryName(path); 32if (!Path.EndsInDirectorySeparator(directory))
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
122string fullPath = Path.GetFullPath(assemblyFile);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (6)
130data = Path.Combine(home, ".local", "share"); 142return Path.Combine(home, ".fonts"); 160config = Path.Combine(home, ".config"); 184string userDirsPath = Path.Combine(GetXdgConfig(homeDir), "user-dirs.dirs"); 236Path.Join(homeDir, line.AsSpan(pos, endPos - pos)) : 248return Path.Combine(homeDir, fallback);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (18)
20string fullPath = Path.GetFullPath(path); 22string? s = Path.GetDirectoryName(fullPath); 32string fullPath = Path.GetFullPath(path); 89string fullPath = Path.GetFullPath(path); 102string fullPath = Path.GetFullPath(path); 108string fullPath = Path.GetFullPath(path); 124string fullPath = Path.GetFullPath(path); 130string fullPath = Path.GetFullPath(path); 146string fullPath = Path.GetFullPath(path); 152string fullPath = Path.GetFullPath(path); 254string fullPath = Path.GetFullPath(path); 255string root = Path.GetPathRoot(fullPath)!; 266Environment.CurrentDirectory = Path.GetFullPath(path); 274FileSystem.MoveDirectory(Path.GetFullPath(sourceDirName), Path.GetFullPath(destDirName)); 279string fullPath = Path.GetFullPath(path); 285string fullPath = Path.GetFullPath(path); 311string fullPath = Path.GetFullPath(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (2)
20string fullPath = Path.GetFullPath(path); 31string tempPath = Path.GetTempPath();
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (13)
20fullPath: Path.GetFullPath(path), 34fullPath = isNormalized ? fullPath : Path.GetFullPath(fullPath); 53Path.GetFileName(Path.TrimEndingDirectorySeparator(fullPath))).ToString(); 67string? parentName = Path.GetDirectoryName(PathInternal.IsRoot(FullPath.AsSpan()) ? FullPath : Path.TrimEndingDirectorySeparator(FullPath)); 80if (Path.IsPathRooted(path)) 83string newPath = Path.GetFullPath(Path.Combine(FullPath, path)); 85ReadOnlySpan<char> trimmedNewPath = Path.TrimEndingDirectorySeparator(newPath.AsSpan()); 89ReadOnlySpan<char> trimmedCurrentPath = FullPath.TrimEnd(Path.DirectorySeparatorChar); 207public DirectoryInfo Root => new DirectoryInfo(Path.GetPathRoot(FullPath)!); 213string destination = Path.GetFullPath(destDirName);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.cs (1)
39if (Path.EndsInDirectorySeparator(OriginalRootDirectory) && PathInternal.StartsWithDirectorySeparator(relativePath))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (2)
88Path.TryJoin(Directory, FileName, _pathBuffer, out int charsWritten); 182Path.Join(originalRootDirectory, relativePath, fileName);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerableFactory.cs (4)
29if (Path.IsPathRooted(expression)) 45ReadOnlySpan<char> directoryName = Path.GetDirectoryName(expression.AsSpan()); 52directory = Path.Join(directory.AsSpan(), directoryName); 77if (Path.DirectorySeparatorChar != '\\')
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.cs (2)
37string path = isNormalized ? directory : Path.GetFullPath(directory); 38_rootDirectory = Path.TrimEndingDirectorySeparator(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEnumerator.Unix.cs (1)
158_pending.Enqueue((Path.Join(_currentPath, entry.FileName), _remainingRecursionDepth - 1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (26)
55FileSystem.CopyFile(Path.GetFullPath(sourceFileName), Path.GetFullPath(destFileName), overwrite); 84FileSystem.DeleteFile(Path.GetFullPath(path)); 100path = Path.GetFullPath(path); 170return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize); 210=> FileSystem.SetCreationTime(Path.GetFullPath(path), creationTime, asDirectory: false); 241=> FileSystem.SetCreationTime(Path.GetFullPath(path), GetUtcDateTimeOffset(creationTimeUtc), asDirectory: false); 273=> FileSystem.GetCreationTime(Path.GetFullPath(path)).LocalDateTime; 298=> FileSystem.GetCreationTime(Path.GetFullPath(path)).UtcDateTime; 323=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), lastAccessTime, false); 354=> FileSystem.SetLastAccessTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastAccessTimeUtc), false); 385=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).LocalDateTime; 410=> FileSystem.GetLastAccessTime(Path.GetFullPath(path)).UtcDateTime; 435=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), lastWriteTime, false); 466=> FileSystem.SetLastWriteTime(Path.GetFullPath(path), GetUtcDateTimeOffset(lastWriteTimeUtc), false); 497=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).LocalDateTime; 522=> FileSystem.GetLastWriteTime(Path.GetFullPath(path)).UtcDateTime; 547=> FileSystem.GetAttributes(Path.GetFullPath(path)); 571=> FileSystem.SetAttributes(Path.GetFullPath(path), fileAttributes); 1057Path.GetFullPath(sourceFileName), 1058Path.GetFullPath(destinationFileName), 1059destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null, 1079string fullSourceFileName = Path.GetFullPath(sourceFileName); 1080string fullDestFileName = Path.GetFullPath(destFileName); 1459string fullPath = Path.GetFullPath(path); 1481string fullPath = Path.GetFullPath(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.Unix.cs (2)
13=> FileSystem.GetUnixFileMode(Path.GetFullPath(path)); 19=> FileSystem.SetUnixFileMode(Path.GetFullPath(path), mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (9)
28FullPath = isNormalized ? fullPath ?? originalPath : Path.GetFullPath(fullPath); 32public override string Name => _name ??= Path.GetFileName(OriginalPath); 46public string? DirectoryName => Path.GetDirectoryName(FullPath); 104string destinationPath = Path.GetFullPath(destFileName); 178string fullDestFileName = Path.GetFullPath(destFileName); 184string? directoryPath = Path.GetDirectoryName(FullName); 195_name = Path.GetFileName(fullDestFileName); 210Path.GetFullPath(destinationFileName), 211destinationBackupFileName != null ? Path.GetFullPath(destinationBackupFileName) : null,
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (2)
191=> GetAttributes(handle, handle.Path, Path.GetFileName(handle.Path), continueOnError); 500Interop.Sys.LStat(Path.TrimEndingDirectorySeparator(path), out _fileCache);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.cs (4)
33ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 34ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 41Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Exists.Unix.cs (1)
47fullPath = Path.TrimEndingDirectorySeparator(fullPath);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (9)
103if (!Directory.Exists(Path.GetDirectoryName(destFullPath))) 248string? directoryName = Path.GetDirectoryName(fullPath); 402ReadOnlySpan<char> srcNoDirectorySeparator = Path.TrimEndingDirectorySeparator(sourceFullPath.AsSpan()); 403ReadOnlySpan<char> destNoDirectorySeparator = Path.TrimEndingDirectorySeparator(destFullPath.AsSpan()); 407if (OperatingSystem.IsBrowser() && Path.EndsInDirectorySeparator(sourceFullPath) && FileExists(sourceFullPath)) 432Path.GetFileName(srcNoDirectorySeparator).SequenceEqual(Path.GetFileName(destNoDirectorySeparator))) // same names. 439&& Path.EndsInDirectorySeparator(sourceFullPath)) 732sb.Length = Path.GetDirectoryNameOffset(sb.AsSpan());
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
57if (PathInternal.IsDirectorySeparator(ch) || ch == Path.VolumeSeparatorChar)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
102string tempPath = Path.GetTempPath();
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (2)
29return Path.Combine(s_userProductDirectory, featureName, subFeatureName); 42s_userProductDirectory = Path.Combine(
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (8)
34if (name.Contains(Path.DirectorySeparatorChar)) 150string sessionDirectoryPath = Path.Combine( 168string sharedMemoryFilePath = Path.Combine(sessionDirectoryPath, id.Name); 345string sessionDirectoryPath = Path.Combine( 412string sharedFilesPath = Path.Combine( 451Path.Combine(ApplicationContainerPath, UserRuntimeTempDirectoryName), 879string runtimeDirectoryPath = Path.Combine( 894Path.Combine(runtimeDirectoryPath, SharedMemoryHelpers.SharedMemorySharedMemoryDirectoryName),
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
42string fullPath = Path.GetFullPath(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Assembly.cs (5)
281string normalizedPath = Path.GetFullPath(path); 324requestorPath = Path.GetFullPath(requestorPath); 345string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath)!, requestedAssemblyName.Name + ".dll"); 379string fullPath = Path.GetFullPath(assemblyFile);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (1)
71string path = Path.Combine(_mediator.ModuleDir, fileName);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
899string? parentDirectory = Path.GetDirectoryName(parentAssembly.Location); 922string assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!, $"{assemblyName.Name}.dll"); 932assemblyPath = Path.Combine(parentDirectory, assemblyName.CultureName!.ToLowerInvariant(), $"{assemblyName.Name}.dll");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\LibraryNameVariation.Unix.cs (1)
36bool containsDelim = libName.Contains(Path.DirectorySeparatorChar);
src\runtime\src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (6)
46startupHookParts.AddRange(diagnosticStartupHooks.Split(Path.PathSeparator)); 51startupHookParts.AddRange(startupHooksVariable.Split(Path.PathSeparator)); 107Path.DirectorySeparatorChar, 108Path.AltDirectorySeparatorChar, 118if (Path.IsPathFullyQualified(startupHookPart)) 163Debug.Assert(Path.IsPathFullyQualified(startupHook.Path));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (3)
455string lockFilesDirectoryPath = Path.Combine( 472Path.Combine(lockFilesDirectoryPath, sessionDirectoryName), 479Path.Combine(lockFilesDirectoryPath, sessionDirectoryName, Id.Name),
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (10)
80if (Path.IsPathRooted(id) || IdContainsAnyDisallowedChars(id)) 88string timeZoneFilePath = Path.Combine(timeZoneDirectory, id); 162var fileName = Path.Combine(GetTimeZoneDirectory(), TimeZoneFileName); 251symlinkPath = Path.GetFullPath(symlinkPath, Path.GetDirectoryName(tzFilePath)!); 314string localtimeFilePath = Path.Combine(timeZoneDirectory, "localtime"); 315string posixrulesFilePath = Path.Combine(timeZoneDirectory, "posixrules"); 436TryLoadTzFile(Path.Combine(GetTimeZoneDirectory(), "localtime"), ref rawData, ref id); 453tzFilePath = Path.Combine(GetTimeZoneDirectory(), tzVariable); 513else if (!tzDirectory.EndsWith(Path.DirectorySeparatorChar))
System\Diagnostics\StackFrame.NativeAot.cs (1)
140ReadOnlySpan<char> fileNameWithoutExtension = Path.GetFileNameWithoutExtension(moduleFullFileName.AsSpan());
System\Runtime\InteropServices\NativeLibrary.NativeAot.cs (2)
78bool libNameIsRelativePath = !Path.IsPathFullyQualified(libraryName); 106ret = LoadLibraryHelper(Path.Combine(AppContext.BaseDirectory, currLibNameVariation), flags, ref errorTracker);
System.Private.Windows.Core.TestUtilities (6)
FileCleanupTestBase.cs (3)
19_testDirectory = Path.Join(Path.GetTempPath(), GetUniqueName()); 46public string GetTestFilePath() => Path.Join(TestDirectory, GetTestFileName());
TempFile.cs (3)
85string file = $"{IO.Path.GetRandomFileName()}_{memberName}_{lineNumber}"; 86return IO.Path.Join(IO.Path.GetTempPath(), file);
System.Private.Xml (7)
System\Xml\Serialization\Compilation.cs (6)
237path = Path.Combine(Path.GetDirectoryName(type.Assembly.Location)!, $"{assemblyName}.dll"); 242path = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!, $"{assemblyName}.dll"); 247path = Path.Combine(Path.GetDirectoryName(AppContext.BaseDirectory)!, $"{assemblyName}.dll");
System\Xml\XmlResolver.cs (1)
48uri = new Uri(Path.GetFullPath(relativeUri!));
System.Reflection.Metadata (3)
System\Reflection\Internal\Utilities\PathUtilities.cs (2)
20(Array.IndexOf(Path.GetInvalidFileNameChars(), '*') >= 0 ? DirectorySeparatorChar : AltDirectorySeparatorChar).ToString(); 48/// <remarks>Unlike <see cref="System.IO.Path.GetFileName(string)"/> this method doesn't check for invalid path characters.</remarks>
System\Reflection\PortableExecutable\PEReader.cs (1)
727peImageDirectory = Path.GetDirectoryName(peImagePath);
System.Reflection.MetadataLoadContext (4)
System\Reflection\PathAssemblyResolver.cs (1)
41string file = Path.GetFileNameWithoutExtension(path);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.Modules.cs (2)
44string? directoryPath = Path.GetDirectoryName(location); 45string modulePath = Path.Combine(directoryPath!, moduleName);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
53int i = s.LastIndexOf(Path.DirectorySeparatorChar);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net12.0\System.Runtime.Forwards.cs (1)
322[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.Caching (2)
System\Runtime\Caching\FileChangeNotificationSystem.cs (2)
102string dir = Path.GetDirectoryName(filePath) ?? string.Empty; 150string dir = Path.GetDirectoryName(filePath) ?? string.Empty;
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
44[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IO.Path))]
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\RuntimeEnvironment.cs (3)
22if (!Path.IsPathRooted(runtimeDirectory)) 27char sep = Path.DirectorySeparatorChar; 28return string.Concat(Path.GetDirectoryName(runtimeDirectory), new ReadOnlySpan<char>(in sep));
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
123string assemblyName = System.IO.Path.GetFileName(assembly.Location);
System.Security.Cryptography (1)
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
425_ = Path.GetFullPath(fileName);
System.Speech (1)
Internal\SrgsCompiler\SRGSCompiler.cs (1)
51srgsPath = Path.GetDirectoryName(uri.IsAbsoluteUri ? uri.AbsolutePath : uri.OriginalString);
System.Windows.Extensions (1)
System\Media\SoundPlayer.cs (1)
364result = new Uri(Path.GetFullPath(partialUri));
System.Windows.Forms (24)
System\Resources\AssemblyNamesTypeResolutionService.cs (1)
16private static readonly string s_dotNetPath = Path.Join(
System\Resources\ResXDataNode.cs (2)
133_fileRefFullPath = !Path.IsPathRooted(fileRefDetails[0]) && basePath is not null 134? Path.Join(basePath, fileRefDetails[0])
System\Resources\ResXFileRef.cs (3)
67if (path1[i] == Path.DirectorySeparatorChar) 87if (path1[i] == Path.DirectorySeparatorChar) 89relPath.Append($"..{Path.DirectorySeparatorChar}");
System\Resources\ResXResourceWriter.cs (2)
311string modifiedBasePath = Path.EndsInDirectorySeparator(BasePath) 313: $"{BasePath}{Path.DirectorySeparatorChar}";
System\Windows\Forms\Application.cs (1)
1338string path = Path.Join(basePath, CompanyName, ProductName, ProductVersion);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (1)
407string themeFilename = Path.GetFileName(VisualStyles.VisualStyleInformation.ThemeFilename);
System\Windows\Forms\Controls\ListView\ListView.cs (1)
5187_backgroundImageFileName = Path.GetTempFileName();
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
162path = Path.GetFullPath(path);
System\Windows\Forms\Controls\ToolStrips\ProfessionalColorTable.cs (1)
1373string themeFileName = Path.GetFileName(VisualStyleInformation.ThemeFilename);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
612string mshtmlPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.System), "mshtml.dll");
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (4)
472names.Add(Path.IsPathFullyQualified(fileName) 474: Path.Join(directory, fileName)); 624if (AddExtension && !Path.HasExtension(fileName)) 630var currentExtension = Path.GetExtension(fileName.AsSpan());
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (2)
370string? parent = Path.GetDirectoryName(selectedPath); 377string folder = Path.GetFileName(selectedPath);
System\Windows\Forms\Dialogs\CommonDialogs\OpenFileDialog.cs (2)
180public string SafeFileName => Path.GetFileName(FileName) ?? string.Empty; 197safePaths[i] = Path.GetFileName(fullPaths[i]);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (1)
902caption = Path.GetFileName(PInvoke.GetModuleFileNameLongPath(HINSTANCE.Null));
System\Windows\Forms\Help\Help.cs (1)
304string ext = Path.GetExtension(file is null ? url : file.LocalPath + file.Fragment).ToLower(CultureInfo.InvariantCulture);
System.Windows.Forms.Design (3)
System\Drawing\BitmapSelector.cs (2)
37=> string.IsNullOrEmpty(Suffix) ? filePath : Path.ChangeExtension(filePath, Suffix + Path.GetExtension(filePath));
System\Windows\Forms\Design\ImageListImageEditor.cs (1)
76image.Name = Path.GetFileName(name);
System.Windows.Forms.Primitives (6)
System\Windows\Forms\Internals\ThemingScope.cs (3)
84string tempFilePath = Path.Join(Path.GetTempPath(), Path.GetRandomFileName());
Windows\Win32\PInvoke.LoadLibrary.cs (3)
17string customPath = Path.Join(startupPath, Libraries.Comctl32); 18Debug.Assert(Path.IsPathFullyQualified(customPath)); 20if (Path.IsPathFullyQualified(customPath))
System.Xaml (1)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (1)
443Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
Terminals.AppHost (1)
TerminalInteractionCommands.cs (1)
535var scriptPath = Path.Combine(AppContext.BaseDirectory, "Scripts", "numberguess.cs");
testhost (5)
parent\testhost.x86\DefaultEngineInvoker.cs (1)
118EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}");
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
testhost.arm64 (5)
parent\testhost.x86\DefaultEngineInvoker.cs (1)
118EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}");
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
testhost.x86 (5)
DefaultEngineInvoker.cs (1)
118EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}");
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
TypeScriptApiCompat (4)
ApiCompatSuppression.cs (2)
110var fileName = Path.GetFileName(file); 120var name = Path.GetFileName(childDirectory);
AtsSurface.cs (1)
67var fileName = Path.GetFileName(filePath);
TypeScriptApiCompatRunner.cs (1)
25var reportDirectory = Path.GetDirectoryName(options.ReportPath);
UIAutomationClient (1)
MS\Internal\Automation\ProxyManager.cs (1)
317return System.IO.Path.GetFileName(sb.ToString().ToLower(CultureInfo.InvariantCulture));
vbc (18)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\';
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (9)
461Debug.Assert(Path.IsPathFullyQualified(clientDir)); 462var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 470commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 575Debug.Assert(Path.IsPathFullyQualified(clientDirectory)); 581if (Path.IsPathFullyQualified(serverInfo.processFilePath) && !File.Exists(serverInfo.processFilePath)) 715clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 819var result = Path.Combine(tempPath, ".roslyn"); 827FilePath = Path.Combine(mutexDirectory, name); 828GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (2)
118Debug.Assert(loggingFilePath is null || Path.IsPathFullyQualified(loggingFilePath)); 182loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
54if (!Path.IsPathFullyQualified(dotNetHostPath)) 77var directoryName = Path.GetDirectoryName(dotNetHostPath);
src\roslyn\src\Compilers\Shared\StandardBuildEnvironment.cs (2)
20public string? GetTempPath() => Path.GetTempPath(); 21public string GetFullyQualifiedPath(string path) => Path.Combine(CurrentDirectory, path);
src\roslyn\src\Compilers\Shared\Vbc.cs (1)
26var responseFile = Path.Combine(buildPaths.ClientDirectory, VisualBasicCompiler.ResponseFileName);
VBCSCompiler (46)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (22)
133=> Path.Combine(_cachePath, dllName, hashKey); 152var cachedAssemblyPath = Path.Combine(entryDir, AssemblyFileName); 205return !File.Exists(Path.Combine(entryDir, cachedFileName)); 215copyAndUpdateTimestamp(Path.Combine(entryDir, cachedFileName), targetPath, outputTimestampUtc); 242var dllCacheDir = Path.Combine(_cachePath, dllName); 253.Select(d => (Path: d, Name: Path.GetFileName(d))) 268var keyPath = Path.Combine(entryPath, dllName + ".key"); 302var dllCacheDir = Path.Combine(_cachePath, dllName); 322stagingDir = Path.Combine(dllCacheDir, hashKey + "." + Guid.NewGuid().ToString("N") + ".tmp"); 325File.Copy(outputFiles.AssemblyPath, Path.Combine(stagingDir, AssemblyFileName), overwrite: false); 327tryCopyOptional(outputFiles.PdbPath, Path.Combine(stagingDir, PdbFileName)); 328tryCopyOptional(outputFiles.RefAssemblyPath, Path.Combine(stagingDir, RefAssemblyFileName)); 329tryCopyOptional(outputFiles.XmlDocPath, Path.Combine(stagingDir, XmlDocFileName)); 331File.WriteAllText(Path.Combine(stagingDir, dllName + ".key"), deterministicKey, Encoding.UTF8); 332File.WriteAllText(Path.Combine(stagingDir, CreatedFileName), DateTimeOffset.UtcNow.ToString("O", CultureInfo.InvariantCulture)); 459var path = Path.Combine(entryDir, LastUsedFileName); 490var dllName = Path.GetFileName(dllDir); 494var dirName = Path.GetFileName(entryDir); 555var lastUsedPath = Path.Combine(entryDir, LastUsedFileName); 583var createdPath = Path.Combine(entryDir, CreatedFileName); 623var dllName = Path.GetFileName(dllDir); 627var dirName = Path.GetFileName(entryDir);
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilerRequestHandler.cs (4)
73Microsoft.CodeAnalysis.AnalyzerAssemblyLoader.CleanLegacyShadowCopyDirectoryIfNeeded(Path.Combine(Path.GetTempPath(), "VBCSCompiler", "AnalyzerAssemblyLoader")); 74AnalyzerAssemblyLoader = Microsoft.CodeAnalysis.AnalyzerAssemblyLoader.CreateNonLockingLoader(Path.Combine(Path.GetTempPath(), "VBCSCompiler", "AnalyzerPathResolver"));
src\roslyn\src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (1)
24: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache, logger)
src\roslyn\src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
79var allModules = GetAllModules(primaryModule, Path.GetDirectoryName(fullPath)!);
src\roslyn\src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (1)
24: this(metadataProvider, Path.Combine(buildPaths.ClientDirectory, ResponseFileName), args, buildPaths, libDirectory, analyzerLoader, driverCache, logger)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
49internal static bool IsRunningOnWindows => Path.DirectorySeparatorChar == '\\';
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (9)
461Debug.Assert(Path.IsPathFullyQualified(clientDir)); 462var processFilePath = Path.Combine(clientDir, $"VBCSCompiler{PlatformInformation.ExeExtension}"); 470commandLineArgs = RuntimeHostInfo.GetDotNetExecCommandLine(Path.ChangeExtension(processFilePath, ".dll"), commandLineArgs); 575Debug.Assert(Path.IsPathFullyQualified(clientDirectory)); 581if (Path.IsPathFullyQualified(serverInfo.processFilePath) && !File.Exists(serverInfo.processFilePath)) 715clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar); 819var result = Path.Combine(tempPath, ".roslyn"); 827FilePath = Path.Combine(mutexDirectory, name); 828GuardPath = Path.Combine(mutexDirectory, ".guard");
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (2)
118Debug.Assert(loggingFilePath is null || Path.IsPathFullyQualified(loggingFilePath)); 182loggingFilePath = Path.Combine(loggingFilePath, $"server.{processId}.log");
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (1)
36return Path.Combine("/tmp", pipeName);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (2)
54if (!Path.IsPathFullyQualified(dotNetHostPath)) 77var directoryName = Path.GetDirectoryName(dotNetHostPath);
src\roslyn\src\Compilers\Shared\StandardBuildEnvironment.cs (2)
20public string? GetTempPath() => Path.GetTempPath(); 21public string GetFullyQualifiedPath(string path) => Path.Combine(CurrentDirectory, path);
vbi (2)
Vbi.vb (2)
18Dim vbiDirectory = Path.GetDirectoryName(GetType(Vbi).GetTypeInfo().Assembly.ManifestModule.FullyQualifiedName) 26responseFile:=Path.Combine(vbiDirectory, InteractiveResponseFileName),
vstest.console (25)
CommandLine\Executor.cs (1)
502if (Path.GetFileName(_processHelper.GetCurrentProcessFileName()) == NonARM64RunnerName &&
CommandLine\InferHelper.cs (2)
177var extension = Path.GetExtension(source); 230var extType = Path.GetExtension(filePath);
Internal\ConsoleLogger.cs (1)
779var sourceName = Path.GetFileName(sd.Key);
Internal\FilePatternParser.cs (6)
53if (!Path.IsPathRooted(filePattern)) 55filePattern = Path.Combine(_fileHelper.GetCurrentDirectory(), filePattern); 87matchingFiles.Add(Path.Combine(splitPattern.Item1, match.Path)); 110pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar), 111pathBeforeWildCard.LastIndexOf(Path.AltDirectorySeparatorChar)); 116directorySeparatorIndex = pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar);
Processors\AeDebuggerArgumentProcessor.cs (1)
145procDumpPath = Path.Combine(procDumpToolDirectoryPath.FullName, ProcDumpExecutableHelper.ProcDumpFileName(_environment.Architecture));
Processors\CollectArgumentProcessor.cs (1)
128string collectorPath = Path.Combine(adapterPath, CoverletConstants.CoverletDataCollectorCodebase);
Processors\EnableDiagArgumentProcessor.cs (3)
150EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}"); 227return Path.GetFullPath(diagFilePathArgument); 238var directory = Path.GetDirectoryName(filePath);
Processors\ResultsDirectoryArgumentProcessor.cs (2)
120if (!Path.IsPathRooted(argument)) 122argument = Path.GetFullPath(argument);
Publisher\TextFileTelemetryPublisher.cs (2)
61?? Path.GetTempPath() + "TelemetryLogs"; 63string path = Path.Combine(resultDirectory, resultFileName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
TestPlatformHelpers\TestRequestManager.cs (2)
1388var extension = Path.GetExtension(settings); 1557if (KnownPlatformSources.Contains(Path.GetFileName(source)))
vstest.console.arm64 (25)
parent\vstest.console\CommandLine\Executor.cs (1)
502if (Path.GetFileName(_processHelper.GetCurrentProcessFileName()) == NonARM64RunnerName &&
parent\vstest.console\CommandLine\InferHelper.cs (2)
177var extension = Path.GetExtension(source); 230var extType = Path.GetExtension(filePath);
parent\vstest.console\Internal\ConsoleLogger.cs (1)
779var sourceName = Path.GetFileName(sd.Key);
parent\vstest.console\Internal\FilePatternParser.cs (6)
53if (!Path.IsPathRooted(filePattern)) 55filePattern = Path.Combine(_fileHelper.GetCurrentDirectory(), filePattern); 87matchingFiles.Add(Path.Combine(splitPattern.Item1, match.Path)); 110pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar), 111pathBeforeWildCard.LastIndexOf(Path.AltDirectorySeparatorChar)); 116directorySeparatorIndex = pathBeforeWildCard.LastIndexOf(Path.DirectorySeparatorChar);
parent\vstest.console\Processors\AeDebuggerArgumentProcessor.cs (1)
145procDumpPath = Path.Combine(procDumpToolDirectoryPath.FullName, ProcDumpExecutableHelper.ProcDumpFileName(_environment.Architecture));
parent\vstest.console\Processors\CollectArgumentProcessor.cs (1)
128string collectorPath = Path.Combine(adapterPath, CoverletConstants.CoverletDataCollectorCodebase);
parent\vstest.console\Processors\EnableDiagArgumentProcessor.cs (3)
150EqtTrace.Verbose($"Runtime location: {Path.GetDirectoryName(objectTypeLocation)}"); 227return Path.GetFullPath(diagFilePathArgument); 238var directory = Path.GetDirectoryName(filePath);
parent\vstest.console\Processors\ResultsDirectoryArgumentProcessor.cs (2)
120if (!Path.IsPathRooted(argument)) 122argument = Path.GetFullPath(argument);
parent\vstest.console\Publisher\TextFileTelemetryPublisher.cs (2)
61?? Path.GetTempPath() + "TelemetryLogs"; 63string path = Path.Combine(resultDirectory, resultFileName);
parent\vstest.console\TestPlatformHelpers\TestRequestManager.cs (2)
1388var extension = Path.GetExtension(settings); 1557if (KnownPlatformSources.Contains(Path.GetFileName(source)))
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (1)
107var path = Path.Combine(p, exeName);
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\ProcDumpExecutableHelper.cs (3)
88var candidatePath = Path.Combine(procdumpDirectory!, filename); 115foreach (string path in pathString.Split(Path.PathSeparator)) 117string exeFullPath = Path.Combine(path.Trim(), executable);
Yarp.AppHost (1)
AppHost.cs (1)
21.WithStaticFiles(Path.Combine("..", "static-content"))