1342 references to FullName
aspire (187)
Caching\DiskCache.cs (12)
24_cacheDirectory = new DirectoryInfo(Path.Combine(executionContext.CacheDirectory.FullName, "nuget-search"));
33_logger.LogDebug(ex, "Failed to create cache directory {CacheDirectory}", _cacheDirectory.FullName);
94_logger.LogDebug(ex, "Failed to create cache directory {CacheDirectory}", _cacheDirectory.FullName);
106var fullPath = Path.Combine(_cacheDirectory.FullName, fileName);
145_logger.LogDebug(ex, "Failed to delete cache file {CacheFile}", file.FullName);
152_logger.LogDebug(ex, "Failed to clear disk cache at {CacheDirectory}", _cacheDirectory.FullName);
216valid = file.FullName;
273_logger.LogDebug("Deleted expired cache file: {CacheFile}", file.FullName);
277_logger.LogDebug("Deleted old cache file during global cleanup: {CacheFile}", file.FullName);
281_logger.LogDebug("Deleted invalid cache file: {CacheFile}", file.FullName);
285_logger.LogDebug("Deleted cache file: {CacheFile}", file.FullName);
290_logger.LogDebug(ex, "Failed to delete cache file {CacheFile}", file.FullName);
DotNet\DotNetCliRunner.cs (32)
184cliArgsList.Add(projectFile.FullName);
254false => [watchOrRunCommand, nonInteractiveSwitch, verboseSwitch, noBuildSwitch, noProfileSwitch, "--project", projectFile.FullName, "--", .. args],
255true => ["run", noProfileSwitch, "--file", projectFile.FullName, "--", .. args]
519WorkingDirectory = workingDirectory.FullName,
579projectFile.FullName,
756string[] cliArgs = ["build", projectFilePath.FullName];
786cliArgsList.AddRange(["package", "--file", projectFilePath.FullName]);
792cliArgsList.AddRange([projectFilePath.FullName, "package"]);
811logger.LogInformation("Adding package {PackageName} with version {PackageVersion} to project {ProjectFilePath}", packageName, packageVersion, projectFilePath.FullName);
824logger.LogError("Failed to add package {PackageName} with version {PackageVersion} to project {ProjectFilePath}. See debug logs for more details.", packageName, packageVersion, projectFilePath.FullName);
828logger.LogInformation("Package {PackageName} with version {PackageVersion} added to project {ProjectFilePath}", packageName, packageVersion, projectFilePath.FullName);
838string[] cliArgs = ["sln", solutionFile.FullName, "add", projectFile.FullName];
840logger.LogInformation("Adding project {ProjectFilePath} to solution {SolutionFilePath}", projectFile.FullName, solutionFile.FullName);
853logger.LogError("Failed to add project {ProjectFilePath} to solution {SolutionFilePath}. See debug logs for more details.", projectFile.FullName, solutionFile.FullName);
857logger.LogInformation("Project {ProjectFilePath} added to solution {SolutionFilePath}", projectFile.FullName, solutionFile.FullName);
900: Path.Combine(workingDirectory.FullName, configPath);
989cliArgs.Add(nugetConfigFile.FullName);
1107string[] cliArgs = ["sln", solutionFile.FullName, "list"];
1161: Path.Combine(solutionFile.Directory!.FullName, line);
1173string[] cliArgs = ["add", projectFile.FullName, "reference", referencedProject.FullName];
1175logger.LogInformation("Adding project reference from {ProjectFile} to {ReferencedProject}", projectFile.FullName, referencedProject.FullName);
1188logger.LogError("Failed to add project reference from {ProjectFile} to {ReferencedProject}. See debug logs for more details.", projectFile.FullName, referencedProject.FullName);
1192logger.LogInformation("Project reference added from {ProjectFile} to {ReferencedProject}", projectFile.FullName, referencedProject.FullName);
1207var sdksDirectory = executionContext.SdksDirectory.FullName;
Projects\ProjectLocator.cs (63)
42logger.LogDebug("Searching for project files in {SearchDirectory}", searchDirectory.FullName);
53logger.LogDebug("Found {ProjectFileCount} project files in {SearchDirectory}", projectFiles.Length, searchDirectory.FullName);
63logger.LogDebug("Checking project file {ProjectFile}", projectFile.FullName);
68logger.LogDebug("Found AppHost project file {ProjectFile} in {SearchDirectory}", projectFile.FullName, searchDirectory.FullName);
69var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName);
78var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName);
84logger.LogTrace("Project file {ProjectFile} in {SearchDirectory} is not an Aspire host", projectFile.FullName, searchDirectory.FullName);
89logger.LogDebug("Searching for single-file apphosts in {SearchDirectory}", searchDirectory.FullName);
91logger.LogDebug("Found {CandidateFileCount} single-file apphost candidates in {SearchDirectory}", candidateAppHostFiles.Length, searchDirectory.FullName);
95logger.LogDebug("Checking single-file apphost candidate {CandidateFile}", candidateFile.FullName);
99logger.LogDebug("Found single-file apphost candidate {CandidateFile} in {SearchDirectory}", candidateFile.FullName, searchDirectory.FullName);
100var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
109logger.LogTrace("Single-file candidate {CandidateFile} in {SearchDirectory} is not a valid apphost", candidateFile.FullName, searchDirectory.FullName);
115appHostProjects.Sort((x, y) => x.FullName.CompareTo(y.FullName));
172var settingsFile = new FileInfo(ConfigurationHelper.BuildPathToSettingsJsonFile(searchDirectory.FullName));
182var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath);
192interactionService.DisplayMessage("warning", string.Format(CultureInfo.CurrentCulture, ErrorStrings.AppHostWasSpecifiedButDoesntExist, settingsFile.FullName, qualifiedAppHostPath));
216if (Directory.Exists(projectFile.FullName))
218logger.LogDebug("Provided path {Path} is a directory, searching for project files recursively", projectFile.FullName);
219var directory = new DirectoryInfo(projectFile.FullName);
234logger.LogDebug("Found {ProjectFileCount} project files in {Directory}", allProjectFiles.Length, directory.FullName);
248logger.LogDebug("Checking project file {ProjectFile}", candidateProject.FullName);
253logger.LogDebug("Found AppHost project file {ProjectFile}", candidateProject.FullName);
254var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateProject.FullName);
271logger.LogDebug("Checking single-file apphost candidate {CandidateFile}", candidateFile.FullName);
275logger.LogDebug("Found valid single-file apphost {AppHostFile}", candidateFile.FullName);
276var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
287foundProjects.Sort((x, y) => x.FullName.CompareTo(y.FullName));
296logger.LogError("No AppHost project files found in directory {Directory}", directory.FullName);
301logger.LogDebug("Found single AppHost project file {ProjectFile} in directory {Directory}", appHostProjects[0].FullName, directory.FullName);
308logger.LogDebug("Multiple AppHost project files found in directory {Directory}, prompting user to select", directory.FullName);
312file => $"{file.Name} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName)})",
318logger.LogDebug("Multiple AppHost project files found in directory {Directory}, selecting none", directory.FullName);
323logger.LogError("Multiple AppHost project files found in directory {Directory}, throwing exception", directory.FullName);
334logger.LogError("Project file {ProjectFile} does not exist.", projectFile.FullName);
343logger.LogDebug("Using single-file apphost {ProjectFile}", projectFile.FullName);
349return await UseOrFindAppHostProjectFileAsync(new FileInfo(parentDirectory.FullName), multipleAppHostProjectsFoundBehavior, createSettingsFile, cancellationToken);
359logger.LogDebug("Using project file {ProjectFile}", projectFile.FullName);
402MultipleAppHostProjectsFoundBehavior.Prompt => await interactionService.PromptForSelectionAsync(InteractionServiceStrings.SelectAppHostToUse, results.BuildableAppHost, projectFile => $"{projectFile.Name} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName)})", cancellationToken),
424var settingsFilePath = ConfigurationHelper.BuildPathToSettingsJsonFile(executionContext.WorkingDirectory.FullName);
427logger.LogDebug("Creating settings file at {SettingsFilePath}", settingsFile.FullName);
429var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
434var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
466logger.LogDebug("Checking project file {ProjectFile} for OutputType", projectFile.FullName);
485logger.LogDebug("Found executable project file {ProjectFile} with OutputType {OutputType}", projectFile.FullName, outputType);
497executableProjects.Sort((x, y) => x.FullName.CompareTo(y.FullName));
Projects\ProjectUpdater.cs (29)
30logger.LogDebug("Fetching '{AppHostPath}' items and properties.", projectFile.FullName);
36logger.LogInformation("No updates required for project: {ProjectFile}", projectFile.FullName);
46.GroupBy(step => step.ProjectFile.FullName)
88var fallbackNuGetConfigDirectory = executionContext.WorkingDirectory.FullName;
175var cacheKey = $"{ItemsAndPropertiesCacheKeyPrefix}_{projectFile.FullName}_{itemsKey}_{propertiesKey}";
184throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.FailedFetchItemsAndPropertiesFormat, projectFile.FullName));
205logger.LogWarning("Falling back to parsing for '{ProjectFile}'. Reason: {Message}", projectFile.FullName, ex.Message);
219return string.Equals(projectFile.FullName, context.AppHostProjectFile.FullName, StringComparison.OrdinalIgnoreCase);
227var appHostProjectAnalyzeStep = new AnalyzeStep(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.AnalyzeProjectFormat, context.AppHostProjectFile.FullName), () => AnalyzeProjectAsync(context.AppHostProjectFile, context, cancellationToken));
252logger.LogDebug("Analyzing App Host SDK for: {AppHostFile}", context.AppHostProjectFile.FullName);
301projectDocument.Load(projectFile.FullName);
306throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindRootProjectElementFormat, projectFile.FullName));
322throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindSdkElementFormat, projectFile.FullName));
328projectDocument.Save(projectFile.FullName);
335var fileContent = await File.ReadAllTextAsync(projectFile.FullName);
343"Could not find '#:sdk Aspire.AppHost.Sdk@<version>' directive in single-file AppHost: {0}", projectFile.FullName));
350await File.WriteAllTextAsync(projectFile.FullName, updatedContent);
358if (!context.VisitedProjects.Add(projectFile.FullName))
398context.AnalyzeSteps.Enqueue(new AnalyzeStep(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.AnalyzeProjectFormat, referencedProjectFile.FullName), () => AnalyzeProjectAsync(referencedProjectFile, context, cancellationToken)));
452var directoryPackagesPropsPath = Path.Combine(current.FullName, "Directory.Packages.props");
519doc.Load(directoryPackagesPropsFile.FullName);
563logger.LogInformation(ex, "Ignoring parsing error in Directory.Packages.props '{DirectoryPackagesPropsFile}' for project '{ProjectFile}'", directoryPackagesPropsFile.FullName, projectFile.FullName);
604logger.LogWarning(ex, "Exception while resolving MSBuild property '{PropertyName}' for project '{ProjectFile}'", propertyName, projectFile.FullName);
617doc.Load(directoryPackagesPropsFile.FullName);
622throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindPackageVersionInDirectoryPackagesProps, packageId, directoryPackagesPropsFile.FullName));
626doc.Save(directoryPackagesPropsFile.FullName);
643throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.FailedUpdatePackageReferenceFormat, package.Id, projectFile.FullName));
Aspire.Cli.Tests (575)
Caching\DiskCacheTests.cs (4)
19var hives = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "hives"));
20var cacheDir = new DirectoryInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache"));
71var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search");
117var diskPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "cache", "nuget-search");
Commands\ConfigCommandTests.cs (5)
70var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
93var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
118var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
152var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
272var settingsPath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json");
Commands\RunCommandTests.cs (17)
420var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost");
422var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj");
424File.WriteAllText(appHostProjectFile.FullName, "<Project></Project>");
811var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
812await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
865var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
866await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
915var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
916await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
969var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
970await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
1018var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1019await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
1068var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1069await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
1118var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1119await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
Commands\UpdateCommandTests.cs (14)
80var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
81var oldBackup1 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
82var oldBackup2 = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.9876543210");
83var otherFile = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.something");
106var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
107var oldBackup = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe.old.1234567890");
147var targetExePath = Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.exe");
217return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
291var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
338var archivePath = Path.Combine(workspace.WorkspaceRoot.FullName, "test-cli.tar.gz");
372return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
439return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
506return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
566return Task.FromResult<FileInfo?>(new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj")));
DotNet\DotNetCliRunnerTests.cs (67)
26var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
34var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
35await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
83var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
84await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
121var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
122await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
169var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
170await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
216var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
217await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
266var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
267await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
362var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
363await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
410var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
411await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
460var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
461await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
515var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
516await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
553args: ["run", "--project", projectFile.FullName],
570var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
571await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
596Assert.Contains(appHostFile.FullName, args);
604var filePathIndex = Array.IndexOf(args, appHostFile.FullName);
631var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
632await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
656Assert.Contains(projectFile.FullName, args);
665var projectIndex = Array.IndexOf(args, projectFile.FullName);
700var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
701await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
725Assert.Contains(projectFile.FullName, args);
733var projectIndex = Array.IndexOf(args, projectFile.FullName);
773var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
774await File.WriteAllTextAsync(solutionFile.FullName, "Not a real solution file.");
778var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj"));
779await File.WriteAllTextAsync(project1File.FullName, "Not a real project file.");
782var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj"));
783await File.WriteAllTextAsync(project2File.FullName, "Not a real project file.");
829var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
830await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
832var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj"));
833await File.WriteAllTextAsync(referencedProject.FullName, "Not a real project file.");
855Assert.Contains(projectFile.FullName, args);
857Assert.Contains(referencedProject.FullName, args);
871var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
872await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
901arg => Assert.Equal(appHostFile.FullName, arg),
926var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
927await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
955arg => Assert.Equal(appHostFile.FullName, arg),
980var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
981await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
1034var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1035await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
1069arg => Assert.Equal(appHostFile.FullName, arg),
1094var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1095await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
1127arg => Assert.Equal(projectFile.FullName, arg),
1152var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1153await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
1184arg => Assert.Equal(projectFile.FullName, arg),
1209var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1210await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
1254var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1255await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
Packaging\NuGetConfigMergerSnapshotTests.cs (16)
46var path = Path.Combine(dir.FullName, "NuGet.config");
64var cacheDir = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
86var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
92var hivePath = Path.Combine(hivesDir.FullName, channelName);
113var cacheDir2 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
148var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
154var hivePath = Path.Combine(hivesDir.FullName, channelName);
175var cacheDir3 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
209var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
215var hivePath = Path.Combine(hivesDir.FullName, channelName);
236var cacheDir4 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
268var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
274var hivePath = Path.Combine(hivesDir.FullName, channelName);
295var cacheDir5 = new DirectoryInfo(Path.Combine(root.FullName, ".aspire", "cache"));
332var updated = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
338var hivePath = Path.Combine(hivesDir.FullName, channelName);
Packaging\NuGetConfigMergerTests.cs (19)
23var path = Path.Combine(dir.FullName, "NuGet.config");
65var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
69var expected = await File.ReadAllTextAsync(tempConfig.ConfigFile.FullName);
89var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
133var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
172var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
212var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
322var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
372var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
441var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
507var xml = XDocument.Load(Path.Combine(root.FullName, "NuGet.config"));
580var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
582Assert.Equal(targetConfigPath, callbackTargetFile.FullName);
610var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
660var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
662Assert.Equal(targetConfigPath, callbackTargetFile.FullName);
682var originalContent = await File.ReadAllTextAsync(Path.Combine(root.FullName, "NuGet.config"));
703var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
725var targetConfigPath = Path.Combine(root.FullName, "NuGet.config");
Packaging\PackagingServiceTests.cs (26)
45var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
46var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
80var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
81var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
124var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
125var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
157var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
158var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
190var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
191var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
222var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
223var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
253var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
254var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
284var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
285var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
315var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
316var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
369var nugetConfigPath = Path.Combine(tempDir.FullName, "NuGet.config");
393var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
394var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
398Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-10167"));
399Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-11832"));
450var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
451var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
455Directory.CreateDirectory(Path.Combine(hivesDir.FullName, "pr-12345"));
Projects\FallbackProjectParserTests.cs (11)
19var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.csproj");
53var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.csproj");
99var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.csproj");
143var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.csproj");
172var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.cs");
208var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.cs");
268var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.cs");
301var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.cs");
339var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.cs");
372var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.cs");
403var projectFile = Path.Combine(tempDir.FullName, $"Test{Guid.NewGuid()}.txt");
Projects\ProjectLocatorTests.cs (174)
26var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
37var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
60var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
61await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
64var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
65await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
68var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
73appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
85Assert.Equal(targetAppHostProjectFile.FullName, foundAppHost?.FullName);
99var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
100await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
103var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
104await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
107var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
112appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
124Assert.Equal(targetAppHostProjectFile.FullName, foundAppHost?.FullName);
135var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
136await File.WriteAllTextAsync(realAppHostProjectFile.FullName, "Not a real apphost project");
140var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
151if (projectFile.FullName == realAppHostProjectFile.FullName)
169Assert.Equal(realAppHostProjectFile.FullName, foundAppHost?.FullName);
178var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj"));
179await File.WriteAllTextAsync(projectFile1.FullName, "Not a real project file.");
181var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj"));
182await File.WriteAllTextAsync(projectFile2.FullName, "Not a real project file.");
192Assert.Equal(projectFile1.FullName, selectedProjectFile!.FullName);
201var appHostProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
202await File.WriteAllTextAsync(appHostProject.FullName, "Not a real apphost project.");
204var webProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebProject.csproj"));
205await File.WriteAllTextAsync(webProject.FullName, "Not a real web project.");
209if (projectFile.FullName == appHostProject.FullName)
225Assert.Equal(appHostProject.FullName, foundAppHost?.FullName);
256var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, $"AppHost{projectFileExtension}"));
257await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
275var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
276await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
286Assert.Equal(projectFile.FullName, returnedProjectFile!.FullName);
297var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
298await File.WriteAllTextAsync(appHostProjectFile.FullName, "Not a real project file.");
309var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
320var settingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"));
323var settingsJson = await File.ReadAllTextAsync(settingsFile.FullName);
338var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
340appHostFile.FullName,
354var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
357Assert.Equal(appHostFile.FullName, foundFiles[0].FullName);
366var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
368appHostFile.FullName,
382var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
385Assert.Equal(appHostFile.FullName, foundFiles[0].FullName);
396var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs"));
398appHostFile.FullName,
406var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj"));
407await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
411var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs"));
413validAppHostFile.FullName,
428var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
435var foundPaths = foundFiles.Select(f => f.FullName).ToHashSet();
436Assert.Contains(validAppHostFile.FullName, foundPaths);
437Assert.Contains(csprojFile.FullName, foundPaths);
438Assert.DoesNotContain(appHostFile.FullName, foundPaths);
447var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
448await File.WriteAllTextAsync(appHostFile.FullName, @"using Aspire.Hosting;
458var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
471var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj"));
472await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
476var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs"));
478appHostFile.FullName,
489if (projectFile.FullName == csprojFile.FullName)
503var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
507Assert.True(foundFiles[0].FullName.CompareTo(foundFiles[1].FullName) < 0);
509var foundPaths = foundFiles.Select(f => f.FullName).ToHashSet();
510Assert.Contains(csprojFile.FullName, foundPaths);
511Assert.Contains(appHostFile.FullName, foundPaths);
519var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
521appHostFile.FullName,
537Assert.Equal(appHostFile.FullName, result!.FullName);
547var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
548await File.WriteAllTextAsync(appHostFile.FullName, @"using Aspire.Hosting;
571var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
573appHostFile.FullName,
582var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj"));
583await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
601var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt"));
602await File.WriteAllTextAsync(txtFile.FullName, "Some text file");
625var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
626await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
630var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
632appHostFile.FullName,
643if (projectFile.FullName == csprojFile.FullName)
663Assert.True(result.FullName == csprojFile.FullName || result.FullName == appHostFile.FullName);
736var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj"));
737await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
742if (file.FullName == projectFile.FullName)
755var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
758Assert.Equal(projectFile.FullName, returnedProjectFile!.FullName);
777var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
795var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj"));
796await File.WriteAllTextAsync(projectFile1.FullName, "Not a real project file.");
797var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj"));
798await File.WriteAllTextAsync(projectFile2.FullName, "Not a real project file.");
804if (file.FullName == projectFile1.FullName || file.FullName == projectFile2.FullName)
817var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
822Assert.Equal(projectFile1.FullName, returnedProjectFile!.FullName);
833var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs"));
835appHostFile.FullName,
850var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
853Assert.Equal(appHostFile.FullName, returnedProjectFile!.FullName);
865var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj"));
866await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
871if (file.FullName == projectFile.FullName)
884var directoryAsFileInfo = new FileInfo(topDirectory.FullName);
887Assert.Equal(projectFile.FullName, returnedProjectFile!.FullName);
899var exeProjectFile = new FileInfo(Path.Combine(exeProjectDir.FullName, "ExeProject.csproj"));
900await File.WriteAllTextAsync(exeProjectFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>");
904var libProjectFile = new FileInfo(Path.Combine(libProjectDir.FullName, "LibProject.csproj"));
905await File.WriteAllTextAsync(libProjectFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Library</OutputType></PropertyGroup></Project>");
911var outputType = projectFile.FullName == exeProjectFile.FullName ? "Exe" : "Library";
925var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
928Assert.Equal(exeProjectFile.FullName, executableProjects[0].FullName);
940var winExeProjectFile = new FileInfo(Path.Combine(winExeProjectDir.FullName, "WinExeProject.csproj"));
941await File.WriteAllTextAsync(winExeProjectFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>WinExe</OutputType></PropertyGroup></Project>");
960var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
963Assert.Equal(winExeProjectFile.FullName, executableProjects[0].FullName);
975var lib1File = new FileInfo(Path.Combine(lib1Dir.FullName, "Lib1.csproj"));
976await File.WriteAllTextAsync(lib1File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Library</OutputType></PropertyGroup></Project>");
979var lib2File = new FileInfo(Path.Combine(lib2Dir.FullName, "Lib2.csproj"));
980await File.WriteAllTextAsync(lib2File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Library</OutputType></PropertyGroup></Project>");
999var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1017var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1031var exe1File = new FileInfo(Path.Combine(exe1Dir.FullName, "Exe1.csproj"));
1032await File.WriteAllTextAsync(exe1File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>");
1035var exe2File = new FileInfo(Path.Combine(exe2Dir.FullName, "Exe2.csproj"));
1036await File.WriteAllTextAsync(exe2File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>");
1039var winExeFile = new FileInfo(Path.Combine(winExeDir.FullName, "WinExe.csproj"));
1040await File.WriteAllTextAsync(winExeFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>WinExe</OutputType></PropertyGroup></Project>");
1066var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1069Assert.Contains(executableProjects, p => p.FullName == exe1File.FullName);
1070Assert.Contains(executableProjects, p => p.FullName == exe2File.FullName);
1071Assert.Contains(executableProjects, p => p.FullName == winExeFile.FullName);
Projects\ProjectUpdaterTests.cs (154)
29var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
32var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
35var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
38appHostProjectFile.FullName,
72if (projectFile.FullName == appHostProjectFile.FullName)
77itemsAndProperties.WithProjectReference(webAppProjectFile.FullName);
79else if (projectFile.FullName == webAppProjectFile.FullName)
82itemsAndProperties.WithProjectReference(serviceDefaultsProjectFile.FullName);
84else if (projectFile.FullName == serviceDefaultsProjectFile.FullName)
139var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
142var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
145var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
148appHostProjectFile.FullName,
183if (projectFile.FullName == appHostProjectFile.FullName)
188itemsAndProperties.WithProjectReference(webAppProjectFile.FullName);
190else if (projectFile.FullName == webAppProjectFile.FullName)
193itemsAndProperties.WithProjectReference(serviceDefaultsProjectFile.FullName);
195else if (projectFile.FullName == serviceDefaultsProjectFile.FullName)
249Assert.Equal(appHostProjectFile.FullName, item.ProjectFile.FullName);
256Assert.Equal(appHostProjectFile.FullName, item.ProjectFile.FullName);
263Assert.Equal(webAppProjectFile.FullName, item.ProjectFile.FullName);
276var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
279var webAppProjectFile = new FileInfo(Path.Combine(webAppFolder.FullName, "UpdateTester.WebApp.csproj"));
282var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
285appHostProjectFile.FullName,
327if (projectFile.FullName == appHostProjectFile.FullName)
333itemsAndProperties.WithProjectReference(webAppProjectFile.FullName);
335else if (projectFile.FullName == webAppProjectFile.FullName)
338itemsAndProperties.WithProjectReference(serviceDefaultsProjectFile.FullName);
340else if (projectFile.FullName == serviceDefaultsProjectFile.FullName)
394Assert.Equal(appHostProjectFile.FullName, item.ProjectFile.FullName);
401Assert.Equal(appHostProjectFile.FullName, item.ProjectFile.FullName);
408Assert.Equal(appHostProjectFile.FullName, item.ProjectFile.FullName);
415Assert.Equal(webAppProjectFile.FullName, item.ProjectFile.FullName);
432var sharedProjectFile = new FileInfo(Path.Combine(sharedProjectFolder.FullName, "SharedProject.csproj"));
435var projectAFile = new FileInfo(Path.Combine(projectAFolder.FullName, "ProjectA.csproj"));
438var projectBFile = new FileInfo(Path.Combine(projectBFolder.FullName, "ProjectB.csproj"));
441var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "DiamondTest.AppHost.csproj"));
444appHostProjectFile.FullName,
476if (projectFile.FullName == appHostProjectFile.FullName)
481itemsAndProperties.WithProjectReference(projectAFile.FullName);
482itemsAndProperties.WithProjectReference(projectBFile.FullName);
484else if (projectFile.FullName == projectAFile.FullName)
489itemsAndProperties.WithProjectReference(sharedProjectFile.FullName);
491else if (projectFile.FullName == projectBFile.FullName)
496itemsAndProperties.WithProjectReference(sharedProjectFile.FullName);
498else if (projectFile.FullName == sharedProjectFile.FullName)
505throw new InvalidOperationException($"Unexpected project file: {projectFile.FullName}");
545var sharedProjectUpdates = packagesAddsExecuted.Where(p => p.ProjectFile.FullName == sharedProjectFile.FullName).ToList();
553var appHostUpdates = packagesAddsExecuted.Where(p => p.ProjectFile.FullName == appHostProjectFile.FullName).ToList();
565var serviceDefaultsProjectFile = new FileInfo(Path.Combine(serviceDefaultsFolder.FullName, "UpdateTester.ServiceDefaults.csproj"));
568var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
570var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
574appHostProjectFile.FullName,
583serviceDefaultsProjectFile.FullName,
597directoryPackagesPropsFile.FullName,
637if (projectFile.FullName == appHostProjectFile.FullName)
640itemsAndProperties.WithProjectReference(serviceDefaultsProjectFile.FullName);
642else if (projectFile.FullName == serviceDefaultsProjectFile.FullName)
688var updatedContent = await File.ReadAllTextAsync(directoryPackagesPropsFile.FullName);
701var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
703var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
707appHostProjectFile.FullName,
719directoryPackagesPropsFile.FullName,
793var updatedContent = await File.ReadAllTextAsync(directoryPackagesPropsFile.FullName);
803var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
805var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
809appHostProjectFile.FullName,
821directoryPackagesPropsFile.FullName,
896var content = await File.ReadAllTextAsync(directoryPackagesPropsFile.FullName);
906var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
936var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
938var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
942appHostProjectFile.FullName,
954directoryPackagesPropsFile.FullName,
1039var content = await File.ReadAllTextAsync(directoryPackagesPropsFile.FullName);
1049var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1051var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1055appHostProjectFile.FullName,
1068directoryPackagesPropsFile.FullName,
1162var content = await File.ReadAllTextAsync(directoryPackagesPropsFile.FullName);
1173var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1175var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1179appHostProjectFile.FullName,
1191directoryPackagesPropsFile.FullName,
1287var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1289var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1293appHostProjectFile.FullName,
1305directoryPackagesPropsFile.FullName,
1398var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1402appHostProjectFile.FullName,
1436if (projectFile.FullName == appHostProjectFile.FullName)
1492var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1494var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
1498appHostProjectFile.FullName,
1510directoryPackagesPropsFile.FullName,
1544if (projectFile.FullName == appHostProjectFile.FullName)
1594var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1598appHostProjectFile.FullName,
1628if (projectFile.FullName == appHostProjectFile.FullName)
1673var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1676appHostProjectFile.FullName,
1707if (projectFile.FullName == appHostProjectFile.FullName)
1755var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
1759appHostFile.FullName,
1827var updatedContent = await File.ReadAllTextAsync(appHostFile.FullName);
1838var appHostFile = new FileInfo(Path.Combine(appHostFolder.FullName, "apphost.cs"));
1842appHostFile.FullName,
1910var updatedContent = await File.ReadAllTextAsync(appHostFile.FullName);
1920var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
1923appHostProjectFile.FullName,
2006var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2010appHostProjectFile.FullName,
2073var updatedContent = await File.ReadAllTextAsync(appHostProjectFile.FullName);
2084var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2088appHostProjectFile.FullName,
2152var updatedContent = await File.ReadAllTextAsync(appHostProjectFile.FullName);
2164var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2167appHostProjectFile.FullName,
2271var appHostProjectFile = new FileInfo(Path.Combine(appHostFolder.FullName, "UpdateTester.AppHost.csproj"));
2273var directoryPackagesPropsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Directory.Packages.props"));
2277appHostProjectFile.FullName,
2294directoryPackagesPropsFile.FullName,
2383Assert.Equal(appHostProjectFile.FullName, packageUpdate.ProjectFile.FullName);
2386var directoryPackagesContent = await File.ReadAllTextAsync(directoryPackagesPropsFile.FullName);
Templating\DotNetTemplateFactoryTests.cs (17)
54var path = Path.Combine(dir.FullName, "NuGet.config");
79var nugetConfigPath = Path.Combine(workingDir.FullName, "NuGet.config");
111var nugetConfigPath = Path.Combine(workingDir.FullName, "NuGet.config");
124var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
149var parentConfigPath = Path.Combine(workingDir.FullName, "NuGet.config");
155var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config");
168var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
191var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config");
205var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
218var workingConfigPath = Path.Combine(workingDir.FullName, "NuGet.config");
222var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config");
235var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
244var workingConfigPath = Path.Combine(workingDir.FullName, "NuGet.config");
245var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config");
256var outputDir = Directory.CreateDirectory(Path.Combine(workingDir.FullName, "MyProject"));
265var workingConfigPath = Path.Combine(workingDir.FullName, "NuGet.config");
266var outputConfigPath = Path.Combine(outputDir.FullName, "NuGet.config");
Utils\FileSystemHelperTests.cs (24)
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;");
24FileSystemHelper.CopyDirectory(sourceDir.FullName, destDir);
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");
54FileSystemHelper.CopyDirectory(sourceDir.FullName, destDir);
75var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "empty_destination");
78FileSystemHelper.CopyDirectory(sourceDir.FullName, destDir);
91var nonExistentSource = Path.Combine(workspace.WorkspaceRoot.FullName, "nonexistent");
92var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
104var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
120FileSystemHelper.CopyDirectory(sourceDir.FullName, null!));
128var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
144FileSystemHelper.CopyDirectory(sourceDir.FullName, string.Empty));
153var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
156var binaryFilePath = Path.Combine(sourceDir.FullName, "binary.dat");
162FileSystemHelper.CopyDirectory(sourceDir.FullName, destDir);
178var destDir = Path.Combine(workspace.WorkspaceRoot.FullName, "destination");
185File.WriteAllText(Path.Combine(current.FullName, $"file{i}.txt"), $"content at level {i}");
189FileSystemHelper.CopyDirectory(sourceDir.FullName, destDir);
Aspire.Dashboard.Tests (6)
Aspire.EndToEnd.Tests (6)
Aspire.Hosting (10)
Aspire.Hosting.Azure (4)
Aspire.Hosting.Azure.Tests (23)
AzureEnvironmentResourceTests.cs (14)
20output.WriteLine($"Temp directory: {tempDir.FullName}");
21using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.FullName);
33var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
37var envBicepPath = Path.Combine(tempDir.FullName, "env", "env.bicep");
52output.WriteLine($"Temp directory: {tempDir.FullName}");
53using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, tempDir.FullName);
70var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
84output.WriteLine($"Temp directory: {tempDir.FullName}");
86tempDir.FullName);
121var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
132output.WriteLine($"Temp directory: {tempDir.FullName}");
134tempDir.FullName);
169var mainBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "main.bicep"));
170var storageBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "storage", "storage.bicep"));
Aspire.Hosting.Containers.Tests (3)
Aspire.Hosting.Docker.Tests (6)
Aspire.Hosting.JavaScript.Tests (1)
Aspire.Hosting.Kubernetes.Tests (5)
Aspire.Hosting.MySql.Tests (1)
Aspire.Hosting.Nats.Tests (1)
Aspire.Hosting.Oracle.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (1)
Aspire.Hosting.Redis.Tests (1)
Aspire.Hosting.Testing (2)
Aspire.Hosting.Testing.Tests (2)
Aspire.Hosting.Tests (5)
Aspire.Templates.Tests (5)
BuildValidator (5)
CodeStyleConfigFileGenerator (2)
csc (1)
dotnet-dev-certs (5)
dotnet-openapi (2)
dotnet-svcutil.xmlserializer (3)
dotnet-svcutil-lib (33)
CommandProcessorOptions.cs (10)
216await ProcessOutputFileOptionAsync(this.OutputDir.FullName, cancellationToken);
390Path.GetDirectoryName(this.OutputFile.FullName) : Path.GetDirectoryName(Path.Combine(Directory.GetCurrentDirectory(), this.OutputFile.OriginalPath()));
651if (this.Project != null && PathHelper.GetRelativePath(this.OutputDir.FullName, new DirectoryInfo(this.Project.DirectoryPath), out var relPath))
698var projectFullPath = Path.Combine(this.BootstrapPath.FullName, "TFMResolver", "TFMResolver.csproj");
736var inputFiles = Metadata.MetadataFileNameManager.ResolveFiles(metadataUri.LocalPath).Select(f => f.FullName);
836string projFolder = Path.Combine(this.BootstrapPath.FullName, nameof(SvcutilBootstrapper));
841assembly = Assembly.LoadFrom(assemblyFile.FullName);
1008if (!Directory.Exists(this.BootstrapPath.FullName))
1010Directory.CreateDirectory(this.BootstrapPath.FullName);
1014await RuntimeEnvironmentHelper.TryCopyingConfigFiles(workingDirectory, this.BootstrapPath.FullName, logger, cancellationToken).ConfigureAwait(false);
dotnet-svcutil-lib.Tests (3)
FilesWebSite (1)
GenerateDocumentationAndConfigFiles (10)
Program.cs (10)
433var fileWithPath = Path.Combine(directory.FullName, args.PropsFileName);
442fileWithPath = Path.Combine(directory.FullName, args.PropsFileToDisableNetAnalyzersInNuGetPackageName);
542var fileWithPath = Path.Combine(directory.FullName, args.AnalyzerDocumentationFileName);
638var fileWithPath = Path.Combine(directory.FullName, args.AnalyzerSarifFileName);
732Validate(Path.Combine(directory.FullName, args.AnalyzerSarifFileName), stringWriter.ToString(), fileNamesWithValidationFailures);
774var fileWithPath = Path.Combine(directory.FullName, "RulesMissingDocumentation.md");
1110var rulesetFilePath = Path.Combine(directory.FullName, rulesetFileName);
1175var editorconfigFilePath = Path.Combine(directory.FullName, ".editorconfig");
1398var configFilePath = Path.Combine(directory.FullName, fileName.ToLowerInvariant());
1610var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
GenerateRulesMissingDocumentation (1)
IIS.FunctionalTests (14)
IIS.LongTests (8)
IIS.NewHandler.FunctionalTests (8)
IIS.NewShim.FunctionalTests (8)
IIS.ShadowCopy.Tests (12)
IISExpress.FunctionalTests (14)
illink (4)
Microsoft.Agents.AI.ProjectTemplates.Tests (1)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (11)
Microsoft.AspNetCore.DataProtection (13)
Microsoft.AspNetCore.DataProtection.Extensions.Tests (6)
Microsoft.AspNetCore.DataProtection.Tests (15)
Repositories\FileSystemXmlRepositoryTests.cs (10)
21var expectedDir = new DirectoryInfo(Path.Combine(baseDir, "DataProtection-Keys")).FullName;
27Assert.Equal(expectedDir, defaultDirInfo.FullName);
82var parsedElement = XElement.Parse(File.ReadAllText(fileInfo.FullName));
116var parsedElement = XElement.Parse(File.ReadAllText(fileInfo.FullName));
205var filePath1 = Path.Combine(dirInfo.FullName, "friendly1.xml");
206var filePath2 = Path.Combine(dirInfo.FullName, "friendly2.xml");
207var filePath3 = Path.Combine(dirInfo.FullName, "friendly3.xml");
222fileLock2 = new FileStream(Path.Combine(dirInfo.FullName, "friendly2.xml"), FileMode.Open, FileAccess.ReadWrite, FileShare.None);
255var filePath = Path.Combine(dirInfo.FullName, "friendly1.xml");
290Assert.Contains(Resources.FormatFileSystem_EphemeralKeysLocationInContainer(dirInfo.FullName), loggerFactory.ToString());
Microsoft.AspNetCore.DeveloperCertificates.XPlat (5)
Microsoft.AspNetCore.FunctionalTests (2)
Microsoft.AspNetCore.Identity.Test (2)
Microsoft.AspNetCore.InternalTesting (3)
Microsoft.AspNetCore.Mvc.Testing (2)
Microsoft.AspNetCore.Server.IntegrationTesting (6)
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Microsoft.AspNetCore.Server.Kestrel.Tests (5)
Microsoft.AspNetCore.Shared.Tests (5)
Microsoft.AspNetCore.TestHost (2)
Microsoft.AspNetCore.Tests (1)
Microsoft.Build.Tasks.CodeAnalysis (3)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (3)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (3)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Features (1)
Microsoft.CodeAnalysis.Features (9)
SymbolSearch\Windows\SymbolSearchUpdateEngine.Update.cs (8)
183Path.Combine(_cacheDirectoryInfo.FullName, ConvertToFileName(_source) + ".txt"));
344var tempFilePath = Path.Combine(_cacheDirectoryInfo.FullName, guidString + ".tmp");
366_service._ioService.Replace(tempFilePath, databaseFileInfo.FullName, destinationBackupFileName: null, ignoreMetadataErrors: true);
372_service._ioService.Move(tempFilePath, databaseFileInfo.FullName);
386=> new(Path.ChangeExtension(databaseFileInfo.FullName, ".bin"));
427getDatabaseBytes: () => isBinary ? _service._ioService.ReadAllBytes(databaseFileInfo.FullName) : databaseBytes,
442return (_service._ioService.ReadAllBytes(databaseBinaryFileInfo.FullName), isBinary: true);
449return (_service._ioService.ReadAllBytes(databaseFileInfo.FullName), isBinary: false);
Microsoft.CodeAnalysis.LanguageServer (1)
Microsoft.CodeAnalysis.Scripting (1)
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
Microsoft.Data.Analysis.Tests (1)
Microsoft.DotNet.Build.Tasks.Feed (5)
Microsoft.DotNet.Build.Tasks.Packaging (1)
Microsoft.DotNet.Helix.JobSender (11)
Microsoft.DotNet.Helix.Sdk (7)
Microsoft.DotNet.Internal.SymbolHelper (2)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
Microsoft.DotNet.SwaggerGenerator.CmdLine (2)
Microsoft.DotNet.SwaggerGenerator.MSBuild (4)
Microsoft.Extensions.AI.Evaluation.Console (4)
Microsoft.Extensions.AI.Evaluation.Reporting (4)
Microsoft.Extensions.AI.Templates.Tests (1)
Microsoft.Extensions.ApiDescription.Tool.Tests (36)
Microsoft.Extensions.DataIngestion (6)
Microsoft.Extensions.DataIngestion.Abstractions (2)
Microsoft.Extensions.DataIngestion.Markdig (1)
Microsoft.Extensions.DataIngestion.MarkItDown (6)
Microsoft.Extensions.DataIngestion.Tests (11)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (7)
Microsoft.Extensions.FileProviders.Physical (2)
Microsoft.Extensions.FileSystemGlobbing (6)
Microsoft.Extensions.SecretManager.Tools.Tests (6)
Microsoft.Maui.Resizetizer (10)
Microsoft.ML.AutoML (4)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core.Tests (5)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.PerformanceTests (3)
Microsoft.ML.Samples (4)
Microsoft.ML.Samples.GPU (4)
Microsoft.ML.SamplesUtils (1)
Microsoft.ML.SearchSpace.Tests (2)
Microsoft.ML.TestFramework (7)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.VisualBasic.Core (6)
Microsoft.VisualBasic.Tests (3)
PresentationCore (1)
PresentationUI (1)
Replay (1)
ResultsOfTGenerator (2)
Roslyn.Compilers.Extension (1)
RulesetToEditorconfigConverter.UnitTests (4)
ServerComparison.FunctionalTests (2)
StaticFilesAuth (4)
System.CodeDom (1)
System.Configuration.ConfigurationManager (2)
System.Formats.Tar (4)
System.IO.Compression.ZipFile (4)
System.IO.Packaging (1)
System.IO.Ports (4)
System.Private.CoreLib (7)
System.Security.Cryptography (1)
System.Windows.Forms.Design (1)
System.Windows.Forms.IntegrationTests.Common (2)
Templates.Blazor.Tests (5)
Templates.Blazor.WebAssembly.Auth.Tests (5)
Templates.Blazor.WebAssembly.Tests (5)
Templates.Mvc.Tests (5)
Templates.Tests (5)
vbc (1)
VBCSCompiler (1)