1836 references to FullName
aspire (178)
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 (31)
183cliArgsList.Add(projectFile.FullName);
253false => [watchOrRunCommand, nonInteractiveSwitch, verboseSwitch, noBuildSwitch, noProfileSwitch, "--project", projectFile.FullName, "--", .. args],
254true => ["run", noProfileSwitch, "--file", projectFile.FullName, "--", .. args]
504WorkingDirectory = workingDirectory.FullName,
558projectFile.FullName,
733string[] cliArgs = ["build", projectFilePath.FullName];
763cliArgsList.AddRange(["package", "--file", projectFilePath.FullName]);
769cliArgsList.AddRange([projectFilePath.FullName, "package"]);
788logger.LogInformation("Adding package {PackageName} with version {PackageVersion} to project {ProjectFilePath}", packageName, packageVersion, projectFilePath.FullName);
801logger.LogError("Failed to add package {PackageName} with version {PackageVersion} to project {ProjectFilePath}. See debug logs for more details.", packageName, packageVersion, projectFilePath.FullName);
805logger.LogInformation("Package {PackageName} with version {PackageVersion} added to project {ProjectFilePath}", packageName, packageVersion, projectFilePath.FullName);
815string[] cliArgs = ["sln", solutionFile.FullName, "add", projectFile.FullName];
817logger.LogInformation("Adding project {ProjectFilePath} to solution {SolutionFilePath}", projectFile.FullName, solutionFile.FullName);
830logger.LogError("Failed to add project {ProjectFilePath} to solution {SolutionFilePath}. See debug logs for more details.", projectFile.FullName, solutionFile.FullName);
834logger.LogInformation("Project {ProjectFilePath} added to solution {SolutionFilePath}", projectFile.FullName, solutionFile.FullName);
877: Path.Combine(workingDirectory.FullName, configPath);
966cliArgs.Add(nugetConfigFile.FullName);
1084string[] cliArgs = ["sln", solutionFile.FullName, "list"];
1138: Path.Combine(solutionFile.Directory!.FullName, line);
1150string[] cliArgs = ["add", projectFile.FullName, "reference", referencedProject.FullName];
1152logger.LogInformation("Adding project reference from {ProjectFile} to {ReferencedProject}", projectFile.FullName, referencedProject.FullName);
1165logger.LogError("Failed to add project reference from {ProjectFile} to {ReferencedProject}. See debug logs for more details.", projectFile.FullName, referencedProject.FullName);
1169logger.LogInformation("Project reference added from {ProjectFile} to {ReferencedProject}", projectFile.FullName, referencedProject.FullName);
Projects\ProjectLocator.cs (60)
40logger.LogDebug("Searching for project files in {SearchDirectory}", searchDirectory.FullName);
51logger.LogDebug("Found {ProjectFileCount} project files in {SearchDirectory}", projectFiles.Length, searchDirectory.FullName);
61logger.LogDebug("Checking project file {ProjectFile}", projectFile.FullName);
66logger.LogDebug("Found AppHost project file {ProjectFile} in {SearchDirectory}", projectFile.FullName, searchDirectory.FullName);
67var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName);
76var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName);
82logger.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);
120appHostProjects.Sort((x, y) => x.FullName.CompareTo(y.FullName));
177var settingsFile = new FileInfo(ConfigurationHelper.BuildPathToSettingsJsonFile(searchDirectory.FullName));
187var qualifiedAppHostPath = Path.IsPathRooted(appHostPath) ? appHostPath : Path.Combine(settingsFile.Directory!.FullName, appHostPath);
197interactionService.DisplayMessage("warning", string.Format(CultureInfo.CurrentCulture, ErrorStrings.AppHostWasSpecifiedButDoesntExist, settingsFile.FullName, qualifiedAppHostPath));
221if (Directory.Exists(projectFile.FullName))
223logger.LogDebug("Provided path {Path} is a directory, searching for project files recursively", projectFile.FullName);
224var directory = new DirectoryInfo(projectFile.FullName);
239logger.LogDebug("Found {ProjectFileCount} project files in {Directory}", allProjectFiles.Length, directory.FullName);
253logger.LogDebug("Checking project file {ProjectFile}", candidateProject.FullName);
258logger.LogDebug("Found AppHost project file {ProjectFile}", candidateProject.FullName);
259var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateProject.FullName);
276logger.LogDebug("Checking single-file apphost candidate {CandidateFile}", candidateFile.FullName);
280logger.LogDebug("Found valid single-file apphost {AppHostFile}", candidateFile.FullName);
281var relativePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, candidateFile.FullName);
292foundProjects.Sort((x, y) => x.FullName.CompareTo(y.FullName));
301logger.LogError("No AppHost project files found in directory {Directory}", directory.FullName);
306logger.LogDebug("Found single AppHost project file {ProjectFile} in directory {Directory}", appHostProjects[0].FullName, directory.FullName);
311logger.LogDebug("Multiple AppHost project files found in directory {Directory}, prompting user to select", directory.FullName);
315file => $"{file.Name} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, file.FullName)})",
324logger.LogError("Project file {ProjectFile} does not exist.", projectFile.FullName);
335logger.LogDebug("Using single-file apphost {ProjectFile}", projectFile.FullName);
351logger.LogDebug("Using project file {ProjectFile}", projectFile.FullName);
393projectFile => $"{projectFile.Name} ({Path.GetRelativePath(executionContext.WorkingDirectory.FullName, projectFile.FullName)})",
404var settingsFilePath = ConfigurationHelper.BuildPathToSettingsJsonFile(executionContext.WorkingDirectory.FullName);
407logger.LogDebug("Creating settings file at {SettingsFilePath}", settingsFile.FullName);
409var relativePathToProjectFile = Path.GetRelativePath(settingsFile.Directory!.FullName, projectFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
414var relativeSettingsFilePath = Path.GetRelativePath(executionContext.WorkingDirectory.FullName, settingsFile.FullName).Replace(Path.DirectorySeparatorChar, '/');
446logger.LogDebug("Checking project file {ProjectFile} for OutputType", projectFile.FullName);
465logger.LogDebug("Found executable project file {ProjectFile} with OutputType {OutputType}", projectFile.FullName, outputType);
477executableProjects.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(System.Globalization.CultureInfo.InvariantCulture, UpdateCommandStrings.FailedFetchItemsAndPropertiesFormat, projectFile.FullName));
205logger.LogWarning("Falling back to XML 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(System.Globalization.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(System.Globalization.CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindRootProjectElementFormat, projectFile.FullName));
305throw new ProjectUpdaterException(string.Format(System.Globalization.CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindSdkElementFormat, projectFile.FullName));
310projectDocument.Save(projectFile.FullName);
317var fileContent = await File.ReadAllTextAsync(projectFile.FullName);
325"Could not find '#:sdk Aspire.AppHost.Sdk@<version>' directive in single-file AppHost: {0}", projectFile.FullName));
332await File.WriteAllTextAsync(projectFile.FullName, updatedContent);
340if (!context.VisitedProjects.Add(projectFile.FullName))
363context.AnalyzeSteps.Enqueue(new AnalyzeStep(string.Format(System.Globalization.CultureInfo.InvariantCulture, UpdateCommandStrings.AnalyzeProjectFormat, referencedProjectFile.FullName), () => AnalyzeProjectAsync(referencedProjectFile, context, cancellationToken)));
417var directoryPackagesPropsPath = Path.Combine(current.FullName, "Directory.Packages.props");
480doc.Load(directoryPackagesPropsFile.FullName);
524logger.LogInformation(ex, "Ignoring parsing error in Directory.Packages.props '{DirectoryPackagesPropsFile}' for project '{ProjectFile}'", directoryPackagesPropsFile.FullName, projectFile.FullName);
565logger.LogWarning(ex, "Exception while resolving MSBuild property '{PropertyName}' for project '{ProjectFile}'", propertyName, projectFile.FullName);
586doc.Load(directoryPackagesPropsFile.FullName);
591throw new ProjectUpdaterException(string.Format(System.Globalization.CultureInfo.InvariantCulture, UpdateCommandStrings.CouldNotFindPackageVersionInDirectoryPackagesProps, packageId, directoryPackagesPropsFile.FullName));
595doc.Save(directoryPackagesPropsFile.FullName);
612throw new ProjectUpdaterException(string.Format(System.Globalization.CultureInfo.InvariantCulture, UpdateCommandStrings.FailedUpdatePackageReferenceFormat, package.Id, projectFile.FullName));
Aspire.Cli.Tests (515)
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)
426var appHostDirectoryPath = Path.Combine(workspace.WorkspaceRoot.FullName, "src", "MyApp.AppHost");
428var appHostProjectPath = Path.Combine(appHostDirectory.FullName, "MyApp.AppHost.csproj");
430File.WriteAllText(appHostProjectFile.FullName, "<Project></Project>");
772var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
773await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
828var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
829await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
880var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
881await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
936var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
937await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
987var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
988await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
1039var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1040await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
1091var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1092await 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");
599Assert.Contains(appHostFile.FullName, args);
607var filePathIndex = Array.IndexOf(args, appHostFile.FullName);
634var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
635await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
659Assert.Contains(projectFile.FullName, args);
668var projectIndex = Array.IndexOf(args, projectFile.FullName);
703var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
704await File.WriteAllTextAsync(projectFile.FullName, "<Project></Project>");
728Assert.Contains(projectFile.FullName, args);
736var projectIndex = Array.IndexOf(args, projectFile.FullName);
776var solutionFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Test.sln"));
777await File.WriteAllTextAsync(solutionFile.FullName, "Not a real solution file.");
781var project1File = new FileInfo(Path.Combine(project1Dir.FullName, "Project1.csproj"));
782await File.WriteAllTextAsync(project1File.FullName, "Not a real project file.");
785var project2File = new FileInfo(Path.Combine(project2Dir.FullName, "Project2.csproj"));
786await File.WriteAllTextAsync(project2File.FullName, "Not a real project file.");
832var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
833await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
835var referencedProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "Service.csproj"));
836await File.WriteAllTextAsync(referencedProject.FullName, "Not a real project file.");
858Assert.Contains(projectFile.FullName, args);
860Assert.Contains(referencedProject.FullName, args);
874var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
875await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
907arg => Assert.Equal(appHostFile.FullName, arg),
932var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
933await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
964arg => Assert.Equal(appHostFile.FullName, arg),
989var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
990await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
1043var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1044await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
1081arg => Assert.Equal(appHostFile.FullName, arg),
1106var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1107await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
1139arg => Assert.Equal(projectFile.FullName, arg),
1164var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1165await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
1196arg => Assert.Equal(projectFile.FullName, arg),
1221var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
1222await File.WriteAllTextAsync(appHostFile.FullName, "// Single-file AppHost");
1266var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
1267await 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\ProjectLocatorTests.cs (182)
25var cacheDirectory = new DirectoryInfo(Path.Combine(workingDirectory.FullName, ".aspire", "cache"));
36var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
59var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
60await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
63var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
64await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
67var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
72appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
84Assert.Equal(targetAppHostProjectFile.FullName, foundAppHost?.FullName);
98var targetAppHostProjectFile = new FileInfo(Path.Combine(targetAppHostDirectory.FullName, "TargetAppHost.csproj"));
99await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
102var otherAppHostProjectFile = new FileInfo(Path.Combine(otherAppHostDirectory.FullName, "OtherAppHost.csproj"));
103await File.WriteAllTextAsync(targetAppHostProjectFile.FullName, "Not a real apphost");
106var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
111appHostPath = Path.GetRelativePath(aspireSettingsFile.Directory!.FullName, targetAppHostProjectFile.FullName)
123Assert.Equal(targetAppHostProjectFile.FullName, foundAppHost?.FullName);
134var realAppHostProjectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "RealAppHost.csproj"));
135await File.WriteAllTextAsync(realAppHostProjectFile.FullName, "Not a real apphost project");
139var aspireSettingsFile = new FileInfo(Path.Combine(workspaceSettingsDirectory.FullName, "settings.json"));
150if (projectFile.FullName == realAppHostProjectFile.FullName)
168Assert.Equal(realAppHostProjectFile.FullName, foundAppHost?.FullName);
177var projectFile1 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost1.csproj"));
178await File.WriteAllTextAsync(projectFile1.FullName, "Not a real project file.");
180var projectFile2 = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost2.csproj"));
181await File.WriteAllTextAsync(projectFile2.FullName, "Not a real project file.");
191Assert.Equal(projectFile1.FullName, selectedProjectFile!.FullName);
200var appHostProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
201await File.WriteAllTextAsync(appHostProject.FullName, "Not a real apphost project.");
203var webProject = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "WebProject.csproj"));
204await File.WriteAllTextAsync(webProject.FullName, "Not a real web project.");
208if (projectFile.FullName == appHostProject.FullName)
224Assert.Equal(appHostProject.FullName, foundAppHost?.FullName);
252var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
253await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
271var projectFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
272await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
282Assert.Equal(projectFile.FullName, returnedProjectFile!.FullName);
293var appHostProjectFile = new FileInfo(Path.Combine(appHostDirectory.FullName, "AppHost.csproj"));
294await File.WriteAllTextAsync(appHostProjectFile.FullName, "Not a real project file.");
305var globalSettingsFilePath = Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.global.json");
316var settingsFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, ".aspire", "settings.json"));
319var settingsJson = await File.ReadAllTextAsync(settingsFile.FullName);
334var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
336appHostFile.FullName,
350var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
353Assert.Equal(appHostFile.FullName, foundFiles[0].FullName);
362var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
364appHostFile.FullName,
378var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
381Assert.Equal(appHostFile.FullName, foundFiles[0].FullName);
392var appHostFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "apphost.cs"));
394appHostFile.FullName,
402var csprojFile = new FileInfo(Path.Combine(dirWithBoth.FullName, "RegularProject.csproj"));
403await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
407var validAppHostFile = new FileInfo(Path.Combine(dirWithOnlyAppHost.FullName, "apphost.cs"));
409validAppHostFile.FullName,
424var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
431var foundPaths = foundFiles.Select(f => f.FullName).ToHashSet();
432Assert.Contains(validAppHostFile.FullName, foundPaths);
433Assert.Contains(csprojFile.FullName, foundPaths);
434Assert.DoesNotContain(appHostFile.FullName, foundPaths);
443var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
444await File.WriteAllTextAsync(appHostFile.FullName, @"using Aspire.Hosting;
454var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
467var csprojFile = new FileInfo(Path.Combine(subDir1.FullName, "AppHost.csproj"));
468await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
472var appHostFile = new FileInfo(Path.Combine(subDir2.FullName, "apphost.cs"));
474appHostFile.FullName,
485if (projectFile.FullName == csprojFile.FullName)
499var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
503Assert.True(foundFiles[0].FullName.CompareTo(foundFiles[1].FullName) < 0);
505var foundPaths = foundFiles.Select(f => f.FullName).ToHashSet();
506Assert.Contains(csprojFile.FullName, foundPaths);
507Assert.Contains(appHostFile.FullName, foundPaths);
515var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
517appHostFile.FullName,
533Assert.Equal(appHostFile.FullName, result!.FullName);
543var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
544await File.WriteAllTextAsync(appHostFile.FullName, @"using Aspire.Hosting;
568var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
570appHostFile.FullName,
579var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "SomeProject.csproj"));
580await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
602var txtFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "readme.txt"));
603await File.WriteAllTextAsync(txtFile.FullName, "Some text file");
626var csprojFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "AppHost.csproj"));
627await File.WriteAllTextAsync(csprojFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"></Project>");
631var appHostFile = new FileInfo(Path.Combine(subDir.FullName, "apphost.cs"));
633appHostFile.FullName,
644if (projectFile.FullName == csprojFile.FullName)
664Assert.True(result.FullName == csprojFile.FullName || result.FullName == appHostFile.FullName);
736var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
738appHostFile.FullName,
754var foundFiles = await projectLocator.FindAppHostProjectFilesAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
766var appHostFile = new FileInfo(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.cs"));
768appHostFile.FullName,
797var projectFile = new FileInfo(Path.Combine(projectDirectory.FullName, "MyAppHost.csproj"));
798await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
803if (file.FullName == projectFile.FullName)
816var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
819Assert.Equal(projectFile.FullName, returnedProjectFile!.FullName);
838var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
856var projectFile1 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project1.csproj"));
857await File.WriteAllTextAsync(projectFile1.FullName, "Not a real project file.");
858var projectFile2 = new FileInfo(Path.Combine(projectDirectory.FullName, "Project2.csproj"));
859await File.WriteAllTextAsync(projectFile2.FullName, "Not a real project file.");
865if (file.FullName == projectFile1.FullName || file.FullName == projectFile2.FullName)
878var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
883Assert.Equal(projectFile1.FullName, returnedProjectFile!.FullName);
894var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs"));
896appHostFile.FullName,
912var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
915Assert.Equal(appHostFile.FullName, returnedProjectFile!.FullName);
926var appHostFile = new FileInfo(Path.Combine(projectDirectory.FullName, "apphost.cs"));
928appHostFile.FullName,
945var directoryAsFileInfo = new FileInfo(projectDirectory.FullName);
964var projectFile = new FileInfo(Path.Combine(subDirectory.FullName, "Mongo.AppHost.csproj"));
965await File.WriteAllTextAsync(projectFile.FullName, "Not a real project file.");
970if (file.FullName == projectFile.FullName)
983var directoryAsFileInfo = new FileInfo(topDirectory.FullName);
986Assert.Equal(projectFile.FullName, returnedProjectFile!.FullName);
998var exeProjectFile = new FileInfo(Path.Combine(exeProjectDir.FullName, "ExeProject.csproj"));
999await File.WriteAllTextAsync(exeProjectFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>");
1003var libProjectFile = new FileInfo(Path.Combine(libProjectDir.FullName, "LibProject.csproj"));
1004await File.WriteAllTextAsync(libProjectFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Library</OutputType></PropertyGroup></Project>");
1010var outputType = projectFile.FullName == exeProjectFile.FullName ? "Exe" : "Library";
1024var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1027Assert.Equal(exeProjectFile.FullName, executableProjects[0].FullName);
1039var winExeProjectFile = new FileInfo(Path.Combine(winExeProjectDir.FullName, "WinExeProject.csproj"));
1040await File.WriteAllTextAsync(winExeProjectFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>WinExe</OutputType></PropertyGroup></Project>");
1059var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1062Assert.Equal(winExeProjectFile.FullName, executableProjects[0].FullName);
1074var lib1File = new FileInfo(Path.Combine(lib1Dir.FullName, "Lib1.csproj"));
1075await File.WriteAllTextAsync(lib1File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Library</OutputType></PropertyGroup></Project>");
1078var lib2File = new FileInfo(Path.Combine(lib2Dir.FullName, "Lib2.csproj"));
1079await File.WriteAllTextAsync(lib2File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Library</OutputType></PropertyGroup></Project>");
1098var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1116var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1130var exe1File = new FileInfo(Path.Combine(exe1Dir.FullName, "Exe1.csproj"));
1131await File.WriteAllTextAsync(exe1File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>");
1134var exe2File = new FileInfo(Path.Combine(exe2Dir.FullName, "Exe2.csproj"));
1135await File.WriteAllTextAsync(exe2File.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>Exe</OutputType></PropertyGroup></Project>");
1138var winExeFile = new FileInfo(Path.Combine(winExeDir.FullName, "WinExe.csproj"));
1139await File.WriteAllTextAsync(winExeFile.FullName, "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><OutputType>WinExe</OutputType></PropertyGroup></Project>");
1165var executableProjects = await projectLocator.FindExecutableProjectsAsync(workspace.WorkspaceRoot.FullName, CancellationToken.None);
1168Assert.Contains(executableProjects, p => p.FullName == exe1File.FullName);
1169Assert.Contains(executableProjects, p => p.FullName == exe2File.FullName);
1170Assert.Contains(executableProjects, p => p.FullName == winExeFile.FullName);
Projects\ProjectUpdaterTests.cs (139)
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,
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 (6)
Aspire.Hosting.Azure (4)
Aspire.Hosting.Azure.Tests (27)
AzureEnvironmentResourceTests.cs (14)
21output.WriteLine($"Temp directory: {tempDir.FullName}");
22using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, publisher: "default", outputPath: tempDir.FullName);
34var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
38var envBicepPath = Path.Combine(tempDir.FullName, "env", "env.bicep");
53output.WriteLine($"Temp directory: {tempDir.FullName}");
54using var builder = TestDistributedApplicationBuilder.Create(DistributedApplicationOperation.Publish, publisher: "default", outputPath: tempDir.FullName);
71var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
85output.WriteLine($"Temp directory: {tempDir.FullName}");
88outputPath: tempDir.FullName);
123var mainBicepPath = Path.Combine(tempDir.FullName, "main.bicep");
134output.WriteLine($"Temp directory: {tempDir.FullName}");
137outputPath: tempDir.FullName);
172var mainBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "main.bicep"));
173var storageBicep = File.ReadAllText(Path.Combine(tempDir.FullName, "storage", "storage.bicep"));
Aspire.Hosting.Containers.Tests (3)
Aspire.Hosting.Docker.Tests (6)
Aspire.Hosting.Kubernetes.Tests (5)
Aspire.Hosting.MySql.Tests (1)
Aspire.Hosting.Nats.Tests (1)
Aspire.Hosting.NodeJs.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)
dotnet (33)
CommandFactory\CommandResolution\DotnetToolsCommandResolver.cs (1)
45dll.FullName,
dotnet.Tests (38)
CommandTests\Run\RunFileTests.cs (10)
1673var programFile = Path.Join(subDir.FullName, "Program.cs");
1679var publishDir = Path.Join(subDir.FullName, "artifacts");
1729new DotnetCommand(Log, "tool", "exec", "MyFileBasedTool", "--yes", "--add-source", packageDir.FullName)
2398Log.WriteLine($"Skipping code generation because file does not exist: {nonGeneratedFile.FullName}");
2403var existingText = codeFilePath.Exists ? File.ReadAllText(codeFilePath.FullName) : string.Empty;
2407Log.WriteLine($"{codeFilePath.FullName} needs to be updated:");
2411throw new InvalidOperationException($"Not updating file in CI: {codeFilePath.FullName}");
2415File.WriteAllText(codeFilePath.FullName, newText);
2416throw new InvalidOperationException($"File outdated, commit the changes: {codeFilePath.FullName}");
3644.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.BuildCheck.UnitTests (2)
Microsoft.Build.CommandLine.UnitTests (3)
Microsoft.Build.Engine.OM.UnitTests (8)
Microsoft.Build.Engine.UnitTests (8)
Microsoft.Build.Framework.UnitTests (1)
Microsoft.Build.Tasks.CodeAnalysis (2)
Microsoft.Build.Tasks.CodeAnalysis.Sdk (2)
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 (7)
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 (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.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.Tests (145)
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)
MSBuild (5)
MSBuildTaskHost (3)
PresentationCore (1)
PresentationUI (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)