24570 references to Path
AnalyzeCiFailure (92)
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();
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)
AnalyzeCiFailure.TestHost (8)
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);
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")));
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);
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"));
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")))!;
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");
aspire (1210)
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\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\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);
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);
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;
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],
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\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);
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);
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\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)!))
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\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);
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\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\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\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\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\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\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);
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\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);
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);
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);
aspire-managed (30)
aspire-tray (116)
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\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\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\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\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");
Aspire.Azure.AI.Extensions.OpenAI.Tests (2)
Aspire.Azure.AI.Projects.Tests (1)
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)!);
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")));
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");
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");
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")));
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");
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);
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")));
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\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);
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))!;
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));
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");
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"), """
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")));
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");
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");
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");
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();
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"), """
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\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\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");
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\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\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\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");
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");
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"));
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);
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\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\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\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\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\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\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\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\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.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\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\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\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\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\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\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\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\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)!);
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\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"));
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\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\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\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\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\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")))
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"),
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\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\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\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\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\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\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\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\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\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\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);
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\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, "..", "..", "..", "..", ".."));
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");
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\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\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\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\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\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)
Aspire.Dashboard (90)
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")
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);
Aspire.Dashboard.Components.Tests (11)
Aspire.Dashboard.Playwright.Tests (38)
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);
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")))
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);
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");
Aspire.Deployment.EndToEnd.Tests (244)
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));
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");
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)!);
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");
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"),
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"), """
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"), """
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");
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"));
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"), """
Aspire.EndToEnd.Tests (66)
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\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)
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);
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);
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;
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]);
Aspire.Hosting.Analyzers (2)
Aspire.Hosting.Analyzers.Tests (1)
Aspire.Hosting.Azure (23)
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);
Aspire.Hosting.Azure.ApiManagement (2)
Aspire.Hosting.Azure.EntraId (2)
Aspire.Hosting.Azure.EntraId.Tests (37)
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"), $$"""
Aspire.Hosting.Azure.Functions (15)
Aspire.Hosting.Azure.Kubernetes (1)
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"));
Aspire.Hosting.Azure.Kusto (2)
Aspire.Hosting.Azure.Kusto.Tests (3)
Aspire.Hosting.Azure.PostgreSQL (2)
Aspire.Hosting.Azure.Provisioning.Tests (2)
Aspire.Hosting.Azure.Sandboxes (5)
Aspire.Hosting.Azure.Sql (2)
Aspire.Hosting.Azure.Storage (2)
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");
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");
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"), "{}");
Aspire.Hosting.Blazor (36)
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");
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;
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");
Aspire.Hosting.Browsers (44)
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)))
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);
Aspire.Hosting.Browsers.Tests (80)
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")),
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\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);
Aspire.Hosting.CodeGeneration.Go (2)
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"), """
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)!);
Aspire.Hosting.CodeGeneration.Java (4)
Aspire.Hosting.CodeGeneration.Java.Tests (23)
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)!);
Aspire.Hosting.CodeGeneration.Python (3)
Aspire.Hosting.CodeGeneration.Python.Tests (2)
Aspire.Hosting.CodeGeneration.Rust (2)
Aspire.Hosting.CodeGeneration.Rust.Tests (16)
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");
Aspire.Hosting.CodeGeneration.TypeScript (5)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (13)
Aspire.Hosting.Containers.Tests (17)
Aspire.Hosting.DevTunnels (2)
Aspire.Hosting.DevTunnels.Tests (2)
Aspire.Hosting.Docker (20)
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);
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");
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");
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");
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]);
Aspire.Hosting.Dotnet.Tests (380)
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");
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");
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);
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");
Aspire.Hosting.EntityFrameworkCore (13)
Aspire.Hosting.EntityFrameworkCore.Tests (11)
Aspire.Hosting.Foundry.Tests (2)
Aspire.Hosting.Garnet.Tests (1)
Aspire.Hosting.Go (9)
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);
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");
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]);
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"))
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"));
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/>");
Aspire.Hosting.JavaScript (75)
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
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");
Aspire.Hosting.Kafka.Tests (1)
Aspire.Hosting.Keycloak (2)
Aspire.Hosting.Keycloak.Tests (2)
Aspire.Hosting.Kubernetes (26)
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);
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");
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");
Aspire.Hosting.Maui (38)
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.Maui.Tests (68)
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");
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");
Aspire.Hosting.Milvus (2)
Aspire.Hosting.Milvus.Tests (2)
Aspire.Hosting.MongoDB (3)
Aspire.Hosting.MongoDB.Tests (4)
Aspire.Hosting.MySql (3)
Aspire.Hosting.MySql.Tests (4)
Aspire.Hosting.Native.Client (6)
Aspire.Hosting.Native.CodeGeneration (21)
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"), $$"""
Aspire.Hosting.Native.Core (3)
Aspire.Hosting.Native.Core.Tests (68)
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),
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);
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");
Aspire.Hosting.Native.Server (83)
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.Oracle (3)
Aspire.Hosting.Oracle.Tests (2)
Aspire.Hosting.PostgreSQL (3)
Aspire.Hosting.PostgreSQL.Tests (8)
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);
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);
Aspire.Hosting.Qdrant (2)
Aspire.Hosting.Qdrant.Tests (2)
Aspire.Hosting.Radius (18)
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");
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);
Aspire.Hosting.Redis (2)
Aspire.Hosting.Redis.Tests (2)
Aspire.Hosting.RemoteHost (35)
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);
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);
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");
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");
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");
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)
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),
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);
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);
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")))
Aspire.Hosting.Seq.Tests (3)
Aspire.Hosting.SqlServer (3)
Aspire.Hosting.Tasks (36)
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);
Aspire.Hosting.Testing (3)
Aspire.Hosting.Testing.Tests (10)
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");
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");
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");
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");
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");
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");
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"),
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\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\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");
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\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\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))
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");
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));
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));
Aspire.Hosting.TestUtilities (23)
Aspire.Hosting.Valkey.Tests (3)
Aspire.Hosting.Yarp.Tests (3)
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)));
Aspire.Playground.Tests (14)
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);
Aspire.Templates.Tests (89)
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")));
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\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)
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)!;
Aspire.TestTools (7)
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);
Aspire.Tray.Tests (393)
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);
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);
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");
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")));
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);
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");
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));
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"));
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"), "{}");
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"), "");
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)
blazor-devserver (6)
CatalogService (1)
cdac-build-tool (4)
CodeStyleConfigFileGenerator (4)
ConfigurationSchemaGenerator (1)
ConfigurationSchemaGenerator.Tests (2)
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));
crossgen2 (18)
Crossgen2Tasks (52)
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);
csc (18)
CSharpSyntaxGenerator (5)
csi (2)
datacollector (4)
datacollector.arm64 (4)
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)
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\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\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\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);
dotnet-build-cache (12)
dotnet-dev-certs (37)
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}");
dotnet-format (25)
dotnet-getdocument (14)
dotnet-Microsoft.XmlSerializer.Generator (5)
dotnet-openapi (15)
dotnet-razorpagegenerator (4)
dotnet-sourcelink (1)
dotnet-sql-cache (3)
dotnet-suggest (11)
dotnet-svcutil-lib (165)
CommandProcessorOptions.cs (23)
171fileOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(fileUri.LocalPath)));
395workingDirectory = Path.IsPathRooted(this.OutputFile.OriginalPath()) ?
396Path.GetDirectoryName(this.OutputFile.FullName) : Path.GetDirectoryName(Path.Combine(Directory.GetCurrentDirectory(), this.OutputFile.OriginalPath()));
403new DirectoryInfo(Path.Combine(workingDirectory, this.UpdateServiceReferenceFolder)) :
413if (!Path.IsPathRooted(originalDirSpec))
416this.OutputDir = new DirectoryInfo(Path.Combine(workingDirectory, originalDirSpec));
492var updateFileName = Path.GetFileName(this.UpdateServiceReferenceFolder);
497this.UpdateServiceReferenceFolder = Path.GetDirectoryName(this.UpdateServiceReferenceFolder);
506var paramsFiles = jsonFiles.Except(excludeJsonFiles).Where(fn => Path.GetFileName(fn).Equals(CommandProcessorOptions.SvcutilParamsFileName, RuntimeEnvironmentHelper.FileStringComparison) ||
507Path.GetFileName(fn).Equals(CommandProcessorOptions.WCFCSParamsFileName, RuntimeEnvironmentHelper.FileStringComparison));
521var svcRefNames = paramsFiles.Select(pf => { PathHelper.GetRelativePath(Path.GetDirectoryName(pf), new DirectoryInfo(projectDir), out var relPath); return relPath; })
531var svcutilParmasFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.SvcutilParamsFileName);
534var wcfcsParamsFile = Path.Combine(projectDir, this.UpdateServiceReferenceFolder, CommandProcessorOptions.WCFCSParamsFileName);
542var relDir = Path.GetDirectoryName(fileRelPath);
551if (Path.GetFileName(paramsFilePath).Equals(CommandProcessorOptions.WCFCSParamsFileName))
561updateOptions.ResolveFullPathsFrom(new DirectoryInfo(Path.GetDirectoryName(paramsFilePath)));
580var tempDir = Path.GetTempPath();
584this.BootstrapPath = new DirectoryInfo(Path.Combine(tempDir, baseDirName, sessionDirName));
704var projectFullPath = Path.Combine(this.BootstrapPath.FullName, "TFMResolver", "TFMResolver.csproj");
710Directory.Delete(Path.GetDirectoryName(projectFullPath));
853string projFolder = Path.Combine(this.BootstrapPath.FullName, nameof(SvcutilBootstrapper));
Shared\MSBuildProj.cs (31)
67public string FullPath { get { return Path.Combine(DirectoryPath, FileName); } }
161using (var safeLogger = await SafeLogger.WriteStartOperationAsync(logger, $"Parsing project {Path.GetFileName(projectFullPath)}").ConfigureAwait(false))
163projectFullPath = Path.GetFullPath(projectFullPath);
167FileName = Path.GetFileName(projectFullPath),
168DirectoryPath = Path.GetDirectoryName(projectFullPath)
297if (!Path.IsPathRooted(binReference))
316fullPath = new FileInfo(Path.Combine(msbuildProj.DirectoryPath, binReference)).FullName;
338fullPath = Path.Combine(fullPath, binReference);
340else if (Directory.Exists(Path.Combine(msbuildProj.DirectoryPath, fullPath)))
342fullPath = Path.Combine(msbuildProj.DirectoryPath, fullPath, binReference);
385fullPath = Path.GetFullPath(fullPath);
387string projectName = Path.GetFileNameWithoutExtension(fullPath);
388string projectExtension = Path.GetExtension(fullPath);
389string projectDir = Path.GetDirectoryName(fullPath);
427string filePath = Path.Combine(dirPath, DirBuildProps);
558basePath = dependency.FullPath.Substring(0, dependency.FullPath.LastIndexOf(Path.DirectorySeparatorChar));
563new XAttribute("Include", Path.Combine(basePath, $"{framework}\\**")),
802var assetsFile = new FileInfo(Path.Combine(this.DirectoryPath, "obj", "project.assets.json")).FullName;
821if (Path.GetExtension(compiletimeAssembly.Path) == ".dll")
823var dependency = ProjectDependency.FromPackage(Path.GetFileNameWithoutExtension(compiletimeAssembly.Path), lib.Name, lib.Version.ToNormalizedString());
879if (!Path.IsPathRooted(outputPath))
881outputPath = Path.Combine(this.DirectoryPath, outputPath.Trim(new char[] { '\"' }));
885Path.Combine(outputPath, $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json") :
900var targetLib = Path.GetFileName(this._resolvedProperties["TargetPath"].Trim('\"'));
903targetLib = $"{Path.ChangeExtension(this.FileName, ".dll")}";
917if (!Path.GetFileName(assetPath).Equals(targetLib, RuntimeEnvironmentHelper.FileStringComparison))
919dependency = ProjectDependency.FromAssembly(Path.Combine(outputPath, assetPath));
1001var fileName = $"{Path.GetFileNameWithoutExtension(this.FileName)}.deps.json";
1010.Where(d => Path.GetFileName(d).Equals(fileName, RuntimeEnvironmentHelper.FileStringComparison))
1011.Where(f => PathHelper.GetFolderName(Path.GetDirectoryName(f)) == this.TargetFramework || Directory.GetParent(Directory.GetParent(f).FullName).Name == this.TargetFramework)
Shared\ProjectDependency.cs (12)
75if (!string.IsNullOrWhiteSpace(filePath) && Path.GetInvalidPathChars().Intersect(filePath).Count() > 0)
80if (!string.IsNullOrWhiteSpace(packageName) && Path.GetInvalidFileNameChars().Intersect(packageName).Count() > 0)
108if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(AssemblyName), ext, StringComparison.OrdinalIgnoreCase) == 0))
115(s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0));
118if (s_exeExtensions.Any((ext) => String.Compare(Path.GetExtension(packageName), ext, StringComparison.OrdinalIgnoreCase) == 0))
133fileHasKnownExtension = s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0);
137fileHasKnownExtension = s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(filePath), ext, StringComparison.OrdinalIgnoreCase) == 0);
145this.FullPath = fileHasKnownExtension ? Path.GetFullPath(filePath) : filePath;
150fileHasKnownExtension ? Path.GetFileNameWithoutExtension(filePath) : Path.GetFileName(filePath);
310if (s_projectExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0))
315else if (s_binaryExtensions.Any((ext) => String.Compare(Path.GetExtension(path), ext, StringComparison.OrdinalIgnoreCase) == 0))
Shared\Utilities\PathHelper.cs (21)
61if (!isUrl && (Uri.TryCreate(Path.Combine(basePath, input), UriKind.Absolute, out var uri)) && uri.Scheme == "file")
85filePath = Path.Combine(directory.FullName, relPath);
109if (Path.IsPathRooted(childPath))
112var childFileName = Path.GetFileName(childPath);
113var childDirectory = childFileName.Contains("*") ? Path.GetDirectoryName(childPath) : childPath;
114var parentSegments = Path.GetFullPath(parentPath.FullName).Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
115var childSegments = Path.GetFullPath(childDirectory).Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
133builder.Append($"..{Path.AltDirectorySeparatorChar}");
142builder.Append($"{childSegments[idx]}{Path.AltDirectorySeparatorChar}");
151relativePath = builder.ToString().Trim(Path.AltDirectorySeparatorChar);
168return path.Split(new char[] { '/', '\\', Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
178var directory = new DirectoryInfo(Path.Combine(parentDirInfo.FullName, directoryName));
198directory = new DirectoryInfo(Path.Combine(parentDirInfo.FullName, directoryName + nextIndex));
215var dstFilePath = Path.Combine(destinationDir, fileName);
253fullPath = EnumerateItems(workingDir).Where(item => Path.GetFileName(item).Equals(itemName, RuntimeEnvironmentHelper.FileStringComparison)).FirstOrDefault();
259workingDir = Path.GetDirectoryName(workingDir);
dotnet-svcutil-lib.Tests (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");
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");
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)
dotnet-svcutil.xmlserializer.IntegrationTests (1)
dotnet-user-jwts (38)
dotnet-user-secrets (22)
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"));
DotnetTool.AppHost (4)
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);
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)
HelixTestTasks (1)
ilasm (19)
ilc (13)
ILCompiler.Build.Tasks (3)
ILCompiler.Compiler (12)
ILCompiler.Diagnostics (8)
ILCompiler.ReadyToRun (36)
ILCompiler.RyuJit (1)
illink (27)
Linker.Steps\OutputStep.cs (13)
158using (var fs = File.Open(Path.Combine(Context.OutputDirectory, Context.PInvokesListFile), FileMode.Create))
176File.Delete(Path.ChangeExtension(target, "pdb"));
219var satelliteAssembly = Path.Combine(subDirectory, resourceFile);
223string cultureName = subDirectory.Substring(subDirectory.LastIndexOf(Path.DirectorySeparatorChar) + 1);
224string culturePath = Path.Combine(directory, cultureName);
227File.Copy(satelliteAssembly, Path.Combine(culturePath, resourceFile), true);
237string target = Path.GetFullPath(GetConfigFile(GetAssemblyFileName(assembly, directory)));
247return Path.GetFileNameWithoutExtension(assembly) + ".resources.dll";
263string target = Path.GetFullPath(Path.Combine(directory, fi.Name));
277var pdb = Path.ChangeExtension(source, "pdb");
279File.Copy(pdb, Path.ChangeExtension(target, "pdb"), true);
285return Path.Combine(directory, file);
ILLink.Tasks (68)
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 ||
Infrastructure.Common (3)
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");
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")
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");
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");
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\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\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\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");
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\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\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());
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\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\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\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\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\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)
Microsoft.Agents.AI.ProjectTemplates.Tests (21)
test\ProjectTemplates\Infrastructure\WellKnownPaths.cs (6)
33ProjectTemplatesArtifactsRoot = Path.Combine(RepoRoot, "artifacts", "ProjectTemplates");
34TemplateSandboxSource = Path.Combine(RepoRoot, "test", "ProjectTemplates", "Infrastructure", "TemplateSandbox");
35TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxSource, "nuget.config");
37LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping");
46var gitPath = Path.Combine(directory, ".git");
66var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
Microsoft.Analyzers.Extra.Tests (4)
Microsoft.Analyzers.Local (2)
Microsoft.Analyzers.Local.Tests (4)
Microsoft.Arcade.Common (13)
Microsoft.AspNetCore (8)
Microsoft.AspNetCore.Components.Testing (13)
Microsoft.AspNetCore.Components.Testing.Tasks (8)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Components.WebAssembly.Server (11)
Microsoft.AspNetCore.Components.WebView (3)
Microsoft.AspNetCore.Components.WebView.Maui (4)
Microsoft.AspNetCore.Components.WebView.WindowsForms (10)
Microsoft.AspNetCore.Components.WebView.Wpf (10)
Microsoft.AspNetCore.DataProtection (10)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (32)
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)
Microsoft.AspNetCore.Hosting (13)
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Results (2)
Microsoft.AspNetCore.HttpLogging (4)
Microsoft.AspNetCore.Identity.UI (4)
Microsoft.AspNetCore.InternalTesting (16)
Microsoft.AspNetCore.Mvc.Core (3)
Microsoft.AspNetCore.Mvc.Localization (1)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (5)
Microsoft.AspNetCore.Mvc.RazorPages (1)
Microsoft.AspNetCore.Mvc.Testing (5)
Microsoft.AspNetCore.Razor.Utilities.Shared (12)
Microsoft.AspNetCore.Server.IIS (4)
Microsoft.AspNetCore.Server.IntegrationTesting (22)
Microsoft.AspNetCore.Server.Kestrel.Core (49)
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.SpaProxy (6)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (5)
Microsoft.AspNetCore.StaticFiles (2)
Microsoft.AspNetCore.TestHost (2)
Microsoft.AspNetCore.WebUtilities (6)
Microsoft.Build (268)
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);
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\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))
Microsoft.Build.Framework (240)
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");
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)))
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\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_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);
Microsoft.Build.NuGetSdkResolver (6)
Microsoft.Build.TaskAuthoring.Analyzer (2)
Microsoft.Build.Tasks.CodeAnalysis (33)
Microsoft.Build.Tasks.Core (323)
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));
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(
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");
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;
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\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);
Microsoft.Build.Utilities.Core (10)
Microsoft.CodeAnalysis (86)
Microsoft.CodeAnalysis.Analyzers (36)
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
Microsoft.CodeAnalysis.BuildClient.Package (18)
Microsoft.CodeAnalysis.CodeStyle (19)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (3)
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
Microsoft.CodeAnalysis.Extensions.Package (1)
Microsoft.CodeAnalysis.ExternalAccess.HotReload (1)
Microsoft.CodeAnalysis.Features (56)
EditAndContinue\TraceLog.cs (6)
44path = Path.Combine(_logDirectory, _traceLog._name + ".log");
56var directory = Path.Combine(_logDirectory, sessionId.Ordinal.ToString(), relativePath);
74var directory = CreateSessionDirectory(updateId.SessionId, Path.Combine(document.Project.Name, relativeDir));
75return Path.Combine(directory, $"{fileName}.{updateId.Ordinal}.{generation?.ToString() ?? "-"}.{suffix}{extension}");
83path = Path.Combine(CreateSessionDirectory(sessionId, directory), fileName);
97path = Path.Combine(CreateSessionDirectory(sessionId, directory), fileName);
PdbSourceDocument\ImplementationAssemblyLookupService.cs (10)
29private static readonly string PathSeparatorString = Path.DirectorySeparatorChar.ToString();
44var pathParts = referencedDllPath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
58var basePath = Path.GetDirectoryName(dllPath);
81dllPath = Path.Combine(basePath, $"{assemblyName}.dll");
132var pathToTry = Path.Combine(
156var frameworkXml = Path.Combine(referencedDllPath, "..", "..", "..", "data", "FrameworkList.xml");
180var basePath = Path.GetFullPath(Path.Combine(referencedDllPath, "..", "..", "..", "..", "..", ".."));
181var dllPath = Path.Combine(basePath, "shared", sdkName, packVersion, dllFileName);
Microsoft.CodeAnalysis.NetAnalyzers (10)
Microsoft.CodeAnalysis.Razor.Compiler (9)
Microsoft.CodeAnalysis.Razor.DotNetFormat (9)
Microsoft.CodeAnalysis.Rebuild (2)
Microsoft.CodeAnalysis.ResxSourceGenerator (30)
Microsoft.CodeAnalysis.Scripting (29)
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)))
Microsoft.CodeAnalysis.Workspaces (91)
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);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (18)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (10)
Microsoft.Data.Analysis.Tests (7)
Microsoft.Deployment.DotNet.Releases (3)
Microsoft.Diagnostics.DataContractReader.Legacy (1)
Microsoft.Diagnostics.NETCore.Client (9)
Microsoft.DiaSymReader (1)
Microsoft.DotNet.ApiCompat.Task (6)
Microsoft.DotNet.ApiSymbolExtensions (11)
Microsoft.DotNet.Arcade.Sdk (21)
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)
Microsoft.DotNet.Build.Tasks.FileCatalog (1)
Microsoft.DotNet.Build.Tasks.Installers (78)
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);
Microsoft.DotNet.Build.Tasks.Packaging (63)
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)));
Microsoft.DotNet.Build.Tasks.Templating (2)
Microsoft.DotNet.Build.Tasks.VisualStudio (11)
Microsoft.DotNet.Build.Tasks.Workloads (23)
Microsoft.DotNet.Cli.CoreUtils (14)
Microsoft.DotNet.Cli.Definitions (17)
Microsoft.DotNet.Cli.InternalMicrosoft (10)
Microsoft.DotNet.Cli.Utils (55)
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)
Microsoft.DotNet.CodeAnalysis (2)
Microsoft.DotNet.Configurer (11)
Microsoft.DotNet.GenFacades (6)
Microsoft.DotNet.HotReload.Utils.Generator (5)
Microsoft.DotNet.HotReload.Watch (83)
Microsoft.DotNet.HotReload.WebAssembly.Browser (3)
Microsoft.DotNet.ILAssembler (2)
Microsoft.DotNet.InternalAbstractions (12)
Microsoft.DotNet.MacOsPkg.Core (13)
Microsoft.DotNet.NativeWrapper (8)
Microsoft.DotNet.NuGetRepack.Tasks (5)
Microsoft.DotNet.PackageTesting (5)
Microsoft.DotNet.PackageValidation (2)
Microsoft.DotNet.ProjectTools (27)
Microsoft.DotNet.SdkResolver (1)
Microsoft.DotNet.SharedFramework.Sdk (16)
Microsoft.DotNet.SourceBuild.Tasks (12)
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\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\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);
Microsoft.DotNet.VersionTools.Cli (1)
Microsoft.DotNet.XliffTasks (46)
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);
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (6)
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)
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
Microsoft.Extensions.AI.Evaluation.Reporting (26)
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"));
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (7)
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (80)
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);
Microsoft.Extensions.AI.OpenAI (4)
Microsoft.Extensions.AI.OpenAI.Tests (4)
Microsoft.Extensions.AI.Templates.Tests (21)
test\ProjectTemplates\Infrastructure\WellKnownPaths.cs (6)
33ProjectTemplatesArtifactsRoot = Path.Combine(RepoRoot, "artifacts", "ProjectTemplates");
34TemplateSandboxSource = Path.Combine(RepoRoot, "test", "ProjectTemplates", "Infrastructure", "TemplateSandbox");
35TemplateTestNuGetConfigPath = Path.Combine(TemplateSandboxSource, "nuget.config");
37LocalShippingPackagesPath = Path.Combine(RepoRoot, "artifacts", "packages", BuildConfigurationFolder, "Shipping");
46var gitPath = Path.Combine(directory, ".git");
66var dotNetExePath = Path.Combine(RepoRoot, ".dotnet", dotNetExeName);
Microsoft.Extensions.Configuration.FileExtensions (4)
Microsoft.Extensions.Configuration.UserSecrets (4)
Microsoft.Extensions.DataIngestion.MarkItDown (3)
Microsoft.Extensions.DataIngestion.Tests (13)
Microsoft.Extensions.DependencyModel (21)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Microsoft.Extensions.DotNetDeltaApplier (5)
Microsoft.Extensions.FileProviders.Embedded (9)
Microsoft.Extensions.FileProviders.Embedded.Manifest.Task (2)
Microsoft.Extensions.FileProviders.Physical (26)
Microsoft.Extensions.FileSystemGlobbing (30)
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));
Microsoft.Extensions.Hosting (5)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (4)
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Microsoft.Extensions.Http.Resilience.Tests (6)
Microsoft.Extensions.Localization (4)
Microsoft.Extensions.Logging.AzureAppServices (4)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.ML.Tests (4)
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)
Microsoft.Gen.BuildMetadata (2)
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
Microsoft.Gen.ComplianceReports (5)
Microsoft.Gen.ComplianceReports.Unit.Tests (8)
Microsoft.Gen.ContextualOptions (2)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
Microsoft.Gen.Logging (2)
Microsoft.Gen.Logging.Unit.Tests (9)
Microsoft.Gen.MetadataExtractor (7)
Microsoft.Gen.MetadataExtractor.Unit.Tests (13)
Microsoft.Gen.Metrics (2)
Microsoft.Gen.Metrics.Unit.Tests (3)
Microsoft.Gen.MetricsReports (3)
Microsoft.Gen.MetricsReports.Unit.Tests (13)
Microsoft.Maui (1)
Microsoft.Maui.Controls (1)
Microsoft.Maui.Controls.Build.Tasks (6)
Microsoft.Maui.Controls.SourceGen (10)
Microsoft.Maui.Essentials (6)
Microsoft.Maui.Resizetizer (56)
Microsoft.ML.AutoML (5)
Microsoft.ML.AutoML.Samples (5)
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(
Microsoft.ML.CodeAnalyzer.Tests (1)
Microsoft.ML.CodeGenerator (12)
Microsoft.ML.Core (45)
Microsoft.ML.Core.Tests (19)
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=+",
Microsoft.ML.CpuMath.UnitTests (1)
Microsoft.ML.Data (16)
Microsoft.ML.DnnImageFeaturizer.AlexNet (3)
AlexNetExtension.cs (3)
28return AlexNet(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "AlexNetPrepOnnx", "AlexNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Dropout234_Output_0" }, new[] { "Input140" }, Path.Combine(modelDir, "AlexNetOnnx", "AlexNet.onnx"));
Microsoft.ML.DnnImageFeaturizer.ResNet101 (3)
ResNet101Extension.cs (3)
28return ResNet101(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "ResNetPrepOnnx", "ResNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Pooling2286_Output_0" }, new[] { "Input1600" }, Path.Combine(modelDir, "ResNet101Onnx", "ResNet101.onnx"));
Microsoft.ML.DnnImageFeaturizer.ResNet18 (3)
ResNet18Extension.cs (3)
28return ResNet18(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "ResNetPrepOnnx", "ResNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Pooling395_Output_0" }, new[] { "Input247" }, Path.Combine(modelDir, "ResNet18Onnx", "ResNet18.onnx"));
Microsoft.ML.DnnImageFeaturizer.ResNet50 (3)
ResNet50Extension.cs (3)
28return ResNet50(dnnModelContext, env, outputColumnName, inputColumnName, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DnnImageModels"));
46var prepEstimator = new OnnxScoringEstimator(env, new[] { "PreprocessedInput" }, new[] { "OriginalInput" }, Path.Combine(modelDir, "ResNetPrepOnnx", "ResNetPreprocess.onnx"));
47var mainEstimator = new OnnxScoringEstimator(env, new[] { "Pooling1096_Output_0" }, new[] { "Input750" }, Path.Combine(modelDir, "ResNet50Onnx", "ResNet50.onnx"));
Microsoft.ML.Ensemble (2)
Microsoft.ML.EntryPoints (1)
Microsoft.ML.ImageAnalytics (4)
Microsoft.ML.IntegrationTests (5)
Microsoft.ML.Maml (4)
Microsoft.ML.OneDal (1)
Microsoft.ML.OnnxConverter (1)
Microsoft.ML.OnnxTransformer (4)
Microsoft.ML.OnnxTransformerTest (21)
Microsoft.ML.Parquet (6)
Microsoft.ML.PerformanceTests (33)
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)))
Microsoft.ML.ResultProcessor (1)
Microsoft.ML.Samples (72)
Microsoft.ML.Samples.GPU (62)
Microsoft.ML.SamplesUtils (11)
SamplesDatasetUtils.cs (11)
27while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null)
36return Path.Combine(directory, "test", "data", fileName);
179string varPath = Path.Combine(path, "variables");
183Download(Path.Combine(remotePath, "saved_model.pb"), Path.Combine(path, "saved_model.pb")).Wait();
184Download(Path.Combine(remotePath, "imdb_word_index.csv"), Path.Combine(path, "imdb_word_index.csv")).Wait();
185Download(Path.Combine(remotePath, "variables", "variables.data-00000-of-00001"), Path.Combine(varPath, "variables.data-00000-of-00001")).Wait();
186Download(Path.Combine(remotePath, "variables", "variables.index"), Path.Combine(varPath, "variables.index")).Wait();
Microsoft.ML.SearchSpace.Tests (2)
Microsoft.ML.Sweeper (5)
Microsoft.ML.TensorFlow (11)
Microsoft.ML.TensorFlow.Tests (51)
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);
Microsoft.ML.TestFrameworkCommon (22)
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"));
OnnxConversionTest.cs (14)
87var subDir = Path.Combine("Onnx", "Regression", "Adult");
165var subDir = Path.Combine("Onnx", "Cluster", "BreastCancer");
207var subDir = Path.Combine("Onnx", "Regression", "Adult");
442var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
584var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
610var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
635var subDir = Path.Combine("Onnx", "MultiClassClassification", "BreastCancer");
647string modelPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.bin";
648string onnxPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.onnx";
649string onnxJsonPath = Path.GetTempPath() + Guid.NewGuid().ToString() + ".model.onnx.json";
817var subDir = Path.Combine("Onnx", "BinaryClassification", "BreastCancer");
856var subDir = Path.Combine("Onnx", "Transforms", "Sentiment");
1172var subDir = Path.Combine("Onnx", "Transforms");
1901var subDir = Path.Combine("Onnx", "Transforms");
Microsoft.ML.TimeSeries.Tests (4)
Microsoft.ML.Tokenizers.Data.Tests (3)
Microsoft.ML.Tokenizers.Tests (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"));
Microsoft.ML.TorchSharp (12)
Microsoft.ML.TorchSharp.Tests (1)
Microsoft.ML.Transforms (5)
Microsoft.ML.Vision (25)
DnnRetrainTransform.cs (16)
118var tempDirPath = Path.GetFullPath(Path.Combine(((IHostEnvironmentInternal)env).TempFilePath, nameof(DnnRetrainTransformer) + "_" + Guid.NewGuid()));
130string fullFilePath = Path.Combine(tempDirPath, relativeFile);
131string fullFileDir = Path.GetDirectoryName(fullFilePath);
409var path = Path.Combine(modelDir, DefaultModelFileNames.TmpMlnetModel);
416var variablesPath = Path.Combine(modelDir, DefaultModelFileNames.VariablesFolder);
417var archivePath = Path.Combine(variablesPath + "-" + Guid.NewGuid().ToString());
420File.Copy(f, Path.Combine(archivePath, Path.GetFileName(f)));
439var destination = Path.Combine(variablesPath, DefaultModelFileNames.Data);
446var destination = Path.Combine(variablesPath, DefaultModelFileNames.Index);
533_modelLocation = Path.IsPathRooted(modelLocation) ? modelLocation : Path.Combine(Directory.GetCurrentDirectory(), modelLocation);
705Path.Combine(_modelLocation, DefaultModelFileNames.Graph),
706Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Data),
707Path.Combine(_modelLocation, DefaultModelFileNames.VariablesFolder, DefaultModelFileNames.Index),
ImageClassificationTrainer.cs (9)
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)
Microsoft.NET.Build.Extensions.Tasks (10)
Microsoft.NET.Build.Tasks (247)
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))))
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\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\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);
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)));
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");
Microsoft.NET.HostModel (7)
Microsoft.NET.ProjectData (141)
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),
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)
Microsoft.NET.ProjectData.Tasks (127)
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\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.Sdk.BlazorWebAssembly.Tasks (20)
Microsoft.NET.Sdk.Publish.Tasks (56)
Microsoft.NET.Sdk.Razor.Tasks (21)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (77)
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);
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");
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);
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (20)
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());
Microsoft.Private.Windows.Core (1)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\PathExtensions.cs (1)
8extension(Path)
Microsoft.SourceLink.AzureDevOpsServer.Git (7)
Microsoft.SourceLink.AzureRepos.Git (7)
Microsoft.SourceLink.Bitbucket.Git (7)
Microsoft.SourceLink.Common (11)
Microsoft.SourceLink.Gitea (7)
Microsoft.SourceLink.Gitee (7)
Microsoft.SourceLink.GitHub (7)
Microsoft.SourceLink.GitLab (7)
Microsoft.SourceLink.GitWeb (7)
Microsoft.TemplateEngine.Cli (20)
Microsoft.TemplateEngine.Core (9)
Microsoft.TemplateEngine.Edge (30)
Microsoft.TemplateEngine.IDE (2)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (5)
Microsoft.TemplateEngine.Utils (31)
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))
Microsoft.TemplateSearch.Common (2)
Microsoft.TestPlatform.AdapterUtilities (1)
Microsoft.TestPlatform.Build (1)
Microsoft.TestPlatform.CommunicationUtilities (2)
Microsoft.TestPlatform.CoreUtilities (14)
Microsoft.TestPlatform.CrossPlatEngine (48)
Microsoft.TestPlatform.Extensions.BlameDataCollector (23)
Microsoft.TestPlatform.PlatformAbstractions (15)
Microsoft.TestPlatform.TestHostRuntimeProvider (32)
Microsoft.TestPlatform.Utilities (10)
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (1)
Microsoft.VisualBasic.Forms (38)
Microsoft.VisualStudio.TestPlatform.Client (6)
Microsoft.VisualStudio.TestPlatform.Common (26)
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (4)
Microsoft.VisualStudio.TestPlatform.Extensions.TestIds.TestLogger (9)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (43)
Microsoft.VisualStudio.TestPlatform.ObjectModel (10)
Microsoft.Web.XmlTransform (3)
Mono.Cecil (8)
MSBuild (31)
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)
mscorlib (1)
NativeIntegrations.DockerCompose (17)
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;
NativeIntegrations.DockerCompose.AppHost.Sample (2)
netstandard (1)
NuGet.Build.Tasks (34)
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)))));
NuGet.Build.Tasks.Pack (40)
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)
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));
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));
NuGet.Common (108)
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\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);
NuGet.Configuration (52)
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);
NuGet.Credentials (3)
NuGet.PackageManagement (88)
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\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));
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);
NuGet.Packaging (139)
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)
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);
NuGet.ProjectModel (13)
NuGet.Protocol (56)
Pipelines.AppHost (6)
Pipelines.Library (4)
PresentationBuildTasks (71)
PresentationCore (21)
PresentationFramework (20)
PresentationUI (11)
ProjectResourceExtensions.AppHost (2)
ReachFramework (4)
RepoTasks (42)
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)
Roslyn.Diagnostics.Analyzers (26)
rzc (50)
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))
sdk-tasks (99)
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));
SelectTests (27)
Stress.ApiService (2)
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");
SuperFileCheck (6)
System.CodeDom (5)
System.CommandLine (7)
System.CommandLine.StaticCompletions (1)
System.ComponentModel.Annotations (1)
System.ComponentModel.Composition (3)
System.ComponentModel.TypeConverter (3)
System.Configuration.ConfigurationManager (41)
System.Console (4)
System.Data.Common (3)
System.Data.Odbc (1)
System.Data.OleDb (1)
System.Diagnostics.EventLog (6)
System.Diagnostics.FileVersionInfo (2)
System.Diagnostics.PerformanceCounter (4)
System.Diagnostics.Process (16)
System.Diagnostics.TextWriterTraceListener (4)
System.Formats.Tar (86)
System.IO.Compression (2)
System.IO.Compression.ZipFile (14)
System.IO.FileSystem.AccessControl (7)
System.IO.FileSystem.DriveInfo (2)
System.IO.FileSystem.Watcher (9)
System.IO.IsolatedStorage (18)
System.IO.MemoryMappedFiles (4)
System.IO.Packaging (6)
System.IO.Pipes (8)
System.IO.Ports (4)
System.Management (1)
System.Net.Mail (8)
System.Net.NetworkInformation (3)
System.Net.Ping (2)
System.Net.Quic (2)
System.Net.Sockets (2)
System.Private.CoreLib (155)
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);
System.Private.Windows.Core.TestUtilities (6)
System.Private.Xml (7)
System.Reflection.Metadata (3)
System.Reflection.MetadataLoadContext (4)
System.Runtime (1)
System.Runtime.Caching (2)
System.Runtime.Extensions (1)
System.Runtime.InteropServices (3)
System.Runtime.Serialization.Schema (1)
System.Security.Cryptography (1)
System.Speech (1)
System.Windows.Extensions (1)
System.Windows.Forms (24)
System.Windows.Forms.Design (3)
System.Windows.Forms.Primitives (6)
System.Xaml (1)
Terminals.AppHost (1)
testhost (5)
testhost.arm64 (5)
testhost.x86 (5)
TypeScriptApiCompat (4)
UIAutomationClient (1)
vbc (18)
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);
vbi (2)
vstest.console (25)
vstest.console.arm64 (25)
Yarp.AppHost (1)