57 references to PathUtility
dotnet (23)
CommandFactory\CommandResolution\PackagedCommandSpecFactory.cs (1)
87PathUtility.GetPathWithDirectorySeparator(runtimeAssembly.Path));
Commands\New\DotnetCommandCallbacks.cs (6)
18PathUtility.EnsureAllPathsExist([projectPath], CliStrings.CommonFileNotFound, allowDirectories: false); 30PathUtility.EnsureAllPathsExist([projectPath], CliStrings.CommonFileNotFound, allowDirectories: false); 31PathUtility.EnsureAllPathsExist([projectToAdd], CliStrings.CommonFileNotFound, allowDirectories: false); 39PathUtility.EnsureAllPathsExist([pathToRestore], CliStrings.CommonFileNotFound, allowDirectories: true); 46PathUtility.EnsureAllPathsExist([solutionPath], CliStrings.CommonFileNotFound, allowDirectories: false); 47PathUtility.EnsureAllPathsExist(projectsToAdd, CliStrings.CommonFileNotFound, allowDirectories: false);
Commands\Project\Convert\ProjectConvertCommand.cs (1)
114string entryPointFileDirectory = PathUtility.EnsureTrailingSlash(Path.GetDirectoryName(file)!);
Commands\Reference\Add\ReferenceAddCommand.cs (1)
33PathUtility.EnsureAllPathsExist(arguments,
Commands\Run\CSharpCompilerCommand.cs (1)
42private static string SdkPath => field ??= PathUtility.EnsureNoTrailingDirectorySeparator(AppContext.BaseDirectory);
Commands\Solution\Add\SolutionAddCommand.cs (2)
30return "/" + string.Join("/", PathUtility.GetPathWithDirectorySeparator(path).Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)) + "/"; 59PathUtility.EnsureAllPathsExist(_projects, CliStrings.CouldNotFindProjectOrDirectory, true);
Commands\Test\MTP\MSBuildHandler.cs (3)
30path = PathUtility.GetFullPath(pathOptions.ProjectPath); 38path = PathUtility.GetFullPath(pathOptions.SolutionPath); 46path = PathUtility.GetFullPath(Directory.GetCurrentDirectory());
Commands\Test\MTP\SolutionAndProjectUtility.cs (1)
346return new TestModule(runProperties, PathUtility.FixFilePath(projectFullPath), targetFramework, isTestingPlatformApplication, launchSettings, project.GetPropertyValue(ProjectProperties.TargetPath), rootVariableName);
Commands\Tool\Search\ToolSearchCommand.cs (1)
23if (!PathUtility.CheckForNuGetInNuGetConfig())
Commands\Workload\Install\FileBasedInstaller.cs (3)
20using PathUtility = Microsoft.DotNet.Cli.Utils.PathUtility; 739PathUtility.DeleteFileAndEmptyParents(path, maxDirectoriesToDelete: 2); 790PathUtility.DeleteFileAndEmptyParents(installationRecordPath, maxDirectoriesToDelete: 3);
CommonOptions.cs (1)
238public static Lazy<string> NormalizedCurrentDirectory = new(() => PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
MsbuildProject.cs (2)
35ProjectDirectory = PathUtility.EnsureTrailingSlash(ProjectRootElement.DirectoryPath); 120foreach (var @ref in refs.Select((r) => PathUtility.GetPathWithBackSlashes(r)))
dotnet.Tests (16)
CommandTests\Package\Remove\GivenDotnetRemovePackage.cs (2)
18<PROJECT | FILE> The project file or C# file-based app to operate on. If a file is not specified, the command will search the current directory for a project file. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}] 32<PROJECT | FILE> The project file or C# file-based app to operate on. If a file is not specified, the command will search the current directory for a project file. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}]
CommandTests\Reference\Add\AddReferenceParserTests.cs (1)
29PathUtility.EnsureTrailingSlash(Directory.GetCurrentDirectory()));
CommandTests\Reference\List\GivenDotnetListReference.cs (2)
19<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}] 31<PROJECT | SOLUTION> The project or solution file to operate on. If a file is not specified, the command will search the current directory for one. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}]
CommandTests\Reference\Remove\GivenDotnetRemoveP2P.cs (2)
20<PROJECT | FILE> The project file or C# file-based app to operate on. If a file is not specified, the command will search the current directory for a project file. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}] 34<PROJECT | FILE> The project file or C# file-based app to operate on. If a file is not specified, the command will search the current directory for a project file. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}]
CommandTests\Run\RunFileTests.cs (1)
2462return PathUtility.GetPathWithForwardSlashes(TestPathUtility.ResolveTempPrefixLink(path));
CommandTests\Solution\Add\GivenDotnetSlnAdd.cs (1)
34<SLN_FILE> The solution file to operate on. If not specified, the command will search the current directory for one. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}]
CommandTests\Solution\List\GivenDotnetSlnList.cs (1)
18<SLN_FILE> The solution file to operate on. If not specified, the command will search the current directory for one. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}]
CommandTests\Solution\Remove\GivenDotnetSlnRemove.cs (1)
20<SLN_FILE> The solution file to operate on. If not specified, the command will search the current directory for one. [default: {PathUtility.EnsureTrailingSlash(defaultVal)}]
CommandTests\Test\GivenDotnetTestBuildsAndRunsHelp.cs (1)
57string directorySeparator = PathUtility.GetDirectorySeparatorChar();
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs (4)
57string? versionsPropsPath = PathUtility.FindFileInParentDirectories(TestContext.Current.TestExecutionDirectory, $"eng{Path.DirectorySeparatorChar}Version.Details.props") ?? throw new FileNotFoundException("Version.Details.props file not found."); 59testInstance.UpdateProjectFileWithMSTestPackageVersion(Path.Combine($@"{testInstance.Path}{PathUtility.GetDirectorySeparatorChar()}TestProject", "TestProject.csproj"), msTestVersion); 67string pattern = $@"In\sprocess\sfile\sartifacts\sproduced:\s+.*{PathUtility.GetDirectorySeparatorChar()}TestResults{PathUtility.GetDirectorySeparatorChar()}.*\.coverage";
Microsoft.DotNet.Cli.Utils (2)
Extensions\LockFileExtensions.cs (1)
28PathUtility.EnsureNoTrailingDirectorySeparator(p.Path));
Extensions\MSBuildProjectExtensions.cs (1)
130return PathUtility.GetPathWithBackSlashes(include.ToLower());
Microsoft.DotNet.Cli.Utils.Tests (9)
PathUtilityTests.cs (9)
14Assert.Equal(@"bar\", PathUtility.GetRelativePath(@"C:\foo\", @"C:\foo\bar\")); 15Assert.Equal(@"Bar\Baz\", PathUtility.GetRelativePath(@"c:\foo\", @"C:\Foo\Bar\Baz\")); 16Assert.Equal(@"baz\Qux\", PathUtility.GetRelativePath(@"C:\fOO\bar\", @"c:\foo\BAR\baz\Qux\")); 17Assert.Equal(@"d:\foo\", PathUtility.GetRelativePath(@"C:\foo\", @"d:\foo\")); 25PathUtility.GetRelativePath( 35PathUtility.GetRelativePath( 41PathUtility.GetRelativePath( 52Assert.Equal(@"c:\foo\bar\baz\", PathUtility.RemoveExtraPathSeparators(@"c:\\\foo\\\\bar\baz\\")); 53Assert.Equal(@"D:\QUX\", PathUtility.RemoveExtraPathSeparators(@"D:\\\\\QUX\"));
Microsoft.NET.TestFramework (5)
Utilities\RegexPatternHelper.cs (5)
15$"{runtime}{PathUtility.GetDirectorySeparatorChar()}" : 19return $@".+{configuration}{PathUtility.GetDirectorySeparatorChar()}{version}{PathUtility.GetDirectorySeparatorChar()}{runtimeIdentifier}{projectName}(\.dll|\.exe)?\s+\({version}\|[a-zA-Z]+[1-9]+\)\s{result}{exitCodePattern}"; 25string pattern = $@"{prefix}.*{configuration}{PathUtility.GetDirectorySeparatorChar()}{version}{PathUtility.GetDirectorySeparatorChar()}{projectName}(\.dll|\.exe)?";
Microsoft.TemplateEngine.Cli (2)
NuGet\NugetApiManager.cs (1)
37if (sourceFeed == null && DotNet.Cli.Utils.PathUtility.CheckForNuGetInNuGetConfig())
TemplatePackageCoordinator.cs (1)
447IEnumerable<PackageSource> packageSources = LoadNuGetSources(additionalSources, includeNuGetFeed: PathUtility.CheckForNuGetInNuGetConfig());