1910 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,
757string[] cliArgs = ["build", projectFilePath.FullName];
787cliArgsList.AddRange(["package", "--file", projectFilePath.FullName]);
793cliArgsList.AddRange([projectFilePath.FullName, "package"]);
812logger.LogInformation("Adding package {PackageName} with version {PackageVersion} to project {ProjectFilePath}", packageName, packageVersion, projectFilePath.FullName);
825logger.LogError("Failed to add package {PackageName} with version {PackageVersion} to project {ProjectFilePath}. See debug logs for more details.", packageName, packageVersion, projectFilePath.FullName);
829logger.LogInformation("Package {PackageName} with version {PackageVersion} added to project {ProjectFilePath}", packageName, packageVersion, projectFilePath.FullName);
839string[] cliArgs = ["sln", solutionFile.FullName, "add", projectFile.FullName];
841logger.LogInformation("Adding project {ProjectFilePath} to solution {SolutionFilePath}", projectFile.FullName, solutionFile.FullName);
854logger.LogError("Failed to add project {ProjectFilePath} to solution {SolutionFilePath}. See debug logs for more details.", projectFile.FullName, solutionFile.FullName);
858logger.LogInformation("Project {ProjectFilePath} added to solution {SolutionFilePath}", projectFile.FullName, solutionFile.FullName);
901: Path.Combine(workingDirectory.FullName, configPath);
990cliArgs.Add(nugetConfigFile.FullName);
1108string[] cliArgs = ["sln", solutionFile.FullName, "list"];
1162: Path.Combine(solutionFile.Directory!.FullName, line);
1174string[] cliArgs = ["add", projectFile.FullName, "reference", referencedProject.FullName];
1176logger.LogInformation("Adding project reference from {ProjectFile} to {ReferencedProject}", projectFile.FullName, referencedProject.FullName);
1189logger.LogError("Failed to add project reference from {ProjectFile} to {ReferencedProject}. See debug logs for more details.", projectFile.FullName, referencedProject.FullName);
1193logger.LogInformation("Project reference added from {ProjectFile} to {ReferencedProject}", projectFile.FullName, referencedProject.FullName);
1208var 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));
248logger.LogDebug("Analyzing App Host SDK for: {AppHostFile}", context.AppHostProjectFile.FullName);
294projectDocument.Load(projectFile.FullName);
299throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindRootProjectElementFormat, projectFile.FullName));
315throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindSdkElementFormat, projectFile.FullName));
321projectDocument.Save(projectFile.FullName);
328var fileContent = await File.ReadAllTextAsync(projectFile.FullName);
336"Could not find '#:sdk Aspire.AppHost.Sdk@<version>' directive in single-file AppHost: {0}", projectFile.FullName));
343await File.WriteAllTextAsync(projectFile.FullName, updatedContent);
351if (!context.VisitedProjects.Add(projectFile.FullName))
374context.AnalyzeSteps.Enqueue(new AnalyzeStep(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.AnalyzeProjectFormat, referencedProjectFile.FullName), () => AnalyzeProjectAsync(referencedProjectFile, context, cancellationToken)));
428var directoryPackagesPropsPath = Path.Combine(current.FullName, "Directory.Packages.props");
491doc.Load(directoryPackagesPropsFile.FullName);
535logger.LogInformation(ex, "Ignoring parsing error in Directory.Packages.props '{DirectoryPackagesPropsFile}' for project '{ProjectFile}'", directoryPackagesPropsFile.FullName, projectFile.FullName);
576logger.LogWarning(ex, "Exception while resolving MSBuild property '{PropertyName}' for project '{ProjectFile}'", propertyName, projectFile.FullName);
597doc.Load(directoryPackagesPropsFile.FullName);
602throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindPackageVersionInDirectoryPackagesProps, packageId, directoryPackagesPropsFile.FullName));
606doc.Save(directoryPackagesPropsFile.FullName);
623throw new ProjectUpdaterException(string.Format(CultureInfo.InvariantCulture, UpdateCommandStrings.FailedUpdatePackageReferenceFormat, package.Id, projectFile.FullName));
Aspire.Cli.Tests (543)
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>");
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 (9)
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"));
158var hivesDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "hives"));
159var cacheDir = new DirectoryInfo(Path.Combine(tempDir.FullName, ".aspire", "cache"));
215var nugetConfigPath = Path.Combine(tempDir.FullName, "NuGet.config");
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 (145)
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);
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)
containerize.UnitTests (6)
csc (1)
dotnet (35)
CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (1)
45dll.FullName,
dotnet.Tests (38)
CommandTests\Run\RunFileTests.cs (10)
2027var programFile = Path.Join(subDir.FullName, "Program.cs");
2033var publishDir = Path.Join(subDir.FullName, "artifacts");
2082new DotnetCommand(Log, "tool", "exec", "MyFileBasedTool", "--yes", "--add-source", packageDir.FullName)
2818Log.WriteLine($"Skipping code generation because file does not exist: {nonGeneratedFile.FullName}");
2823var existingText = codeFilePath.Exists ? File.ReadAllText(codeFilePath.FullName) : string.Empty;
2827Log.WriteLine($"{codeFilePath.FullName} needs to be updated:");
2831throw new InvalidOperationException($"Not updating file in CI: {codeFilePath.FullName}");
2835File.WriteAllText(codeFilePath.FullName, newText);
2836throw new InvalidOperationException($"File outdated, commit the changes: {codeFilePath.FullName}");
4239.ToDictionary(f => f.Name, f => File.ReadAllText(f.FullName));
dotnet-dev-certs (5)
dotnet-format (2)
dotnet-format.UnitTests (1)
dotnet-MsiInstallation.Tests (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)
dotnet-watch (2)
dotnet-watch.Tests (1)
EndToEnd.Tests (4)
FilesWebSite (1)
GenerateDocumentationAndConfigFiles (10)
Program.cs (10)
260var fileWithPath = Path.Combine(directory.FullName, propsFileName);
269fileWithPath = Path.Combine(directory.FullName, propsFileToDisableNetAnalyzersInNuGetPackageName);
341var fileWithPath = Path.Combine(directory.FullName, analyzerDocumentationFileName);
436var fileWithPath = Path.Combine(directory.FullName, tempAnalyzerSarifFileName);
530Validate(Path.Combine(directory.FullName, analyzerSarifFileName), File.ReadAllText(fileWithPath), fileNamesWithValidationFailures);
566var fileWithPath = Path.Combine(directory.FullName, "RulesMissingDocumentation.md");
902var rulesetFilePath = Path.Combine(directory.FullName, rulesetFileName);
967var editorconfigFilePath = Path.Combine(directory.FullName, ".editorconfig");
1185var configFilePath = Path.Combine(directory.FullName, fileName.ToLowerInvariant());
1397var fileWithPath = Path.Combine(directory.FullName, targetsFileName);
GenerateRulesMissingDocumentation (1)
HelixTasks (7)
IIS.FunctionalTests (14)
IIS.LongTests (8)
IIS.NewHandler.FunctionalTests (8)
IIS.NewShim.FunctionalTests (8)
IIS.ShadowCopy.Tests (12)
IISExpress.FunctionalTests (14)
illink (4)
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.TestHost (2)
Microsoft.AspNetCore.Tests (1)
Microsoft.Build (12)
Microsoft.Build.BuildCheck.UnitTests (2)
Microsoft.Build.CommandLine.UnitTests (3)
Microsoft.Build.Engine.OM.UnitTests (9)
Microsoft.Build.Engine.UnitTests (8)
Microsoft.Build.Framework.UnitTests (1)
Microsoft.Build.Tasks.CodeAnalysis (3)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (3)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (2)
Microsoft.Build.Tasks.Core (45)
DownloadFile.cs (7)
180var destinationFile = new FileInfo(Path.Combine(destinationDirectory.FullName, filename));
185Log.LogMessageFromResources(MessageImportance.Normal, "DownloadFile.DidNotDownloadBecauseOfFileMatch", SourceUrl, destinationFile.FullName, nameof(SkipUnchangedFiles), "true");
187DownloadedFile = new TaskItem(destinationFile.FullName);
193Log.LogErrorFromResources("DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength);
201using (var target = new FileStream(destinationFile.FullName, FileMode.Create, FileAccess.Write, FileShare.None))
203Log.LogMessageFromResources(MessageImportance.High, "DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength);
215DownloadedFile = new TaskItem(destinationFile.FullName);
Unzip.cs (15)
163string fullDestinationDirectoryPath = Path.GetFullPath(FileUtilities.EnsureTrailingSlash(destinationDirectory.FullName));
173string fullDestinationPath = Path.GetFullPath(Path.Combine(destinationDirectory.FullName, zipArchiveEntry.FullName));
180if (Path.GetFileName(destinationPath.FullName).Length == 0)
183Directory.CreateDirectory(destinationPath.FullName);
187if (!destinationPath.FullName.StartsWith(destinationDirectory.FullName, StringComparison.OrdinalIgnoreCase))
191Log.LogErrorFromResources("Unzip.ErrorExtractingResultsInFilesOutsideDestination", destinationPath.FullName, destinationDirectory.FullName);
197Log.LogMessageFromResources(MessageImportance.Low, "Unzip.DidNotUnzipBecauseOfFileMatch", zipArchiveEntry.FullName, destinationPath.FullName, nameof(SkipUnchangedFiles), "true");
202Log.LogErrorFromResources("Unzip.FileComment", zipArchiveEntry.FullName, destinationPath.FullName);
224string lockedFileMessage = LockCheck.GetLockedFileMessage(destinationPath.FullName);
225Log.LogErrorWithCodeFromResources("Unzip.ErrorCouldNotMakeFileWriteable", zipArchiveEntry.FullName, destinationPath.FullName, e.Message, lockedFileMessage);
232Log.LogMessageFromResources(MessageImportance.Normal, "Unzip.FileComment", zipArchiveEntry.FullName, destinationPath.FullName);
259using (Stream destination = File.Open(destinationPath.FullName, FileMode.Create, FileAccess.Write, FileShare.None))
275Log.LogErrorWithCodeFromResources("Unzip.ErrorCouldNotExtractFile", zipArchiveEntry.FullName, destinationPath.FullName, e.Message);
ZipDirectory.cs (18)
66Log.LogErrorWithCodeFromResources("ZipDirectory.ErrorDirectoryDoesNotExist", sourceDirectory.FullName);
80Log.LogErrorWithCodeFromResources("ZipDirectory.ErrorFileExists", destinationFile.FullName);
87File.Delete(destinationFile.FullName);
91string lockedFileMessage = LockCheck.GetLockedFileMessage(destinationFile.FullName);
92Log.LogErrorWithCodeFromResources("ZipDirectory.ErrorFailed", sourceDirectory.FullName, destinationFile.FullName, e.Message, lockedFileMessage);
102Log.LogErrorFromResources("ZipDirectory.Comment", sourceDirectory.FullName, destinationFile.FullName);
106Log.LogMessageFromResources(MessageImportance.High, "ZipDirectory.Comment", sourceDirectory.FullName, destinationFile.FullName);
109ZipFile.CreateFromDirectory(sourceDirectory.FullName, destinationFile.FullName);
113ZipFile.CreateFromDirectory(sourceDirectory.FullName, destinationFile.FullName, compressionLevel.Value, includeBaseDirectory: false);
129ZipFile.CreateFromDirectory(sourceDirectory.FullName, destinationFile.FullName);
135Log.LogErrorWithCodeFromResources("ZipDirectory.ErrorFailed", sourceDirectory.FullName, destinationFile.FullName, e.Message, string.Empty);
Microsoft.Build.Tasks.UnitTests (19)
Microsoft.Build.UnitTests.Shared (2)
Microsoft.Build.Utilities.Core (21)
ToolLocationHelper.cs (15)
2526ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found ExtensionsSDK folder '{0}'. ", extensionSdksDirectory.FullName);
2529ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkName directories under '{1}'", sdkNameDirectories.Length, extensionSdksDirectory.FullName);
2535ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Found '{0}' sdkVersion directories under '{1}'", sdkVersionDirectories.Length, sdkNameFolders.FullName);
2541ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Parsed sdk version folder '{0}' under '{1}'", sdkVersionDirectory.Name, sdkVersionDirectory.FullName);
2552string pathToSDKManifest = Path.Combine(sdkVersionDirectory.FullName, "SDKManifest.xml");
2555targetPlatformSDK.ExtensionSDKs.Add(SDKKey, FileUtilities.EnsureTrailingSlash(sdkVersionDirectory.FullName));
2564ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "SDKKey '{0}' was already found, not adding sdk under '{1}'", SDKKey, sdkVersionDirectory.FullName);
2569ErrorUtilities.DebugTraceMessage("GatherExtensionSDKs", "Failed to parse sdk version folder '{0}' under '{1}'", sdkVersionDirectory.Name, sdkVersionDirectory.FullName);
2627string platformSDKDirectory = Path.Combine(rootPathWithIdentifier.FullName, version);
3039ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Found '{0}' platform version directories under '{1}'", platformVersions.Length, platformIdentifier.FullName);
3055string pathToPlatformManifest = Path.Combine(platformVersion.FullName, "Platform.xml");
3058sdk.Platforms.Add(sdkKey, FileUtilities.EnsureTrailingSlash(platformVersion.FullName));
3067ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "SDKKey '{0}' was already found, not adding platform under '{1}'", sdkKey, platformVersion.FullName);
3072ErrorUtilities.DebugTraceMessage("GatherPlatformsForSdk", "Failed to parse platform version folder '{0}' under '{1}'", platformVersion.Name, platformVersion.FullName);
3198pathToReturn = Directory.GetParent(pathToReturn).FullName;
Microsoft.Build.Utilities.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (2)
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.ApiDiff (1)
Microsoft.DotNet.ApiDiff.Tests (10)
Diff.Disk.Tests.cs (8)
276inputFolderPath.FullName,
282outputFolderPath.FullName,
288VerifyDiskWrite(outputFolderPath.FullName, DefaultTableOfContentsTitle, ExpectedEmptyTableOfContents, []);
430inputFolderPath.FullName,
436outputFolderPath.FullName,
442string tableOfContentsMarkdownFilePath = Path.Join(outputFolderPath.FullName, $"{DefaultTableOfContentsTitle}.md");
447string myAssemblyMarkdownFilePath = Path.Join(outputFolderPath.FullName, $"{DefaultTableOfContentsTitle}_{DefaultAssemblyName}.md");
552await File.WriteAllLinesAsync(file.FullName, list);
Microsoft.DotNet.ApiDiff.Tool (3)
Microsoft.DotNet.Build.Tasks.Packaging (1)
Microsoft.DotNet.Cli.Utils (3)
Microsoft.DotNet.Configurer (1)
Microsoft.DotNet.Helix.JobSender (11)
Microsoft.DotNet.Helix.Sdk (1)
Microsoft.DotNet.Internal.SymbolHelper (2)
Microsoft.DotNet.InternalAbstractions (3)
Microsoft.DotNet.MSBuildSdkResolver.Tests (3)
Microsoft.DotNet.Open.Api.Tools.Tests (2)
Microsoft.DotNet.SwaggerGenerator.CmdLine (2)
Microsoft.DotNet.SwaggerGenerator.MSBuild (3)
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 (5)
Microsoft.Extensions.DataIngestion.Abstractions (2)
Microsoft.Extensions.DataIngestion.Markdig (1)
Microsoft.Extensions.DataIngestion.MarkItDown (4)
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.NET.Build.Containers (4)
Microsoft.NET.Build.Tests (146)
GivenFrameworkReferences.cs (9)
58string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
113string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
149string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
179string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
372string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
719string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
754testProject.PackageReferences.Add(new TestPackageReference(referencedPackage.Name, "1.0.0", nupkgFolder.FullName));
772string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
1136var resolvedVersions = ResolvedVersionInfo.ParseFrom(Path.Combine(outputDirectory.FullName, "resolvedversions.txt"));
GivenThatWeWantToBuildANetCoreApp.cs (12)
154string runtimeConfigFile = Path.Combine(outputDirectory.FullName, testProject.Name + ".runtimeconfig.json");
166string devruntimeConfigContents = File.ReadAllText(Path.Combine(outputDirectory.FullName, runtimeconfigDevFileName));
363string outputFolder = buildCommand.GetOutputDirectory(project.TargetFrameworks, runtimeIdentifier: runtimeIdentifier ?? "").FullName;
393buildCommand.GetOutputDirectory(targetFramework).FullName,
421buildCommand.GetOutputDirectory(targetFramework).FullName,
485string outputFolder = buildCommand.GetOutputDirectory(project.TargetFrameworks).FullName;
524string outputFolder = buildCommand.GetOutputDirectory(project.TargetFrameworks, runtimeIdentifier: runtimeIdentifier).FullName;
650string intermediateFolderWithConfiguration = Path.Combine(buildCommand.GetBaseIntermediateDirectory().FullName, "Debug");
868var outputPath = buildCommand.GetOutputDirectory(targetFramework: TFM, runtimeIdentifier: runtimeIdentifier).FullName;
927var outputPath = buildCommand.GetOutputDirectory(targetFramework: ToolsetInfo.CurrentTargetFramework).FullName;
939buildCommand.GetIntermediateDirectory(targetFramework: ToolsetInfo.CurrentTargetFramework).FullName,
1129var runCommand = new RunExeCommand(Log, Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework).FullName, $"{testProj.Name}{EnvironmentInfo.ExecutableExtension}"));
GivenThatWeWantToControlGeneratedAssemblyInfo.cs (18)
79var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework, "Release").FullName, "HelloWorld.dll");
258var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll");
286var assemblyPath = Path.Combine(incrementalBuildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll");
309var assemblyPath = Path.Combine(firstBuildCommand.GetOutputDirectory(targetFramework).FullName, "TestLibrary.dll");
359var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
394var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll");
453var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(ToolsetInfo.CurrentTargetFramework).FullName, "HelloWorld.dll");
507var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, "HelloWorld.dll");
553var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
579var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
606var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
632var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
660var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory("netstandard2.0").FullName, "HelloWorld.dll");
698var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll");
744var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testTestProject.TargetFrameworks).FullName, testTestProject.Name + ".dll");
776var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll");
803var assemblyPath = Path.Combine(buildCommand.GetOutputDirectory(targetFramework).FullName, testProject.Name + ".dll");
860var exePath = Path.Combine(buildCommand.GetOutputDirectory(testProject.TargetFrameworks).FullName, testProject.Name + ".dll");
Microsoft.NET.Publish.Tests (115)
GivenThatWeWantToPublishAHelloWorldProject.cs (8)
55new DotnetCommand(Log, Path.Combine(publishDirectory.FullName, "HelloWorld.dll"))
121string selfContainedExecutableFullPath = Path.Combine(publishDirectory.FullName, selfContainedExecutable);
326using (var depsJsonFileStream = File.OpenRead(Path.Combine(publishDirectory.FullName, $"{testProject.Name}.deps.json")))
344string selfContainedExecutableFullPath = Path.Combine(publishDirectory.FullName, selfContainedExecutable);
365.OnlyHaveRuntimeAssembliesWhichAreInFolder(rid, publishDirectory.FullName)
367.OnlyHaveNativeAssembliesWhichAreInFolder(rid, publishDirectory.FullName, testProject.Name);
386runCommand = new DotnetCommand(Log, Path.Combine(publishDirectory.FullName, $"{testProject.Name}.dll"));
1151var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework).FullName;
GivenThatWeWantToPublishAnAotApp.cs (16)
58var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
102var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
147var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, configuration: projectConfiguration, runtimeIdentifier: rid).FullName;
199var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, configuration: projectConfiguration, runtimeIdentifier: rid).FullName;
242var outputDirectory = buildCommand.GetOutputDirectory(targetFramework, runtimeIdentifier: rid).FullName;
293var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
337var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
367var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
413var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
446var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
593var outputDirectory = buildCommand.GetOutputDirectory(targetFramework).FullName;
743var publishedExe = Path.Combine(publishDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}");
838var publishedExe = Path.Combine(publishDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}");
871var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
924var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
964string outputDirectory = buildCommand.GetOutputDirectory(targetFramework: targetFramework).FullName;
GivenThatWeWantToPublishASingleFileApp.cs (13)
105var singleFilePath = Path.Combine(GetPublishDirectory(cmd).FullName, $"SingleFileTest{Constants.ExeSuffix}");
327var publishDir = GetPublishDirectory(publishCommand, targetFramework: ToolsetInfo.CurrentTargetFramework).FullName;
445var mainProjectDll = Path.Combine(intermediateDirectory.FullName, $"{TestProjectName}.dll");
522var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand).FullName, SingleFile);
568GetPublishDirectory(publishCommand).FullName,
583var appHostPath = Path.Combine(GetPublishDirectory(publishCommand).FullName, SingleFile);
607var appHostPath = Path.Combine(GetPublishDirectory(publishCommand).FullName, SingleFile);
826var publishDir = GetPublishDirectory(publishCommand, targetFramework).FullName;
870string singleFilePath = Path.Combine(publishDir.FullName, $"{testProject.Name}.exe");
960var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand, ToolsetInfo.CurrentTargetFramework).FullName, $"SingleFileTest{Constants.ExeSuffix}");
991var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand, ToolsetInfo.CurrentTargetFramework).FullName, $"SingleFileTest{Constants.ExeSuffix}");
1025var singleFilePath = Path.Combine(GetPublishDirectory(publishCommand, ToolsetInfo.CurrentTargetFramework).FullName, $"SingleFileTest{Constants.ExeSuffix}");
1168var publishDir = GetPublishDirectory(publishCommand, targetFramework, runtimeIdentifier: rid).FullName;
GivenThatWeWantToRunILLink.cs (40)
48var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
49var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
87var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
88var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
132var exe = Path.Combine(publishDirectory.FullName, $"{testProject.Name}{Constants.ExeSuffix}");
283var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
309var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
348var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
384var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
408var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
438var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
473var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
497var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
527var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
567var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
817var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
818var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1047string outputDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1130var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1187var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1221var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1245var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1278var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1279var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1315var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1316var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1353var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1354var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1407var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1408var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1445var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1446var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1482var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1483var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1512var publishDirectory = publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1513var intermediateDirectory = publishCommand.GetIntermediateDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName;
1784var outputDirectory = buildCommand.GetOutputDirectory(targetFramework, runtimeIdentifier: rid).FullName;
1818var outputDirectory = buildCommand.GetOutputDirectory(targetFramework, runtimeIdentifier: rid).FullName;
2353string[] runtimeAssemblies = Directory.GetFiles(publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName, "*.dll");
2359Assembly assembly = mlc.LoadFromAssemblyPath(Path.Combine(publishCommand.GetOutputDirectory(targetFramework: targetFramework, runtimeIdentifier: rid).FullName, "System.Private.CoreLib.dll"));
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (8)
Microsoft.NET.Sdk.Publish.Tasks (2)
Microsoft.NET.Sdk.Razor.Tests (8)
Microsoft.NET.Sdk.StaticWebAssets.Tests (24)
StaticWebAssetsPackIntegrationTest.cs (10)
54Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
83Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryNoStaticAssets.1.0.0.nupkg"),
149Path.Combine(pack2.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
180Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
1498Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
1523Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
1556Path.Combine(build.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
1586Path.Combine(pack.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
1687Path.Combine(buildCommand.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
1718Path.Combine(buildCommand.GetPackageDirectory().FullName, "PackageLibraryDirectDependency.1.0.0.nupkg"),
Microsoft.NET.Sdk.Web.Tests (2)
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (1)
Microsoft.NET.TestFramework (51)
Assertions\DirectoryInfoAssertions.cs (20)
19_dirInfo.Exists.Should().BeTrue($"Expected directory {_dirInfo.FullName} to exist, but it does not.");
25_dirInfo.Exists.Should().BeFalse($"Expected directory {_dirInfo.FullName} to not exist, but it does.");
31var file = _dirInfo.EnumerateFiles(expectedFile, SearchOption.TopDirectoryOnly).SingleOrDefault() ?? new FileInfo(Path.Combine(_dirInfo.FullName, expectedFile));
32file.Should().Exist($"Expected File {expectedFile} cannot be found in directory {_dirInfo.FullName}.");
38var file = _dirInfo.EnumerateFiles(expectedFile, SearchOption.TopDirectoryOnly).SingleOrDefault() ?? new FileInfo(Path.Combine(_dirInfo.FullName, expectedFile));
39file.Should().NotExist($"File {expectedFile} should not be found in directory {_dirInfo.FullName}.");
61matchingFileExists.Should().BeTrue($"Expected directory {_dirInfo.FullName} to contain files matching {expectedFilesSearchPattern}, but no matching file exists.");
79matchingFileCount.Should().Be(0, $"Found {matchingFileCount} files that should not exist in directory {_dirInfo.FullName}. No file matching {expectedFilesSearchPattern} should exist.");
87dir.Exists.Should().BeTrue($"Expected directory {expectedDir} cannot be found inside directory {_dirInfo.FullName}.");
95.Select(f => f.FullName.Substring(_dirInfo.FullName.Length + 1) // make relative to _dirInfo
102missingFiles.Should().BeEmpty($"Following files cannot be found inside directory {_dirInfo.FullName} {nl} {string.Join(nl, missingFiles)}");
103extraFiles.Should().BeEmpty($"Following extra files are found inside directory {_dirInfo.FullName} {nl} {string.Join(nl, extraFiles)}");
110_dirInfo.EnumerateFileSystemInfos().Any().Should().BeFalse($"The directory {_dirInfo.FullName} is not empty.");
117_dirInfo.EnumerateFileSystemInfos().Any().Should().BeTrue($"The directory {_dirInfo.FullName} is empty.");
124_dirInfo.Exists.Should().BeFalse($"Expected directory {_dirInfo.FullName} to not exist, but it does.");
138subDirectories.Any().Should().BeFalse($"Directory {_dirInfo.FullName} should not have any sub directories.");
143.Select(f => f.FullName.Substring(_dirInfo.FullName.Length + 1) // make relative to _dirInfo
149errorSubDirectories.Should().BeEmpty($"The following subdirectories should not be found inside directory {_dirInfo.FullName} {nl} {string.Join(nl, errorSubDirectories)}");
Microsoft.NET.ToolPack.Tests (5)
Microsoft.TemplateEngine.Cli (2)
Microsoft.VisualBasic.Core (6)
Microsoft.VisualBasic.Tests (3)
MSBuildTaskHost (3)
PresentationCore (1)
PresentationUI (1)
Replay (1)
ResultsOfTGenerator (2)
Roslyn.Compilers.Extension (1)
RulesetToEditorconfigConverter.UnitTests (4)
sdk-tasks (2)
ServerComparison.FunctionalTests (2)
StaticFilesAuth (4)
System.CodeDom (1)
System.CommandLine.StaticCompletions.Tests (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)