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